2025-11-11 12:21:11 +05:30
|
|
|
declare const coherentpdf: typeof import('../../src/types/coherentpdf.global').coherentpdf;
|
|
|
|
|
|
|
|
|
|
interface GetAttachmentsMessage {
|
|
|
|
|
command: 'get-attachments';
|
|
|
|
|
fileBuffer: ArrayBuffer;
|
|
|
|
|
fileName: string;
|
2026-01-27 15:26:11 +05:30
|
|
|
cpdfUrl?: string;
|
2025-11-11 12:21:11 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface EditAttachmentsMessage {
|
|
|
|
|
command: 'edit-attachments';
|
|
|
|
|
fileBuffer: ArrayBuffer;
|
|
|
|
|
fileName: string;
|
|
|
|
|
attachmentsToRemove: number[];
|
2026-01-27 15:26:11 +05:30
|
|
|
cpdfUrl?: string;
|
2025-11-11 12:21:11 +05:30
|
|
|
}
|
|
|
|
|
|
2026-01-27 15:26:11 +05:30
|
|
|
type EditAttachmentsWorkerMessage =
|
|
|
|
|
| GetAttachmentsMessage
|
|
|
|
|
| EditAttachmentsMessage;
|
2025-11-11 12:21:11 +05:30
|
|
|
|
|
|
|
|
interface GetAttachmentsSuccessResponse {
|
|
|
|
|
status: 'success';
|
2026-01-27 15:26:11 +05:30
|
|
|
attachments: Array<{
|
|
|
|
|
index: number;
|
|
|
|
|
name: string;
|
|
|
|
|
page: number;
|
|
|
|
|
data: ArrayBuffer;
|
|
|
|
|
}>;
|
2025-11-11 12:21:11 +05:30
|
|
|
fileName: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface GetAttachmentsErrorResponse {
|
|
|
|
|
status: 'error';
|
|
|
|
|
message: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface EditAttachmentsSuccessResponse {
|
|
|
|
|
status: 'success';
|
|
|
|
|
modifiedPDF: ArrayBuffer;
|
|
|
|
|
fileName: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface EditAttachmentsErrorResponse {
|
|
|
|
|
status: 'error';
|
|
|
|
|
message: string;
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-27 15:26:11 +05:30
|
|
|
type GetAttachmentsResponse =
|
|
|
|
|
| GetAttachmentsSuccessResponse
|
|
|
|
|
| GetAttachmentsErrorResponse;
|
|
|
|
|
type EditAttachmentsResponse =
|
|
|
|
|
| EditAttachmentsSuccessResponse
|
|
|
|
|
| EditAttachmentsErrorResponse;
|
|
|
|
|
type EditAttachmentsWorkerResponse =
|
|
|
|
|
| GetAttachmentsResponse
|
|
|
|
|
| EditAttachmentsResponse;
|