@docx-editor.dev/core 2.7.0 → 2.9.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.
Files changed (118) hide show
  1. package/dist/automation.cjs +1 -1
  2. package/dist/automation.d.cts +5 -6
  3. package/dist/automation.d.ts +5 -6
  4. package/dist/automation.js +1 -1
  5. package/dist/binding.cjs +1 -1
  6. package/dist/binding.d.cts +12 -12
  7. package/dist/binding.d.ts +12 -12
  8. package/dist/binding.js +1 -1
  9. package/dist/chunk-2RDMWJPF.cjs +2 -0
  10. package/dist/chunk-5VC5HGJA.js +2 -0
  11. package/dist/chunk-A2JIBG75.js +1 -0
  12. package/dist/chunk-DKMKH77K.cjs +5 -0
  13. package/dist/chunk-DTQPINIM.js +15 -0
  14. package/dist/chunk-HHFMXG25.js +2 -0
  15. package/dist/chunk-IEXDXWTA.cjs +1 -0
  16. package/dist/chunk-IMMAG4QP.cjs +10 -0
  17. package/dist/chunk-KBCC66CI.js +5 -0
  18. package/dist/chunk-P5YSGSYC.cjs +15 -0
  19. package/dist/chunk-Q66ZJFRE.js +18 -0
  20. package/dist/chunk-TP4EHWEX.cjs +18 -0
  21. package/dist/chunk-VUJGPCPU.js +10 -0
  22. package/dist/chunk-XMHWBL3K.cjs +2 -0
  23. package/dist/contracts/document.d.cts +25 -3
  24. package/dist/contracts/document.d.ts +25 -3
  25. package/dist/contracts/editor.d.cts +10 -10
  26. package/dist/contracts/editor.d.ts +10 -10
  27. package/dist/contracts/interaction.d.cts +9 -9
  28. package/dist/contracts/interaction.d.ts +9 -9
  29. package/dist/contracts/modules.d.cts +6 -5
  30. package/dist/contracts/modules.d.ts +6 -5
  31. package/dist/contracts/types.d.cts +101 -1
  32. package/dist/contracts/types.d.ts +101 -1
  33. package/dist/{custom-node-writes-BpOBjNzo.d.ts → custom-node-writes-7ERv0f_X.d.cts} +25 -11
  34. package/dist/{custom-node-writes-C_AlNvds.d.cts → custom-node-writes-QyVZdTUA.d.ts} +25 -11
  35. package/dist/{editor-CXaGlcUa.d.cts → editor-CojjwMmF.d.cts} +78 -67
  36. package/dist/{editor-C--WWCBA.d.ts → editor-PUlv5Pp7.d.ts} +78 -67
  37. package/dist/editor.cjs +1 -1
  38. package/dist/editor.css +124 -14
  39. package/dist/editor.d.cts +68 -36
  40. package/dist/editor.d.ts +68 -36
  41. package/dist/editor.js +1 -1
  42. package/dist/{hf-references-BdjsQNE_.d.ts → hf-references-Dvk6De4Q.d.cts} +1 -2
  43. package/dist/{hf-references-CgEOSw3i.d.cts → hf-references-z5Y4N1ab.d.ts} +1 -2
  44. package/dist/{image-resources-Bkmu1Jei.d.cts → image-resources-DQOiwOuE.d.cts} +2 -2
  45. package/dist/{image-resources-BWd5u-op.d.ts → image-resources-eZqD_-vC.d.ts} +2 -2
  46. package/dist/{index-QsE1xXyT.d.cts → index-DGPSeLI0.d.cts} +1632 -1435
  47. package/dist/{index-DW0TsrYl.d.ts → index-oN-v8DQ5.d.ts} +1632 -1435
  48. package/dist/index.cjs +1 -1
  49. package/dist/index.d.cts +19 -19
  50. package/dist/index.d.ts +19 -19
  51. package/dist/index.js +1 -1
  52. package/dist/layout.cjs +1 -1
  53. package/dist/layout.d.cts +545 -336
  54. package/dist/layout.d.ts +545 -336
  55. package/dist/layout.js +1 -1
  56. package/dist/{note-nodes-BPSTVDMr.d.ts → note-nodes-BNCANoGN.d.ts} +1 -1
  57. package/dist/{note-nodes-C6DLxlvj.d.cts → note-nodes-DL-Au22P.d.cts} +1 -1
  58. package/dist/note-properties-CQlxjic_.d.cts +67 -0
  59. package/dist/note-properties-jvnw_DGG.d.ts +67 -0
  60. package/dist/omml-equation-BD-LsmWE.d.cts +84 -0
  61. package/dist/omml-equation-Dd3mBep-.d.ts +84 -0
  62. package/dist/{ooxml-tree-BU0e3DVi.d.ts → ooxml-package-CdEy9ufK.d.cts} +352 -1
  63. package/dist/{ooxml-tree-BU0e3DVi.d.cts → ooxml-package-CdEy9ufK.d.ts} +352 -1
  64. package/dist/output.cjs +1 -1
  65. package/dist/output.d.cts +9 -8
  66. package/dist/output.d.ts +9 -8
  67. package/dist/output.js +1 -1
  68. package/dist/{protocol-CD7slqvl.d.cts → protocol-C7ahrdUx.d.ts} +28 -4
  69. package/dist/{protocol-DsbfgBwA.d.ts → protocol-UuZOcOp7.d.cts} +28 -4
  70. package/dist/{review-support-Cr2n7f1-.d.ts → review-items-D5SPFtsO.d.ts} +49 -102
  71. package/dist/{review-support-oQrX6Xu3.d.cts → review-items-DpsqTHio.d.cts} +49 -102
  72. package/dist/review-reads-B2Ji3fVU.d.ts +176 -0
  73. package/dist/review-reads-CP106AHp.d.cts +176 -0
  74. package/dist/{revision-projection-UKqvPa4-.d.ts → revision-projection-CILpvv4M.d.ts} +1 -1
  75. package/dist/{revision-projection-WzlQGBJx.d.cts → revision-projection-Cc4wz30g.d.cts} +1 -1
  76. package/dist/{semantic-cell-selection-C8RC0VnN.d.ts → semantic-cell-selection-BWhVAk5B.d.ts} +16 -4
  77. package/dist/{semantic-cell-selection-CQOgvtbT.d.cts → semantic-cell-selection-DJPjBWzf.d.cts} +16 -4
  78. package/dist/{semantic-interaction-f4GyBQ_1.d.cts → semantic-interaction-BjOcDB06.d.cts} +14 -2
  79. package/dist/{semantic-interaction-C45D_oG2.d.ts → semantic-interaction-Cca1-X_a.d.ts} +14 -2
  80. package/dist/{semantic-paint-DUkGLJ_L.d.ts → semantic-paint-CufpIQFw.d.ts} +7 -7
  81. package/dist/{semantic-paint-BUt0ePEW.d.cts → semantic-paint-Ur7pAINj.d.cts} +7 -7
  82. package/dist/{semantic-records-DoW_xNgJ.d.ts → semantic-records-C3Z76KeN.d.cts} +77 -31
  83. package/dist/{semantic-records-CuT3Wsd-.d.cts → semantic-records-Cc1MJrhM.d.ts} +77 -31
  84. package/dist/{shaped-measurer-CakZ7g1s.d.ts → shaped-measurer-CYSK20E2.d.cts} +2 -4
  85. package/dist/{shaped-measurer-CDcHzjhf.d.cts → shaped-measurer-CwlTPDJO.d.ts} +2 -4
  86. package/dist/store.cjs +1 -1
  87. package/dist/store.d.cts +90 -18
  88. package/dist/store.d.ts +90 -18
  89. package/dist/store.js +1 -1
  90. package/dist/{tree-op-types-fZgbrR5F.d.ts → tree-op-types-B0-sCtw-.d.cts} +79 -10
  91. package/dist/{tree-op-types-QujrzgCz.d.cts → tree-op-types-XMVsJSpe.d.ts} +79 -10
  92. package/dist/{tree-session-5UWKAQ41.d.cts → tree-session-D945D43B.d.cts} +45 -19
  93. package/dist/{tree-session--6LDTNjR.d.ts → tree-session-DBJgmdmc.d.ts} +45 -19
  94. package/dist/{tree-store-Dy9FZ1pa.d.ts → tree-store-C6vc8E_2.d.cts} +14 -3
  95. package/dist/{tree-store-DhYIACNE.d.cts → tree-store-ClA-qng4.d.ts} +14 -3
  96. package/package.json +2 -2
  97. package/dist/chunk-32HTRN7R.js +0 -10
  98. package/dist/chunk-42PRWWVE.js +0 -2
  99. package/dist/chunk-BRBRYJKE.cjs +0 -2
  100. package/dist/chunk-DTR64XCS.cjs +0 -2
  101. package/dist/chunk-EMQSFPJO.cjs +0 -15
  102. package/dist/chunk-GBK7Z6F4.cjs +0 -5
  103. package/dist/chunk-GPJXQDHC.js +0 -2
  104. package/dist/chunk-JLSB6KNZ.js +0 -5
  105. package/dist/chunk-LEV2X47E.cjs +0 -18
  106. package/dist/chunk-NDTLLSG7.js +0 -1
  107. package/dist/chunk-O4VILLOM.cjs +0 -1
  108. package/dist/chunk-OB6JFVYA.js +0 -15
  109. package/dist/chunk-QTUZFJ4O.js +0 -18
  110. package/dist/chunk-UE7KTQLK.js +0 -2
  111. package/dist/chunk-WC3LI6FC.cjs +0 -10
  112. package/dist/chunk-XRDTD4X3.cjs +0 -2
  113. package/dist/content-control-walk-CbTqHq6O.d.cts +0 -56
  114. package/dist/content-control-walk-D06GijR0.d.ts +0 -56
  115. package/dist/ooxml-package-CR5us6ad.d.cts +0 -354
  116. package/dist/ooxml-package-D_CtywTW.d.ts +0 -354
  117. package/dist/review-reads-C5E7u-pt.d.ts +0 -432
  118. package/dist/review-reads-ChgUq41I.d.cts +0 -432
