@pdfme/generator 1.0.0-beta.3 → 1.0.0-beta.5

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.
@@ -1,13 +1,7 @@
1
1
  import { z } from 'zod';
2
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
3
  declare type CommonSchema = z.infer<typeof _CommonSchema>;
4
+ export declare const schemaTypes: readonly ["text", "image", "qrcode", "japanpost", "ean13", "ean8", "code39", "code128", "nw7", "itf14", "upca", "upce"];
11
5
  export declare const isTextSchema: (arg: CommonSchema) => arg is {
12
6
  rotate?: number | undefined;
13
7
  alignment?: "left" | "center" | "right" | undefined;
@@ -18,35 +12,41 @@ export declare const isTextSchema: (arg: CommonSchema) => arg is {
18
12
  characterSpacing?: number | undefined;
19
13
  lineHeight?: number | undefined;
20
14
  type: "text";
21
- height: number;
22
- width: number;
23
15
  position: {
24
16
  x: number;
25
17
  y: number;
26
18
  };
19
+ width: number;
20
+ height: number;
27
21
  };
28
- export declare type ImageSchema = z.infer<typeof ImageSchema>;
29
22
  export declare const isImageSchema: (arg: CommonSchema) => arg is {
30
23
  rotate?: number | undefined;
31
24
  type: "image";
32
- height: number;
33
- width: number;
34
25
  position: {
35
26
  x: number;
36
27
  y: number;
37
28
  };
29
+ width: number;
30
+ height: number;
38
31
  };
39
- export declare type BarcodeSchema = z.infer<typeof BarcodeSchema>;
40
32
  export declare const isBarcodeSchema: (arg: CommonSchema) => arg is {
41
33
  rotate?: number | undefined;
42
34
  type: "qrcode" | "japanpost" | "ean13" | "ean8" | "code39" | "code128" | "nw7" | "itf14" | "upca" | "upce";
43
- height: number;
44
- width: number;
45
35
  position: {
46
36
  x: number;
47
37
  y: number;
48
38
  };
39
+ width: number;
40
+ height: number;
49
41
  };
42
+ export declare type Lang = z.infer<typeof Lang>;
43
+ export declare type Size = z.infer<typeof Size>;
44
+ export declare type Alignment = z.infer<typeof Alignment>;
45
+ export declare type SchemaType = z.infer<typeof SchemaType>;
46
+ export declare type BarCodeType = z.infer<typeof BarcodeSchemaType>;
47
+ export declare type TextSchema = z.infer<typeof TextSchema>;
48
+ export declare type ImageSchema = z.infer<typeof ImageSchema>;
49
+ export declare type BarcodeSchema = z.infer<typeof BarcodeSchema>;
50
50
  export declare type Schema = z.infer<typeof Schema>;
51
51
  export declare type SchemaForUI = z.infer<typeof SchemaForUI>;
52
52
  export declare type Font = z.infer<typeof Font>;
@@ -1,3 +1,3 @@
1
- import { GenerateProps } from '@pdfme/common';
1
+ import type { GenerateProps } from '@pdfme/common';
2
2
  declare const generate: (props: GenerateProps) => Promise<Uint8Array>;
3
3
  export default generate;
@@ -1,3 +1,4 @@
1
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, };
2
+ export { generate };
3
+ export type { Lang, Size, Alignment, SchemaType, BarCodeType, TextSchema, ImageSchema, BarcodeSchema, Schema, SchemaForUI, Font, BasePdf, Template, CommonProps, GeneratorOptions, GenerateProps, UIOptions, UIProps, PreviewProps, DesignerProps, } from '@pdfme/common';
4
+ export { BLANK_PDF, isTextSchema, isImageSchema, isBarcodeSchema, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, validateBarcodeInput, } from '@pdfme/common';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdfme/generator",
3
- "version": "1.0.0-beta.3",
3
+ "version": "1.0.0-beta.5",
4
4
  "author": "hand-dot",
5
5
  "license": "MIT",
6
6
  "description": "TypeScript base PDF generator and React base UI. Open source, developed by the community, and completely free to use under the MIT license!",
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "main": "dist/index.js",
13
13
  "module": "src/index.ts",
