pretext-pdf 1.0.3 → 1.0.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.
- package/CHANGELOG.md +56 -0
- package/README.md +29 -0
- package/dist/schema.d.ts +425 -3
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +163 -24
- package/dist/schema.js.map +1 -1
- package/dist/types-public.d.ts +3 -1
- package/dist/types-public.d.ts.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +4 -2
- package/dist/validate.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,62 @@ Format: [Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/)
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## [1.0.5] — 2026-05-04
|
|
11
|
+
|
|
12
|
+
Schema coverage completion, `ValidationResult.warningCount`, and README API docs.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **`ValidationResult.warningCount`** — `validateDocument()` now returns `warningCount` alongside
|
|
17
|
+
`errorCount`. Computed by filtering `errors[]` by `severity === 'warning'`. MCP consumers no
|
|
18
|
+
longer need to derive it client-side.
|
|
19
|
+
|
|
20
|
+
- **JSON Schema: remaining field coverage** — `src/schema.ts` now covers all previously missing
|
|
21
|
+
fields across 9 element types:
|
|
22
|
+
- `inlineSpanSchema`: `dir`
|
|
23
|
+
- `paragraphSchema`: `columns`, `columnGap`, `tabularNumbers`, `hyphenate`
|
|
24
|
+
- `headingSchema`: `tabularNumbers`, `hyphenate`
|
|
25
|
+
- `blockquoteSchema`: `lineHeight`, `padding`, `paddingH`, `paddingV`, `underline`, `strikethrough`
|
|
26
|
+
- `calloutSchema`: `titleColor`, `fontWeight`, `lineHeight`, `padding`, `paddingH`, `paddingV`
|
|
27
|
+
- `listSchema`: `lineHeight`, `markerWidth`, `itemSpaceAfter`, `nestedNumberingStyle`; nested
|
|
28
|
+
items now carry `dir` and have a typed inner schema
|
|
29
|
+
- `tocSchema`: `titleFontSize`, `levelIndent`, `leader`, `entrySpacing`
|
|
30
|
+
- `formFieldSchema`: `borderColor`, `backgroundColor`, `keepTogether`, `defaultSelected`
|
|
31
|
+
- `richParagraphSchema`: `columns`, `columnGap`, `tabularNumbers`
|
|
32
|
+
|
|
33
|
+
- **README: `validateDocument` and `pretext-pdf/schema` documented** — both entry points now have
|
|
34
|
+
`### API reference` sections with code examples.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## [1.0.4] — 2026-05-04
|
|
39
|
+
|
|
40
|
+
Schema export hardening: post-release audit fixes addressing coverage gaps and a
|
|
41
|
+
malformed dialect URI.
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
|
|
45
|
+
- **`pretext-pdf/schema`: `$schema` dialect URI corrected** — was
|
|
46
|
+
`https://json-schema.org/draft/2020-12` (not a registered URI), now
|
|
47
|
+
`https://json-schema.org/draft/2020-12/schema`. Strict JSON Schema validators
|
|
48
|
+
(AJV, Smithery, VS Code) will now correctly identify the dialect.
|
|
49
|
+
- **`pretext-pdf/schema`: `hr` element spacing fields** — `spaceAbove` and
|
|
50
|
+
`spaceBelow` (the primary documented fields, default 12) were missing.
|
|
51
|
+
`spaceBefore` and `spaceAfter` are now correctly marked as aliases.
|
|
52
|
+
- **`pretext-pdf/schema`: `float-group` and `chart` element types** — both
|
|
53
|
+
first-class public element types were missing from the `content.items.anyOf`
|
|
54
|
+
list. Schema-driven tooling will now know they exist.
|
|
55
|
+
|
|
56
|
+
### Added (schema coverage)
|
|
57
|
+
|
|
58
|
+
- `pdfDocumentSchema.sections` — page-range header/footer overrides
|
|
59
|
+
- `headingSchema.annotation` — annotation field (was already on paragraph)
|
|
60
|
+
- `tableSchema.cellPaddingH` / `cellPaddingV` — primary table density controls
|
|
61
|
+
- `imageSchema.floatWidth` / `floatGap` / `floatSpans` — column-layout controls
|
|
62
|
+
for floated images
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
10
66
|
## [1.0.3] — 2026-05-03
|
|
11
67
|
|
|
12
68
|
Enhancements: JSON Schema export, simplified marked peer dep range, and internal API polish.
|
package/README.md
CHANGED
|
@@ -433,6 +433,35 @@ const pdf = await createPdf({ pageSize: 'A4' })
|
|
|
433
433
|
|
|
434
434
|
### `fromPdfmake(doc, opts?)` *(from `pretext-pdf/compat`)*
|
|
435
435
|
|
|
436
|
+
### `validateDocument(doc, opts?)` — non-throwing validation
|
|
437
|
+
|
|
438
|
+
```typescript
|
|
439
|
+
import { validateDocument } from 'pretext-pdf'
|
|
440
|
+
|
|
441
|
+
const result = validateDocument(doc, { strict: true })
|
|
442
|
+
// result: { valid, errors[], errorCount, warningCount }
|
|
443
|
+
|
|
444
|
+
if (!result.valid) {
|
|
445
|
+
for (const err of result.errors) {
|
|
446
|
+
console.log(`${err.severity} at ${err.path}: ${err.message}`)
|
|
447
|
+
if (err.suggestion) console.log(` → did you mean '${err.suggestion}'?`)
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
Unlike `validate()` which throws, `validateDocument()` always returns. Useful for MCP tools and agent preflight checks.
|
|
453
|
+
|
|
454
|
+
### `pdfDocumentSchema` *(from `pretext-pdf/schema`)*
|
|
455
|
+
|
|
456
|
+
Machine-readable JSON Schema for the `PdfDocument` type. Intended for editor tooling, MCP clients, and LLM context injection.
|
|
457
|
+
|
|
458
|
+
```typescript
|
|
459
|
+
import { pdfDocumentSchema } from 'pretext-pdf/schema'
|
|
460
|
+
|
|
461
|
+
// Use with ajv, json-schema-to-typescript, Smithery UI, or inject into LLM context:
|
|
462
|
+
const schemaString = JSON.stringify(pdfDocumentSchema, null, 2)
|
|
463
|
+
```
|
|
464
|
+
|
|
436
465
|
---
|
|
437
466
|
|
|
438
467
|
## Strict validation
|
package/dist/schema.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* import { pdfDocumentSchema } from 'pretext-pdf/schema'
|
|
10
10
|
*/
|
|
11
11
|
export declare const pdfDocumentSchema: {
|
|
12
|
-
readonly $schema: "https://json-schema.org/draft/2020-12";
|
|
12
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
13
13
|
readonly title: "PdfDocument";
|
|
14
14
|
readonly description: "Top-level descriptor for a pretext-pdf document.";
|
|
15
15
|
readonly type: "object";
|
|
@@ -88,6 +88,23 @@ export declare const pdfDocumentSchema: {
|
|
|
88
88
|
readonly smallCaps: {
|
|
89
89
|
readonly type: "boolean";
|
|
90
90
|
};
|
|
91
|
+
readonly tabularNumbers: {
|
|
92
|
+
readonly type: "boolean";
|
|
93
|
+
readonly description: "Render digits at fixed slot width for aligned numeric columns.";
|
|
94
|
+
};
|
|
95
|
+
readonly columns: {
|
|
96
|
+
readonly type: "number";
|
|
97
|
+
readonly description: "Number of columns for multi-column layout. Default: 1";
|
|
98
|
+
};
|
|
99
|
+
readonly columnGap: {
|
|
100
|
+
readonly type: "number";
|
|
101
|
+
readonly description: "Gap between columns in pt. Default: 24";
|
|
102
|
+
};
|
|
103
|
+
readonly hyphenate: {
|
|
104
|
+
readonly type: "boolean";
|
|
105
|
+
readonly const: false;
|
|
106
|
+
readonly description: "Set to false to disable hyphenation for this element.";
|
|
107
|
+
};
|
|
91
108
|
readonly annotation: {
|
|
92
109
|
readonly type: "object";
|
|
93
110
|
readonly required: readonly ["contents"];
|
|
@@ -189,6 +206,35 @@ export declare const pdfDocumentSchema: {
|
|
|
189
206
|
readonly smallCaps: {
|
|
190
207
|
readonly type: "boolean";
|
|
191
208
|
};
|
|
209
|
+
readonly tabularNumbers: {
|
|
210
|
+
readonly type: "boolean";
|
|
211
|
+
readonly description: "Render digits at fixed slot width for aligned numeric columns.";
|
|
212
|
+
};
|
|
213
|
+
readonly hyphenate: {
|
|
214
|
+
readonly type: "boolean";
|
|
215
|
+
readonly const: false;
|
|
216
|
+
readonly description: "Set to false to disable hyphenation for this element.";
|
|
217
|
+
};
|
|
218
|
+
readonly annotation: {
|
|
219
|
+
readonly type: "object";
|
|
220
|
+
readonly required: readonly ["contents"];
|
|
221
|
+
readonly properties: {
|
|
222
|
+
readonly contents: {
|
|
223
|
+
readonly type: "string";
|
|
224
|
+
};
|
|
225
|
+
readonly author: {
|
|
226
|
+
readonly type: "string";
|
|
227
|
+
};
|
|
228
|
+
readonly color: {
|
|
229
|
+
readonly type: "string";
|
|
230
|
+
readonly pattern: "^#[0-9A-Fa-f]{6}$";
|
|
231
|
+
readonly description: "6-digit hex color e.g. #FF0000";
|
|
232
|
+
};
|
|
233
|
+
readonly open: {
|
|
234
|
+
readonly type: "boolean";
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
};
|
|
192
238
|
};
|
|
193
239
|
}, {
|
|
194
240
|
readonly type: "object";
|
|
@@ -219,13 +265,21 @@ export declare const pdfDocumentSchema: {
|
|
|
219
265
|
readonly pattern: "^#[0-9A-Fa-f]{6}$";
|
|
220
266
|
readonly description: "6-digit hex color e.g. #FF0000";
|
|
221
267
|
};
|
|
268
|
+
readonly spaceAbove: {
|
|
269
|
+
readonly type: "number";
|
|
270
|
+
readonly description: "Space above line in pt. Default: 12. Primary field.";
|
|
271
|
+
};
|
|
272
|
+
readonly spaceBelow: {
|
|
273
|
+
readonly type: "number";
|
|
274
|
+
readonly description: "Space below line in pt. Default: 12. Primary field.";
|
|
275
|
+
};
|
|
222
276
|
readonly spaceBefore: {
|
|
223
277
|
readonly type: "number";
|
|
224
|
-
readonly description: "
|
|
278
|
+
readonly description: "Alias for spaceAbove (primary).";
|
|
225
279
|
};
|
|
226
280
|
readonly spaceAfter: {
|
|
227
281
|
readonly type: "number";
|
|
228
|
-
readonly description: "
|
|
282
|
+
readonly description: "Alias for spaceBelow (primary).";
|
|
229
283
|
};
|
|
230
284
|
};
|
|
231
285
|
}, {
|
|
@@ -278,6 +332,75 @@ export declare const pdfDocumentSchema: {
|
|
|
278
332
|
readonly floatText: {
|
|
279
333
|
readonly type: "string";
|
|
280
334
|
};
|
|
335
|
+
readonly floatWidth: {
|
|
336
|
+
readonly type: "number";
|
|
337
|
+
readonly description: "Image column width in pt. Default: 35% of content width.";
|
|
338
|
+
};
|
|
339
|
+
readonly floatGap: {
|
|
340
|
+
readonly type: "number";
|
|
341
|
+
readonly description: "Gap between image and text columns in pt. Default: 12";
|
|
342
|
+
};
|
|
343
|
+
readonly floatSpans: {
|
|
344
|
+
readonly type: "array";
|
|
345
|
+
readonly items: {
|
|
346
|
+
readonly type: "object";
|
|
347
|
+
readonly required: readonly ["text"];
|
|
348
|
+
readonly properties: {
|
|
349
|
+
readonly text: {
|
|
350
|
+
readonly type: "string";
|
|
351
|
+
};
|
|
352
|
+
readonly dir: {
|
|
353
|
+
readonly type: "string";
|
|
354
|
+
readonly enum: readonly ["ltr", "rtl", "auto"];
|
|
355
|
+
};
|
|
356
|
+
readonly fontFamily: {
|
|
357
|
+
readonly type: "string";
|
|
358
|
+
};
|
|
359
|
+
readonly fontWeight: {
|
|
360
|
+
readonly type: "number";
|
|
361
|
+
readonly enum: readonly [400, 700];
|
|
362
|
+
};
|
|
363
|
+
readonly fontStyle: {
|
|
364
|
+
readonly type: "string";
|
|
365
|
+
readonly enum: readonly ["normal", "italic"];
|
|
366
|
+
};
|
|
367
|
+
readonly color: {
|
|
368
|
+
readonly type: "string";
|
|
369
|
+
readonly pattern: "^#[0-9A-Fa-f]{6}$";
|
|
370
|
+
readonly description: "6-digit hex color e.g. #FF0000";
|
|
371
|
+
};
|
|
372
|
+
readonly fontSize: {
|
|
373
|
+
readonly type: "number";
|
|
374
|
+
};
|
|
375
|
+
readonly underline: {
|
|
376
|
+
readonly type: "boolean";
|
|
377
|
+
};
|
|
378
|
+
readonly strikethrough: {
|
|
379
|
+
readonly type: "boolean";
|
|
380
|
+
};
|
|
381
|
+
readonly url: {
|
|
382
|
+
readonly type: "string";
|
|
383
|
+
};
|
|
384
|
+
readonly href: {
|
|
385
|
+
readonly type: "string";
|
|
386
|
+
};
|
|
387
|
+
readonly verticalAlign: {
|
|
388
|
+
readonly type: "string";
|
|
389
|
+
readonly enum: readonly ["superscript", "subscript"];
|
|
390
|
+
};
|
|
391
|
+
readonly smallCaps: {
|
|
392
|
+
readonly type: "boolean";
|
|
393
|
+
};
|
|
394
|
+
readonly letterSpacing: {
|
|
395
|
+
readonly type: "number";
|
|
396
|
+
};
|
|
397
|
+
readonly footnoteRef: {
|
|
398
|
+
readonly type: "string";
|
|
399
|
+
};
|
|
400
|
+
};
|
|
401
|
+
};
|
|
402
|
+
readonly description: "Rich-text spans rendered alongside the image. Alternative to floatText.";
|
|
403
|
+
};
|
|
281
404
|
};
|
|
282
405
|
}, {
|
|
283
406
|
readonly type: "object";
|
|
@@ -407,6 +530,14 @@ export declare const pdfDocumentSchema: {
|
|
|
407
530
|
readonly fontSize: {
|
|
408
531
|
readonly type: "number";
|
|
409
532
|
};
|
|
533
|
+
readonly cellPaddingH: {
|
|
534
|
+
readonly type: "number";
|
|
535
|
+
readonly description: "Horizontal cell padding in pt. Default: 8";
|
|
536
|
+
};
|
|
537
|
+
readonly cellPaddingV: {
|
|
538
|
+
readonly type: "number";
|
|
539
|
+
readonly description: "Vertical cell padding in pt. Default: 6";
|
|
540
|
+
};
|
|
410
541
|
readonly spaceAfter: {
|
|
411
542
|
readonly type: "number";
|
|
412
543
|
readonly description: "Space in points (pt)";
|
|
@@ -437,6 +568,10 @@ export declare const pdfDocumentSchema: {
|
|
|
437
568
|
readonly text: {
|
|
438
569
|
readonly type: "string";
|
|
439
570
|
};
|
|
571
|
+
readonly dir: {
|
|
572
|
+
readonly type: "string";
|
|
573
|
+
readonly enum: readonly ["ltr", "rtl", "auto"];
|
|
574
|
+
};
|
|
440
575
|
readonly fontWeight: {
|
|
441
576
|
readonly type: "number";
|
|
442
577
|
readonly enum: readonly [400, 700];
|
|
@@ -444,6 +579,23 @@ export declare const pdfDocumentSchema: {
|
|
|
444
579
|
readonly items: {
|
|
445
580
|
readonly type: "array";
|
|
446
581
|
readonly description: "Nested list items (up to 2 levels)";
|
|
582
|
+
readonly items: {
|
|
583
|
+
readonly type: "object";
|
|
584
|
+
readonly required: readonly ["text"];
|
|
585
|
+
readonly properties: {
|
|
586
|
+
readonly text: {
|
|
587
|
+
readonly type: "string";
|
|
588
|
+
};
|
|
589
|
+
readonly dir: {
|
|
590
|
+
readonly type: "string";
|
|
591
|
+
readonly enum: readonly ["ltr", "rtl", "auto"];
|
|
592
|
+
};
|
|
593
|
+
readonly fontWeight: {
|
|
594
|
+
readonly type: "number";
|
|
595
|
+
readonly enum: readonly [400, 700];
|
|
596
|
+
};
|
|
597
|
+
};
|
|
598
|
+
};
|
|
447
599
|
};
|
|
448
600
|
};
|
|
449
601
|
};
|
|
@@ -454,9 +606,25 @@ export declare const pdfDocumentSchema: {
|
|
|
454
606
|
readonly indent: {
|
|
455
607
|
readonly type: "number";
|
|
456
608
|
};
|
|
609
|
+
readonly markerWidth: {
|
|
610
|
+
readonly type: "number";
|
|
611
|
+
readonly description: "Width reserved for marker column in pt. Default: 20";
|
|
612
|
+
};
|
|
457
613
|
readonly fontSize: {
|
|
458
614
|
readonly type: "number";
|
|
459
615
|
};
|
|
616
|
+
readonly lineHeight: {
|
|
617
|
+
readonly type: "number";
|
|
618
|
+
};
|
|
619
|
+
readonly itemSpaceAfter: {
|
|
620
|
+
readonly type: "number";
|
|
621
|
+
readonly description: "Space between list items in pt. Default: 4";
|
|
622
|
+
};
|
|
623
|
+
readonly nestedNumberingStyle: {
|
|
624
|
+
readonly type: "string";
|
|
625
|
+
readonly enum: readonly ["continue", "restart"];
|
|
626
|
+
readonly description: "How nested ordered counters behave. Default: continue";
|
|
627
|
+
};
|
|
460
628
|
readonly color: {
|
|
461
629
|
readonly type: "string";
|
|
462
630
|
readonly pattern: "^#[0-9A-Fa-f]{6}$";
|
|
@@ -518,6 +686,21 @@ export declare const pdfDocumentSchema: {
|
|
|
518
686
|
readonly fontSize: {
|
|
519
687
|
readonly type: "number";
|
|
520
688
|
};
|
|
689
|
+
readonly lineHeight: {
|
|
690
|
+
readonly type: "number";
|
|
691
|
+
};
|
|
692
|
+
readonly padding: {
|
|
693
|
+
readonly type: "number";
|
|
694
|
+
readonly description: "Shorthand for paddingH and paddingV.";
|
|
695
|
+
};
|
|
696
|
+
readonly paddingH: {
|
|
697
|
+
readonly type: "number";
|
|
698
|
+
readonly description: "Horizontal padding inside box in pt. Default: 16";
|
|
699
|
+
};
|
|
700
|
+
readonly paddingV: {
|
|
701
|
+
readonly type: "number";
|
|
702
|
+
readonly description: "Vertical padding inside box in pt. Default: 10";
|
|
703
|
+
};
|
|
521
704
|
readonly align: {
|
|
522
705
|
readonly type: "string";
|
|
523
706
|
readonly enum: readonly ["left", "center", "right", "justify"];
|
|
@@ -533,6 +716,12 @@ export declare const pdfDocumentSchema: {
|
|
|
533
716
|
readonly keepTogether: {
|
|
534
717
|
readonly type: "boolean";
|
|
535
718
|
};
|
|
719
|
+
readonly underline: {
|
|
720
|
+
readonly type: "boolean";
|
|
721
|
+
};
|
|
722
|
+
readonly strikethrough: {
|
|
723
|
+
readonly type: "boolean";
|
|
724
|
+
};
|
|
536
725
|
};
|
|
537
726
|
}, {
|
|
538
727
|
readonly type: "object";
|
|
@@ -617,12 +806,36 @@ export declare const pdfDocumentSchema: {
|
|
|
617
806
|
readonly pattern: "^#[0-9A-Fa-f]{6}$";
|
|
618
807
|
readonly description: "6-digit hex color e.g. #FF0000";
|
|
619
808
|
};
|
|
809
|
+
readonly titleColor: {
|
|
810
|
+
readonly type: "string";
|
|
811
|
+
readonly pattern: "^#[0-9A-Fa-f]{6}$";
|
|
812
|
+
readonly description: "6-digit hex color e.g. #FF0000";
|
|
813
|
+
};
|
|
620
814
|
readonly fontFamily: {
|
|
621
815
|
readonly type: "string";
|
|
622
816
|
};
|
|
817
|
+
readonly fontWeight: {
|
|
818
|
+
readonly type: "number";
|
|
819
|
+
readonly enum: readonly [400, 700];
|
|
820
|
+
};
|
|
623
821
|
readonly fontSize: {
|
|
624
822
|
readonly type: "number";
|
|
625
823
|
};
|
|
824
|
+
readonly lineHeight: {
|
|
825
|
+
readonly type: "number";
|
|
826
|
+
};
|
|
827
|
+
readonly padding: {
|
|
828
|
+
readonly type: "number";
|
|
829
|
+
readonly description: "Shorthand for paddingH and paddingV. Default: 12";
|
|
830
|
+
};
|
|
831
|
+
readonly paddingH: {
|
|
832
|
+
readonly type: "number";
|
|
833
|
+
readonly description: "Horizontal padding inside box in pt. Default: 16";
|
|
834
|
+
};
|
|
835
|
+
readonly paddingV: {
|
|
836
|
+
readonly type: "number";
|
|
837
|
+
readonly description: "Vertical padding inside box in pt. Default: 10";
|
|
838
|
+
};
|
|
626
839
|
readonly spaceBefore: {
|
|
627
840
|
readonly type: "number";
|
|
628
841
|
readonly description: "Space in points (pt)";
|
|
@@ -656,6 +869,10 @@ export declare const pdfDocumentSchema: {
|
|
|
656
869
|
readonly text: {
|
|
657
870
|
readonly type: "string";
|
|
658
871
|
};
|
|
872
|
+
readonly dir: {
|
|
873
|
+
readonly type: "string";
|
|
874
|
+
readonly enum: readonly ["ltr", "rtl", "auto"];
|
|
875
|
+
};
|
|
659
876
|
readonly fontFamily: {
|
|
660
877
|
readonly type: "string";
|
|
661
878
|
};
|
|
@@ -739,6 +956,18 @@ export declare const pdfDocumentSchema: {
|
|
|
739
956
|
readonly smallCaps: {
|
|
740
957
|
readonly type: "boolean";
|
|
741
958
|
};
|
|
959
|
+
readonly tabularNumbers: {
|
|
960
|
+
readonly type: "boolean";
|
|
961
|
+
readonly description: "Render digits at fixed slot width for aligned numeric columns.";
|
|
962
|
+
};
|
|
963
|
+
readonly columns: {
|
|
964
|
+
readonly type: "number";
|
|
965
|
+
readonly description: "Number of columns for multi-column layout. Default: 1";
|
|
966
|
+
};
|
|
967
|
+
readonly columnGap: {
|
|
968
|
+
readonly type: "number";
|
|
969
|
+
readonly description: "Gap between columns in pt. Default: 24";
|
|
970
|
+
};
|
|
742
971
|
};
|
|
743
972
|
}, {
|
|
744
973
|
readonly type: "object";
|
|
@@ -765,6 +994,22 @@ export declare const pdfDocumentSchema: {
|
|
|
765
994
|
readonly fontSize: {
|
|
766
995
|
readonly type: "number";
|
|
767
996
|
};
|
|
997
|
+
readonly titleFontSize: {
|
|
998
|
+
readonly type: "number";
|
|
999
|
+
readonly description: "Font size for TOC title. Default: fontSize + 4";
|
|
1000
|
+
};
|
|
1001
|
+
readonly levelIndent: {
|
|
1002
|
+
readonly type: "number";
|
|
1003
|
+
readonly description: "Indentation per level in pt. Default: 16";
|
|
1004
|
+
};
|
|
1005
|
+
readonly leader: {
|
|
1006
|
+
readonly type: "string";
|
|
1007
|
+
readonly description: "Leader character between entry and page number. Default: .";
|
|
1008
|
+
};
|
|
1009
|
+
readonly entrySpacing: {
|
|
1010
|
+
readonly type: "number";
|
|
1011
|
+
readonly description: "Space after each entry line in pt. Default: 4";
|
|
1012
|
+
};
|
|
768
1013
|
readonly fontFamily: {
|
|
769
1014
|
readonly type: "string";
|
|
770
1015
|
};
|
|
@@ -964,14 +1209,120 @@ export declare const pdfDocumentSchema: {
|
|
|
964
1209
|
readonly fontSize: {
|
|
965
1210
|
readonly type: "number";
|
|
966
1211
|
};
|
|
1212
|
+
readonly borderColor: {
|
|
1213
|
+
readonly type: "string";
|
|
1214
|
+
readonly pattern: "^#[0-9A-Fa-f]{6}$";
|
|
1215
|
+
readonly description: "6-digit hex color e.g. #FF0000";
|
|
1216
|
+
};
|
|
1217
|
+
readonly backgroundColor: {
|
|
1218
|
+
readonly type: "string";
|
|
1219
|
+
readonly pattern: "^#[0-9A-Fa-f]{6}$";
|
|
1220
|
+
readonly description: "6-digit hex color e.g. #FF0000";
|
|
1221
|
+
};
|
|
1222
|
+
readonly defaultSelected: {
|
|
1223
|
+
readonly type: "string";
|
|
1224
|
+
readonly description: "Pre-selected value for radio groups and dropdowns.";
|
|
1225
|
+
};
|
|
1226
|
+
readonly keepTogether: {
|
|
1227
|
+
readonly type: "boolean";
|
|
1228
|
+
readonly description: "If true, never break this element across pages. Default: true";
|
|
1229
|
+
};
|
|
1230
|
+
readonly spaceAfter: {
|
|
1231
|
+
readonly type: "number";
|
|
1232
|
+
readonly description: "Space in points (pt)";
|
|
1233
|
+
};
|
|
1234
|
+
readonly spaceBefore: {
|
|
1235
|
+
readonly type: "number";
|
|
1236
|
+
readonly description: "Space in points (pt)";
|
|
1237
|
+
};
|
|
1238
|
+
};
|
|
1239
|
+
}, {
|
|
1240
|
+
readonly type: "object";
|
|
1241
|
+
readonly required: readonly ["type", "image", "float", "content"];
|
|
1242
|
+
readonly properties: {
|
|
1243
|
+
readonly type: {
|
|
1244
|
+
readonly type: "string";
|
|
1245
|
+
readonly const: "float-group";
|
|
1246
|
+
};
|
|
1247
|
+
readonly image: {
|
|
1248
|
+
readonly type: "object";
|
|
1249
|
+
readonly required: readonly ["src"];
|
|
1250
|
+
readonly properties: {
|
|
1251
|
+
readonly src: {
|
|
1252
|
+
readonly type: "string";
|
|
1253
|
+
readonly description: "Absolute file path or URL";
|
|
1254
|
+
};
|
|
1255
|
+
readonly format: {
|
|
1256
|
+
readonly type: "string";
|
|
1257
|
+
readonly enum: readonly ["png", "jpg", "auto"];
|
|
1258
|
+
};
|
|
1259
|
+
readonly height: {
|
|
1260
|
+
readonly type: "number";
|
|
1261
|
+
};
|
|
1262
|
+
};
|
|
1263
|
+
};
|
|
1264
|
+
readonly float: {
|
|
1265
|
+
readonly type: "string";
|
|
1266
|
+
readonly enum: readonly ["left", "right"];
|
|
1267
|
+
};
|
|
1268
|
+
readonly floatWidth: {
|
|
1269
|
+
readonly type: "number";
|
|
1270
|
+
readonly description: "Image column width in pt. Default: 35% of content width.";
|
|
1271
|
+
};
|
|
1272
|
+
readonly floatGap: {
|
|
1273
|
+
readonly type: "number";
|
|
1274
|
+
readonly description: "Gap between image and text columns in pt. Default: 12";
|
|
1275
|
+
};
|
|
1276
|
+
readonly content: {
|
|
1277
|
+
readonly type: "array";
|
|
1278
|
+
readonly description: "Content elements rendered in the text column (paragraph, heading, rich-paragraph).";
|
|
1279
|
+
readonly items: {
|
|
1280
|
+
readonly type: "object";
|
|
1281
|
+
};
|
|
1282
|
+
};
|
|
1283
|
+
readonly spaceBefore: {
|
|
1284
|
+
readonly type: "number";
|
|
1285
|
+
readonly description: "Space in points (pt)";
|
|
1286
|
+
};
|
|
967
1287
|
readonly spaceAfter: {
|
|
968
1288
|
readonly type: "number";
|
|
969
1289
|
readonly description: "Space in points (pt)";
|
|
970
1290
|
};
|
|
1291
|
+
};
|
|
1292
|
+
}, {
|
|
1293
|
+
readonly type: "object";
|
|
1294
|
+
readonly required: readonly ["type", "spec"];
|
|
1295
|
+
readonly properties: {
|
|
1296
|
+
readonly type: {
|
|
1297
|
+
readonly type: "string";
|
|
1298
|
+
readonly const: "chart";
|
|
1299
|
+
};
|
|
1300
|
+
readonly spec: {
|
|
1301
|
+
readonly type: "object";
|
|
1302
|
+
readonly description: "Vega-Lite JSON specification. Requires vega and vega-lite peer deps.";
|
|
1303
|
+
};
|
|
1304
|
+
readonly width: {
|
|
1305
|
+
readonly type: "number";
|
|
1306
|
+
};
|
|
1307
|
+
readonly height: {
|
|
1308
|
+
readonly type: "number";
|
|
1309
|
+
};
|
|
1310
|
+
readonly caption: {
|
|
1311
|
+
readonly type: "string";
|
|
1312
|
+
readonly description: "Optional figure caption rendered below the chart.";
|
|
1313
|
+
};
|
|
1314
|
+
readonly align: {
|
|
1315
|
+
readonly type: "string";
|
|
1316
|
+
readonly enum: readonly ["left", "center", "right"];
|
|
1317
|
+
};
|
|
971
1318
|
readonly spaceBefore: {
|
|
972
1319
|
readonly type: "number";
|
|
973
1320
|
readonly description: "Space in points (pt)";
|
|
974
1321
|
};
|
|
1322
|
+
readonly spaceAfter: {
|
|
1323
|
+
readonly type: "number";
|
|
1324
|
+
readonly description: "Space in points (pt)";
|
|
1325
|
+
};
|
|
975
1326
|
};
|
|
976
1327
|
}];
|
|
977
1328
|
};
|
|
@@ -1106,6 +1457,77 @@ export declare const pdfDocumentSchema: {
|
|
|
1106
1457
|
};
|
|
1107
1458
|
};
|
|
1108
1459
|
};
|
|
1460
|
+
readonly sections: {
|
|
1461
|
+
readonly type: "array";
|
|
1462
|
+
readonly description: "Page-range overrides for header/footer. First matching section wins. Falls back to doc.header/footer.";
|
|
1463
|
+
readonly items: {
|
|
1464
|
+
readonly type: "object";
|
|
1465
|
+
readonly properties: {
|
|
1466
|
+
readonly fromPage: {
|
|
1467
|
+
readonly type: "number";
|
|
1468
|
+
readonly description: "First page (1-based, inclusive). Default: 1";
|
|
1469
|
+
};
|
|
1470
|
+
readonly toPage: {
|
|
1471
|
+
readonly type: "number";
|
|
1472
|
+
readonly description: "Last page (1-based, inclusive). Default: Infinity";
|
|
1473
|
+
};
|
|
1474
|
+
readonly header: {
|
|
1475
|
+
readonly type: "object";
|
|
1476
|
+
readonly properties: {
|
|
1477
|
+
readonly text: {
|
|
1478
|
+
readonly type: "string";
|
|
1479
|
+
};
|
|
1480
|
+
readonly fontSize: {
|
|
1481
|
+
readonly type: "number";
|
|
1482
|
+
};
|
|
1483
|
+
readonly align: {
|
|
1484
|
+
readonly type: "string";
|
|
1485
|
+
readonly enum: readonly ["left", "center", "right"];
|
|
1486
|
+
};
|
|
1487
|
+
readonly fontFamily: {
|
|
1488
|
+
readonly type: "string";
|
|
1489
|
+
};
|
|
1490
|
+
readonly fontWeight: {
|
|
1491
|
+
readonly type: "number";
|
|
1492
|
+
readonly enum: readonly [400, 700];
|
|
1493
|
+
};
|
|
1494
|
+
readonly color: {
|
|
1495
|
+
readonly type: "string";
|
|
1496
|
+
readonly pattern: "^#[0-9A-Fa-f]{6}$";
|
|
1497
|
+
readonly description: "6-digit hex color e.g. #FF0000";
|
|
1498
|
+
};
|
|
1499
|
+
};
|
|
1500
|
+
};
|
|
1501
|
+
readonly footer: {
|
|
1502
|
+
readonly type: "object";
|
|
1503
|
+
readonly properties: {
|
|
1504
|
+
readonly text: {
|
|
1505
|
+
readonly type: "string";
|
|
1506
|
+
};
|
|
1507
|
+
readonly fontSize: {
|
|
1508
|
+
readonly type: "number";
|
|
1509
|
+
};
|
|
1510
|
+
readonly align: {
|
|
1511
|
+
readonly type: "string";
|
|
1512
|
+
readonly enum: readonly ["left", "center", "right"];
|
|
1513
|
+
};
|
|
1514
|
+
readonly fontFamily: {
|
|
1515
|
+
readonly type: "string";
|
|
1516
|
+
};
|
|
1517
|
+
readonly fontWeight: {
|
|
1518
|
+
readonly type: "number";
|
|
1519
|
+
readonly enum: readonly [400, 700];
|
|
1520
|
+
};
|
|
1521
|
+
readonly color: {
|
|
1522
|
+
readonly type: "string";
|
|
1523
|
+
readonly pattern: "^#[0-9A-Fa-f]{6}$";
|
|
1524
|
+
readonly description: "6-digit hex color e.g. #FF0000";
|
|
1525
|
+
};
|
|
1526
|
+
};
|
|
1527
|
+
};
|
|
1528
|
+
};
|
|
1529
|
+
};
|
|
1530
|
+
};
|
|
1109
1531
|
readonly watermark: {
|
|
1110
1532
|
readonly type: "object";
|
|
1111
1533
|
readonly description: "Watermark overlay rendered on every page behind content.";
|
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAkhBH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkRc,CAAA"}
|