@embedpdf/react 3.0.0-next.13 → 3.0.0-next.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AnnotationList-CkijRHet-HEFNUIZe.d.cts +877 -0
- package/dist/AnnotationList-CkijRHet-HEFNUIZe.d.ts +877 -0
- package/dist/actions.cjs +25 -5
- package/dist/actions.cjs.map +1 -1
- package/dist/actions.d.cts +18 -5
- package/dist/actions.d.ts +18 -5
- package/dist/actions.js +22 -6
- package/dist/actions.js.map +1 -1
- package/dist/anchored-DeX95xSd.d.ts +85 -0
- package/dist/anchored-DzN3JywS.d.cts +85 -0
- package/dist/anchored.cjs +71 -28
- package/dist/anchored.cjs.map +1 -1
- package/dist/anchored.d.cts +2 -45
- package/dist/anchored.d.ts +2 -45
- package/dist/anchored.js +56 -19
- package/dist/anchored.js.map +1 -1
- package/dist/annotation-B48UT2ln.d.ts +302 -0
- package/dist/annotation-C1ttM8Wj.js +708 -0
- package/dist/annotation-C1ttM8Wj.js.map +1 -0
- package/dist/annotation-C9dVwo9b.d.cts +302 -0
- package/dist/annotation-Dex5EBda.cjs +830 -0
- package/dist/annotation-Dex5EBda.cjs.map +1 -0
- package/dist/annotation.cjs +20 -783
- package/dist/annotation.d.cts +2 -2
- package/dist/annotation.d.ts +2 -2
- package/dist/annotation.js +2 -768
- package/dist/commands.cjs +68 -28
- package/dist/commands.cjs.map +1 -1
- package/dist/commands.d.cts +37 -10
- package/dist/commands.d.ts +37 -10
- package/dist/commands.js +68 -31
- package/dist/commands.js.map +1 -1
- package/dist/form-55izw0jS.js +511 -0
- package/dist/form-55izw0jS.js.map +1 -0
- package/dist/form-BNqQfGGH.cjs +548 -0
- package/dist/form-BNqQfGGH.cjs.map +1 -0
- package/dist/form.cjs +5 -5
- package/dist/form.d.cts +32 -25
- package/dist/form.d.ts +32 -25
- package/dist/form.js +2 -3
- package/dist/history.cjs +38 -0
- package/dist/history.cjs.map +1 -0
- package/dist/history.d.cts +27 -0
- package/dist/history.d.ts +27 -0
- package/dist/history.js +27 -0
- package/dist/history.js.map +1 -0
- package/dist/i18n.cjs +26 -30
- package/dist/i18n.cjs.map +1 -1
- package/dist/i18n.d.cts +24 -21
- package/dist/i18n.d.ts +24 -21
- package/dist/i18n.js +24 -31
- package/dist/i18n.js.map +1 -1
- package/dist/index.cjs +213 -57
- package/dist/index.d.cts +32 -31
- package/dist/index.d.ts +32 -31
- package/dist/index.js +33 -29
- package/dist/inert-CmBEbKCn.cjs +19 -0
- package/dist/inert-CmBEbKCn.cjs.map +1 -0
- package/dist/inert-D8fkennb.js +14 -0
- package/dist/inert-D8fkennb.js.map +1 -0
- package/dist/interaction.cjs +48 -102
- package/dist/interaction.cjs.map +1 -1
- package/dist/interaction.d.cts +23 -32
- package/dist/interaction.d.ts +23 -32
- package/dist/interaction.js +33 -102
- package/dist/interaction.js.map +1 -1
- package/dist/link.cjs +65 -104
- package/dist/link.cjs.map +1 -1
- package/dist/link.d.cts +21 -16
- package/dist/link.d.ts +22 -17
- package/dist/link.js +67 -107
- package/dist/link.js.map +1 -1
- package/dist/measurement.cjs +56 -0
- package/dist/measurement.cjs.map +1 -0
- package/dist/measurement.d.cts +38 -0
- package/dist/measurement.d.ts +38 -0
- package/dist/measurement.js +42 -0
- package/dist/measurement.js.map +1 -0
- package/dist/metadata.cjs +20 -7
- package/dist/metadata.cjs.map +1 -1
- package/dist/metadata.d.cts +22 -7
- package/dist/metadata.d.ts +22 -7
- package/dist/metadata.js +20 -10
- package/dist/metadata.js.map +1 -1
- package/dist/page-edit.cjs +7 -3
- package/dist/page-edit.cjs.map +1 -1
- package/dist/page-edit.d.cts +6 -2
- package/dist/page-edit.d.ts +6 -2
- package/dist/page-edit.js +7 -4
- package/dist/page-edit.js.map +1 -1
- package/dist/page-layers-Bkaaz8Zf.js +26 -0
- package/dist/page-layers-Bkaaz8Zf.js.map +1 -0
- package/dist/page-layers-BloZDoOV.cjs +37 -0
- package/dist/page-layers-BloZDoOV.cjs.map +1 -0
- package/dist/page-view.cjs +89 -82
- package/dist/page-view.cjs.map +1 -1
- package/dist/page-view.d.cts +14 -7
- package/dist/page-view.d.ts +18 -11
- package/dist/page-view.js +86 -81
- package/dist/page-view.js.map +1 -1
- package/dist/redaction.cjs +30 -15
- package/dist/redaction.cjs.map +1 -1
- package/dist/redaction.d.cts +27 -9
- package/dist/redaction.d.ts +27 -9
- package/dist/redaction.js +29 -18
- package/dist/redaction.js.map +1 -1
- package/dist/render.cjs +71 -46
- package/dist/render.cjs.map +1 -1
- package/dist/render.d.cts +17 -5
- package/dist/render.d.ts +17 -5
- package/dist/render.js +70 -49
- package/dist/render.js.map +1 -1
- package/dist/runtime-B6xcPsEb.js +398 -0
- package/dist/runtime-B6xcPsEb.js.map +1 -0
- package/dist/runtime-DBEBlpQV.d.cts +237 -0
- package/dist/runtime-V3MVMb91.d.ts +237 -0
- package/dist/runtime-fzpGv78v.cjs +555 -0
- package/dist/runtime-fzpGv78v.cjs.map +1 -0
- package/dist/runtime.cjs +45 -324
- package/dist/runtime.d.cts +2 -2
- package/dist/runtime.d.ts +2 -2
- package/dist/runtime.js +2 -306
- package/dist/search.cjs +81 -50
- package/dist/search.cjs.map +1 -1
- package/dist/search.d.cts +36 -24
- package/dist/search.d.ts +36 -24
- package/dist/search.js +81 -53
- package/dist/search.js.map +1 -1
- package/dist/selection.cjs +105 -108
- package/dist/selection.cjs.map +1 -1
- package/dist/selection.d.cts +54 -26
- package/dist/selection.d.ts +56 -28
- package/dist/selection.js +103 -110
- package/dist/selection.js.map +1 -1
- package/dist/shell.cjs +36 -21
- package/dist/shell.cjs.map +1 -1
- package/dist/shell.d.cts +32 -17
- package/dist/shell.d.ts +32 -17
- package/dist/shell.js +36 -24
- package/dist/shell.js.map +1 -1
- package/dist/signature.cjs +29 -48
- package/dist/signature.cjs.map +1 -1
- package/dist/signature.d.cts +26 -26
- package/dist/signature.d.ts +26 -26
- package/dist/signature.js +30 -48
- package/dist/signature.js.map +1 -1
- package/dist/stage-BIG6aeVd.cjs +369 -0
- package/dist/stage-BIG6aeVd.cjs.map +1 -0
- package/dist/stage-ByFPD-Fv.d.cts +117 -0
- package/dist/stage-DaboaheR.d.ts +117 -0
- package/dist/stage-DoVekb83.js +302 -0
- package/dist/stage-DoVekb83.js.map +1 -0
- package/dist/stage-scope-CQgCuf1w.cjs +46 -0
- package/dist/stage-scope-CQgCuf1w.cjs.map +1 -0
- package/dist/stage-scope-D7ZeNduT.js +23 -0
- package/dist/stage-scope-D7ZeNduT.js.map +1 -0
- package/dist/stage.cjs +12 -235
- package/dist/stage.d.cts +2 -116
- package/dist/stage.d.ts +2 -116
- package/dist/stage.js +3 -228
- package/dist/stamp.cjs +41 -35
- package/dist/stamp.cjs.map +1 -1
- package/dist/stamp.d.cts +25 -18
- package/dist/stamp.d.ts +25 -18
- package/dist/stamp.js +40 -37
- package/dist/stamp.js.map +1 -1
- package/dist/state-0K1I5cM4.d.cts +29 -0
- package/dist/state-0K1I5cM4.d.ts +29 -0
- package/dist/state-CbgxhwLA.js +62 -0
- package/dist/state-CbgxhwLA.js.map +1 -0
- package/dist/state-CsfZy_Eq.cjs +73 -0
- package/dist/state-CsfZy_Eq.cjs.map +1 -0
- package/dist/svg-shapes-Dm1yTR1b.js +40 -0
- package/dist/svg-shapes-Dm1yTR1b.js.map +1 -0
- package/dist/svg-shapes-zo0GNkc9.cjs +53 -0
- package/dist/svg-shapes-zo0GNkc9.cjs.map +1 -0
- package/dist/toolbar.cjs +297 -295
- package/dist/toolbar.cjs.map +1 -1
- package/dist/toolbar.d.cts +58 -68
- package/dist/toolbar.d.ts +67 -77
- package/dist/toolbar.js +271 -293
- package/dist/toolbar.js.map +1 -1
- package/dist/view-manager.cjs +34 -0
- package/dist/view-manager.cjs.map +1 -0
- package/dist/view-manager.d.cts +21 -0
- package/dist/view-manager.d.ts +21 -0
- package/dist/view-manager.js +23 -0
- package/dist/view-manager.js.map +1 -0
- package/package.json +41 -38
- package/dist/AnnotationListSnapshot-D3mFut1e-C_GMpK25.d.cts +0 -546
- package/dist/AnnotationListSnapshot-D3mFut1e-C_GMpK25.d.ts +0 -546
- package/dist/annotation-BCED_p9H.d.cts +0 -160
- package/dist/annotation-anchors-CetwM1g7.js +0 -15
- package/dist/annotation-anchors-CetwM1g7.js.map +0 -1
- package/dist/annotation-anchors-DuYRBJLl.cjs +0 -26
- package/dist/annotation-anchors-DuYRBJLl.cjs.map +0 -1
- package/dist/annotation-hooks-BB5ZhPpf.cjs +0 -16
- package/dist/annotation-hooks-BB5ZhPpf.cjs.map +0 -1
- package/dist/annotation-hooks-Df8EmzDO.js +0 -11
- package/dist/annotation-hooks-Df8EmzDO.js.map +0 -1
- package/dist/annotation-k38KDlIZ.d.ts +0 -160
- package/dist/annotation-menu.cjs +0 -64
- package/dist/annotation-menu.cjs.map +0 -1
- package/dist/annotation-menu.d.cts +0 -33
- package/dist/annotation-menu.d.ts +0 -33
- package/dist/annotation-menu.js +0 -48
- package/dist/annotation-menu.js.map +0 -1
- package/dist/annotation.cjs.map +0 -1
- package/dist/annotation.js.map +0 -1
- package/dist/form-BVumS7up.cjs +0 -926
- package/dist/form-BVumS7up.cjs.map +0 -1
- package/dist/form-CK3mp99m.js +0 -895
- package/dist/form-CK3mp99m.js.map +0 -1
- package/dist/rolldown-runtime-BBjsoOtd.js +0 -27
- package/dist/runtime-DE76hlnl.d.ts +0 -216
- package/dist/runtime-umHA_xHt.d.cts +0 -216
- package/dist/runtime.cjs.map +0 -1
- package/dist/runtime.js.map +0 -1
- package/dist/scrollbar.cjs +0 -241
- package/dist/scrollbar.cjs.map +0 -1
- package/dist/scrollbar.d.cts +0 -42
- package/dist/scrollbar.d.ts +0 -42
- package/dist/scrollbar.js +0 -213
- package/dist/scrollbar.js.map +0 -1
- package/dist/stage.cjs.map +0 -1
- package/dist/stage.js.map +0 -1
- package/dist/views.cjs +0 -35
- package/dist/views.cjs.map +0 -1
- package/dist/views.d.cts +0 -21
- package/dist/views.d.ts +0 -21
- package/dist/views.js +0 -27
- package/dist/views.js.map +0 -1
|
@@ -0,0 +1,877 @@
|
|
|
1
|
+
//#region ../../engine/core/dist/AnnotationList-CkijRHet.d.ts
|
|
2
|
+
//#region src/dto/IsoDateTime.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* A moment, as an ISO 8601 string: `2017-07-12T21:44:38-07:00`.
|
|
5
|
+
*
|
|
6
|
+
* Every date in the engine's data has this type. A date read from the PDF
|
|
7
|
+
* keeps the offset it was written with (a PDF date without an offset reads
|
|
8
|
+
* without one); a date the engine makes itself is UTC (`…Z`). A date the PDF
|
|
9
|
+
* writes in a form that can't be parsed reads as `null`. PDF dates have whole
|
|
10
|
+
* seconds, so a fraction is dropped on write.
|
|
11
|
+
*
|
|
12
|
+
* Reads are strings, never `Date` objects: a read must go back into a write
|
|
13
|
+
* as it is, including through JSON, and a `Date` would also drop the offset.
|
|
14
|
+
*/
|
|
15
|
+
type IsoDateTime = string;
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/identity/PageObjectNumber.d.ts
|
|
18
|
+
/**
|
|
19
|
+
* PDF indirect object number for a page.
|
|
20
|
+
*
|
|
21
|
+
* Resolved via the PDFium runtime helper `EPDFPage_GetObjectNumber(pagePtr)`.
|
|
22
|
+
* Always > 0 for well-formed PDFs, and the primary addressing key. The
|
|
23
|
+
* page index is kept on `PageHandle` as display
|
|
24
|
+
* metadata only, because it can shift when pages are inserted, deleted, or
|
|
25
|
+
* reordered while a session is open.
|
|
26
|
+
*/
|
|
27
|
+
type PageObjectNumber = number;
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/identity/PageRef.d.ts
|
|
30
|
+
/**
|
|
31
|
+
* How callers address a page — the page-plane sibling of `AnnotationRef`
|
|
32
|
+
* and `FormFieldRef`.
|
|
33
|
+
*
|
|
34
|
+
* `objectNumber` is the indirect object number of the page dictionary.
|
|
35
|
+
* ISO 32000-1 §7.7.3.3 requires every `/Kids` entry to be an indirect
|
|
36
|
+
* reference, the layer runtime never renumbers (frozen base + incremental
|
|
37
|
+
* deltas), and a deleted page's number is retired, never recycled — so it
|
|
38
|
+
* is the durable identity for the lifetime of a document. It is what every
|
|
39
|
+
* `PageLayout.ref` and `PageHandle.ref` carries.
|
|
40
|
+
*
|
|
41
|
+
* It is deliberately the only kind. Pages are durable by construction (see
|
|
42
|
+
* `PagesMutator`): a display index is never an identity, a page without an
|
|
43
|
+
* object number is refused at open (`MalformedPdf`), and a `/Names /Pages`
|
|
44
|
+
* key is a registry entry the layout already maps to a number, not a second
|
|
45
|
+
* identity the engine would ever return. The discriminated shape keeps the
|
|
46
|
+
* address consistent with the other refs and leaves room for an additive
|
|
47
|
+
* kind should a real one ever appear.
|
|
48
|
+
*
|
|
49
|
+
* Records that mention a page (an annotation ref, event payloads, per-page
|
|
50
|
+
* results, destinations, search matches) carry the same `page: PageRef`;
|
|
51
|
+
* `toPageRef()` builds one from a page number you already hold.
|
|
52
|
+
*/
|
|
53
|
+
type PageRef = {
|
|
54
|
+
kind: 'objectNumber';
|
|
55
|
+
objectNumber: PageObjectNumber;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* A destination (ISO 32000-1 §12.3.2.2): the page it goes to and where on
|
|
59
|
+
* that page, measured from the top-left of that page's visible box, y down.
|
|
60
|
+
* Outlines, links, actions and the document's open destination all resolve
|
|
61
|
+
* to one of these; named destinations are resolved by the engine, so only
|
|
62
|
+
* this explicit form is ever handed out.
|
|
63
|
+
*
|
|
64
|
+
* `null` keeps the viewer's current value, as in the file, and a value left
|
|
65
|
+
* out means the same; an `xyz` zoom of `0` means the same as `null`. The
|
|
66
|
+
* `fitB*` kinds fit the page's content bounding box rather than the whole
|
|
67
|
+
* page. Pass one straight to the stage's `reveal`.
|
|
68
|
+
*/
|
|
69
|
+
type PageDestination = {
|
|
70
|
+
kind: 'xyz';
|
|
71
|
+
page: PageRef;
|
|
72
|
+
x?: number | null;
|
|
73
|
+
y?: number | null;
|
|
74
|
+
zoom?: number | null;
|
|
75
|
+
} | {
|
|
76
|
+
kind: 'fit';
|
|
77
|
+
page: PageRef;
|
|
78
|
+
} | {
|
|
79
|
+
kind: 'fitH';
|
|
80
|
+
page: PageRef;
|
|
81
|
+
y?: number | null;
|
|
82
|
+
} | {
|
|
83
|
+
kind: 'fitV';
|
|
84
|
+
page: PageRef;
|
|
85
|
+
x?: number | null;
|
|
86
|
+
} | {
|
|
87
|
+
kind: 'fitR';
|
|
88
|
+
page: PageRef;
|
|
89
|
+
x: number;
|
|
90
|
+
y: number;
|
|
91
|
+
width: number;
|
|
92
|
+
height: number;
|
|
93
|
+
} | {
|
|
94
|
+
kind: 'fitB';
|
|
95
|
+
page: PageRef;
|
|
96
|
+
} | {
|
|
97
|
+
kind: 'fitBH';
|
|
98
|
+
page: PageRef;
|
|
99
|
+
y?: number | null;
|
|
100
|
+
} | {
|
|
101
|
+
kind: 'fitBV';
|
|
102
|
+
page: PageRef;
|
|
103
|
+
x?: number | null;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* One Hide `/T` or ResetForm `/Fields` entry. Deliberately unscoped: a
|
|
107
|
+
* dictionary reference carries no page, so resolution (a name to widgets, an
|
|
108
|
+
* object number to an annotation or field) is the interpreter's job — never
|
|
109
|
+
* the extractor's.
|
|
110
|
+
*/
|
|
111
|
+
type PdfActionTargetRef = {
|
|
112
|
+
kind: 'name';
|
|
113
|
+
name: string;
|
|
114
|
+
} | {
|
|
115
|
+
kind: 'objectNumber';
|
|
116
|
+
objectNumber: number;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Decoded SubmitForm `/Flags` word (ISO 32000-2:2020 Table 240) plus the raw
|
|
120
|
+
* value. `exclude` is derived from bit 1 — never stored separately, so the
|
|
121
|
+
* two cannot disagree. Note the two easily-missed positions verified against
|
|
122
|
+
* the spec: bit 12 is `ExclFKey` (not "ExclFDFTemplate") and bit 13 is
|
|
123
|
+
* reserved/undefined, so `EmbedForm` is bit 14.
|
|
124
|
+
*/
|
|
125
|
+
interface SubmitFormFlags {
|
|
126
|
+
raw: number;
|
|
127
|
+
/** Bit 1: set → `fields` lists excluded fields. */
|
|
128
|
+
exclude: boolean;
|
|
129
|
+
/** Bit 2: submit designated valueless fields too, as name-only entries. */
|
|
130
|
+
includeNoValueFields: boolean;
|
|
131
|
+
/** Bits 3/6/9 folded into one verdict: bit 9 SubmitPDF dominates ("all
|
|
132
|
+
* other flags shall be ignored except GetMethod"), else bit 6 XFDF, else
|
|
133
|
+
* bit 3 HTML Form format, else FDF (the Table 240 default). */
|
|
134
|
+
format: 'fdf' | 'html' | 'xfdf' | 'pdf';
|
|
135
|
+
/** Bit 4. ISO makes GetMethod meaningful only with ExportFormat set, and
|
|
136
|
+
* the bit-9 rule keeps it alive for SubmitPDF — so `'get'` only for
|
|
137
|
+
* `'html'` and `'pdf'`; everything else posts. */
|
|
138
|
+
method: 'post' | 'get';
|
|
139
|
+
/** Bit 5 (meaningful only with ExportFormat; passed through — this stack
|
|
140
|
+
* does not capture click coordinates). */
|
|
141
|
+
submitCoordinates: boolean;
|
|
142
|
+
/** Bit 7 (FDF only): include incremental updates via FDF `Differences`. */
|
|
143
|
+
includeAppendSaves: boolean;
|
|
144
|
+
/** Bit 8 (FDF only): include markup annotations. */
|
|
145
|
+
includeAnnotations: boolean;
|
|
146
|
+
/** Bit 10: convert date-like values to the standard date format. */
|
|
147
|
+
canonicalFormat: boolean;
|
|
148
|
+
/** Bit 11 (FDF, with IncludeAnnotations): only the current user's
|
|
149
|
+
* annotations. */
|
|
150
|
+
exclNonUserAnnots: boolean;
|
|
151
|
+
/** Bit 12: the submitted FDF excludes its `F` entry. */
|
|
152
|
+
exclFKey: boolean;
|
|
153
|
+
/** Bit 14 (bit 13 is reserved): the FDF `F` entry embeds the source PDF. */
|
|
154
|
+
embedForm: boolean;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* SubmitForm's extracted intent. Atomic on purpose: either every required
|
|
158
|
+
* component resolved (a complete, executable payload) or the node carries no
|
|
159
|
+
* payload at all — partial states are unrepresentable. An unreadable
|
|
160
|
+
* required component (`/F`) degrades the whole node to `unknown` +
|
|
161
|
+
* `payload-dropped` at read time instead.
|
|
162
|
+
*/
|
|
163
|
+
interface SubmitFormPayload {
|
|
164
|
+
/** Resolved `/F` URL — a `<< /FS /URL >>` file specification (7.11.5,
|
|
165
|
+
* `/UF` preferred over `/F` per 7.11.2); a bare string `/F` is accepted
|
|
166
|
+
* as a producer-compat extension. */
|
|
167
|
+
url: string;
|
|
168
|
+
/**
|
|
169
|
+
* `null` = `/Fields` absent → Include/Exclude is ignored and every field
|
|
170
|
+
* except NoExport-flagged ones is submitted (Table 239). `[]` =
|
|
171
|
+
* present-but-empty: include mode submits nothing, exclude mode submits
|
|
172
|
+
* everything eligible — presence and emptiness are different states.
|
|
173
|
+
*/
|
|
174
|
+
fields: PdfActionTargetRef[] | null;
|
|
175
|
+
flags: SubmitFormFlags;
|
|
176
|
+
/** `/CharSet` (PDF 2.0), extracted but not encoded by this stack. */
|
|
177
|
+
charSet?: string;
|
|
178
|
+
}
|
|
179
|
+
interface PdfActionNodeCommon<Destination> {
|
|
180
|
+
/** Raw `/S` name, retained for unknown and future action types. */
|
|
181
|
+
subtype: string;
|
|
182
|
+
/** Normalized `/Next` children in PDF order. */
|
|
183
|
+
next: PdfActionNode<Destination>[];
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* One detached node in a normalized PDF action tree, discriminated on the
|
|
187
|
+
* interpreter that would execute it. Every executable arm carries its full
|
|
188
|
+
* payload — a `goto` without a destination or a `uri` without a URI is
|
|
189
|
+
* unrepresentable. A payload the reader cannot materialize degrades the node
|
|
190
|
+
* to `unknown` (original `/S` kept on `subtype`) and appends the tree-level
|
|
191
|
+
* `'payload-dropped'` warning. A `goto` goes to a {@link PageDestination};
|
|
192
|
+
* the engine's own readers, which work in the file's coordinates, use
|
|
193
|
+
* `PdfActionNode<PdfDestination>`.
|
|
194
|
+
*/
|
|
195
|
+
type PdfActionNode<Destination = PageDestination> = PdfActionNodeCommon<Destination> & ({
|
|
196
|
+
type: 'javascript';
|
|
197
|
+
script: string;
|
|
198
|
+
} | {
|
|
199
|
+
type: 'goto';
|
|
200
|
+
destination: Destination;
|
|
201
|
+
} | {
|
|
202
|
+
type: 'uri';
|
|
203
|
+
uri: string;
|
|
204
|
+
isMap: boolean;
|
|
205
|
+
} | {
|
|
206
|
+
type: 'named';
|
|
207
|
+
name: string;
|
|
208
|
+
} | {
|
|
209
|
+
type: 'hide';
|
|
210
|
+
targets: PdfActionTargetRef[];
|
|
211
|
+
hide: boolean;
|
|
212
|
+
} | {
|
|
213
|
+
type: 'reset-form';
|
|
214
|
+
/**
|
|
215
|
+
* `null` = `/Fields` absent → reset every field (`exclude` is
|
|
216
|
+
* meaningless). `[]` = present-but-empty: with `exclude` false reset
|
|
217
|
+
* nothing, with `exclude` true reset everything — PDFium's executor
|
|
218
|
+
* branches on presence first.
|
|
219
|
+
*/
|
|
220
|
+
fields: PdfActionTargetRef[] | null;
|
|
221
|
+
exclude: boolean;
|
|
222
|
+
} |
|
|
223
|
+
/** Reported, never executed. */
|
|
224
|
+
{
|
|
225
|
+
type: 'goto-remote';
|
|
226
|
+
filePath: string;
|
|
227
|
+
} | {
|
|
228
|
+
type: 'goto-embedded';
|
|
229
|
+
filePath: string;
|
|
230
|
+
} | {
|
|
231
|
+
type: 'launch';
|
|
232
|
+
filePath: string;
|
|
233
|
+
} |
|
|
234
|
+
/** ISO allows `/Rendition` to carry `/JS`; preserved, not collected. */
|
|
235
|
+
{
|
|
236
|
+
type: 'rendition';
|
|
237
|
+
script?: string;
|
|
238
|
+
} |
|
|
239
|
+
/** Recognized; executable only when `payload` is present. Absent payload
|
|
240
|
+
* = extracted by a runtime without the SubmitForm getters (version
|
|
241
|
+
* skew) — the node stays recognized-inert. */
|
|
242
|
+
{
|
|
243
|
+
type: 'submit-form';
|
|
244
|
+
payload?: SubmitFormPayload;
|
|
245
|
+
} | {
|
|
246
|
+
type: 'thread';
|
|
247
|
+
} | {
|
|
248
|
+
type: 'sound';
|
|
249
|
+
} | {
|
|
250
|
+
type: 'movie';
|
|
251
|
+
} | {
|
|
252
|
+
type: 'import-data';
|
|
253
|
+
} | {
|
|
254
|
+
type: 'set-ocg-state';
|
|
255
|
+
} | {
|
|
256
|
+
type: 'transition';
|
|
257
|
+
} | {
|
|
258
|
+
type: 'goto-3d-view';
|
|
259
|
+
} | {
|
|
260
|
+
type: 'unknown';
|
|
261
|
+
});
|
|
262
|
+
type PdfActionWarning = 'cycle-dropped' | 'malformed-next' | 'incomplete' |
|
|
263
|
+
/** A node's payload could not be read; that node degraded to `unknown`. */
|
|
264
|
+
'payload-dropped';
|
|
265
|
+
/**
|
|
266
|
+
* One extracted action root plus the native reader's safety verdict.
|
|
267
|
+
* Consumers must never execute a tree whose `incomplete` flag is true.
|
|
268
|
+
*/
|
|
269
|
+
interface PdfActionTree<Destination = PageDestination> {
|
|
270
|
+
/** Null when the model was valid but its root exceeded a safety bound. */
|
|
271
|
+
root: PdfActionNode<Destination> | null;
|
|
272
|
+
incomplete: boolean;
|
|
273
|
+
/** Raw native bits, retained so newer warnings survive older SDKs.
|
|
274
|
+
* TS-detected warnings (`payload-dropped`) appear only in `warnings`. */
|
|
275
|
+
warningFlags: number;
|
|
276
|
+
warnings: PdfActionWarning[];
|
|
277
|
+
}
|
|
278
|
+
interface PdfFieldActions<Destination = PageDestination> {
|
|
279
|
+
keystroke?: PdfActionTree<Destination>;
|
|
280
|
+
format?: PdfActionTree<Destination>;
|
|
281
|
+
validate?: PdfActionTree<Destination>;
|
|
282
|
+
calculate?: PdfActionTree<Destination>;
|
|
283
|
+
}
|
|
284
|
+
//#endregion
|
|
285
|
+
//#region src/identity/AnnotationRef.d.ts
|
|
286
|
+
/**
|
|
287
|
+
* How callers address an annotation, and how the engine names one. Every
|
|
288
|
+
* annotation has one name for life:
|
|
289
|
+
*
|
|
290
|
+
* - `objectNumber`: an annotation born as a PDF object, in the uploaded
|
|
291
|
+
* file or written later. Object numbers are never reused.
|
|
292
|
+
* - `baseIndex`: an annotation born inline in the uploaded file (a
|
|
293
|
+
* dictionary in the page's `/Annots`, with no object number of its own).
|
|
294
|
+
* Its name is its position in that page's `/Annots` in the uploaded
|
|
295
|
+
* file, which never changes. It keeps this name after a write gives it
|
|
296
|
+
* an object number.
|
|
297
|
+
*
|
|
298
|
+
* An annotation's `/NM` is data, not a name: files can carry the same one
|
|
299
|
+
* twice. A ref that names no annotation on its page fails with `NotFound`.
|
|
300
|
+
*/
|
|
301
|
+
type AnnotationRef = {
|
|
302
|
+
kind: 'objectNumber';
|
|
303
|
+
page: PageRef;
|
|
304
|
+
objectNumber: number;
|
|
305
|
+
} | {
|
|
306
|
+
kind: 'baseIndex';
|
|
307
|
+
page: PageRef;
|
|
308
|
+
baseIndex: number;
|
|
309
|
+
};
|
|
310
|
+
//#endregion
|
|
311
|
+
//#region src/identity/FormFieldRef.d.ts
|
|
312
|
+
/**
|
|
313
|
+
* How callers address a logical form field.
|
|
314
|
+
*
|
|
315
|
+
* - `objectNumber` — the indirect object number of the field dictionary.
|
|
316
|
+
* ISO 32000 guarantees every real AcroForm field dictionary is an
|
|
317
|
+
* indirect object, and the layer runtime never renumbers (frozen base +
|
|
318
|
+
* incremental deltas), so this is the durable identity for the lifetime
|
|
319
|
+
* of a document. Preferred for all engine calls.
|
|
320
|
+
* - `fqn` — the fully qualified field name ("billing.name"). The portable,
|
|
321
|
+
* semantic identity used by interchange formats (FDF/XFDF) and analytics;
|
|
322
|
+
* survives document rewrites but is only as unique as the producer made
|
|
323
|
+
* it. The engine resolves it against the reconciled field tree.
|
|
324
|
+
*/
|
|
325
|
+
type FormFieldRef = {
|
|
326
|
+
kind: 'objectNumber';
|
|
327
|
+
objectNumber: number;
|
|
328
|
+
} | {
|
|
329
|
+
kind: 'fqn';
|
|
330
|
+
name: string;
|
|
331
|
+
};
|
|
332
|
+
/**
|
|
333
|
+
* A widget annotation of a field, as the field tree sees it. The forms reader
|
|
334
|
+
* learns widgets from the field's `/Kids`, not from a page's `/Annots`, so it
|
|
335
|
+
* must be able to report widgets the annotation subsystem cannot reach.
|
|
336
|
+
*
|
|
337
|
+
* `ref` is the widget as an annotation address, computed once by the engine:
|
|
338
|
+
* present exactly when the widget is an indirect object (`objectNumber > 0`)
|
|
339
|
+
* placed on a page (`page !== null`). In a conforming PDF every widget has
|
|
340
|
+
* one. `objectNumber` stays beside it because a widget can be an object on no
|
|
341
|
+
* page: it has a number but no annotation address, and the field still owns
|
|
342
|
+
* it (signature checks join changed objects to fields by these numbers).
|
|
343
|
+
*/
|
|
344
|
+
interface FormWidget {
|
|
345
|
+
/** The widget as an annotation address, or null when it cannot be addressed as one. */
|
|
346
|
+
ref: AnnotationRef | null;
|
|
347
|
+
/**
|
|
348
|
+
* The widget annotation's object number, whether or not it is on a page.
|
|
349
|
+
* `0` when the widget is stored as a direct object (spec-violating; it
|
|
350
|
+
* cannot be addressed).
|
|
351
|
+
*/
|
|
352
|
+
objectNumber: number;
|
|
353
|
+
/**
|
|
354
|
+
* The page whose /Annots array references the widget; `null` when the
|
|
355
|
+
* widget is not reachable from any page ("unplaced").
|
|
356
|
+
*/
|
|
357
|
+
page: PageRef | null;
|
|
358
|
+
}
|
|
359
|
+
//#endregion
|
|
360
|
+
//#region src/geometry/pageSpace.d.ts
|
|
361
|
+
/** A point in page space: x from the visible page's left edge, y down from its top edge. */
|
|
362
|
+
interface PagePoint {
|
|
363
|
+
x: number;
|
|
364
|
+
y: number;
|
|
365
|
+
}
|
|
366
|
+
/** A box in page space: `x, y` is its top-left corner. */
|
|
367
|
+
interface PageBox {
|
|
368
|
+
x: number;
|
|
369
|
+
y: number;
|
|
370
|
+
width: number;
|
|
371
|
+
height: number;
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* A quad in page space, with `PdfQuad`'s corner names. The names belong to
|
|
375
|
+
* the text's frame, so the flip to page space keeps them.
|
|
376
|
+
*/
|
|
377
|
+
interface PageQuad {
|
|
378
|
+
upperLeft: PagePoint;
|
|
379
|
+
upperRight: PagePoint;
|
|
380
|
+
lowerLeft: PagePoint;
|
|
381
|
+
lowerRight: PagePoint;
|
|
382
|
+
}
|
|
383
|
+
//#endregion
|
|
384
|
+
//#region src/pageSpace/coordinates.d.ts
|
|
385
|
+
/**
|
|
386
|
+
* The types a value's positions take, for a type that exists in both spaces
|
|
387
|
+
* (`TextLayout<PageCoordinates>`): the file's coordinates or page space.
|
|
388
|
+
*/
|
|
389
|
+
interface Coordinates {
|
|
390
|
+
point: {
|
|
391
|
+
x: number;
|
|
392
|
+
y: number;
|
|
393
|
+
};
|
|
394
|
+
box: object;
|
|
395
|
+
quad: object;
|
|
396
|
+
destination: object;
|
|
397
|
+
}
|
|
398
|
+
interface PageCoordinates extends Coordinates {
|
|
399
|
+
point: PagePoint;
|
|
400
|
+
box: PageBox;
|
|
401
|
+
quad: PageQuad;
|
|
402
|
+
destination: PageDestination;
|
|
403
|
+
}
|
|
404
|
+
//#endregion
|
|
405
|
+
//#region src/forms/value-entry.d.ts
|
|
406
|
+
/** Lossless shape of a field's effective PDF `/V` or `/DV` object. */
|
|
407
|
+
type FormValueEntry = {
|
|
408
|
+
kind: 'none';
|
|
409
|
+
} | {
|
|
410
|
+
kind: 'scalar';
|
|
411
|
+
value: string;
|
|
412
|
+
} | {
|
|
413
|
+
kind: 'array';
|
|
414
|
+
values: string[];
|
|
415
|
+
} | {
|
|
416
|
+
kind: 'unsupported';
|
|
417
|
+
};
|
|
418
|
+
//#endregion
|
|
419
|
+
//#region src/forms/field.d.ts
|
|
420
|
+
/**
|
|
421
|
+
* The field family — the discriminant of {@link FormFieldDTO}. Narrowing on
|
|
422
|
+
* it reveals exactly the members that are meaningful for that family, the
|
|
423
|
+
* same way annotation DTOs narrow on `subtype`.
|
|
424
|
+
*/
|
|
425
|
+
type FormFieldFamily = 'text' | 'checkbox' | 'radio' | 'combobox' | 'listbox' | 'pushbutton' | 'signature' | 'unknown';
|
|
426
|
+
/**
|
|
427
|
+
* Where the field was found.
|
|
428
|
+
*
|
|
429
|
+
* - `acroform` — reachable from the /AcroForm /Fields tree, as the spec
|
|
430
|
+
* requires.
|
|
431
|
+
* - `recovered` — only reachable through a page's /Annots array (a common
|
|
432
|
+
* producer bug). The engine reconciles these on every read so they work
|
|
433
|
+
* like any other field, but other PDF processors will not see them until
|
|
434
|
+
* {@link DocumentFormsService.repair} makes the fix durable.
|
|
435
|
+
*/
|
|
436
|
+
type FormFieldOrigin = 'acroform' | 'recovered';
|
|
437
|
+
/**
|
|
438
|
+
* A widget of a field: its address and its page. Its place, look and state
|
|
439
|
+
* are its row in the form's `widgets`, joined by `ref`.
|
|
440
|
+
*/
|
|
441
|
+
type FormFieldWidget = FormWidget;
|
|
442
|
+
/**
|
|
443
|
+
* A widget of a toggle (checkbox/radio) field. Toggle widgets always carry
|
|
444
|
+
* their appearance-state machinery — no nullable fields to probe.
|
|
445
|
+
*/
|
|
446
|
+
interface ToggleFieldWidget extends FormFieldWidget {
|
|
447
|
+
/**
|
|
448
|
+
* The widget's appearance state name in the file (the non-"Off" key of
|
|
449
|
+
* its /AP /N dictionary), usually its export value. Writes never need it.
|
|
450
|
+
*/
|
|
451
|
+
onState: string;
|
|
452
|
+
/**
|
|
453
|
+
* The widget's export value (/Opt entry when present, else the
|
|
454
|
+
* on-state). The identity FDF/XFDF carry.
|
|
455
|
+
*/
|
|
456
|
+
exportValue: string;
|
|
457
|
+
/** Whether this widget is currently checked. */
|
|
458
|
+
checked: boolean;
|
|
459
|
+
}
|
|
460
|
+
/** One option of a choice (combo/list box) field. */
|
|
461
|
+
interface FormFieldOption {
|
|
462
|
+
/** Display label shown to the user. */
|
|
463
|
+
label: string;
|
|
464
|
+
/** Export value used by /V, interchange, and `FormFieldValue.choice`. */
|
|
465
|
+
value: string;
|
|
466
|
+
/** Whether the option is currently selected. */
|
|
467
|
+
selected: boolean;
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* The trunk every field family shares: identity, provenance, universal
|
|
471
|
+
* flags, and widget placement. A logical field is the document-scoped
|
|
472
|
+
* record that holds the value; its widgets are page-scoped views — join
|
|
473
|
+
* them to the annotation subsystem via each widget's `ref`.
|
|
474
|
+
*/
|
|
475
|
+
interface FormFieldBase<C extends Coordinates = PageCoordinates> {
|
|
476
|
+
/**
|
|
477
|
+
* Durable ref: the field dictionary's object number, or its full name when
|
|
478
|
+
* the dictionary is a direct object (spec-violating) and has no number.
|
|
479
|
+
*/
|
|
480
|
+
ref: FormFieldRef;
|
|
481
|
+
/** Fully qualified name, e.g. `"billing.name"`. */
|
|
482
|
+
name: string;
|
|
483
|
+
family: FormFieldFamily;
|
|
484
|
+
origin: FormFieldOrigin;
|
|
485
|
+
/**
|
|
486
|
+
* The user must not change the value. The engine's write transactions
|
|
487
|
+
* still accept programmatic writes to read-only fields (calculated
|
|
488
|
+
* fields are read-only yet script-written); enforcing fill policy is
|
|
489
|
+
* the application's job.
|
|
490
|
+
*/
|
|
491
|
+
readOnly: boolean;
|
|
492
|
+
/** PDF apps ask for a value before the form is submitted. */
|
|
493
|
+
required: boolean;
|
|
494
|
+
/** Left out when the form is submitted or exported. */
|
|
495
|
+
noExport: boolean;
|
|
496
|
+
/** /TU — the accessible tooltip / alternate name. */
|
|
497
|
+
alternateName: string | null;
|
|
498
|
+
/** /TM — the export mapping name. */
|
|
499
|
+
mappingName: string | null;
|
|
500
|
+
/** Exact effective `/V` object shape; family conveniences below are derived. */
|
|
501
|
+
valueEntry: FormValueEntry;
|
|
502
|
+
/** Exact effective `/DV` object shape, including absent and malformed values. */
|
|
503
|
+
defaultValueEntry: FormValueEntry;
|
|
504
|
+
/** Effective inherited field `/AA` actions. */
|
|
505
|
+
actions?: PdfFieldActions<C['destination']>;
|
|
506
|
+
/**
|
|
507
|
+
* The group the field belongs to: who fills it in (the buyer's fields).
|
|
508
|
+
* `fields:` scopes grant filling in and signing by group. `null` for a
|
|
509
|
+
* field in no group.
|
|
510
|
+
*/
|
|
511
|
+
groupId: string | null;
|
|
512
|
+
/**
|
|
513
|
+
* The user who created the field, as the creating session's identity
|
|
514
|
+
* named them; `null` for a field another tool made, or an anonymous
|
|
515
|
+
* session.
|
|
516
|
+
*/
|
|
517
|
+
createdBy: string | null;
|
|
518
|
+
/** When the field was created; `null` when nobody recorded it. */
|
|
519
|
+
createdAt: IsoDateTime | null;
|
|
520
|
+
/**
|
|
521
|
+
* The user whose write last changed the value: a fill, or the script that
|
|
522
|
+
* fill ran (a calculated total counts as filled by whoever's fill
|
|
523
|
+
* calculated it). `null` after a reset, or when an anonymous session
|
|
524
|
+
* filled it last.
|
|
525
|
+
*/
|
|
526
|
+
filledBy: string | null;
|
|
527
|
+
/** That user's display name, as their session gave it. */
|
|
528
|
+
filledByName: string | null;
|
|
529
|
+
/** When the value last changed by a fill; `null` with `filledBy`. */
|
|
530
|
+
filledAt: IsoDateTime | null;
|
|
531
|
+
/** The session that restored this field's attribution in an import. */
|
|
532
|
+
importedBy: string | null;
|
|
533
|
+
/** The field's widget annotations, in control order. May be empty ("unplaced"). */
|
|
534
|
+
widgets: FormFieldWidget[];
|
|
535
|
+
}
|
|
536
|
+
/** A text field. Write with `{ value }`. */
|
|
537
|
+
interface TextFieldDTO<C extends Coordinates = PageCoordinates> extends FormFieldBase<C> {
|
|
538
|
+
family: 'text';
|
|
539
|
+
value: string;
|
|
540
|
+
/** /DV — restored by `reset()`. */
|
|
541
|
+
defaultValue: string;
|
|
542
|
+
/** /MaxLen; `null` when unlimited. Longer writes are truncated to this length. */
|
|
543
|
+
maxLength: number | null;
|
|
544
|
+
multiline: boolean;
|
|
545
|
+
password: boolean;
|
|
546
|
+
/** Fixed character cells; meaningful with `maxLength`. */
|
|
547
|
+
comb: boolean;
|
|
548
|
+
}
|
|
549
|
+
/** A checkbox. Write with `{ checked }`, or `{ value }` naming a widget's export value. */
|
|
550
|
+
interface CheckboxFieldDTO<C extends Coordinates = PageCoordinates> extends FormFieldBase<C> {
|
|
551
|
+
family: 'checkbox';
|
|
552
|
+
checked: boolean;
|
|
553
|
+
/** The export value reported while checked ("Off" is never exported). */
|
|
554
|
+
exportValue: string;
|
|
555
|
+
widgets: ToggleFieldWidget[];
|
|
556
|
+
}
|
|
557
|
+
/** A radio group: One field, N widgets. Write with `{ value }`, a button's export value. */
|
|
558
|
+
interface RadioFieldDTO<C extends Coordinates = PageCoordinates> extends FormFieldBase<C> {
|
|
559
|
+
family: 'radio';
|
|
560
|
+
/** The checked widget's export value, or `"Off"` when the group is clear. */
|
|
561
|
+
value: string;
|
|
562
|
+
/** Widgets sharing an export value check together. */
|
|
563
|
+
radiosInUnison: boolean;
|
|
564
|
+
/** The group cannot be cleared once a choice is made. */
|
|
565
|
+
noToggleToOff: boolean;
|
|
566
|
+
widgets: ToggleFieldWidget[];
|
|
567
|
+
}
|
|
568
|
+
/** A combo box (dropdown). Write with `{ value }`. */
|
|
569
|
+
interface ComboBoxFieldDTO<C extends Coordinates = PageCoordinates> extends FormFieldBase<C> {
|
|
570
|
+
family: 'combobox';
|
|
571
|
+
/** An option export value — or free text when `edit` is set. */
|
|
572
|
+
value: string;
|
|
573
|
+
/** /DV — restored by `reset()`. */
|
|
574
|
+
defaultValue: string;
|
|
575
|
+
/** Free text is allowed in addition to the options. */
|
|
576
|
+
edit: boolean;
|
|
577
|
+
options: FormFieldOption[];
|
|
578
|
+
}
|
|
579
|
+
/** A list box. Write with `{ selectedValues }`. */
|
|
580
|
+
interface ListBoxFieldDTO<C extends Coordinates = PageCoordinates> extends FormFieldBase<C> {
|
|
581
|
+
family: 'listbox';
|
|
582
|
+
/** Selected option export values, in option order. */
|
|
583
|
+
selectedValues: string[];
|
|
584
|
+
/** /DV — the option values `reset()` selects. */
|
|
585
|
+
defaultValue: string[];
|
|
586
|
+
/** Whether several options may be selected at once. */
|
|
587
|
+
multiSelect: boolean;
|
|
588
|
+
options: FormFieldOption[];
|
|
589
|
+
/** The option shown in the box's top row (`/TI`): its position in `options`. */
|
|
590
|
+
topIndex: number;
|
|
591
|
+
}
|
|
592
|
+
/** A push button: pure trigger, holds no value. Never written or exported. */
|
|
593
|
+
interface PushButtonFieldDTO<C extends Coordinates = PageCoordinates> extends FormFieldBase<C> {
|
|
594
|
+
family: 'pushbutton';
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* A signature field: identity and placement only. Form writes never set a
|
|
598
|
+
* signature value; signing goes through the signatures API.
|
|
599
|
+
*/
|
|
600
|
+
interface SignatureFieldDTO<C extends Coordinates = PageCoordinates> extends FormFieldBase<C> {
|
|
601
|
+
family: 'signature';
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* Forward-compat placeholder for field types the engine does not model,
|
|
605
|
+
* mirroring the `unsupported` annotation kind. Round-trips safely.
|
|
606
|
+
*/
|
|
607
|
+
interface UnknownFieldDTO<C extends Coordinates = PageCoordinates> extends FormFieldBase<C> {
|
|
608
|
+
family: 'unknown';
|
|
609
|
+
/** The raw /V value as text, for diagnostics. */
|
|
610
|
+
rawValue: string;
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* A logical form field. Discriminated on `family`:
|
|
614
|
+
*
|
|
615
|
+
* ```ts
|
|
616
|
+
* if (field.family === 'listbox') {
|
|
617
|
+
* field.selectedValues; // string[]
|
|
618
|
+
* }
|
|
619
|
+
* ```
|
|
620
|
+
*/
|
|
621
|
+
type FormFieldDTO<C extends Coordinates = PageCoordinates> = TextFieldDTO<C> | CheckboxFieldDTO<C> | RadioFieldDTO<C> | ComboBoxFieldDTO<C> | ListBoxFieldDTO<C> | PushButtonFieldDTO<C> | SignatureFieldDTO<C> | UnknownFieldDTO<C>;
|
|
622
|
+
//#endregion
|
|
623
|
+
//#region src/dto/CachePins.d.ts
|
|
624
|
+
/**
|
|
625
|
+
* Per-page cache-busting integers embedded in immutable cloud/CDN leaf URLs.
|
|
626
|
+
*
|
|
627
|
+
* These are not page state. They are read coordinates for cacheable endpoints,
|
|
628
|
+
* one per read family: `/text` and plain renders use `contentVersion`; the
|
|
629
|
+
* page's annotations (every annotation except widgets) use
|
|
630
|
+
* `annotationVersion`; the page's widget images use `widgetVersion`.
|
|
631
|
+
*/
|
|
632
|
+
interface CachePins {
|
|
633
|
+
contentVersion: number;
|
|
634
|
+
/** The page's annotations except widgets: their list and their images. */
|
|
635
|
+
annotationVersion: number;
|
|
636
|
+
/** The page's widgets: their images (`form/pages/{p}/appearances@`). */
|
|
637
|
+
widgetVersion: number;
|
|
638
|
+
}
|
|
639
|
+
//#endregion
|
|
640
|
+
//#region src/mutation/MutationMeta.d.ts
|
|
641
|
+
/**
|
|
642
|
+
* Cache pin patch returned by cloud mutations after the durable DB transaction
|
|
643
|
+
* commits.
|
|
644
|
+
*
|
|
645
|
+
* `previousDocVersion` makes partial page deltas safe: clients may apply the
|
|
646
|
+
* patch only when their cached manifest is exactly at that version. Otherwise
|
|
647
|
+
* they must refresh instead of manufacturing a mixed-version manifest.
|
|
648
|
+
*
|
|
649
|
+
* Deliberately does not carry plane scopes: scopes only ever move
|
|
650
|
+
* base → layer, and each mutation kind knows exactly which planes it owns, so
|
|
651
|
+
* the client flips them locally when absorbing this delta (the monotone-flip
|
|
652
|
+
* rule); the manifest is the authoritative source and the 404 → refresh rail
|
|
653
|
+
* the backstop.
|
|
654
|
+
*/
|
|
655
|
+
interface CacheDelta {
|
|
656
|
+
previousDocVersion: number;
|
|
657
|
+
docVersion: number;
|
|
658
|
+
/**
|
|
659
|
+
* New doc-level bulk annotations pin, present when this mutation bumped
|
|
660
|
+
* it (annotation CRUD, page insert/delete, redaction, flatten — see
|
|
661
|
+
* `DocumentManifest.annotationsVersion`). Absorbing it keeps the client's
|
|
662
|
+
* cached manifest addressing the fresh bulk leaf without a 404-refresh
|
|
663
|
+
* round trip.
|
|
664
|
+
*/
|
|
665
|
+
annotationsVersion?: number;
|
|
666
|
+
/** New form pin, present when this mutation bumped it (see `DocumentManifest.formsVersion`). */
|
|
667
|
+
formsVersion?: number;
|
|
668
|
+
/**
|
|
669
|
+
* New plane pins, present when this mutation bumped them: `layoutVersion`
|
|
670
|
+
* for a page-structure write (move, rotate, delete, insert, names),
|
|
671
|
+
* `metadataVersion` for a metadata write, `attachmentsVersion` for an
|
|
672
|
+
* attachment write. Absorbing them re-points the cached manifest's leaf
|
|
673
|
+
* without a refetch.
|
|
674
|
+
*/
|
|
675
|
+
layoutVersion?: number;
|
|
676
|
+
metadataVersion?: number;
|
|
677
|
+
attachmentsVersion?: number;
|
|
678
|
+
/**
|
|
679
|
+
* The layer's write serial after this mutation and whether an artifact
|
|
680
|
+
* now exists (cloud only). Absorbing them keeps the client's cached
|
|
681
|
+
* manifest an honest `DocumentVersionRef` source between refreshes.
|
|
682
|
+
*/
|
|
683
|
+
layerVersion?: number;
|
|
684
|
+
working?: boolean;
|
|
685
|
+
pages: Array<{
|
|
686
|
+
page: PageRef;
|
|
687
|
+
cache: CachePins;
|
|
688
|
+
}>;
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* Base envelope for every layer-mutating operation: the `meta` of every
|
|
692
|
+
* write result.
|
|
693
|
+
*
|
|
694
|
+
* `affectedPages` names the pages whose annotations or content the write
|
|
695
|
+
* changed. `cacheDelta` is the cloud/CDN URL pin delta and is `null` for
|
|
696
|
+
* local engines (and for a write that changed nothing).
|
|
697
|
+
*/
|
|
698
|
+
interface MutationMeta {
|
|
699
|
+
affectedPages: PageRef[];
|
|
700
|
+
cacheDelta: CacheDelta | null;
|
|
701
|
+
/**
|
|
702
|
+
* The write's id: the `opId` it was given, or the one minted for it. Its
|
|
703
|
+
* events carry it as `origin.tx.id`, and `doc.apply({ undoOf: opId })`
|
|
704
|
+
* undoes the write.
|
|
705
|
+
*/
|
|
706
|
+
opId: string;
|
|
707
|
+
/**
|
|
708
|
+
* Whether `{ undoOf: opId }` can undo the write. False for a write that
|
|
709
|
+
* changed nothing, and for the final writes: redaction apply, flatten,
|
|
710
|
+
* signing and form repair. A final write also ends undo for every write
|
|
711
|
+
* before it on the layer.
|
|
712
|
+
*/
|
|
713
|
+
undoable: boolean;
|
|
714
|
+
}
|
|
715
|
+
/** DocMDP / `/Lock /P` permission values (ISO 32000-2 Table 257). */
|
|
716
|
+
type DocMdpPermission = 1 | 2 | 3;
|
|
717
|
+
/**
|
|
718
|
+
* The modification level a signed document allows, as a product policy:
|
|
719
|
+
* - `none`: no byte change at all (not a DocMDP value)
|
|
720
|
+
* - `lta`: DSS and document timestamps only (P = 1)
|
|
721
|
+
* - `fill`: + form fill, signatures, new signature fields (P = 2)
|
|
722
|
+
* - `annotate`: + annotations (P = 3, and how a validator reads an approval
|
|
723
|
+
* signature)
|
|
724
|
+
*/
|
|
725
|
+
type ModificationLevel = 'none' | 'lta' | 'fill' | 'annotate';
|
|
726
|
+
type FieldLockAction = 'all' | 'include' | 'exclude';
|
|
727
|
+
/** A FieldMDP transform or a field `/Lock`: which fields it freezes, and an optional `/P` tightening. */
|
|
728
|
+
interface FieldLockSpec {
|
|
729
|
+
action: FieldLockAction;
|
|
730
|
+
/** Fully qualified names; a name covers its descendants (`group` covers `group.total`). Empty for `all`. */
|
|
731
|
+
fields: string[];
|
|
732
|
+
permission?: DocMdpPermission;
|
|
733
|
+
}
|
|
734
|
+
/** A lock an earlier signature established on the current bytes. */
|
|
735
|
+
interface DocumentFieldLock {
|
|
736
|
+
signatureIndex: number;
|
|
737
|
+
source: 'fieldmdp' | 'lock';
|
|
738
|
+
spec: FieldLockSpec;
|
|
739
|
+
}
|
|
740
|
+
/**
|
|
741
|
+
* What the signatures already in a document mean for what comes after, in
|
|
742
|
+
* two separate answers:
|
|
743
|
+
*
|
|
744
|
+
* - `enforced`: what a signer declared — a certification's /P, a signed
|
|
745
|
+
* field's /Lock /P. The engine refuses what it forbids (mapped onto
|
|
746
|
+
* capabilities like encryption permission bits). A plain approval
|
|
747
|
+
* signature declares nothing: `null`.
|
|
748
|
+
* - `judged`: what a validator holds later changes to — the declared level,
|
|
749
|
+
* or the approval baseline (`annotate`: form fill-in, signing and
|
|
750
|
+
* annotations keep the signature valid, anything else does not;
|
|
751
|
+
* Acrobat's reading, ISO 32000 is silent) when only approval signatures
|
|
752
|
+
* exist. Never refused, only judged.
|
|
753
|
+
*/
|
|
754
|
+
interface DocumentProtection {
|
|
755
|
+
/** Declared and enforced; `null` when nothing declared (unsigned, or approval signatures only). */
|
|
756
|
+
enforced: ModificationLevel | null;
|
|
757
|
+
/** Judged; `null` when nothing is signed. */
|
|
758
|
+
judged: ModificationLevel | null;
|
|
759
|
+
certification: {
|
|
760
|
+
signatureIndex: number;
|
|
761
|
+
permission: DocMdpPermission;
|
|
762
|
+
} | null;
|
|
763
|
+
fieldLocks: DocumentFieldLock[];
|
|
764
|
+
/** The versioned product policy that derived this. */
|
|
765
|
+
policyVersion: number;
|
|
766
|
+
}
|
|
767
|
+
//#endregion
|
|
768
|
+
//#region src/forms/snapshot.d.ts
|
|
769
|
+
/**
|
|
770
|
+
* What kind of interactive form the document declares.
|
|
771
|
+
*
|
|
772
|
+
* - `none` — no /AcroForm dictionary. Recovered fields may still exist
|
|
773
|
+
* (see {@link FormFieldOrigin}); `repair()` can bootstrap the dictionary.
|
|
774
|
+
* - `acroform` — a standard AcroForm.
|
|
775
|
+
* - `xfa` — the /AcroForm carries an /XFA entry. The engine serves the
|
|
776
|
+
* AcroForm shell read-only and never executes XFA.
|
|
777
|
+
*/
|
|
778
|
+
type FormKind = 'none' | 'acroform' | 'xfa';
|
|
779
|
+
//#endregion
|
|
780
|
+
//#region src/search/types.d.ts
|
|
781
|
+
/**
|
|
782
|
+
* What to search for — the one shape, engine → wire → plugin state →
|
|
783
|
+
* search box. One flat object; the flags define behavior per mode instead
|
|
784
|
+
* of the mode changing the shape:
|
|
785
|
+
*
|
|
786
|
+
* | flag | literal | regex |
|
|
787
|
+
* |-------------------|------------------|--------------------------------|
|
|
788
|
+
* | `matchCase` | fold case | `i` flag |
|
|
789
|
+
* | `wholeWord` | boundary check | pattern is `\b(?:…)\b`-wrapped |
|
|
790
|
+
* | `matchDiacritics` | mark fold | rejected (`InvalidArg`) |
|
|
791
|
+
* | `ignoreWhitespace`| whitespace drop | rejected (`InvalidArg`) |
|
|
792
|
+
*
|
|
793
|
+
* Literal queries match over folded text; regex queries run the portable
|
|
794
|
+
* dialect against the raw page text — which is why `matchDiacritics` and
|
|
795
|
+
* `ignoreWhitespace` cannot apply to them (diacritic folding and whitespace
|
|
796
|
+
* dropping are properties of the folded text plane; a pattern spells its
|
|
797
|
+
* own `\s*`). Validate with `validateSearchQuery` for early UI feedback;
|
|
798
|
+
* engines re-validate and reject with `EngineErrorCode.InvalidArg`.
|
|
799
|
+
*/
|
|
800
|
+
interface SearchQuery {
|
|
801
|
+
/**
|
|
802
|
+
* The literal text — or, when `regex`, a pattern in the portable
|
|
803
|
+
* search-regex dialect: JavaScript `u`-mode syntax minus backreferences
|
|
804
|
+
* and lookaround, so every valid pattern also runs on RE2 (the
|
|
805
|
+
* server-side engine).
|
|
806
|
+
*/
|
|
807
|
+
text: string;
|
|
808
|
+
/** Interpret `text` as a regex pattern. Default false (literal). */
|
|
809
|
+
regex?: boolean;
|
|
810
|
+
/** Exact-case matching. Default false (case-folded / `i` semantics). */
|
|
811
|
+
matchCase?: boolean;
|
|
812
|
+
/** Only match at word boundaries (letters/digits end the word). */
|
|
813
|
+
wholeWord?: boolean;
|
|
814
|
+
/**
|
|
815
|
+
* Treat diacritics as significant ("café" ≠ "cafe"). Default false —
|
|
816
|
+
* marks are stripped on both sides, which is what viewers ship.
|
|
817
|
+
* Literal only: combined with `regex` the query is rejected.
|
|
818
|
+
*/
|
|
819
|
+
matchDiacritics?: boolean;
|
|
820
|
+
/**
|
|
821
|
+
* Drop whitespace on both sides instead of collapsing it, so "invoice"
|
|
822
|
+
* finds the letter-spaced "i n v o i c e" that OCR and tracked-out headings
|
|
823
|
+
* produce, and "total amount" finds "totalamount". Default false — the default
|
|
824
|
+
* fold collapses whitespace runs to one space, so a needle still has to
|
|
825
|
+
* carry a space wherever the page does. A hit spans the original text
|
|
826
|
+
* including the dropped whitespace; with `wholeWord` the boundaries are
|
|
827
|
+
* checked on the original text (the folded plane has no word gaps left).
|
|
828
|
+
* Literal only: combined with `regex` the query is rejected.
|
|
829
|
+
*/
|
|
830
|
+
ignoreWhitespace?: boolean;
|
|
831
|
+
}
|
|
832
|
+
//#endregion
|
|
833
|
+
//#region src/mutation/RedactionApplyResult.d.ts
|
|
834
|
+
/** Whether a page was redacted, or had nothing to apply. A page that fails fails the whole call. */
|
|
835
|
+
type RedactionApplyStatus = 'applied' | 'unchanged';
|
|
836
|
+
/**
|
|
837
|
+
* What to apply. `pages` applies every redact annotation on each listed
|
|
838
|
+
* page; `annotations` applies exactly the referenced redact annotations
|
|
839
|
+
* (every `AnnotationRef` carries its page, so no separate page list is
|
|
840
|
+
* needed). Referencing a non-redact annotation fails that page with
|
|
841
|
+
* `InvalidArg` before anything is written.
|
|
842
|
+
*/
|
|
843
|
+
type RedactionApplyScope = {
|
|
844
|
+
pages: PageRef[];
|
|
845
|
+
} | {
|
|
846
|
+
annotations: AnnotationRef[];
|
|
847
|
+
};
|
|
848
|
+
interface RedactionApplyItemResult {
|
|
849
|
+
page: PageRef;
|
|
850
|
+
status: RedactionApplyStatus;
|
|
851
|
+
/**
|
|
852
|
+
* Annotations other than redact ones removed on this page as a side
|
|
853
|
+
* effect (popup cascades and detached form widgets included). The
|
|
854
|
+
* consumed redact annotations themselves are never counted — this is
|
|
855
|
+
* the "collateral" signal for confirm dialogs and audit logs.
|
|
856
|
+
*/
|
|
857
|
+
removedAnnotationCount: number;
|
|
858
|
+
}
|
|
859
|
+
/**
|
|
860
|
+
* Apply is a content + annotation mutation, never a layout mutation:
|
|
861
|
+
* content under each redacted region is destroyed, the configured overlay
|
|
862
|
+
* (`/RO`, else `/IC` + `/OverlayText`) is painted into page content, and
|
|
863
|
+
* the consumed redact annotations (plus intersecting collateral) are
|
|
864
|
+
* removed. All or nothing: a page that fails, or a cancel, leaves every page
|
|
865
|
+
* as it was.
|
|
866
|
+
*/
|
|
867
|
+
interface RedactionApplyResult {
|
|
868
|
+
/** The original request, retained for audit/event replay. */
|
|
869
|
+
scope: RedactionApplyScope;
|
|
870
|
+
results: RedactionApplyItemResult[];
|
|
871
|
+
/** Total {@link RedactionApplyItemResult.removedAnnotationCount} across all pages. */
|
|
872
|
+
removedAnnotationCount: number;
|
|
873
|
+
meta: MutationMeta;
|
|
874
|
+
}
|
|
875
|
+
//#endregion
|
|
876
|
+
export { RedactionApplyResult as a, FormKind as i, FormFieldDTO as n, SearchQuery as o, FormFieldRef as r, DocumentProtection as t };
|
|
877
|
+
//# sourceMappingURL=AnnotationList-CkijRHet-HEFNUIZe.d.ts.map
|