@unlev/exeq 0.6.0 → 0.6.1

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.
@@ -0,0 +1,247 @@
1
+ import { PDFDocument } from 'pdf-lib';
2
+
3
+ declare function generateId(): string;
4
+ type FieldType = 'text' | 'dropdown' | 'signature' | 'signed-date' | 'checkbox' | 'initials' | 'blackout' | 'whiteout';
5
+ type TextSubtype = 'freeform' | 'number' | 'date' | 'email' | 'phone';
6
+ interface FormField {
7
+ id: string;
8
+ type: FieldType;
9
+ textSubtype?: TextSubtype;
10
+ label: string;
11
+ placeholder: string;
12
+ required: boolean;
13
+ assignee: string;
14
+ page: number;
15
+ x: number;
16
+ y: number;
17
+ width: number;
18
+ height: number;
19
+ fontSize: number;
20
+ value: string;
21
+ inkColor?: string;
22
+ letterSpacing?: number;
23
+ lineHeight?: number;
24
+ align?: 'left' | 'center' | 'right';
25
+ bold?: boolean;
26
+ italic?: boolean;
27
+ underline?: boolean;
28
+ strikethrough?: boolean;
29
+ minLength?: number;
30
+ maxLength?: number;
31
+ fontFamily?: string;
32
+ options?: string[];
33
+ formula?: string;
34
+ locked?: boolean;
35
+ autoShrink?: boolean;
36
+ }
37
+ interface Template {
38
+ fields: FormField[];
39
+ signerRoles: string[];
40
+ pdfUrl: string;
41
+ }
42
+ declare const DEFAULT_SIGNER_ROLES: string[];
43
+ declare const SIGNER_ROLE_COLORS: Record<string, string>;
44
+ declare function getSignerColor(role: string): string;
45
+ declare function isRedactField(f: FormField | {
46
+ type: FieldType;
47
+ }): boolean;
48
+ declare function isSignatureField(f: FormField | {
49
+ type: FieldType;
50
+ }): boolean;
51
+ declare function isTextLikeField(f: FormField | {
52
+ type: FieldType;
53
+ }): boolean;
54
+ declare function getInputType(subtype?: TextSubtype): string;
55
+ declare function getCssFontFamily(fontFamily?: string): string | undefined;
56
+ declare function sortFieldsByPosition(fields: FormField[]): FormField[];
57
+ declare function preserveFieldValues(oldFields: FormField[], newFields: FormField[]): FormField[];
58
+ declare function getFieldValues(fields: FormField[]): Record<string, string>;
59
+ declare const FONT_FAMILIES: readonly [{
60
+ readonly value: "Helvetica";
61
+ readonly label: "Helvetica";
62
+ }, {
63
+ readonly value: "Courier";
64
+ readonly label: "Courier New";
65
+ }, {
66
+ readonly value: "TimesRoman";
67
+ readonly label: "Times New Roman";
68
+ }];
69
+ declare const FIELD_DEFAULTS: Record<FieldType, Partial<FormField>>;
70
+ /** Given a desired label and a list of existing labels, return a unique label by appending a number if needed. */
71
+ declare function uniqueLabel(desired: string, existingLabels: string[]): string;
72
+ declare function createField(type: FieldType, assignee: string, page: number, x: number, y: number, existingFields?: FormField[]): FormField;
73
+
74
+ type TransformFn = (value: string) => string;
75
+ type TransformMap = Record<string, TransformFn>;
76
+ /**
77
+ * Parse a date string robustly into a local Date (midnight, local TZ) so that
78
+ * getMonth/getDate/getFullYear are calendar-correct. Handles:
79
+ * - ISO date-only "YYYY-MM-DD" → parsed as LOCAL (avoids the classic UTC
80
+ * off-by-one where "2024-03-15" becomes the 14th in western timezones).
81
+ * - Excel serial numbers (a bare integer, e.g. "45000") → converted.
82
+ * - Anything else → native `new Date` (handles "M/D/YYYY", ISO datetimes, …).
83
+ * Returns null when unparseable.
84
+ */
85
+ declare function parseDate(value: string): Date | null;
86
+ /** Built-in transforms that ship with exeq. */
87
+ declare const BUILTIN_TRANSFORMS: TransformMap;
88
+ /**
89
+ * Resolve a single formula string against a set of fields and transforms.
90
+ * Formula format: "{{Source Field Label | transform}}" or "{{Source Field Label}}" (no transform = raw value).
91
+ * Multiple expressions can appear in one formula: "{{First}} {{Last}}" → "Jane Smith"
92
+ *
93
+ * Source resolution order for "{{Name}}":
94
+ * 1. a placed field whose label (case-insensitive) or id matches Name
95
+ * 2. `values[Name]` — imported/contextual data not tied to a placed field
96
+ * 3. the built-in `today` / `now` source (current date)
97
+ *
98
+ * @param values Extra named values (e.g. imported CSV/form data) made available
99
+ * to formula sources even when there is no placed field for them.
100
+ */
101
+ declare function resolveFormula(formula: string, fields: FormField[], customTransforms?: TransformMap, values?: Record<string, string>): string;
102
+ /**
103
+ * Resolve all formula fields in a fields array.
104
+ * Returns a new array with computed values filled in.
105
+ *
106
+ * @param values Extra named values available to formula sources (see resolveFormula).
107
+ */
108
+ declare function resolveAllFormulas(fields: FormField[], customTransforms?: TransformMap, values?: Record<string, string>): FormField[];
109
+
110
+ /** US Letter in PDF points (72pt = 1 in). */
111
+ declare const US_LETTER: [number, number];
112
+ /** US Legal in PDF points. */
113
+ declare const US_LEGAL: [number, number];
114
+ /** A4 in PDF points. */
115
+ declare const A4: [number, number];
116
+ /**
117
+ * Linear calibration applied to every field's percentage position and size.
118
+ * Use to align rendered output with a physical pre-printed form when the
119
+ * template's source PDF and the real paper don't exactly agree on crop or
120
+ * scale.
121
+ *
122
+ * Math (for an output page of size [pW, pH] pt):
123
+ * xPctOff = (xOffset / pW) * 100
124
+ * yPctOff = (yOffset / pH) * 100
125
+ * x' = x_pct * xScale + xPctOff
126
+ * y' = y_pct * yScale + yPctOff
127
+ * width' = width_pct * xScale
128
+ * height' = height_pct * yScale
129
+ *
130
+ * Defaults (scale=1, offsets=0) are a no-op.
131
+ */
132
+ interface Calibration {
133
+ /** Horizontal offset in PDF points; positive = right. */
134
+ xOffset: number;
135
+ /** Vertical offset in PDF points; positive = down (screen coords). */
136
+ yOffset: number;
137
+ /** Horizontal multiplier applied to x and width. */
138
+ xScale: number;
139
+ /** Vertical multiplier applied to y and height. */
140
+ yScale: number;
141
+ }
142
+ declare const DEFAULT_CALIBRATION: Calibration;
143
+ /**
144
+ * Returns a copy of `fields` with calibration applied to x / y / width /
145
+ * height. The math is page-size-aware so an `xOffset` of 5pt actually
146
+ * shifts the rendered output 5pt to the right.
147
+ *
148
+ * @param pageSize Output page size in pt used to convert pt offsets to
149
+ * percent offsets. Defaults to US Letter.
150
+ */
151
+ declare function applyCalibration(fields: FormField[], calibration: Calibration, pageSize?: [number, number]): FormField[];
152
+ interface FillPdfOptions {
153
+ /** Source PDF used as the background.
154
+ * - `string` (URL): fetched, embedded once per URL across the document.
155
+ * - `ArrayBuffer`: embedded uniquely each call.
156
+ * - `null`: render onto blank pages (overlay-only output). */
157
+ pdfSource: string | ArrayBuffer | null;
158
+ /** Fields to render on top of the background. */
159
+ fields: FormField[];
160
+ /** Override the output page size in PDF points.
161
+ * - With a `pdfSource`, source pages are drawn stretched to fit.
162
+ * - With `pdfSource: null`, blank pages of this size are created.
163
+ * - When omitted with a source, output uses the source's page sizes.
164
+ * - When omitted with `pdfSource: null`, defaults to US Letter. */
165
+ pageSize?: [number, number];
166
+ /** When `pdfSource` is null, how many blank pages to render. Default `1`.
167
+ * Fields with out-of-range `page` indices are skipped. */
168
+ pageCount?: number;
169
+ /** Run `resolveAllFormulas` on fields before rendering. */
170
+ resolveFormulas?: boolean;
171
+ /** Custom transforms merged with `BUILTIN_TRANSFORMS` during formula
172
+ * resolution. Only meaningful when `resolveFormulas` is true. */
173
+ customTransforms?: TransformMap;
174
+ /** Extra named values made available to formula sources (e.g. imported CSV/
175
+ * form data) even when there is no placed field for them. Only meaningful
176
+ * when `resolveFormulas` is true. */
177
+ formulaValues?: Record<string, string>;
178
+ /** Linear calibration applied to field positions before rendering. */
179
+ calibration?: Calibration;
180
+ }
181
+ /**
182
+ * Generates one filled PDF.
183
+ *
184
+ * const bytes = await generateFilledPdf({
185
+ * pdfSource: '/forms/template.pdf',
186
+ * fields: template.fields,
187
+ * pageSize: US_LETTER,
188
+ * resolveFormulas: true,
189
+ * });
190
+ *
191
+ * For multi-record output that shares a background, use `createPdfBuilder`
192
+ * — it dedupes the embedded source across all pages.
193
+ */
194
+ declare function generateFilledPdf(opts: FillPdfOptions, builderOptions?: Omit<CreatePdfBuilderOptions, 'pageSize'>): Promise<Uint8Array>;
195
+ interface PdfBuilder {
196
+ /** Underlying pdf-lib document — exposed for advanced post-processing
197
+ * (audit-trail pages, custom metadata, etc.). */
198
+ readonly doc: PDFDocument;
199
+ /** Append one record's pages to the output. */
200
+ addRecord(opts: FillPdfOptions): Promise<void>;
201
+ /** Finalize and return the merged PDF bytes. */
202
+ save(): Promise<Uint8Array>;
203
+ }
204
+ /** Document-level metadata applied at `save()` time. */
205
+ interface PdfMetadata {
206
+ title?: string;
207
+ author?: string;
208
+ subject?: string;
209
+ creator?: string;
210
+ producer?: string;
211
+ /** Document creation date. Pin to a fixed `Date` for reproducible output. */
212
+ creationDate?: Date;
213
+ /** Document modification date. Pin to a fixed `Date` for reproducible output. */
214
+ modificationDate?: Date;
215
+ }
216
+ interface CreatePdfBuilderOptions {
217
+ /** Default `pageSize` for any `addRecord` call that doesn't set its own. */
218
+ pageSize?: [number, number];
219
+ /** Document metadata applied at `save()` time. Pin `creationDate` and
220
+ * `modificationDate` to fixed `Date`s for byte-identical output across runs
221
+ * — pdf-lib otherwise stamps the current time, so two runs of identical
222
+ * input would differ. Useful for server-side generation and caching. */
223
+ metadata?: PdfMetadata;
224
+ }
225
+ /**
226
+ * Creates a builder that merges multiple filled records into one PDF.
227
+ *
228
+ * Resources (source PDFs indexed by URL, embedded fonts, signature PNGs) are
229
+ * embedded once across the whole document and reused — critical for
230
+ * mail-merge style batches where dozens of records share the same background.
231
+ *
232
+ * const builder = await createPdfBuilder({ pageSize: US_LETTER });
233
+ * for (const record of records) {
234
+ * await builder.addRecord({
235
+ * pdfSource: '/forms/template.pdf',
236
+ * fields: record.fields,
237
+ * resolveFormulas: true,
238
+ * });
239
+ * }
240
+ * const bytes = await builder.save();
241
+ * downloadPdf(bytes, 'merged.pdf');
242
+ */
243
+ declare function createPdfBuilder(defaults?: CreatePdfBuilderOptions): Promise<PdfBuilder>;
244
+ declare function downloadPdf(bytes: Uint8Array, filename: string): void;
245
+ declare function postPdfToCallback(bytes: Uint8Array, callbackUrl: string, filename: string): Promise<void>;
246
+
247
+ export { A4 as A, BUILTIN_TRANSFORMS as B, type Calibration as C, DEFAULT_CALIBRATION as D, preserveFieldValues as E, type FormField as F, resolveAllFormulas as G, resolveFormula as H, sortFieldsByPosition as I, uniqueLabel as J, type PdfBuilder as P, SIGNER_ROLE_COLORS as S, type Template as T, US_LEGAL as U, type TransformMap as a, type FieldType as b, type CreatePdfBuilderOptions as c, DEFAULT_SIGNER_ROLES as d, FIELD_DEFAULTS as e, FONT_FAMILIES as f, type FillPdfOptions as g, type PdfMetadata as h, type TextSubtype as i, type TransformFn as j, US_LETTER as k, applyCalibration as l, createField as m, createPdfBuilder as n, downloadPdf as o, generateFilledPdf as p, generateId as q, getCssFontFamily as r, getFieldValues as s, getInputType as t, getSignerColor as u, isRedactField as v, isSignatureField as w, isTextLikeField as x, parseDate as y, postPdfToCallback as z };
@@ -0,0 +1,247 @@
1
+ import { PDFDocument } from 'pdf-lib';
2
+
3
+ declare function generateId(): string;
4
+ type FieldType = 'text' | 'dropdown' | 'signature' | 'signed-date' | 'checkbox' | 'initials' | 'blackout' | 'whiteout';
5
+ type TextSubtype = 'freeform' | 'number' | 'date' | 'email' | 'phone';
6
+ interface FormField {
7
+ id: string;
8
+ type: FieldType;
9
+ textSubtype?: TextSubtype;
10
+ label: string;
11
+ placeholder: string;
12
+ required: boolean;
13
+ assignee: string;
14
+ page: number;
15
+ x: number;
16
+ y: number;
17
+ width: number;
18
+ height: number;
19
+ fontSize: number;
20
+ value: string;
21
+ inkColor?: string;
22
+ letterSpacing?: number;
23
+ lineHeight?: number;
24
+ align?: 'left' | 'center' | 'right';
25
+ bold?: boolean;
26
+ italic?: boolean;
27
+ underline?: boolean;
28
+ strikethrough?: boolean;
29
+ minLength?: number;
30
+ maxLength?: number;
31
+ fontFamily?: string;
32
+ options?: string[];
33
+ formula?: string;
34
+ locked?: boolean;
35
+ autoShrink?: boolean;
36
+ }
37
+ interface Template {
38
+ fields: FormField[];
39
+ signerRoles: string[];
40
+ pdfUrl: string;
41
+ }
42
+ declare const DEFAULT_SIGNER_ROLES: string[];
43
+ declare const SIGNER_ROLE_COLORS: Record<string, string>;
44
+ declare function getSignerColor(role: string): string;
45
+ declare function isRedactField(f: FormField | {
46
+ type: FieldType;
47
+ }): boolean;
48
+ declare function isSignatureField(f: FormField | {
49
+ type: FieldType;
50
+ }): boolean;
51
+ declare function isTextLikeField(f: FormField | {
52
+ type: FieldType;
53
+ }): boolean;
54
+ declare function getInputType(subtype?: TextSubtype): string;
55
+ declare function getCssFontFamily(fontFamily?: string): string | undefined;
56
+ declare function sortFieldsByPosition(fields: FormField[]): FormField[];
57
+ declare function preserveFieldValues(oldFields: FormField[], newFields: FormField[]): FormField[];
58
+ declare function getFieldValues(fields: FormField[]): Record<string, string>;
59
+ declare const FONT_FAMILIES: readonly [{
60
+ readonly value: "Helvetica";
61
+ readonly label: "Helvetica";
62
+ }, {
63
+ readonly value: "Courier";
64
+ readonly label: "Courier New";
65
+ }, {
66
+ readonly value: "TimesRoman";
67
+ readonly label: "Times New Roman";
68
+ }];
69
+ declare const FIELD_DEFAULTS: Record<FieldType, Partial<FormField>>;
70
+ /** Given a desired label and a list of existing labels, return a unique label by appending a number if needed. */
71
+ declare function uniqueLabel(desired: string, existingLabels: string[]): string;
72
+ declare function createField(type: FieldType, assignee: string, page: number, x: number, y: number, existingFields?: FormField[]): FormField;
73
+
74
+ type TransformFn = (value: string) => string;
75
+ type TransformMap = Record<string, TransformFn>;
76
+ /**
77
+ * Parse a date string robustly into a local Date (midnight, local TZ) so that
78
+ * getMonth/getDate/getFullYear are calendar-correct. Handles:
79
+ * - ISO date-only "YYYY-MM-DD" → parsed as LOCAL (avoids the classic UTC
80
+ * off-by-one where "2024-03-15" becomes the 14th in western timezones).
81
+ * - Excel serial numbers (a bare integer, e.g. "45000") → converted.
82
+ * - Anything else → native `new Date` (handles "M/D/YYYY", ISO datetimes, …).
83
+ * Returns null when unparseable.
84
+ */
85
+ declare function parseDate(value: string): Date | null;
86
+ /** Built-in transforms that ship with exeq. */
87
+ declare const BUILTIN_TRANSFORMS: TransformMap;
88
+ /**
89
+ * Resolve a single formula string against a set of fields and transforms.
90
+ * Formula format: "{{Source Field Label | transform}}" or "{{Source Field Label}}" (no transform = raw value).
91
+ * Multiple expressions can appear in one formula: "{{First}} {{Last}}" → "Jane Smith"
92
+ *
93
+ * Source resolution order for "{{Name}}":
94
+ * 1. a placed field whose label (case-insensitive) or id matches Name
95
+ * 2. `values[Name]` — imported/contextual data not tied to a placed field
96
+ * 3. the built-in `today` / `now` source (current date)
97
+ *
98
+ * @param values Extra named values (e.g. imported CSV/form data) made available
99
+ * to formula sources even when there is no placed field for them.
100
+ */
101
+ declare function resolveFormula(formula: string, fields: FormField[], customTransforms?: TransformMap, values?: Record<string, string>): string;
102
+ /**
103
+ * Resolve all formula fields in a fields array.
104
+ * Returns a new array with computed values filled in.
105
+ *
106
+ * @param values Extra named values available to formula sources (see resolveFormula).
107
+ */
108
+ declare function resolveAllFormulas(fields: FormField[], customTransforms?: TransformMap, values?: Record<string, string>): FormField[];
109
+
110
+ /** US Letter in PDF points (72pt = 1 in). */
111
+ declare const US_LETTER: [number, number];
112
+ /** US Legal in PDF points. */
113
+ declare const US_LEGAL: [number, number];
114
+ /** A4 in PDF points. */
115
+ declare const A4: [number, number];
116
+ /**
117
+ * Linear calibration applied to every field's percentage position and size.
118
+ * Use to align rendered output with a physical pre-printed form when the
119
+ * template's source PDF and the real paper don't exactly agree on crop or
120
+ * scale.
121
+ *
122
+ * Math (for an output page of size [pW, pH] pt):
123
+ * xPctOff = (xOffset / pW) * 100
124
+ * yPctOff = (yOffset / pH) * 100
125
+ * x' = x_pct * xScale + xPctOff
126
+ * y' = y_pct * yScale + yPctOff
127
+ * width' = width_pct * xScale
128
+ * height' = height_pct * yScale
129
+ *
130
+ * Defaults (scale=1, offsets=0) are a no-op.
131
+ */
132
+ interface Calibration {
133
+ /** Horizontal offset in PDF points; positive = right. */
134
+ xOffset: number;
135
+ /** Vertical offset in PDF points; positive = down (screen coords). */
136
+ yOffset: number;
137
+ /** Horizontal multiplier applied to x and width. */
138
+ xScale: number;
139
+ /** Vertical multiplier applied to y and height. */
140
+ yScale: number;
141
+ }
142
+ declare const DEFAULT_CALIBRATION: Calibration;
143
+ /**
144
+ * Returns a copy of `fields` with calibration applied to x / y / width /
145
+ * height. The math is page-size-aware so an `xOffset` of 5pt actually
146
+ * shifts the rendered output 5pt to the right.
147
+ *
148
+ * @param pageSize Output page size in pt used to convert pt offsets to
149
+ * percent offsets. Defaults to US Letter.
150
+ */
151
+ declare function applyCalibration(fields: FormField[], calibration: Calibration, pageSize?: [number, number]): FormField[];
152
+ interface FillPdfOptions {
153
+ /** Source PDF used as the background.
154
+ * - `string` (URL): fetched, embedded once per URL across the document.
155
+ * - `ArrayBuffer`: embedded uniquely each call.
156
+ * - `null`: render onto blank pages (overlay-only output). */
157
+ pdfSource: string | ArrayBuffer | null;
158
+ /** Fields to render on top of the background. */
159
+ fields: FormField[];
160
+ /** Override the output page size in PDF points.
161
+ * - With a `pdfSource`, source pages are drawn stretched to fit.
162
+ * - With `pdfSource: null`, blank pages of this size are created.
163
+ * - When omitted with a source, output uses the source's page sizes.
164
+ * - When omitted with `pdfSource: null`, defaults to US Letter. */
165
+ pageSize?: [number, number];
166
+ /** When `pdfSource` is null, how many blank pages to render. Default `1`.
167
+ * Fields with out-of-range `page` indices are skipped. */
168
+ pageCount?: number;
169
+ /** Run `resolveAllFormulas` on fields before rendering. */
170
+ resolveFormulas?: boolean;
171
+ /** Custom transforms merged with `BUILTIN_TRANSFORMS` during formula
172
+ * resolution. Only meaningful when `resolveFormulas` is true. */
173
+ customTransforms?: TransformMap;
174
+ /** Extra named values made available to formula sources (e.g. imported CSV/
175
+ * form data) even when there is no placed field for them. Only meaningful
176
+ * when `resolveFormulas` is true. */
177
+ formulaValues?: Record<string, string>;
178
+ /** Linear calibration applied to field positions before rendering. */
179
+ calibration?: Calibration;
180
+ }
181
+ /**
182
+ * Generates one filled PDF.
183
+ *
184
+ * const bytes = await generateFilledPdf({
185
+ * pdfSource: '/forms/template.pdf',
186
+ * fields: template.fields,
187
+ * pageSize: US_LETTER,
188
+ * resolveFormulas: true,
189
+ * });
190
+ *
191
+ * For multi-record output that shares a background, use `createPdfBuilder`
192
+ * — it dedupes the embedded source across all pages.
193
+ */
194
+ declare function generateFilledPdf(opts: FillPdfOptions, builderOptions?: Omit<CreatePdfBuilderOptions, 'pageSize'>): Promise<Uint8Array>;
195
+ interface PdfBuilder {
196
+ /** Underlying pdf-lib document — exposed for advanced post-processing
197
+ * (audit-trail pages, custom metadata, etc.). */
198
+ readonly doc: PDFDocument;
199
+ /** Append one record's pages to the output. */
200
+ addRecord(opts: FillPdfOptions): Promise<void>;
201
+ /** Finalize and return the merged PDF bytes. */
202
+ save(): Promise<Uint8Array>;
203
+ }
204
+ /** Document-level metadata applied at `save()` time. */
205
+ interface PdfMetadata {
206
+ title?: string;
207
+ author?: string;
208
+ subject?: string;
209
+ creator?: string;
210
+ producer?: string;
211
+ /** Document creation date. Pin to a fixed `Date` for reproducible output. */
212
+ creationDate?: Date;
213
+ /** Document modification date. Pin to a fixed `Date` for reproducible output. */
214
+ modificationDate?: Date;
215
+ }
216
+ interface CreatePdfBuilderOptions {
217
+ /** Default `pageSize` for any `addRecord` call that doesn't set its own. */
218
+ pageSize?: [number, number];
219
+ /** Document metadata applied at `save()` time. Pin `creationDate` and
220
+ * `modificationDate` to fixed `Date`s for byte-identical output across runs
221
+ * — pdf-lib otherwise stamps the current time, so two runs of identical
222
+ * input would differ. Useful for server-side generation and caching. */
223
+ metadata?: PdfMetadata;
224
+ }
225
+ /**
226
+ * Creates a builder that merges multiple filled records into one PDF.
227
+ *
228
+ * Resources (source PDFs indexed by URL, embedded fonts, signature PNGs) are
229
+ * embedded once across the whole document and reused — critical for
230
+ * mail-merge style batches where dozens of records share the same background.
231
+ *
232
+ * const builder = await createPdfBuilder({ pageSize: US_LETTER });
233
+ * for (const record of records) {
234
+ * await builder.addRecord({
235
+ * pdfSource: '/forms/template.pdf',
236
+ * fields: record.fields,
237
+ * resolveFormulas: true,
238
+ * });
239
+ * }
240
+ * const bytes = await builder.save();
241
+ * downloadPdf(bytes, 'merged.pdf');
242
+ */
243
+ declare function createPdfBuilder(defaults?: CreatePdfBuilderOptions): Promise<PdfBuilder>;
244
+ declare function downloadPdf(bytes: Uint8Array, filename: string): void;
245
+ declare function postPdfToCallback(bytes: Uint8Array, callbackUrl: string, filename: string): Promise<void>;
246
+
247
+ export { A4 as A, BUILTIN_TRANSFORMS as B, type Calibration as C, DEFAULT_CALIBRATION as D, preserveFieldValues as E, type FormField as F, resolveAllFormulas as G, resolveFormula as H, sortFieldsByPosition as I, uniqueLabel as J, type PdfBuilder as P, SIGNER_ROLE_COLORS as S, type Template as T, US_LEGAL as U, type TransformMap as a, type FieldType as b, type CreatePdfBuilderOptions as c, DEFAULT_SIGNER_ROLES as d, FIELD_DEFAULTS as e, FONT_FAMILIES as f, type FillPdfOptions as g, type PdfMetadata as h, type TextSubtype as i, type TransformFn as j, US_LETTER as k, applyCalibration as l, createField as m, createPdfBuilder as n, downloadPdf as o, generateFilledPdf as p, generateId as q, getCssFontFamily as r, getFieldValues as s, getInputType as t, getSignerColor as u, isRedactField as v, isSignatureField as w, isTextLikeField as x, parseDate as y, postPdfToCallback as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unlev/exeq",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Embeddable PDF form builder and document signing — client-side, no backend required",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -20,20 +20,7 @@
20
20
  "./styles": "./dist/index.css"
21
21
  },
22
22
  "files": [
23
- "dist/index.js",
24
- "dist/index.mjs",
25
- "dist/index.d.ts",
26
- "dist/index.d.mts",
27
- "dist/index.css",
28
- "dist/index.css.map",
29
- "dist/index.js.map",
30
- "dist/index.mjs.map",
31
- "dist/server.js",
32
- "dist/server.mjs",
33
- "dist/server.d.ts",
34
- "dist/server.d.mts",
35
- "dist/server.js.map",
36
- "dist/server.mjs.map"
23
+ "dist"
37
24
  ],
38
25
  "sideEffects": [
39
26
  "*.css"