document-schema 4.0.0 → 4.1.0
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/README.md +64 -4
- package/dist/construct-CdQuI9f5.d.cts +204 -0
- package/dist/construct-CdQuI9f5.d.ts +204 -0
- package/dist/construct.cjs +106 -0
- package/dist/construct.d.cts +2 -0
- package/dist/construct.d.ts +2 -0
- package/dist/construct.js +93 -0
- package/dist/content-json-schema-defs.cjs +224 -2
- package/dist/content-json-schema-defs.js +224 -2
- package/dist/index.cjs +18 -0
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/{package-node-DDPSNOvy.d.cts → package-node-BiUEzIzl.d.cts} +22 -7
- package/dist/{package-node-QVFHQcm8.d.ts → package-node-DLUobcDQ.d.ts} +22 -7
- package/dist/package-node.cjs +24 -11
- package/dist/package-node.d.cts +2 -2
- package/dist/package-node.d.ts +2 -2
- package/dist/package-node.js +21 -12
- package/dist/package.cjs +4 -1
- package/dist/package.d.cts +46 -1
- package/dist/package.d.ts +46 -1
- package/dist/package.js +4 -1
- package/dist/schema-io.cjs +2 -2
- package/dist/schema-io.js +2 -2
- package/package.json +1 -1
- package/schemas/content-document.schema.json +340 -3
- package/schemas/document-package.schema.json +475 -3
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ graph TD
|
|
|
48
48
|
style schema fill:#f9a825,stroke:#333,stroke-width:3px
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
`ContentDocument` (the semantic pivot) is a discriminated union of five kinds: `wordprocessing` (docx/odt sections of paragraphs/runs/tables/images), `presentation` (pptx/odp slides of shapes), `spreadsheet` (xlsx/ods sheets of cells, columns, rows, print settings), `drawing` (odg pages of shapes plus vector primitives — rect/ellipse/line/path), and `formula` (an equation carrying its own MathML node tree plus StarMath source when the producing format had one, extended with the two-layer math model: an optional verbatim-LaTeX `presentation` authoritative for rendering, an optional semantic `content: MathExpression` tree authoritative for computation, and provenance — neither layer stored derived from the other, so editing one never silently mutates the other). `ContentEmbeddedObjectSchema` lets any of the five embed another whole `ContentDocument`. Every paragraph/run/image/table/shape/vector/spreadsheet-cell leaf also carries its own canonical `headingLevel`-or-position fields directly: a `ContentParagraph`'s optional `headingLevel` (1 = the outermost heading, independent of the round-trip-only `styleId`), and every such leaf's optional `frames: LayoutFrame[]` — that node's own rendered page position(s) (`pageIndex` plus PDF user-space `xPt`/`yPt`/`widthPt`/`heightPt`), fused directly onto the content tree once a layout pass has run. `DocumentPackage` is the single hierarchical artefact — structure, layout, and content fused in one tree (see [The package tree](#the-package-tree)): the root carries `kind`, `metadata`, the optional document-level `symbolTable` and rendered `pages`, the optional package-level `styles`/`definitions` tables (see [Definitions tables and styles](#definitions-tables-and-styles)), and `children` — one group per top-level container with the content tree grouped inside it; the schema does not keep populated `frames` fields and `pages` in sync or detect staleness, and does not check that a tree's `style` refs name table entries (both are producer responsibilities, exactly as the frames/pages pairing always was). Every one of the five kinds also accepts an optional document-level `symbolTable` — the math curation layer mapping each written symbol glyph (within a scope) to its id, quantity kind, preferred unit, and definition source, alongside the unit registry (SI dimension-exponent vectors, exact rational conversions, per-unit-system normalisation contexts) that the `qty` nodes of lowered formulas resolve against.
|
|
51
|
+
`ContentDocument` (the semantic pivot) is a discriminated union of five kinds: `wordprocessing` (docx/odt sections of paragraphs/runs/tables/images), `presentation` (pptx/odp slides of shapes), `spreadsheet` (xlsx/ods sheets of cells, columns, rows, print settings), `drawing` (odg pages of shapes plus vector primitives — rect/ellipse/line/path), and `formula` (an equation carrying its own MathML node tree plus StarMath source when the producing format had one, extended with the two-layer math model: an optional verbatim-LaTeX `presentation` authoritative for rendering, an optional semantic `content: MathExpression` tree authoritative for computation, and provenance — neither layer stored derived from the other, so editing one never silently mutates the other). `ContentEmbeddedObjectSchema` lets any of the five embed another whole `ContentDocument`. Every paragraph/run/image/table/shape/vector/spreadsheet-cell leaf also carries its own canonical `headingLevel`-or-position fields directly: a `ContentParagraph`'s optional `headingLevel` (1 = the outermost heading, independent of the round-trip-only `styleId`), and every such leaf's optional `frames: LayoutFrame[]` — that node's own rendered page position(s) (`pageIndex` plus PDF user-space `xPt`/`yPt`/`widthPt`/`heightPt`), fused directly onto the content tree once a layout pass has run. `DocumentPackage` is the single hierarchical artefact — structure, layout, and content fused in one tree (see [The package tree](#the-package-tree)): the root carries `kind`, `metadata`, the optional document-level `symbolTable` and rendered `pages`, the optional package-level `styles`/`definitions`/`layers`/`attachments`/`destinations` tables (see [Definitions tables and styles](#definitions-tables-and-styles)), and `children` — one group per top-level container with the content tree grouped inside it, where a group's node may also be one of the six fidelity construct descriptors (see [Fidelity constructs](#fidelity-constructs)); the schema does not keep populated `frames` fields and `pages` in sync or detect staleness, and does not check that a tree's `style` refs name table entries (both are producer responsibilities, exactly as the frames/pages pairing always was). Every one of the five kinds also accepts an optional document-level `symbolTable` — the math curation layer mapping each written symbol glyph (within a scope) to its id, quantity kind, preferred unit, and definition source, alongside the unit registry (SI dimension-exponent vectors, exact rational conversions, per-unit-system normalisation contexts) that the `qty` nodes of lowered formulas resolve against.
|
|
52
52
|
|
|
53
53
|
The `LayoutDocument` family (pages of positioned `LayoutItem`s — `text`/`image`/`rect`/`line`/`ellipse`/`path`/`link` in PDF user-space coordinates) no longer lives here: 4.0.0 demoted it to a pdf-codec-private model ([pdf-codec#65](https://github.com/ExaDev/pdf-codec/issues/65)), where the only codec that ever read or wrote it owns it outright. `documentFromJson` recognises old layout-document `$schema` URIs and throws a tombstone pointing at pdf-codec rather than failing as if the value were unrelated. Dependents stay on document-schema.js 3.x via semver until their own majors, so the demotion is not a cascade-breaker.
|
|
54
54
|
|
|
@@ -90,7 +90,7 @@ const laidOut = DocumentPackageSchema.parse({ ...pkg, pages: [{ widthPt: 612, he
|
|
|
90
90
|
|
|
91
91
|
`DocumentPackage` ([#20](https://github.com/ExaDev/document-schema.js/issues/20)) is the promoted single hierarchical artefact — one tree where 3.x carried `{ formatVersion, content, pages }` with the content flat. The tree's vocabulary is defined in `src/package-node.ts` and was proven first as [document-outline.js](https://github.com/ExaDev/document-outline.js)'s phase-1 `decompose`/`flatten` implementation ([document-outline.js#2](https://github.com/ExaDev/document-outline.js/issues/2)); this package's schemas are that shape's schema-home port, matching it node for node:
|
|
92
92
|
|
|
93
|
-
- **Groups** are `{ node, children }` where `node` embeds either an anchor paragraph (heading groups and list-item groups carry the full `ContentParagraph` — runs, formatting, frames — never a projected text label) or a container descriptor: `{ kind: 'section', pageSize, margins }`, `{ kind: 'slide', size, notes }`, `{ kind: 'sheet', name, cells, columns, rows, printSettings }`, `{ kind: 'drawPage', size }`, each tagged with a `kind` the flat container type does not carry, or a shape group's untagged frame descriptor.
|
|
93
|
+
- **Groups** are `{ node, children }` where `node` embeds either an anchor paragraph (heading groups and list-item groups carry the full `ContentParagraph` — runs, formatting, frames — never a projected text label) or a container descriptor: `{ kind: 'section', pageSize, margins }`, `{ kind: 'slide', size, notes }`, `{ kind: 'sheet', name, cells, columns, rows, printSettings }`, `{ kind: 'drawPage', size }`, each tagged with a `kind` the flat container type does not carry, or a shape group's untagged frame descriptor, or — since 4.1.0 — a **construct descriptor** (see [Fidelity constructs](#fidelity-constructs)).
|
|
94
94
|
- **Bare leaves** carry their own `kind` and never `children`. Discrimination is structural on `node`+`children`, not on the presence of a `kind`.
|
|
95
95
|
- **Section groups are mandatory** — one per `ContentSection` — because a section carries pre-layout page geometry (`pageSize`/`margins`) that a rendered `pages` array cannot hold.
|
|
96
96
|
- **Grouping never crosses container boundaries**: a shape is its own group with its inner blocks grouped inside it (never a slide's paragraphs flattened across its shapes — that is a TOC projection, not a decomposition); a sheet's grid rides on the sheet node with images and embedded documents as children; embedded documents stay intact as one leaf.
|
|
@@ -104,9 +104,69 @@ The flat `ContentDocument` and the tree are **one format, two encodings**, relat
|
|
|
104
104
|
|
|
105
105
|
The codecs do not change: they keep producing flat `ContentDocument`s (their natural reading shape); decomposition runs once at the package boundary in documents.js and flatten runs once where a builder consumes a package.
|
|
106
106
|
|
|
107
|
+
## Fidelity constructs
|
|
108
|
+
|
|
109
|
+
Every format carries constructs the flat content model drops — docx SDTs and field codes, ODF fields and tracked changes, PDF form widgets and link annotations, markdown footnotes and link titles. [#22](https://github.com/ExaDev/document-schema.js/issues/22) replaces those per-repo caveats with one **harmonised semantic vocabulary**: no format-specific node kinds, ever. Four codec inventories ([ooxml.js#65](https://github.com/ExaDev/ooxml.js/issues/65), [odf.js#59](https://github.com/ExaDev/odf.js/issues/59), [markdown-codec#63](https://github.com/ExaDev/markdown-codec/issues/63), [pdf-codec#66](https://github.com/ExaDev/pdf-codec/issues/66)) audited what each format actually carries, and 4.1.0 lands their answer additively ([#24](https://github.com/ExaDev/document-schema.js/issues/24)) — new descriptor kinds and package tables, no change to any existing node shape, so a 4.0.0 tree parses unchanged.
|
|
110
|
+
|
|
111
|
+
A construct is a group like any other: `{ node: <descriptor>, children }`, where the children are the extent the construct spans. The tree was designed construct-capable from day one for exactly this, which is why the kinds could land in a minor rather than a second structural break.
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
// A tracked insertion inside a docx content control, and a footnote marker whose body lives in the definitions table.
|
|
115
|
+
const pkg = DocumentPackageSchema.parse({
|
|
116
|
+
kind: 'wordprocessing',
|
|
117
|
+
metadata: {},
|
|
118
|
+
definitions: { n1: { kind: 'footnote', blocks: [{ kind: 'paragraph', runs: [{ text: 'The note body.' }] }] } },
|
|
119
|
+
children: [
|
|
120
|
+
{
|
|
121
|
+
node: { kind: 'section', pageSize: { widthPt: 612, heightPt: 792 }, margins: { topPt: 72, rightPt: 72, bottomPt: 72, leftPt: 72 } },
|
|
122
|
+
children: [
|
|
123
|
+
{
|
|
124
|
+
node: { kind: 'contentControl', controlType: 'richText', tag: 'ClientBlock', lock: 'container' },
|
|
125
|
+
children: [
|
|
126
|
+
{
|
|
127
|
+
node: { kind: 'provenance', change: 'insertion', author: 'A. Reviewer', dateIso: '2026-08-18T09:00:00Z' },
|
|
128
|
+
children: [{ kind: 'paragraph', runs: [{ text: 'Inserted sentence.' }] }],
|
|
129
|
+
},
|
|
130
|
+
{ node: { kind: 'anchor', anchorType: 'footnote', name: '1', definition: 'n1' }, children: [] },
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
});
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
The six kinds (`src/construct.ts`):
|
|
140
|
+
|
|
141
|
+
| Kind | Carries | Where it comes from |
|
|
142
|
+
| --- | --- | --- |
|
|
143
|
+
| `contentControl` | `controlType`, `tag`, `alias`, `lock`, `value`, `checked`, `options` | docx block and inline SDTs, docx legacy `w:ffData` form fields, ODF `office:forms` controls and TOC/index wrappers, PDF AcroForm widgets and their field tree |
|
|
144
|
+
| `field` | `instruction`, `cachedResult` | docx `w:fldChar`/`w:instrText` and `w:fldSimple`, ODF field masters and simple fields, ODF cross-reference displays, pptx `a:fld` |
|
|
145
|
+
| `anchor` | `anchorType`, `name`, `definition` | docx bookmarks, comment extents, footnote/endnote references; ODF `text:bookmark`, `text:reference-mark*`, `text:note`, `office:annotation`; PDF sticky notes and markup annotations; markdown footnote markers |
|
|
146
|
+
| `link` | `target` (external URI or internal anchor name), `title` | docx `@w:anchor`, pptx slide jumps, PDF `GoTo`/`/Dest` and link annotations, markdown link/image titles |
|
|
147
|
+
| `provenance` | `change`, `author`, `dateIso` | docx `w:ins`/`w:del` and move tracking, ODF `text:tracked-changes`/`text:changed-region` |
|
|
148
|
+
| `division` | `name`, `columnCount`, `protected`, `source` | ODF `text:section` and `text:section-source`, tagged PDF `/Sect` and `/Div` |
|
|
149
|
+
|
|
150
|
+
Four things bound the vocabulary, and each is a decision rather than an omission:
|
|
151
|
+
|
|
152
|
+
- **Extents are block-scoped.** A construct group wraps the block flow of a section, heading group, shape, or list item. It cannot wrap a sub-sequence of one paragraph's runs, because a run-level extent is not expressible without changing `ContentParagraph`, and 4.1.0 changes no content shape. Run-level constructs keep their existing homes: **an external hyperlink stays on `ContentRun.hyperlink`** — `link` groups are for block-scoped and annotated extents a flat run field cannot express, never a replacement for it — and the inline field, bookmark, and tracked-change cases wait on a run-level mechanism rather than being forced into a wrapper that would split their paragraph.
|
|
153
|
+
- **Two group variants, one per block flow.** `SectionConstructGroup` sits in a section's or heading group's flow and admits heading children; `ShapeConstructGroup` sits in a shape's or list item's and does not — exactly the `SectionChild`/`ShapeChild` split that already existed. A construct nests in and around every other group, so a `provenance` wrapper inside a `contentControl` inside a `division` is a legal (and real) docx shape. Constructs are **not** legal as direct children of a slide, sheet, drawing page, or the package root: those hold containers and leaves, not block flow.
|
|
154
|
+
- **`division` is first-class, not degraded.** [#24](https://github.com/ExaDev/document-schema.js/issues/24) posed ODF `text:section` as a choice between a new generic kind and degrading to `contentControl` with the specifics in residue. It is first-class, on the odf inventory's own recommendation: `ContentSection` cannot host it (that is page geometry, one `pageSize`/`margins` pair, and it does not nest, while a division nests arbitrarily and usually changes no page geometry at all), and burying a structural container in the form-control vocabulary would make `contentControl` mean two unrelated things. It clears #22's no-format-specific-kinds bar on a real analogue — tagged PDF's `/Sect` and `/Div` are the same construct — not on ODF's say-so. It is spelled `division` rather than `section` because `{ kind: 'section' }` is already the page-geometry container descriptor.
|
|
155
|
+
- **Residue is not here.** #22's channel 2 — a per-node and package-level `source: { format, xml }` facility for what has no cross-format meaning — spans the whole content model and remains open on #22. Descriptors are closed objects with no escape hatch, deliberately: a descriptor-only residue field would mint exactly the parallel shape the general facility exists to avoid.
|
|
156
|
+
|
|
157
|
+
Two harmonisations the inventories asked for are also deliberately absent. There is **no `fieldType` enum**: `instruction` is required and verbatim, so nothing is lost without one, and #24 asks for exactly one new vocabulary — `link`'s internal targets — rather than one per kind, with the four inventories' own corpus gate still standing before a field-type member set could be frozen honestly. And a **sheet-scoped named range** (xlsx defined names and tables, ODF `table:named-expressions`) is a definitions-table entry, not an `anchor`: a sheet group's children are its images and embedded documents, never a block flow, so there is no extent for an anchor to wrap — which is the odf inventory's own verdict for the identical construct.
|
|
158
|
+
|
|
107
159
|
## Definitions tables and styles
|
|
108
160
|
|
|
109
|
-
The package root carries a generic definitions-table facility ([#21](https://github.com/ExaDev/document-schema.js/issues/21)): named tables whose entries tree nodes reference by string id. **Styles
|
|
161
|
+
The package root carries a generic definitions-table facility ([#21](https://github.com/ExaDev/document-schema.js/issues/21)): named tables whose entries tree nodes reference by string id. **Styles were the first tenant**; link, footnote, and comment definitions ride the tenant-generic `definitions` table (entries tagged with a `kind` discriminator and an open body, `src/definitions.ts`) alongside it — which is why that generic table exists rather than the facility being shaped around styles.
|
|
162
|
+
|
|
163
|
+
4.1.0 adds three more tables of that same generic type at the root ([#24](https://github.com/ExaDev/document-schema.js/issues/24), proposed by [pdf-codec#66](https://github.com/ExaDev/pdf-codec/issues/66)) — no new entry shape is minted anywhere:
|
|
164
|
+
|
|
165
|
+
- `layers` — optional-content/layer definitions: PDF `/OCProperties` groups and their configuration, ODF Draw's layer model. Definitions only; which content belongs to which layer is a membership fact the producing codec carries on its own item model.
|
|
166
|
+
- `attachments` — package attachments: PDF `/Names /EmbeddedFiles`, `/FileAttachment`, `/EF`, `/AF`, and the docx/ODF package attachments that make the facility cross-format rather than PDF-specific.
|
|
167
|
+
- `destinations` — named destinations and the navigation tree that resolves against them: PDF `/Dests`, the `/Names` name tree, and `/Outlines`. This is the other end of a `link` construct's internal target.
|
|
168
|
+
|
|
169
|
+
Each is its own root field rather than three more tenants of `definitions`, for the reason `styles` is its own field despite being the facility's first tenant: separate key namespaces, so a layer and a destination may share a name without colliding. The `kind` discriminator still earns its keep inside each, because each holds more than one tenant — a layers table carries group definitions alongside their configuration, and a destinations table carries named destinations alongside outline entries. Per-tenant entry fields stay the tenant's own, never this package's.
|
|
110
170
|
|
|
111
171
|
A styles entry carries `{ paragraph?, run? }` sub-objects of **resolved canonical properties only**: paragraph `alignment`/`list`/`spacingBeforePt`/`spacingAfterPt`/`lineSpacing`/`indentLeftPt`/`indentFirstLinePt`, run `bold`/`italic`/`underline`/`strike`/`fontFamily`/`sizePt`/`color`. Never `frames`, never `sourcePath`, never `styleId` (per-node facts — a position is a fact about a node, not a style), never a `basedOn` graph (the table is a dictionary, not a program) — and the ban list is **enforced by schema shape** (strict objects that reject those keys outright), not merely documented.
|
|
112
172
|
|
|
@@ -152,7 +212,7 @@ node_modules/document-schema.js/schemas/document-package.schema.json
|
|
|
152
212
|
node_modules/document-schema.js/schemas/content-document.schema.json
|
|
153
213
|
```
|
|
154
214
|
|
|
155
|
-
Each file's `$id` is a jsdelivr URL pinned to the exact npm version — immutable and live on publish, and (see [Versioning by `$schema`](#versioning-by-schema)) the version of anything stamped with it. Both files carry the same hand-authored `$defs` block (the same object emitted twice in one generator run, so the copies cannot drift), covering the recursive paragraph/table/embedded-object, MathML, and package-tree node models that Zod's converter cannot express directly; `content-json-schema-defs.ts` holds those fragments, and a regression test compares each fragment that has a real Zod counterpart against a live `z.toJSONSchema()` of that schema so a field changed without updating its fragment fails a test. The one deliberate cross-file `$ref` is the embedded-object cycle back to a whole `ContentDocument`. Fragments downstream of a `z.custom()` node (`ContentBlock`, `ContentTable`/`Cell`/`Row`, `ContentEmbeddedObject(Block)`, the
|
|
215
|
+
Each file's `$id` is a jsdelivr URL pinned to the exact npm version — immutable and live on publish, and (see [Versioning by `$schema`](#versioning-by-schema)) the version of anything stamped with it. Both files carry the same hand-authored `$defs` block (the same object emitted twice in one generator run, so the copies cannot drift), covering the recursive paragraph/table/embedded-object, MathML, and package-tree node models that Zod's converter cannot express directly; `content-json-schema-defs.ts` holds those fragments, and a regression test compares each fragment that has a real Zod counterpart against a live `z.toJSONSchema()` of that schema so a field changed without updating its fragment fails a test. The one deliberate cross-file `$ref` is the embedded-object cycle back to a whole `ContentDocument`. Fragments downstream of a `z.custom()` node (`ContentBlock`, `ContentTable`/`Cell`/`Row`, `ContentEmbeddedObject(Block)`, the nine package-tree group wrappers, `MathMlNode`/`Element`/`Attribute`, `ContentFormula`, `MathExpression` and its recursive variants) still need hand re-verification — the construct descriptors themselves do not, since each is a plain `z.strictObject` reaching no opaque node and is held to the live comparison against `src/content.ts`/`src/package-node.ts`/`src/mathml.ts`/`src/math.ts` — see below.
|
|
156
216
|
|
|
157
217
|
### `z.custom()` vs `z.lazy()` for recursive schemas
|
|
158
218
|
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/construct.d.ts
|
|
3
|
+
declare const ContentControlTypeSchema: z.ZodEnum<{
|
|
4
|
+
richText: "richText";
|
|
5
|
+
plainText: "plainText";
|
|
6
|
+
checkbox: "checkbox";
|
|
7
|
+
dropDown: "dropDown";
|
|
8
|
+
comboBox: "comboBox";
|
|
9
|
+
date: "date";
|
|
10
|
+
picture: "picture";
|
|
11
|
+
repeatingSection: "repeatingSection";
|
|
12
|
+
button: "button";
|
|
13
|
+
index: "index";
|
|
14
|
+
group: "group";
|
|
15
|
+
}>;
|
|
16
|
+
type ContentControlType = z.infer<typeof ContentControlTypeSchema>;
|
|
17
|
+
declare const ContentControlLockSchema: z.ZodEnum<{
|
|
18
|
+
content: "content";
|
|
19
|
+
container: "container";
|
|
20
|
+
both: "both";
|
|
21
|
+
}>;
|
|
22
|
+
type ContentControlLock = z.infer<typeof ContentControlLockSchema>;
|
|
23
|
+
declare const ContentControlDescriptorSchema: z.ZodObject<{
|
|
24
|
+
kind: z.ZodLiteral<"contentControl">;
|
|
25
|
+
controlType: z.ZodEnum<{
|
|
26
|
+
richText: "richText";
|
|
27
|
+
plainText: "plainText";
|
|
28
|
+
checkbox: "checkbox";
|
|
29
|
+
dropDown: "dropDown";
|
|
30
|
+
comboBox: "comboBox";
|
|
31
|
+
date: "date";
|
|
32
|
+
picture: "picture";
|
|
33
|
+
repeatingSection: "repeatingSection";
|
|
34
|
+
button: "button";
|
|
35
|
+
index: "index";
|
|
36
|
+
group: "group";
|
|
37
|
+
}>;
|
|
38
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
39
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
40
|
+
lock: z.ZodOptional<z.ZodEnum<{
|
|
41
|
+
content: "content";
|
|
42
|
+
container: "container";
|
|
43
|
+
both: "both";
|
|
44
|
+
}>>;
|
|
45
|
+
value: z.ZodOptional<z.ZodString>;
|
|
46
|
+
checked: z.ZodOptional<z.ZodBoolean>;
|
|
47
|
+
options: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
48
|
+
}, z.core.$strict>;
|
|
49
|
+
type ContentControlDescriptor = z.infer<typeof ContentControlDescriptorSchema>;
|
|
50
|
+
declare const FieldDescriptorSchema: z.ZodObject<{
|
|
51
|
+
kind: z.ZodLiteral<"field">;
|
|
52
|
+
instruction: z.ZodString;
|
|
53
|
+
cachedResult: z.ZodOptional<z.ZodString>;
|
|
54
|
+
}, z.core.$strict>;
|
|
55
|
+
type FieldDescriptor = z.infer<typeof FieldDescriptorSchema>;
|
|
56
|
+
declare const AnchorTypeSchema: z.ZodEnum<{
|
|
57
|
+
bookmark: "bookmark";
|
|
58
|
+
footnote: "footnote";
|
|
59
|
+
endnote: "endnote";
|
|
60
|
+
comment: "comment";
|
|
61
|
+
}>;
|
|
62
|
+
type AnchorType = z.infer<typeof AnchorTypeSchema>;
|
|
63
|
+
declare const AnchorDescriptorSchema: z.ZodObject<{
|
|
64
|
+
kind: z.ZodLiteral<"anchor">;
|
|
65
|
+
anchorType: z.ZodEnum<{
|
|
66
|
+
bookmark: "bookmark";
|
|
67
|
+
footnote: "footnote";
|
|
68
|
+
endnote: "endnote";
|
|
69
|
+
comment: "comment";
|
|
70
|
+
}>;
|
|
71
|
+
name: z.ZodString;
|
|
72
|
+
definition: z.ZodOptional<z.ZodString>;
|
|
73
|
+
}, z.core.$strict>;
|
|
74
|
+
type AnchorDescriptor = z.infer<typeof AnchorDescriptorSchema>;
|
|
75
|
+
declare const LinkTargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
76
|
+
kind: z.ZodLiteral<"external">;
|
|
77
|
+
uri: z.ZodString;
|
|
78
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
79
|
+
kind: z.ZodLiteral<"internal">;
|
|
80
|
+
anchor: z.ZodString;
|
|
81
|
+
}, z.core.$strict>], "kind">;
|
|
82
|
+
type LinkTarget = z.infer<typeof LinkTargetSchema>;
|
|
83
|
+
declare const LinkDescriptorSchema: z.ZodObject<{
|
|
84
|
+
kind: z.ZodLiteral<"link">;
|
|
85
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
86
|
+
kind: z.ZodLiteral<"external">;
|
|
87
|
+
uri: z.ZodString;
|
|
88
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
89
|
+
kind: z.ZodLiteral<"internal">;
|
|
90
|
+
anchor: z.ZodString;
|
|
91
|
+
}, z.core.$strict>], "kind">;
|
|
92
|
+
title: z.ZodOptional<z.ZodString>;
|
|
93
|
+
}, z.core.$strict>;
|
|
94
|
+
type LinkDescriptor = z.infer<typeof LinkDescriptorSchema>;
|
|
95
|
+
declare const ProvenanceChangeSchema: z.ZodEnum<{
|
|
96
|
+
insertion: "insertion";
|
|
97
|
+
deletion: "deletion";
|
|
98
|
+
moveFrom: "moveFrom";
|
|
99
|
+
moveTo: "moveTo";
|
|
100
|
+
formatChange: "formatChange";
|
|
101
|
+
}>;
|
|
102
|
+
type ProvenanceChange = z.infer<typeof ProvenanceChangeSchema>;
|
|
103
|
+
declare const ProvenanceDescriptorSchema: z.ZodObject<{
|
|
104
|
+
kind: z.ZodLiteral<"provenance">;
|
|
105
|
+
change: z.ZodEnum<{
|
|
106
|
+
insertion: "insertion";
|
|
107
|
+
deletion: "deletion";
|
|
108
|
+
moveFrom: "moveFrom";
|
|
109
|
+
moveTo: "moveTo";
|
|
110
|
+
formatChange: "formatChange";
|
|
111
|
+
}>;
|
|
112
|
+
author: z.ZodOptional<z.ZodString>;
|
|
113
|
+
dateIso: z.ZodOptional<z.ZodString>;
|
|
114
|
+
}, z.core.$strict>;
|
|
115
|
+
type ProvenanceDescriptor = z.infer<typeof ProvenanceDescriptorSchema>;
|
|
116
|
+
declare const DivisionSourceSchema: z.ZodObject<{
|
|
117
|
+
href: z.ZodString;
|
|
118
|
+
sectionName: z.ZodOptional<z.ZodString>;
|
|
119
|
+
}, z.core.$strict>;
|
|
120
|
+
type DivisionSource = z.infer<typeof DivisionSourceSchema>;
|
|
121
|
+
declare const DivisionDescriptorSchema: z.ZodObject<{
|
|
122
|
+
kind: z.ZodLiteral<"division">;
|
|
123
|
+
name: z.ZodOptional<z.ZodString>;
|
|
124
|
+
columnCount: z.ZodOptional<z.ZodNumber>;
|
|
125
|
+
protected: z.ZodOptional<z.ZodBoolean>;
|
|
126
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
127
|
+
href: z.ZodString;
|
|
128
|
+
sectionName: z.ZodOptional<z.ZodString>;
|
|
129
|
+
}, z.core.$strict>>;
|
|
130
|
+
}, z.core.$strict>;
|
|
131
|
+
type DivisionDescriptor = z.infer<typeof DivisionDescriptorSchema>;
|
|
132
|
+
declare const ConstructDescriptorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
133
|
+
kind: z.ZodLiteral<"contentControl">;
|
|
134
|
+
controlType: z.ZodEnum<{
|
|
135
|
+
richText: "richText";
|
|
136
|
+
plainText: "plainText";
|
|
137
|
+
checkbox: "checkbox";
|
|
138
|
+
dropDown: "dropDown";
|
|
139
|
+
comboBox: "comboBox";
|
|
140
|
+
date: "date";
|
|
141
|
+
picture: "picture";
|
|
142
|
+
repeatingSection: "repeatingSection";
|
|
143
|
+
button: "button";
|
|
144
|
+
index: "index";
|
|
145
|
+
group: "group";
|
|
146
|
+
}>;
|
|
147
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
148
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
149
|
+
lock: z.ZodOptional<z.ZodEnum<{
|
|
150
|
+
content: "content";
|
|
151
|
+
container: "container";
|
|
152
|
+
both: "both";
|
|
153
|
+
}>>;
|
|
154
|
+
value: z.ZodOptional<z.ZodString>;
|
|
155
|
+
checked: z.ZodOptional<z.ZodBoolean>;
|
|
156
|
+
options: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
157
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
158
|
+
kind: z.ZodLiteral<"field">;
|
|
159
|
+
instruction: z.ZodString;
|
|
160
|
+
cachedResult: z.ZodOptional<z.ZodString>;
|
|
161
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
162
|
+
kind: z.ZodLiteral<"anchor">;
|
|
163
|
+
anchorType: z.ZodEnum<{
|
|
164
|
+
bookmark: "bookmark";
|
|
165
|
+
footnote: "footnote";
|
|
166
|
+
endnote: "endnote";
|
|
167
|
+
comment: "comment";
|
|
168
|
+
}>;
|
|
169
|
+
name: z.ZodString;
|
|
170
|
+
definition: z.ZodOptional<z.ZodString>;
|
|
171
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
172
|
+
kind: z.ZodLiteral<"link">;
|
|
173
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
174
|
+
kind: z.ZodLiteral<"external">;
|
|
175
|
+
uri: z.ZodString;
|
|
176
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
177
|
+
kind: z.ZodLiteral<"internal">;
|
|
178
|
+
anchor: z.ZodString;
|
|
179
|
+
}, z.core.$strict>], "kind">;
|
|
180
|
+
title: z.ZodOptional<z.ZodString>;
|
|
181
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
182
|
+
kind: z.ZodLiteral<"provenance">;
|
|
183
|
+
change: z.ZodEnum<{
|
|
184
|
+
insertion: "insertion";
|
|
185
|
+
deletion: "deletion";
|
|
186
|
+
moveFrom: "moveFrom";
|
|
187
|
+
moveTo: "moveTo";
|
|
188
|
+
formatChange: "formatChange";
|
|
189
|
+
}>;
|
|
190
|
+
author: z.ZodOptional<z.ZodString>;
|
|
191
|
+
dateIso: z.ZodOptional<z.ZodString>;
|
|
192
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
193
|
+
kind: z.ZodLiteral<"division">;
|
|
194
|
+
name: z.ZodOptional<z.ZodString>;
|
|
195
|
+
columnCount: z.ZodOptional<z.ZodNumber>;
|
|
196
|
+
protected: z.ZodOptional<z.ZodBoolean>;
|
|
197
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
198
|
+
href: z.ZodString;
|
|
199
|
+
sectionName: z.ZodOptional<z.ZodString>;
|
|
200
|
+
}, z.core.$strict>>;
|
|
201
|
+
}, z.core.$strict>], "kind">;
|
|
202
|
+
type ConstructDescriptor = z.infer<typeof ConstructDescriptorSchema>;
|
|
203
|
+
//#endregion
|
|
204
|
+
export { ProvenanceChange as C, ProvenanceDescriptorSchema as E, LinkTargetSchema as S, ProvenanceDescriptor as T, FieldDescriptor as _, ConstructDescriptor as a, LinkDescriptorSchema as b, ContentControlDescriptorSchema as c, ContentControlType as d, ContentControlTypeSchema as f, DivisionSourceSchema as g, DivisionSource as h, AnchorTypeSchema as i, ContentControlLock as l, DivisionDescriptorSchema as m, AnchorDescriptorSchema as n, ConstructDescriptorSchema as o, DivisionDescriptor as p, AnchorType as r, ContentControlDescriptor as s, AnchorDescriptor as t, ContentControlLockSchema as u, FieldDescriptorSchema as v, ProvenanceChangeSchema as w, LinkTarget as x, LinkDescriptor as y };
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/construct.d.ts
|
|
3
|
+
declare const ContentControlTypeSchema: z.ZodEnum<{
|
|
4
|
+
richText: "richText";
|
|
5
|
+
plainText: "plainText";
|
|
6
|
+
checkbox: "checkbox";
|
|
7
|
+
dropDown: "dropDown";
|
|
8
|
+
comboBox: "comboBox";
|
|
9
|
+
date: "date";
|
|
10
|
+
picture: "picture";
|
|
11
|
+
repeatingSection: "repeatingSection";
|
|
12
|
+
button: "button";
|
|
13
|
+
index: "index";
|
|
14
|
+
group: "group";
|
|
15
|
+
}>;
|
|
16
|
+
type ContentControlType = z.infer<typeof ContentControlTypeSchema>;
|
|
17
|
+
declare const ContentControlLockSchema: z.ZodEnum<{
|
|
18
|
+
content: "content";
|
|
19
|
+
container: "container";
|
|
20
|
+
both: "both";
|
|
21
|
+
}>;
|
|
22
|
+
type ContentControlLock = z.infer<typeof ContentControlLockSchema>;
|
|
23
|
+
declare const ContentControlDescriptorSchema: z.ZodObject<{
|
|
24
|
+
kind: z.ZodLiteral<"contentControl">;
|
|
25
|
+
controlType: z.ZodEnum<{
|
|
26
|
+
richText: "richText";
|
|
27
|
+
plainText: "plainText";
|
|
28
|
+
checkbox: "checkbox";
|
|
29
|
+
dropDown: "dropDown";
|
|
30
|
+
comboBox: "comboBox";
|
|
31
|
+
date: "date";
|
|
32
|
+
picture: "picture";
|
|
33
|
+
repeatingSection: "repeatingSection";
|
|
34
|
+
button: "button";
|
|
35
|
+
index: "index";
|
|
36
|
+
group: "group";
|
|
37
|
+
}>;
|
|
38
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
39
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
40
|
+
lock: z.ZodOptional<z.ZodEnum<{
|
|
41
|
+
content: "content";
|
|
42
|
+
container: "container";
|
|
43
|
+
both: "both";
|
|
44
|
+
}>>;
|
|
45
|
+
value: z.ZodOptional<z.ZodString>;
|
|
46
|
+
checked: z.ZodOptional<z.ZodBoolean>;
|
|
47
|
+
options: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
48
|
+
}, z.core.$strict>;
|
|
49
|
+
type ContentControlDescriptor = z.infer<typeof ContentControlDescriptorSchema>;
|
|
50
|
+
declare const FieldDescriptorSchema: z.ZodObject<{
|
|
51
|
+
kind: z.ZodLiteral<"field">;
|
|
52
|
+
instruction: z.ZodString;
|
|
53
|
+
cachedResult: z.ZodOptional<z.ZodString>;
|
|
54
|
+
}, z.core.$strict>;
|
|
55
|
+
type FieldDescriptor = z.infer<typeof FieldDescriptorSchema>;
|
|
56
|
+
declare const AnchorTypeSchema: z.ZodEnum<{
|
|
57
|
+
bookmark: "bookmark";
|
|
58
|
+
footnote: "footnote";
|
|
59
|
+
endnote: "endnote";
|
|
60
|
+
comment: "comment";
|
|
61
|
+
}>;
|
|
62
|
+
type AnchorType = z.infer<typeof AnchorTypeSchema>;
|
|
63
|
+
declare const AnchorDescriptorSchema: z.ZodObject<{
|
|
64
|
+
kind: z.ZodLiteral<"anchor">;
|
|
65
|
+
anchorType: z.ZodEnum<{
|
|
66
|
+
bookmark: "bookmark";
|
|
67
|
+
footnote: "footnote";
|
|
68
|
+
endnote: "endnote";
|
|
69
|
+
comment: "comment";
|
|
70
|
+
}>;
|
|
71
|
+
name: z.ZodString;
|
|
72
|
+
definition: z.ZodOptional<z.ZodString>;
|
|
73
|
+
}, z.core.$strict>;
|
|
74
|
+
type AnchorDescriptor = z.infer<typeof AnchorDescriptorSchema>;
|
|
75
|
+
declare const LinkTargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
76
|
+
kind: z.ZodLiteral<"external">;
|
|
77
|
+
uri: z.ZodString;
|
|
78
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
79
|
+
kind: z.ZodLiteral<"internal">;
|
|
80
|
+
anchor: z.ZodString;
|
|
81
|
+
}, z.core.$strict>], "kind">;
|
|
82
|
+
type LinkTarget = z.infer<typeof LinkTargetSchema>;
|
|
83
|
+
declare const LinkDescriptorSchema: z.ZodObject<{
|
|
84
|
+
kind: z.ZodLiteral<"link">;
|
|
85
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
86
|
+
kind: z.ZodLiteral<"external">;
|
|
87
|
+
uri: z.ZodString;
|
|
88
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
89
|
+
kind: z.ZodLiteral<"internal">;
|
|
90
|
+
anchor: z.ZodString;
|
|
91
|
+
}, z.core.$strict>], "kind">;
|
|
92
|
+
title: z.ZodOptional<z.ZodString>;
|
|
93
|
+
}, z.core.$strict>;
|
|
94
|
+
type LinkDescriptor = z.infer<typeof LinkDescriptorSchema>;
|
|
95
|
+
declare const ProvenanceChangeSchema: z.ZodEnum<{
|
|
96
|
+
insertion: "insertion";
|
|
97
|
+
deletion: "deletion";
|
|
98
|
+
moveFrom: "moveFrom";
|
|
99
|
+
moveTo: "moveTo";
|
|
100
|
+
formatChange: "formatChange";
|
|
101
|
+
}>;
|
|
102
|
+
type ProvenanceChange = z.infer<typeof ProvenanceChangeSchema>;
|
|
103
|
+
declare const ProvenanceDescriptorSchema: z.ZodObject<{
|
|
104
|
+
kind: z.ZodLiteral<"provenance">;
|
|
105
|
+
change: z.ZodEnum<{
|
|
106
|
+
insertion: "insertion";
|
|
107
|
+
deletion: "deletion";
|
|
108
|
+
moveFrom: "moveFrom";
|
|
109
|
+
moveTo: "moveTo";
|
|
110
|
+
formatChange: "formatChange";
|
|
111
|
+
}>;
|
|
112
|
+
author: z.ZodOptional<z.ZodString>;
|
|
113
|
+
dateIso: z.ZodOptional<z.ZodString>;
|
|
114
|
+
}, z.core.$strict>;
|
|
115
|
+
type ProvenanceDescriptor = z.infer<typeof ProvenanceDescriptorSchema>;
|
|
116
|
+
declare const DivisionSourceSchema: z.ZodObject<{
|
|
117
|
+
href: z.ZodString;
|
|
118
|
+
sectionName: z.ZodOptional<z.ZodString>;
|
|
119
|
+
}, z.core.$strict>;
|
|
120
|
+
type DivisionSource = z.infer<typeof DivisionSourceSchema>;
|
|
121
|
+
declare const DivisionDescriptorSchema: z.ZodObject<{
|
|
122
|
+
kind: z.ZodLiteral<"division">;
|
|
123
|
+
name: z.ZodOptional<z.ZodString>;
|
|
124
|
+
columnCount: z.ZodOptional<z.ZodNumber>;
|
|
125
|
+
protected: z.ZodOptional<z.ZodBoolean>;
|
|
126
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
127
|
+
href: z.ZodString;
|
|
128
|
+
sectionName: z.ZodOptional<z.ZodString>;
|
|
129
|
+
}, z.core.$strict>>;
|
|
130
|
+
}, z.core.$strict>;
|
|
131
|
+
type DivisionDescriptor = z.infer<typeof DivisionDescriptorSchema>;
|
|
132
|
+
declare const ConstructDescriptorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
133
|
+
kind: z.ZodLiteral<"contentControl">;
|
|
134
|
+
controlType: z.ZodEnum<{
|
|
135
|
+
richText: "richText";
|
|
136
|
+
plainText: "plainText";
|
|
137
|
+
checkbox: "checkbox";
|
|
138
|
+
dropDown: "dropDown";
|
|
139
|
+
comboBox: "comboBox";
|
|
140
|
+
date: "date";
|
|
141
|
+
picture: "picture";
|
|
142
|
+
repeatingSection: "repeatingSection";
|
|
143
|
+
button: "button";
|
|
144
|
+
index: "index";
|
|
145
|
+
group: "group";
|
|
146
|
+
}>;
|
|
147
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
148
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
149
|
+
lock: z.ZodOptional<z.ZodEnum<{
|
|
150
|
+
content: "content";
|
|
151
|
+
container: "container";
|
|
152
|
+
both: "both";
|
|
153
|
+
}>>;
|
|
154
|
+
value: z.ZodOptional<z.ZodString>;
|
|
155
|
+
checked: z.ZodOptional<z.ZodBoolean>;
|
|
156
|
+
options: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
157
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
158
|
+
kind: z.ZodLiteral<"field">;
|
|
159
|
+
instruction: z.ZodString;
|
|
160
|
+
cachedResult: z.ZodOptional<z.ZodString>;
|
|
161
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
162
|
+
kind: z.ZodLiteral<"anchor">;
|
|
163
|
+
anchorType: z.ZodEnum<{
|
|
164
|
+
bookmark: "bookmark";
|
|
165
|
+
footnote: "footnote";
|
|
166
|
+
endnote: "endnote";
|
|
167
|
+
comment: "comment";
|
|
168
|
+
}>;
|
|
169
|
+
name: z.ZodString;
|
|
170
|
+
definition: z.ZodOptional<z.ZodString>;
|
|
171
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
172
|
+
kind: z.ZodLiteral<"link">;
|
|
173
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
174
|
+
kind: z.ZodLiteral<"external">;
|
|
175
|
+
uri: z.ZodString;
|
|
176
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
177
|
+
kind: z.ZodLiteral<"internal">;
|
|
178
|
+
anchor: z.ZodString;
|
|
179
|
+
}, z.core.$strict>], "kind">;
|
|
180
|
+
title: z.ZodOptional<z.ZodString>;
|
|
181
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
182
|
+
kind: z.ZodLiteral<"provenance">;
|
|
183
|
+
change: z.ZodEnum<{
|
|
184
|
+
insertion: "insertion";
|
|
185
|
+
deletion: "deletion";
|
|
186
|
+
moveFrom: "moveFrom";
|
|
187
|
+
moveTo: "moveTo";
|
|
188
|
+
formatChange: "formatChange";
|
|
189
|
+
}>;
|
|
190
|
+
author: z.ZodOptional<z.ZodString>;
|
|
191
|
+
dateIso: z.ZodOptional<z.ZodString>;
|
|
192
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
193
|
+
kind: z.ZodLiteral<"division">;
|
|
194
|
+
name: z.ZodOptional<z.ZodString>;
|
|
195
|
+
columnCount: z.ZodOptional<z.ZodNumber>;
|
|
196
|
+
protected: z.ZodOptional<z.ZodBoolean>;
|
|
197
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
198
|
+
href: z.ZodString;
|
|
199
|
+
sectionName: z.ZodOptional<z.ZodString>;
|
|
200
|
+
}, z.core.$strict>>;
|
|
201
|
+
}, z.core.$strict>], "kind">;
|
|
202
|
+
type ConstructDescriptor = z.infer<typeof ConstructDescriptorSchema>;
|
|
203
|
+
//#endregion
|
|
204
|
+
export { ProvenanceChange as C, ProvenanceDescriptorSchema as E, LinkTargetSchema as S, ProvenanceDescriptor as T, FieldDescriptor as _, ConstructDescriptor as a, LinkDescriptorSchema as b, ContentControlDescriptorSchema as c, ContentControlType as d, ContentControlTypeSchema as f, DivisionSourceSchema as g, DivisionSource as h, AnchorTypeSchema as i, ContentControlLock as l, DivisionDescriptorSchema as m, AnchorDescriptorSchema as n, ConstructDescriptorSchema as o, DivisionDescriptor as p, AnchorType as r, ContentControlDescriptor as s, AnchorDescriptor as t, ContentControlLockSchema as u, FieldDescriptorSchema as v, ProvenanceChangeSchema as w, LinkTarget as x, LinkDescriptor as y };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let zod = require("zod");
|
|
3
|
+
//#region src/construct.ts
|
|
4
|
+
const ContentControlTypeSchema = zod.z.enum([
|
|
5
|
+
"richText",
|
|
6
|
+
"plainText",
|
|
7
|
+
"checkbox",
|
|
8
|
+
"dropDown",
|
|
9
|
+
"comboBox",
|
|
10
|
+
"date",
|
|
11
|
+
"picture",
|
|
12
|
+
"repeatingSection",
|
|
13
|
+
"button",
|
|
14
|
+
"index",
|
|
15
|
+
"group"
|
|
16
|
+
]);
|
|
17
|
+
const ContentControlLockSchema = zod.z.enum([
|
|
18
|
+
"content",
|
|
19
|
+
"container",
|
|
20
|
+
"both"
|
|
21
|
+
]);
|
|
22
|
+
const ContentControlDescriptorSchema = zod.z.strictObject({
|
|
23
|
+
kind: zod.z.literal("contentControl"),
|
|
24
|
+
controlType: ContentControlTypeSchema,
|
|
25
|
+
tag: zod.z.string().optional(),
|
|
26
|
+
alias: zod.z.string().optional(),
|
|
27
|
+
lock: ContentControlLockSchema.optional(),
|
|
28
|
+
value: zod.z.string().optional(),
|
|
29
|
+
checked: zod.z.boolean().optional(),
|
|
30
|
+
options: zod.z.array(zod.z.string()).optional()
|
|
31
|
+
});
|
|
32
|
+
const FieldDescriptorSchema = zod.z.strictObject({
|
|
33
|
+
kind: zod.z.literal("field"),
|
|
34
|
+
instruction: zod.z.string(),
|
|
35
|
+
cachedResult: zod.z.string().optional()
|
|
36
|
+
});
|
|
37
|
+
const AnchorTypeSchema = zod.z.enum([
|
|
38
|
+
"bookmark",
|
|
39
|
+
"footnote",
|
|
40
|
+
"endnote",
|
|
41
|
+
"comment"
|
|
42
|
+
]);
|
|
43
|
+
const AnchorDescriptorSchema = zod.z.strictObject({
|
|
44
|
+
kind: zod.z.literal("anchor"),
|
|
45
|
+
anchorType: AnchorTypeSchema,
|
|
46
|
+
name: zod.z.string(),
|
|
47
|
+
definition: zod.z.string().optional()
|
|
48
|
+
});
|
|
49
|
+
const LinkTargetSchema = zod.z.discriminatedUnion("kind", [zod.z.strictObject({
|
|
50
|
+
kind: zod.z.literal("external"),
|
|
51
|
+
uri: zod.z.string()
|
|
52
|
+
}), zod.z.strictObject({
|
|
53
|
+
kind: zod.z.literal("internal"),
|
|
54
|
+
anchor: zod.z.string()
|
|
55
|
+
})]);
|
|
56
|
+
const LinkDescriptorSchema = zod.z.strictObject({
|
|
57
|
+
kind: zod.z.literal("link"),
|
|
58
|
+
target: LinkTargetSchema,
|
|
59
|
+
title: zod.z.string().optional()
|
|
60
|
+
});
|
|
61
|
+
const ProvenanceChangeSchema = zod.z.enum([
|
|
62
|
+
"insertion",
|
|
63
|
+
"deletion",
|
|
64
|
+
"moveFrom",
|
|
65
|
+
"moveTo",
|
|
66
|
+
"formatChange"
|
|
67
|
+
]);
|
|
68
|
+
const ProvenanceDescriptorSchema = zod.z.strictObject({
|
|
69
|
+
kind: zod.z.literal("provenance"),
|
|
70
|
+
change: ProvenanceChangeSchema,
|
|
71
|
+
author: zod.z.string().optional(),
|
|
72
|
+
dateIso: zod.z.string().optional()
|
|
73
|
+
});
|
|
74
|
+
const DivisionSourceSchema = zod.z.strictObject({
|
|
75
|
+
href: zod.z.string(),
|
|
76
|
+
sectionName: zod.z.string().optional()
|
|
77
|
+
});
|
|
78
|
+
const DivisionDescriptorSchema = zod.z.strictObject({
|
|
79
|
+
kind: zod.z.literal("division"),
|
|
80
|
+
name: zod.z.string().optional(),
|
|
81
|
+
columnCount: zod.z.number().int().positive().optional(),
|
|
82
|
+
protected: zod.z.boolean().optional(),
|
|
83
|
+
source: DivisionSourceSchema.optional()
|
|
84
|
+
});
|
|
85
|
+
const ConstructDescriptorSchema = zod.z.discriminatedUnion("kind", [
|
|
86
|
+
ContentControlDescriptorSchema,
|
|
87
|
+
FieldDescriptorSchema,
|
|
88
|
+
AnchorDescriptorSchema,
|
|
89
|
+
LinkDescriptorSchema,
|
|
90
|
+
ProvenanceDescriptorSchema,
|
|
91
|
+
DivisionDescriptorSchema
|
|
92
|
+
]);
|
|
93
|
+
//#endregion
|
|
94
|
+
exports.AnchorDescriptorSchema = AnchorDescriptorSchema;
|
|
95
|
+
exports.AnchorTypeSchema = AnchorTypeSchema;
|
|
96
|
+
exports.ConstructDescriptorSchema = ConstructDescriptorSchema;
|
|
97
|
+
exports.ContentControlDescriptorSchema = ContentControlDescriptorSchema;
|
|
98
|
+
exports.ContentControlLockSchema = ContentControlLockSchema;
|
|
99
|
+
exports.ContentControlTypeSchema = ContentControlTypeSchema;
|
|
100
|
+
exports.DivisionDescriptorSchema = DivisionDescriptorSchema;
|
|
101
|
+
exports.DivisionSourceSchema = DivisionSourceSchema;
|
|
102
|
+
exports.FieldDescriptorSchema = FieldDescriptorSchema;
|
|
103
|
+
exports.LinkDescriptorSchema = LinkDescriptorSchema;
|
|
104
|
+
exports.LinkTargetSchema = LinkTargetSchema;
|
|
105
|
+
exports.ProvenanceChangeSchema = ProvenanceChangeSchema;
|
|
106
|
+
exports.ProvenanceDescriptorSchema = ProvenanceDescriptorSchema;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { C as ProvenanceChange, E as ProvenanceDescriptorSchema, S as LinkTargetSchema, T as ProvenanceDescriptor, _ as FieldDescriptor, a as ConstructDescriptor, b as LinkDescriptorSchema, c as ContentControlDescriptorSchema, d as ContentControlType, f as ContentControlTypeSchema, g as DivisionSourceSchema, h as DivisionSource, i as AnchorTypeSchema, l as ContentControlLock, m as DivisionDescriptorSchema, n as AnchorDescriptorSchema, o as ConstructDescriptorSchema, p as DivisionDescriptor, r as AnchorType, s as ContentControlDescriptor, t as AnchorDescriptor, u as ContentControlLockSchema, v as FieldDescriptorSchema, w as ProvenanceChangeSchema, x as LinkTarget, y as LinkDescriptor } from "./construct-CdQuI9f5.cjs";
|
|
2
|
+
export { AnchorDescriptor, AnchorDescriptorSchema, AnchorType, AnchorTypeSchema, ConstructDescriptor, ConstructDescriptorSchema, ContentControlDescriptor, ContentControlDescriptorSchema, ContentControlLock, ContentControlLockSchema, ContentControlType, ContentControlTypeSchema, DivisionDescriptor, DivisionDescriptorSchema, DivisionSource, DivisionSourceSchema, FieldDescriptor, FieldDescriptorSchema, LinkDescriptor, LinkDescriptorSchema, LinkTarget, LinkTargetSchema, ProvenanceChange, ProvenanceChangeSchema, ProvenanceDescriptor, ProvenanceDescriptorSchema };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { C as ProvenanceChange, E as ProvenanceDescriptorSchema, S as LinkTargetSchema, T as ProvenanceDescriptor, _ as FieldDescriptor, a as ConstructDescriptor, b as LinkDescriptorSchema, c as ContentControlDescriptorSchema, d as ContentControlType, f as ContentControlTypeSchema, g as DivisionSourceSchema, h as DivisionSource, i as AnchorTypeSchema, l as ContentControlLock, m as DivisionDescriptorSchema, n as AnchorDescriptorSchema, o as ConstructDescriptorSchema, p as DivisionDescriptor, r as AnchorType, s as ContentControlDescriptor, t as AnchorDescriptor, u as ContentControlLockSchema, v as FieldDescriptorSchema, w as ProvenanceChangeSchema, x as LinkTarget, y as LinkDescriptor } from "./construct-CdQuI9f5.js";
|
|
2
|
+
export { AnchorDescriptor, AnchorDescriptorSchema, AnchorType, AnchorTypeSchema, ConstructDescriptor, ConstructDescriptorSchema, ContentControlDescriptor, ContentControlDescriptorSchema, ContentControlLock, ContentControlLockSchema, ContentControlType, ContentControlTypeSchema, DivisionDescriptor, DivisionDescriptorSchema, DivisionSource, DivisionSourceSchema, FieldDescriptor, FieldDescriptorSchema, LinkDescriptor, LinkDescriptorSchema, LinkTarget, LinkTargetSchema, ProvenanceChange, ProvenanceChangeSchema, ProvenanceDescriptor, ProvenanceDescriptorSchema };
|