@docx-editor.dev/core 2.27.0 → 2.29.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/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +76 -16
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +31 -12
- package/dist/binding.js +1 -1
- package/dist/{index-CkQVRJtJ.d.ts → chrome-print-CAs51cpq.d.ts} +248 -115
- package/dist/chunk-236O4YQW.js +2 -0
- package/dist/chunk-4HENIAFG.js +1 -0
- package/dist/chunk-6JPL6ZAS.cjs +5 -0
- package/dist/chunk-6ZQP4HQ7.js +3 -0
- package/dist/{chunk-2GK7YQB2.cjs → chunk-7WQ7AAHW.cjs} +1 -1
- package/dist/chunk-BCXH4BXB.js +5 -0
- package/dist/chunk-BY2ACZZ6.cjs +1 -0
- package/dist/chunk-CAJEXXVG.cjs +4 -0
- package/dist/chunk-CPWLFPWC.js +30 -0
- package/dist/chunk-D7ZMDMPX.cjs +3 -0
- package/dist/chunk-DOHF6FA7.cjs +30 -0
- package/dist/chunk-DVX32P2P.js +27 -0
- package/dist/chunk-E4LOMDNL.js +1 -0
- package/dist/chunk-EKLM7NWB.cjs +7 -0
- package/dist/chunk-G3K63G7P.cjs +27 -0
- package/dist/chunk-G4HOFIKJ.js +1 -0
- package/dist/chunk-JLVBDYVQ.cjs +2 -0
- package/dist/chunk-LQX36Z5P.js +7 -0
- package/dist/chunk-LSZ6KPKK.js +1 -0
- package/dist/chunk-MM5QBMTE.cjs +1 -0
- package/dist/chunk-OMCG63ZF.js +1 -0
- package/dist/chunk-OSFOJTHU.cjs +18 -0
- package/dist/chunk-RCLZXP3B.js +2 -0
- package/dist/chunk-T6K2QYNZ.cjs +2 -0
- package/dist/chunk-TRGAVV2Y.js +4 -0
- package/dist/chunk-U4JZVSOE.js +2 -0
- package/dist/chunk-UHHYFIDT.cjs +1 -0
- package/dist/chunk-V3N4SOAK.cjs +1 -0
- package/dist/chunk-W35WTWAO.cjs +1 -0
- package/dist/chunk-YQ5G6LC7.js +18 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +42 -6
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.cjs +1 -1
- package/dist/collaboration.d.ts +99 -7
- package/dist/collaboration.js +1 -1
- package/dist/contracts/document.d.ts +18 -3
- package/dist/contracts/editor.d.ts +19 -10
- package/dist/contracts/interaction.d.ts +31 -2
- package/dist/contracts/modules.cjs +1 -1
- package/dist/contracts/modules.d.ts +56 -8
- package/dist/contracts/modules.js +1 -1
- package/dist/contracts/types.d.ts +11 -2
- package/dist/{custom-node-writes-Vzpq9I8_.d.ts → custom-node-writes-Bn6uciLb.d.ts} +2 -2
- package/dist/diagnostic-context-B8M79cfK.d.ts +30 -0
- package/dist/diagnostic-hints-BeVjfNOv.d.ts +113 -0
- package/dist/{document-protection-9zpIHWTE.d.ts → document-protection-CUb55pl_.d.ts} +2 -2
- package/dist/{editor-B3OBYNrF.d.ts → editor-CZQZmTIU.d.ts} +770 -141
- package/dist/{editor-scope-OHPwVQ5l.d.ts → editor-scope-7o9xweiJ.d.ts} +1 -1
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +5 -5
- package/dist/editor.d.ts +439 -33
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +23 -14
- package/dist/export.js +2 -2
- package/dist/failure-NS2lsya4.d.ts +115 -0
- package/dist/{font-resolver-DN0xNOf_.d.ts → font-resolver-lSBLirLR.d.ts} +3 -3
- package/dist/{headless-document-view-ICYqNkQ1.d.ts → headless-document-view-pp3q7wIh.d.ts} +2 -2
- package/dist/{image-resources-BDFxcu7W.d.ts → image-resources-tXLQShoC.d.ts} +10 -10
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +92 -20
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-BvZD_VKP.d.ts → layout-shaping-BD-dF_rn.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +168 -79
- package/dist/layout.js +1 -1
- package/dist/{note-properties-CkAk7g-n.d.ts → note-properties-qQUjO1GQ.d.ts} +3 -3
- package/dist/{omml-equation-DuczgG5o.d.ts → omml-equation-BUbU0utM.d.ts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +18 -9
- package/dist/output.js +1 -1
- package/dist/{protocol-aKYr8r3u.d.ts → protocol-DYzzz2ej.d.ts} +44 -4
- package/dist/{review-paragraph-order-Ddj5d6rp.d.ts → review-paragraph-order-CN_0l2Cb.d.ts} +5 -2
- package/dist/{semantic-cell-selection-DoqYCz_F.d.ts → semantic-cell-selection-eYag3P47.d.ts} +8 -213
- package/dist/{semantic-interaction-G0bjmmmk.d.ts → semantic-interaction-kR_QB845.d.ts} +25 -34
- package/dist/{semantic-paint-CsMzF8-O.d.ts → semantic-paint-ZayFF3tD.d.ts} +17 -5
- package/dist/{semantic-record-queries-1du6lQqS.d.ts → semantic-record-queries-Bsgth6lv.d.ts} +1 -1
- package/dist/{semantic-records-B9OolWGN.d.ts → semantic-records-DQmumPgL.d.ts} +1367 -884
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +1611 -1586
- package/dist/store.js +1 -1
- package/dist/{tree-package-fragment-DYZIk1rY.d.ts → tree-package-store-CovjNARF.d.ts} +157 -137
- package/dist/{tree-session-contract-DQVJOOkv.d.ts → tree-session-contract-CZVAGl51.d.ts} +8 -6
- package/dist/{types-barrel-BFKR8Pzp.d.ts → types-barrel-DuC5QBNC.d.ts} +352 -231
- package/package.json +3 -3
- package/dist/chunk-4KZ6L5YF.cjs +0 -15
- package/dist/chunk-55AT3MOU.cjs +0 -25
- package/dist/chunk-6ZQMII6V.js +0 -1
- package/dist/chunk-7IGCWG4H.js +0 -2
- package/dist/chunk-7MYITTAH.js +0 -5
- package/dist/chunk-AVKVRU7Z.cjs +0 -5
- package/dist/chunk-CWRBFNK5.cjs +0 -5
- package/dist/chunk-DGPA3TST.cjs +0 -27
- package/dist/chunk-DNXVNQEO.js +0 -1
- package/dist/chunk-FQN4KSFL.cjs +0 -7
- package/dist/chunk-GVUOWHTO.cjs +0 -1
- package/dist/chunk-GWQJ5774.js +0 -5
- package/dist/chunk-HAQ72KD7.js +0 -1
- package/dist/chunk-HO5XFO32.cjs +0 -3
- package/dist/chunk-IGR23DV2.js +0 -1
- package/dist/chunk-JSIX2EOH.js +0 -3
- package/dist/chunk-K246T47S.cjs +0 -1
- package/dist/chunk-KAXOGCGA.js +0 -1
- package/dist/chunk-LZLTN5A3.cjs +0 -1
- package/dist/chunk-NBCVVZOM.cjs +0 -1
- package/dist/chunk-O5INAWZQ.js +0 -1
- package/dist/chunk-OHAXVTWG.cjs +0 -1
- package/dist/chunk-S74GRBNE.js +0 -7
- package/dist/chunk-UBLUVNZR.js +0 -27
- package/dist/chunk-UMRSBLO7.js +0 -15
- package/dist/chunk-VIPMGGUT.js +0 -25
- package/dist/chunk-WG4KMSX2.cjs +0 -2
- package/dist/chunk-WRLKVNNR.cjs +0 -1
- package/dist/chunk-ZU7IVN6G.js +0 -2
- package/dist/failure-BIPVQbRm.d.ts +0 -65
- package/dist/revision-projection-CSNFudZY.d.ts +0 -242
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as HistoryGroupOutcome } from './editor-scope-
|
|
1
|
+
import { c as HistoryGroupOutcome } from './editor-scope-7o9xweiJ.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* How a tracked change is addressed: `@w:id`, `@w:author` and `@w:date` together, within a
|
|
@@ -1128,91 +1128,6 @@ declare function resolveInternalTarget(ownerPartName: string, rawTarget: string)
|
|
|
1128
1128
|
*/
|
|
1129
1129
|
declare function validateExternalTarget(raw: string): NameResult;
|
|
1130
1130
|
|
|
1131
|
-
/** One `<Default>`: a file extension mapped to a content type. */
|
|
1132
|
-
interface DefaultRecord {
|
|
1133
|
-
readonly extension: string;
|
|
1134
|
-
readonly contentType: string;
|
|
1135
|
-
readonly order: number;
|
|
1136
|
-
}
|
|
1137
|
-
/** One `<Override>`: a specific part name mapped to a content type. Beats any Default. */
|
|
1138
|
-
interface OverrideRecord {
|
|
1139
|
-
readonly partName: string;
|
|
1140
|
-
readonly contentType: string;
|
|
1141
|
-
readonly order: number;
|
|
1142
|
-
}
|
|
1143
|
-
/**
|
|
1144
|
-
* The authored `[Content_Types].xml` records, in significant order.
|
|
1145
|
-
*
|
|
1146
|
-
* Retained rather than collapsed into a lookup, because the file's lexical form and ordering are
|
|
1147
|
-
* part of what a lossless save re-emits.
|
|
1148
|
-
*/
|
|
1149
|
-
interface ContentTypeRecords {
|
|
1150
|
-
readonly defaults: readonly DefaultRecord[];
|
|
1151
|
-
readonly overrides: readonly OverrideRecord[];
|
|
1152
|
-
}
|
|
1153
|
-
/**
|
|
1154
|
-
* Why content-type records could not be indexed.
|
|
1155
|
-
*
|
|
1156
|
-
* All fail CLOSED: conflicting Defaults on one extension, duplicate normalized Override names, or
|
|
1157
|
-
* invalid MIME syntax are refused rather than resolved by picking one.
|
|
1158
|
-
*/
|
|
1159
|
-
type ContentTypeError = {
|
|
1160
|
-
readonly code: 'invalid-mime';
|
|
1161
|
-
readonly value: string;
|
|
1162
|
-
} | {
|
|
1163
|
-
readonly code: 'conflicting-default';
|
|
1164
|
-
readonly extension: string;
|
|
1165
|
-
} | {
|
|
1166
|
-
readonly code: 'duplicate-override';
|
|
1167
|
-
readonly partName: string;
|
|
1168
|
-
} | {
|
|
1169
|
-
readonly code: 'invalid-override-name';
|
|
1170
|
-
readonly partName: string;
|
|
1171
|
-
} | {
|
|
1172
|
-
readonly code: 'too-many-records';
|
|
1173
|
-
readonly limit: number;
|
|
1174
|
-
};
|
|
1175
|
-
/** Whether a string is syntactically a MIME type. Syntax only — no registry lookup. */
|
|
1176
|
-
declare function isValidMime(value: string): boolean;
|
|
1177
|
-
/** ASCII-case-insensitive extension key (leading dot removed; ASCII-only fold). */
|
|
1178
|
-
declare function extensionKey(extension: string): string;
|
|
1179
|
-
/** The resolved lookup: Override by case-folded part name, Default by case-insensitive extension. */
|
|
1180
|
-
interface ContentTypeIndex {
|
|
1181
|
-
/** ext key -> single MIME (identical duplicates collapsed). */
|
|
1182
|
-
readonly defaults: ReadonlyMap<string, string>;
|
|
1183
|
-
/** case-folded part name -> MIME. */
|
|
1184
|
-
readonly overrides: ReadonlyMap<string, string>;
|
|
1185
|
-
}
|
|
1186
|
-
/** The built index, or the conflict that made it impossible. */
|
|
1187
|
-
type IndexResult = {
|
|
1188
|
-
readonly ok: true;
|
|
1189
|
-
readonly index: ContentTypeIndex;
|
|
1190
|
-
} | {
|
|
1191
|
-
readonly ok: false;
|
|
1192
|
-
readonly error: ContentTypeError;
|
|
1193
|
-
};
|
|
1194
|
-
/**
|
|
1195
|
-
* Build a resolved content-type index, failing closed on conflict/duplicate/MIME
|
|
1196
|
-
* errors. `maxRecords` bounds the combined record count (N/N+1 gate).
|
|
1197
|
-
*/
|
|
1198
|
-
declare function buildContentTypeIndex(records: ContentTypeRecords, maxRecords?: number): IndexResult;
|
|
1199
|
-
/**
|
|
1200
|
-
* A part's content type, or why it has none.
|
|
1201
|
-
*
|
|
1202
|
-
* An orphan record never determines a part's type — a Default with no matching part is preserved
|
|
1203
|
-
* inertly rather than applied.
|
|
1204
|
-
*/
|
|
1205
|
-
type ResolveResult = {
|
|
1206
|
-
readonly ok: true;
|
|
1207
|
-
readonly contentType: string;
|
|
1208
|
-
readonly source: 'override' | 'default';
|
|
1209
|
-
} | {
|
|
1210
|
-
readonly ok: false;
|
|
1211
|
-
readonly reason: 'unknown';
|
|
1212
|
-
};
|
|
1213
|
-
/** Resolve a part's content type: Override wins over Default; else unknown. */
|
|
1214
|
-
declare function resolveContentType(index: ContentTypeIndex, partName: string): ResolveResult;
|
|
1215
|
-
|
|
1216
1131
|
/** OOXML image relationship type for embedded or linked media parts. */
|
|
1217
1132
|
declare const IMAGE_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image";
|
|
1218
1133
|
/**
|
|
@@ -1295,56 +1210,6 @@ type ImageRelationshipResolution = {
|
|
|
1295
1210
|
*/
|
|
1296
1211
|
declare function resolveImageRelationship(records: readonly RelationshipRecord[] | undefined, ownerPart: string, relationshipId: string): ImageRelationshipResolution;
|
|
1297
1212
|
|
|
1298
|
-
/**
|
|
1299
|
-
* Why a zip was refused at the trust boundary.
|
|
1300
|
-
*
|
|
1301
|
-
* `too-large` and `too-many-entries` are the zip-bomb guards; `bad-name` catches path traversal —
|
|
1302
|
-
* an entry with `..` or a leading `/` is rejected rather than normalized.
|
|
1303
|
-
*/
|
|
1304
|
-
type ZipRejection = 'too-many-entries' | 'too-large' | 'bad-name' | 'inflate-error';
|
|
1305
|
-
/** Archive caps: entry count, total decompressed bytes, and the decompression ratio. */
|
|
1306
|
-
interface ZipLimits {
|
|
1307
|
-
readonly maxEntries: number;
|
|
1308
|
-
/** Max total UNCOMPRESSED bytes across the archive. */
|
|
1309
|
-
readonly maxTotalBytes: number;
|
|
1310
|
-
/**
|
|
1311
|
-
* Max ratio of the archive's total declared uncompressed bytes to the archive's own byte
|
|
1312
|
-
* length (zip-bomb guard). Applies once that total exceeds 8 MiB, so a small archive is
|
|
1313
|
-
* never refused for compressing well.
|
|
1314
|
-
*/
|
|
1315
|
-
readonly maxRatio?: number;
|
|
1316
|
-
}
|
|
1317
|
-
/** The archive caps in force when a host configures none. Conservative and finite. */
|
|
1318
|
-
declare const DEFAULT_ZIP_LIMITS: ZipLimits;
|
|
1319
|
-
/** The read entries, or the typed refusal. Never throws — the bytes are untrusted. */
|
|
1320
|
-
type ZipReadResult = {
|
|
1321
|
-
readonly ok: true;
|
|
1322
|
-
readonly entries: ReadonlyMap<string, Uint8Array>;
|
|
1323
|
-
} | {
|
|
1324
|
-
readonly ok: false;
|
|
1325
|
-
readonly reason: ZipRejection;
|
|
1326
|
-
readonly detail?: string;
|
|
1327
|
-
readonly limit?: 'zip.maxTotalBytes' | 'zip.maxRatio';
|
|
1328
|
-
};
|
|
1329
|
-
/**
|
|
1330
|
-
* Inflate a ZIP archive with bounds + OPC name normalization. Entry name, count, archive
|
|
1331
|
-
* ratio, and total-uncompressed-size limits are enforced BEFORE each entry is decompressed
|
|
1332
|
-
* (via fflate's pre-inflation filter), so a zip bomb or a traversal name is rejected without
|
|
1333
|
-
* ever being inflated. Keys are canonical part names.
|
|
1334
|
-
*
|
|
1335
|
-
* The budgets count each entry's DECLARED sizes, and the declared size is also a hard cap on
|
|
1336
|
-
* what the entry may produce: fflate inflates into a buffer of exactly `originalSize` bytes
|
|
1337
|
-
* and never grows it, so an entry whose stream holds more than it declares is truncated (or
|
|
1338
|
-
* refused as `inflate-error`), never expanded past its budget. A stored entry is copied at
|
|
1339
|
-
* its compressed size, so the larger of its two declared sizes is what counts.
|
|
1340
|
-
*/
|
|
1341
|
-
declare function readZip(bytes: Uint8Array, limits?: ZipLimits): ZipReadResult;
|
|
1342
|
-
/** Deflate a set of canonical-part-name -> bytes into a ZIP archive. Every part name
|
|
1343
|
-
* is re-validated through the OPC normalization profile before writing, so a
|
|
1344
|
-
* traversal/encoded/normalized-alias name from an untrusted serialized model can
|
|
1345
|
-
* never be smuggled into a ZIP entry (write-side path-traversal guard). */
|
|
1346
|
-
declare function writeZip(entries: ReadonlyMap<string, Uint8Array>): Uint8Array;
|
|
1347
|
-
|
|
1348
1213
|
type ShapeSchemeColorResolver = (scheme: string) => string | null;
|
|
1349
1214
|
type ShapeStyleMatrixResolver = (kind: 'fill' | 'line', index: number) => OoxmlElement | null;
|
|
1350
1215
|
/**
|
|
@@ -1432,6 +1297,11 @@ interface TextboxStoryProjection {
|
|
|
1432
1297
|
readonly verticalAnchor: 'top' | 'center' | 'bottom';
|
|
1433
1298
|
/** Autofit child of `wps:bodyPr`; extent stays authoritative either way (diagnostic only). */
|
|
1434
1299
|
readonly autofit: 'none' | 'shape' | 'normal';
|
|
1300
|
+
/**
|
|
1301
|
+
* `wps:bodyPr/@wrap="none"` (VML `mso-wrap-style:none`): lines never wrap at the box edge,
|
|
1302
|
+
* and the box takes the width of its widest line plus the insets. Absent for wrapped text.
|
|
1303
|
+
*/
|
|
1304
|
+
readonly noWrap?: true;
|
|
1435
1305
|
/** Solid fill of the hosting shape, painted behind the story; null for no fill. */
|
|
1436
1306
|
readonly fillHex: string | null;
|
|
1437
1307
|
/** Solid outline of the hosting shape; null for no outline. */
|
|
@@ -1465,6 +1335,26 @@ interface DrawingImageEffects {
|
|
|
1465
1335
|
readonly bilevel?: number;
|
|
1466
1336
|
}
|
|
1467
1337
|
|
|
1338
|
+
/** One text box member of a drawing group. */
|
|
1339
|
+
interface GroupTextboxProjection {
|
|
1340
|
+
/** Canonical node id of the member `wps:wsp`; namespaces the story's line ids. */
|
|
1341
|
+
readonly memberNodeId: string;
|
|
1342
|
+
/** The member box in the group's extent space, in EMU (origin at the extent's top-left). */
|
|
1343
|
+
readonly frameEmu: Readonly<{
|
|
1344
|
+
x: number;
|
|
1345
|
+
y: number;
|
|
1346
|
+
cx: number;
|
|
1347
|
+
cy: number;
|
|
1348
|
+
}>;
|
|
1349
|
+
/** The member's story, projected at the scaled member size. */
|
|
1350
|
+
readonly story: TextboxStoryProjection;
|
|
1351
|
+
/**
|
|
1352
|
+
* Clockwise turn of the member's text about the member box center, in degrees [0, 360):
|
|
1353
|
+
* the member's `rot`, plus 180 for `flipV`. `flipH` never mirrors the text.
|
|
1354
|
+
*/
|
|
1355
|
+
readonly rotationDegrees: number;
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1468
1358
|
/** The relationship namespace `r:id` lives in. */
|
|
1469
1359
|
declare const OFFICE_RELATIONSHIP_NAMESPACE_URI = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
1470
1360
|
/** The `Type` a hyperlink relationship declares. */
|
|
@@ -1586,6 +1476,229 @@ interface GroupPictureProjection {
|
|
|
1586
1476
|
readonly alternateContent: boolean;
|
|
1587
1477
|
}
|
|
1588
1478
|
|
|
1479
|
+
/**
|
|
1480
|
+
* Why a zip was refused at the trust boundary.
|
|
1481
|
+
*
|
|
1482
|
+
* `too-large` and `too-many-entries` are the zip-bomb guards; `bad-name` catches path traversal —
|
|
1483
|
+
* an entry with `..` or a leading `/` is rejected rather than normalized.
|
|
1484
|
+
*/
|
|
1485
|
+
type ZipRejection = 'too-many-entries' | 'too-large' | 'bad-name' | 'inflate-error';
|
|
1486
|
+
/** Archive caps: entry count, total decompressed bytes, and the decompression ratio. */
|
|
1487
|
+
interface ZipLimits {
|
|
1488
|
+
readonly maxEntries: number;
|
|
1489
|
+
/** Max total UNCOMPRESSED bytes across the archive. */
|
|
1490
|
+
readonly maxTotalBytes: number;
|
|
1491
|
+
/**
|
|
1492
|
+
* Max ratio of the archive's total declared uncompressed bytes to the archive's own byte
|
|
1493
|
+
* length (zip-bomb guard). Applies once that total exceeds 8 MiB, so a small archive is
|
|
1494
|
+
* never refused for compressing well.
|
|
1495
|
+
*/
|
|
1496
|
+
readonly maxRatio?: number;
|
|
1497
|
+
}
|
|
1498
|
+
/** The archive caps in force when a host configures none. Conservative and finite. */
|
|
1499
|
+
declare const DEFAULT_ZIP_LIMITS: ZipLimits;
|
|
1500
|
+
/** The read entries, or the typed refusal. Never throws — the bytes are untrusted. */
|
|
1501
|
+
type ZipReadResult = {
|
|
1502
|
+
readonly ok: true;
|
|
1503
|
+
readonly entries: ReadonlyMap<string, Uint8Array>;
|
|
1504
|
+
} | {
|
|
1505
|
+
readonly ok: false;
|
|
1506
|
+
readonly reason: ZipRejection;
|
|
1507
|
+
readonly detail?: string;
|
|
1508
|
+
readonly limit?: 'zip.maxTotalBytes' | 'zip.maxRatio';
|
|
1509
|
+
};
|
|
1510
|
+
/**
|
|
1511
|
+
* Inflate a ZIP archive with bounds + OPC name normalization. Entry name, count, archive
|
|
1512
|
+
* ratio, and total-uncompressed-size limits are enforced BEFORE each entry is decompressed
|
|
1513
|
+
* (via fflate's pre-inflation filter), so a zip bomb or a traversal name is rejected without
|
|
1514
|
+
* ever being inflated. Keys are canonical part names.
|
|
1515
|
+
*
|
|
1516
|
+
* The budgets count each entry's DECLARED sizes, and the declared size is also a hard cap on
|
|
1517
|
+
* what the entry may produce: fflate inflates into a buffer of exactly `originalSize` bytes
|
|
1518
|
+
* and never grows it, so an entry whose stream holds more than it declares is truncated (or
|
|
1519
|
+
* refused as `inflate-error`), never expanded past its budget. A stored entry is copied at
|
|
1520
|
+
* its compressed size, so the larger of its two declared sizes is what counts.
|
|
1521
|
+
*/
|
|
1522
|
+
declare function readZip(bytes: Uint8Array, limits?: ZipLimits): ZipReadResult;
|
|
1523
|
+
/** Deflate a set of canonical-part-name -> bytes into a ZIP archive. Every part name
|
|
1524
|
+
* is re-validated through the OPC normalization profile before writing, so a
|
|
1525
|
+
* traversal/encoded/normalized-alias name from an untrusted serialized model can
|
|
1526
|
+
* never be smuggled into a ZIP entry (write-side path-traversal guard). */
|
|
1527
|
+
declare function writeZip(entries: ReadonlyMap<string, Uint8Array>): Uint8Array;
|
|
1528
|
+
|
|
1529
|
+
/** One `<Default>`: a file extension mapped to a content type. */
|
|
1530
|
+
interface DefaultRecord {
|
|
1531
|
+
readonly extension: string;
|
|
1532
|
+
readonly contentType: string;
|
|
1533
|
+
readonly order: number;
|
|
1534
|
+
}
|
|
1535
|
+
/** One `<Override>`: a specific part name mapped to a content type. Beats any Default. */
|
|
1536
|
+
interface OverrideRecord {
|
|
1537
|
+
readonly partName: string;
|
|
1538
|
+
readonly contentType: string;
|
|
1539
|
+
readonly order: number;
|
|
1540
|
+
}
|
|
1541
|
+
/**
|
|
1542
|
+
* The authored `[Content_Types].xml` records, in significant order.
|
|
1543
|
+
*
|
|
1544
|
+
* Retained rather than collapsed into a lookup, because the file's lexical form and ordering are
|
|
1545
|
+
* part of what a lossless save re-emits.
|
|
1546
|
+
*/
|
|
1547
|
+
interface ContentTypeRecords {
|
|
1548
|
+
readonly defaults: readonly DefaultRecord[];
|
|
1549
|
+
readonly overrides: readonly OverrideRecord[];
|
|
1550
|
+
}
|
|
1551
|
+
/**
|
|
1552
|
+
* Why content-type records could not be indexed.
|
|
1553
|
+
*
|
|
1554
|
+
* All fail CLOSED: conflicting Defaults on one extension, duplicate normalized Override names, or
|
|
1555
|
+
* invalid MIME syntax are refused rather than resolved by picking one.
|
|
1556
|
+
*/
|
|
1557
|
+
type ContentTypeError = {
|
|
1558
|
+
readonly code: 'invalid-mime';
|
|
1559
|
+
readonly value: string;
|
|
1560
|
+
} | {
|
|
1561
|
+
readonly code: 'conflicting-default';
|
|
1562
|
+
readonly extension: string;
|
|
1563
|
+
} | {
|
|
1564
|
+
readonly code: 'duplicate-override';
|
|
1565
|
+
readonly partName: string;
|
|
1566
|
+
} | {
|
|
1567
|
+
readonly code: 'invalid-override-name';
|
|
1568
|
+
readonly partName: string;
|
|
1569
|
+
} | {
|
|
1570
|
+
readonly code: 'too-many-records';
|
|
1571
|
+
readonly limit: number;
|
|
1572
|
+
};
|
|
1573
|
+
/** Whether a string is syntactically a MIME type. Syntax only — no registry lookup. */
|
|
1574
|
+
declare function isValidMime(value: string): boolean;
|
|
1575
|
+
/** ASCII-case-insensitive extension key (leading dot removed; ASCII-only fold). */
|
|
1576
|
+
declare function extensionKey(extension: string): string;
|
|
1577
|
+
/** The resolved lookup: Override by case-folded part name, Default by case-insensitive extension. */
|
|
1578
|
+
interface ContentTypeIndex {
|
|
1579
|
+
/** ext key -> single MIME (identical duplicates collapsed). */
|
|
1580
|
+
readonly defaults: ReadonlyMap<string, string>;
|
|
1581
|
+
/** case-folded part name -> MIME. */
|
|
1582
|
+
readonly overrides: ReadonlyMap<string, string>;
|
|
1583
|
+
}
|
|
1584
|
+
/** The built index, or the conflict that made it impossible. */
|
|
1585
|
+
type IndexResult = {
|
|
1586
|
+
readonly ok: true;
|
|
1587
|
+
readonly index: ContentTypeIndex;
|
|
1588
|
+
} | {
|
|
1589
|
+
readonly ok: false;
|
|
1590
|
+
readonly error: ContentTypeError;
|
|
1591
|
+
};
|
|
1592
|
+
/**
|
|
1593
|
+
* Build a resolved content-type index, failing closed on conflict/duplicate/MIME
|
|
1594
|
+
* errors. `maxRecords` bounds the combined record count (N/N+1 gate).
|
|
1595
|
+
*/
|
|
1596
|
+
declare function buildContentTypeIndex(records: ContentTypeRecords, maxRecords?: number): IndexResult;
|
|
1597
|
+
/**
|
|
1598
|
+
* A part's content type, or why it has none.
|
|
1599
|
+
*
|
|
1600
|
+
* An orphan record never determines a part's type — a Default with no matching part is preserved
|
|
1601
|
+
* inertly rather than applied.
|
|
1602
|
+
*/
|
|
1603
|
+
type ResolveResult = {
|
|
1604
|
+
readonly ok: true;
|
|
1605
|
+
readonly contentType: string;
|
|
1606
|
+
readonly source: 'override' | 'default';
|
|
1607
|
+
} | {
|
|
1608
|
+
readonly ok: false;
|
|
1609
|
+
readonly reason: 'unknown';
|
|
1610
|
+
};
|
|
1611
|
+
/** Resolve a part's content type: Override wins over Default; else unknown. */
|
|
1612
|
+
declare function resolveContentType(index: ContentTypeIndex, partName: string): ResolveResult;
|
|
1613
|
+
|
|
1614
|
+
/** Caps applied while loading a package: zip, XML, part count and relationship count. */
|
|
1615
|
+
interface OoxmlPackageLimits {
|
|
1616
|
+
readonly zip?: ZipLimits;
|
|
1617
|
+
readonly xml?: XmlLimits;
|
|
1618
|
+
/** Cap on parts converted into canonical trees (N/N+1 gate, not a soft target). */
|
|
1619
|
+
readonly maxXmlParts?: number;
|
|
1620
|
+
/** Cap on relationship records across every rels part. */
|
|
1621
|
+
readonly maxRelationships?: number;
|
|
1622
|
+
}
|
|
1623
|
+
/** The limits in force when a host configures none. Conservative and finite. */
|
|
1624
|
+
declare const DEFAULT_OOXML_PACKAGE_LIMITS: Required<Pick<OoxmlPackageLimits, 'maxXmlParts' | 'maxRelationships'>>;
|
|
1625
|
+
/**
|
|
1626
|
+
* An external relationship target. Retained verbatim as authored evidence, with the
|
|
1627
|
+
* sink-safety verdict alongside it. Never resolved against the package, never fetched.
|
|
1628
|
+
*/
|
|
1629
|
+
interface OoxmlExternalTarget {
|
|
1630
|
+
readonly ownerPart: string;
|
|
1631
|
+
readonly id: string;
|
|
1632
|
+
readonly type: string;
|
|
1633
|
+
readonly rawTarget: string;
|
|
1634
|
+
/** False when the target is not a safe sink (javascript:, file:, ...). Still not fetched. */
|
|
1635
|
+
readonly sinkSafe: boolean;
|
|
1636
|
+
}
|
|
1637
|
+
/**
|
|
1638
|
+
* A loaded package: every XML part as a canonical tree, plus the non-XML parts kept verbatim.
|
|
1639
|
+
*
|
|
1640
|
+
* The preservation model in one value. Modelled parts re-emit normalized; everything else is
|
|
1641
|
+
* byte-identical, which is why an unrecognized part never costs a document anything.
|
|
1642
|
+
*/
|
|
1643
|
+
interface OoxmlPackage {
|
|
1644
|
+
/** Canonical trees, keyed by canonical part name. Non-XML parts are absent by design. */
|
|
1645
|
+
readonly parts: ReadonlyMap<string, OoxmlPart>;
|
|
1646
|
+
/** Raw bytes of every entry, including the non-XML parts that have no tree. */
|
|
1647
|
+
readonly partBytes: ReadonlyMap<string, Uint8Array>;
|
|
1648
|
+
/** Internal relationships by owner part, in authored order. */
|
|
1649
|
+
readonly relationships: ReadonlyMap<string, readonly RelationshipRecord[]>;
|
|
1650
|
+
readonly externalTargets: readonly OoxmlExternalTarget[];
|
|
1651
|
+
readonly contentTypes: ContentTypeIndex;
|
|
1652
|
+
/** Canonical name of the part the root `officeDocument` relationship points at. */
|
|
1653
|
+
readonly mainDocumentPart: string;
|
|
1654
|
+
}
|
|
1655
|
+
/** Why a package could not be loaded. Every code describes the FILE, not the caller. */
|
|
1656
|
+
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';
|
|
1657
|
+
/** A loaded package, or a typed refusal. Never throws. */
|
|
1658
|
+
type OoxmlPackageResult = {
|
|
1659
|
+
readonly ok: true;
|
|
1660
|
+
readonly package: OoxmlPackage;
|
|
1661
|
+
} | {
|
|
1662
|
+
readonly ok: false;
|
|
1663
|
+
readonly reason: OoxmlPackageRejection;
|
|
1664
|
+
readonly detail?: string;
|
|
1665
|
+
readonly limit?: 'zip.maxTotalBytes' | 'zip.maxRatio';
|
|
1666
|
+
};
|
|
1667
|
+
/**
|
|
1668
|
+
* Load DOCX bytes into canonical typed/generic OOXML trees, bounded at every step.
|
|
1669
|
+
*
|
|
1670
|
+
* THE trust boundary for a document. Composes the hardened primitives — zip limits and OPC name
|
|
1671
|
+
* normalization, content-type indexing, relationship validation, entity-free XML — into one
|
|
1672
|
+
* loader, and returns a typed rejection rather than throwing from inside a decoder.
|
|
1673
|
+
*
|
|
1674
|
+
* Fails closed on every limit, malformed name, unresolvable internal target, duplicate
|
|
1675
|
+
* relationship id, and XML rejection. An external relationship never causes a failure and
|
|
1676
|
+
* never causes a fetch: it is recorded with its sink-safety verdict for a later, explicitly
|
|
1677
|
+
* user-gated lane. A content-type record with an invalid MIME type is treated as absent,
|
|
1678
|
+
* unless it decides the type of the main document part, a relationships part, or a
|
|
1679
|
+
* non-payload part that the package root or the main document relates to.
|
|
1680
|
+
*/
|
|
1681
|
+
declare function readOoxmlPackage(bytes: Uint8Array, limits?: OoxmlPackageLimits): OoxmlPackageResult;
|
|
1682
|
+
/**
|
|
1683
|
+
* Serialize a canonical package back to DOCX bytes.
|
|
1684
|
+
*
|
|
1685
|
+
* Starts from the ORIGINAL entry bytes and overwrites only the parts held as trees. A part
|
|
1686
|
+
* the loader did not model — media, fonts, an XML part outside the modeled set — passes
|
|
1687
|
+
* through untouched, so round-tripping a document cannot lose a part the engine never
|
|
1688
|
+
* claimed to understand.
|
|
1689
|
+
*
|
|
1690
|
+
* The modeled parts are re-emitted NORMALIZED from the tree rather than patched as text.
|
|
1691
|
+
* That is the whole point of the canonical tree: correctness is judged by the two D9
|
|
1692
|
+
* oracles (the namespace-aware fingerprint and the save/reopen semantic digest), not by
|
|
1693
|
+
* byte equality, so a different-but-equivalent spelling is not a defect.
|
|
1694
|
+
*
|
|
1695
|
+
* `writeZip` re-validates every part name, so a name that became unsafe between load and
|
|
1696
|
+
* save cannot be smuggled into the archive.
|
|
1697
|
+
*/
|
|
1698
|
+
declare function writeOoxmlPackage(pkg: OoxmlPackage): Uint8Array;
|
|
1699
|
+
/** Replace one part's tree, returning a new package. Pure, like the tree edits themselves. */
|
|
1700
|
+
declare function withPart(pkg: OoxmlPackage, part: OoxmlPart): OoxmlPackage;
|
|
1701
|
+
|
|
1589
1702
|
/**
|
|
1590
1703
|
* Whether a drawing sits in the text flow or is positioned against a frame.
|
|
1591
1704
|
*
|
|
@@ -1699,6 +1812,8 @@ interface DrawingProjection {
|
|
|
1699
1812
|
/** The picture member of a `wpg:wgp` group; `picture` stays null for a group. */
|
|
1700
1813
|
readonly groupPicture: GroupPictureProjection | null;
|
|
1701
1814
|
readonly textboxStory: TextboxStoryProjection | null;
|
|
1815
|
+
/** Text box members of a `wpg:wgp` group, laid out read-only; absent when none has text. */
|
|
1816
|
+
readonly groupTextboxes?: readonly GroupTextboxProjection[];
|
|
1702
1817
|
/** Read-only preview of the supported native VML subset; the canonical XML is untouched. */
|
|
1703
1818
|
readonly legacyGraphic?: LegacyGraphicProjection;
|
|
1704
1819
|
readonly locks: DrawingLocks;
|
|
@@ -1772,94 +1887,6 @@ declare function projectDrawing(drawing: OoxmlDrawingNode, context: Readonly<{
|
|
|
1772
1887
|
resolveStyleMatrixReference?: ShapeStyleMatrixResolver;
|
|
1773
1888
|
}>): DrawingProjection | null;
|
|
1774
1889
|
|
|
1775
|
-
/** Caps applied while loading a package: zip, XML, part count and relationship count. */
|
|
1776
|
-
interface OoxmlPackageLimits {
|
|
1777
|
-
readonly zip?: ZipLimits;
|
|
1778
|
-
readonly xml?: XmlLimits;
|
|
1779
|
-
/** Cap on parts converted into canonical trees (N/N+1 gate, not a soft target). */
|
|
1780
|
-
readonly maxXmlParts?: number;
|
|
1781
|
-
/** Cap on relationship records across every rels part. */
|
|
1782
|
-
readonly maxRelationships?: number;
|
|
1783
|
-
}
|
|
1784
|
-
/** The limits in force when a host configures none. Conservative and finite. */
|
|
1785
|
-
declare const DEFAULT_OOXML_PACKAGE_LIMITS: Required<Pick<OoxmlPackageLimits, 'maxXmlParts' | 'maxRelationships'>>;
|
|
1786
|
-
/**
|
|
1787
|
-
* An external relationship target. Retained verbatim as authored evidence, with the
|
|
1788
|
-
* sink-safety verdict alongside it. Never resolved against the package, never fetched.
|
|
1789
|
-
*/
|
|
1790
|
-
interface OoxmlExternalTarget {
|
|
1791
|
-
readonly ownerPart: string;
|
|
1792
|
-
readonly id: string;
|
|
1793
|
-
readonly type: string;
|
|
1794
|
-
readonly rawTarget: string;
|
|
1795
|
-
/** False when the target is not a safe sink (javascript:, file:, ...). Still not fetched. */
|
|
1796
|
-
readonly sinkSafe: boolean;
|
|
1797
|
-
}
|
|
1798
|
-
/**
|
|
1799
|
-
* A loaded package: every XML part as a canonical tree, plus the non-XML parts kept verbatim.
|
|
1800
|
-
*
|
|
1801
|
-
* The preservation model in one value. Modelled parts re-emit normalized; everything else is
|
|
1802
|
-
* byte-identical, which is why an unrecognized part never costs a document anything.
|
|
1803
|
-
*/
|
|
1804
|
-
interface OoxmlPackage {
|
|
1805
|
-
/** Canonical trees, keyed by canonical part name. Non-XML parts are absent by design. */
|
|
1806
|
-
readonly parts: ReadonlyMap<string, OoxmlPart>;
|
|
1807
|
-
/** Raw bytes of every entry, including the non-XML parts that have no tree. */
|
|
1808
|
-
readonly partBytes: ReadonlyMap<string, Uint8Array>;
|
|
1809
|
-
/** Internal relationships by owner part, in authored order. */
|
|
1810
|
-
readonly relationships: ReadonlyMap<string, readonly RelationshipRecord[]>;
|
|
1811
|
-
readonly externalTargets: readonly OoxmlExternalTarget[];
|
|
1812
|
-
readonly contentTypes: ContentTypeIndex;
|
|
1813
|
-
/** Canonical name of the part the root `officeDocument` relationship points at. */
|
|
1814
|
-
readonly mainDocumentPart: string;
|
|
1815
|
-
}
|
|
1816
|
-
/** Why a package could not be loaded. Every code describes the FILE, not the caller. */
|
|
1817
|
-
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';
|
|
1818
|
-
/** A loaded package, or a typed refusal. Never throws. */
|
|
1819
|
-
type OoxmlPackageResult = {
|
|
1820
|
-
readonly ok: true;
|
|
1821
|
-
readonly package: OoxmlPackage;
|
|
1822
|
-
} | {
|
|
1823
|
-
readonly ok: false;
|
|
1824
|
-
readonly reason: OoxmlPackageRejection;
|
|
1825
|
-
readonly detail?: string;
|
|
1826
|
-
readonly limit?: 'zip.maxTotalBytes' | 'zip.maxRatio';
|
|
1827
|
-
};
|
|
1828
|
-
/**
|
|
1829
|
-
* Load DOCX bytes into canonical typed/generic OOXML trees, bounded at every step.
|
|
1830
|
-
*
|
|
1831
|
-
* THE trust boundary for a document. Composes the hardened primitives — zip limits and OPC name
|
|
1832
|
-
* normalization, content-type indexing, relationship validation, entity-free XML — into one
|
|
1833
|
-
* loader, and returns a typed rejection rather than throwing from inside a decoder.
|
|
1834
|
-
*
|
|
1835
|
-
* Fails closed on every limit, malformed name, unresolvable internal target, duplicate
|
|
1836
|
-
* relationship id, and XML rejection. An external relationship never causes a failure and
|
|
1837
|
-
* never causes a fetch: it is recorded with its sink-safety verdict for a later, explicitly
|
|
1838
|
-
* user-gated lane. A content-type record with an invalid MIME type is treated as absent,
|
|
1839
|
-
* unless it decides the type of the main document part, a relationships part, or a
|
|
1840
|
-
* non-payload part that the package root or the main document relates to.
|
|
1841
|
-
*/
|
|
1842
|
-
declare function readOoxmlPackage(bytes: Uint8Array, limits?: OoxmlPackageLimits): OoxmlPackageResult;
|
|
1843
|
-
/**
|
|
1844
|
-
* Serialize a canonical package back to DOCX bytes.
|
|
1845
|
-
*
|
|
1846
|
-
* Starts from the ORIGINAL entry bytes and overwrites only the parts held as trees. A part
|
|
1847
|
-
* the loader did not model — media, fonts, an XML part outside the modeled set — passes
|
|
1848
|
-
* through untouched, so round-tripping a document cannot lose a part the engine never
|
|
1849
|
-
* claimed to understand.
|
|
1850
|
-
*
|
|
1851
|
-
* The modeled parts are re-emitted NORMALIZED from the tree rather than patched as text.
|
|
1852
|
-
* That is the whole point of the canonical tree: correctness is judged by the two D9
|
|
1853
|
-
* oracles (the namespace-aware fingerprint and the save/reopen semantic digest), not by
|
|
1854
|
-
* byte equality, so a different-but-equivalent spelling is not a defect.
|
|
1855
|
-
*
|
|
1856
|
-
* `writeZip` re-validates every part name, so a name that became unsafe between load and
|
|
1857
|
-
* save cannot be smuggled into the archive.
|
|
1858
|
-
*/
|
|
1859
|
-
declare function writeOoxmlPackage(pkg: OoxmlPackage): Uint8Array;
|
|
1860
|
-
/** Replace one part's tree, returning a new package. Pure, like the tree edits themselves. */
|
|
1861
|
-
declare function withPart(pkg: OoxmlPackage, part: OoxmlPart): OoxmlPackage;
|
|
1862
|
-
|
|
1863
1890
|
/** The `w15` namespace: `commentsExtended.xml` — thread parent and resolved state. */
|
|
1864
1891
|
declare const W15_NAMESPACE_URI = "http://schemas.microsoft.com/office/word/2012/wordml";
|
|
1865
1892
|
/** A position in one story: a paragraph node id plus a UTF-16 offset inside it. */
|
|
@@ -2186,8 +2213,8 @@ interface ReviewRange {
|
|
|
2186
2213
|
*/
|
|
2187
2214
|
type ReviewRevisionKind = 'insert' | 'delete'
|
|
2188
2215
|
/**
|
|
2189
|
-
* A combined decision
|
|
2190
|
-
*
|
|
2216
|
+
* A combined deletion and insertion decision. The built-in reader lists them separately,
|
|
2217
|
+
* unless a review query asks to pair replacements or a custom review provider combines them.
|
|
2191
2218
|
*/
|
|
2192
2219
|
| 'replace' | 'moveFrom' | 'moveTo'
|
|
2193
2220
|
/** `w:rPrChange` / `w:pPrChange` — the words are unchanged, their formatting is not. */
|
|
@@ -2225,8 +2252,11 @@ interface ReviewRevisionItem {
|
|
|
2225
2252
|
readonly structuralChanges?: readonly ('rowInsert' | 'rowDelete' | 'cellInsert' | 'cellDelete' | 'cellMerge' | 'numberingInsert')[];
|
|
2226
2253
|
/** Changed direct formatting values, ready for localized review summaries. */
|
|
2227
2254
|
readonly formattingChanges?: readonly {
|
|
2228
|
-
readonly property: 'bold' | 'italic' | 'underline' | 'strike' | 'fontFamily' | 'fontSize' | 'color' | 'alignment' | 'leftIndent' | 'rightIndent' | 'firstLineIndent' | 'hangingIndent' | 'spaceBefore' | 'spaceAfter';
|
|
2229
|
-
/**
|
|
2255
|
+
readonly property: 'bold' | 'italic' | 'underline' | 'strike' | 'fontFamily' | 'fontSize' | 'color' | 'alignment' | 'leftIndent' | 'rightIndent' | 'firstLineIndent' | 'hangingIndent' | 'spaceBefore' | 'spaceAfter' | 'direction';
|
|
2256
|
+
/**
|
|
2257
|
+
* New direct value; null means inherit. Sizes and distances are in points. A direction is
|
|
2258
|
+
* `rtl` or `ltr`.
|
|
2259
|
+
*/
|
|
2230
2260
|
readonly value: string | null;
|
|
2231
2261
|
}[];
|
|
2232
2262
|
/** Newly applied proofing language codes in a tracked formatting change. */
|
|
@@ -2456,6 +2486,15 @@ declare function activeReviewItem(items: readonly ReviewItem[], position: Review
|
|
|
2456
2486
|
*/
|
|
2457
2487
|
declare function reviewThreadRootOf(items: readonly ReviewItem[], comment: ReviewCommentItem): ReviewItem;
|
|
2458
2488
|
|
|
2489
|
+
/**
|
|
2490
|
+
* Why a revision site cannot be resolved: no `w:id` or author, a content marker where content
|
|
2491
|
+
* cannot be, a wrapper whose content is itself marked, a structural revision outside tables and
|
|
2492
|
+
* numbering, or a move whose ranges do not pair up.
|
|
2493
|
+
*
|
|
2494
|
+
* @public
|
|
2495
|
+
*/
|
|
2496
|
+
type RevisionSiteRefusal = 'unaddressed' | 'misplaced-marker' | 'nested-marker' | 'unsupported-structure' | 'unsupported-move';
|
|
2497
|
+
|
|
2459
2498
|
/** The value a control accepts, by what kind of control it is. */
|
|
2460
2499
|
type ContentControlValueInput = {
|
|
2461
2500
|
readonly kind: 'text';
|
|
@@ -2489,9 +2528,19 @@ interface RevisionBatchEntry {
|
|
|
2489
2528
|
readonly author: string;
|
|
2490
2529
|
readonly partName: string;
|
|
2491
2530
|
readonly revisionKind: ReviewRevisionItem['revisionKind'];
|
|
2531
|
+
/** For a formatting change, its OOXML property-change element, as the review item has it. */
|
|
2532
|
+
readonly formattingKind?: string;
|
|
2492
2533
|
}
|
|
2493
2534
|
/** Why a requested decision remains pending. @public */
|
|
2494
2535
|
type RevisionBatchSkipReason = 'unsupported-revision' | 'incomplete-group' | 'retained-structure' | 'unknown-revision';
|
|
2536
|
+
/**
|
|
2537
|
+
* Why an `unsupported-revision` skip happened: a refused site, a formatting change whose earlier
|
|
2538
|
+
* properties were not recorded so it cannot be rejected, a read-only review item, or a change
|
|
2539
|
+
* with no sites in the part.
|
|
2540
|
+
*
|
|
2541
|
+
* @public
|
|
2542
|
+
*/
|
|
2543
|
+
type RevisionBatchSkipDetail = RevisionSiteRefusal | 'unrecorded-properties' | 'read-only' | 'no-sites';
|
|
2495
2544
|
/** Outcome of one selected-set decision. Counts refer to review decisions, not XML markers. @public */
|
|
2496
2545
|
interface RevisionBatchResult {
|
|
2497
2546
|
readonly resolved: readonly RevisionBatchEntry[];
|
|
@@ -2499,6 +2548,8 @@ interface RevisionBatchResult {
|
|
|
2499
2548
|
readonly key: string;
|
|
2500
2549
|
readonly reason: RevisionBatchSkipReason;
|
|
2501
2550
|
readonly revision?: RevisionBatchEntry;
|
|
2551
|
+
/** For `unsupported-revision`, which engine condition refused it. */
|
|
2552
|
+
readonly detail?: RevisionBatchSkipDetail;
|
|
2502
2553
|
}[];
|
|
2503
2554
|
/** All pending decisions in the addressed scope, including excluded and unsupported changes. */
|
|
2504
2555
|
readonly remaining: number;
|
|
@@ -2509,6 +2560,48 @@ declare function planRevisionBatch(part: OoxmlPart, action: 'accept' | 'reject',
|
|
|
2509
2560
|
result: RevisionBatchResult;
|
|
2510
2561
|
};
|
|
2511
2562
|
|
|
2563
|
+
/** Why a requested change keeps its attribution. @public */
|
|
2564
|
+
type RevisionAuthorSkipReason = 'unknown-revision' | 'unsupported-revision';
|
|
2565
|
+
/**
|
|
2566
|
+
* One reattributed change. `key` and `author` describe the change after the update, because
|
|
2567
|
+
* review keys include the author. @public
|
|
2568
|
+
*/
|
|
2569
|
+
interface RevisionAuthorEntry extends RevisionBatchEntry {
|
|
2570
|
+
/**
|
|
2571
|
+
* The key the caller selected the change by. It differs from `key` when the attribution
|
|
2572
|
+
* changed, because review keys include the author and date.
|
|
2573
|
+
*/
|
|
2574
|
+
readonly previousKey: string;
|
|
2575
|
+
/** The author the change had before the update. */
|
|
2576
|
+
readonly previousAuthor: string;
|
|
2577
|
+
}
|
|
2578
|
+
/** Outcome of one attribution change. Counts refer to review decisions, not XML markers. @public */
|
|
2579
|
+
interface RevisionAuthorResult {
|
|
2580
|
+
/** Changes that now carry the requested attribution, in selection order. */
|
|
2581
|
+
readonly updated: readonly RevisionAuthorEntry[];
|
|
2582
|
+
/** Requested changes that kept their attribution. */
|
|
2583
|
+
readonly skipped: readonly {
|
|
2584
|
+
readonly key: string;
|
|
2585
|
+
readonly reason: RevisionAuthorSkipReason;
|
|
2586
|
+
readonly revision?: RevisionBatchEntry;
|
|
2587
|
+
}[];
|
|
2588
|
+
}
|
|
2589
|
+
/** A planned attribution change: its ops, and how to name the result once they commit. */
|
|
2590
|
+
interface RevisionAuthorPlan {
|
|
2591
|
+
readonly ops: readonly TreeDocOp[];
|
|
2592
|
+
/** The outcome before commit. Updated entries still carry their previous keys. */
|
|
2593
|
+
readonly result: RevisionAuthorResult;
|
|
2594
|
+
/** The outcome against the committed part, with each updated change under its new key. */
|
|
2595
|
+
finish(after: OoxmlPart): RevisionAuthorResult;
|
|
2596
|
+
}
|
|
2597
|
+
/**
|
|
2598
|
+
* Plan an attribution change for selected review keys. Omitted keys select every change.
|
|
2599
|
+
* `authors` keeps only the changes those authors made.
|
|
2600
|
+
* Callers validate `revision` with `invalidRevisionAuthorInput` first.
|
|
2601
|
+
* @internal
|
|
2602
|
+
*/
|
|
2603
|
+
declare function planRevisionAuthorChange(part: OoxmlPart, revision: RevisionAttributionInput, keys?: readonly string[], scopeRoot?: OoxmlNode, authors?: readonly string[]): RevisionAuthorPlan;
|
|
2604
|
+
|
|
2512
2605
|
/** Allowlisted OOXML table border line styles — store/layout authority. */
|
|
2513
2606
|
declare const TABLE_BORDER_STYLES: readonly ['single', 'dashed', 'dotted', 'double', 'triple', 'thick'];
|
|
2514
2607
|
/**
|
|
@@ -2654,8 +2747,11 @@ interface DocRange {
|
|
|
2654
2747
|
*/
|
|
2655
2748
|
type ExecResult = {
|
|
2656
2749
|
ok: true;
|
|
2750
|
+
/** Whether the DOCUMENT changed; view-only calls (pane, activation, mode) always report `false`. */
|
|
2657
2751
|
changed: boolean;
|
|
2658
2752
|
revisions?: RevisionBatchResult;
|
|
2753
|
+
/** Present on `setReviewChangesAuthor`: the changes it updated and the ones it skipped. */
|
|
2754
|
+
revisionAuthors?: RevisionAuthorResult;
|
|
2659
2755
|
history?: HistoryGroupOutcome;
|
|
2660
2756
|
} | {
|
|
2661
2757
|
ok: false;
|
|
@@ -2663,6 +2759,7 @@ type ExecResult = {
|
|
|
2663
2759
|
reason: string;
|
|
2664
2760
|
target?: DocTarget;
|
|
2665
2761
|
revisions?: RevisionBatchResult;
|
|
2762
|
+
revisionAuthors?: RevisionAuthorResult;
|
|
2666
2763
|
};
|
|
2667
2764
|
/**
|
|
2668
2765
|
* Why a write was refused, as a value to branch on.
|
|
@@ -3268,6 +3365,18 @@ type TreeDocOp = SetFieldCodeOp | {
|
|
|
3268
3365
|
readonly siteNodeIds?: readonly string[];
|
|
3269
3366
|
/** Internal shared-notes scope. When present, this must be the canonical id of a note root. */
|
|
3270
3367
|
readonly scopeRootId?: string;
|
|
3368
|
+
} | {
|
|
3369
|
+
/**
|
|
3370
|
+
* Attribute pending revisions to another author, and optionally another date, without
|
|
3371
|
+
* deciding them. `sites` name revision elements and move range starts. Sites sharing a
|
|
3372
|
+
* `renumber` label take one fresh `w:id`, so the change cannot merge with another one.
|
|
3373
|
+
*/
|
|
3374
|
+
readonly op: 'setRevisionAttribution';
|
|
3375
|
+
readonly revision: RevisionAttributionInput;
|
|
3376
|
+
readonly sites: readonly {
|
|
3377
|
+
readonly nodeId: string;
|
|
3378
|
+
readonly renumber?: string;
|
|
3379
|
+
}[];
|
|
3271
3380
|
} | {
|
|
3272
3381
|
readonly op: 'rejectAllRevisions';
|
|
3273
3382
|
/** Exact canonical sites selected by bulk preflight. */
|
|
@@ -4081,7 +4190,19 @@ type TreeOpRejection = 'unknown-op' | 'unknown-paragraph' | 'not-a-paragraph' |
|
|
|
4081
4190
|
* a real offset that is not a PLACE — refused rather than resolved to the nearest one, so a
|
|
4082
4191
|
* caller learns the node would not have landed where they asked.
|
|
4083
4192
|
*/
|
|
4084
|
-
| 'indivisible-content'
|
|
4193
|
+
| 'indivisible-content'
|
|
4194
|
+
/**
|
|
4195
|
+
* The range has one end inside a field's editable saved result and the other outside it.
|
|
4196
|
+
* Deleting it would leave the field's begin, separate, and end markers unbalanced, so it is
|
|
4197
|
+
* refused. A range that covers the whole field removes the field.
|
|
4198
|
+
*/
|
|
4199
|
+
| 'field-structure'
|
|
4200
|
+
/**
|
|
4201
|
+
* In the editable field-result mode, an op other than typing, deletion, or run formatting
|
|
4202
|
+
* addresses a position inside a field's saved result. Splits, tabs, links, notes, and
|
|
4203
|
+
* fragments there are not supported yet.
|
|
4204
|
+
*/
|
|
4205
|
+
| 'field-result-unsupported' | 'unknown-block' | 'not-a-block' | 'block-required' | 'carries-section-mark'
|
|
4085
4206
|
/** The transaction named a part the package does not hold. */
|
|
4086
4207
|
| 'unknown-part'
|
|
4087
4208
|
/**
|
|
@@ -4165,5 +4286,5 @@ type TreeOpResult = {
|
|
|
4165
4286
|
readonly detail?: string;
|
|
4166
4287
|
};
|
|
4167
4288
|
|
|
4168
|
-
export { IMAGE_WRAP_TARGETS as
|
|
4169
|
-
export type {
|
|
4289
|
+
export { IMAGE_WRAP_TARGETS as aK, TEXT_FORM_FORMATS as aL, ACCEPTED_PARAGRAPH_PROPERTIES as b2, ACCEPTED_RUN_PROPERTIES as b3, CONTENT_CONTROL_ID_MAX as b4, CONTENT_CONTROL_PROPERTY_ORDER as b5, MAX_CONTENT_CONTROL_NESTING as bA, OFFICE_RELATIONSHIP_NAMESPACE_URI as bD, OOXML_NODE_IDENTITY_RULES as bE, DEFAULT_OOXML_PACKAGE_LIMITS as bm, DEFAULT_ZIP_LIMITS as bn, HYPERLINK_RELATIONSHIP_TYPE as bq, IMAGE_RELATIONSHIP_TYPE as bt, MAX_CONTENT_CONTROLS_PER_PART as bz, hyperlinkAnchorOf as c$, allocateContentControlId as cF, asciiFold as cG, buildContentTypeIndex as cH, buildRelationshipSet as cI, childElements as cJ, commentAnchorsOfStory as cK, commentsOfPart as cL, contentControlContentChildren as cM, contentControlContentNodeOf as cN, contentControlEndPropertiesNodeOf as cO, contentControlLevelOf as cP, contentControlPropertiesNodeOf as cQ, contentControlPropertiesOf as cR, contentControlTextOf as cS, contentControlsIn as cT, detectDuplicateNames as cU, extensionKey as cV, findContentControl as cW, findElement as cX, firstReviewRange as cY, flattenContentControls as cZ, hasAnyComment as c_, TABLE_BORDER_STYLES as co, W15_NAMESPACE_URI as cu, WML_NAMESPACE_URI as cv, XMLNS_NAMESPACE_URI as cw, XML_NAMESPACE_URI as cx, hyperlinkRelationshipIdOf as d0, hyperlinkTargetOf as d1, isContentControlContentNode as d2, isContentControlNode as d3, isContentControlWrapper as d4, isContentRevisionKind as d5, isHyperlinkNode as d6, isRangeMarkerKind as d7, isValidMime as d8, legacyCheckboxFieldsOf as d9, withPart as dA, writeOoxmlPackage as dB, writeZip as dC, activeReviewItem as dE, reviewItemPositionRank as dF, reviewItemsAt as dG, reviewThreadRootOf as dH, lockForbidsEdit as da, lockForbidsRemoval as db, normalizePartName as dc, orderedContentControlProperties as dd, parseContentControlId as de, partNameKey as df, planRevisionAuthorChange as dg, planRevisionBatch as dh, projectDrawing as di, readOnOffChild as dj, readOoxmlPackage as dk, readOoxmlPart as dl, readXml as dm, readZip as dn, resolveContentControlLock as dp, resolveContentType as dq, resolveImageRelationship as dr, resolveInternalTarget as ds, resolveRelationship as dt, reviewItemKey as du, reviewItemRanges as dv, textContent as dw, textFormFieldsOf as dx, threadStateOfPart as dy, validateExternalTarget as dz };
|
|
4290
|
+
export type { DrawingVerticalReferenceFrame as $, ParagraphTabStop as A, Block as B, CommentRecord as C, DocxDocument as D, ExecResult as E, RevisionType as F, Section as G, HeaderFooterSet as H, InsertableContentControlType as I, SectionProperties as J, StyleDefinition as K, Theme as L, ThemeColorScheme as M, OoxmlNode as N, OoxmlPart as O, Paragraph as P, OoxmlPackage as Q, ReviewModelInput as R, StyleDefinitions as S, Table as T, OoxmlNodeId as U, OoxmlGenericElementNode as V, DocxDocumentJSON as W, DrawingHorizontalReferenceFrame as X, DrawingKind as Y, DrawingLocks as Z, DrawingPositionInput as _, ReviewItem as a, OoxmlHardBreakNode as a$, FontDefinition as a0, ImageWrapTarget as a1, NumberingRef as a2, PageMargins as a3, ParagraphDisagreements as a4, ParagraphFormatCommand as a5, Point as a6, Rect as a7, RevisionAuthorResult as a8, RevisionBatchResult as a9, OoxmlNoteNode as aA, OoxmlContinuationSeparatorNode as aB, OoxmlEndnotesNode as aC, OoxmlFootnotesNode as aD, OoxmlNoteRefNode as aE, OoxmlNoteReferenceNode as aF, OoxmlSeparatorNode as aG, ImpactClass as aH, SourceCrop as aI, TreeDocColorValue as aJ, TableBorderStyle as aM, DrawingAccessibility as aN, DrawingImageEffects as aO, DrawingTransform as aP, VectorShapeProjection as aQ, OoxmlDrawingNode as aR, TextFormFieldRange as aS, TextFormFieldOptions as aT, OoxmlInvariantResult as aU, OoxmlInvariantIssue as aV, OoxmlFldCharNode as aW, OoxmlFldSimpleNode as aX, OoxmlInstrTextNode as aY, TreeOpResult as aZ, RelationshipRecord as a_, Run as aa, SelectionPin as ab, TableCell as ac, TableRow as ad, Unsubscribe as ae, Watermark as af, TreeDocOp as ag, OoxmlProperty as ah, OoxmlPackageResult as ai, OoxmlPackageRejection as aj, OoxmlElement as ak, OoxmlContentControlNode as al, OoxmlContentControlContentNode as am, DrawingProjection as an, OoxmlPackageLimits as ao, RevisionAuthorEntry as ap, RevisionAuthorSkipReason as aq, RevisionBatchEntry as ar, RevisionBatchSkipDetail as as, RevisionBatchSkipReason as at, RevisionSiteRefusal as au, TreeOpRejection as av, AutomationTableMutation as aw, RevisionAttributionInput as ax, DrawingTreeDocOp as ay, OoxmlParagraphNode as az, ReviewRevisionItem as b, OoxmlHyperlinkNode as b$, OoxmlAttribute as b0, CommentThreadState as b1, CommentAnchor as b6, CommentPosition as b7, CommitTextFormFieldOp as b8, ContentControlCheckbox as b9, NameRejection as bB, NameResult as bC, OoxmlBodyNode as bF, OoxmlBookmarkEndNode as bG, OoxmlBookmarkStartNode as bH, OoxmlContentControlCalendarNode as bI, OoxmlContentControlCheckboxNode as bJ, OoxmlContentControlCheckedNode as bK, OoxmlContentControlCheckedStateNode as bL, OoxmlContentControlComboBoxNode as bM, OoxmlContentControlDataBindingNode as bN, OoxmlContentControlDateFormatNode as bO, OoxmlContentControlDateNode as bP, OoxmlContentControlDropDownListNode as bQ, OoxmlContentControlEndPropertiesNode as bR, OoxmlContentControlLidNode as bS, OoxmlContentControlListItemNode as bT, OoxmlContentControlPropertiesNode as bU, OoxmlContentControlStoreMappedDataAsNode as bV, OoxmlContentControlTextNode as bW, OoxmlContentControlUncheckedStateNode as bX, OoxmlDocumentNode as bY, OoxmlExternalTarget as bZ, OoxmlGenericExtensionAttribute as b_, ContentControlCheckboxState as ba, ContentControlDataBinding as bb, ContentControlDateFormat as bc, ContentControlEntry as bd, ContentControlKind as be, ContentControlLevel as bf, ContentControlListItem as bg, ContentControlLock as bh, ContentControlProperties as bi, ContentTypeError as bj, ContentTypeIndex as bk, ContentTypeRecords as bl, DefaultRecord as bo, DeleteTextOp as bp, HyperlinkKind as br, HyperlinkTarget as bs, ImageRelationshipResolution as bu, IndexResult as bv, InsertBuildingBlockOp as bw, InsertTextOp as bx, LegacyCheckboxFieldRange as by, ReviewCommentItem as c, OoxmlInvariantIssueCode as c0, OoxmlKnownNodeAttribute as c1, OoxmlNamespaceBinding as c2, OoxmlNodeIdentityRules as c3, OoxmlParagraphPropertiesNode as c4, OoxmlPartMetadata as c5, OoxmlReadRejection as c6, OoxmlReadResult as c7, OoxmlRunNode as c8, OoxmlRunPropertiesNode as c9, XmlRejection as cA, XmlResult as cB, ZipLimits as cC, ZipReadResult as cD, ZipRejection as cE, OoxmlTabNode as ca, OoxmlTextElementNode as cb, OoxmlTextNode as cc, OoxmlWmlValAttribute as cd, OoxmlXmlSpaceAttribute as ce, OverrideRecord as cf, RelationshipError as cg, RelationshipSetResult as ch, RelationshipTargetResolver as ci, ResolveResult as cj, ResolvedRelationship as ck, SetLegacyCheckboxOp as cl, SetLegacyDropdownOp as cm, SetTextFormFieldDefaultOp as cn, TabStopWrite as cp, TargetMode as cq, TextFormFieldType as cr, TreeDocOpKind as cs, TreeOpEffect as ct, XmlLimits as cy, XmlNode as cz, ReviewCustomItem as d, VectorShapeComponent as dD, ReviewPosition as e, ReviewRange as f, ReviewRevisionKind as g, RevisionAddress as h, ContentControlType as i, DocTarget as j, RunFormatting as k, Extent as l, ContainerRef as m, ContentControlFilter as n, DocRange as o, Revision as p, DocComment as q, ColorValue as r, ContentControl as s, DocAnchor as t, DocAnchorRange as u, DocLocation as v, DocumentBody as w, ExecErrorCode as x, IndentFormatting as y, ParagraphFlags as z };
|