14
- "types": "dist/types/index.d.ts",
14
+ "types": "dist/types/generator/src/index.d.ts",
15
15
  "engines": {
16
16
  "node": ">=14"
17
17
  },
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@pdf-lib/fontkit": "^1.1.1",
30
- "@pdfme/common": "^1.0.0-beta",
30
+ "@pdfme/common": "^1.0.0-beta.5",
31
31
  "bwip-js": "^3.0.4",
32
32
  "pdf-lib": "^1.17.1"
33
33
  },
@@ -57,5 +57,9 @@
57
57
  "testMatch": [
58
58
  "**/*.test.ts"
59
59
  ]
60
- }
61
- }
60
+ },
61
+ "publishConfig": {
62
+ "access": "public"
63
+ },
64
+ "stableVersion": "1.0.0-beta.4"
65
+ }
package/src/generate.ts CHANGED
@@ -1,14 +1,7 @@
1
1
  import { PDFDocument } from 'pdf-lib';
2
2
  import fontkit from '@pdf-lib/fontkit';
3
- import {
4
- GenerateProps,
5
- Template,
6
- Font,
7
- getDefaultFont,
8
- getFallbackFontName,
9
- checkGenerateProps,
10
- } from '@pdfme/common';
11
-
3
+ import type { GenerateProps, Template, Font } from '@pdfme/common';
4
+ import { getDefaultFont, getFallbackFontName, checkGenerateProps } from '@pdfme/common';
12
5
  import {
13
6
  getEmbeddedPagesAndEmbedPdfBoxes,
14
7
  drawInputByTemplateSchema,
package/src/index.ts CHANGED
@@ -1,18 +1,16 @@
1
1
  import generate from './generate';
2
- import {
3
- BLANK_PDF,
2
+
3
+ export { generate };
4
+
5
+ export type {
4
6
  Lang,
5
7
  Size,
6
8
  Alignment,
7
9
  SchemaType,
8
- schemaTypes,
9
10
  BarCodeType,
10
11
  TextSchema,
11
- isTextSchema,
12
12
  ImageSchema,
13
- isImageSchema,
14
13
  BarcodeSchema,
15
- isBarcodeSchema,
16
14
  Schema,
17
15
  SchemaForUI,
18
16
  Font,
@@ -24,50 +22,18 @@ import {
24
22
  UIOptions,
25
23
  UIProps,
26
24
  PreviewProps,
27
- PreviewReactProps,
28
25
  DesignerProps,
29
- DesignerReactProps,
30
- checkTemplate,
31
- checkUIProps,
32
- checkPreviewProps,
33
- checkDesignerProps,
34
- checkGenerateProps,
35
- validateBarcodeInput,
36
26
  } from '@pdfme/common';
37
27
 
38
28
  export {
39
- generate,
40
29
  BLANK_PDF,
41
- Lang,
42
- Size,
43
- Alignment,
44
- SchemaType,
45
- schemaTypes,
46
- BarCodeType,
47
- TextSchema,
48
30
  isTextSchema,
49
- ImageSchema,
50
31
  isImageSchema,
51
- BarcodeSchema,
52
32
  isBarcodeSchema,
53
- Schema,
54
- SchemaForUI,
55
- Font,
56
- BasePdf,
57
- Template,
58
- CommonProps,
59
- GeneratorOptions,
60
- GenerateProps,
61
- UIOptions,
62
- UIProps,
63
- PreviewProps,
64
- PreviewReactProps,
65
- DesignerProps,
66
- DesignerReactProps,
67
33
  checkTemplate,
68
34
  checkUIProps,
69
35
  checkPreviewProps,
70
36
  checkDesignerProps,
71
37
  checkGenerateProps,
72
38
  validateBarcodeInput,
73
- };
39
+ } from '@pdfme/common';
package/tsconfig.json CHANGED
@@ -3,6 +3,7 @@
3
3
  "noImplicitAny": true,
4
4
  "target": "es5",
5
5
  "esModuleInterop": true,
6
+ "isolatedModules": true,
6
7
  "declaration": true,
7
8
  "declarationDir": "dist/types",
8
9
  "module": "ES2015",