@pdfme/common 3.0.1-dev.21 → 3.0.1-dev.23
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/cjs/src/schema.js +5 -1
- package/dist/cjs/src/schema.js.map +1 -1
- package/dist/esm/src/schema.js +5 -1
- package/dist/esm/src/schema.js.map +1 -1
- package/dist/types/src/schema.d.ts +36 -0
- package/dist/types/src/types.d.ts +5 -1
- package/package.json +2 -1
- package/src/schema.ts +5 -1
- package/src/types.ts +3 -1
package/dist/cjs/src/schema.js
CHANGED
@@ -48,7 +48,11 @@ exports.GenerateProps = CommonProps.extend({
|
|
48
48
|
options: exports.GeneratorOptions.optional(),
|
49
49
|
}).strict();
|
50
50
|
// ---------------------ui------------------------
|
51
|
-
exports.UIOptions = CommonOptions.extend({
|
51
|
+
exports.UIOptions = CommonOptions.extend({
|
52
|
+
lang: exports.Lang.optional(),
|
53
|
+
labels: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
|
54
|
+
theme: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
|
55
|
+
});
|
52
56
|
const HTMLElementSchema = zod_1.z.any().refine((v) => v instanceof HTMLElement);
|
53
57
|
exports.UIProps = CommonProps.extend({
|
54
58
|
domContainer: HTMLElementSchema,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC;AAE/C,QAAA,IAAI,GAAG,OAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAErB,QAAA,IAAI,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,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,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;CACpD,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAA6B,OAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,YAAY,WAAW,CAAC,CAAC;AAEvF,QAAA,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC;IACxC,YAAY,EAAE,iBAAiB;IAC/B,OAAO,EAAE,iBAAS,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC;AAEU,QAAA,YAAY,GAAG,eAAO,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,cAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAE3D,QAAA,aAAa,GAAG,eAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC"}
|
package/dist/esm/src/schema.js
CHANGED
@@ -45,7 +45,11 @@ export const GenerateProps = CommonProps.extend({
|
|
45
45
|
options: GeneratorOptions.optional(),
|
46
46
|
}).strict();
|
47
47
|
// ---------------------ui------------------------
|
48
|
-
export const UIOptions = CommonOptions.extend({
|
48
|
+
export const UIOptions = CommonOptions.extend({
|
49
|
+
lang: Lang.optional(),
|
50
|
+
labels: z.record(z.string(), z.string()).optional(),
|
51
|
+
theme: z.record(z.string(), z.unknown()).optional(),
|
52
|
+
});
|
49
53
|
const HTMLElementSchema = z.any().refine((v) => v instanceof HTMLElement);
|
50
54
|
export const UIProps = CommonProps.extend({
|
51
55
|
domContainer: HTMLElementSchema,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAA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.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
|
502
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
503
|
+
theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
502
504
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
503
505
|
font: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
504
506
|
data: z.ZodUnion<[z.ZodString, z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
|
@@ -514,6 +516,8 @@ export declare const UIOptions: z.ZodObject<{
|
|
514
516
|
subset?: boolean | undefined;
|
515
517
|
}>>>;
|
516
518
|
lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
|
519
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
520
|
+
theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
517
521
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
518
522
|
font: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
519
523
|
data: z.ZodUnion<[z.ZodString, z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
|
@@ -529,6 +533,8 @@ export declare const UIOptions: z.ZodObject<{
|
|
529
533
|
subset?: boolean | undefined;
|
530
534
|
}>>>;
|
531
535
|
lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
|
536
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
537
|
+
theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
532
538
|
}, z.ZodTypeAny, "passthrough">>;
|
533
539
|
export declare const UIProps: z.ZodObject<{
|
534
540
|
template: z.ZodObject<{
|
@@ -651,6 +657,8 @@ export declare const UIProps: z.ZodObject<{
|
|
651
657
|
subset?: boolean | undefined;
|
652
658
|
}>>>;
|
653
659
|
lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
|
660
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
661
|
+
theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
654
662
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
655
663
|
font: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
656
664
|
data: z.ZodUnion<[z.ZodString, z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
|
@@ -666,6 +674,8 @@ export declare const UIProps: z.ZodObject<{
|
|
666
674
|
subset?: boolean | undefined;
|
667
675
|
}>>>;
|
668
676
|
lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
|
677
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
678
|
+
theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
669
679
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
670
680
|
font: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
671
681
|
data: z.ZodUnion<[z.ZodString, z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
|
@@ -681,6 +691,8 @@ export declare const UIProps: z.ZodObject<{
|
|
681
691
|
subset?: boolean | undefined;
|
682
692
|
}>>>;
|
683
693
|
lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
|
694
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
695
|
+
theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
684
696
|
}, z.ZodTypeAny, "passthrough">>>;
|
685
697
|
}, "strip", z.ZodTypeAny, {
|
686
698
|
template: {
|
@@ -725,6 +737,8 @@ export declare const UIProps: z.ZodObject<{
|
|
725
737
|
subset?: boolean | undefined;
|
726
738
|
}>>>;
|
727
739
|
lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
|
740
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
741
|
+
theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
728
742
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
729
743
|
}, {
|
730
744
|
template: {
|
@@ -769,6 +783,8 @@ export declare const UIProps: z.ZodObject<{
|
|
769
783
|
subset?: boolean | undefined;
|
770
784
|
}>>>;
|
771
785
|
lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
|
786
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
787
|
+
theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
772
788
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
773
789
|
}>;
|
774
790
|
export declare const PreviewProps: z.ZodObject<{
|
@@ -787,6 +803,8 @@ export declare const PreviewProps: z.ZodObject<{
|
|
787
803
|
subset?: boolean | undefined;
|
788
804
|
}>>>;
|
789
805
|
lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
|
806
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
807
|
+
theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
790
808
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
791
809
|
font: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
792
810
|
data: z.ZodUnion<[z.ZodString, z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
|
@@ -802,6 +820,8 @@ export declare const PreviewProps: z.ZodObject<{
|
|
802
820
|
subset?: boolean | undefined;
|
803
821
|
}>>>;
|
804
822
|
lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
|
823
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
824
|
+
theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
805
825
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
806
826
|
font: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
807
827
|
data: z.ZodUnion<[z.ZodString, z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
|
@@ -817,6 +837,8 @@ export declare const PreviewProps: z.ZodObject<{
|
|
817
837
|
subset?: boolean | undefined;
|
818
838
|
}>>>;
|
819
839
|
lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
|
840
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
841
|
+
theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
820
842
|
}, z.ZodTypeAny, "passthrough">>>;
|
821
843
|
template: z.ZodObject<{
|
822
844
|
schemas: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodObject<{
|
@@ -963,6 +985,8 @@ export declare const PreviewProps: z.ZodObject<{
|
|
963
985
|
subset?: boolean | undefined;
|
964
986
|
}>>>;
|
965
987
|
lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
|
988
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
989
|
+
theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
966
990
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
967
991
|
plugins?: Record<string, {
|
968
992
|
ui?: any;
|
@@ -1008,6 +1032,8 @@ export declare const PreviewProps: z.ZodObject<{
|
|
1008
1032
|
subset?: boolean | undefined;
|
1009
1033
|
}>>>;
|
1010
1034
|
lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
|
1035
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
1036
|
+
theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
1011
1037
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
1012
1038
|
plugins?: Record<string, {
|
1013
1039
|
ui?: any;
|
@@ -1031,6 +1057,8 @@ export declare const DesignerProps: z.ZodObject<{
|
|
1031
1057
|
subset?: boolean | undefined;
|
1032
1058
|
}>>>;
|
1033
1059
|
lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
|
1060
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
1061
|
+
theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
1034
1062
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
1035
1063
|
font: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
1036
1064
|
data: z.ZodUnion<[z.ZodString, z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
|
@@ -1046,6 +1074,8 @@ export declare const DesignerProps: z.ZodObject<{
|
|
1046
1074
|
subset?: boolean | undefined;
|
1047
1075
|
}>>>;
|
1048
1076
|
lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
|
1077
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
1078
|
+
theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
1049
1079
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
1050
1080
|
font: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
1051
1081
|
data: z.ZodUnion<[z.ZodString, z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
|
@@ -1061,6 +1091,8 @@ export declare const DesignerProps: z.ZodObject<{
|
|
1061
1091
|
subset?: boolean | undefined;
|
1062
1092
|
}>>>;
|
1063
1093
|
lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
|
1094
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
1095
|
+
theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
1064
1096
|
}, z.ZodTypeAny, "passthrough">>>;
|
1065
1097
|
template: z.ZodObject<{
|
1066
1098
|
schemas: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodObject<{
|
@@ -1205,6 +1237,8 @@ export declare const DesignerProps: z.ZodObject<{
|
|
1205
1237
|
subset?: boolean | undefined;
|
1206
1238
|
}>>>;
|
1207
1239
|
lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
|
1240
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
1241
|
+
theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
1208
1242
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
1209
1243
|
plugins?: Record<string, {
|
1210
1244
|
ui?: any;
|
@@ -1249,6 +1283,8 @@ export declare const DesignerProps: z.ZodObject<{
|
|
1249
1283
|
subset?: boolean | undefined;
|
1250
1284
|
}>>>;
|
1251
1285
|
lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
|
1286
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
1287
|
+
theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
1252
1288
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
1253
1289
|
plugins?: Record<string, {
|
1254
1290
|
ui?: any;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { z } from 'zod';
|
2
2
|
import type { PDFPage, PDFDocument } from '@pdfme/pdf-lib';
|
3
|
+
import type { ThemeConfig, GlobalToken } from 'antd';
|
3
4
|
import type { WidgetProps as _PropPanelWidgetProps, Schema as _PropPanelSchema } from 'form-render';
|
4
5
|
import { Lang, Size, Schema, Font, SchemaForUI, BasePdf, Template, GeneratorOptions, GenerateProps, UIOptions, UIProps, PreviewProps, DesignerProps } from './schema.js';
|
5
6
|
export type PropPanelSchema = _PropPanelSchema;
|
@@ -52,6 +53,7 @@ export type UIRenderProps<T extends Schema> = {
|
|
52
53
|
onChange?: (value: string) => void;
|
53
54
|
rootElement: HTMLDivElement;
|
54
55
|
options: UIOptions;
|
56
|
+
theme: GlobalToken;
|
55
57
|
};
|
56
58
|
type PropPanelProps = {
|
57
59
|
rootElement: HTMLDivElement;
|
@@ -114,7 +116,9 @@ export type GeneratorOptions = z.infer<typeof GeneratorOptions>;
|
|
114
116
|
export type GenerateProps = z.infer<typeof GenerateProps> & {
|
115
117
|
plugins?: Plugins;
|
116
118
|
};
|
117
|
-
export type UIOptions = z.infer<typeof UIOptions
|
119
|
+
export type UIOptions = z.infer<typeof UIOptions> & {
|
120
|
+
theme?: ThemeConfig;
|
121
|
+
};
|
118
122
|
export type UIProps = z.infer<typeof UIProps> & {
|
119
123
|
plugins?: Plugins;
|
120
124
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pdfme/common",
|
3
|
-
"version": "3.0.1-dev.
|
3
|
+
"version": "3.0.1-dev.23",
|
4
4
|
"sideEffects": false,
|
5
5
|
"author": "hand-dot",
|
6
6
|
"license": "MIT",
|
@@ -50,6 +50,7 @@
|
|
50
50
|
},
|
51
51
|
"dependencies": {
|
52
52
|
"@pdfme/pdf-lib": "^1.17.3",
|
53
|
+
"antd": "^5.11.2",
|
53
54
|
"buffer": "^6.0.3",
|
54
55
|
"form-render": "^2.2.20",
|
55
56
|
"zod": "^3.20.2"
|
package/src/schema.ts
CHANGED
@@ -64,7 +64,11 @@ export const GenerateProps = CommonProps.extend({
|
|
64
64
|
|
65
65
|
// ---------------------ui------------------------
|
66
66
|
|
67
|
-
export const UIOptions = CommonOptions.extend({
|
67
|
+
export const UIOptions = CommonOptions.extend({
|
68
|
+
lang: Lang.optional(),
|
69
|
+
labels: z.record(z.string(), z.string()).optional(),
|
70
|
+
theme: z.record(z.string(), z.unknown()).optional(),
|
71
|
+
});
|
68
72
|
|
69
73
|
const HTMLElementSchema: z.ZodSchema<HTMLElement> = z.any().refine((v) => v instanceof HTMLElement);
|
70
74
|
|
package/src/types.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import { z } from 'zod';
|
2
2
|
import type { PDFPage, PDFDocument } from '@pdfme/pdf-lib';
|
3
|
+
import type { ThemeConfig, GlobalToken } from 'antd';
|
3
4
|
import type { WidgetProps as _PropPanelWidgetProps, Schema as _PropPanelSchema } from 'form-render';
|
4
5
|
// prettier-ignore
|
5
6
|
import {Lang, Size, Schema, Font, SchemaForUI, BasePdf, Template, GeneratorOptions, GenerateProps, UIOptions, UIProps, PreviewProps, DesignerProps} from './schema.js';
|
@@ -53,6 +54,7 @@ export type UIRenderProps<T extends Schema> = {
|
|
53
54
|
onChange?: (value: string) => void;
|
54
55
|
rootElement: HTMLDivElement;
|
55
56
|
options: UIOptions;
|
57
|
+
theme: GlobalToken;
|
56
58
|
};
|
57
59
|
|
58
60
|
type PropPanelProps = {
|
@@ -118,7 +120,7 @@ export type BasePdf = z.infer<typeof BasePdf>;
|
|
118
120
|
export type Template = z.infer<typeof Template>;
|
119
121
|
export type GeneratorOptions = z.infer<typeof GeneratorOptions>;
|
120
122
|
export type GenerateProps = z.infer<typeof GenerateProps> & { plugins?: Plugins };
|
121
|
-
export type UIOptions = z.infer<typeof UIOptions
|
123
|
+
export type UIOptions = z.infer<typeof UIOptions> & { theme?: ThemeConfig };
|
122
124
|
export type UIProps = z.infer<typeof UIProps> & { plugins?: Plugins };
|
123
125
|
export type PreviewProps = z.infer<typeof PreviewProps> & { plugins?: Plugins };
|
124
126
|
export type DesignerProps = z.infer<typeof DesignerProps> & { plugins?: Plugins };
|