@pdfme/common 1.0.0-beta.10
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/.eslintrc.js +31 -0
- package/declaration.d.ts +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.LICENSE.txt +6 -0
- package/dist/index.js.map +1 -0
- package/dist/types/constants.d.ts +6 -0
- package/dist/types/helper.d.ts +15 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/schema.d.ts +3613 -0
- package/dist/types/type.d.ts +64 -0
- package/package.json +57 -0
- package/src/assets/Helvetica.ttf +0 -0
- package/src/constants.ts +8 -0
- package/src/helper.ts +214 -0
- package/src/index.ts +95 -0
- package/src/schema.ts +118 -0
- package/src/type.ts +58 -0
- package/tsconfig.json +21 -0
- package/webpack.config.js +54 -0
@@ -0,0 +1,6 @@
|
|
1
|
+
export declare const DEFAULT_FONT_SIZE = 13;
|
2
|
+
export declare const DEFAULT_ALIGNMENT = "left";
|
3
|
+
export declare const DEFAULT_LINE_HEIGHT = 1;
|
4
|
+
export declare const DEFAULT_CHARACTER_SPACING = 0;
|
5
|
+
export declare const DEFAULT_FONT_COLOR = "#000";
|
6
|
+
export declare const BLANK_PDF = "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MKNSAwIG9iago8PAovRmlsdGVyIC9GbGF0ZURlY29kZQovTGVuZ3RoIDM4Cj4+CnN0cmVhbQp4nCvkMlAwUDC1NNUzMVGwMDHUszRSKErlCtfiyuMK5AIAXQ8GCgplbmRzdHJlYW0KZW5kb2JqCjQgMCBvYmoKPDwKL1R5cGUgL1BhZ2UKL01lZGlhQm94IFswIDAgNTk1LjQ0IDg0MS45Ml0KL1Jlc291cmNlcyA8PAo+PgovQ29udGVudHMgNSAwIFIKL1BhcmVudCAyIDAgUgo+PgplbmRvYmoKMiAwIG9iago8PAovVHlwZSAvUGFnZXMKL0tpZHMgWzQgMCBSXQovQ291bnQgMQo+PgplbmRvYmoKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwovUGFnZXMgMiAwIFIKPj4KZW5kb2JqCjMgMCBvYmoKPDwKL3RyYXBwZWQgKGZhbHNlKQovQ3JlYXRvciAoU2VyaWYgQWZmaW5pdHkgRGVzaWduZXIgMS4xMC40KQovVGl0bGUgKFVudGl0bGVkLnBkZikKL0NyZWF0aW9uRGF0ZSAoRDoyMDIyMDEwNjE0MDg1OCswOScwMCcpCi9Qcm9kdWNlciAoaUxvdmVQREYpCi9Nb2REYXRlIChEOjIwMjIwMTA2MDUwOTA5WikKPj4KZW5kb2JqCjYgMCBvYmoKPDwKL1NpemUgNwovUm9vdCAxIDAgUgovSW5mbyAzIDAgUgovSUQgWzwyODhCM0VENTAyOEU0MDcyNERBNzNCOUE0Nzk4OUEwQT4gPEY1RkJGNjg4NkVERDZBQUNBNDRCNEZDRjBBRDUxRDlDPl0KL1R5cGUgL1hSZWYKL1cgWzEgMiAyXQovRmlsdGVyIC9GbGF0ZURlY29kZQovSW5kZXggWzAgN10KL0xlbmd0aCAzNgo+PgpzdHJlYW0KeJxjYGD4/5+RUZmBgZHhFZBgDAGxakAEP5BgEmFgAABlRwQJCmVuZHN0cmVhbQplbmRvYmoKc3RhcnR4cmVmCjUzMgolJUVPRgo=";
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { Template, BasePdf, Font, BarCodeType } from './type';
|
2
|
+
export declare const getB64BasePdf: (basePdf: BasePdf) => string | Promise<string>;
|
3
|
+
export declare const b64toUint8Array: (base64: string) => Uint8Array;
|
4
|
+
export declare const getFallbackFontName: (font: Font) => string;
|
5
|
+
export declare const getDefaultFont: () => Font;
|
6
|
+
export declare const checkFont: (arg: {
|
7
|
+
font: Font;
|
8
|
+
template: Template;
|
9
|
+
}) => void;
|
10
|
+
export declare const checkTemplate: (data: unknown) => void;
|
11
|
+
export declare const checkUIProps: (data: unknown) => void;
|
12
|
+
export declare const checkPreviewProps: (data: unknown) => void;
|
13
|
+
export declare const checkDesignerProps: (data: unknown) => void;
|
14
|
+
export declare const checkGenerateProps: (data: unknown) => void;
|
15
|
+
export declare const validateBarcodeInput: (type: BarCodeType, input: string) => boolean;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { DEFAULT_FONT_SIZE, DEFAULT_ALIGNMENT, DEFAULT_LINE_HEIGHT, DEFAULT_CHARACTER_SPACING, DEFAULT_FONT_COLOR, BLANK_PDF } from './constants';
|
2
|
+
import { schemaTypes, isImageSchema, isBarcodeSchema, isTextSchema } from './type';
|
3
|
+
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';
|
4
|
+
import { getB64BasePdf, b64toUint8Array, getFallbackFontName, getDefaultFont, checkFont, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, validateBarcodeInput } from './helper';
|
5
|
+
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, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, validateBarcodeInput, };
|
6
|
+
export type { Lang, Size, Alignment, SchemaType, BarCodeType, TextSchema, ImageSchema, BarcodeSchema, Schema, SchemaForUI, Font, BasePdf, Template, CommonProps, GeneratorOptions, GenerateProps, UIOptions, UIProps, PreviewProps, PreviewReactProps, DesignerProps, DesignerReactProps, };
|