@pdfme/common 6.1.13-dev.26 → 6.1.13-dev.31
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/helper.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js.map +1 -1
- package/dist/schema.d.ts +26 -15
- package/dist/types.d.ts +1 -1
- package/package.json +3 -2
package/dist/schema.d.ts
CHANGED
|
@@ -182,6 +182,17 @@ export declare const SchemaForUI: z.ZodObject<{
|
|
|
182
182
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
183
183
|
id: z.ZodString;
|
|
184
184
|
}, z.core.$strip>;
|
|
185
|
+
/**
|
|
186
|
+
* PDF / font bytes with a definite ArrayBuffer backing store.
|
|
187
|
+
*
|
|
188
|
+
* Printed by name in declaration emit so published .d.ts stays valid on
|
|
189
|
+
* TypeScript ≤5.6, where Uint8Array is not generic. A generic typed-array
|
|
190
|
+
* annotation poisons `z.infer` unions such as `Template['basePdf']` on
|
|
191
|
+
* those compilers (see #1021).
|
|
192
|
+
*/
|
|
193
|
+
export interface PdfBytes extends Uint8Array {
|
|
194
|
+
readonly buffer: ArrayBuffer;
|
|
195
|
+
}
|
|
185
196
|
export declare const BlankPdf: z.ZodObject<{
|
|
186
197
|
width: z.ZodNumber;
|
|
187
198
|
height: z.ZodNumber;
|
|
@@ -208,8 +219,8 @@ export declare const BlankPdf: z.ZodObject<{
|
|
|
208
219
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
209
220
|
}, z.core.$loose>>>;
|
|
210
221
|
}, z.core.$strip>;
|
|
211
|
-
export declare const CustomPdf: z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<
|
|
212
|
-
export declare const BasePdf: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<
|
|
222
|
+
export declare const CustomPdf: z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<PdfBytes, unknown, z.core.$ZodTypeInternals<PdfBytes, unknown>>]>;
|
|
223
|
+
export declare const BasePdf: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<PdfBytes, unknown, z.core.$ZodTypeInternals<PdfBytes, unknown>>]>, z.ZodObject<{
|
|
213
224
|
width: z.ZodNumber;
|
|
214
225
|
height: z.ZodNumber;
|
|
215
226
|
padding: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
|
|
@@ -299,7 +310,7 @@ export declare const Template: z.ZodObject<{
|
|
|
299
310
|
}, z.core.$strip>>;
|
|
300
311
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
301
312
|
}, z.core.$loose>>>;
|
|
302
|
-
basePdf: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<
|
|
313
|
+
basePdf: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<PdfBytes, unknown, z.core.$ZodTypeInternals<PdfBytes, unknown>>]>, z.ZodObject<{
|
|
303
314
|
width: z.ZodNumber;
|
|
304
315
|
height: z.ZodNumber;
|
|
305
316
|
padding: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
|
|
@@ -329,7 +340,7 @@ export declare const Template: z.ZodObject<{
|
|
|
329
340
|
}, z.core.$loose>;
|
|
330
341
|
export declare const Inputs: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
331
342
|
export declare const Font: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
332
|
-
data: z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<
|
|
343
|
+
data: z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<PdfBytes, unknown, z.core.$ZodTypeInternals<PdfBytes, unknown>>]>;
|
|
333
344
|
fallback: z.ZodOptional<z.ZodBoolean>;
|
|
334
345
|
subset: z.ZodOptional<z.ZodBoolean>;
|
|
335
346
|
}, z.core.$strip>>;
|
|
@@ -365,14 +376,14 @@ export declare const Plugin: z.ZodObject<{
|
|
|
365
376
|
}, z.core.$loose>;
|
|
366
377
|
export declare const CommonOptions: z.ZodObject<{
|
|
367
378
|
font: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
368
|
-
data: z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<
|
|
379
|
+
data: z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<PdfBytes, unknown, z.core.$ZodTypeInternals<PdfBytes, unknown>>]>;
|
|
369
380
|
fallback: z.ZodOptional<z.ZodBoolean>;
|
|
370
381
|
subset: z.ZodOptional<z.ZodBoolean>;
|
|
371
382
|
}, z.core.$strip>>>;
|
|
372
383
|
}, z.core.$loose>;
|
|
373
384
|
export declare const GeneratorOptions: z.ZodObject<{
|
|
374
385
|
font: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
375
|
-
data: z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<
|
|
386
|
+
data: z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<PdfBytes, unknown, z.core.$ZodTypeInternals<PdfBytes, unknown>>]>;
|
|
376
387
|
fallback: z.ZodOptional<z.ZodBoolean>;
|
|
377
388
|
subset: z.ZodOptional<z.ZodBoolean>;
|
|
378
389
|
}, z.core.$strip>>>;
|
|
@@ -428,7 +439,7 @@ export declare const GenerateProps: z.ZodObject<{
|
|
|
428
439
|
}, z.core.$strip>>;
|
|
429
440
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
430
441
|
}, z.core.$loose>>>;
|
|
431
|
-
basePdf: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<
|
|
442
|
+
basePdf: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<PdfBytes, unknown, z.core.$ZodTypeInternals<PdfBytes, unknown>>]>, z.ZodObject<{
|
|
432
443
|
width: z.ZodNumber;
|
|
433
444
|
height: z.ZodNumber;
|
|
434
445
|
padding: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
|
|
@@ -489,7 +500,7 @@ export declare const GenerateProps: z.ZodObject<{
|
|
|
489
500
|
inputs: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
490
501
|
options: z.ZodOptional<z.ZodObject<{
|
|
491
502
|
font: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
492
|
-
data: z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<
|
|
503
|
+
data: z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<PdfBytes, unknown, z.core.$ZodTypeInternals<PdfBytes, unknown>>]>;
|
|
493
504
|
fallback: z.ZodOptional<z.ZodBoolean>;
|
|
494
505
|
subset: z.ZodOptional<z.ZodBoolean>;
|
|
495
506
|
}, z.core.$strip>>>;
|
|
@@ -525,7 +536,7 @@ export declare const GenerateProps: z.ZodObject<{
|
|
|
525
536
|
}, z.core.$strict>;
|
|
526
537
|
export declare const UIOptions: z.ZodObject<{
|
|
527
538
|
font: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
528
|
-
data: z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<
|
|
539
|
+
data: z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<PdfBytes, unknown, z.core.$ZodTypeInternals<PdfBytes, unknown>>]>;
|
|
529
540
|
fallback: z.ZodOptional<z.ZodBoolean>;
|
|
530
541
|
subset: z.ZodOptional<z.ZodBoolean>;
|
|
531
542
|
}, z.core.$strip>>>;
|
|
@@ -575,7 +586,7 @@ export declare const UIProps: z.ZodObject<{
|
|
|
575
586
|
}, z.core.$strip>>;
|
|
576
587
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
577
588
|
}, z.core.$loose>>>;
|
|
578
|
-
basePdf: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<
|
|
589
|
+
basePdf: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<PdfBytes, unknown, z.core.$ZodTypeInternals<PdfBytes, unknown>>]>, z.ZodObject<{
|
|
579
590
|
width: z.ZodNumber;
|
|
580
591
|
height: z.ZodNumber;
|
|
581
592
|
padding: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
|
|
@@ -636,7 +647,7 @@ export declare const UIProps: z.ZodObject<{
|
|
|
636
647
|
domContainer: z.ZodSchema<HTMLElement, unknown, z.core.$ZodTypeInternals<HTMLElement, unknown>>;
|
|
637
648
|
options: z.ZodOptional<z.ZodObject<{
|
|
638
649
|
font: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
639
|
-
data: z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<
|
|
650
|
+
data: z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<PdfBytes, unknown, z.core.$ZodTypeInternals<PdfBytes, unknown>>]>;
|
|
640
651
|
fallback: z.ZodOptional<z.ZodBoolean>;
|
|
641
652
|
subset: z.ZodOptional<z.ZodBoolean>;
|
|
642
653
|
}, z.core.$strip>>>;
|
|
@@ -687,7 +698,7 @@ export declare const PreviewProps: z.ZodObject<{
|
|
|
687
698
|
}, z.core.$strip>>;
|
|
688
699
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
689
700
|
}, z.core.$loose>>>;
|
|
690
|
-
basePdf: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<
|
|
701
|
+
basePdf: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<PdfBytes, unknown, z.core.$ZodTypeInternals<PdfBytes, unknown>>]>, z.ZodObject<{
|
|
691
702
|
width: z.ZodNumber;
|
|
692
703
|
height: z.ZodNumber;
|
|
693
704
|
padding: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
|
|
@@ -748,7 +759,7 @@ export declare const PreviewProps: z.ZodObject<{
|
|
|
748
759
|
domContainer: z.ZodSchema<HTMLElement, unknown, z.core.$ZodTypeInternals<HTMLElement, unknown>>;
|
|
749
760
|
options: z.ZodOptional<z.ZodObject<{
|
|
750
761
|
font: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
751
|
-
data: z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<
|
|
762
|
+
data: z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<PdfBytes, unknown, z.core.$ZodTypeInternals<PdfBytes, unknown>>]>;
|
|
752
763
|
fallback: z.ZodOptional<z.ZodBoolean>;
|
|
753
764
|
subset: z.ZodOptional<z.ZodBoolean>;
|
|
754
765
|
}, z.core.$strip>>>;
|
|
@@ -800,7 +811,7 @@ export declare const DesignerProps: z.ZodObject<{
|
|
|
800
811
|
}, z.core.$strip>>;
|
|
801
812
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
802
813
|
}, z.core.$loose>>>;
|
|
803
|
-
basePdf: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<
|
|
814
|
+
basePdf: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<PdfBytes, unknown, z.core.$ZodTypeInternals<PdfBytes, unknown>>]>, z.ZodObject<{
|
|
804
815
|
width: z.ZodNumber;
|
|
805
816
|
height: z.ZodNumber;
|
|
806
817
|
padding: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
|
|
@@ -861,7 +872,7 @@ export declare const DesignerProps: z.ZodObject<{
|
|
|
861
872
|
domContainer: z.ZodSchema<HTMLElement, unknown, z.core.$ZodTypeInternals<HTMLElement, unknown>>;
|
|
862
873
|
options: z.ZodOptional<z.ZodObject<{
|
|
863
874
|
font: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
864
|
-
data: z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<
|
|
875
|
+
data: z.ZodUnion<readonly [z.ZodString, z.ZodSchema<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodSchema<PdfBytes, unknown, z.core.$ZodTypeInternals<PdfBytes, unknown>>]>;
|
|
865
876
|
fallback: z.ZodOptional<z.ZodBoolean>;
|
|
866
877
|
subset: z.ZodOptional<z.ZodBoolean>;
|
|
867
878
|
}, z.core.$strip>>>;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { PDFPage, PDFDocument } from '@pdfme/pdf-lib';
|
|
3
3
|
import { Lang, Dict, Mode, Size, DynamicLayoutSplitRange, Schema, Font, SchemaForUI, BasePdf, BlankPdf, CustomPdf, CommonOptions, Template, GeneratorOptions, GenerateProps, UIOptions, UIProps, PreviewProps, DesignerProps, ColorType, LegacySchemaPageArray, SchemaPageArray } from './schema.js';
|
|
4
|
+
export type { PdfBytes } from './schema.js';
|
|
4
5
|
export interface UIOptionsThemeToken {
|
|
5
6
|
colorPrimary?: string;
|
|
6
7
|
colorPrimaryBg?: string;
|
|
@@ -249,4 +250,3 @@ export type DynamicLayoutArgs = {
|
|
|
249
250
|
_cache: Map<string | number, unknown>;
|
|
250
251
|
};
|
|
251
252
|
export type GetDynamicLayout = (value: string, args: DynamicLayoutArgs) => Promise<DynamicLayoutCallbackResult>;
|
|
252
|
-
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pdfme/common",
|
|
3
|
-
"version": "6.1.13-dev.
|
|
3
|
+
"version": "6.1.13-dev.31",
|
|
4
4
|
"description": "TypeScript base PDF generator and React base UI. Open source, developed by the community, and completely free to use under the MIT license!",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pdf",
|
|
@@ -45,7 +45,8 @@
|
|
|
45
45
|
"clean": "rimraf dist",
|
|
46
46
|
"lint": "vp lint -c ../../.oxlintrc.json src",
|
|
47
47
|
"fmt": "vp fmt -c ../../.oxfmtrc.json src --write",
|
|
48
|
-
"test": "vitest run --config ../../vitest.config.ts"
|
|
48
|
+
"test": "vitest run --config ../../vitest.config.ts",
|
|
49
|
+
"test:types:consumer": "node ./scripts/test-types-consumer.mjs"
|
|
49
50
|
},
|
|
50
51
|
"dependencies": {
|
|
51
52
|
"@pdfme/pdf-lib": "*",
|