@@ -1,354 +0,0 @@
1
- import { e as OoxmlPart, X as XmlLimits, n as OoxmlReadRejection } from './ooxml-tree-BU0e3DVi.js';
2
-
3
- /**
4
- * Why a part or relationship name was refused.
5
- *
6
- * Path traversal is the reason this exists: a name with `..` or a leading `/` is refused rather
7
- * than normalized, because normalizing is how a crafted package reaches outside itself.
8
- */
9
- type NameRejection = 'empty' | 'control-char' | 'backslash' | 'drive-or-unc' | 'encoded-separator' | 'encoded-dot' | 'bad-encoding' | 'empty-segment' | 'dot-segment' | 'unsafe-key' | 'segment-trailing-dot' | 'traversal-escape' | 'not-absolute-uri' | 'unsafe-scheme';
10
- /** A validated OPC name, or the typed reason it was refused. */
11
- type NameResult = {
12
- readonly ok: true;
13
- readonly partName: string;
14
- } | {
15
- readonly ok: false;
16
- readonly reason: NameRejection;
17
- };
18
- /**
19
- * Normalize a ZIP entry name or OPC part name into a canonical part name
20
- * (`/word/document.xml`). Accepts leading-slash and no-leading-slash inputs;
21
- * rejects traversal, dot segments, and the attack surface. Duplicate detection
22
- * folds ASCII case (OPC part-name equivalence).
23
- */
24
- declare function normalizePartName(raw: string): NameResult;
25
- /**
26
- * ASCII-only lowercase fold. OPC part-name/extension equivalence is US-ASCII
27
- * case-insensitive; a locale `toLowerCase()` mis-folds e.g. Turkish `I`/`İ` and
28
- * could let two "equivalent" part names evade duplicate detection.
29
- */
30
- declare function asciiFold(s: string): string;
31
- /** Case-folded key for OPC part-name equivalence / duplicate detection. */
32
- declare function partNameKey(partName: string): string;
33
- /**
34
- * Detect archive entries that collide after normalization (before inflation).
35
- * Returns the case-folded keys that more than one raw name maps to.
36
- */
37
- declare function detectDuplicateNames(rawNames: readonly string[]): {
38
- readonly duplicates: readonly string[];
39
- readonly rejected: readonly {
40
- raw: string;
41
- reason: NameRejection;
42
- }[];
43
- };
44
- /**
45
- * Resolve an internal relationship target against its owner part, without
46
- * escaping the package root. `ownerPartName` is a canonical part name; the base
47
- * is its containing folder. A leading "/" target is package-absolute. `.`/`..`
48
- * segments resolve on a stack; popping above root is `traversal-escape`.
49
- */
50
- declare function resolveInternalTarget(ownerPartName: string, rawTarget: string): NameResult;
51
- /**
52
- * Validate an external-mode relationship target. It MUST be an absolute URI, is
53
- * retained verbatim by the caller, and is NEVER owner-resolved or fetched here.
54
- * Unsafe schemes (javascript/vbscript/data/file) are rejected for runtime sinks;
55
- * the raw lexical form is still preserved separately by the authored record.
56
- */
57
- declare function validateExternalTarget(raw: string): NameResult;
58
-
59
- /** One `<Default>`: a file extension mapped to a content type. */
60
- interface DefaultRecord {
61
- readonly extension: string;
62
- readonly contentType: string;
63
- readonly order: number;
64
- }
65
- /** One `<Override>`: a specific part name mapped to a content type. Beats any Default. */
66
- interface OverrideRecord {
67
- readonly partName: string;
68
- readonly contentType: string;
69
- readonly order: number;
70
- }
71
- /**
72
- * The authored `[Content_Types].xml` records, in significant order.
73
- *
74
- * Retained rather than collapsed into a lookup, because the file's lexical form and ordering are
75
- * part of what a lossless save re-emits.
76
- */
77
- interface ContentTypeRecords {
78
- readonly defaults: readonly DefaultRecord[];
79
- readonly overrides: readonly OverrideRecord[];
80
- }
81
- /**
82
- * Why content-type records could not be indexed.
83
- *
84
- * All fail CLOSED: conflicting Defaults on one extension, duplicate normalized Override names, or
85
- * invalid MIME syntax are refused rather than resolved by picking one.
86
- */
87
- type ContentTypeError = {
88
- readonly code: 'invalid-mime';
89
- readonly value: string;
90
- } | {
91
- readonly code: 'conflicting-default';
92
- readonly extension: string;
93
- } | {
94
- readonly code: 'duplicate-override';
95
- readonly partName: string;
96
- } | {
97
- readonly code: 'invalid-override-name';
98
- readonly partName: string;
99
- } | {
100
- readonly code: 'too-many-records';
101
- readonly limit: number;
102
- };
103
- /** Whether a string is syntactically a MIME type. Syntax only — no registry lookup. */
104
- declare function isValidMime(value: string): boolean;
105
- /** ASCII-case-insensitive extension key (leading dot removed; ASCII-only fold). */
106
- declare function extensionKey(extension: string): string;
107
- /** The resolved lookup: Override by case-folded part name, Default by case-insensitive extension. */
108
- interface ContentTypeIndex {
109
- /** ext key -> single MIME (identical duplicates collapsed). */
110
- readonly defaults: ReadonlyMap<string, string>;
111
- /** case-folded part name -> MIME. */
112
- readonly overrides: ReadonlyMap<string, string>;
113
- }
114
- /** The built index, or the conflict that made it impossible. */
115
- type IndexResult = {
116
- readonly ok: true;
117
- readonly index: ContentTypeIndex;
118
- } | {
119
- readonly ok: false;
120
- readonly error: ContentTypeError;
121
- };
122
- /**
123
- * Build a resolved content-type index, failing closed on conflict/duplicate/MIME
124
- * errors. `maxRecords` bounds the combined record count (N/N+1 gate).
125
- */
126
- declare function buildContentTypeIndex(records: ContentTypeRecords, maxRecords?: number): IndexResult;
127
- /**
128
- * A part's content type, or why it has none.
129
- *
130
- * An orphan record never determines a part's type — a Default with no matching part is preserved
131
- * inertly rather than applied.
132
- */
133
- type ResolveResult = {
134
- readonly ok: true;
135
- readonly contentType: string;
136
- readonly source: 'override' | 'default';
137
- } | {
138
- readonly ok: false;
139
- readonly reason: 'unknown';
140
- };
141
- /** Resolve a part's content type: Override wins over Default; else unknown. */
142
- declare function resolveContentType(index: ContentTypeIndex, partName: string): ResolveResult;
143
-
144
- /** OOXML image relationship type for embedded or linked media parts. */
145
- declare const IMAGE_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image";
146
- /**
147
- * Whether a relationship points inside the package or out of it.
148
- *
149
- * The security-relevant distinction: an `External` target is retained VERBATIM and never
150
- * owner-resolved or fetched, because auto-loading a file-supplied remote target is a zero-click
151
- * external fetch.
152
- */
153
- type TargetMode = 'Internal' | 'External';
154
- /**
155
- * One authored relationship, with nothing materialized away: owner part, id, type, raw target
156
- * lexical form, mode, and position.
157
- */
158
- interface RelationshipRecord {
159
- readonly ownerPart: string;
160
- readonly id: string;
161
- readonly type: string;
162
- readonly rawTarget: string;
163
- readonly targetMode: TargetMode;
164
- readonly order: number;
165
- }
166
- /** Why a relationship set is invalid. Duplicate ids within one owner fail closed. */
167
- type RelationshipError = {
168
- readonly code: 'duplicate-id';
169
- readonly ownerPart: string;
170
- readonly id: string;
171
- };
172
- /** The validated relationship set, or the conflict that rejected it. */
173
- type RelationshipSetResult = {
174
- readonly ok: true;
175
- readonly byOwner: ReadonlyMap<string, readonly RelationshipRecord[]>;
176
- } | {
177
- readonly ok: false;
178
- readonly error: RelationshipError;
179
- };
180
- /** Group relationships by owner in authored order; reject duplicate ids per owner. */
181
- declare function buildRelationshipSet(records: readonly RelationshipRecord[]): RelationshipSetResult;
182
- /**
183
- * A relationship resolved to a part, or the reason it could not be.
184
- *
185
- * External targets resolve to a refusal by design: they are never followed from a file.
186
- */
187
- type ResolvedRelationship = {
188
- readonly mode: 'Internal';
189
- readonly target: NameResult;
190
- readonly raw: string;
191
- } | {
192
- readonly mode: 'External';
193
- readonly sinkSafe: NameResult;
194
- readonly raw: string;
195
- };
196
- /**
197
- * Resolve a relationship to a runtime projection while the raw target stays
198
- * authored. Internal -> owner-relative part name; External -> sink-safe
199
- * validation only (never owner-resolved, never fetched). `raw` is always the
200
- * verbatim authored target.
201
- */
202
- declare function resolveRelationship(rec: RelationshipRecord): ResolvedRelationship;
203
- /**
204
- * An image relationship resolved to package bytes, or why it was refused.
205
- *
206
- * External-mode image rels are refused rather than fetched — the no-zero-click-external-fetch
207
- * rule applies to images exactly as it does to links.
208
- */
209
- type ImageRelationshipResolution = {
210
- readonly mode: 'internal';
211
- readonly partName: string;
212
- readonly raw: string;
213
- } | {
214
- readonly mode: 'external';
215
- readonly sinkSafe: boolean;
216
- readonly raw: string;
217
- } | {
218
- readonly mode: 'missing';
219
- };
220
- /**
221
- * Resolve an image relationship id from an owner part. Internal targets resolve
222
- * owner-relative; external targets are never fetched; a missing id is `missing`.
223
- */
224
- declare function resolveImageRelationship(records: readonly RelationshipRecord[] | undefined, ownerPart: string, relationshipId: string): ImageRelationshipResolution;
225
-
226
- /**
227
- * Why a zip was refused at the trust boundary.
228
- *
229
- * `too-large` and `too-many-entries` are the zip-bomb guards; `bad-name` catches path traversal —
230
- * an entry with `..` or a leading `/` is rejected rather than normalized.
231
- */
232
- type ZipRejection = 'too-many-entries' | 'too-large' | 'bad-name' | 'inflate-error';
233
- /** Archive caps: entry count, total decompressed bytes, and the decompression ratio. */
234
- interface ZipLimits {
235
- readonly maxEntries: number;
236
- /** Max total UNCOMPRESSED bytes across the archive. */
237
- readonly maxTotalBytes: number;
238
- /** Max per-entry uncompressed:compressed ratio (zip-bomb guard). */
239
- readonly maxRatio?: number;
240
- }
241
- /** The archive caps in force when a host configures none. Conservative and finite. */
242
- declare const DEFAULT_ZIP_LIMITS: ZipLimits;
243
- /** The read entries, or the typed refusal. Never throws — the bytes are untrusted. */
244
- type ZipReadResult = {
245
- readonly ok: true;
246
- readonly entries: ReadonlyMap<string, Uint8Array>;
247
- } | {
248
- readonly ok: false;
249
- readonly reason: ZipRejection;
250
- readonly detail?: string;
251
- };
252
- /**
253
- * Inflate a ZIP archive with bounds + OPC name normalization. Entry name, count,
254
- * compression-ratio, and total-uncompressed-size limits are enforced BEFORE each
255
- * entry is decompressed (via fflate's pre-inflation filter), so a zip bomb or a
256
- * traversal name is rejected without ever being inflated. Keys are canonical part
257
- * names.
258
- */
259
- declare function readZip(bytes: Uint8Array, limits?: ZipLimits): ZipReadResult;
260
- /** Deflate a set of canonical-part-name -> bytes into a ZIP archive. Every part name
261
- * is re-validated through the OPC normalization profile before writing, so a
262
- * traversal/encoded/normalized-alias name from an untrusted serialized model can
263
- * never be smuggled into a ZIP entry (write-side path-traversal guard). */
264
- declare function writeZip(entries: ReadonlyMap<string, Uint8Array>): Uint8Array;
265
-
266
- /** Caps applied while loading a package: zip, XML, part count and relationship count. */
267
- interface OoxmlPackageLimits {
268
- readonly zip?: ZipLimits;
269
- readonly xml?: XmlLimits;
270
- /** Cap on parts converted into canonical trees (N/N+1 gate, not a soft target). */
271
- readonly maxXmlParts?: number;
272
- /** Cap on relationship records across every rels part. */
273
- readonly maxRelationships?: number;
274
- }
275
- /** The limits in force when a host configures none. Conservative and finite. */
276
- declare const DEFAULT_OOXML_PACKAGE_LIMITS: Required<Pick<OoxmlPackageLimits, 'maxXmlParts' | 'maxRelationships'>>;
277
- /**
278
- * An external relationship target. Retained verbatim as authored evidence, with the
279
- * sink-safety verdict alongside it. Never resolved against the package, never fetched.
280
- */
281
- interface OoxmlExternalTarget {
282
- readonly ownerPart: string;
283
- readonly id: string;
284
- readonly type: string;
285
- readonly rawTarget: string;
286
- /** False when the target is not a safe sink (javascript:, file:, ...). Still not fetched. */
287
- readonly sinkSafe: boolean;
288
- }
289
- /**
290
- * A loaded package: every XML part as a canonical tree, plus the non-XML parts kept verbatim.
291
- *
292
- * The preservation model in one value. Modelled parts re-emit normalized; everything else is
293
- * byte-identical, which is why an unrecognized part never costs a document anything.
294
- */
295
- interface OoxmlPackage {
296
- /** Canonical trees, keyed by canonical part name. Non-XML parts are absent by design. */
297
- readonly parts: ReadonlyMap<string, OoxmlPart>;
298
- /** Raw bytes of every entry, including the non-XML parts that have no tree. */
299
- readonly partBytes: ReadonlyMap<string, Uint8Array>;
300
- /** Internal relationships by owner part, in authored order. */
301
- readonly relationships: ReadonlyMap<string, readonly RelationshipRecord[]>;
302
- readonly externalTargets: readonly OoxmlExternalTarget[];
303
- readonly contentTypes: ContentTypeIndex;
304
- /** Canonical name of the part the root `officeDocument` relationship points at. */
305
- readonly mainDocumentPart: string;
306
- }
307
- /** Why a package could not be loaded. Every code describes the FILE, not the caller. */
308
- type OoxmlPackageRejection = ZipRejection | OoxmlReadRejection | 'no-content-types' | 'bad-content-types' | 'no-main-document' | 'bad-relationship-target' | 'duplicate-relationship-id' | 'too-many-relationships' | 'too-many-xml-parts';
309
- /** A loaded package, or a typed refusal. Never throws. */
310
- type OoxmlPackageResult = {
311
- readonly ok: true;
312
- readonly package: OoxmlPackage;
313
- } | {
314
- readonly ok: false;
315
- readonly reason: OoxmlPackageRejection;
316
- readonly detail?: string;
317
- };
318
- /**
319
- * Load an OPC package into canonical typed/generic OOXML trees.
320
- *
321
- * Fails closed on every limit, malformed name, unresolvable internal target, duplicate
322
- * relationship id, and XML rejection. An external relationship never causes a failure and
323
- * never causes a fetch: it is recorded with its sink-safety verdict for a later, explicitly
324
- * user-gated lane.
325
- */
326
- /**
327
- * Load DOCX bytes into canonical trees, bounded at every step.
328
- *
329
- * THE trust boundary for a document. Composes the hardened primitives — zip limits and OPC name
330
- * normalization, content-type indexing, relationship validation, entity-free XML — into one
331
- * loader, and returns a typed rejection rather than throwing from inside a decoder.
332
- */
333
- declare function readOoxmlPackage(bytes: Uint8Array, limits?: OoxmlPackageLimits): OoxmlPackageResult;
334
- /**
335
- * Serialize a canonical package back to DOCX bytes.
336
- *
337
- * Starts from the ORIGINAL entry bytes and overwrites only the parts held as trees. A part
338
- * the loader did not model — media, fonts, an XML part outside the modeled set — passes
339
- * through untouched, so round-tripping a document cannot lose a part the engine never
340
- * claimed to understand.
341
- *
342
- * The modeled parts are re-emitted NORMALIZED from the tree rather than patched as text.
343
- * That is the whole point of the canonical tree: correctness is judged by the two D9
344
- * oracles (the namespace-aware fingerprint and the save/reopen semantic digest), not by
345
- * byte equality, so a different-but-equivalent spelling is not a defect.
346
- *
347
- * `writeZip` re-validates every part name, so a name that became unsafe between load and
348
- * save cannot be smuggled into the archive.
349
- */
350
- declare function writeOoxmlPackage(pkg: OoxmlPackage): Uint8Array;
351
- /** Replace one part's tree, returning a new package. Pure, like the tree edits themselves. */
352
- declare function withPart(pkg: OoxmlPackage, part: OoxmlPart): OoxmlPackage;
353
-
354
- export { readOoxmlPackage as A, readZip as B, type ContentTypeError as C, DEFAULT_OOXML_PACKAGE_LIMITS as D, resolveContentType as E, resolveImageRelationship as F, resolveInternalTarget as G, resolveRelationship as H, IMAGE_RELATIONSHIP_TYPE as I, validateExternalTarget as J, withPart as K, writeOoxmlPackage as L, writeZip as M, type NameRejection as N, type OoxmlPackage as O, type RelationshipRecord as R, type TargetMode as T, type ZipLimits as Z, type OoxmlPackageLimits as a, type OoxmlPackageRejection as b, type ContentTypeIndex as c, type ContentTypeRecords as d, DEFAULT_ZIP_LIMITS as e, type DefaultRecord as f, type ImageRelationshipResolution as g, type IndexResult as h, type NameResult as i, type OoxmlExternalTarget as j, type OoxmlPackageResult as k, type OverrideRecord as l, type RelationshipError as m, type RelationshipSetResult as n, type ResolveResult as o, type ResolvedRelationship as p, type ZipReadResult as q, type ZipRejection as r, asciiFold as s, buildContentTypeIndex as t, buildRelationshipSet as u, detectDuplicateNames as v, extensionKey as w, isValidMime as x, normalizePartName as y, partNameKey as z };