@pdfme/common 6.1.0 → 6.1.1-dev.11
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/dynamicTemplate.d.ts +2 -2
- package/dist/helper.d.ts +30 -0
- package/dist/index.d.ts +8 -4
- package/dist/index.js +430 -194
- package/dist/index.js.map +1 -1
- package/dist/pageSize.d.ts +53 -0
- package/dist/schema.d.ts +61 -21
- package/dist/splitRange.d.ts +5 -0
- package/dist/types.d.ts +25 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export type PageOrientation = 'portrait' | 'landscape';
|
|
2
|
+
export declare const PAGE_SIZE_PRESETS: {
|
|
3
|
+
readonly A3: {
|
|
4
|
+
readonly width: 297;
|
|
5
|
+
readonly height: 420;
|
|
6
|
+
};
|
|
7
|
+
readonly A4: {
|
|
8
|
+
readonly width: 210;
|
|
9
|
+
readonly height: 297;
|
|
10
|
+
};
|
|
11
|
+
readonly A5: {
|
|
12
|
+
readonly width: 148;
|
|
13
|
+
readonly height: 210;
|
|
14
|
+
};
|
|
15
|
+
readonly A6: {
|
|
16
|
+
readonly width: 105;
|
|
17
|
+
readonly height: 148;
|
|
18
|
+
};
|
|
19
|
+
readonly B4: {
|
|
20
|
+
readonly width: 250;
|
|
21
|
+
readonly height: 353;
|
|
22
|
+
};
|
|
23
|
+
readonly B5: {
|
|
24
|
+
readonly width: 176;
|
|
25
|
+
readonly height: 250;
|
|
26
|
+
};
|
|
27
|
+
readonly B6: {
|
|
28
|
+
readonly width: 125;
|
|
29
|
+
readonly height: 176;
|
|
30
|
+
};
|
|
31
|
+
readonly Letter: {
|
|
32
|
+
readonly width: 215.9;
|
|
33
|
+
readonly height: 279.4;
|
|
34
|
+
};
|
|
35
|
+
readonly Legal: {
|
|
36
|
+
readonly width: 215.9;
|
|
37
|
+
readonly height: 355.6;
|
|
38
|
+
};
|
|
39
|
+
readonly Tabloid: {
|
|
40
|
+
readonly width: 279.4;
|
|
41
|
+
readonly height: 431.8;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export type PageSizePreset = keyof typeof PAGE_SIZE_PRESETS;
|
|
45
|
+
export type PageSize = PageSizePreset | {
|
|
46
|
+
width: number;
|
|
47
|
+
height: number;
|
|
48
|
+
};
|
|
49
|
+
export declare const resolvePageSize: (size?: PageSize, orientation?: PageOrientation) => {
|
|
50
|
+
width: number;
|
|
51
|
+
height: number;
|
|
52
|
+
};
|
|
53
|
+
export declare const detectPaperSize: (width: number, height: number, tolerance?: number) => `${PageSizePreset} ${PageOrientation}` | null;
|
package/dist/schema.d.ts
CHANGED
|
@@ -70,6 +70,9 @@ export declare const Dict: z.ZodObject<{
|
|
|
70
70
|
'schemas.text.max': z.ZodString;
|
|
71
71
|
'schemas.text.fit': z.ZodString;
|
|
72
72
|
'schemas.text.dynamicFontSize': z.ZodString;
|
|
73
|
+
'schemas.text.overflow': z.ZodString;
|
|
74
|
+
'schemas.text.overflowVisible': z.ZodString;
|
|
75
|
+
'schemas.text.overflowExpand': z.ZodString;
|
|
73
76
|
'schemas.text.format': z.ZodString;
|
|
74
77
|
'schemas.text.plain': z.ZodString;
|
|
75
78
|
'schemas.text.inlineMarkdown': z.ZodString;
|
|
@@ -100,6 +103,17 @@ export declare const Dict: z.ZodObject<{
|
|
|
100
103
|
'schemas.select.options': z.ZodString;
|
|
101
104
|
'schemas.select.optionPlaceholder': z.ZodString;
|
|
102
105
|
'schemas.radioGroup.groupName': z.ZodString;
|
|
106
|
+
'schemas.list.listStyle': z.ZodString;
|
|
107
|
+
'schemas.list.bullet': z.ZodString;
|
|
108
|
+
'schemas.list.ordered': z.ZodString;
|
|
109
|
+
'schemas.list.markerWidth': z.ZodString;
|
|
110
|
+
'schemas.list.markerGap': z.ZodString;
|
|
111
|
+
'schemas.list.indentSize': z.ZodString;
|
|
112
|
+
'schemas.list.itemSpacing': z.ZodString;
|
|
113
|
+
'schemas.list.addItem': z.ZodString;
|
|
114
|
+
'schemas.list.removeItem': z.ZodString;
|
|
115
|
+
'schemas.list.indentItem': z.ZodString;
|
|
116
|
+
'schemas.list.outdentItem': z.ZodString;
|
|
103
117
|
}, z.core.$strip>;
|
|
104
118
|
export declare const Mode: z.ZodEnum<{
|
|
105
119
|
viewer: "viewer";
|
|
@@ -114,6 +128,11 @@ export declare const Size: z.ZodObject<{
|
|
|
114
128
|
height: z.ZodNumber;
|
|
115
129
|
width: z.ZodNumber;
|
|
116
130
|
}, z.core.$strip>;
|
|
131
|
+
export declare const DynamicLayoutSplitRange: z.ZodObject<{
|
|
132
|
+
unit: z.ZodString;
|
|
133
|
+
start: z.ZodNumber;
|
|
134
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
}, z.core.$strip>;
|
|
117
136
|
export declare const Schema: z.ZodObject<{
|
|
118
137
|
name: z.ZodString;
|
|
119
138
|
type: z.ZodString;
|
|
@@ -128,7 +147,8 @@ export declare const Schema: z.ZodObject<{
|
|
|
128
147
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
129
148
|
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
130
149
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
131
|
-
|
|
150
|
+
__splitRange: z.ZodOptional<z.ZodObject<{
|
|
151
|
+
unit: z.ZodString;
|
|
132
152
|
start: z.ZodNumber;
|
|
133
153
|
end: z.ZodOptional<z.ZodNumber>;
|
|
134
154
|
}, z.core.$strip>>;
|
|
@@ -148,7 +168,8 @@ export declare const SchemaForUI: z.ZodObject<{
|
|
|
148
168
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
149
169
|
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
150
170
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
151
|
-
|
|
171
|
+
__splitRange: z.ZodOptional<z.ZodObject<{
|
|
172
|
+
unit: z.ZodString;
|
|
152
173
|
start: z.ZodNumber;
|
|
153
174
|
end: z.ZodOptional<z.ZodNumber>;
|
|
154
175
|
}, z.core.$strip>>;
|
|
@@ -173,7 +194,8 @@ export declare const BlankPdf: z.ZodObject<{
|
|
|
173
194
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
174
195
|
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
175
196
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
176
|
-
|
|
197
|
+
__splitRange: z.ZodOptional<z.ZodObject<{
|
|
198
|
+
unit: z.ZodString;
|
|
177
199
|
start: z.ZodNumber;
|
|
178
200
|
end: z.ZodOptional<z.ZodNumber>;
|
|
179
201
|
}, z.core.$strip>>;
|
|
@@ -199,7 +221,8 @@ export declare const BasePdf: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodStr
|
|
|
199
221
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
200
222
|
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
201
223
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
202
|
-
|
|
224
|
+
__splitRange: z.ZodOptional<z.ZodObject<{
|
|
225
|
+
unit: z.ZodString;
|
|
203
226
|
start: z.ZodNumber;
|
|
204
227
|
end: z.ZodOptional<z.ZodNumber>;
|
|
205
228
|
}, z.core.$strip>>;
|
|
@@ -220,7 +243,8 @@ export declare const LegacySchemaPageArray: z.ZodArray<z.ZodRecord<z.ZodString,
|
|
|
220
243
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
221
244
|
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
222
245
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
223
|
-
|
|
246
|
+
__splitRange: z.ZodOptional<z.ZodObject<{
|
|
247
|
+
unit: z.ZodString;
|
|
224
248
|
start: z.ZodNumber;
|
|
225
249
|
end: z.ZodOptional<z.ZodNumber>;
|
|
226
250
|
}, z.core.$strip>>;
|
|
@@ -240,7 +264,8 @@ export declare const SchemaPageArray: z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
|
240
264
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
241
265
|
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
242
266
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
243
|
-
|
|
267
|
+
__splitRange: z.ZodOptional<z.ZodObject<{
|
|
268
|
+
unit: z.ZodString;
|
|
244
269
|
start: z.ZodNumber;
|
|
245
270
|
end: z.ZodOptional<z.ZodNumber>;
|
|
246
271
|
}, z.core.$strip>>;
|
|
@@ -261,7 +286,8 @@ export declare const Template: z.ZodObject<{
|
|
|
261
286
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
262
287
|
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
263
288
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
264
|
-
|
|
289
|
+
__splitRange: z.ZodOptional<z.ZodObject<{
|
|
290
|
+
unit: z.ZodString;
|
|
265
291
|
start: z.ZodNumber;
|
|
266
292
|
end: z.ZodOptional<z.ZodNumber>;
|
|
267
293
|
}, z.core.$strip>>;
|
|
@@ -285,7 +311,8 @@ export declare const Template: z.ZodObject<{
|
|
|
285
311
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
286
312
|
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
287
313
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
288
|
-
|
|
314
|
+
__splitRange: z.ZodOptional<z.ZodObject<{
|
|
315
|
+
unit: z.ZodString;
|
|
289
316
|
start: z.ZodNumber;
|
|
290
317
|
end: z.ZodOptional<z.ZodNumber>;
|
|
291
318
|
}, z.core.$strip>>;
|
|
@@ -320,7 +347,8 @@ export declare const Plugin: z.ZodObject<{
|
|
|
320
347
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
321
348
|
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
322
349
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
323
|
-
|
|
350
|
+
__splitRange: z.ZodOptional<z.ZodObject<{
|
|
351
|
+
unit: z.ZodString;
|
|
324
352
|
start: z.ZodNumber;
|
|
325
353
|
end: z.ZodOptional<z.ZodNumber>;
|
|
326
354
|
}, z.core.$strip>>;
|
|
@@ -384,7 +412,8 @@ export declare const GenerateProps: z.ZodObject<{
|
|
|
384
412
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
385
413
|
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
386
414
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
387
|
-
|
|
415
|
+
__splitRange: z.ZodOptional<z.ZodObject<{
|
|
416
|
+
unit: z.ZodString;
|
|
388
417
|
start: z.ZodNumber;
|
|
389
418
|
end: z.ZodOptional<z.ZodNumber>;
|
|
390
419
|
}, z.core.$strip>>;
|
|
@@ -408,7 +437,8 @@ export declare const GenerateProps: z.ZodObject<{
|
|
|
408
437
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
409
438
|
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
410
439
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
411
|
-
|
|
440
|
+
__splitRange: z.ZodOptional<z.ZodObject<{
|
|
441
|
+
unit: z.ZodString;
|
|
412
442
|
start: z.ZodNumber;
|
|
413
443
|
end: z.ZodOptional<z.ZodNumber>;
|
|
414
444
|
}, z.core.$strip>>;
|
|
@@ -437,7 +467,8 @@ export declare const GenerateProps: z.ZodObject<{
|
|
|
437
467
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
438
468
|
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
439
469
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
440
|
-
|
|
470
|
+
__splitRange: z.ZodOptional<z.ZodObject<{
|
|
471
|
+
unit: z.ZodString;
|
|
441
472
|
start: z.ZodNumber;
|
|
442
473
|
end: z.ZodOptional<z.ZodNumber>;
|
|
443
474
|
}, z.core.$strip>>;
|
|
@@ -523,7 +554,8 @@ export declare const UIProps: z.ZodObject<{
|
|
|
523
554
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
524
555
|
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
525
556
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
526
|
-
|
|
557
|
+
__splitRange: z.ZodOptional<z.ZodObject<{
|
|
558
|
+
unit: z.ZodString;
|
|
527
559
|
start: z.ZodNumber;
|
|
528
560
|
end: z.ZodOptional<z.ZodNumber>;
|
|
529
561
|
}, z.core.$strip>>;
|
|
@@ -547,7 +579,8 @@ export declare const UIProps: z.ZodObject<{
|
|
|
547
579
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
548
580
|
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
549
581
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
550
|
-
|
|
582
|
+
__splitRange: z.ZodOptional<z.ZodObject<{
|
|
583
|
+
unit: z.ZodString;
|
|
551
584
|
start: z.ZodNumber;
|
|
552
585
|
end: z.ZodOptional<z.ZodNumber>;
|
|
553
586
|
}, z.core.$strip>>;
|
|
@@ -576,7 +609,8 @@ export declare const UIProps: z.ZodObject<{
|
|
|
576
609
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
577
610
|
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
578
611
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
579
|
-
|
|
612
|
+
__splitRange: z.ZodOptional<z.ZodObject<{
|
|
613
|
+
unit: z.ZodString;
|
|
580
614
|
start: z.ZodNumber;
|
|
581
615
|
end: z.ZodOptional<z.ZodNumber>;
|
|
582
616
|
}, z.core.$strip>>;
|
|
@@ -630,7 +664,8 @@ export declare const PreviewProps: z.ZodObject<{
|
|
|
630
664
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
631
665
|
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
632
666
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
633
|
-
|
|
667
|
+
__splitRange: z.ZodOptional<z.ZodObject<{
|
|
668
|
+
unit: z.ZodString;
|
|
634
669
|
start: z.ZodNumber;
|
|
635
670
|
end: z.ZodOptional<z.ZodNumber>;
|
|
636
671
|
}, z.core.$strip>>;
|
|
@@ -654,7 +689,8 @@ export declare const PreviewProps: z.ZodObject<{
|
|
|
654
689
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
655
690
|
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
656
691
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
657
|
-
|
|
692
|
+
__splitRange: z.ZodOptional<z.ZodObject<{
|
|
693
|
+
unit: z.ZodString;
|
|
658
694
|
start: z.ZodNumber;
|
|
659
695
|
end: z.ZodOptional<z.ZodNumber>;
|
|
660
696
|
}, z.core.$strip>>;
|
|
@@ -683,7 +719,8 @@ export declare const PreviewProps: z.ZodObject<{
|
|
|
683
719
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
684
720
|
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
685
721
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
686
|
-
|
|
722
|
+
__splitRange: z.ZodOptional<z.ZodObject<{
|
|
723
|
+
unit: z.ZodString;
|
|
687
724
|
start: z.ZodNumber;
|
|
688
725
|
end: z.ZodOptional<z.ZodNumber>;
|
|
689
726
|
}, z.core.$strip>>;
|
|
@@ -738,7 +775,8 @@ export declare const DesignerProps: z.ZodObject<{
|
|
|
738
775
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
739
776
|
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
740
777
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
741
|
-
|
|
778
|
+
__splitRange: z.ZodOptional<z.ZodObject<{
|
|
779
|
+
unit: z.ZodString;
|
|
742
780
|
start: z.ZodNumber;
|
|
743
781
|
end: z.ZodOptional<z.ZodNumber>;
|
|
744
782
|
}, z.core.$strip>>;
|
|
@@ -762,7 +800,8 @@ export declare const DesignerProps: z.ZodObject<{
|
|
|
762
800
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
763
801
|
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
764
802
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
765
|
-
|
|
803
|
+
__splitRange: z.ZodOptional<z.ZodObject<{
|
|
804
|
+
unit: z.ZodString;
|
|
766
805
|
start: z.ZodNumber;
|
|
767
806
|
end: z.ZodOptional<z.ZodNumber>;
|
|
768
807
|
}, z.core.$strip>>;
|
|
@@ -791,7 +830,8 @@ export declare const DesignerProps: z.ZodObject<{
|
|
|
791
830
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
792
831
|
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
793
832
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
794
|
-
|
|
833
|
+
__splitRange: z.ZodOptional<z.ZodObject<{
|
|
834
|
+
unit: z.ZodString;
|
|
795
835
|
start: z.ZodNumber;
|
|
796
836
|
end: z.ZodOptional<z.ZodNumber>;
|
|
797
837
|
}, z.core.$strip>>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DynamicLayoutRange, DynamicLayoutSplitRange } from './types.js';
|
|
2
|
+
export declare const createDynamicLayoutSplitRange: (unit: string, start: number, end?: number) => DynamicLayoutSplitRange;
|
|
3
|
+
export declare const getDynamicLayoutSplitRange: (schema: {
|
|
4
|
+
__splitRange?: DynamicLayoutSplitRange;
|
|
5
|
+
}, unit: string) => DynamicLayoutRange | undefined;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { PDFPage, PDFDocument } from '@pdfme/pdf-lib';
|
|
3
|
-
import { Lang, Dict, Mode, Size, Schema, Font, SchemaForUI, BasePdf, BlankPdf, CustomPdf, CommonOptions, Template, GeneratorOptions, GenerateProps, UIOptions, UIProps, PreviewProps, DesignerProps, ColorType, LegacySchemaPageArray, SchemaPageArray } from './schema.js';
|
|
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
4
|
export interface UIOptionsThemeToken {
|
|
5
5
|
colorPrimary?: string;
|
|
6
6
|
colorPrimaryBg?: string;
|
|
@@ -121,6 +121,7 @@ export type UIRenderProps<T extends Schema> = {
|
|
|
121
121
|
* @property {HTMLElement[]} activeElements - Array of currently active HTML elements in the UI.
|
|
122
122
|
* @property {ChangeSchemas} changeSchemas - Function to change multiple schemas simultaneously.
|
|
123
123
|
* @property {SchemaForUI[]} schemas - Array of schemas for UI rendering.
|
|
124
|
+
* @property {BasePdf} basePdf - The base PDF used by the current template.
|
|
124
125
|
* @property {Size} pageSize - The size of the page being edited.
|
|
125
126
|
* @property {UIOptions} options - UI options for the property panel.
|
|
126
127
|
* @property {UITheme} theme - The theme token used in the UI.
|
|
@@ -132,6 +133,7 @@ type PropPanelProps = {
|
|
|
132
133
|
activeElements: HTMLElement[];
|
|
133
134
|
changeSchemas: ChangeSchemas;
|
|
134
135
|
schemas: SchemaForUI[];
|
|
136
|
+
basePdf?: BasePdf;
|
|
135
137
|
options: UIOptions;
|
|
136
138
|
theme: UITheme;
|
|
137
139
|
i18n: (key: string) => string;
|
|
@@ -191,6 +193,8 @@ export type Lang = z.infer<typeof Lang>;
|
|
|
191
193
|
export type Dict = z.infer<typeof Dict>;
|
|
192
194
|
export type Mode = z.infer<typeof Mode>;
|
|
193
195
|
export type Size = z.infer<typeof Size>;
|
|
196
|
+
export type DynamicLayoutSplitRange = z.infer<typeof DynamicLayoutSplitRange>;
|
|
197
|
+
export type DynamicLayoutRange = Omit<DynamicLayoutSplitRange, 'unit'>;
|
|
194
198
|
export type Schema = z.infer<typeof Schema>;
|
|
195
199
|
export type SchemaForUI = z.infer<typeof SchemaForUI>;
|
|
196
200
|
/**
|
|
@@ -225,4 +229,24 @@ export type DesignerProps = Omit<z.infer<typeof DesignerProps>, 'plugins'> & {
|
|
|
225
229
|
};
|
|
226
230
|
export type SchemaPageArray = z.infer<typeof SchemaPageArray>;
|
|
227
231
|
export type LegacySchemaPageArray = z.infer<typeof LegacySchemaPageArray>;
|
|
232
|
+
export type DynamicLayoutPatchArgs = {
|
|
233
|
+
schema: Schema;
|
|
234
|
+
start: number;
|
|
235
|
+
end: number;
|
|
236
|
+
isSplit: boolean;
|
|
237
|
+
chunkHeight: number;
|
|
238
|
+
};
|
|
239
|
+
export type DynamicLayoutResult = {
|
|
240
|
+
heights: number[];
|
|
241
|
+
avoidFirstUnitOnly?: boolean;
|
|
242
|
+
patchSplitSchema?: (args: DynamicLayoutPatchArgs) => Partial<Schema>;
|
|
243
|
+
};
|
|
244
|
+
export type DynamicLayoutCallbackResult = DynamicLayoutResult | number[];
|
|
245
|
+
export type DynamicLayoutArgs = {
|
|
246
|
+
schema: Schema;
|
|
247
|
+
basePdf: BasePdf;
|
|
248
|
+
options: CommonOptions;
|
|
249
|
+
_cache: Map<string | number, unknown>;
|
|
250
|
+
};
|
|
251
|
+
export type GetDynamicLayout = (value: string, args: DynamicLayoutArgs) => Promise<DynamicLayoutCallbackResult>;
|
|
228
252
|
export {};
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PDFME_VERSION = "6.1.
|
|
1
|
+
export declare const PDFME_VERSION = "6.1.1";
|
package/package.json
CHANGED