@pdfme/generator 1.0.0-beta.2 → 1.0.0-beta.7
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.js +3 -0
- package/dist/{@pdfme/generator.js.LICENSE.txt → index.js.LICENSE.txt} +3 -1
- package/dist/index.js.map +1 -0
- package/dist/types/{generator/src/constants.d.ts → constants.d.ts} +0 -0
- package/dist/types/{generator/src/generate.d.ts → generate.d.ts} +1 -1
- package/dist/types/{generator/src/helper.d.ts → helper.d.ts} +0 -1
- package/dist/types/index.d.ts +4 -0
- package/package.json +10 -7
- package/src/generate.ts +2 -9
- package/src/index.ts +5 -39
- package/tsconfig.json +1 -0
- package/webpack.config.js +1 -2
- package/dist/@pdfme/generator.js +0 -3
- package/dist/@pdfme/generator.js.map +0 -1
- package/dist/types/common/src/barcode.d.ts +0 -2
- package/dist/types/common/src/constants.d.ts +0 -6
- package/dist/types/common/src/helper.d.ts +0 -15
- package/dist/types/common/src/index.d.ts +0 -4
- package/dist/types/common/src/schema.d.ts +0 -3613
- package/dist/types/common/src/type.d.ts +0 -64
- package/dist/types/common/src/utils.d.ts +0 -12
- package/dist/types/generator/src/generator.d.ts +0 -67
- package/dist/types/generator/src/index.d.ts +0 -3
@@ -1,64 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
import { Lang, Size, Alignment, BarcodeSchemaType, SchemaType, CommonSchema as _CommonSchema, TextSchema, ImageSchema, BarcodeSchema, Schema, SchemaForUI, Font, BasePdf, Template, CommonProps, GeneratorOptions, GenerateProps, UIOptions, UIProps, PreviewProps, PreviewReactProps, DesignerProps, DesignerReactProps } from './schema';
|
3
|
-
export declare type Lang = z.infer<typeof Lang>;
|
4
|
-
export declare type Size = z.infer<typeof Size>;
|
5
|
-
export declare type Alignment = z.infer<typeof Alignment>;
|
6
|
-
export declare type SchemaType = z.infer<typeof SchemaType>;
|
7
|
-
export declare const schemaTypes: readonly ["text", "image", "qrcode", "japanpost", "ean13", "ean8", "code39", "code128", "nw7", "itf14", "upca", "upce"];
|
8
|
-
export declare type BarCodeType = z.infer<typeof BarcodeSchemaType>;
|
9
|
-
export declare type TextSchema = z.infer<typeof TextSchema>;
|
10
|
-
declare type CommonSchema = z.infer<typeof _CommonSchema>;
|
11
|
-
export declare const isTextSchema: (arg: CommonSchema) => arg is {
|
12
|
-
rotate?: number | undefined;
|
13
|
-
alignment?: "left" | "center" | "right" | undefined;
|
14
|
-
fontSize?: number | undefined;
|
15
|
-
fontName?: string | undefined;
|
16
|
-
fontColor?: string | undefined;
|
17
|
-
backgroundColor?: string | undefined;
|
18
|
-
characterSpacing?: number | undefined;
|
19
|
-
lineHeight?: number | undefined;
|
20
|
-
type: "text";
|
21
|
-
height: number;
|
22
|
-
width: number;
|
23
|
-
position: {
|
24
|
-
x: number;
|
25
|
-
y: number;
|
26
|
-
};
|
27
|
-
};
|
28
|
-
export declare type ImageSchema = z.infer<typeof ImageSchema>;
|
29
|
-
export declare const isImageSchema: (arg: CommonSchema) => arg is {
|
30
|
-
rotate?: number | undefined;
|
31
|
-
type: "image";
|
32
|
-
height: number;
|
33
|
-
width: number;
|
34
|
-
position: {
|
35
|
-
x: number;
|
36
|
-
y: number;
|
37
|
-
};
|
38
|
-
};
|
39
|
-
export declare type BarcodeSchema = z.infer<typeof BarcodeSchema>;
|
40
|
-
export declare const isBarcodeSchema: (arg: CommonSchema) => arg is {
|
41
|
-
rotate?: number | undefined;
|
42
|
-
type: "qrcode" | "japanpost" | "ean13" | "ean8" | "code39" | "code128" | "nw7" | "itf14" | "upca" | "upce";
|
43
|
-
height: number;
|
44
|
-
width: number;
|
45
|
-
position: {
|
46
|
-
x: number;
|
47
|
-
y: number;
|
48
|
-
};
|
49
|
-
};
|
50
|
-
export declare type Schema = z.infer<typeof Schema>;
|
51
|
-
export declare type SchemaForUI = z.infer<typeof SchemaForUI>;
|
52
|
-
export declare type Font = z.infer<typeof Font>;
|
53
|
-
export declare type BasePdf = z.infer<typeof BasePdf>;
|
54
|
-
export declare type Template = z.infer<typeof Template>;
|
55
|
-
export declare type CommonProps = z.infer<typeof CommonProps>;
|
56
|
-
export declare type GeneratorOptions = z.infer<typeof GeneratorOptions>;
|
57
|
-
export declare type GenerateProps = z.infer<typeof GenerateProps>;
|
58
|
-
export declare type UIOptions = z.infer<typeof UIOptions>;
|
59
|
-
export declare type UIProps = z.infer<typeof UIProps>;
|
60
|
-
export declare type PreviewProps = z.infer<typeof PreviewProps>;
|
61
|
-
export declare type PreviewReactProps = z.infer<typeof PreviewReactProps>;
|
62
|
-
export declare type DesignerProps = z.infer<typeof DesignerProps>;
|
63
|
-
export declare type DesignerReactProps = z.infer<typeof DesignerReactProps>;
|
64
|
-
export {};
|
@@ -1,12 +0,0 @@
|
|
1
|
-
export declare const uuid: () => string;
|
2
|
-
export declare const set: <T extends object>(obj: T, path: string | string[], value: any) => void;
|
3
|
-
export declare const debounce: <T extends Function>(cb: T, wait?: number) => T;
|
4
|
-
export declare const cloneDeep: <T>(value: T) => T;
|
5
|
-
export declare const uniq: <T>(array: T[]) => T[];
|
6
|
-
export declare const round: (number: number, precision: number) => number;
|
7
|
-
export declare const b64toUint8Array: (base64: string) => Uint8Array;
|
8
|
-
export declare const b64toBlob: (base64: string) => Blob;
|
9
|
-
export declare const arrayMove: <T>(array: T[], from: number, to: number) => T[];
|
10
|
-
export declare const flatten: <T>(arr: T[][]) => T[];
|
11
|
-
export declare const pt2mm: (pt: number) => number;
|
12
|
-
export declare const mm2pt: (mm: number) => number;
|
@@ -1,67 +0,0 @@
|
|
1
|
-
import { PDFPage, PDFFont, PDFDocument, PDFImage, PDFEmbeddedPage } from 'pdf-lib';
|
2
|
-
import { Schema, Font, BasePdf, BarCodeType } from '../../common/src/type';
|
3
|
-
export interface InputImageCache {
|
4
|
-
[key: string]: PDFImage;
|
5
|
-
}
|
6
|
-
export declare const createBarCode: ({ type, input, width, height, backgroundColor, }: {
|
7
|
-
type: BarCodeType;
|
8
|
-
input: string;
|
9
|
-
width: number;
|
10
|
-
height: number;
|
11
|
-
backgroundColor?: string | undefined;
|
12
|
-
}) => Promise<Buffer>;
|
13
|
-
declare type EmbedPdfBox = {
|
14
|
-
mediaBox: {
|
15
|
-
x: number;
|
16
|
-
y: number;
|
17
|
-
width: number;
|
18
|
-
height: number;
|
19
|
-
};
|
20
|
-
bleedBox: {
|
21
|
-
x: number;
|
22
|
-
y: number;
|
23
|
-
width: number;
|
24
|
-
height: number;
|
25
|
-
};
|
26
|
-
trimBox: {
|
27
|
-
x: number;
|
28
|
-
y: number;
|
29
|
-
width: number;
|
30
|
-
height: number;
|
31
|
-
};
|
32
|
-
};
|
33
|
-
export declare const embedAndGetFontObj: (arg: {
|
34
|
-
pdfDoc: PDFDocument;
|
35
|
-
font: Font;
|
36
|
-
}) => Promise<{
|
37
|
-
[key: string]: PDFFont;
|
38
|
-
}>;
|
39
|
-
export declare const getEmbeddedPagesAndEmbedPdfBoxes: (arg: {
|
40
|
-
pdfDoc: PDFDocument;
|
41
|
-
basePdf: BasePdf;
|
42
|
-
}) => Promise<{
|
43
|
-
embeddedPages: PDFEmbeddedPage[];
|
44
|
-
embedPdfBoxes: EmbedPdfBox[];
|
45
|
-
}>;
|
46
|
-
interface TextSchemaSetting {
|
47
|
-
fontObj: {
|
48
|
-
[key: string]: PDFFont;
|
49
|
-
};
|
50
|
-
fallbackFontName: string;
|
51
|
-
splitThreshold: number;
|
52
|
-
}
|
53
|
-
export declare const drawInputByTemplateSchema: (arg: {
|
54
|
-
input: string;
|
55
|
-
templateSchema: Schema;
|
56
|
-
pdfDoc: PDFDocument;
|
57
|
-
page: PDFPage;
|
58
|
-
pageHeight: number;
|
59
|
-
textSchemaSetting: TextSchemaSetting;
|
60
|
-
inputImageCache: InputImageCache;
|
61
|
-
}) => Promise<void>;
|
62
|
-
export declare const drawEmbeddedPage: (arg: {
|
63
|
-
page: PDFPage;
|
64
|
-
embeddedPage: PDFEmbeddedPage;
|
65
|
-
embedPdfBox: EmbedPdfBox;
|
66
|
-
}) => void;
|
67
|
-
export {};
|
@@ -1,3 +0,0 @@
|
|
1
|
-
import generate from './generate';
|
2
|
-
import { BLANK_PDF, Lang, Size, Alignment, SchemaType, schemaTypes, BarCodeType, TextSchema, isTextSchema, ImageSchema, isImageSchema, BarcodeSchema, isBarcodeSchema, Schema, SchemaForUI, Font, BasePdf, Template, CommonProps, GeneratorOptions, GenerateProps, UIOptions, UIProps, PreviewProps, PreviewReactProps, DesignerProps, DesignerReactProps, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, validateBarcodeInput } from '@pdfme/common';
|
3
|
-
export { generate, BLANK_PDF, Lang, Size, Alignment, SchemaType, schemaTypes, BarCodeType, TextSchema, isTextSchema, ImageSchema, isImageSchema, BarcodeSchema, isBarcodeSchema, Schema, SchemaForUI, Font, BasePdf, Template, CommonProps, GeneratorOptions, GenerateProps, UIOptions, UIProps, PreviewProps, PreviewReactProps, DesignerProps, DesignerReactProps, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, validateBarcodeInput, };
|