feat: add JSON to PDF and PDF to JSON conversion tools
- Introduced new pages and logic for converting JSON files to PDF and vice versa. - Implemented web workers for handling conversion processes in the background. - Updated Vite configuration to include new HTML pages for the conversion tools. - Enhanced user interface with file upload sections and status messages for conversion progress. - Added TypeScript definitions for worker communication and response handling.
This commit is contained in:
20
public/workers/json-to-pdf.worker.d.ts
vendored
Normal file
20
public/workers/json-to-pdf.worker.d.ts
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
declare const coherentpdf: typeof import('../../src/types/coherentpdf.global').coherentpdf;
|
||||
|
||||
interface ConvertJSONToPDFMessage {
|
||||
command: 'convert';
|
||||
fileBuffers: ArrayBuffer[];
|
||||
fileNames: string[];
|
||||
}
|
||||
|
||||
interface JSONToPDFSuccessResponse {
|
||||
status: 'success';
|
||||
pdfFiles: Array<{ name: string; data: ArrayBuffer }>;
|
||||
}
|
||||
|
||||
interface JSONToPDFErrorResponse {
|
||||
status: 'error';
|
||||
message: string;
|
||||
}
|
||||
|
||||
type JSONToPDFResponse = JSONToPDFSuccessResponse | JSONToPDFErrorResponse;
|
||||
|
||||
Reference in New Issue
Block a user