@pdfme/common 6.1.1 → 6.1.2
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/helper.d.ts +30 -0
- package/dist/index.d.ts +8 -4
- package/dist/index.js +418 -206
- package/dist/index.js.map +1 -1
- package/dist/pageSize.d.ts +53 -0
- package/dist/schema.d.ts +50 -105
- package/dist/splitRange.d.ts +5 -0
- package/dist/types.d.ts +5 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/helper.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PDFDocument, PDFPage } from '@pdfme/pdf-lib';
|
|
1
2
|
import { Template, Font, BasePdf, Plugins, BlankPdf } from './types.js';
|
|
2
3
|
export declare const cloneDeep: typeof structuredClone;
|
|
3
4
|
export declare const getFallbackFontName: (font: Font) => string;
|
|
@@ -16,6 +17,35 @@ export declare const getInputFromTemplate: (template: Template) => {
|
|
|
16
17
|
[key: string]: string;
|
|
17
18
|
}[];
|
|
18
19
|
export declare const isUrlSafeToFetch: (urlString: string) => boolean;
|
|
20
|
+
export type PdfLinkAnnotationRect = {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
};
|
|
26
|
+
export declare const normalizeSafeLinkUri: (uri: string) => string | undefined;
|
|
27
|
+
export declare const getInternalLinkTarget: (href: string) => string | undefined;
|
|
28
|
+
export declare const normalizeInternalLinkHref: (href: string) => string | undefined;
|
|
29
|
+
export declare const normalizeLinkHref: (href: string) => string | undefined;
|
|
30
|
+
export declare const resetInternalLinkAnnotations: (_cache: Map<string | number, unknown>) => void;
|
|
31
|
+
export declare const registerInternalLinkAnchor: (arg: {
|
|
32
|
+
_cache: Map<string | number, unknown>;
|
|
33
|
+
name: string;
|
|
34
|
+
page: PDFPage;
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
}) => void;
|
|
38
|
+
export declare const registerInternalLinkAnnotation: (arg: {
|
|
39
|
+
_cache: Map<string | number, unknown>;
|
|
40
|
+
page: PDFPage;
|
|
41
|
+
targetName: string;
|
|
42
|
+
rect: PdfLinkAnnotationRect;
|
|
43
|
+
borderWidth?: number;
|
|
44
|
+
}) => void;
|
|
45
|
+
export declare const applyInternalLinkAnnotations: (arg: {
|
|
46
|
+
_cache: Map<string | number, unknown>;
|
|
47
|
+
pdfDoc: PDFDocument;
|
|
48
|
+
}) => void;
|
|
19
49
|
export declare const getB64BasePdf: (customPdf: ArrayBuffer | Uint8Array | string) => Promise<string>;
|
|
20
50
|
export declare const isBlankPdf: (basePdf: BasePdf) => basePdf is BlankPdf;
|
|
21
51
|
export declare const b64toUint8Array: (base64: string) => Uint8Array<ArrayBuffer>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { PDFME_VERSION } from './version.js';
|
|
2
2
|
import { MM_TO_PT_RATIO, PT_TO_MM_RATIO, PT_TO_PX_RATIO, BLANK_PDF, BLANK_A4_PDF, CUSTOM_A4_PDF, ZOOM, DEFAULT_FONT_NAME } from './constants.js';
|
|
3
|
-
import type { ChangeSchemaItem, ChangeSchemas, SchemaPageArray, PropPanel, PropPanelSchema, PropPanelWidgetProps, PDFRenderProps, Mode, UIRenderProps, Plugin, Lang, Dict, Size, Schema, SchemaForUI, Font, ColorType, BasePdf, BlankPdf, CustomPdf, Template, CommonOptions, GeneratorOptions, Plugins, PluginRegistry, GenerateProps, UIOptions, UIProps, PreviewProps, DesignerProps, DynamicLayoutArgs, DynamicLayoutCallbackResult, DynamicLayoutPatchArgs, DynamicLayoutResult, GetDynamicLayout } from './types.js';
|
|
4
|
-
import {
|
|
3
|
+
import type { ChangeSchemaItem, ChangeSchemas, SchemaPageArray, PropPanel, PropPanelSchema, PropPanelWidgetProps, PDFRenderProps, Mode, UIRenderProps, Plugin, Lang, Dict, Size, Schema, SchemaForUI, Font, ColorType, DynamicLayoutRange, DynamicLayoutSplitRange, BasePdf, BlankPdf, CustomPdf, Template, CommonOptions, GeneratorOptions, Plugins, PluginRegistry, GenerateProps, UIOptions, UIProps, PreviewProps, DesignerProps, DynamicLayoutArgs, DynamicLayoutCallbackResult, DynamicLayoutPatchArgs, DynamicLayoutResult, GetDynamicLayout } from './types.js';
|
|
4
|
+
import type { PdfLinkAnnotationRect } from './helper.js';
|
|
5
|
+
import type { PageOrientation, PageSize, PageSizePreset } from './pageSize.js';
|
|
6
|
+
import { cloneDeep, getFallbackFontName, getDefaultFont, getB64BasePdf, b64toUint8Array, checkFont, checkInputs, checkUIOptions, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, mm2pt, pt2mm, pt2px, px2mm, isHexValid, getInputFromTemplate, isBlankPdf, isUrlSafeToFetch, getInternalLinkTarget, normalizeInternalLinkHref, normalizeLinkHref, normalizeSafeLinkUri, registerInternalLinkAnchor, registerInternalLinkAnnotation, resetInternalLinkAnnotations, applyInternalLinkAnnotations } from './helper.js';
|
|
7
|
+
import { PAGE_SIZE_PRESETS, detectPaperSize, resolvePageSize } from './pageSize.js';
|
|
5
8
|
import { getDynamicTemplate } from './dynamicTemplate.js';
|
|
9
|
+
import { createDynamicLayoutSplitRange, getDynamicLayoutSplitRange } from './splitRange.js';
|
|
6
10
|
import { replacePlaceholders } from './expression.js';
|
|
7
11
|
import { pluginRegistry } from './pluginRegistry.js';
|
|
8
|
-
export { PDFME_VERSION, MM_TO_PT_RATIO, PT_TO_MM_RATIO, PT_TO_PX_RATIO, BLANK_PDF, BLANK_A4_PDF, CUSTOM_A4_PDF, ZOOM, DEFAULT_FONT_NAME, cloneDeep, getFallbackFontName, getDefaultFont, getB64BasePdf, b64toUint8Array, mm2pt, pt2mm, pt2px, px2mm, isHexValid, getInputFromTemplate, isBlankPdf, getDynamicTemplate, replacePlaceholders, checkFont, checkInputs, checkUIOptions, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, pluginRegistry, isUrlSafeToFetch, };
|
|
9
|
-
export type { Lang, Dict, Size, Schema, SchemaForUI, Font, ColorType, BasePdf, BlankPdf, CustomPdf, Template, CommonOptions, GeneratorOptions, Plugin, Plugins, PluginRegistry, GenerateProps, UIOptions, UIProps, PreviewProps, DesignerProps, ChangeSchemaItem, ChangeSchemas, SchemaPageArray, PropPanel, PropPanelSchema, PropPanelWidgetProps, PDFRenderProps, UIRenderProps, Mode, DynamicLayoutArgs, DynamicLayoutCallbackResult, DynamicLayoutPatchArgs, DynamicLayoutResult, GetDynamicLayout, };
|
|
12
|
+
export { PDFME_VERSION, MM_TO_PT_RATIO, PT_TO_MM_RATIO, PT_TO_PX_RATIO, BLANK_PDF, BLANK_A4_PDF, CUSTOM_A4_PDF, ZOOM, DEFAULT_FONT_NAME, cloneDeep, getFallbackFontName, getDefaultFont, getB64BasePdf, b64toUint8Array, mm2pt, pt2mm, pt2px, px2mm, isHexValid, getInputFromTemplate, isBlankPdf, getDynamicTemplate, replacePlaceholders, checkFont, checkInputs, checkUIOptions, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, pluginRegistry, isUrlSafeToFetch, getInternalLinkTarget, normalizeInternalLinkHref, normalizeLinkHref, normalizeSafeLinkUri, registerInternalLinkAnchor, registerInternalLinkAnnotation, resetInternalLinkAnnotations, applyInternalLinkAnnotations, PAGE_SIZE_PRESETS, detectPaperSize, resolvePageSize, createDynamicLayoutSplitRange, getDynamicLayoutSplitRange, };
|
|
13
|
+
export type { Lang, Dict, Size, Schema, SchemaForUI, Font, ColorType, DynamicLayoutRange, DynamicLayoutSplitRange, BasePdf, BlankPdf, CustomPdf, Template, CommonOptions, GeneratorOptions, Plugin, Plugins, PluginRegistry, GenerateProps, UIOptions, UIProps, PreviewProps, DesignerProps, ChangeSchemaItem, ChangeSchemas, SchemaPageArray, PropPanel, PropPanelSchema, PropPanelWidgetProps, PDFRenderProps, UIRenderProps, Mode, DynamicLayoutArgs, DynamicLayoutCallbackResult, DynamicLayoutPatchArgs, DynamicLayoutResult, GetDynamicLayout, PdfLinkAnnotationRect, PageOrientation, PageSize, PageSizePreset, };
|