av6-pdf-engine 1.0.6 → 1.0.8
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.
- package/dist/index.d.mts +25 -1
- package/dist/index.d.ts +25 -1
- package/dist/index.js +11 -2
- package/dist/index.mjs +7 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -315,4 +315,28 @@ declare enum PdfEngineErrorCode {
|
|
|
315
315
|
declare function renderCustomPdf(def: CustomDocDefinition, outputPath: string): Promise<void>;
|
|
316
316
|
declare function renderCustomPdfToBuffer(def: CustomDocDefinition): Promise<Buffer>;
|
|
317
317
|
|
|
318
|
-
|
|
318
|
+
declare class PdfEngineError extends Error {
|
|
319
|
+
readonly code: PdfEngineErrorCode;
|
|
320
|
+
readonly statusCode: number;
|
|
321
|
+
readonly details?: Record<string, unknown>;
|
|
322
|
+
readonly retryable: boolean;
|
|
323
|
+
cause?: unknown;
|
|
324
|
+
constructor(args: {
|
|
325
|
+
code: PdfEngineErrorCode;
|
|
326
|
+
message: string;
|
|
327
|
+
statusCode?: number;
|
|
328
|
+
details?: Record<string, unknown>;
|
|
329
|
+
retryable?: boolean;
|
|
330
|
+
cause?: unknown;
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
declare function isPdfEngineError(e: unknown): e is PdfEngineError;
|
|
334
|
+
declare function toPdfEngineError(cause: unknown, fallback: {
|
|
335
|
+
code: PdfEngineErrorCode;
|
|
336
|
+
message: string;
|
|
337
|
+
statusCode?: number;
|
|
338
|
+
details?: Record<string, unknown>;
|
|
339
|
+
retryable?: boolean;
|
|
340
|
+
}): PdfEngineError;
|
|
341
|
+
|
|
342
|
+
export { type Alignment, BARCODE_TYPES, type BarcodeBlock, type BarcodeType, type BaseBlock, type Block, type BuiltInFont, type ColumnsBlock, type CustomDocDefinition, type FontName, type FontRegistration, type FooterDef, type FooterInput, type HeaderDef, type ImageBlock, type InlineTextStyle, type KeyValueGridBlock, type KeyValueItem, type LineBlock, type Orientation, type PDFDoc, type PageBackgroundDef, type PageBreakBlock, type PageContext, type PageMargins, PdfEngineError, PdfEngineErrorCode, type QRErrorLevel, QR_ERROR_LEVEL, type QrCodeBlock, type RenderEnv, type SignatureBlock, type StyleDef, type StyleRef, type TableBlock, type TableCell, type TextBlock, type WatermarkDef, type WatermarkMode, type Width, isPdfEngineError, renderCustomPdf, renderCustomPdfToBuffer, toPdfEngineError };
|
package/dist/index.d.ts
CHANGED
|
@@ -315,4 +315,28 @@ declare enum PdfEngineErrorCode {
|
|
|
315
315
|
declare function renderCustomPdf(def: CustomDocDefinition, outputPath: string): Promise<void>;
|
|
316
316
|
declare function renderCustomPdfToBuffer(def: CustomDocDefinition): Promise<Buffer>;
|
|
317
317
|
|
|
318
|
-
|
|
318
|
+
declare class PdfEngineError extends Error {
|
|
319
|
+
readonly code: PdfEngineErrorCode;
|
|
320
|
+
readonly statusCode: number;
|
|
321
|
+
readonly details?: Record<string, unknown>;
|
|
322
|
+
readonly retryable: boolean;
|
|
323
|
+
cause?: unknown;
|
|
324
|
+
constructor(args: {
|
|
325
|
+
code: PdfEngineErrorCode;
|
|
326
|
+
message: string;
|
|
327
|
+
statusCode?: number;
|
|
328
|
+
details?: Record<string, unknown>;
|
|
329
|
+
retryable?: boolean;
|
|
330
|
+
cause?: unknown;
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
declare function isPdfEngineError(e: unknown): e is PdfEngineError;
|
|
334
|
+
declare function toPdfEngineError(cause: unknown, fallback: {
|
|
335
|
+
code: PdfEngineErrorCode;
|
|
336
|
+
message: string;
|
|
337
|
+
statusCode?: number;
|
|
338
|
+
details?: Record<string, unknown>;
|
|
339
|
+
retryable?: boolean;
|
|
340
|
+
}): PdfEngineError;
|
|
341
|
+
|
|
342
|
+
export { type Alignment, BARCODE_TYPES, type BarcodeBlock, type BarcodeType, type BaseBlock, type Block, type BuiltInFont, type ColumnsBlock, type CustomDocDefinition, type FontName, type FontRegistration, type FooterDef, type FooterInput, type HeaderDef, type ImageBlock, type InlineTextStyle, type KeyValueGridBlock, type KeyValueItem, type LineBlock, type Orientation, type PDFDoc, type PageBackgroundDef, type PageBreakBlock, type PageContext, type PageMargins, PdfEngineError, PdfEngineErrorCode, type QRErrorLevel, QR_ERROR_LEVEL, type QrCodeBlock, type RenderEnv, type SignatureBlock, type StyleDef, type StyleRef, type TableBlock, type TableCell, type TextBlock, type WatermarkDef, type WatermarkMode, type Width, isPdfEngineError, renderCustomPdf, renderCustomPdfToBuffer, toPdfEngineError };
|
package/dist/index.js
CHANGED
|
@@ -31,10 +31,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
BARCODE_TYPES: () => BARCODE_TYPES,
|
|
34
|
+
PdfEngineError: () => PdfEngineError,
|
|
34
35
|
PdfEngineErrorCode: () => PdfEngineErrorCode,
|
|
35
36
|
QR_ERROR_LEVEL: () => QR_ERROR_LEVEL,
|
|
37
|
+
isPdfEngineError: () => isPdfEngineError,
|
|
36
38
|
renderCustomPdf: () => renderCustomPdf,
|
|
37
|
-
renderCustomPdfToBuffer: () => renderCustomPdfToBuffer
|
|
39
|
+
renderCustomPdfToBuffer: () => renderCustomPdfToBuffer,
|
|
40
|
+
toPdfEngineError: () => toPdfEngineError
|
|
38
41
|
});
|
|
39
42
|
module.exports = __toCommonJS(index_exports);
|
|
40
43
|
|
|
@@ -842,6 +845,9 @@ var PdfEngineError = class extends Error {
|
|
|
842
845
|
this.cause = args.cause;
|
|
843
846
|
}
|
|
844
847
|
};
|
|
848
|
+
function isPdfEngineError(e) {
|
|
849
|
+
return e instanceof PdfEngineError;
|
|
850
|
+
}
|
|
845
851
|
function toPdfEngineError(cause, fallback) {
|
|
846
852
|
if (cause instanceof PdfEngineError) return cause;
|
|
847
853
|
return new PdfEngineError({
|
|
@@ -1963,8 +1969,11 @@ async function renderCustomPdfToBuffer(def) {
|
|
|
1963
1969
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1964
1970
|
0 && (module.exports = {
|
|
1965
1971
|
BARCODE_TYPES,
|
|
1972
|
+
PdfEngineError,
|
|
1966
1973
|
PdfEngineErrorCode,
|
|
1967
1974
|
QR_ERROR_LEVEL,
|
|
1975
|
+
isPdfEngineError,
|
|
1968
1976
|
renderCustomPdf,
|
|
1969
|
-
renderCustomPdfToBuffer
|
|
1977
|
+
renderCustomPdfToBuffer,
|
|
1978
|
+
toPdfEngineError
|
|
1970
1979
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -802,6 +802,9 @@ var PdfEngineError = class extends Error {
|
|
|
802
802
|
this.cause = args.cause;
|
|
803
803
|
}
|
|
804
804
|
};
|
|
805
|
+
function isPdfEngineError(e) {
|
|
806
|
+
return e instanceof PdfEngineError;
|
|
807
|
+
}
|
|
805
808
|
function toPdfEngineError(cause, fallback) {
|
|
806
809
|
if (cause instanceof PdfEngineError) return cause;
|
|
807
810
|
return new PdfEngineError({
|
|
@@ -1922,8 +1925,11 @@ async function renderCustomPdfToBuffer(def) {
|
|
|
1922
1925
|
}
|
|
1923
1926
|
export {
|
|
1924
1927
|
BARCODE_TYPES,
|
|
1928
|
+
PdfEngineError,
|
|
1925
1929
|
PdfEngineErrorCode,
|
|
1926
1930
|
QR_ERROR_LEVEL,
|
|
1931
|
+
isPdfEngineError,
|
|
1927
1932
|
renderCustomPdf,
|
|
1928
|
-
renderCustomPdfToBuffer
|
|
1933
|
+
renderCustomPdfToBuffer,
|
|
1934
|
+
toPdfEngineError
|
|
1929
1935
|
};
|