@docx-editor.dev/core 2.31.0 → 2.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -1
- package/THIRD_PARTY_NOTICES.md +1 -0
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +16 -54
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +17 -15
- package/dist/binding.js +1 -1
- package/dist/{chrome-print-BWvaVEhD.d.ts → chrome-print-CrPI9ZQc.d.ts} +128 -38
- package/dist/chunk-23MKR33J.js +4 -0
- package/dist/chunk-2CWQY27B.cjs +1 -0
- package/dist/chunk-2DEY5NUC.cjs +32 -0
- package/dist/chunk-2DR4TH6B.js +1 -0
- package/dist/chunk-2F2UEAE2.js +2 -0
- package/dist/chunk-2GPGAFOJ.cjs +5 -0
- package/dist/chunk-ALD626VU.cjs +2 -0
- package/dist/chunk-AU33YWEJ.js +236 -0
- package/dist/chunk-AXU63LYW.cjs +1 -0
- package/dist/chunk-CM5VZRBV.js +32 -0
- package/dist/chunk-D7FAFFTN.js +1 -0
- package/dist/chunk-DYUVJNDD.cjs +1 -0
- package/dist/chunk-ESYUKD5D.js +2 -0
- package/dist/chunk-F7TGQMVR.js +5 -0
- package/dist/chunk-FLW7KIQX.js +30 -0
- package/dist/chunk-JG4A6W6I.js +7 -0
- package/dist/chunk-JNGLSBPH.js +2 -0
- package/dist/chunk-KE6ZWRIY.cjs +236 -0
- package/dist/chunk-L3YXJDPX.js +1 -0
- package/dist/chunk-LI42N7OW.cjs +4 -0
- package/dist/chunk-PLKDS4JT.js +1 -0
- package/dist/chunk-PXMTQ73F.cjs +2 -0
- package/dist/chunk-R4R3AAE4.js +1 -0
- package/dist/chunk-RFUNFTGV.cjs +1 -0
- package/dist/chunk-SVM6PGMS.js +3 -0
- package/dist/chunk-SZURLHR3.cjs +3 -0
- package/dist/chunk-UYCGCVZ2.cjs +1 -0
- package/dist/chunk-WN7ICTA5.js +1 -0
- package/dist/chunk-X34QRAUU.cjs +1 -0
- package/dist/chunk-XNBYG4XJ.cjs +30 -0
- package/dist/chunk-ZDFJW5XS.cjs +2 -0
- package/dist/chunk-ZWO4JHNN.cjs +7 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +29 -4
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.cjs +1 -1
- package/dist/collaboration.d.ts +5 -5
- package/dist/collaboration.js +1 -1
- package/dist/contracts/document.d.ts +3 -3
- package/dist/contracts/editor.d.ts +13 -9
- package/dist/contracts/interaction.d.ts +2 -2
- package/dist/contracts/modules.d.ts +15 -12
- package/dist/contracts/types.d.ts +135 -2
- package/dist/{custom-node-writes-TeUvMP13.d.ts → custom-node-writes-AqY5KpVx.d.ts} +7 -2
- package/dist/diagnostic-context-CuzhOX0g.d.ts +98 -0
- package/dist/{diagnostic-hints-C9JlLz1L.d.ts → diagnostic-hints-BtCaCqQC.d.ts} +4 -4
- package/dist/{document-protection-C8x3P2J6.d.ts → document-protection-BvbpSXbQ.d.ts} +1 -1
- package/dist/drawing-graphic-kind-CXYGYbB3.d.ts +324 -0
- package/dist/drawing-preview-package-B9lSLRg4.d.ts +115 -0
- package/dist/{editor-B2ShlO23.d.ts → editor-B7OOAAie.d.ts} +181 -244
- package/dist/editor-fonts-D_-vjuJi.d.ts +53 -0
- package/dist/{editor-scope-C7ke1KJG.d.ts → editor-scope-CA6egMaK.d.ts} +6 -2
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +4 -4
- package/dist/editor.d.ts +259 -31
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +48 -19
- package/dist/export.js +2 -2
- package/dist/{failure-NS2lsya4.d.ts → failure-6KGFrDO9.d.ts} +1 -1
- package/dist/{font-resolver-CWh40DYp.d.ts → font-resolver-Bm9XqTNO.d.ts} +15 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +43 -26
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-CWS3j0Xr.d.ts → layout-shaping-Ci_BTnSU.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +181 -99
- package/dist/layout.js +1 -1
- package/dist/metafile-drawing-DtMFyMKq.d.ts +107 -0
- package/dist/{note-properties-QsKh24sM.d.ts → note-properties-DCIJUKIy.d.ts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +11 -7
- package/dist/output.js +1 -1
- package/dist/{protocol-COZJUKUY.d.ts → protocol-Cp_QzVxS.d.ts} +75 -5
- package/dist/{review-paragraph-order-C_QbCKcH.d.ts → review-paragraph-order-BJQ43_r0.d.ts} +1 -1
- package/dist/revision-projection-OVusTS77.d.ts +258 -0
- package/dist/{semantic-cell-selection-Cub9FDa8.d.ts → semantic-cell-selection-CoI5hHBm.d.ts} +2 -2
- package/dist/{semantic-interaction-dApRIYpt.d.ts → semantic-interaction-BbA4dgEo.d.ts} +1 -1
- package/dist/{semantic-paint-DLzA8sjP.d.ts → semantic-paint-B5JcIv9c.d.ts} +19 -9
- package/dist/{semantic-record-queries-3yp9o11g.d.ts → semantic-record-queries-DnO8J5_j.d.ts} +1 -1
- package/dist/{semantic-records-B-akgRch.d.ts → semantic-records-DoK0lNjS.d.ts} +439 -418
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +511 -20
- package/dist/store.js +1 -1
- package/dist/{types-barrel-CkF2JbU4.d.ts → tree-op-types-Df4oY2u4.d.ts} +1081 -524
- package/dist/{tree-package-store-B8l8DX3Z.d.ts → tree-package-store-DXhX1PE-.d.ts} +8 -3
- package/dist/{tree-session-contract-DeLRqohz.d.ts → tree-session-contract-CF2625mv.d.ts} +5 -5
- package/dist/unsupported-elements-CUojsaCr.d.ts +23 -0
- package/docs/accept-reject-without-scrolling.md +95 -0
- package/docs/comment-on-found-text.md +72 -0
- package/docs/custom-review-cards.md +178 -0
- package/docs/highlight-ranges.md +48 -0
- package/docs/index.md +36 -0
- package/docs/propose-rewrite.md +247 -0
- package/docs/tracked-replacement.md +68 -0
- package/licenses/ECMA-376.md +29 -0
- package/package.json +3 -2
- package/dist/bookmark-names-DDuAra_V.d.ts +0 -37
- package/dist/chunk-243W4WW2.cjs +0 -2
- package/dist/chunk-2E2RPEKX.js +0 -1
- package/dist/chunk-4S24UOPG.js +0 -30
- package/dist/chunk-5JPIEN54.cjs +0 -3
- package/dist/chunk-5SO5QDMV.cjs +0 -2
- package/dist/chunk-6IDOVU6L.cjs +0 -1
- package/dist/chunk-6JIJOZDW.js +0 -1
- package/dist/chunk-BTQKU64Q.cjs +0 -1
- package/dist/chunk-DBOOTED4.cjs +0 -30
- package/dist/chunk-EOTAXOJY.cjs +0 -5
- package/dist/chunk-FDAKJ2SJ.cjs +0 -30
- package/dist/chunk-FNNOJNGY.js +0 -3
- package/dist/chunk-FT33HRZP.js +0 -5
- package/dist/chunk-HC6YNKUI.cjs +0 -1
- package/dist/chunk-HZ66UCIS.js +0 -2
- package/dist/chunk-IBRBNT37.cjs +0 -1
- package/dist/chunk-IVIN7X43.js +0 -30
- package/dist/chunk-LZY6B6IV.js +0 -4
- package/dist/chunk-MOYYRVFV.cjs +0 -2
- package/dist/chunk-N6B3BXCL.js +0 -1
- package/dist/chunk-Q5K2GGNG.js +0 -2
- package/dist/chunk-R2XINWVE.js +0 -7
- package/dist/chunk-SUEXVBPR.js +0 -1
- package/dist/chunk-T2QQHG5C.js +0 -18
- package/dist/chunk-VWIJKH4A.js +0 -1
- package/dist/chunk-WO4V6PNS.cjs +0 -18
- package/dist/chunk-XMJKFURD.cjs +0 -4
- package/dist/chunk-XSTGE3NI.cjs +0 -1
- package/dist/chunk-YQWMI6J5.cjs +0 -7
- package/dist/chunk-ZCJS7D7S.js +0 -2
- package/dist/diagnostic-context-DJ0P1uZE.d.ts +0 -31
- package/dist/headless-document-view-qOpaCF82.d.ts +0 -143
- package/dist/omml-equation-BsLAa2lX.d.ts +0 -115
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { H as HistoryGroupOutcome } from './editor-scope-CA6egMaK.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Why a zip was refused at the trust boundary.
|
|
@@ -341,6 +341,7 @@ declare const XML_NAMESPACE_URI = "http://www.w3.org/XML/1998/namespace";
|
|
|
341
341
|
declare const XMLNS_NAMESPACE_URI = "http://www.w3.org/2000/xmlns/";
|
|
342
342
|
/** The `w14` wordml-2010 extension namespace — `w14:paraId`/`w14:textId` live here. */
|
|
343
343
|
declare const W14_NAMESPACE_URI = "http://schemas.microsoft.com/office/word/2010/wordml";
|
|
344
|
+
/** @internal */
|
|
344
345
|
declare const DRAWINGML_MAIN_NAMESPACE_URI = "http://schemas.openxmlformats.org/drawingml/2006/main";
|
|
345
346
|
declare const WP_NAMESPACE_URI = "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing";
|
|
346
347
|
declare const PIC_NAMESPACE_URI = "http://schemas.openxmlformats.org/drawingml/2006/picture";
|
|
@@ -1144,24 +1145,100 @@ type OoxmlInvariantResult = {
|
|
|
1144
1145
|
*/
|
|
1145
1146
|
declare function readOoxmlPart(xml: string, metadata: OoxmlPartMetadata, limits?: XmlLimits): OoxmlReadResult;
|
|
1146
1147
|
|
|
1147
|
-
/**
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
readonly
|
|
1153
|
-
/**
|
|
1154
|
-
readonly
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
readonly
|
|
1148
|
+
/** @internal */
|
|
1149
|
+
type ShapeSchemeColorResolver = (scheme: string) => string | null;
|
|
1150
|
+
/** A resolved shape colour. @public */
|
|
1151
|
+
interface ShapeColor {
|
|
1152
|
+
/** Validated six-character sRGB hex, without `#`. */
|
|
1153
|
+
readonly hex: string;
|
|
1154
|
+
/** Opacity, 0..1. */
|
|
1155
|
+
readonly alpha: number;
|
|
1156
|
+
}
|
|
1157
|
+
/** @internal */
|
|
1158
|
+
declare function resolveColorNode(color: OoxmlNode, resolveSchemeColor?: ShapeSchemeColorResolver, placeholder?: ShapeColor): ShapeColor | null;
|
|
1159
|
+
/** @internal */
|
|
1160
|
+
declare function directFill(parent: OoxmlElement, resolveSchemeColor?: ShapeSchemeColorResolver, placeholder?: ShapeColor): {
|
|
1161
|
+
readonly present: boolean;
|
|
1162
|
+
readonly color: ShapeColor | null;
|
|
1163
|
+
};
|
|
1164
|
+
|
|
1165
|
+
/** A pattern fill: the tile's foreground rows and the two colours. @public */
|
|
1166
|
+
interface VectorPattern {
|
|
1167
|
+
/** Eight rows of foreground cells from the top; the leftmost cell is the high bit. */
|
|
1168
|
+
readonly rows: readonly number[];
|
|
1169
|
+
readonly foreground: ShapeColor;
|
|
1170
|
+
readonly background: ShapeColor;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
/** An affine map `[a, b, c, d, e, f]`: x' = a x + c y + e, y' = b x + d y + f. */
|
|
1174
|
+
type AffineMatrix = readonly [number, number, number, number, number, number];
|
|
1175
|
+
/** One colour stop of a gradient. @public */
|
|
1176
|
+
interface GradientStop {
|
|
1177
|
+
/** Position along the gradient, 0..1. */
|
|
1178
|
+
readonly offset: number;
|
|
1179
|
+
/** Validated six-character sRGB hex, without `#`. */
|
|
1180
|
+
readonly hex: string;
|
|
1181
|
+
/** Opacity, 0..1. */
|
|
1182
|
+
readonly alpha: number;
|
|
1183
|
+
}
|
|
1184
|
+
/**
|
|
1185
|
+
* A gradient ready to paint. `linear` runs from (x1, y1) to (x2, y2); `radial` grows from
|
|
1186
|
+
* its centre (cx, cy) at offset 0 to radius r at offset 1. Both are in gradient space, which
|
|
1187
|
+
* `matrix` maps onto the component's point space.
|
|
1188
|
+
*/
|
|
1189
|
+
interface VectorGradient {
|
|
1190
|
+
readonly kind: 'linear' | 'radial';
|
|
1191
|
+
/** Stops in offset order; at least two. */
|
|
1192
|
+
readonly stops: readonly GradientStop[];
|
|
1193
|
+
/** `[x1, y1, x2, y2]` for a linear gradient, `[cx, cy, r]` for a radial one. */
|
|
1194
|
+
readonly coords: readonly number[];
|
|
1195
|
+
/** Gradient space onto the component's point space. */
|
|
1196
|
+
readonly matrix: AffineMatrix;
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
/**
|
|
1200
|
+
* Outline geometry of a text box shape. A polygon's points are shares of the box, from 0 at
|
|
1201
|
+
* its top-left to 1 at its far side, so the outline stretches with a box that fits its text.
|
|
1202
|
+
*/
|
|
1203
|
+
type TextboxOutlineProjection = {
|
|
1204
|
+
readonly kind: 'ellipse';
|
|
1205
|
+
}
|
|
1206
|
+
/** The corner radius is `arc` times the box's shorter side. */
|
|
1207
|
+
| {
|
|
1208
|
+
readonly kind: 'roundRect';
|
|
1209
|
+
readonly arc: number;
|
|
1210
|
+
} | {
|
|
1211
|
+
readonly kind: 'polygon';
|
|
1212
|
+
readonly subpaths: readonly (readonly {
|
|
1213
|
+
readonly x: number;
|
|
1214
|
+
readonly y: number;
|
|
1215
|
+
}[])[];
|
|
1216
|
+
};
|
|
1217
|
+
/**
|
|
1218
|
+
* The text area of a box of any size: shares of its width and height (an oval, a preset), or
|
|
1219
|
+
* the inscribed square of a round rectangle's corner arc on every side.
|
|
1220
|
+
*/
|
|
1221
|
+
type TextboxTextAreaRule = {
|
|
1222
|
+
readonly kind: 'share';
|
|
1223
|
+
readonly top: number;
|
|
1224
|
+
readonly right: number;
|
|
1225
|
+
readonly bottom: number;
|
|
1226
|
+
readonly left: number;
|
|
1227
|
+
} | {
|
|
1228
|
+
readonly kind: 'arc';
|
|
1229
|
+
readonly arc: number;
|
|
1230
|
+
};
|
|
1231
|
+
|
|
1232
|
+
/** A text box shadow: colour, opacity and page offset. */
|
|
1233
|
+
interface LegacyTextboxShadow {
|
|
1234
|
+
readonly hex: string;
|
|
1235
|
+
readonly alpha: number;
|
|
1236
|
+
readonly offsetXEmu: number;
|
|
1237
|
+
readonly offsetYEmu: number;
|
|
1238
|
+
/** The shadow is the solid silhouette, seen only outside the shape. */
|
|
1239
|
+
readonly obscured: boolean;
|
|
1162
1240
|
}
|
|
1163
1241
|
|
|
1164
|
-
type ShapeSchemeColorResolver = (scheme: string) => string | null;
|
|
1165
1242
|
type ShapeStyleMatrixResolver = (kind: 'fill' | 'line', index: number) => OoxmlElement | null;
|
|
1166
1243
|
/**
|
|
1167
1244
|
* The renderable subset of a `wps:wsp` non-picture graphic, or of one bounded `wpg:wgp`
|
|
@@ -1170,6 +1247,8 @@ type ShapeStyleMatrixResolver = (kind: 'fill' | 'line', index: number) => OoxmlE
|
|
|
1170
1247
|
* from `a:srgbClr` or from the theme, through `a:schemeClr` or a `wps:style` matrix
|
|
1171
1248
|
* reference. Anything richer (gradient and picture fills, text bodies, rotation, a nested
|
|
1172
1249
|
* group) projects as `null` and paints the labelled placeholder instead.
|
|
1250
|
+
*
|
|
1251
|
+
* @public
|
|
1173
1252
|
*/
|
|
1174
1253
|
interface VectorShapeProjection {
|
|
1175
1254
|
/** The drawing extent that frames the subpath coordinate space. */
|
|
@@ -1200,7 +1279,13 @@ interface VectorShapeProjection {
|
|
|
1200
1279
|
readonly strokeWidthEmu: number;
|
|
1201
1280
|
/** Independently styled paths, always non-empty. A direct shape has one component. */
|
|
1202
1281
|
readonly components: readonly VectorShapeComponent[];
|
|
1282
|
+
/**
|
|
1283
|
+
* Geometry outside the extent paints too. A drawing canvas does not cut its members at
|
|
1284
|
+
* its frame: a member placed past an edge shows whole.
|
|
1285
|
+
*/
|
|
1286
|
+
readonly overflowVisible?: true;
|
|
1203
1287
|
}
|
|
1288
|
+
/** One painted layer of a vector shape. @public */
|
|
1204
1289
|
interface VectorShapeComponent {
|
|
1205
1290
|
readonly subpathsEmu: readonly (readonly Readonly<{
|
|
1206
1291
|
x: number;
|
|
@@ -1218,15 +1303,50 @@ interface VectorShapeComponent {
|
|
|
1218
1303
|
readonly strokeHex: string | null;
|
|
1219
1304
|
readonly strokeAlpha: number;
|
|
1220
1305
|
readonly strokeWidthEmu: number;
|
|
1306
|
+
/**
|
|
1307
|
+
* A gradient fill (`a:gradFill`), painted in place of `fillHex` where the painter can.
|
|
1308
|
+
* `fillHex` then holds the mean of its stops.
|
|
1309
|
+
*/
|
|
1310
|
+
readonly fillGradient?: VectorGradient;
|
|
1311
|
+
/** A preset pattern the fill paints with; `fillHex` is its mean colour. */
|
|
1312
|
+
readonly fillPattern?: VectorPattern;
|
|
1313
|
+
/** The outer shadow the shape casts, painted under this component. */
|
|
1314
|
+
readonly shadow?: ShapeShadow;
|
|
1315
|
+
/**
|
|
1316
|
+
* The component only casts `shadow`: it is the silhouette of a shape with several paths,
|
|
1317
|
+
* placed before them, and paints no fill or outline of its own.
|
|
1318
|
+
*/
|
|
1319
|
+
readonly shadowOnly?: true;
|
|
1221
1320
|
/** Authored line ends and joins, inherited from the selected theme line when absent. */
|
|
1222
1321
|
readonly strokeCap?: 'butt' | 'round' | 'square';
|
|
1223
|
-
readonly strokeJoin?: 'round' | 'bevel';
|
|
1322
|
+
readonly strokeJoin?: 'round' | 'bevel' | 'miter';
|
|
1323
|
+
/** Miter limit in line widths, for a miter join. */
|
|
1324
|
+
readonly strokeMiterLimit?: number;
|
|
1325
|
+
/** Dash and gap lengths in multiples of the stroke width; absent for a solid outline. */
|
|
1326
|
+
readonly strokeDash?: readonly number[];
|
|
1327
|
+
/** Paint clips to these closed subpaths, as an inner shadow clips to its shape. */
|
|
1328
|
+
readonly clipEmu?: readonly (readonly Readonly<{
|
|
1329
|
+
x: number;
|
|
1330
|
+
y: number;
|
|
1331
|
+
}>[])[];
|
|
1332
|
+
/** In a picture's frame: paints under the picture (its shadow and fill), not over it. */
|
|
1333
|
+
readonly belowPicture?: true;
|
|
1334
|
+
/**
|
|
1335
|
+
* How far the stroked path lies outside the geometry by design, in EMU: a picture outline
|
|
1336
|
+
* runs half its width outside the picture, so the whole stroke stays off the picture.
|
|
1337
|
+
*/
|
|
1338
|
+
readonly strokeOutsetEmu?: number;
|
|
1224
1339
|
/**
|
|
1225
1340
|
* The outline sits inside the closed geometry (`a:ln algn="in"`): painters draw it at twice
|
|
1226
1341
|
* its width clipped to the path, so the authored width stays inside the shape and adds no
|
|
1227
1342
|
* reach past the extent. Set only for a closed outline with area.
|
|
1228
1343
|
*/
|
|
1229
1344
|
readonly strokeInset?: boolean;
|
|
1345
|
+
/**
|
|
1346
|
+
* The subpaths fill by the nonzero winding rule rather than even-odd, so overlapping
|
|
1347
|
+
* subpaths of one direction stay filled where they cross.
|
|
1348
|
+
*/
|
|
1349
|
+
readonly fillRule?: 'nonzero';
|
|
1230
1350
|
}
|
|
1231
1351
|
/**
|
|
1232
1352
|
* The story carried by a `wps:wsp` text box (`wps:txbx` → `w:txbxContent`).
|
|
@@ -1234,6 +1354,8 @@ interface VectorShapeComponent {
|
|
|
1234
1354
|
* The projection captures only the story root and the shape chrome reads; it never walks the
|
|
1235
1355
|
* story content, so the per-drawing element budget is not spent on paragraphs. Layout collects
|
|
1236
1356
|
* blocks from `content` under its own caps.
|
|
1357
|
+
*
|
|
1358
|
+
* @internal
|
|
1237
1359
|
*/
|
|
1238
1360
|
interface TextboxStoryProjection {
|
|
1239
1361
|
/** Canonical node id of the `w:txbxContent` element. */
|
|
@@ -1262,34 +1384,168 @@ interface TextboxStoryProjection {
|
|
|
1262
1384
|
readonly strokeHex: string | null;
|
|
1263
1385
|
/** Outline width in EMU; 0 when absent. */
|
|
1264
1386
|
readonly strokeWidthEmu: number;
|
|
1387
|
+
/** The shape around a legacy VML story; absent for an upright rectangle. */
|
|
1388
|
+
readonly legacyFrame?: TextboxLegacyFrame;
|
|
1389
|
+
/** The outline is centred on the shape edge, half outside the extent, as VML strokes it. */
|
|
1390
|
+
readonly strokeCentered?: true;
|
|
1391
|
+
/** VML `insetpen`: the outline lies inside the box and insets the text by its full width. */
|
|
1392
|
+
readonly strokeInset?: true;
|
|
1393
|
+
/** VML `mso-fit-shape-to-text`: the box height follows its text when laid out. */
|
|
1394
|
+
readonly fitHeightToText?: true;
|
|
1395
|
+
/** Outline dash pattern in multiples of the outline width; absent for solid. */
|
|
1396
|
+
readonly strokeDash?: readonly number[];
|
|
1397
|
+
/** How outline dashes end; absent for flat ends. */
|
|
1398
|
+
readonly strokeCap?: 'round' | 'square';
|
|
1399
|
+
/** The shape painted again under itself in one colour, offset on the page. */
|
|
1400
|
+
readonly shadow?: LegacyTextboxShadow;
|
|
1401
|
+
/**
|
|
1402
|
+
* The story is DrawingML shape text lowered to read-only paragraphs (a diagram's text): it
|
|
1403
|
+
* lays out without the document's styles and with the DrawingML line rule.
|
|
1404
|
+
*/
|
|
1405
|
+
readonly drawingText?: true;
|
|
1406
|
+
/**
|
|
1407
|
+
* The drawing's `vectorShape` paints the box's fill, outline and effects; the story paints
|
|
1408
|
+
* only its text. The fill and outline fields stay for the text insets they give.
|
|
1409
|
+
*/
|
|
1410
|
+
readonly chromeByVector?: true;
|
|
1265
1411
|
}
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
readonly
|
|
1277
|
-
|
|
1412
|
+
/** Shape geometry, turn and text flow of a text box: a legacy VML one, or a DrawingML one. */
|
|
1413
|
+
interface TextboxLegacyFrame {
|
|
1414
|
+
/** Space between the shape box and its text area, in EMU, before the story insets. */
|
|
1415
|
+
readonly textAreaEmu: Readonly<{
|
|
1416
|
+
top: number;
|
|
1417
|
+
right: number;
|
|
1418
|
+
bottom: number;
|
|
1419
|
+
left: number;
|
|
1420
|
+
}>;
|
|
1421
|
+
/** Outline geometry; null for a rectangle. */
|
|
1422
|
+
readonly outline: TextboxOutlineProjection | null;
|
|
1423
|
+
/** Clockwise shape turn in degrees, in [0, 360). */
|
|
1424
|
+
readonly rotationDegrees: number;
|
|
1425
|
+
/** The text turns with the shape; otherwise it stays upright in the turned box. */
|
|
1426
|
+
readonly textTurnsWithShape: boolean;
|
|
1427
|
+
/**
|
|
1428
|
+
* `vertical` runs lines top to bottom, stacked right to left; `verticalBottomToTop` runs
|
|
1429
|
+
* them bottom to top, stacked left to right.
|
|
1430
|
+
*/
|
|
1431
|
+
readonly flow: 'horizontal' | 'vertical' | 'verticalBottomToTop';
|
|
1432
|
+
/** The shape paints and its text does not, as a text area some shapes write hides it. */
|
|
1433
|
+
readonly textHidden?: true;
|
|
1434
|
+
/** How the text area follows the box size, for a box that fits its text. */
|
|
1435
|
+
readonly textAreaRule?: TextboxTextAreaRule;
|
|
1278
1436
|
}
|
|
1279
1437
|
|
|
1280
|
-
/**
|
|
1438
|
+
/** An outer shadow: the shape's silhouette, offset, blurred and filled in one colour. */
|
|
1439
|
+
interface ShapeShadow {
|
|
1440
|
+
/** Offset of the silhouette, in the component's point space. */
|
|
1441
|
+
readonly dxEmu: number;
|
|
1442
|
+
/** Vertical offset of the silhouette, in the same units. */
|
|
1443
|
+
readonly dyEmu: number;
|
|
1444
|
+
/** Blur radius in the same units; 0 is a crisp silhouette. */
|
|
1445
|
+
readonly blurEmu: number;
|
|
1446
|
+
/** Validated six-character sRGB hex, without `#`. */
|
|
1447
|
+
readonly hex: string;
|
|
1448
|
+
/** Opacity, 0..1. */
|
|
1449
|
+
readonly alpha: number;
|
|
1450
|
+
}
|
|
1451
|
+
/**
|
|
1452
|
+
* The effect list a shape paints with, and the colour `phClr` stands for in it.
|
|
1453
|
+
*
|
|
1454
|
+
* @internal
|
|
1455
|
+
*/
|
|
1456
|
+
interface ShapeEffectList {
|
|
1457
|
+
/** The shape's own `a:effectLst`, or the one in the theme effect style it references. */
|
|
1458
|
+
readonly effectLst: OoxmlElement;
|
|
1459
|
+
/** True when `effectLst` comes from the theme through the shape's `effectRef`. */
|
|
1460
|
+
readonly fromTheme: boolean;
|
|
1461
|
+
/** The colour of the `effectRef`, which `phClr` in a theme effect list stands for. */
|
|
1462
|
+
readonly placeholder?: ShapeColor;
|
|
1463
|
+
}
|
|
1464
|
+
/**
|
|
1465
|
+
* A mirror image below a picture that fades out downward (`a:reflection`), as the effects
|
|
1466
|
+
* renderer projects it for paint.
|
|
1467
|
+
*
|
|
1281
1468
|
* @public
|
|
1282
1469
|
*/
|
|
1283
|
-
interface
|
|
1284
|
-
/**
|
|
1285
|
-
readonly
|
|
1286
|
-
|
|
1287
|
-
readonly
|
|
1288
|
-
|
|
1289
|
-
readonly
|
|
1470
|
+
interface ShapeReflection {
|
|
1471
|
+
/** Opacity where the mirror image meets the shape. */
|
|
1472
|
+
readonly startAlpha: number;
|
|
1473
|
+
/** Opacity at `endPosition`; below it the mirror image is clear. */
|
|
1474
|
+
readonly endAlpha: number;
|
|
1475
|
+
/** Where the fade ends, as a share of the shape's height. */
|
|
1476
|
+
readonly endPosition: number;
|
|
1477
|
+
/** Gap between the shape and its mirror image. */
|
|
1478
|
+
readonly distanceEmu: number;
|
|
1479
|
+
/** Blur radius of the mirror image. */
|
|
1480
|
+
readonly blurEmu: number;
|
|
1290
1481
|
}
|
|
1291
1482
|
|
|
1292
|
-
/**
|
|
1483
|
+
/** Effects that change how a picture itself paints, beyond what its frame draws. @public */
|
|
1484
|
+
interface PictureFrameEffects {
|
|
1485
|
+
/** A mirror image of the picture below it. */
|
|
1486
|
+
readonly reflection?: ShapeReflection;
|
|
1487
|
+
/** The picture's edge fades out over this distance inside it. */
|
|
1488
|
+
readonly softEdgeEmu?: number;
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
/** The rule a layout widens to its line. */
|
|
1492
|
+
interface HorizontalRuleProjection {
|
|
1493
|
+
/** `RRGGBB` of the bar, or of its upper band when shaded. */
|
|
1494
|
+
readonly fillHex: string;
|
|
1495
|
+
/** The lower band is light grey, as a groove. */
|
|
1496
|
+
readonly shaded: boolean;
|
|
1497
|
+
/** The bar's share of its line, in (0, 1]. */
|
|
1498
|
+
readonly widthFraction: number;
|
|
1499
|
+
/** A set width in points, which the line caps; absent for a share of the line. */
|
|
1500
|
+
readonly widthPt?: number;
|
|
1501
|
+
/** Where a bar shorter than its line sits on it. */
|
|
1502
|
+
readonly align: 'left' | 'center' | 'right';
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
/** @internal */
|
|
1506
|
+
declare const CHART_GRAPHIC_DATA_URI = "http://schemas.openxmlformats.org/drawingml/2006/chart";
|
|
1507
|
+
/** @internal */
|
|
1508
|
+
declare const CHART_NAMESPACE_URI = "http://schemas.openxmlformats.org/drawingml/2006/chart";
|
|
1509
|
+
/** One resolved chart part. @internal */
|
|
1510
|
+
interface ChartPart {
|
|
1511
|
+
/** The `c:chartSpace` root. */
|
|
1512
|
+
readonly chartSpace: OoxmlElement;
|
|
1513
|
+
/** Canonical part name, for story ids and diagnostics. */
|
|
1514
|
+
readonly partName: string;
|
|
1515
|
+
/** The theme's Latin heading and body faces, which chart text takes through tokens. */
|
|
1516
|
+
readonly themeFaces: ChartThemeFaces;
|
|
1517
|
+
}
|
|
1518
|
+
/** @internal */
|
|
1519
|
+
interface ChartThemeFaces {
|
|
1520
|
+
readonly major: string | null;
|
|
1521
|
+
readonly minor: string | null;
|
|
1522
|
+
}
|
|
1523
|
+
/** Resolves the chart part behind one `c:chart` element of the owner story part. @internal */
|
|
1524
|
+
type ChartPartResolver = (chart: OoxmlElement) => ChartPart | null;
|
|
1525
|
+
|
|
1526
|
+
/** @internal */
|
|
1527
|
+
declare const CHARTEX_GRAPHIC_DATA_URI = "http://schemas.microsoft.com/office/drawing/2014/chartex";
|
|
1528
|
+
/** @internal */
|
|
1529
|
+
declare const CHARTEX_NAMESPACE_URI = "http://schemas.microsoft.com/office/drawing/2014/chartex";
|
|
1530
|
+
/** The namespace of chart style and colour style parts. @internal */
|
|
1531
|
+
declare const CHART_STYLE_NAMESPACE_URI = "http://schemas.microsoft.com/office/drawing/2012/chartStyle";
|
|
1532
|
+
/** One resolved chartex part. @internal */
|
|
1533
|
+
interface ChartexPart {
|
|
1534
|
+
/** The `cx:chartSpace` root. */
|
|
1535
|
+
readonly chartSpace: OoxmlElement;
|
|
1536
|
+
/** Canonical part name, for story ids and diagnostics. */
|
|
1537
|
+
readonly partName: string;
|
|
1538
|
+
/** The `cs:chartStyle` root the chartex part names, or null. */
|
|
1539
|
+
readonly style: OoxmlElement | null;
|
|
1540
|
+
/** The `cs:colorStyle` root the chartex part names, or null. */
|
|
1541
|
+
readonly colors: OoxmlElement | null;
|
|
1542
|
+
/** The theme's Latin heading and body faces, which chart text takes through tokens. */
|
|
1543
|
+
readonly themeFaces: ChartThemeFaces;
|
|
1544
|
+
}
|
|
1545
|
+
/** Resolves the chartex part behind one `cx:chart` element of the owner story part. @internal */
|
|
1546
|
+
type ChartexPartResolver = (chart: OoxmlElement) => ChartexPart | null;
|
|
1547
|
+
|
|
1548
|
+
/** One text box member of a drawing group. @internal */
|
|
1293
1549
|
interface GroupTextboxProjection {
|
|
1294
1550
|
/** Canonical node id of the member `wps:wsp`; namespaces the story's line ids. */
|
|
1295
1551
|
readonly memberNodeId: string;
|
|
@@ -1309,523 +1565,709 @@ interface GroupTextboxProjection {
|
|
|
1309
1565
|
readonly rotationDegrees: number;
|
|
1310
1566
|
}
|
|
1311
1567
|
|
|
1312
|
-
/**
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
*/
|
|
1321
|
-
type RelationshipTargetResolver = (relationshipId: string) => {
|
|
1322
|
-
readonly target: string;
|
|
1323
|
-
readonly external: boolean;
|
|
1324
|
-
/**
|
|
1325
|
-
* The PACKAGE's own verdict on this target (`validateExternalTarget`): whether it is an
|
|
1326
|
-
* absolute URI with a safe scheme.
|
|
1327
|
-
*
|
|
1328
|
-
* Carried separately because `sanitizeHref` cannot answer it. That function is a SCHEME
|
|
1329
|
-
* allowlist and deliberately admits relative URLs — the right rule for a value the host
|
|
1330
|
-
* authored, and the wrong one for a value a `.docx` did. A file-supplied
|
|
1331
|
-
* `Target="/admin/delete-account"` has no scheme to refuse, so it would pass the
|
|
1332
|
-
* allowlist and resolve against the EMBEDDING APPLICATION'S origin: a link reading
|
|
1333
|
-
* "Company policy" that issues an authenticated same-origin request to whatever host
|
|
1334
|
-
* app the editor is mounted in. Absent, a target is treated as unverified.
|
|
1335
|
-
*/
|
|
1336
|
-
readonly sinkSafe?: boolean;
|
|
1337
|
-
} | null;
|
|
1568
|
+
/** Opaque handle — bytes are reachable only through {@link mintValidatedImageBytes}. */
|
|
1569
|
+
interface ValidatedImageBytesHandle {
|
|
1570
|
+
readonly registryId: number;
|
|
1571
|
+
readonly resourceKey: string;
|
|
1572
|
+
readonly contentId: string;
|
|
1573
|
+
readonly generation: number;
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1338
1576
|
/**
|
|
1339
|
-
*
|
|
1577
|
+
* The engine's trust-boundary caps: recursion depth, element counts, and the rest.
|
|
1340
1578
|
*
|
|
1341
|
-
*
|
|
1342
|
-
*
|
|
1579
|
+
* A caller may LOWER any of these but never raise or disable one — an override of `Infinity`,
|
|
1580
|
+
* zero, a negative or `NaN` clamps into `(0, ceiling]` rather than turning the limit off. These
|
|
1581
|
+
* are security ceilings, not performance budgets.
|
|
1343
1582
|
*/
|
|
1344
|
-
|
|
1345
|
-
/**
|
|
1346
|
-
|
|
1347
|
-
/**
|
|
1348
|
-
|
|
1583
|
+
interface ResourceLimits {
|
|
1584
|
+
/** Max nested-structure recursion (tables/shapes/SDT/groups). */
|
|
1585
|
+
readonly maxRecursionDepth: number;
|
|
1586
|
+
/** Max total parsed element count. */
|
|
1587
|
+
readonly maxElementCount: number;
|
|
1588
|
+
/** Max package part count. */
|
|
1589
|
+
readonly maxPartCount: number;
|
|
1590
|
+
/** Max total decompressed bytes (zip-bomb guard). */
|
|
1591
|
+
readonly maxDecompressedBytes: number;
|
|
1592
|
+
/** Max total compressed input bytes. */
|
|
1593
|
+
readonly maxCompressedBytes: number;
|
|
1594
|
+
/** Max decompressed:compressed ratio per entry. */
|
|
1595
|
+
readonly maxCompressionRatio: number;
|
|
1596
|
+
/** In-memory chunk budget for streaming/spooling. */
|
|
1597
|
+
readonly maxChunkBytes: number;
|
|
1598
|
+
/** Max pagination passes before non-convergence is declared. */
|
|
1599
|
+
readonly maxPaginationPasses: number;
|
|
1600
|
+
/** Max queued items in any bounded work queue. */
|
|
1601
|
+
readonly maxQueueDepth: number;
|
|
1602
|
+
}
|
|
1603
|
+
/** Non-disableable hard ceilings: no resolved limit may exceed these. */
|
|
1604
|
+
declare const HARD_CEILINGS: ResourceLimits;
|
|
1605
|
+
/** Finite defaults, all <= their hard ceiling. */
|
|
1606
|
+
declare const DEFAULT_LIMITS: ResourceLimits;
|
|
1349
1607
|
/**
|
|
1350
|
-
*
|
|
1351
|
-
*
|
|
1352
|
-
*
|
|
1353
|
-
* activate, so it paints inert exactly like a refused scheme.
|
|
1608
|
+
* Resolve caller overrides into a frozen, always-finite limit set. Each value is
|
|
1609
|
+
* `min(override>0 ? override : default, ceiling)`. Infinity/0/negative/NaN can
|
|
1610
|
+
* never disable a limit — the hard ceiling always wins.
|
|
1354
1611
|
*/
|
|
1355
|
-
|
|
1356
|
-
/**
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
readonly
|
|
1365
|
-
/**
|
|
1366
|
-
* The sanitized runtime projection, or `null` when there is nothing safe to navigate to.
|
|
1367
|
-
* The ONLY value permitted in a DOM `href`, `window.open`, or a copied link.
|
|
1368
|
-
*/
|
|
1369
|
-
readonly href: string | null;
|
|
1370
|
-
/** `w:anchor`, for an internal link. */
|
|
1371
|
-
readonly anchor?: string;
|
|
1372
|
-
/** `w:tooltip` — Word's hover text; paint puts it on the anchor's `title`. */
|
|
1373
|
-
readonly tooltip?: string;
|
|
1374
|
-
/** The authored `r:id`, so an edit can rewrite the relationship it names. */
|
|
1375
|
-
readonly relationshipId?: string;
|
|
1612
|
+
declare function resolveLimits(overrides?: Partial<ResourceLimits>): ResourceLimits;
|
|
1613
|
+
/** Bounded image decode limits (typed-drawings-and-images task 4). */
|
|
1614
|
+
/** Trust-boundary caps specific to image decoding and embedding. */
|
|
1615
|
+
interface ImageResourceLimits {
|
|
1616
|
+
readonly maxEncodedBytes: number;
|
|
1617
|
+
readonly maxDecodedBytes: number;
|
|
1618
|
+
readonly maxPixels: number;
|
|
1619
|
+
readonly maxDimension: number;
|
|
1620
|
+
readonly maxPolygonPoints: number;
|
|
1621
|
+
readonly maxExternalRedirects: number;
|
|
1376
1622
|
}
|
|
1377
|
-
/**
|
|
1378
|
-
declare
|
|
1379
|
-
/**
|
|
1380
|
-
declare
|
|
1381
|
-
/**
|
|
1382
|
-
declare function
|
|
1623
|
+
/** Image caps nothing can raise past. A caller's override clamps into these. */
|
|
1624
|
+
declare const IMAGE_RESOURCE_HARD_CEILINGS: ImageResourceLimits;
|
|
1625
|
+
/** The image caps in force when a host configures none. Conservative and finite. */
|
|
1626
|
+
declare const DEFAULT_IMAGE_RESOURCE_LIMITS: ImageResourceLimits;
|
|
1627
|
+
/** Resolve caller overrides into frozen image limits; hard ceilings cannot be raised. */
|
|
1628
|
+
declare function resolveImageResourceLimits(overrides?: Partial<ImageResourceLimits>): ImageResourceLimits;
|
|
1629
|
+
|
|
1383
1630
|
/**
|
|
1384
|
-
*
|
|
1385
|
-
*
|
|
1386
|
-
* `r:id` wins over `w:anchor` when a link carries both, matching Word: the relationship
|
|
1387
|
-
* names the document and the anchor names a place inside it, so the pair is a link to a
|
|
1388
|
-
* bookmark in ANOTHER file — which this engine will not follow, but whose external half is
|
|
1389
|
-
* the part that decides where it points.
|
|
1631
|
+
* Raster media the decode port measures and any authoring path may write.
|
|
1390
1632
|
*
|
|
1391
|
-
*
|
|
1633
|
+
* BMP and WebP are here for the same reason the other three are: an `<img>` decodes them
|
|
1634
|
+
* natively, so they need a signature and a structural header and nothing else. BMP is what
|
|
1635
|
+
* older documents carry; WebP is what current Word writes.
|
|
1392
1636
|
*/
|
|
1393
|
-
|
|
1637
|
+
type SupportedImageMime = 'image/png' | 'image/jpeg' | 'image/gif' | 'image/bmp' | 'image/webp';
|
|
1638
|
+
/**
|
|
1639
|
+
* Vector media painted straight from validated bytes. An `<img>` renders SVG in the
|
|
1640
|
+
* browser's secure static mode — no script, no external subresource loads — so there is
|
|
1641
|
+
* no decode step and no raster buffer sized by a file-supplied number.
|
|
1642
|
+
*/
|
|
1643
|
+
type VectorImageMime = 'image/svg+xml';
|
|
1644
|
+
/** Every mime the painter can hand to an `<img>`. */
|
|
1645
|
+
type RenderableImageMime = SupportedImageMime | VectorImageMime;
|
|
1646
|
+
/**
|
|
1647
|
+
* Media kept in the package byte-for-byte that the painter cannot hand to an `<img>`.
|
|
1648
|
+
* A decode port may rasterize it; without one it paints as a labelled placeholder.
|
|
1649
|
+
*/
|
|
1650
|
+
type PreservedImageMime = 'image/tiff' | 'image/x-emf' | 'image/x-wmf';
|
|
1651
|
+
/** @internal */
|
|
1652
|
+
type MetafileImageMime = 'image/x-emf' | 'image/x-wmf';
|
|
1394
1653
|
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1654
|
+
/**
|
|
1655
|
+
* What is known about one embedded image: validated, refused, or still decoding.
|
|
1656
|
+
*
|
|
1657
|
+
* Content type is a CLAIM. Signature sniffing, structural header validation and the decode port
|
|
1658
|
+
* are authoritative, and bytes that fail them never enter public state.
|
|
1659
|
+
*/
|
|
1660
|
+
type ImageResourceState = {
|
|
1661
|
+
readonly kind: 'ready';
|
|
1662
|
+
readonly partName: string;
|
|
1663
|
+
readonly contentId: string;
|
|
1664
|
+
readonly resourceKey: string;
|
|
1665
|
+
readonly validatedHandle: ValidatedImageBytesHandle;
|
|
1666
|
+
readonly mime: RenderableImageMime;
|
|
1667
|
+
readonly pixelWidth: number;
|
|
1668
|
+
readonly pixelHeight: number;
|
|
1669
|
+
readonly dpiX: number;
|
|
1670
|
+
readonly dpiY: number;
|
|
1671
|
+
} | {
|
|
1672
|
+
readonly kind: 'unrenderable';
|
|
1673
|
+
readonly partName: string | null;
|
|
1674
|
+
readonly mime: RenderableImageMime | PreservedImageMime | 'unknown';
|
|
1675
|
+
readonly reason: 'unsupported-format' | 'non-picture-graphic' | 'signature-mismatch' | 'decode-failed' | 'resource-limit';
|
|
1676
|
+
} | {
|
|
1677
|
+
readonly kind: 'external';
|
|
1678
|
+
readonly relationshipId: string;
|
|
1679
|
+
readonly sinkSafe: boolean;
|
|
1680
|
+
} | {
|
|
1681
|
+
readonly kind: 'missing';
|
|
1682
|
+
readonly relationshipId: string;
|
|
1683
|
+
} | {
|
|
1684
|
+
readonly kind: 'pending';
|
|
1685
|
+
readonly resourceKey: string;
|
|
1686
|
+
};
|
|
1687
|
+
/**
|
|
1688
|
+
* The injected image decoder.
|
|
1689
|
+
*
|
|
1690
|
+
* A port rather than a direct `Image`/`createImageBitmap` call, so a worker or server runtime
|
|
1691
|
+
* supplies its own and the engine never reaches for a browser global.
|
|
1692
|
+
*/
|
|
1693
|
+
interface ImageDecodePort {
|
|
1694
|
+
decode(bytes: Uint8Array, mime: SupportedImageMime, limits: ImageResourceLimits,
|
|
1695
|
+
/** Aborted when the owning lookup/session is disposed. */
|
|
1696
|
+
signal?: AbortSignal): Promise<Readonly<{
|
|
1697
|
+
pixelWidth: number;
|
|
1698
|
+
pixelHeight: number;
|
|
1699
|
+
dpiX: number;
|
|
1700
|
+
dpiY: number;
|
|
1701
|
+
}>>;
|
|
1702
|
+
/**
|
|
1703
|
+
* Optional conversion of media an `<img>` cannot render (EMF/WMF metafiles, TIFF) into a
|
|
1704
|
+
* renderable raster. The returned bytes are untrusted and re-enter the full raster
|
|
1705
|
+
* validation path (sniff, header, pixel caps, decode) before they can become a ready
|
|
1706
|
+
* resource. A null return declines the format and keeps the labelled placeholder; so does
|
|
1707
|
+
* a throw, as `decode-failed`.
|
|
1708
|
+
*/
|
|
1709
|
+
convertPreserved?(bytes: Uint8Array, mime: PreservedImageMime, limits: ImageResourceLimits,
|
|
1710
|
+
/** Aborted when the owning lookup/session is disposed. */
|
|
1711
|
+
signal?: AbortSignal): Promise<Readonly<{
|
|
1712
|
+
bytes: Uint8Array;
|
|
1713
|
+
mime: SupportedImageMime;
|
|
1714
|
+
}> | null>;
|
|
1399
1715
|
}
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
readonly
|
|
1403
|
-
readonly
|
|
1716
|
+
/** Resolves a relationship id to a validated image resource, or reports why it could not. */
|
|
1717
|
+
interface ImageResourceLookup {
|
|
1718
|
+
readonly resolveEmbedded: (ownerPartName: string, relationshipId: string) => Promise<ImageResourceState>;
|
|
1719
|
+
readonly resolveLinked: (ownerPartName: string, relationshipId: string) => ImageResourceState;
|
|
1720
|
+
readonly resolveForProjection: (projection: DrawingProjection) => Promise<ImageResourceState>;
|
|
1721
|
+
readonly liveReferenceCount: (partName: string) => number;
|
|
1722
|
+
readonly dispose: () => void;
|
|
1723
|
+
}
|
|
1724
|
+
/** Maximum prefix inspected for SVG root detection (exported for bounded-scan tests). */
|
|
1725
|
+
declare const MAX_SVG_SNIFF_BYTES = 512;
|
|
1726
|
+
/** A raster header that passed structural validation: its real MIME type and pixel extent. */
|
|
1727
|
+
interface ValidatedRasterHeader {
|
|
1728
|
+
readonly pixelWidth: number;
|
|
1729
|
+
readonly pixelHeight: number;
|
|
1730
|
+
/** Horizontal physical density when bounded header metadata supplies it. */
|
|
1731
|
+
readonly dpiX?: number;
|
|
1732
|
+
/** Vertical physical density when bounded header metadata supplies it. */
|
|
1733
|
+
readonly dpiY?: number;
|
|
1404
1734
|
}
|
|
1735
|
+
/** Bounded scan for an `<svg` document root (optional `<?xml` prolog only). */
|
|
1736
|
+
declare function hasBoundedSvgRoot(bytes: Uint8Array): boolean;
|
|
1737
|
+
/** Signature sniffing — authoritative over declared content type. */
|
|
1738
|
+
declare function sniffImageMime(bytes: Uint8Array): RenderableImageMime | PreservedImageMime | 'unknown';
|
|
1739
|
+
/** Structural PNG IHDR validation before decode. */
|
|
1740
|
+
declare function validatePngHeader(bytes: Uint8Array): ValidatedRasterHeader | null;
|
|
1741
|
+
/** Structural GIF logical screen descriptor validation before decode. */
|
|
1742
|
+
declare function validateGifHeader(bytes: Uint8Array): ValidatedRasterHeader | null;
|
|
1743
|
+
/** Bounded JPEG marker scan through the first supported SOF marker. */
|
|
1744
|
+
declare function validateJpegHeader(bytes: Uint8Array): ValidatedRasterHeader | null;
|
|
1745
|
+
/**
|
|
1746
|
+
* Intrinsic size of an SVG, resolved the way a browser sizes one: absolute `width`/`height`
|
|
1747
|
+
* first, then `viewBox` for the missing axis or ratio, then the CSS 300x150 default.
|
|
1748
|
+
*
|
|
1749
|
+
* This is metadata for insert and reset-to-natural-size only. Layout uses the authored
|
|
1750
|
+
* `wp:extent` and the browser rasterizes into that box, so nothing here sizes an allocation
|
|
1751
|
+
* and an out-of-range value is clamped rather than refused.
|
|
1752
|
+
*/
|
|
1753
|
+
declare function resolveSvgIntrinsicSize(bytes: Uint8Array, limits: ImageResourceLimits): ValidatedRasterHeader | null;
|
|
1754
|
+
/**
|
|
1755
|
+
* Validate a raster image's header structurally and report its real MIME type and extent.
|
|
1756
|
+
*
|
|
1757
|
+
* Content type is a CLAIM; this is what makes it a fact. A file declaring `image/png` over JPEG
|
|
1758
|
+
* bytes is caught here rather than at decode.
|
|
1759
|
+
*/
|
|
1760
|
+
declare function validateRasterHeader(bytes: Uint8Array, mime: SupportedImageMime): ValidatedRasterHeader | null;
|
|
1761
|
+
/** Package-wide live drawing references to a media part name. */
|
|
1762
|
+
declare function liveDrawingReferenceCount(pkg: OoxmlPackage, partName: string): number;
|
|
1763
|
+
/** How the image cache decodes, and what it will spend doing so. */
|
|
1764
|
+
interface CreateImageResourceCacheOptions {
|
|
1765
|
+
readonly limits?: Partial<ImageResourceLimits>;
|
|
1766
|
+
readonly decodePort: ImageDecodePort;
|
|
1767
|
+
}
|
|
1768
|
+
/**
|
|
1769
|
+
* Derived cache for one immutable package snapshot. Registry identity is
|
|
1770
|
+
* `(package snapshot, decodePort object, normalized limits)` — the first caller
|
|
1771
|
+
* never imposes its decoder or limits on later callers with different options.
|
|
1772
|
+
*/
|
|
1773
|
+
declare function imageResourceLookupFor(pkg: OoxmlPackage, options: CreateImageResourceCacheOptions): ImageResourceLookup;
|
|
1774
|
+
/** @deprecated Prefer {@link imageResourceLookupFor} — registry binds cache to package identity. */
|
|
1775
|
+
/** Build the per-document image cache. Validated bytes only; refusals are remembered too. */
|
|
1776
|
+
declare function createImageResourceCache(initialPkg: OoxmlPackage, options: CreateImageResourceCacheOptions): ImageResourceLookup;
|
|
1405
1777
|
|
|
1406
|
-
/**
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
/**
|
|
1417
|
-
readonly
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
/**
|
|
1424
|
-
readonly
|
|
1778
|
+
/**
|
|
1779
|
+
* Plain text fitted to a floating shape box, painted with one fill and an optional outline.
|
|
1780
|
+
*
|
|
1781
|
+
* @internal
|
|
1782
|
+
*/
|
|
1783
|
+
interface LegacyTextArtProjection {
|
|
1784
|
+
readonly text: string;
|
|
1785
|
+
readonly fontFamily: string;
|
|
1786
|
+
readonly bold: boolean;
|
|
1787
|
+
readonly italic: boolean;
|
|
1788
|
+
/** `RRGGBB`, or null when the shape is not filled. */
|
|
1789
|
+
readonly fillHex: string | null;
|
|
1790
|
+
readonly fillAlpha: number;
|
|
1791
|
+
/** `RRGGBB`, or null when the shape is not stroked. */
|
|
1792
|
+
readonly strokeHex: string | null;
|
|
1793
|
+
readonly strokeAlpha: number;
|
|
1794
|
+
readonly strokeWidthPt: number;
|
|
1795
|
+
/** Clockwise rotation about the box centre, in [0, 360). */
|
|
1796
|
+
readonly rotationDegrees: number;
|
|
1797
|
+
/** `trim`: the ink fills the whole box, with no text inset. */
|
|
1798
|
+
readonly trim?: true;
|
|
1425
1799
|
/**
|
|
1426
|
-
*
|
|
1427
|
-
*
|
|
1428
|
-
* MC payloads it cannot draw.
|
|
1800
|
+
* Data an installed text art layout (`DrawingRenderers.textArtLayout`) reads: plain JSON
|
|
1801
|
+
* values, so equal projections stay equal. The engine never reads it.
|
|
1429
1802
|
*/
|
|
1430
|
-
readonly
|
|
1803
|
+
readonly renderData?: unknown;
|
|
1431
1804
|
}
|
|
1432
1805
|
|
|
1433
1806
|
/**
|
|
1434
|
-
*
|
|
1807
|
+
* A chart plot type. A classic chart names it by its element without the `Chart` suffix:
|
|
1808
|
+
* column and bar charts are both `bar`, and `ofPie` is a pie-of-pie or bar-of-pie chart. A
|
|
1809
|
+
* chartex chart names it by its series layout: `waterfall`, `funnel`, `boxWhisker`,
|
|
1810
|
+
* `treemap`, `sunburst` and `regionMap` by their layout id, `histogram` for a clustered
|
|
1811
|
+
* column series, and `pareto` for a Pareto chart (a clustered column series with its
|
|
1812
|
+
* Pareto line).
|
|
1435
1813
|
*
|
|
1436
|
-
*
|
|
1437
|
-
* position, while an anchored one has offsets relative to a page, margin or column.
|
|
1814
|
+
* @public
|
|
1438
1815
|
*/
|
|
1439
|
-
type
|
|
1440
|
-
/** Nine Word wrap menu targets (inline plus eight floating modes). @public */
|
|
1441
|
-
type ImageWrapTarget = 'inline' | 'square' | 'squareLeft' | 'squareRight' | 'tight' | 'through' | 'topAndBottom' | 'behind' | 'inFront';
|
|
1442
|
-
/** Every text-wrap mode a drawing may be set to, including `inline`. */
|
|
1443
|
-
declare const IMAGE_WRAP_TARGETS: readonly ImageWrapTarget[];
|
|
1444
|
-
type DrawingWrapElement = 'none' | 'square' | 'tight' | 'through' | 'topAndBottom';
|
|
1445
|
-
type DrawingHorizontalReferenceFrame = 'character' | 'column' | 'insideMargin' | 'leftMargin' | 'margin' | 'outsideMargin' | 'page' | 'rightMargin';
|
|
1446
|
-
type DrawingVerticalReferenceFrame = 'bottomMargin' | 'insideMargin' | 'line' | 'margin' | 'outsideMargin' | 'page' | 'paragraph' | 'topMargin';
|
|
1447
|
-
/** `a:srcRect` — how much of each edge of the source image is cropped away, as fractions. */
|
|
1448
|
-
interface SourceCrop {
|
|
1449
|
-
readonly left: number;
|
|
1450
|
-
readonly top: number;
|
|
1451
|
-
readonly right: number;
|
|
1452
|
-
readonly bottom: number;
|
|
1453
|
-
}
|
|
1454
|
-
interface DrawingTransform {
|
|
1455
|
-
readonly rotationDegrees: number;
|
|
1456
|
-
readonly flipHorizontal: boolean;
|
|
1457
|
-
readonly flipVertical: boolean;
|
|
1458
|
-
/** Source `a:off` in EMU; defaults to origin when absent. */
|
|
1459
|
-
readonly offsetEmu: Readonly<{
|
|
1460
|
-
x: number;
|
|
1461
|
-
y: number;
|
|
1462
|
-
}>;
|
|
1463
|
-
/** Source `a:ext` in EMU; zero falls back to `wp:extent` at geometry time. */
|
|
1464
|
-
readonly extentEmu: Readonly<{
|
|
1465
|
-
cx: number;
|
|
1466
|
-
cy: number;
|
|
1467
|
-
}>;
|
|
1468
|
-
}
|
|
1816
|
+
type DrawingChartPlotType = 'area' | 'area3D' | 'bar' | 'bar3D' | 'bubble' | 'doughnut' | 'line' | 'line3D' | 'ofPie' | 'pie' | 'pie3D' | 'radar' | 'scatter' | 'stock' | 'surface' | 'surface3D' | 'waterfall' | 'funnel' | 'histogram' | 'pareto' | 'boxWhisker' | 'treemap' | 'sunburst' | 'regionMap';
|
|
1469
1817
|
/**
|
|
1470
|
-
*
|
|
1818
|
+
* How the page shows a chart: `chart` when the installed chart renderer draws it,
|
|
1819
|
+
* `fallback` when it shows the content saved in its `mc:AlternateContent` fallback (a
|
|
1820
|
+
* picture, a shape, a group or VML), and `placeholder` when it shows the labeled chart
|
|
1821
|
+
* placeholder.
|
|
1471
1822
|
*
|
|
1472
|
-
*
|
|
1473
|
-
* would promise an edit that cannot happen.
|
|
1823
|
+
* @public
|
|
1474
1824
|
*/
|
|
1475
|
-
|
|
1476
|
-
readonly select: boolean;
|
|
1477
|
-
readonly move: boolean;
|
|
1478
|
-
readonly resize: boolean;
|
|
1479
|
-
readonly changeAspect: boolean;
|
|
1480
|
-
}
|
|
1481
|
-
interface DrawingLocksInput {
|
|
1482
|
-
readonly select?: boolean;
|
|
1483
|
-
readonly move?: boolean;
|
|
1484
|
-
readonly resize?: boolean;
|
|
1485
|
-
readonly changeAspect?: boolean;
|
|
1486
|
-
}
|
|
1825
|
+
type DrawingChartShownAs = 'chart' | 'fallback' | 'placeholder';
|
|
1487
1826
|
/**
|
|
1488
|
-
*
|
|
1827
|
+
* The title and plot types of a chart, as text, and how the page shows it.
|
|
1489
1828
|
*
|
|
1490
|
-
*
|
|
1491
|
-
*
|
|
1829
|
+
* A drawing record carries it as `chart` whenever the drawing holds a chart whose chart part
|
|
1830
|
+
* can be read, in each of the three states that `shownAs` names. A visible drawing in a
|
|
1831
|
+
* skipped `mc:Choice` can retain a placeholder when its bounds are usable. Chart metadata
|
|
1832
|
+
* is present only when the projection resolves the chart part.
|
|
1833
|
+
*
|
|
1834
|
+
* @public
|
|
1492
1835
|
*/
|
|
1493
|
-
interface
|
|
1836
|
+
interface DrawingChartSummary {
|
|
1494
1837
|
/**
|
|
1495
|
-
*
|
|
1496
|
-
*
|
|
1838
|
+
* The title the chart shows, as plain text: its own title, typed or from a cell, or the name
|
|
1839
|
+
* of its only series for an automatic title. Null when it shows none, and when a title with
|
|
1840
|
+
* no text of its own sits on a chart with several series. Runs of white space collapse to one
|
|
1841
|
+
* space, and the text is cut to at most 200 UTF-16 code units.
|
|
1842
|
+
*
|
|
1843
|
+
* A chartex chart (waterfall, funnel, histogram, Pareto, box and whisker, treemap, sunburst,
|
|
1844
|
+
* region map) reads only its own title text. Its title is null when the title element has
|
|
1845
|
+
* no text of its own and the chart shows its default caption, and a chartex chart never uses
|
|
1846
|
+
* a series name as an automatic title.
|
|
1497
1847
|
*/
|
|
1498
|
-
readonly
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1848
|
+
readonly title: string | null;
|
|
1849
|
+
/**
|
|
1850
|
+
* The chart's plot types in document order; a classic combination chart has more than one.
|
|
1851
|
+
* A chartex chart reports exactly one plot type, or none when its series layout is not one
|
|
1852
|
+
* of the chartex types.
|
|
1853
|
+
*/
|
|
1854
|
+
readonly plotTypes: readonly DrawingChartPlotType[];
|
|
1855
|
+
/**
|
|
1856
|
+
* How the page shows the chart. The projection sets it from the renderers installed when
|
|
1857
|
+
* the document opened: `chart` (the record has a `vectorShape`), `fallback` (the record
|
|
1858
|
+
* paints the fallback content, such as a picture `resource`), or `placeholder` (the record
|
|
1859
|
+
* has `placeholderGraphicKind` `'chart'`). Read this field rather than the other fields.
|
|
1860
|
+
*/
|
|
1861
|
+
readonly shownAs: DrawingChartShownAs;
|
|
1503
1862
|
}
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
readonly
|
|
1514
|
-
readonly
|
|
1515
|
-
readonly
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
right: number;
|
|
1522
|
-
bottom: number;
|
|
1523
|
-
left: number;
|
|
1524
|
-
}>;
|
|
1525
|
-
readonly inlineDistancesEmu: Readonly<{
|
|
1526
|
-
top: number;
|
|
1527
|
-
right: number;
|
|
1528
|
-
bottom: number;
|
|
1529
|
-
left: number;
|
|
1530
|
-
}>;
|
|
1531
|
-
readonly wrap: ImageWrapTarget;
|
|
1532
|
-
readonly wrapGeometry: DrawingWrapProjection | null;
|
|
1533
|
-
readonly position: DrawingPositionProjection | null;
|
|
1534
|
-
readonly anchor: Readonly<{
|
|
1535
|
-
simplePos: boolean;
|
|
1536
|
-
relativeHeight: number;
|
|
1537
|
-
behindDocument: boolean;
|
|
1538
|
-
layoutInCell: boolean;
|
|
1539
|
-
allowOverlap: boolean;
|
|
1540
|
-
}> | null;
|
|
1541
|
-
readonly picture: PictureProjection | null;
|
|
1542
|
-
readonly vectorShape: VectorShapeProjection | null;
|
|
1543
|
-
/** The picture member of a `wpg:wgp` group; `picture` stays null for a group. */
|
|
1544
|
-
readonly groupPicture: GroupPictureProjection | null;
|
|
1545
|
-
readonly textboxStory: TextboxStoryProjection | null;
|
|
1546
|
-
/** Text box members of a `wpg:wgp` group, laid out read-only; absent when none has text. */
|
|
1547
|
-
readonly groupTextboxes?: readonly GroupTextboxProjection[];
|
|
1548
|
-
/** Read-only preview of the supported native VML subset; the canonical XML is untouched. */
|
|
1549
|
-
readonly legacyGraphic?: LegacyGraphicProjection;
|
|
1550
|
-
/** Floating VML text art (a text watermark), fitted to the box by layout. */
|
|
1551
|
-
readonly textArt?: LegacyTextArtProjection;
|
|
1552
|
-
readonly locks: DrawingLocks;
|
|
1553
|
-
readonly effects: DrawingImageEffects;
|
|
1554
|
-
readonly compatibilityBranchNodeId: string | null;
|
|
1555
|
-
readonly diagnostics: readonly DrawingDiagnostic[];
|
|
1556
|
-
/** Layout-only wrap area of an MC payload that cannot paint (`wrapFootprintProjection`). */
|
|
1557
|
-
readonly footprintOnly?: true;
|
|
1863
|
+
|
|
1864
|
+
/** Only generated, escaped SVG and relationship slots; never authored markup. */
|
|
1865
|
+
type LegacyGraphicFragment = string | Readonly<{
|
|
1866
|
+
relationshipId: string;
|
|
1867
|
+
before: string;
|
|
1868
|
+
after: string;
|
|
1869
|
+
nativeCrop?: SourceCrop;
|
|
1870
|
+
}>;
|
|
1871
|
+
interface LegacyGraphicProjection {
|
|
1872
|
+
readonly width: number;
|
|
1873
|
+
readonly height: number;
|
|
1874
|
+
readonly fragments: readonly LegacyGraphicFragment[];
|
|
1875
|
+
/**
|
|
1876
|
+
* The relationship of the one uncropped picture that fills the whole graphic, when that is
|
|
1877
|
+
* all it paints. The graphic then resolves to that picture, which every output can paint.
|
|
1878
|
+
*/
|
|
1879
|
+
readonly soleImageRelationshipId?: string;
|
|
1558
1880
|
}
|
|
1559
|
-
|
|
1881
|
+
|
|
1882
|
+
/** Picture color adjustments shared by projection, layout, and paint.
|
|
1883
|
+
* @public
|
|
1884
|
+
*/
|
|
1885
|
+
interface DrawingImageEffects {
|
|
1886
|
+
/** Fixed alpha multiplier for raster painting; omitted means opaque. */
|
|
1887
|
+
readonly opacity?: number;
|
|
1888
|
+
readonly grayscale: boolean;
|
|
1889
|
+
readonly brightness: number;
|
|
1890
|
+
readonly contrast: number;
|
|
1891
|
+
readonly bilevel?: number;
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
/** The relationship namespace `r:id` lives in. */
|
|
1895
|
+
declare const OFFICE_RELATIONSHIP_NAMESPACE_URI = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
1896
|
+
/** The `Type` a hyperlink relationship declares. */
|
|
1897
|
+
declare const HYPERLINK_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink";
|
|
1898
|
+
/**
|
|
1899
|
+
* What a part's relationships answer for one `r:id`: the authored target and whether the
|
|
1900
|
+
* package declared it external. `null` for an id the part does not declare — a DANGLING
|
|
1901
|
+
* relationship, which is a real thing in real documents.
|
|
1902
|
+
*/
|
|
1903
|
+
type RelationshipTargetResolver = (relationshipId: string) => {
|
|
1904
|
+
readonly target: string;
|
|
1905
|
+
readonly external: boolean;
|
|
1560
1906
|
/**
|
|
1561
|
-
* The
|
|
1562
|
-
*
|
|
1907
|
+
* The PACKAGE's own verdict on this target (`validateExternalTarget`): whether it is an
|
|
1908
|
+
* absolute URI with a safe scheme.
|
|
1909
|
+
*
|
|
1910
|
+
* Carried separately because `sanitizeHref` cannot answer it. That function is a SCHEME
|
|
1911
|
+
* allowlist and deliberately admits relative URLs — the right rule for a value the host
|
|
1912
|
+
* authored, and the wrong one for a value a `.docx` did. A file-supplied
|
|
1913
|
+
* `Target="/admin/delete-account"` has no scheme to refuse, so it would pass the
|
|
1914
|
+
* allowlist and resolve against the EMBEDDING APPLICATION'S origin: a link reading
|
|
1915
|
+
* "Company policy" that issues an authenticated same-origin request to whatever host
|
|
1916
|
+
* app the editor is mounted in. Absent, a target is treated as unverified.
|
|
1563
1917
|
*/
|
|
1564
|
-
readonly
|
|
1565
|
-
|
|
1566
|
-
|
|
1918
|
+
readonly sinkSafe?: boolean;
|
|
1919
|
+
} | null;
|
|
1920
|
+
/**
|
|
1921
|
+
* What a hyperlink points at, which decides what activating it may do.
|
|
1922
|
+
*
|
|
1923
|
+
* The security-relevant split: an `external` link goes through `sanitizeHref` and opens only on
|
|
1924
|
+
* explicit user action, while an anchor merely scrolls and never navigates.
|
|
1925
|
+
*/
|
|
1926
|
+
type HyperlinkKind =
|
|
1927
|
+
/** `r:id` → a relationship with `TargetMode="External"`. Opens somewhere else. */
|
|
1928
|
+
'external'
|
|
1929
|
+
/** `w:anchor` → a bookmark in this document. Scrolls, never navigates. */
|
|
1930
|
+
| 'internal'
|
|
1931
|
+
/**
|
|
1932
|
+
* `r:id` naming a relationship the part does not declare, or one that is not external.
|
|
1933
|
+
*
|
|
1934
|
+
* The link keeps its runs — the text is never lost twice — but there is nothing to
|
|
1935
|
+
* activate, so it paints inert exactly like a refused scheme.
|
|
1936
|
+
*/
|
|
1937
|
+
| 'unresolved';
|
|
1938
|
+
/** A resolved hyperlink: its kind, its target, and the tooltip Word shows on hover. */
|
|
1939
|
+
interface HyperlinkTarget {
|
|
1940
|
+
readonly kind: HyperlinkKind;
|
|
1941
|
+
/**
|
|
1942
|
+
* The authored target, verbatim: the relationship's `Target` for an `r:id` link, the
|
|
1943
|
+
* anchor name for an internal one. Save re-emits from the tree, never from this — it is
|
|
1944
|
+
* here so a UI can show what the document actually says.
|
|
1945
|
+
*/
|
|
1946
|
+
readonly authored: string;
|
|
1947
|
+
/**
|
|
1948
|
+
* The sanitized runtime projection, or `null` when there is nothing safe to navigate to.
|
|
1949
|
+
* The ONLY value permitted in a DOM `href`, `window.open`, or a copied link.
|
|
1950
|
+
*/
|
|
1951
|
+
readonly href: string | null;
|
|
1952
|
+
/** `w:anchor`, for an internal link. */
|
|
1953
|
+
readonly anchor?: string;
|
|
1954
|
+
/** `w:tooltip` — Word's hover text; paint puts it on the anchor's `title`. */
|
|
1955
|
+
readonly tooltip?: string;
|
|
1956
|
+
/** The authored `r:id`, so an edit can rewrite the relationship it names. */
|
|
1957
|
+
readonly relationshipId?: string;
|
|
1567
1958
|
}
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1959
|
+
/** Whether a node is a typed `w:hyperlink`. */
|
|
1960
|
+
declare function isHyperlinkNode(node: OoxmlNode): boolean;
|
|
1961
|
+
/** A typed hyperlink's `w:anchor`, or undefined. */
|
|
1962
|
+
declare function hyperlinkAnchorOf(link: OoxmlNode): string | undefined;
|
|
1963
|
+
/** A typed hyperlink's `r:id`, or undefined. */
|
|
1964
|
+
declare function hyperlinkRelationshipIdOf(link: OoxmlNode): string | undefined;
|
|
1965
|
+
/**
|
|
1966
|
+
* Read a typed `w:hyperlink` into its target record.
|
|
1967
|
+
*
|
|
1968
|
+
* `r:id` wins over `w:anchor` when a link carries both, matching Word: the relationship
|
|
1969
|
+
* names the document and the anchor names a place inside it, so the pair is a link to a
|
|
1970
|
+
* bookmark in ANOTHER file — which this engine will not follow, but whose external half is
|
|
1971
|
+
* the part that decides where it points.
|
|
1972
|
+
*
|
|
1973
|
+
* A link with neither is `unresolved`: it paints its runs and does nothing.
|
|
1974
|
+
*/
|
|
1975
|
+
declare function hyperlinkTargetOf(link: OoxmlNode, resolve: RelationshipTargetResolver): HyperlinkTarget;
|
|
1976
|
+
|
|
1977
|
+
interface DrawingProjectionLimits {
|
|
1978
|
+
readonly maxCompatibilityBranches: number;
|
|
1979
|
+
readonly maxVisitedElements: number;
|
|
1980
|
+
readonly maxDrawingDepth: number;
|
|
1583
1981
|
}
|
|
1584
|
-
interface
|
|
1585
|
-
readonly
|
|
1586
|
-
readonly
|
|
1587
|
-
readonly
|
|
1982
|
+
interface DrawingDiagnostic {
|
|
1983
|
+
readonly code: 'malformed-drawing' | 'unsupported-graphic' | 'unresolvable-frame' | 'invalid-geometry' | 'resource-refused' | 'wrap-polygon-over-limit' | 'wrap-polygon-malformed';
|
|
1984
|
+
readonly nodeId: string;
|
|
1985
|
+
readonly detail: string | null;
|
|
1986
|
+
}
|
|
1987
|
+
/** @internal */
|
|
1988
|
+
declare function isElement(node: OoxmlNode): node is OoxmlElement;
|
|
1989
|
+
|
|
1990
|
+
/** One picture painted as a member of a drawing group. */
|
|
1991
|
+
interface GroupPictureProjection {
|
|
1992
|
+
readonly embeddedRelationshipId: string | null;
|
|
1993
|
+
readonly linkedRelationshipId: string | null;
|
|
1994
|
+
readonly crop: Readonly<{
|
|
1995
|
+
left: number;
|
|
1588
1996
|
top: number;
|
|
1589
1997
|
right: number;
|
|
1590
1998
|
bottom: number;
|
|
1591
|
-
left: number;
|
|
1592
1999
|
}>;
|
|
1593
|
-
|
|
2000
|
+
/** The picture's rectangle inside the drawing extent, in extent EMU. */
|
|
2001
|
+
readonly frameEmu: Readonly<{
|
|
2002
|
+
x: number;
|
|
2003
|
+
y: number;
|
|
2004
|
+
cx: number;
|
|
2005
|
+
cy: number;
|
|
2006
|
+
}>;
|
|
2007
|
+
/** Canonical node id of the `pic:pic` member. The vector projection skips it. */
|
|
2008
|
+
readonly memberNodeId: string;
|
|
2009
|
+
/**
|
|
2010
|
+
* Whether the group is the chosen branch of a run-level `mc:AlternateContent`. Layout then
|
|
2011
|
+
* drops the whole group when the picture resource fails, as the projection drops other
|
|
2012
|
+
* MC payloads it cannot draw.
|
|
2013
|
+
*/
|
|
2014
|
+
readonly alternateContent: boolean;
|
|
2015
|
+
/** The ring that clips the picture, in the unit square of the extent; absent for a box. */
|
|
2016
|
+
readonly clipUnit?: readonly Readonly<{
|
|
1594
2017
|
x: number;
|
|
1595
2018
|
y: number;
|
|
1596
2019
|
}>[];
|
|
1597
2020
|
}
|
|
1598
|
-
interface PictureProjection {
|
|
1599
|
-
readonly embeddedRelationshipId: string | null;
|
|
1600
|
-
readonly linkedRelationshipId: string | null;
|
|
1601
|
-
readonly crop: SourceCrop;
|
|
1602
|
-
readonly fillMode: 'stretch' | 'tile';
|
|
1603
|
-
readonly transform: DrawingTransform;
|
|
1604
|
-
readonly presetGeometry: string | null;
|
|
1605
|
-
}
|
|
1606
|
-
/**
|
|
1607
|
-
* Project one `w:drawing` into the resolved shape layout and chrome read.
|
|
1608
|
-
*
|
|
1609
|
-
* Bounded throughout: extents, crops and nesting all come from a file. Returns a projection that
|
|
1610
|
-
* reports `hidden` and its locks rather than throwing, so an unusable drawing degrades to
|
|
1611
|
-
* something the surface can skip.
|
|
1612
|
-
*/
|
|
1613
|
-
declare function projectDrawing(drawing: OoxmlDrawingNode, context: Readonly<{
|
|
1614
|
-
ownerPartName: string;
|
|
1615
|
-
supportedMcRequires: ReadonlySet<string>;
|
|
1616
|
-
limits: DrawingProjectionLimits;
|
|
1617
|
-
namespaceScope?: ReadonlyMap<string, string>;
|
|
1618
|
-
resolveRelationship?: RelationshipTargetResolver;
|
|
1619
|
-
resolveSchemeColor?: ShapeSchemeColorResolver;
|
|
1620
|
-
resolveStyleMatrixReference?: ShapeStyleMatrixResolver;
|
|
1621
|
-
}>): DrawingProjection | null;
|
|
1622
2021
|
|
|
1623
|
-
/**
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
readonly
|
|
2022
|
+
/** @internal */
|
|
2023
|
+
declare const DIAGRAM_NAMESPACE_URI = "http://schemas.openxmlformats.org/drawingml/2006/diagram";
|
|
2024
|
+
/** The parts one diagram drawing renders from. @internal */
|
|
2025
|
+
interface DiagramParts {
|
|
2026
|
+
/** The data model root (`dgm:dataModel`): background and outline of the whole diagram. */
|
|
2027
|
+
readonly dataModel: OoxmlElement;
|
|
2028
|
+
/** The saved drawing root (`dsp:drawing`), or null when the package has none. */
|
|
2029
|
+
readonly drawing: OoxmlElement | null;
|
|
2030
|
+
/** Canonical name of the saved drawing part, for diagnostics and cache keys. */
|
|
2031
|
+
readonly drawingPartName: string | null;
|
|
2032
|
+
/** Canonical name of the data model part. */
|
|
2033
|
+
readonly dataPartName: string;
|
|
2034
|
+
/** The layout definition root (`dgm:layoutDef`), or null. */
|
|
2035
|
+
readonly layoutDef: OoxmlElement | null;
|
|
2036
|
+
/** The quick style root (`dgm:styleDef`), or null. */
|
|
2037
|
+
readonly styleDef: OoxmlElement | null;
|
|
2038
|
+
/** The colours root (`dgm:colorsDef`), or null. */
|
|
2039
|
+
readonly colorsDef: OoxmlElement | null;
|
|
2040
|
+
/** The theme's body (minor) Latin font, which diagram text uses unless it names one. */
|
|
2041
|
+
readonly fontFamily: string;
|
|
1629
2042
|
}
|
|
1630
|
-
|
|
1631
2043
|
/**
|
|
1632
|
-
*
|
|
2044
|
+
* Resolves the parts behind one `dgm:relIds` element of the owner story part. The same
|
|
2045
|
+
* resolver answers the chart part behind a `c:chart` element through `chart`, so the drawing
|
|
2046
|
+
* projection threads one resolver for every part-backed graphic.
|
|
1633
2047
|
*
|
|
1634
|
-
*
|
|
1635
|
-
* zero, a negative or `NaN` clamps into `(0, ceiling]` rather than turning the limit off. These
|
|
1636
|
-
* are security ceilings, not performance budgets.
|
|
1637
|
-
*/
|
|
1638
|
-
interface ResourceLimits {
|
|
1639
|
-
/** Max nested-structure recursion (tables/shapes/SDT/groups). */
|
|
1640
|
-
readonly maxRecursionDepth: number;
|
|
1641
|
-
/** Max total parsed element count. */
|
|
1642
|
-
readonly maxElementCount: number;
|
|
1643
|
-
/** Max package part count. */
|
|
1644
|
-
readonly maxPartCount: number;
|
|
1645
|
-
/** Max total decompressed bytes (zip-bomb guard). */
|
|
1646
|
-
readonly maxDecompressedBytes: number;
|
|
1647
|
-
/** Max total compressed input bytes. */
|
|
1648
|
-
readonly maxCompressedBytes: number;
|
|
1649
|
-
/** Max decompressed:compressed ratio per entry. */
|
|
1650
|
-
readonly maxCompressionRatio: number;
|
|
1651
|
-
/** In-memory chunk budget for streaming/spooling. */
|
|
1652
|
-
readonly maxChunkBytes: number;
|
|
1653
|
-
/** Max pagination passes before non-convergence is declared. */
|
|
1654
|
-
readonly maxPaginationPasses: number;
|
|
1655
|
-
/** Max queued items in any bounded work queue. */
|
|
1656
|
-
readonly maxQueueDepth: number;
|
|
1657
|
-
}
|
|
1658
|
-
/** Non-disableable hard ceilings: no resolved limit may exceed these. */
|
|
1659
|
-
declare const HARD_CEILINGS: ResourceLimits;
|
|
1660
|
-
/** Finite defaults, all <= their hard ceiling. */
|
|
1661
|
-
declare const DEFAULT_LIMITS: ResourceLimits;
|
|
1662
|
-
/**
|
|
1663
|
-
* Resolve caller overrides into a frozen, always-finite limit set. Each value is
|
|
1664
|
-
* `min(override>0 ? override : default, ceiling)`. Infinity/0/negative/NaN can
|
|
1665
|
-
* never disable a limit — the hard ceiling always wins.
|
|
2048
|
+
* @internal
|
|
1666
2049
|
*/
|
|
1667
|
-
|
|
1668
|
-
/**
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
readonly
|
|
1672
|
-
|
|
1673
|
-
readonly
|
|
1674
|
-
readonly maxDimension: number;
|
|
1675
|
-
readonly maxPolygonPoints: number;
|
|
1676
|
-
readonly maxExternalRedirects: number;
|
|
2050
|
+
interface DiagramPartResolver {
|
|
2051
|
+
/** The diagram parts behind one `dgm:relIds` element, or null when they do not resolve. */
|
|
2052
|
+
(relIds: OoxmlElement): DiagramParts | null;
|
|
2053
|
+
/** The chart part behind one `c:chart` element of the same story part. */
|
|
2054
|
+
readonly chart?: ChartPartResolver;
|
|
2055
|
+
/** The chartex part behind one `cx:chart` element of the same story part. */
|
|
2056
|
+
readonly chartex?: ChartexPartResolver;
|
|
1677
2057
|
}
|
|
1678
|
-
/** Image caps nothing can raise past. A caller's override clamps into these. */
|
|
1679
|
-
declare const IMAGE_RESOURCE_HARD_CEILINGS: ImageResourceLimits;
|
|
1680
|
-
/** The image caps in force when a host configures none. Conservative and finite. */
|
|
1681
|
-
declare const DEFAULT_IMAGE_RESOURCE_LIMITS: ImageResourceLimits;
|
|
1682
|
-
/** Resolve caller overrides into frozen image limits; hard ceilings cannot be raised. */
|
|
1683
|
-
declare function resolveImageResourceLimits(overrides?: Partial<ImageResourceLimits>): ImageResourceLimits;
|
|
1684
2058
|
|
|
1685
2059
|
/**
|
|
1686
|
-
*
|
|
1687
|
-
*
|
|
1688
|
-
* BMP and WebP are here for the same reason the other three are: an `<img>` decodes them
|
|
1689
|
-
* natively, so they need a signature and a structural header and nothing else. BMP is what
|
|
1690
|
-
* older documents carry; WebP is what current Word writes.
|
|
1691
|
-
*/
|
|
1692
|
-
type SupportedImageMime = 'image/png' | 'image/jpeg' | 'image/gif' | 'image/bmp' | 'image/webp';
|
|
1693
|
-
/**
|
|
1694
|
-
* Vector media painted straight from validated bytes. An `<img>` renders SVG in the
|
|
1695
|
-
* browser's secure static mode — no script, no external subresource loads — so there is
|
|
1696
|
-
* no decode step and no raster buffer sized by a file-supplied number.
|
|
1697
|
-
*/
|
|
1698
|
-
type VectorImageMime = 'image/svg+xml';
|
|
1699
|
-
/** Every mime the painter can hand to an `<img>`. */
|
|
1700
|
-
type RenderableImageMime = SupportedImageMime | VectorImageMime;
|
|
1701
|
-
/**
|
|
1702
|
-
* Media kept in the package byte-for-byte that the painter cannot hand to an `<img>`.
|
|
1703
|
-
* A decode port may rasterize it; without one it paints as a labelled placeholder.
|
|
1704
|
-
*/
|
|
1705
|
-
type PreservedImageMime = 'image/tiff' | 'image/x-emf' | 'image/x-wmf';
|
|
1706
|
-
/**
|
|
1707
|
-
* What is known about one embedded image: validated, refused, or still decoding.
|
|
1708
|
-
*
|
|
1709
|
-
* Content type is a CLAIM. Signature sniffing, structural header validation and the decode port
|
|
1710
|
-
* are authoritative, and bytes that fail them never enter public state.
|
|
1711
|
-
*/
|
|
1712
|
-
type ImageResourceState = {
|
|
1713
|
-
readonly kind: 'ready';
|
|
1714
|
-
readonly partName: string;
|
|
1715
|
-
readonly contentId: string;
|
|
1716
|
-
readonly resourceKey: string;
|
|
1717
|
-
readonly validatedHandle: ValidatedImageBytesHandle;
|
|
1718
|
-
readonly mime: RenderableImageMime;
|
|
1719
|
-
readonly pixelWidth: number;
|
|
1720
|
-
readonly pixelHeight: number;
|
|
1721
|
-
readonly dpiX: number;
|
|
1722
|
-
readonly dpiY: number;
|
|
1723
|
-
} | {
|
|
1724
|
-
readonly kind: 'unrenderable';
|
|
1725
|
-
readonly partName: string | null;
|
|
1726
|
-
readonly mime: RenderableImageMime | PreservedImageMime | 'unknown';
|
|
1727
|
-
readonly reason: 'unsupported-format' | 'non-picture-graphic' | 'signature-mismatch' | 'decode-failed' | 'resource-limit';
|
|
1728
|
-
} | {
|
|
1729
|
-
readonly kind: 'external';
|
|
1730
|
-
readonly relationshipId: string;
|
|
1731
|
-
readonly sinkSafe: boolean;
|
|
1732
|
-
} | {
|
|
1733
|
-
readonly kind: 'missing';
|
|
1734
|
-
readonly relationshipId: string;
|
|
1735
|
-
} | {
|
|
1736
|
-
readonly kind: 'pending';
|
|
1737
|
-
readonly resourceKey: string;
|
|
1738
|
-
};
|
|
1739
|
-
/**
|
|
1740
|
-
* The injected image decoder.
|
|
2060
|
+
* Whether a drawing sits in the text flow or is positioned against a frame.
|
|
1741
2061
|
*
|
|
1742
|
-
*
|
|
1743
|
-
*
|
|
2062
|
+
* The distinction that decides everything downstream: an inline drawing occupies a character
|
|
2063
|
+
* position, while an anchored one has offsets relative to a page, margin or column.
|
|
1744
2064
|
*/
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
readonly
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
readonly dispose: () => void;
|
|
1775
|
-
}
|
|
1776
|
-
/** Maximum prefix inspected for SVG root detection (exported for bounded-scan tests). */
|
|
1777
|
-
declare const MAX_SVG_SNIFF_BYTES = 512;
|
|
1778
|
-
/** A raster header that passed structural validation: its real MIME type and pixel extent. */
|
|
1779
|
-
interface ValidatedRasterHeader {
|
|
1780
|
-
readonly pixelWidth: number;
|
|
1781
|
-
readonly pixelHeight: number;
|
|
1782
|
-
/** Horizontal physical density when bounded header metadata supplies it. */
|
|
1783
|
-
readonly dpiX?: number;
|
|
1784
|
-
/** Vertical physical density when bounded header metadata supplies it. */
|
|
1785
|
-
readonly dpiY?: number;
|
|
2065
|
+
type DrawingKind = 'inline' | 'anchored';
|
|
2066
|
+
/** Nine Word wrap menu targets (inline plus eight floating modes). @public */
|
|
2067
|
+
type ImageWrapTarget = 'inline' | 'square' | 'squareLeft' | 'squareRight' | 'tight' | 'through' | 'topAndBottom' | 'behind' | 'inFront';
|
|
2068
|
+
/** Every text-wrap mode a drawing may be set to, including `inline`. */
|
|
2069
|
+
declare const IMAGE_WRAP_TARGETS: readonly ImageWrapTarget[];
|
|
2070
|
+
type DrawingWrapElement = 'none' | 'square' | 'tight' | 'through' | 'topAndBottom';
|
|
2071
|
+
type DrawingHorizontalReferenceFrame = 'character' | 'column' | 'insideMargin' | 'leftMargin' | 'margin' | 'outsideMargin' | 'page' | 'rightMargin';
|
|
2072
|
+
type DrawingVerticalReferenceFrame = 'bottomMargin' | 'insideMargin' | 'line' | 'margin' | 'outsideMargin' | 'page' | 'paragraph' | 'topMargin';
|
|
2073
|
+
/** `a:srcRect` — how much of each edge of the source image is cropped away, as fractions. */
|
|
2074
|
+
interface SourceCrop {
|
|
2075
|
+
readonly left: number;
|
|
2076
|
+
readonly top: number;
|
|
2077
|
+
readonly right: number;
|
|
2078
|
+
readonly bottom: number;
|
|
2079
|
+
}
|
|
2080
|
+
interface DrawingTransform {
|
|
2081
|
+
readonly rotationDegrees: number;
|
|
2082
|
+
readonly flipHorizontal: boolean;
|
|
2083
|
+
readonly flipVertical: boolean;
|
|
2084
|
+
/** Source `a:off` in EMU; defaults to origin when absent. */
|
|
2085
|
+
readonly offsetEmu: Readonly<{
|
|
2086
|
+
x: number;
|
|
2087
|
+
y: number;
|
|
2088
|
+
}>;
|
|
2089
|
+
/** Source `a:ext` in EMU; zero falls back to `wp:extent` at geometry time. */
|
|
2090
|
+
readonly extentEmu: Readonly<{
|
|
2091
|
+
cx: number;
|
|
2092
|
+
cy: number;
|
|
2093
|
+
}>;
|
|
1786
2094
|
}
|
|
1787
|
-
/** Bounded scan for an `<svg` document root (optional `<?xml` prolog only). */
|
|
1788
|
-
declare function hasBoundedSvgRoot(bytes: Uint8Array): boolean;
|
|
1789
|
-
/** Signature sniffing — authoritative over declared content type. */
|
|
1790
|
-
declare function sniffImageMime(bytes: Uint8Array): RenderableImageMime | PreservedImageMime | 'unknown';
|
|
1791
|
-
/** Structural PNG IHDR validation before decode. */
|
|
1792
|
-
declare function validatePngHeader(bytes: Uint8Array): ValidatedRasterHeader | null;
|
|
1793
|
-
/** Structural GIF logical screen descriptor validation before decode. */
|
|
1794
|
-
declare function validateGifHeader(bytes: Uint8Array): ValidatedRasterHeader | null;
|
|
1795
|
-
/** Bounded JPEG marker scan through the first supported SOF marker. */
|
|
1796
|
-
declare function validateJpegHeader(bytes: Uint8Array): ValidatedRasterHeader | null;
|
|
1797
2095
|
/**
|
|
1798
|
-
*
|
|
1799
|
-
* first, then `viewBox` for the missing axis or ratio, then the CSS 300x150 default.
|
|
2096
|
+
* What a drawing refuses: selection, movement, resizing, aspect change.
|
|
1800
2097
|
*
|
|
1801
|
-
*
|
|
1802
|
-
*
|
|
1803
|
-
* and an out-of-range value is clamped rather than refused.
|
|
2098
|
+
* Read and honoured rather than advisory — chrome that offered a handle the store will refuse
|
|
2099
|
+
* would promise an edit that cannot happen.
|
|
1804
2100
|
*/
|
|
1805
|
-
|
|
2101
|
+
interface DrawingLocks {
|
|
2102
|
+
readonly select: boolean;
|
|
2103
|
+
readonly move: boolean;
|
|
2104
|
+
readonly resize: boolean;
|
|
2105
|
+
readonly changeAspect: boolean;
|
|
2106
|
+
}
|
|
2107
|
+
interface DrawingLocksInput {
|
|
2108
|
+
readonly select?: boolean;
|
|
2109
|
+
readonly move?: boolean;
|
|
2110
|
+
readonly resize?: boolean;
|
|
2111
|
+
readonly changeAspect?: boolean;
|
|
2112
|
+
}
|
|
1806
2113
|
/**
|
|
1807
|
-
*
|
|
2114
|
+
* An anchored drawing's position: offsets, and the frames they are relative to.
|
|
1808
2115
|
*
|
|
1809
|
-
*
|
|
1810
|
-
*
|
|
2116
|
+
* The relative-to bases matter as much as the offsets. Writing an offset without preserving its
|
|
2117
|
+
* base re-anchors the drawing against a different reference and moves it somewhere nobody asked.
|
|
1811
2118
|
*/
|
|
1812
|
-
|
|
1813
|
-
/**
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
readonly
|
|
1818
|
-
readonly
|
|
2119
|
+
interface DrawingPositionInput {
|
|
2120
|
+
/**
|
|
2121
|
+
* `'simple'` when `@simplePos="1"`: `horizontalEmu` / `verticalEmu` are authoritative
|
|
2122
|
+
* `wp:simplePos` x/y. `'frame'` (default) uses positionH/V relative frames.
|
|
2123
|
+
*/
|
|
2124
|
+
readonly mode?: 'frame' | 'simple';
|
|
2125
|
+
readonly horizontalEmu?: number;
|
|
2126
|
+
readonly verticalEmu?: number;
|
|
2127
|
+
readonly relativeToH?: DrawingHorizontalReferenceFrame;
|
|
2128
|
+
readonly relativeToV?: DrawingVerticalReferenceFrame;
|
|
2129
|
+
}
|
|
2130
|
+
interface DrawingProjection {
|
|
2131
|
+
readonly drawingNodeId: string;
|
|
2132
|
+
readonly ownerPartName: string;
|
|
2133
|
+
readonly kind: DrawingKind;
|
|
2134
|
+
readonly relationshipId: string | null;
|
|
2135
|
+
readonly docPrId: number | null;
|
|
2136
|
+
readonly name: string;
|
|
2137
|
+
readonly title: string;
|
|
2138
|
+
readonly description: string;
|
|
2139
|
+
readonly hyperlinkHref: string | null;
|
|
2140
|
+
readonly hidden: boolean;
|
|
2141
|
+
readonly extentEmu: Readonly<{
|
|
2142
|
+
cx: number;
|
|
2143
|
+
cy: number;
|
|
2144
|
+
}>;
|
|
2145
|
+
readonly effectExtentEmu: Readonly<{
|
|
2146
|
+
top: number;
|
|
2147
|
+
right: number;
|
|
2148
|
+
bottom: number;
|
|
2149
|
+
left: number;
|
|
2150
|
+
}>;
|
|
2151
|
+
readonly inlineDistancesEmu: Readonly<{
|
|
2152
|
+
top: number;
|
|
2153
|
+
right: number;
|
|
2154
|
+
bottom: number;
|
|
2155
|
+
left: number;
|
|
2156
|
+
}>;
|
|
2157
|
+
readonly wrap: ImageWrapTarget;
|
|
2158
|
+
readonly wrapGeometry: DrawingWrapProjection | null;
|
|
2159
|
+
readonly position: DrawingPositionProjection | null;
|
|
2160
|
+
readonly anchor: Readonly<{
|
|
2161
|
+
simplePos: boolean;
|
|
2162
|
+
relativeHeight: number;
|
|
2163
|
+
behindDocument: boolean;
|
|
2164
|
+
layoutInCell: boolean;
|
|
2165
|
+
allowOverlap: boolean;
|
|
2166
|
+
}> | null;
|
|
2167
|
+
readonly picture: PictureProjection | null;
|
|
2168
|
+
readonly vectorShape: VectorShapeProjection | null;
|
|
2169
|
+
/** The picture member of a `wpg:wgp` group; `picture` stays null for a group. */
|
|
2170
|
+
readonly groupPicture: GroupPictureProjection | null;
|
|
2171
|
+
/**
|
|
2172
|
+
* The group's other picture members, in document order. Each paints above `groupPicture`
|
|
2173
|
+
* and the ones before it, and below `vectorShape`. Absent when the group has one picture.
|
|
2174
|
+
*/
|
|
2175
|
+
readonly groupPictureLayers?: readonly GroupPictureProjection[];
|
|
2176
|
+
readonly textboxStory: TextboxStoryProjection | null;
|
|
2177
|
+
/** Text box members of a `wpg:wgp` group, laid out read-only; absent when none has text. */
|
|
2178
|
+
readonly groupTextboxes?: readonly GroupTextboxProjection[];
|
|
2179
|
+
/** The title and plot types of a chart: rendered, shown by its fallback, or a placeholder. */
|
|
2180
|
+
readonly chartSummary?: DrawingChartSummary;
|
|
2181
|
+
/**
|
|
2182
|
+
* The picture saved in the `mc:Fallback` of a chart's `mc:AlternateContent`, whichever
|
|
2183
|
+
* branch the page shows, for an output that exports a chart as its saved picture. Absent
|
|
2184
|
+
* when the fallback is not a picture that paints.
|
|
2185
|
+
*/
|
|
2186
|
+
readonly chartFallbackPicture?: PictureProjection;
|
|
2187
|
+
/** Read-only preview of the supported native VML subset; the canonical XML is untouched. */
|
|
2188
|
+
readonly legacyGraphic?: LegacyGraphicProjection;
|
|
2189
|
+
/** Floating VML text art (a text watermark), fitted to the box by layout. */
|
|
2190
|
+
readonly textArt?: LegacyTextArtProjection;
|
|
2191
|
+
/** A horizontal rule; layout widens it to its line and gives it its `vectorShape`. */
|
|
2192
|
+
readonly horizontalRule?: HorizontalRuleProjection;
|
|
2193
|
+
readonly locks: DrawingLocks;
|
|
2194
|
+
readonly effects: DrawingImageEffects;
|
|
2195
|
+
readonly compatibilityBranchNodeId: string | null;
|
|
2196
|
+
readonly diagnostics: readonly DrawingDiagnostic[];
|
|
2197
|
+
/** Layout-only wrap area of an MC payload that cannot paint (`wrapFootprintProjection`). */
|
|
2198
|
+
readonly footprintOnly?: true;
|
|
2199
|
+
}
|
|
2200
|
+
interface DrawingAccessibility {
|
|
2201
|
+
/**
|
|
2202
|
+
* The record takes part in layout only, for example the wrap area of a payload that cannot
|
|
2203
|
+
* paint. Outputs must not paint, hit-test, select, link, or export it.
|
|
2204
|
+
*/
|
|
2205
|
+
readonly hidden: boolean;
|
|
2206
|
+
readonly decorative: boolean;
|
|
2207
|
+
readonly label: string | null;
|
|
2208
|
+
}
|
|
2209
|
+
interface DrawingPositionProjection {
|
|
2210
|
+
readonly simplePosition: Readonly<{
|
|
2211
|
+
xEmu: number;
|
|
2212
|
+
yEmu: number;
|
|
2213
|
+
}>;
|
|
2214
|
+
readonly horizontal: Readonly<{
|
|
2215
|
+
relativeFrom: DrawingHorizontalReferenceFrame;
|
|
2216
|
+
align: string | null;
|
|
2217
|
+
offsetEmu: number | null;
|
|
2218
|
+
}>;
|
|
2219
|
+
readonly vertical: Readonly<{
|
|
2220
|
+
relativeFrom: DrawingVerticalReferenceFrame;
|
|
2221
|
+
align: string | null;
|
|
2222
|
+
offsetEmu: number | null;
|
|
2223
|
+
}>;
|
|
2224
|
+
}
|
|
2225
|
+
interface DrawingWrapProjection {
|
|
2226
|
+
readonly element: DrawingWrapElement;
|
|
2227
|
+
readonly textSide: 'bothSides' | 'left' | 'right' | 'largest';
|
|
2228
|
+
readonly distancesEmu: Readonly<{
|
|
2229
|
+
top: number;
|
|
2230
|
+
right: number;
|
|
2231
|
+
bottom: number;
|
|
2232
|
+
left: number;
|
|
2233
|
+
}>;
|
|
2234
|
+
readonly polygon: readonly Readonly<{
|
|
2235
|
+
x: number;
|
|
2236
|
+
y: number;
|
|
2237
|
+
}>[];
|
|
2238
|
+
}
|
|
2239
|
+
interface PictureProjection {
|
|
2240
|
+
readonly embeddedRelationshipId: string | null;
|
|
2241
|
+
readonly linkedRelationshipId: string | null;
|
|
2242
|
+
readonly crop: SourceCrop;
|
|
2243
|
+
readonly fillMode: 'stretch' | 'tile';
|
|
2244
|
+
readonly transform: DrawingTransform;
|
|
2245
|
+
readonly presetGeometry: string | null;
|
|
2246
|
+
/** The clip ring of non-rectangular geometry, in the unit square of the extent. */
|
|
2247
|
+
readonly clipUnit?: readonly Readonly<{
|
|
2248
|
+
x: number;
|
|
2249
|
+
y: number;
|
|
2250
|
+
}>[];
|
|
2251
|
+
/** Effects that change how the picture itself paints: a reflection, soft edges. */
|
|
2252
|
+
readonly frameEffects?: PictureFrameEffects;
|
|
1819
2253
|
}
|
|
1820
2254
|
/**
|
|
1821
|
-
*
|
|
1822
|
-
*
|
|
1823
|
-
*
|
|
2255
|
+
* Project one `w:drawing` into the resolved shape layout and chrome read.
|
|
2256
|
+
*
|
|
2257
|
+
* Bounded throughout: extents, crops and nesting all come from a file. Returns a projection that
|
|
2258
|
+
* reports `hidden` and its locks rather than throwing, so an unusable drawing degrades to
|
|
2259
|
+
* something the surface can skip.
|
|
1824
2260
|
*/
|
|
1825
|
-
declare function
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
2261
|
+
declare function projectDrawing(drawing: OoxmlDrawingNode, context: Readonly<{
|
|
2262
|
+
ownerPartName: string;
|
|
2263
|
+
supportedMcRequires: ReadonlySet<string>;
|
|
2264
|
+
limits: DrawingProjectionLimits;
|
|
2265
|
+
namespaceScope?: ReadonlyMap<string, string>;
|
|
2266
|
+
resolveRelationship?: RelationshipTargetResolver;
|
|
2267
|
+
resolveSchemeColor?: ShapeSchemeColorResolver;
|
|
2268
|
+
resolveStyleMatrixReference?: ShapeStyleMatrixResolver;
|
|
2269
|
+
resolveDiagramParts?: DiagramPartResolver;
|
|
2270
|
+
}>): DrawingProjection | null;
|
|
1829
2271
|
|
|
1830
2272
|
/** Caps applied while loading a package: zip, XML, part count and relationship count. */
|
|
1831
2273
|
interface OoxmlPackageLimits {
|
|
@@ -2001,6 +2443,18 @@ type AutomationTableMutation = {
|
|
|
2001
2443
|
readonly kind: 'deleteRows' | 'deleteColumns';
|
|
2002
2444
|
readonly index: number;
|
|
2003
2445
|
readonly count: number;
|
|
2446
|
+
} | {
|
|
2447
|
+
/** Merge the rectangle from one cell to another, by row and in-row cell index. */
|
|
2448
|
+
readonly kind: 'mergeCells';
|
|
2449
|
+
readonly topRow: number;
|
|
2450
|
+
readonly firstCell: number;
|
|
2451
|
+
readonly bottomRow: number;
|
|
2452
|
+
readonly lastCell: number;
|
|
2453
|
+
} | {
|
|
2454
|
+
readonly kind: 'splitCell';
|
|
2455
|
+
readonly cellId: string;
|
|
2456
|
+
readonly rowCount: number;
|
|
2457
|
+
readonly columnCount: number;
|
|
2004
2458
|
} | {
|
|
2005
2459
|
readonly kind: 'delete';
|
|
2006
2460
|
} | {
|
|
@@ -2031,6 +2485,70 @@ interface SetFieldCodeOp {
|
|
|
2031
2485
|
readonly code: string;
|
|
2032
2486
|
}
|
|
2033
2487
|
|
|
2488
|
+
/**
|
|
2489
|
+
* Insert an allowlisted page-number complex field at a UTF-16 offset.
|
|
2490
|
+
*
|
|
2491
|
+
* `PAGE_X_OF_Y` is PAGE + literal " of " + NUMPAGES in one undoable op. Non-page
|
|
2492
|
+
* instructions are refused — never authored through this path.
|
|
2493
|
+
*/
|
|
2494
|
+
interface InsertPageFieldOp {
|
|
2495
|
+
readonly op: 'insertPageField';
|
|
2496
|
+
readonly paragraphId: string;
|
|
2497
|
+
readonly offset: number;
|
|
2498
|
+
readonly field: 'PAGE' | 'NUMPAGES' | 'SECTIONPAGES' | 'PAGE_X_OF_Y';
|
|
2499
|
+
/**
|
|
2500
|
+
* Write this as a TRACKED insertion, on the same terms as `insertText`.
|
|
2501
|
+
*
|
|
2502
|
+
* The whole field — every `w:fldChar`, the instruction, the `PAGE_X_OF_Y` literal —
|
|
2503
|
+
* goes into ONE `w:ins`, because the field is one proposal: rejecting it must take
|
|
2504
|
+
* the complete atom back, never leave a `begin` standing without its `end`.
|
|
2505
|
+
*/
|
|
2506
|
+
readonly revision?: RevisionAttributionInput;
|
|
2507
|
+
}
|
|
2508
|
+
/**
|
|
2509
|
+
* Insert one complex field with an empty cached result at a UTF-16 offset.
|
|
2510
|
+
*
|
|
2511
|
+
* The instruction must be one that `inertFieldInstruction` admits: a page number, a reference
|
|
2512
|
+
* to a bookmark, note, or style, a sequence number, or a date. It is written as text and never
|
|
2513
|
+
* evaluated. Every other instruction refuses with `invalidArgs`.
|
|
2514
|
+
*/
|
|
2515
|
+
interface InsertComplexFieldOp {
|
|
2516
|
+
readonly op: 'insertComplexField';
|
|
2517
|
+
readonly paragraphId: string;
|
|
2518
|
+
readonly offset: number;
|
|
2519
|
+
readonly instruction: string;
|
|
2520
|
+
/** Write the whole field as ONE tracked insertion, on the same terms as `insertText`. */
|
|
2521
|
+
readonly revision?: RevisionAttributionInput;
|
|
2522
|
+
}
|
|
2523
|
+
|
|
2524
|
+
/** Set one field's cached result text. See the module comment for the placements. */
|
|
2525
|
+
interface SetFieldResultOp {
|
|
2526
|
+
readonly op: 'setFieldResult';
|
|
2527
|
+
readonly paragraphId: string;
|
|
2528
|
+
/** The begin `w:fldChar`, or the `w:fldSimple` element. */
|
|
2529
|
+
readonly fieldNodeId: string;
|
|
2530
|
+
/** Plain text. A tab becomes `w:tab`; other control characters refuse. */
|
|
2531
|
+
readonly text: string;
|
|
2532
|
+
/**
|
|
2533
|
+
* The author whose pending insertion holds the field. The result joins that insertion. The
|
|
2534
|
+
* op mints no revision of its own.
|
|
2535
|
+
*/
|
|
2536
|
+
readonly revision?: RevisionAttributionInput;
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
/** Insert one inline `m:oMath` and the plain runs beside it. */
|
|
2540
|
+
interface InsertEquationOp {
|
|
2541
|
+
readonly op: 'insertEquation';
|
|
2542
|
+
readonly paragraphId: string;
|
|
2543
|
+
readonly offset: number;
|
|
2544
|
+
/** Plain runs and exactly one inline `m:oMath`, in order. Receive fresh ids at apply. */
|
|
2545
|
+
readonly nodes: readonly OoxmlNode[];
|
|
2546
|
+
/** Model length of `nodes`: their text, plus one for the equation. */
|
|
2547
|
+
readonly length: number;
|
|
2548
|
+
/** Write the nodes as ONE tracked insertion, on the same terms as `insertText`. */
|
|
2549
|
+
readonly revision?: RevisionAttributionInput;
|
|
2550
|
+
}
|
|
2551
|
+
|
|
2034
2552
|
type InsertTextOp = {
|
|
2035
2553
|
readonly op: 'insertText';
|
|
2036
2554
|
readonly paragraphId: string;
|
|
@@ -2857,13 +3375,25 @@ interface RevisionBatchEntry {
|
|
|
2857
3375
|
/** Why a requested decision remains pending. @public */
|
|
2858
3376
|
type RevisionBatchSkipReason = 'unsupported-revision' | 'incomplete-group' | 'retained-structure' | 'unknown-revision';
|
|
2859
3377
|
/**
|
|
2860
|
-
*
|
|
2861
|
-
*
|
|
2862
|
-
*
|
|
3378
|
+
* The structure behind a skip.
|
|
3379
|
+
*
|
|
3380
|
+
* For `unsupported-revision`: a refused site, a formatting change whose earlier properties were
|
|
3381
|
+
* not recorded so it cannot be rejected, a read-only review item, a change with no sites, a
|
|
3382
|
+
* change a content control lock keeps (`locked-content`), or a change in a data-bound content
|
|
3383
|
+
* control (`bound-content`). The last two have their own codes, `review.locked-content` and
|
|
3384
|
+
* `review.bound-content`; `reviewCodeOfSkip` reads them.
|
|
3385
|
+
*
|
|
3386
|
+
* For `incomplete-group`, the change the decision would also decide: the other half of a move or
|
|
3387
|
+
* merge (`paired-change`), a change inside content the decision removes (`removed-content`) or
|
|
3388
|
+
* inside properties a reject replaces (`replaced-properties`), a change the decision would empty
|
|
3389
|
+
* (`emptied-change`), a change that encloses the selected one (`enclosing-change`), or another
|
|
3390
|
+
* site of a group the planner keeps together (`grouped-change`).
|
|
3391
|
+
*
|
|
3392
|
+
* For `retained-structure`: a row kept for the table nested in it (`nested-table`).
|
|
2863
3393
|
*
|
|
2864
3394
|
* @public
|
|
2865
3395
|
*/
|
|
2866
|
-
type RevisionBatchSkipDetail = RevisionSiteRefusal | 'unrecorded-properties' | 'read-only' | 'no-sites';
|
|
3396
|
+
type RevisionBatchSkipDetail = RevisionSiteRefusal | 'unrecorded-properties' | 'read-only' | 'no-sites' | 'paired-change' | 'removed-content' | 'replaced-properties' | 'emptied-change' | 'enclosing-change' | 'grouped-change' | 'nested-table' | 'locked-content' | 'bound-content';
|
|
2867
3397
|
/** Outcome of one selected-set decision. Counts refer to review decisions, not XML markers. @public */
|
|
2868
3398
|
interface RevisionBatchResult {
|
|
2869
3399
|
readonly resolved: readonly RevisionBatchEntry[];
|
|
@@ -2871,16 +3401,36 @@ interface RevisionBatchResult {
|
|
|
2871
3401
|
readonly key: string;
|
|
2872
3402
|
readonly reason: RevisionBatchSkipReason;
|
|
2873
3403
|
readonly revision?: RevisionBatchEntry;
|
|
2874
|
-
/**
|
|
3404
|
+
/**
|
|
3405
|
+
* The condition or structure behind the skip, such as `locked-content` or `paired-change`.
|
|
3406
|
+
* `reviewCodeOfSkip` turns the reason and the detail into one review code.
|
|
3407
|
+
*/
|
|
2875
3408
|
readonly detail?: RevisionBatchSkipDetail;
|
|
2876
3409
|
}[];
|
|
2877
3410
|
/** All pending decisions in the addressed scope, including excluded and unsupported changes. */
|
|
2878
3411
|
readonly remaining: number;
|
|
2879
3412
|
}
|
|
2880
|
-
/**
|
|
2881
|
-
|
|
3413
|
+
/**
|
|
3414
|
+
* @internal Pure preflight; callers commit its operations through their normal write guards.
|
|
3415
|
+
*
|
|
3416
|
+
* `countRemaining: false` skips the exact count of the decisions left after the batch, and
|
|
3417
|
+
* reports `remaining` as the decisions not resolved here. The exact count resolves the whole
|
|
3418
|
+
* batch once more on a copy and lists what is left, which on a long reviewed document cost more
|
|
3419
|
+
* than the plan itself, and a caller that reads only the operations or the skipped changes
|
|
3420
|
+
* (a check, one decision, an editor that recounts its queue) paid it on every call.
|
|
3421
|
+
*/
|
|
3422
|
+
declare function planRevisionBatch(part: OoxmlPart, action: 'accept' | 'reject', keys?: readonly string[], scopeRoot?: OoxmlNode, options?: {
|
|
3423
|
+
readonly countRemaining?: boolean;
|
|
3424
|
+
/**
|
|
3425
|
+
* A decision on these changes themselves, not a filtered selection: the other half of a
|
|
3426
|
+
* selected move resolves with it, and changes inside content it removes go along.
|
|
3427
|
+
*/
|
|
3428
|
+
readonly explicit?: boolean;
|
|
3429
|
+
}): {
|
|
2882
3430
|
ops: readonly TreeDocOp[];
|
|
2883
3431
|
result: RevisionBatchResult;
|
|
3432
|
+
/** Keys of unselected changes the decision removes with their content. Explicit only. */
|
|
3433
|
+
swept?: readonly string[];
|
|
2884
3434
|
};
|
|
2885
3435
|
|
|
2886
3436
|
/** Why a requested change keeps its attribution. @public */
|
|
@@ -3787,26 +4337,7 @@ type TreeDocOp = SetFieldCodeOp | {
|
|
|
3787
4337
|
readonly offset: number;
|
|
3788
4338
|
/** Write this as a TRACKED insertion, on the same terms as `insertText`. */
|
|
3789
4339
|
readonly revision?: RevisionAttributionInput;
|
|
3790
|
-
} | {
|
|
3791
|
-
/**
|
|
3792
|
-
* Insert an allowlisted page-number complex field at a UTF-16 offset.
|
|
3793
|
-
*
|
|
3794
|
-
* `PAGE_X_OF_Y` is PAGE + literal " of " + NUMPAGES in one undoable op. Non-page
|
|
3795
|
-
* instructions are refused — never authored through this path.
|
|
3796
|
-
*/
|
|
3797
|
-
readonly op: 'insertPageField';
|
|
3798
|
-
readonly paragraphId: string;
|
|
3799
|
-
readonly offset: number;
|
|
3800
|
-
readonly field: 'PAGE' | 'NUMPAGES' | 'SECTIONPAGES' | 'PAGE_X_OF_Y';
|
|
3801
|
-
/**
|
|
3802
|
-
* Write this as a TRACKED insertion, on the same terms as `insertText`.
|
|
3803
|
-
*
|
|
3804
|
-
* The whole field — every `w:fldChar`, the instruction, the `PAGE_X_OF_Y` literal —
|
|
3805
|
-
* goes into ONE `w:ins`, because the field is one proposal: rejecting it must take
|
|
3806
|
-
* the complete atom back, never leave a `begin` standing without its `end`.
|
|
3807
|
-
*/
|
|
3808
|
-
readonly revision?: RevisionAttributionInput;
|
|
3809
|
-
} | {
|
|
4340
|
+
} | InsertPageFieldOp | InsertComplexFieldOp | SetFieldResultOp | InsertEquationOp | {
|
|
3810
4341
|
/**
|
|
3811
4342
|
* Move a numbered paragraph to another `w:numPr/w:ilvl`.
|
|
3812
4343
|
*
|
|
@@ -4095,6 +4626,8 @@ type TreeDocOp = SetFieldCodeOp | {
|
|
|
4095
4626
|
readonly xpath: string;
|
|
4096
4627
|
readonly storeItemId: string;
|
|
4097
4628
|
};
|
|
4629
|
+
/** Propose the control as a tracked `w:ins`; rejecting removes it with its text. */
|
|
4630
|
+
readonly revision?: RevisionAttributionInput;
|
|
4098
4631
|
} | {
|
|
4099
4632
|
/** Repeating-section item insert — unsupported at this layer (out of scope). */
|
|
4100
4633
|
readonly op: 'addRepeatingSectionItem';
|
|
@@ -4169,6 +4702,18 @@ type TreeDocOp = SetFieldCodeOp | {
|
|
|
4169
4702
|
readonly op: 'deleteTableColumn';
|
|
4170
4703
|
readonly tableId: string;
|
|
4171
4704
|
readonly gridColumnId: string;
|
|
4705
|
+
} | {
|
|
4706
|
+
/** Merge cells covering one rectangle into its top-left cell, content in reading order. */
|
|
4707
|
+
readonly op: 'mergeTableCells';
|
|
4708
|
+
readonly tableId: string;
|
|
4709
|
+
readonly cellIds: readonly string[];
|
|
4710
|
+
} | {
|
|
4711
|
+
/** Split one cell into `rows` by `columns` equal cells; a one-row cell adds rows. */
|
|
4712
|
+
readonly op: 'splitTableCell';
|
|
4713
|
+
readonly tableId: string;
|
|
4714
|
+
readonly cellId: string;
|
|
4715
|
+
readonly rows: number;
|
|
4716
|
+
readonly columns: number;
|
|
4172
4717
|
} | {
|
|
4173
4718
|
/**
|
|
4174
4719
|
* Resize one internal divider between two adjacent canonical grid columns.
|
|
@@ -4648,8 +5193,18 @@ type TreeOpRejection = 'unknown-op' | 'unknown-paragraph' | 'not-a-paragraph' |
|
|
|
4648
5193
|
* mapping cannot be trusted and the inserted row would not match it.
|
|
4649
5194
|
*/
|
|
4650
5195
|
| 'row-hides-cell'
|
|
4651
|
-
/**
|
|
5196
|
+
/** The table carries a legacy `w:hMerge`, which grid edits cannot place. */
|
|
4652
5197
|
| 'table-has-merge'
|
|
5198
|
+
/** The cells to merge do not cover one rectangle, or cover only one cell. */
|
|
5199
|
+
| 'cells-not-rectangle'
|
|
5200
|
+
/** A cell merged over several rows splits only into a divisor of them. */
|
|
5201
|
+
| 'split-rows-not-divisor'
|
|
5202
|
+
/** The cells hold a tracked cell insertion, deletion, or merge. */
|
|
5203
|
+
| 'cell-has-revision'
|
|
5204
|
+
/** The split cells would be narrower than the minimum column width. */
|
|
5205
|
+
| 'cell-too-narrow'
|
|
5206
|
+
/** Without `w:tblGrid`, a cell splits only into a divisor of the columns it spans. */
|
|
5207
|
+
| 'split-needs-grid'
|
|
4653
5208
|
/** The addressed grid column id is missing or ambiguous without `w:tblGrid`. */
|
|
4654
5209
|
| 'unknown-grid-column'
|
|
4655
5210
|
/** The operation would exceed bounded table topology limits. */
|
|
@@ -4660,6 +5215,8 @@ type TreeOpRejection = 'unknown-op' | 'unknown-paragraph' | 'not-a-paragraph' |
|
|
|
4660
5215
|
| 'unknown-drawing'
|
|
4661
5216
|
/** The drawing's graphic payload is not a supported picture. */
|
|
4662
5217
|
| 'not-a-picture-drawing'
|
|
5218
|
+
/** A chart in any state: only a delete applies, and it removes the whole chart. */
|
|
5219
|
+
| 'chart-drawing'
|
|
4663
5220
|
/** A lock flag or `@locked` forbids this mutation. */
|
|
4664
5221
|
| 'drawing-locked'
|
|
4665
5222
|
/** Finite EMU extent, crop, or position value is out of range. */
|
|
@@ -4687,5 +5244,5 @@ type TreeOpResult = {
|
|
|
4687
5244
|
readonly detail?: string;
|
|
4688
5245
|
};
|
|
4689
5246
|
|
|
4690
|
-
export {
|
|
4691
|
-
export type {
|
|
5247
|
+
export { DEFAULT_ZIP_LIMITS as b$, DEFAULT_IMAGE_RESOURCE_LIMITS as b6, IMAGE_WRAP_TARGETS as b7, TEXT_FORM_FORMATS as b8, resolveImageResourceLimits as b9, CHART_GRAPHIC_DATA_URI as bA, CHART_NAMESPACE_URI as bB, CHART_STYLE_NAMESPACE_URI as bC, CONTENT_CONTROL_ID_MAX as bD, CONTENT_CONTROL_PROPERTY_ORDER as bE, DEFAULT_LIMITS as bZ, DEFAULT_OOXML_PACKAGE_LIMITS as b_, resolveSvgIntrinsicSize as ba, sniffImageMime as bb, validateRasterHeader as bc, ACCEPTED_PARAGRAPH_PROPERTIES as bv, ACCEPTED_RUN_PROPERTIES as bw, CHARTEX_GRAPHIC_DATA_URI as by, CHARTEX_NAMESPACE_URI as bz, DIAGRAM_NAMESPACE_URI as c0, DRAWINGML_MAIN_NAMESPACE_URI as c1, HARD_CEILINGS as c7, HYPERLINK_RELATIONSHIP_TYPE as c8, IMAGE_RELATIONSHIP_TYPE as cb, IMAGE_RESOURCE_HARD_CEILINGS as cc, MAX_CONTENT_CONTROLS_PER_PART as cn, MAX_CONTENT_CONTROL_NESTING as co, MAX_SVG_SNIFF_BYTES as cp, OFFICE_RELATIONSHIP_NAMESPACE_URI as cs, OOXML_NODE_IDENTITY_RULES as ct, hasBoundedSvgRoot as d$, allocateContentControlId as dC, asciiFold as dD, buildContentTypeIndex as dE, buildRelationshipSet as dF, childElements as dG, commentAnchorsOfStory as dH, commentsOfPart as dI, contentControlContentChildren as dJ, contentControlContentNodeOf as dK, contentControlEndPropertiesNodeOf as dL, contentControlLevelOf as dM, contentControlPropertiesNodeOf as dN, contentControlPropertiesOf as dO, contentControlTextOf as dP, contentControlsIn as dQ, createImageResourceCache as dR, detectDuplicateNames as dS, directFill as dT, enclosedBookmarkDeletions as dU, extensionKey as dV, findContentControl as dW, findElement as dX, firstReviewRange as dY, flattenContentControls as dZ, hasAnyComment as d_, TABLE_BORDER_STYLES as dg, W15_NAMESPACE_URI as dr, WML_NAMESPACE_URI as ds, XMLNS_NAMESPACE_URI as dt, XML_NAMESPACE_URI as du, hyperlinkAnchorOf as e0, hyperlinkRelationshipIdOf as e1, hyperlinkTargetOf as e2, imageResourceLookupFor as e3, isContentControlContentNode as e4, isContentControlNode as e5, isContentControlWrapper as e6, isContentRevisionKind as e7, isElement as e8, isHyperlinkNode as e9, reviewItemRanges as eA, textContent as eB, textFormFieldsOf as eC, threadStateOfPart as eD, validateExternalTarget as eE, validateGifHeader as eF, validateJpegHeader as eG, validatePngHeader as eH, withPart as eI, withoutBookmarkInPart as eJ, writeOoxmlPackage as eK, writeZip as eL, activeReviewItem as eQ, reviewItemPositionRank as eR, reviewItemsAt as eS, reviewThreadRootOf as eT, isRangeMarkerKind as ea, isValidMime as eb, legacyCheckboxFieldsOf as ec, liveDrawingReferenceCount as ed, lockForbidsEdit as ee, lockForbidsRemoval as ef, normalizePartName as eg, orderedContentControlProperties as eh, parseContentControlId as ei, partNameKey as ej, planRevisionAuthorChange as ek, planRevisionBatch as el, projectDrawing as em, readOnOffChild as en, readOoxmlPackage as eo, readOoxmlPart as ep, readXml as eq, readZip as er, resolveColorNode as es, resolveContentControlLock as et, resolveContentType as eu, resolveImageRelationship as ev, resolveInternalTarget as ew, resolveLimits as ex, resolveRelationship as ey, reviewItemKey as ez };
|
|
5248
|
+
export type { Table as $, ParagraphDisagreements as A, Block as B, CommentRecord as C, DocxDocument as D, ExecResult as E, ParagraphFlags as F, ParagraphTabStop as G, HeaderFooterSet as H, InsertableContentControlType as I, RevisionAuthorEntry as J, RevisionAuthorResult as K, RevisionAuthorSkipReason as L, RevisionBatchEntry as M, NumberingRef as N, OoxmlPart as O, PageMargins as P, RevisionBatchResult as Q, ReviewModelInput as R, StyleDefinitions as S, RevisionBatchSkipDetail as T, RevisionBatchSkipReason as U, RevisionSiteRefusal as V, RevisionType as W, Run as X, Section as Y, SectionProperties as Z, StyleDefinition as _, ReviewItem as a, DrawingImageEffects as a$, TableCell as a0, TableRow as a1, Theme as a2, ThemeColorScheme as a3, OoxmlNode as a4, OoxmlPackage as a5, DocxDocumentJSON as a6, DrawingHorizontalReferenceFrame as a7, DrawingKind as a8, DrawingLocks as a9, OoxmlPackageRejection as aA, AutomationTableMutation as aB, OoxmlProperty as aC, OoxmlPackageResult as aD, RevisionAttributionInput as aE, TreeOpRejection as aF, OoxmlNodeId as aG, PackageWatermarkWrite as aH, OoxmlInvariantIssue as aI, DrawingTreeDocOp as aJ, ImpactClass as aK, OoxmlParagraphNode as aL, OoxmlNoteNode as aM, OoxmlContinuationSeparatorNode as aN, OoxmlEndnotesNode as aO, OoxmlFootnotesNode as aP, OoxmlNoteRefNode as aQ, OoxmlNoteReferenceNode as aR, OoxmlSeparatorNode as aS, SourceCrop as aT, TextFormFieldRange as aU, TextFormFieldOptions as aV, DrawingTransform as aW, TableBorderStyle as aX, TextboxOutlineProjection as aY, VectorShapeComponent as aZ, DrawingAccessibility as a_, DrawingPositionInput as aa, DrawingVerticalReferenceFrame as ab, FontDefinition as ac, ImageDecodePort as ad, ImageResourceLimits as ae, ImageResourceState as af, ImageWrapTarget as ag, ParagraphFormatCommand as ah, Point as ai, PreservedImageMime as aj, Rect as ak, RenderableImageMime as al, SelectionPin as am, SupportedImageMime as an, Unsubscribe as ao, ValidatedImageBytesHandle as ap, VectorImageMime as aq, Watermark as ar, WatermarkLayout as as, WatermarkState as at, TreeDocOp as au, OoxmlElement as av, OoxmlContentControlNode as aw, OoxmlGenericElementNode as ax, OoxmlContentControlContentNode as ay, OoxmlPackageLimits as az, ReviewRevisionItem as b, DrawingChartSummary as b0, VectorShapeProjection as b1, PictureFrameEffects as b2, DrawingProjection as b3, OoxmlDrawingNode as b4, TreeDocColorValue as b5, ChartPart as bF, ChartThemeFaces as bG, ChartexPart as bH, CommentAnchor as bI, CommentPosition as bJ, CommitTextFormFieldOp as bK, ContentControlCheckbox as bL, ContentControlCheckboxState as bM, ContentControlDataBinding as bN, ContentControlDateFormat as bO, ContentControlEntry as bP, ContentControlKind as bQ, ContentControlLevel as bR, ContentControlListItem as bS, ContentControlLock as bT, ContentControlProperties as bU, ContentTypeError as bV, ContentTypeIndex as bW, ContentTypeRecords as bX, CreateImageResourceCacheOptions as bY, OoxmlAttribute as bd, OoxmlInvariantResult as be, LegacyTextArtProjection as bf, ChartPartResolver as bg, ChartexPartResolver as bh, ShapeSchemeColorResolver as bi, ShapeEffectList as bj, GroupTextboxProjection as bk, MetafileImageMime as bl, OoxmlFldCharNode as bm, OoxmlFldSimpleNode as bn, OoxmlInstrTextNode as bo, TreeOpResult as bp, RelationshipRecord as bq, OoxmlHardBreakNode as br, ShapeColor as bs, ResourceLimits as bt, CommentThreadState as bu, BookmarkOpPosition as bx, ReviewCommentItem as c, OoxmlTabNode as c$, DefaultRecord as c2, DeleteBookmarkOp as c3, DeleteTextOp as c4, DiagramPartResolver as c5, DiagramParts as c6, HyperlinkKind as c9, OoxmlContentControlCheckedStateNode as cA, OoxmlContentControlComboBoxNode as cB, OoxmlContentControlDataBindingNode as cC, OoxmlContentControlDateFormatNode as cD, OoxmlContentControlDateNode as cE, OoxmlContentControlDropDownListNode as cF, OoxmlContentControlEndPropertiesNode as cG, OoxmlContentControlLidNode as cH, OoxmlContentControlListItemNode as cI, OoxmlContentControlPropertiesNode as cJ, OoxmlContentControlStoreMappedDataAsNode as cK, OoxmlContentControlTextNode as cL, OoxmlContentControlUncheckedStateNode as cM, OoxmlDocumentNode as cN, OoxmlExternalTarget as cO, OoxmlGenericExtensionAttribute as cP, OoxmlHyperlinkNode as cQ, OoxmlInvariantIssueCode as cR, OoxmlKnownNodeAttribute as cS, OoxmlNamespaceBinding as cT, OoxmlNodeIdentityRules as cU, OoxmlParagraphPropertiesNode as cV, OoxmlPartMetadata as cW, OoxmlReadRejection as cX, OoxmlReadResult as cY, OoxmlRunNode as cZ, OoxmlRunPropertiesNode as c_, HyperlinkTarget as ca, ImageRelationshipResolution as cd, ImageResourceLookup as ce, IndexResult as cf, InsertBookmarkOp as cg, InsertBuildingBlockOp as ch, InsertComplexFieldOp as ci, InsertEquationOp as cj, InsertPageFieldOp as ck, InsertTextOp as cl, LegacyCheckboxFieldRange as cm, NameRejection as cq, NameResult as cr, OoxmlBodyNode as cu, OoxmlBookmarkEndNode as cv, OoxmlBookmarkStartNode as cw, OoxmlContentControlCalendarNode as cx, OoxmlContentControlCheckboxNode as cy, OoxmlContentControlCheckedNode as cz, ReviewCustomItem as d, OoxmlTextElementNode as d0, OoxmlTextNode as d1, OoxmlWmlValAttribute as d2, OoxmlXmlSpaceAttribute as d3, OverrideRecord as d4, RelationshipError as d5, RelationshipSetResult as d6, RelationshipTargetResolver as d7, ResolveResult as d8, ResolvedRelationship as d9, ZipReadResult as dA, ZipRejection as dB, SetFieldResultOp as da, SetLegacyCheckboxOp as db, SetLegacyDropdownOp as dc, SetTextFormFieldDefaultOp as dd, ShapeReflection as de, ShapeShadow as df, TabStopWrite as dh, TargetMode as di, TextFormFieldType as dj, TextboxStoryProjection as dk, TreeDocOpKind as dl, TreeOpEffect as dm, ValidatedRasterHeader as dn, VectorGradient as dp, VectorPattern as dq, XmlLimits as dv, XmlNode as dw, XmlRejection as dx, XmlResult as dy, ZipLimits as dz, ReviewPosition as e, AffineMatrix as eM, DrawingChartPlotType as eN, DrawingChartShownAs as eO, GradientStop as eP, 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, Paragraph as z };
|