@pdfme/common
Advanced tools
Comparing version 1.1.5 to 1.1.6
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.validateBarcodeInput = exports.checkGenerateProps = exports.checkDesignerProps = exports.checkPreviewProps = exports.checkUIProps = exports.checkTemplate = exports.checkUIOptions = exports.checkInputs = exports.checkFont = exports.getDefaultFont = exports.getFallbackFontName = exports.b64toUint8Array = exports.getB64BasePdf = exports.isBarcodeSchema = exports.isImageSchema = exports.isTextSchema = exports.schemaTypes = exports.BLANK_PDF = exports.DEFAULT_FONT_COLOR = exports.DEFAULT_CHARACTER_SPACING = exports.DEFAULT_LINE_HEIGHT = exports.DEFAULT_ALIGNMENT = exports.DEFAULT_FONT_SIZE = void 0; | ||
exports.validateBarcodeInput = exports.checkGenerateProps = exports.checkDesignerProps = exports.checkPreviewProps = exports.checkUIProps = exports.checkTemplate = exports.checkUIOptions = exports.checkInputs = exports.checkFont = exports.getDefaultFont = exports.getFallbackFontName = exports.b64toUint8Array = exports.getB64BasePdf = exports.isBarcodeSchema = exports.isImageSchema = exports.isTextSchema = exports.schemaTypes = exports.HELVETICA = exports.BLANK_PDF = exports.DEFAULT_FONT_COLOR = exports.DEFAULT_CHARACTER_SPACING = exports.DEFAULT_LINE_HEIGHT = exports.DEFAULT_ALIGNMENT = exports.DEFAULT_FONT_SIZE = void 0; | ||
const constants_js_1 = require("./constants.js"); | ||
@@ -11,2 +11,3 @@ Object.defineProperty(exports, "DEFAULT_FONT_SIZE", { enumerable: true, get: function () { return constants_js_1.DEFAULT_FONT_SIZE; } }); | ||
Object.defineProperty(exports, "BLANK_PDF", { enumerable: true, get: function () { return constants_js_1.BLANK_PDF; } }); | ||
Object.defineProperty(exports, "HELVETICA", { enumerable: true, get: function () { return constants_js_1.HELVETICA; } }); | ||
const type_js_1 = require("./type.js"); | ||
@@ -13,0 +14,0 @@ Object.defineProperty(exports, "schemaTypes", { enumerable: true, get: function () { return type_js_1.schemaTypes; } }); |
@@ -45,5 +45,8 @@ "use strict"; | ||
const Uint8ArraySchema = zod_1.z.any().refine((v) => v instanceof Uint8Array); | ||
const Data = zod_1.z.union([ArrayBufferSchema, Uint8ArraySchema]); | ||
exports.Font = zod_1.z.record(zod_1.z.object({ data: Data, fallback: zod_1.z.boolean().optional(), subset: zod_1.z.boolean().optional() })); | ||
exports.BasePdf = zod_1.z.union([zod_1.z.string(), Data]); | ||
exports.Font = zod_1.z.record(zod_1.z.object({ | ||
data: zod_1.z.union([zod_1.z.string(), ArrayBufferSchema, Uint8ArraySchema]), | ||
fallback: zod_1.z.boolean().optional(), | ||
subset: zod_1.z.boolean().optional(), | ||
})); | ||
exports.BasePdf = zod_1.z.union([zod_1.z.string(), ArrayBufferSchema, Uint8ArraySchema]); | ||
exports.Template = zod_1.z.object({ | ||
@@ -50,0 +53,0 @@ schemas: zod_1.z.array(zod_1.z.record(exports.Schema)), |
@@ -1,5 +0,5 @@ | ||
import { DEFAULT_FONT_SIZE, DEFAULT_ALIGNMENT, DEFAULT_LINE_HEIGHT, DEFAULT_CHARACTER_SPACING, DEFAULT_FONT_COLOR, BLANK_PDF, } from './constants.js'; | ||
import { DEFAULT_FONT_SIZE, DEFAULT_ALIGNMENT, DEFAULT_LINE_HEIGHT, DEFAULT_CHARACTER_SPACING, DEFAULT_FONT_COLOR, BLANK_PDF, HELVETICA, } from './constants.js'; | ||
import { schemaTypes, isImageSchema, isBarcodeSchema, isTextSchema } from './type.js'; | ||
import { getB64BasePdf, b64toUint8Array, getFallbackFontName, getDefaultFont, checkFont, checkInputs, checkUIOptions, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, validateBarcodeInput, } from './helper.js'; | ||
export { DEFAULT_FONT_SIZE, DEFAULT_ALIGNMENT, DEFAULT_LINE_HEIGHT, DEFAULT_CHARACTER_SPACING, DEFAULT_FONT_COLOR, BLANK_PDF, schemaTypes, isTextSchema, isImageSchema, isBarcodeSchema, getB64BasePdf, b64toUint8Array, getFallbackFontName, getDefaultFont, checkFont, checkInputs, checkUIOptions, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, validateBarcodeInput, }; | ||
export { DEFAULT_FONT_SIZE, DEFAULT_ALIGNMENT, DEFAULT_LINE_HEIGHT, DEFAULT_CHARACTER_SPACING, DEFAULT_FONT_COLOR, BLANK_PDF, HELVETICA, schemaTypes, isTextSchema, isImageSchema, isBarcodeSchema, getB64BasePdf, b64toUint8Array, getFallbackFontName, getDefaultFont, checkFont, checkInputs, checkUIOptions, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, validateBarcodeInput, }; | ||
//# sourceMappingURL=index.js.map |
@@ -42,5 +42,8 @@ /* eslint dot-notation: "off"*/ | ||
const Uint8ArraySchema = z.any().refine((v) => v instanceof Uint8Array); | ||
const Data = z.union([ArrayBufferSchema, Uint8ArraySchema]); | ||
export const Font = z.record(z.object({ data: Data, fallback: z.boolean().optional(), subset: z.boolean().optional() })); | ||
export const BasePdf = z.union([z.string(), Data]); | ||
export const Font = z.record(z.object({ | ||
data: z.union([z.string(), ArrayBufferSchema, Uint8ArraySchema]), | ||
fallback: z.boolean().optional(), | ||
subset: z.boolean().optional(), | ||
})); | ||
export const BasePdf = z.union([z.string(), ArrayBufferSchema, Uint8ArraySchema]); | ||
export const Template = z.object({ | ||
@@ -47,0 +50,0 @@ schemas: z.array(z.record(Schema)), |
@@ -1,6 +0,6 @@ | ||
import { DEFAULT_FONT_SIZE, DEFAULT_ALIGNMENT, DEFAULT_LINE_HEIGHT, DEFAULT_CHARACTER_SPACING, DEFAULT_FONT_COLOR, BLANK_PDF } from './constants.js'; | ||
import { DEFAULT_FONT_SIZE, DEFAULT_ALIGNMENT, DEFAULT_LINE_HEIGHT, DEFAULT_CHARACTER_SPACING, DEFAULT_FONT_COLOR, BLANK_PDF, HELVETICA } from './constants.js'; | ||
import { schemaTypes, isImageSchema, isBarcodeSchema, isTextSchema } from './type.js'; | ||
import type { Lang, Size, Alignment, SchemaType, BarCodeType, TextSchema, ImageSchema, BarcodeSchema, Schema, SchemaForUI, Font, BasePdf, Template, CommonProps, GeneratorOptions, GenerateProps, UIOptions, UIProps, PreviewProps, PreviewReactProps, DesignerProps, DesignerReactProps } from './type.js'; | ||
import { getB64BasePdf, b64toUint8Array, getFallbackFontName, getDefaultFont, checkFont, checkInputs, checkUIOptions, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, validateBarcodeInput } from './helper.js'; | ||
export { DEFAULT_FONT_SIZE, DEFAULT_ALIGNMENT, DEFAULT_LINE_HEIGHT, DEFAULT_CHARACTER_SPACING, DEFAULT_FONT_COLOR, BLANK_PDF, schemaTypes, isTextSchema, isImageSchema, isBarcodeSchema, getB64BasePdf, b64toUint8Array, getFallbackFontName, getDefaultFont, checkFont, checkInputs, checkUIOptions, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, validateBarcodeInput, }; | ||
export { DEFAULT_FONT_SIZE, DEFAULT_ALIGNMENT, DEFAULT_LINE_HEIGHT, DEFAULT_CHARACTER_SPACING, DEFAULT_FONT_COLOR, BLANK_PDF, HELVETICA, schemaTypes, isTextSchema, isImageSchema, isBarcodeSchema, getB64BasePdf, b64toUint8Array, getFallbackFontName, getDefaultFont, checkFont, checkInputs, checkUIOptions, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, validateBarcodeInput, }; | ||
export type { Lang, Size, Alignment, SchemaType, BarCodeType, TextSchema, ImageSchema, BarcodeSchema, Schema, SchemaForUI, Font, BasePdf, Template, CommonProps, GeneratorOptions, GenerateProps, UIOptions, UIProps, PreviewProps, PreviewReactProps, DesignerProps, DesignerReactProps, }; |
{ | ||
"name": "@pdfme/common", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"sideEffects": false, | ||
@@ -49,3 +49,3 @@ "author": "hand-dot", | ||
"dependencies": { | ||
"zod": "^3.11.6" | ||
"zod": "^3.20.2" | ||
}, | ||
@@ -52,0 +52,0 @@ "jest": { |
@@ -8,2 +8,3 @@ import { | ||
BLANK_PDF, | ||
HELVETICA, | ||
} from './constants.js'; | ||
@@ -58,2 +59,3 @@ import { schemaTypes, isImageSchema, isBarcodeSchema, isTextSchema } from './type.js'; | ||
BLANK_PDF, | ||
HELVETICA, | ||
schemaTypes, | ||
@@ -60,0 +62,0 @@ isTextSchema, |
@@ -54,9 +54,12 @@ /* eslint dot-notation: "off"*/ | ||
const Uint8ArraySchema: z.ZodSchema<Uint8Array> = z.any().refine((v) => v instanceof Uint8Array); | ||
const Data = z.union([ArrayBufferSchema, Uint8ArraySchema]); | ||
export const Font = z.record( | ||
z.object({ data: Data, fallback: z.boolean().optional(), subset: z.boolean().optional() }) | ||
z.object({ | ||
data: z.union([z.string(), ArrayBufferSchema, Uint8ArraySchema]), | ||
fallback: z.boolean().optional(), | ||
subset: z.boolean().optional(), | ||
}) | ||
); | ||
export const BasePdf = z.union([z.string(), Data]); | ||
export const BasePdf = z.union([z.string(), ArrayBufferSchema, Uint8ArraySchema]); | ||
@@ -63,0 +66,0 @@ export const Template = z.object({ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
1960905
12278
Updatedzod@^3.20.2