@oxog/printkit 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,272 @@
1
+ type PageSizeName = 'A3' | 'A4' | 'A5' | 'Letter' | 'Legal' | 'Tabloid';
2
+ interface CustomSize {
3
+ width: number | string;
4
+ height: number | string;
5
+ }
6
+ type PageSize = PageSizeName | CustomSize;
7
+ type Orientation = 'portrait' | 'landscape';
8
+ interface MarginOptions {
9
+ top?: number | string | undefined;
10
+ right?: number | string | undefined;
11
+ bottom?: number | string | undefined;
12
+ left?: number | string | undefined;
13
+ }
14
+ interface PageInfo {
15
+ pageNumber: number;
16
+ totalPages: number;
17
+ title: string;
18
+ date: Date;
19
+ }
20
+ type HeaderFooterFn = (info: PageInfo) => string;
21
+ interface PrintOptions {
22
+ title?: string | undefined;
23
+ pageSize?: PageSize | undefined;
24
+ orientation?: Orientation | undefined;
25
+ margin?: number | string | MarginOptions | undefined;
26
+ header?: string | HeaderFooterFn | undefined;
27
+ footer?: string | HeaderFooterFn | undefined;
28
+ styles?: string | string[] | undefined;
29
+ styleSheets?: string[] | undefined;
30
+ copyStyles?: boolean | undefined;
31
+ pageBreakBefore?: string | undefined;
32
+ pageBreakAfter?: string | undefined;
33
+ avoidBreakInside?: string | undefined;
34
+ removeAfterPrint?: boolean | undefined;
35
+ printBackground?: boolean | undefined;
36
+ onBeforePrint?: (() => void | Promise<void>) | undefined;
37
+ onAfterPrint?: (() => void) | undefined;
38
+ onError?: ((error: PrintError$1) => void) | undefined;
39
+ }
40
+ type PrintTarget = HTMLElement | string | HTMLElement[] | string[];
41
+ interface Printer {
42
+ print(target: PrintTarget, options?: PrintOptions): Promise<void>;
43
+ printHTML(html: string, options?: PrintOptions): Promise<void>;
44
+ printURL(url: string, options?: PrintOptions): Promise<void>;
45
+ printImage(src: string | HTMLImageElement, options?: PrintOptions | undefined): Promise<void>;
46
+ printImages(sources: (string | HTMLImageElement)[], options?: PrintOptions | undefined): Promise<void>;
47
+ printJSON(data: unknown, options?: PrintJSONOptions): Promise<void>;
48
+ printTable(data: TableData, options?: PrintTableOptions): Promise<void>;
49
+ setDefaultOptions(options: PrintOptions): void;
50
+ getDefaultOptions(): PrintOptions;
51
+ destroy(): void;
52
+ }
53
+ interface PreviewOptions extends PrintOptions {
54
+ modal?: ModalOptions | undefined;
55
+ toolbar?: ToolbarOptions | undefined;
56
+ onPrint?: (() => void) | undefined;
57
+ onDownload?: (() => void) | undefined;
58
+ onClose?: (() => void) | undefined;
59
+ }
60
+ interface ModalOptions {
61
+ width?: string | number | undefined;
62
+ height?: string | number | undefined;
63
+ showToolbar?: boolean | undefined;
64
+ showPageNumbers?: boolean | undefined;
65
+ zoom?: number | undefined;
66
+ className?: string | undefined;
67
+ }
68
+ interface ToolbarOptions {
69
+ print?: boolean | undefined;
70
+ download?: boolean | undefined;
71
+ zoom?: boolean | undefined;
72
+ navigation?: boolean | undefined;
73
+ close?: boolean | undefined;
74
+ }
75
+ interface PrintPreview {
76
+ open(): void;
77
+ close(): void;
78
+ print(): Promise<void>;
79
+ download(filename?: string): Promise<void>;
80
+ setZoom(level: number): void;
81
+ getZoom(): number;
82
+ zoomIn(): void;
83
+ zoomOut(): void;
84
+ resetZoom(): void;
85
+ nextPage(): void;
86
+ prevPage(): void;
87
+ goToPage(page: number): void;
88
+ getCurrentPage(): number;
89
+ getTotalPages(): number;
90
+ isOpen(): boolean;
91
+ destroy(): void;
92
+ }
93
+ interface PDFOptions extends PrintOptions {
94
+ quality?: number | undefined;
95
+ scale?: number | undefined;
96
+ metadata?: PDFMetadata | undefined;
97
+ onProgress?: ((progress: number) => void) | undefined;
98
+ }
99
+ interface PDFMetadata {
100
+ title?: string | undefined;
101
+ author?: string | undefined;
102
+ subject?: string | undefined;
103
+ keywords?: string[] | undefined;
104
+ creator?: string | undefined;
105
+ creationDate?: Date | undefined;
106
+ }
107
+ interface PDFExporter {
108
+ toBlob(target: PrintTarget, options?: PDFOptions): Promise<Blob>;
109
+ toBase64(target: PrintTarget, options?: PDFOptions): Promise<string>;
110
+ toDataURL(target: PrintTarget, options?: PDFOptions): Promise<string>;
111
+ download(target: PrintTarget, filename: string, options?: PDFOptions | undefined): Promise<void>;
112
+ downloadHTML(html: string, filename: string, options?: PDFOptions | undefined): Promise<void>;
113
+ }
114
+ type JobPriority = 'low' | 'normal' | 'high';
115
+ type JobStatus = 'pending' | 'printing' | 'completed' | 'failed';
116
+ interface PrintJob {
117
+ id: string;
118
+ content: PrintTarget;
119
+ options?: PrintOptions | undefined;
120
+ priority?: JobPriority | undefined;
121
+ /** Number of automatic retries after a failed attempt (default 0) */
122
+ retries?: number | undefined;
123
+ /** Number of attempts made so far */
124
+ attempts?: number | undefined;
125
+ status: JobStatus;
126
+ error?: Error | undefined;
127
+ createdAt: Date;
128
+ completedAt?: Date | undefined;
129
+ }
130
+ type NewPrintJob = Omit<PrintJob, 'id' | 'status' | 'createdAt' | 'attempts'>;
131
+ type QueueEvent = 'jobStart' | 'jobComplete' | 'jobError' | 'queueComplete' | 'queuePause' | 'queueResume';
132
+ type QueueEventHandler<E extends QueueEvent> = E extends 'jobError' ? (job: PrintJob, error: Error) => void : E extends 'jobStart' | 'jobComplete' ? (job: PrintJob) => void : () => void;
133
+ interface PrintQueue {
134
+ add(job: NewPrintJob): string;
135
+ remove(jobId: string): boolean;
136
+ /** Puts a failed job back in the queue; returns false if it is not a failed job */
137
+ retry(jobId: string): boolean;
138
+ clear(): void;
139
+ getJob(jobId: string): PrintJob | undefined;
140
+ getJobs(): PrintJob[];
141
+ getPendingJobs(): PrintJob[];
142
+ printNext(): Promise<void>;
143
+ printAll(): Promise<void>;
144
+ pause(): void;
145
+ resume(): void;
146
+ on<E extends QueueEvent>(event: E, handler: QueueEventHandler<E>): () => void;
147
+ off<E extends QueueEvent>(event: E, handler: QueueEventHandler<E>): void;
148
+ destroy(): void;
149
+ }
150
+ interface TableData {
151
+ headers: string[];
152
+ rows: (string | number)[][];
153
+ caption?: string | undefined;
154
+ }
155
+ interface PrintTableOptions extends PrintOptions {
156
+ tableStyles?: string | undefined;
157
+ headerStyles?: string | undefined;
158
+ cellStyles?: string | undefined;
159
+ stripedRows?: boolean | undefined;
160
+ bordered?: boolean | undefined;
161
+ }
162
+ interface PrintJSONOptions extends PrintOptions {
163
+ indent?: number | undefined;
164
+ syntaxHighlight?: boolean | undefined;
165
+ collapsible?: boolean | undefined;
166
+ }
167
+ interface FormatOptions {
168
+ removeScripts?: boolean | undefined;
169
+ removeInputs?: boolean | undefined;
170
+ inlineStyles?: boolean | undefined;
171
+ removeHidden?: boolean | undefined;
172
+ }
173
+ interface PageOptions {
174
+ pageSize?: PageSize | undefined;
175
+ margin?: number | string | MarginOptions | undefined;
176
+ orientation?: Orientation | undefined;
177
+ }
178
+ type PrintErrorCode = 'PRINT_NOT_SUPPORTED' | 'ELEMENT_NOT_FOUND' | 'IFRAME_LOAD_FAILED' | 'PDF_EXPORT_FAILED' | 'STYLE_LOAD_FAILED' | 'CANCELLED' | 'UNKNOWN';
179
+ interface PrintError$1 extends Error {
180
+ code: PrintErrorCode;
181
+ target?: PrintTarget | undefined;
182
+ }
183
+ interface Dimensions {
184
+ width: string;
185
+ height: string;
186
+ }
187
+ interface PrintDocument {
188
+ content: string;
189
+ styles: string;
190
+ header?: string | undefined;
191
+ footer?: string | undefined;
192
+ pageSize: Dimensions;
193
+ margins: Required<MarginOptions>;
194
+ title: string;
195
+ }
196
+
197
+ /**
198
+ * CSS class to hide elements when printing
199
+ */
200
+ declare const PRINT_HIDE_CLASS = "print-hide";
201
+ /**
202
+ * CSS class to show elements only when printing
203
+ */
204
+ declare const PRINT_ONLY_CLASS = "print-only";
205
+ /**
206
+ * Default print styles
207
+ */
208
+ declare function getDefaultPrintStyles(): string;
209
+ /**
210
+ * Builds base document styles
211
+ */
212
+ declare function getBaseDocumentStyles(): string;
213
+ /**
214
+ * Combines all default styles
215
+ */
216
+ declare function getAllDefaultStyles(): string;
217
+
218
+ /**
219
+ * CSS class for page break before
220
+ */
221
+ declare const BREAK_BEFORE_CLASS = "print-break-before";
222
+ /**
223
+ * CSS class for page break after
224
+ */
225
+ declare const BREAK_AFTER_CLASS = "print-break-after";
226
+ /**
227
+ * CSS class to avoid break inside
228
+ */
229
+ declare const AVOID_BREAK_CLASS = "print-avoid-break";
230
+ /**
231
+ * Creates a page break element
232
+ */
233
+ declare function pageBreak(): HTMLDivElement;
234
+ /**
235
+ * Marks an element to avoid page breaks inside
236
+ */
237
+ declare function avoidBreak(element: HTMLElement): void;
238
+ /**
239
+ * Marks an element to break before
240
+ */
241
+ declare function breakBefore(element: HTMLElement): void;
242
+ /**
243
+ * Marks an element to break after
244
+ */
245
+ declare function breakAfter(element: HTMLElement): void;
246
+ /**
247
+ * Calculates estimated page count based on content height
248
+ */
249
+ declare function calculatePages(contentHeight: number, pageHeight: number, marginTop?: number, marginBottom?: number): number;
250
+
251
+ /**
252
+ * Custom error class for print operations
253
+ */
254
+ declare class PrintError extends Error implements PrintError$1 {
255
+ readonly code: PrintErrorCode;
256
+ readonly target: PrintTarget | undefined;
257
+ constructor(code: PrintErrorCode, message: string, target?: PrintTarget | undefined);
258
+ }
259
+ /**
260
+ * Creates a PrintError with the appropriate message
261
+ */
262
+ declare function createPrintError(code: PrintErrorCode, details?: string, target?: PrintTarget): PrintError;
263
+ /**
264
+ * Type guard to check if an error is a PrintError
265
+ */
266
+ declare function isPrintError(error: unknown): error is PrintError;
267
+ /**
268
+ * Wraps an unknown error as a PrintError
269
+ */
270
+ declare function wrapError(error: unknown, target?: PrintTarget): PrintError;
271
+
272
+ export { AVOID_BREAK_CLASS as A, BREAK_BEFORE_CLASS as B, type CustomSize as C, type Dimensions as D, type PDFMetadata as E, type PrintJob as F, type JobStatus as G, type HeaderFooterFn as H, type QueueEventHandler as I, type JobPriority as J, type TableData as K, type PrintTableOptions as L, type MarginOptions as M, type NewPrintJob as N, type Orientation as O, type PrintOptions as P, type QueueEvent as Q, type PrintJSONOptions as R, type FormatOptions as S, type ToolbarOptions as T, type PageOptions as U, type PrintErrorCode as V, type PrintError$1 as W, type PrintDocument as X, type Printer as a, type PrintTarget as b, type PreviewOptions as c, type PrintPreview as d, type PDFExporter as e, type PrintQueue as f, type PageSize as g, type PageSizeName as h, type PageInfo as i, getDefaultPrintStyles as j, getBaseDocumentStyles as k, getAllDefaultStyles as l, calculatePages as m, avoidBreak as n, breakBefore as o, pageBreak as p, breakAfter as q, PRINT_HIDE_CLASS as r, PRINT_ONLY_CLASS as s, BREAK_AFTER_CLASS as t, PrintError as u, createPrintError as v, isPrintError as w, wrapError as x, type ModalOptions as y, type PDFOptions as z };
@@ -0,0 +1,272 @@
1
+ type PageSizeName = 'A3' | 'A4' | 'A5' | 'Letter' | 'Legal' | 'Tabloid';
2
+ interface CustomSize {
3
+ width: number | string;
4
+ height: number | string;
5
+ }
6
+ type PageSize = PageSizeName | CustomSize;
7
+ type Orientation = 'portrait' | 'landscape';
8
+ interface MarginOptions {
9
+ top?: number | string | undefined;
10
+ right?: number | string | undefined;
11
+ bottom?: number | string | undefined;
12
+ left?: number | string | undefined;
13
+ }
14
+ interface PageInfo {
15
+ pageNumber: number;
16
+ totalPages: number;
17
+ title: string;
18
+ date: Date;
19
+ }
20
+ type HeaderFooterFn = (info: PageInfo) => string;
21
+ interface PrintOptions {
22
+ title?: string | undefined;
23
+ pageSize?: PageSize | undefined;
24
+ orientation?: Orientation | undefined;
25
+ margin?: number | string | MarginOptions | undefined;
26
+ header?: string | HeaderFooterFn | undefined;
27
+ footer?: string | HeaderFooterFn | undefined;
28
+ styles?: string | string[] | undefined;
29
+ styleSheets?: string[] | undefined;
30
+ copyStyles?: boolean | undefined;
31
+ pageBreakBefore?: string | undefined;
32
+ pageBreakAfter?: string | undefined;
33
+ avoidBreakInside?: string | undefined;
34
+ removeAfterPrint?: boolean | undefined;
35
+ printBackground?: boolean | undefined;
36
+ onBeforePrint?: (() => void | Promise<void>) | undefined;
37
+ onAfterPrint?: (() => void) | undefined;
38
+ onError?: ((error: PrintError$1) => void) | undefined;
39
+ }
40
+ type PrintTarget = HTMLElement | string | HTMLElement[] | string[];
41
+ interface Printer {
42
+ print(target: PrintTarget, options?: PrintOptions): Promise<void>;
43
+ printHTML(html: string, options?: PrintOptions): Promise<void>;
44
+ printURL(url: string, options?: PrintOptions): Promise<void>;
45
+ printImage(src: string | HTMLImageElement, options?: PrintOptions | undefined): Promise<void>;
46
+ printImages(sources: (string | HTMLImageElement)[], options?: PrintOptions | undefined): Promise<void>;
47
+ printJSON(data: unknown, options?: PrintJSONOptions): Promise<void>;
48
+ printTable(data: TableData, options?: PrintTableOptions): Promise<void>;
49
+ setDefaultOptions(options: PrintOptions): void;
50
+ getDefaultOptions(): PrintOptions;
51
+ destroy(): void;
52
+ }
53
+ interface PreviewOptions extends PrintOptions {
54
+ modal?: ModalOptions | undefined;
55
+ toolbar?: ToolbarOptions | undefined;
56
+ onPrint?: (() => void) | undefined;
57
+ onDownload?: (() => void) | undefined;
58
+ onClose?: (() => void) | undefined;
59
+ }
60
+ interface ModalOptions {
61
+ width?: string | number | undefined;
62
+ height?: string | number | undefined;
63
+ showToolbar?: boolean | undefined;
64
+ showPageNumbers?: boolean | undefined;
65
+ zoom?: number | undefined;
66
+ className?: string | undefined;
67
+ }
68
+ interface ToolbarOptions {
69
+ print?: boolean | undefined;
70
+ download?: boolean | undefined;
71
+ zoom?: boolean | undefined;
72
+ navigation?: boolean | undefined;
73
+ close?: boolean | undefined;
74
+ }
75
+ interface PrintPreview {
76
+ open(): void;
77
+ close(): void;
78
+ print(): Promise<void>;
79
+ download(filename?: string): Promise<void>;
80
+ setZoom(level: number): void;
81
+ getZoom(): number;
82
+ zoomIn(): void;
83
+ zoomOut(): void;
84
+ resetZoom(): void;
85
+ nextPage(): void;
86
+ prevPage(): void;
87
+ goToPage(page: number): void;
88
+ getCurrentPage(): number;
89
+ getTotalPages(): number;
90
+ isOpen(): boolean;
91
+ destroy(): void;
92
+ }
93
+ interface PDFOptions extends PrintOptions {
94
+ quality?: number | undefined;
95
+ scale?: number | undefined;
96
+ metadata?: PDFMetadata | undefined;
97
+ onProgress?: ((progress: number) => void) | undefined;
98
+ }
99
+ interface PDFMetadata {
100
+ title?: string | undefined;
101
+ author?: string | undefined;
102
+ subject?: string | undefined;
103
+ keywords?: string[] | undefined;
104
+ creator?: string | undefined;
105
+ creationDate?: Date | undefined;
106
+ }
107
+ interface PDFExporter {
108
+ toBlob(target: PrintTarget, options?: PDFOptions): Promise<Blob>;
109
+ toBase64(target: PrintTarget, options?: PDFOptions): Promise<string>;
110
+ toDataURL(target: PrintTarget, options?: PDFOptions): Promise<string>;
111
+ download(target: PrintTarget, filename: string, options?: PDFOptions | undefined): Promise<void>;
112
+ downloadHTML(html: string, filename: string, options?: PDFOptions | undefined): Promise<void>;
113
+ }
114
+ type JobPriority = 'low' | 'normal' | 'high';
115
+ type JobStatus = 'pending' | 'printing' | 'completed' | 'failed';
116
+ interface PrintJob {
117
+ id: string;
118
+ content: PrintTarget;
119
+ options?: PrintOptions | undefined;
120
+ priority?: JobPriority | undefined;
121
+ /** Number of automatic retries after a failed attempt (default 0) */
122
+ retries?: number | undefined;
123
+ /** Number of attempts made so far */
124
+ attempts?: number | undefined;
125
+ status: JobStatus;
126
+ error?: Error | undefined;
127
+ createdAt: Date;
128
+ completedAt?: Date | undefined;
129
+ }
130
+ type NewPrintJob = Omit<PrintJob, 'id' | 'status' | 'createdAt' | 'attempts'>;
131
+ type QueueEvent = 'jobStart' | 'jobComplete' | 'jobError' | 'queueComplete' | 'queuePause' | 'queueResume';
132
+ type QueueEventHandler<E extends QueueEvent> = E extends 'jobError' ? (job: PrintJob, error: Error) => void : E extends 'jobStart' | 'jobComplete' ? (job: PrintJob) => void : () => void;
133
+ interface PrintQueue {
134
+ add(job: NewPrintJob): string;
135
+ remove(jobId: string): boolean;
136
+ /** Puts a failed job back in the queue; returns false if it is not a failed job */
137
+ retry(jobId: string): boolean;
138
+ clear(): void;
139
+ getJob(jobId: string): PrintJob | undefined;
140
+ getJobs(): PrintJob[];
141
+ getPendingJobs(): PrintJob[];
142
+ printNext(): Promise<void>;
143
+ printAll(): Promise<void>;
144
+ pause(): void;
145
+ resume(): void;
146
+ on<E extends QueueEvent>(event: E, handler: QueueEventHandler<E>): () => void;
147
+ off<E extends QueueEvent>(event: E, handler: QueueEventHandler<E>): void;
148
+ destroy(): void;
149
+ }
150
+ interface TableData {
151
+ headers: string[];
152
+ rows: (string | number)[][];
153
+ caption?: string | undefined;
154
+ }
155
+ interface PrintTableOptions extends PrintOptions {
156
+ tableStyles?: string | undefined;
157
+ headerStyles?: string | undefined;
158
+ cellStyles?: string | undefined;
159
+ stripedRows?: boolean | undefined;
160
+ bordered?: boolean | undefined;
161
+ }
162
+ interface PrintJSONOptions extends PrintOptions {
163
+ indent?: number | undefined;
164
+ syntaxHighlight?: boolean | undefined;
165
+ collapsible?: boolean | undefined;
166
+ }
167
+ interface FormatOptions {
168
+ removeScripts?: boolean | undefined;
169
+ removeInputs?: boolean | undefined;
170
+ inlineStyles?: boolean | undefined;
171
+ removeHidden?: boolean | undefined;
172
+ }
173
+ interface PageOptions {
174
+ pageSize?: PageSize | undefined;
175
+ margin?: number | string | MarginOptions | undefined;
176
+ orientation?: Orientation | undefined;
177
+ }
178
+ type PrintErrorCode = 'PRINT_NOT_SUPPORTED' | 'ELEMENT_NOT_FOUND' | 'IFRAME_LOAD_FAILED' | 'PDF_EXPORT_FAILED' | 'STYLE_LOAD_FAILED' | 'CANCELLED' | 'UNKNOWN';
179
+ interface PrintError$1 extends Error {
180
+ code: PrintErrorCode;
181
+ target?: PrintTarget | undefined;
182
+ }
183
+ interface Dimensions {
184
+ width: string;
185
+ height: string;
186
+ }
187
+ interface PrintDocument {
188
+ content: string;
189
+ styles: string;
190
+ header?: string | undefined;
191
+ footer?: string | undefined;
192
+ pageSize: Dimensions;
193
+ margins: Required<MarginOptions>;
194
+ title: string;
195
+ }
196
+
197
+ /**
198
+ * CSS class to hide elements when printing
199
+ */
200
+ declare const PRINT_HIDE_CLASS = "print-hide";
201
+ /**
202
+ * CSS class to show elements only when printing
203
+ */
204
+ declare const PRINT_ONLY_CLASS = "print-only";
205
+ /**
206
+ * Default print styles
207
+ */
208
+ declare function getDefaultPrintStyles(): string;
209
+ /**
210
+ * Builds base document styles
211
+ */
212
+ declare function getBaseDocumentStyles(): string;
213
+ /**
214
+ * Combines all default styles
215
+ */
216
+ declare function getAllDefaultStyles(): string;
217
+
218
+ /**
219
+ * CSS class for page break before
220
+ */
221
+ declare const BREAK_BEFORE_CLASS = "print-break-before";
222
+ /**
223
+ * CSS class for page break after
224
+ */
225
+ declare const BREAK_AFTER_CLASS = "print-break-after";
226
+ /**
227
+ * CSS class to avoid break inside
228
+ */
229
+ declare const AVOID_BREAK_CLASS = "print-avoid-break";
230
+ /**
231
+ * Creates a page break element
232
+ */
233
+ declare function pageBreak(): HTMLDivElement;
234
+ /**
235
+ * Marks an element to avoid page breaks inside
236
+ */
237
+ declare function avoidBreak(element: HTMLElement): void;
238
+ /**
239
+ * Marks an element to break before
240
+ */
241
+ declare function breakBefore(element: HTMLElement): void;
242
+ /**
243
+ * Marks an element to break after
244
+ */
245
+ declare function breakAfter(element: HTMLElement): void;
246
+ /**
247
+ * Calculates estimated page count based on content height
248
+ */
249
+ declare function calculatePages(contentHeight: number, pageHeight: number, marginTop?: number, marginBottom?: number): number;
250
+
251
+ /**
252
+ * Custom error class for print operations
253
+ */
254
+ declare class PrintError extends Error implements PrintError$1 {
255
+ readonly code: PrintErrorCode;
256
+ readonly target: PrintTarget | undefined;
257
+ constructor(code: PrintErrorCode, message: string, target?: PrintTarget | undefined);
258
+ }
259
+ /**
260
+ * Creates a PrintError with the appropriate message
261
+ */
262
+ declare function createPrintError(code: PrintErrorCode, details?: string, target?: PrintTarget): PrintError;
263
+ /**
264
+ * Type guard to check if an error is a PrintError
265
+ */
266
+ declare function isPrintError(error: unknown): error is PrintError;
267
+ /**
268
+ * Wraps an unknown error as a PrintError
269
+ */
270
+ declare function wrapError(error: unknown, target?: PrintTarget): PrintError;
271
+
272
+ export { AVOID_BREAK_CLASS as A, BREAK_BEFORE_CLASS as B, type CustomSize as C, type Dimensions as D, type PDFMetadata as E, type PrintJob as F, type JobStatus as G, type HeaderFooterFn as H, type QueueEventHandler as I, type JobPriority as J, type TableData as K, type PrintTableOptions as L, type MarginOptions as M, type NewPrintJob as N, type Orientation as O, type PrintOptions as P, type QueueEvent as Q, type PrintJSONOptions as R, type FormatOptions as S, type ToolbarOptions as T, type PageOptions as U, type PrintErrorCode as V, type PrintError$1 as W, type PrintDocument as X, type Printer as a, type PrintTarget as b, type PreviewOptions as c, type PrintPreview as d, type PDFExporter as e, type PrintQueue as f, type PageSize as g, type PageSizeName as h, type PageInfo as i, getDefaultPrintStyles as j, getBaseDocumentStyles as k, getAllDefaultStyles as l, calculatePages as m, avoidBreak as n, breakBefore as o, pageBreak as p, breakAfter as q, PRINT_HIDE_CLASS as r, PRINT_ONLY_CLASS as s, BREAK_AFTER_CLASS as t, PrintError as u, createPrintError as v, isPrintError as w, wrapError as x, type ModalOptions as y, type PDFOptions as z };