- Added a new worker script to handle extraction of embedded attachments from PDF files. - Created TypeScript definitions for the message structure and response types. - Updated the main extraction logic to utilize the worker for improved performance and responsiveness. - Integrated the extraction feature into the UI, allowing users to extract attachments as a ZIP file. - Enhanced error handling and user feedback during the extraction process.
19 lines
532 B
TypeScript
19 lines
532 B
TypeScript
declare const coherentpdf: typeof import('../../src/types/coherentpdf.global').coherentpdf;
|
|
|
|
interface ExtractAttachmentsMessage {
|
|
command: 'extract-attachments';
|
|
fileBuffers: ArrayBuffer[];
|
|
fileNames: string[];
|
|
}
|
|
|
|
interface ExtractAttachmentSuccessResponse {
|
|
status: 'success';
|
|
attachments: Array<{ name: string; data: ArrayBuffer }>;
|
|
}
|
|
|
|
interface ExtractAttachmentErrorResponse {
|
|
status: 'error';
|
|
message: string;
|
|
}
|
|
|
|
type ExtractAttachmentResponse = ExtractAttachmentSuccessResponse | ExtractAttachmentErrorResponse; |