@betteroffice/docx 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/chunk-GGEGIQRK.mjs +1 -0
  2. package/dist/chunk-J7LNO6SM.mjs +1 -0
  3. package/dist/chunk-WON6K4FY.mjs +1 -0
  4. package/dist/chunk-Y7RUNRU2.mjs +1 -0
  5. package/dist/collaboration/index.d.mts +5 -4
  6. package/dist/core.d.mts +3 -3
  7. package/dist/{displayListQueries-UGc_XBUv.d.mts → displayListQueries-BJlo7Jkz.d.mts} +24 -6
  8. package/dist/docx/index.d.mts +1 -1
  9. package/dist/editor/index.d.mts +5 -4
  10. package/dist/{rustDisplayList-CX78djsZ.d.mts → frameDelta-D965X8yK.d.mts} +2 -273
  11. package/dist/generated/edit/docx_edit_bg.wasm +0 -0
  12. package/dist/generated/layout/docx_layout_bg.wasm +0 -0
  13. package/dist/generated/parse/docx_parse_bg.wasm +0 -0
  14. package/dist/{index-Bwxm3oiC.d.mts → index-Dx4Z3lkz.d.mts} +83 -7
  15. package/dist/layout/index.d.mts +5 -4
  16. package/dist/layout/index.mjs +1 -1
  17. package/dist/layout/pagination/index.d.mts +3 -3
  18. package/dist/layout/render/index.d.mts +8 -7
  19. package/dist/layout/render/index.mjs +1 -1
  20. package/dist/plugin-api/RenderedDomContext.d.mts +5 -4
  21. package/dist/plugin-api/index.d.mts +1 -1
  22. package/dist/plugin-api/resolveItemPositions.d.mts +1 -1
  23. package/dist/rustDisplayList-BRuZBqdL.d.mts +278 -0
  24. package/dist/types/content.d.mts +1 -1
  25. package/dist/types/document.d.mts +2 -2
  26. package/dist/{types-DMkDbvEu.d.mts → types-BfqUl2h_.d.mts} +1 -1
  27. package/dist/utils/comments.d.mts +1 -1
  28. package/dist/utils/index.d.mts +1 -1
  29. package/dist/wasm-DO3BUV7C.mjs +1 -0
  30. package/dist/wasm-NWXX4H5G.mjs +1 -0
  31. package/dist/wasm-edit.d.mts +1 -0
  32. package/dist/wasm-edit.mjs +1 -1
  33. package/dist/wasm-layout.d.mts +10 -1
  34. package/dist/wasm-layout.mjs +1 -1
  35. package/dist/yrs/index.d.mts +4 -3
  36. package/dist/yrs/index.mjs +1 -1
  37. package/dist/yrs/residentEngineWorker.mjs +1 -1
  38. package/package.json +1 -1
  39. package/dist/chunk-6NEKRDXF.mjs +0 -1
  40. package/dist/chunk-CIRN3LZA.mjs +0 -1
  41. package/dist/chunk-NTQM4EYN.mjs +0 -1
  42. package/dist/wasm-BGQBTR2J.mjs +0 -1
  43. package/dist/wasm-SA237OSP.mjs +0 -1
  44. package/dist/{content-DLFHRQav.d.mts → content-MOZ6hKP4.d.mts} +349 -349
@@ -124,6 +124,204 @@ type PresetGeometryPathCommand = {
124
124
  type: 'close';
125
125
  };
126
126
 
127
+ /**
128
+ * Embedded images (`w:drawing` → `pic:pic`): size, wrap, position,
129
+ * transform, padding, crop.
130
+ */
131
+
132
+ /** One point in a `wp:wrapPolygon`, in the drawing's authored coordinates. */
133
+ interface ImageWrapPoint {
134
+ x?: number;
135
+ y?: number;
136
+ }
137
+ /**
138
+ * Image size specification
139
+ */
140
+ interface ImageSize {
141
+ /** Width in EMUs (English Metric Units) */
142
+ width: number;
143
+ /** Height in EMUs */
144
+ height: number;
145
+ }
146
+ /**
147
+ * Image wrap type for floating images
148
+ */
149
+ interface ImageWrap {
150
+ type: WrapType;
151
+ /** Wrap text direction */
152
+ wrapText?: 'bothSides' | 'left' | 'right' | 'largest';
153
+ /** Distance from text */
154
+ distT?: number;
155
+ distB?: number;
156
+ distL?: number;
157
+ distR?: number;
158
+ /** Tight/through contour. Undefined = rectangular wrap. */
159
+ polygon?: ImageWrapPoint[];
160
+ }
161
+ /**
162
+ * Position for floating images
163
+ */
164
+ interface ImagePosition {
165
+ /** Use `wp:simplePos` instead of positionH/V. Undefined = false. */
166
+ useSimplePos?: boolean;
167
+ /** `wp:simplePos` coordinates in EMUs. */
168
+ simplePos?: {
169
+ x?: number;
170
+ y?: number;
171
+ };
172
+ /** Stable z-order (`wp:anchor/@relativeHeight`). Undefined = source order. */
173
+ relativeHeight?: number;
174
+ /** Behind-text plane (`wp:anchor/@behindDoc`). Undefined = false. */
175
+ behindDoc?: boolean;
176
+ /** Hidden drawing. Undefined = visible. */
177
+ hidden?: boolean;
178
+ /** Locked drawing metadata. Undefined = editable. */
179
+ locked?: boolean;
180
+ /** Horizontal positioning */
181
+ horizontal: {
182
+ relativeTo: 'character' | 'column' | 'insideMargin' | 'leftMargin' | 'margin' | 'outsideMargin' | 'page' | 'rightMargin';
183
+ alignment?: 'left' | 'right' | 'center' | 'inside' | 'outside';
184
+ posOffset?: number;
185
+ };
186
+ /** Vertical positioning */
187
+ vertical: {
188
+ relativeTo: 'insideMargin' | 'line' | 'margin' | 'outsideMargin' | 'page' | 'paragraph' | 'topMargin' | 'bottomMargin';
189
+ alignment?: 'top' | 'bottom' | 'center' | 'inside' | 'outside';
190
+ posOffset?: number;
191
+ };
192
+ }
193
+ /**
194
+ * Image transformation
195
+ */
196
+ interface ImageTransform {
197
+ /** Rotation in degrees */
198
+ rotation?: number;
199
+ /** Flip horizontal */
200
+ flipH?: boolean;
201
+ /** Flip vertical */
202
+ flipV?: boolean;
203
+ }
204
+ /** Post-transform layout footprint, kept separate from the content frame. */
205
+ interface ImageRotationBounds {
206
+ width?: number;
207
+ height?: number;
208
+ offsetX?: number;
209
+ offsetY?: number;
210
+ }
211
+ /** One ordered DrawingML blip effect. Unknown effects stay named and inert. */
212
+ interface ImageEffect {
213
+ kind?: 'brightnessContrast' | 'saturation' | 'grayscale' | 'biLevel' | 'colorChange' | 'duotone' | 'alpha' | 'blur' | 'unknown';
214
+ amount?: number;
215
+ threshold?: number;
216
+ colors?: string[];
217
+ rawName?: string;
218
+ }
219
+ /** Safe hyperlink metadata attached to picture non-visual properties. */
220
+ interface ImageHyperlink {
221
+ href?: string;
222
+ tooltip?: string;
223
+ target?: string;
224
+ history?: boolean;
225
+ docLocation?: string;
226
+ }
227
+ /**
228
+ * Image padding/margins
229
+ */
230
+ interface ImagePadding {
231
+ top?: number;
232
+ bottom?: number;
233
+ left?: number;
234
+ right?: number;
235
+ }
236
+ /**
237
+ * Image crop, expressed as fractions of the source image to trim from each
238
+ * edge. OOXML's `<a:srcRect l="10000" t="0" r="5000" b="0"/>` uses units of
239
+ * 1/100000 (so 10000 → 0.1 → 10% trimmed from the left). We store the
240
+ * normalised fraction so both the renderer and the saver can read it
241
+ * directly without re-parsing units.
242
+ */
243
+ interface ImageCrop {
244
+ left?: number;
245
+ top?: number;
246
+ right?: number;
247
+ bottom?: number;
248
+ }
249
+ /**
250
+ * Embedded image (`w:drawing` with an inline or anchored picture). Carries
251
+ * the relationship-id pointer to the binary in `word/media/`, its
252
+ * resolved data URL (`src`), display dimensions, optional crop /
253
+ * transform / wrap behaviors, and anchor positioning for floating
254
+ * images.
255
+ *
256
+ * See ECMA-376 §20.4 (DrawingML wordprocessingDrawing).
257
+ */
258
+ interface Image {
259
+ type: 'image';
260
+ /** Unique ID */
261
+ id?: string;
262
+ /** Relationship ID for the image data */
263
+ rId: string;
264
+ /** Resolved image data (base64 or blob URL) */
265
+ src?: string;
266
+ /** Image MIME type */
267
+ mimeType?: string;
268
+ /** Original filename */
269
+ filename?: string;
270
+ /** Alt text for accessibility */
271
+ alt?: string;
272
+ /** Title/description */
273
+ title?: string;
274
+ /** Image size */
275
+ size: ImageSize;
276
+ /** Original size before any transforms */
277
+ originalSize?: ImageSize;
278
+ /** Wrap settings */
279
+ wrap: ImageWrap;
280
+ /** Position for floating images */
281
+ position?: ImagePosition;
282
+ /** Image transformations */
283
+ transform?: ImageTransform;
284
+ /** Padding around image */
285
+ padding?: ImagePadding;
286
+ /** Source-image crop (fractional, OOXML `a:srcRect`). */
287
+ crop?: ImageCrop;
288
+ /** Opacity in [0, 1] (OOXML `a:alphaModFix amt`). Undefined = fully opaque. */
289
+ opacity?: number;
290
+ /** Whether this is a decorative image */
291
+ decorative?: boolean;
292
+ /**
293
+ * `wp:anchor layoutInCell` — when true (default), an anchored image inside
294
+ * a table cell is constrained to the cell. When false, the image escapes
295
+ * the cell into the page area. Round-tripped on save.
296
+ */
297
+ layoutInCell?: boolean;
298
+ /**
299
+ * `wp:anchor allowOverlap` — when true (default), anchored objects may
300
+ * overlap; when false, Word repositions them to avoid collisions. We
301
+ * don't currently reposition; we round-trip the flag so saving preserves
302
+ * the author's intent.
303
+ */
304
+ allowOverlap?: boolean;
305
+ /** Hyperlink URL for clickable image */
306
+ hlinkHref?: string;
307
+ /** Image outline/border */
308
+ outline?: ShapeOutline;
309
+ /** Image effects */
310
+ effects?: {
311
+ brightness?: number;
312
+ contrast?: number;
313
+ saturation?: number;
314
+ /** Ordered blip-effect list. Undefined = legacy scalar effects only. */
315
+ ordered?: ImageEffect[];
316
+ };
317
+ /** Rotated layout bbox. Undefined = use untransformed `size`. */
318
+ rotationBounds?: ImageRotationBounds;
319
+ /** Complete picture hyperlink metadata. Undefined = use `hlinkHref`. */
320
+ hyperlink?: ImageHyperlink;
321
+ /** Effect extents in EMUs. Undefined = no extra wrap/ink extent. */
322
+ effectExtent?: ImagePadding;
323
+ }
324
+
127
325
  /**
128
326
  * Lists & Numbering Types
129
327
  *
@@ -270,49 +468,160 @@ interface NumberingDefinitions {
270
468
  }
271
469
 
272
470
  /**
273
- * Math equations (`m:oMath`, `m:oMathPara`). OMML XML is round-tripped
274
- * verbatim to preserve fidelity Word/Pages/Docs can disagree on.
275
- */
276
- /**
277
- * Math equation content (m:oMath or m:oMathPara)
278
- */
279
- interface MathEquation {
280
- type: 'mathEquation';
281
- /** Whether this is a block (oMathPara) or inline (oMath) equation */
282
- display: 'inline' | 'block';
283
- /** Raw OMML XML for round-trip preservation */
284
- ommlXml: string;
285
- /** Plain text representation for accessibility/fallback */
286
- plainText?: string;
287
- }
288
-
289
- /**
290
- * Tables (`w:tbl`), rows (`w:tr`), and cells (`w:tc`).
471
+ * DrawingML chart model for basic rendered charts.
472
+ *
473
+ * This is intentionally normalized for display rather than lossless OOXML
474
+ * round-trip. Unsupported chart families stay in the original package parts.
291
475
  */
292
476
 
293
- /**
294
- * Table cell (`w:tc`). Holds nested block content (paragraphs and nested
295
- * tables), cell-level formatting (borders, shading, vertical merge),
296
- * tracked property changes, and tracked structural changes for cell
297
- * insert/delete/merge operations.
298
- */
299
- interface TableCell {
300
- type: 'tableCell';
301
- /** Cell formatting */
302
- formatting?: TableCellFormatting;
303
- /** Cell-level tracked property changes (w:tcPrChange) */
304
- propertyChanges?: TableCellPropertyChange[];
305
- /** Tracked structural changes (cell insert/delete/merge) */
306
- structuralChange?: TableStructuralChangeInfo;
307
- /** Cell content (paragraphs, tables, etc.) */
308
- content: (Paragraph | Table)[];
477
+ type ChartType = 'bar' | 'column' | 'line' | 'pie' | 'doughnut';
478
+ type ChartGrouping = 'standard' | 'clustered' | 'stacked' | 'percentStacked';
479
+ interface ChartPoint {
480
+ index?: number;
481
+ value?: number;
482
+ category?: string;
483
+ color?: string;
484
+ explosion?: number;
485
+ marker?: {
486
+ symbol?: string;
487
+ size?: number;
488
+ color?: string;
489
+ };
490
+ label?: string;
309
491
  }
310
- /**
311
- * Table row (`w:tr`) — an ordered list of `TableCell` plus row-level
312
- * formatting (height, repeated header, cantSplit) and tracked changes
313
- * for inserts/deletes.
314
- */
315
- interface TableRow {
492
+ interface ChartSeries {
493
+ name?: string;
494
+ categories: string[];
495
+ values: number[];
496
+ color?: string;
497
+ index?: number;
498
+ order?: number;
499
+ categoryFormula?: string;
500
+ valueFormula?: string;
501
+ axisIds?: string[];
502
+ points?: ChartPoint[];
503
+ grouping?: ChartGrouping;
504
+ marker?: {
505
+ symbol?: string;
506
+ size?: number;
507
+ color?: string;
508
+ };
509
+ smooth?: boolean;
510
+ }
511
+ interface ChartAxis {
512
+ id?: string;
513
+ title?: string;
514
+ min?: number;
515
+ max?: number;
516
+ labels?: string[];
517
+ axisType?: 'category' | 'value' | 'date' | 'series';
518
+ position?: 'left' | 'right' | 'top' | 'bottom';
519
+ crossAxisId?: string;
520
+ crosses?: 'autoZero' | 'min' | 'max' | 'value';
521
+ crossesAt?: number;
522
+ majorUnit?: number;
523
+ minorUnit?: number;
524
+ logarithmicBase?: number;
525
+ reversed?: boolean;
526
+ numberFormat?: string;
527
+ majorTickMark?: string;
528
+ minorTickMark?: string;
529
+ tickLabelPosition?: string;
530
+ hidden?: boolean;
531
+ }
532
+ /** One chart-family element inside `c:plotArea`. */
533
+ interface ChartPlotGroup {
534
+ chartType?: ChartType | 'area' | 'scatter' | 'radar' | 'stock' | 'bubble' | 'ofPie' | 'surface';
535
+ grouping?: ChartGrouping;
536
+ overlap?: number;
537
+ gapWidth?: number;
538
+ axisIds?: string[];
539
+ series?: ChartSeries[];
540
+ varyColors?: boolean;
541
+ firstSliceAngle?: number;
542
+ holeSize?: number;
543
+ showDataLabels?: boolean;
544
+ }
545
+ interface ChartLegend {
546
+ position?: 'left' | 'right' | 'top' | 'bottom';
547
+ visible?: boolean;
548
+ }
549
+ interface Chart {
550
+ type: 'chart';
551
+ chartType: ChartType;
552
+ /** Relationship id used by the owning drawing part. */
553
+ rId?: string;
554
+ /** Normalized package path, e.g. word/charts/chart1.xml. */
555
+ path?: string;
556
+ title?: string;
557
+ legend?: ChartLegend;
558
+ series: ChartSeries[];
559
+ axes?: {
560
+ category?: ChartAxis;
561
+ value?: ChartAxis;
562
+ };
563
+ /** Drawing extent from wp:extent in EMUs. */
564
+ size?: ImageSize;
565
+ /** Wrap metadata from the containing drawing; v1 layout treats charts as inline blocks. */
566
+ wrap?: ImageWrap;
567
+ /** Floating anchor. Undefined = inline legacy behavior. */
568
+ position?: ImagePosition;
569
+ /** Multiple/combo plot groups. Undefined = synthesize one from legacy fields. */
570
+ plotGroups?: ChartPlotGroup[];
571
+ /** Complete axis collection keyed through plot-group `axisIds`. */
572
+ axisList?: ChartAxis[];
573
+ /** Chart accessibility description. */
574
+ description?: string;
575
+ /** Decorative flag. Undefined = false. */
576
+ decorative?: boolean;
577
+ /** Stable z-order for anchored charts. Undefined = source order. */
578
+ relativeHeight?: number;
579
+ }
580
+
581
+ /**
582
+ * Math equations (`m:oMath`, `m:oMathPara`). OMML XML is round-tripped
583
+ * verbatim to preserve fidelity Word/Pages/Docs can disagree on.
584
+ */
585
+ /**
586
+ * Math equation content (m:oMath or m:oMathPara)
587
+ */
588
+ interface MathEquation {
589
+ type: 'mathEquation';
590
+ /** Whether this is a block (oMathPara) or inline (oMath) equation */
591
+ display: 'inline' | 'block';
592
+ /** Raw OMML XML for round-trip preservation */
593
+ ommlXml: string;
594
+ /** Plain text representation for accessibility/fallback */
595
+ plainText?: string;
596
+ }
597
+
598
+ /**
599
+ * Tables (`w:tbl`), rows (`w:tr`), and cells (`w:tc`).
600
+ */
601
+
602
+ /**
603
+ * Table cell (`w:tc`). Holds nested block content (paragraphs and nested
604
+ * tables), cell-level formatting (borders, shading, vertical merge),
605
+ * tracked property changes, and tracked structural changes for cell
606
+ * insert/delete/merge operations.
607
+ */
608
+ interface TableCell {
609
+ type: 'tableCell';
610
+ /** Cell formatting */
611
+ formatting?: TableCellFormatting;
612
+ /** Cell-level tracked property changes (w:tcPrChange) */
613
+ propertyChanges?: TableCellPropertyChange[];
614
+ /** Tracked structural changes (cell insert/delete/merge) */
615
+ structuralChange?: TableStructuralChangeInfo;
616
+ /** Cell content (paragraphs, tables, etc.) */
617
+ content: (Paragraph | Table)[];
618
+ }
619
+ /**
620
+ * Table row (`w:tr`) — an ordered list of `TableCell` plus row-level
621
+ * formatting (height, repeated header, cantSplit) and tracked changes
622
+ * for inserts/deletes.
623
+ */
624
+ interface TableRow {
316
625
  type: 'tableRow';
317
626
  /** Row formatting */
318
627
  formatting?: TableRowFormatting;
@@ -1890,313 +2199,4 @@ interface TextBox {
1890
2199
  bodyProperties?: ShapeTextBodyProperties;
1891
2200
  }
1892
2201
 
1893
- /**
1894
- * Embedded images (`w:drawing` → `pic:pic`): size, wrap, position,
1895
- * transform, padding, crop.
1896
- */
1897
-
1898
- /** One point in a `wp:wrapPolygon`, in the drawing's authored coordinates. */
1899
- interface ImageWrapPoint {
1900
- x?: number;
1901
- y?: number;
1902
- }
1903
- /**
1904
- * Image size specification
1905
- */
1906
- interface ImageSize {
1907
- /** Width in EMUs (English Metric Units) */
1908
- width: number;
1909
- /** Height in EMUs */
1910
- height: number;
1911
- }
1912
- /**
1913
- * Image wrap type for floating images
1914
- */
1915
- interface ImageWrap {
1916
- type: WrapType;
1917
- /** Wrap text direction */
1918
- wrapText?: 'bothSides' | 'left' | 'right' | 'largest';
1919
- /** Distance from text */
1920
- distT?: number;
1921
- distB?: number;
1922
- distL?: number;
1923
- distR?: number;
1924
- /** Tight/through contour. Undefined = rectangular wrap. */
1925
- polygon?: ImageWrapPoint[];
1926
- }
1927
- /**
1928
- * Position for floating images
1929
- */
1930
- interface ImagePosition {
1931
- /** Use `wp:simplePos` instead of positionH/V. Undefined = false. */
1932
- useSimplePos?: boolean;
1933
- /** `wp:simplePos` coordinates in EMUs. */
1934
- simplePos?: {
1935
- x?: number;
1936
- y?: number;
1937
- };
1938
- /** Stable z-order (`wp:anchor/@relativeHeight`). Undefined = source order. */
1939
- relativeHeight?: number;
1940
- /** Behind-text plane (`wp:anchor/@behindDoc`). Undefined = false. */
1941
- behindDoc?: boolean;
1942
- /** Hidden drawing. Undefined = visible. */
1943
- hidden?: boolean;
1944
- /** Locked drawing metadata. Undefined = editable. */
1945
- locked?: boolean;
1946
- /** Horizontal positioning */
1947
- horizontal: {
1948
- relativeTo: 'character' | 'column' | 'insideMargin' | 'leftMargin' | 'margin' | 'outsideMargin' | 'page' | 'rightMargin';
1949
- alignment?: 'left' | 'right' | 'center' | 'inside' | 'outside';
1950
- posOffset?: number;
1951
- };
1952
- /** Vertical positioning */
1953
- vertical: {
1954
- relativeTo: 'insideMargin' | 'line' | 'margin' | 'outsideMargin' | 'page' | 'paragraph' | 'topMargin' | 'bottomMargin';
1955
- alignment?: 'top' | 'bottom' | 'center' | 'inside' | 'outside';
1956
- posOffset?: number;
1957
- };
1958
- }
1959
- /**
1960
- * Image transformation
1961
- */
1962
- interface ImageTransform {
1963
- /** Rotation in degrees */
1964
- rotation?: number;
1965
- /** Flip horizontal */
1966
- flipH?: boolean;
1967
- /** Flip vertical */
1968
- flipV?: boolean;
1969
- }
1970
- /** Post-transform layout footprint, kept separate from the content frame. */
1971
- interface ImageRotationBounds {
1972
- width?: number;
1973
- height?: number;
1974
- offsetX?: number;
1975
- offsetY?: number;
1976
- }
1977
- /** One ordered DrawingML blip effect. Unknown effects stay named and inert. */
1978
- interface ImageEffect {
1979
- kind?: 'brightnessContrast' | 'saturation' | 'grayscale' | 'biLevel' | 'colorChange' | 'duotone' | 'alpha' | 'blur' | 'unknown';
1980
- amount?: number;
1981
- threshold?: number;
1982
- colors?: string[];
1983
- rawName?: string;
1984
- }
1985
- /** Safe hyperlink metadata attached to picture non-visual properties. */
1986
- interface ImageHyperlink {
1987
- href?: string;
1988
- tooltip?: string;
1989
- target?: string;
1990
- history?: boolean;
1991
- docLocation?: string;
1992
- }
1993
- /**
1994
- * Image padding/margins
1995
- */
1996
- interface ImagePadding {
1997
- top?: number;
1998
- bottom?: number;
1999
- left?: number;
2000
- right?: number;
2001
- }
2002
- /**
2003
- * Image crop, expressed as fractions of the source image to trim from each
2004
- * edge. OOXML's `<a:srcRect l="10000" t="0" r="5000" b="0"/>` uses units of
2005
- * 1/100000 (so 10000 → 0.1 → 10% trimmed from the left). We store the
2006
- * normalised fraction so both the renderer and the saver can read it
2007
- * directly without re-parsing units.
2008
- */
2009
- interface ImageCrop {
2010
- left?: number;
2011
- top?: number;
2012
- right?: number;
2013
- bottom?: number;
2014
- }
2015
- /**
2016
- * Embedded image (`w:drawing` with an inline or anchored picture). Carries
2017
- * the relationship-id pointer to the binary in `word/media/`, its
2018
- * resolved data URL (`src`), display dimensions, optional crop /
2019
- * transform / wrap behaviors, and anchor positioning for floating
2020
- * images.
2021
- *
2022
- * See ECMA-376 §20.4 (DrawingML wordprocessingDrawing).
2023
- */
2024
- interface Image {
2025
- type: 'image';
2026
- /** Unique ID */
2027
- id?: string;
2028
- /** Relationship ID for the image data */
2029
- rId: string;
2030
- /** Resolved image data (base64 or blob URL) */
2031
- src?: string;
2032
- /** Image MIME type */
2033
- mimeType?: string;
2034
- /** Original filename */
2035
- filename?: string;
2036
- /** Alt text for accessibility */
2037
- alt?: string;
2038
- /** Title/description */
2039
- title?: string;
2040
- /** Image size */
2041
- size: ImageSize;
2042
- /** Original size before any transforms */
2043
- originalSize?: ImageSize;
2044
- /** Wrap settings */
2045
- wrap: ImageWrap;
2046
- /** Position for floating images */
2047
- position?: ImagePosition;
2048
- /** Image transformations */
2049
- transform?: ImageTransform;
2050
- /** Padding around image */
2051
- padding?: ImagePadding;
2052
- /** Source-image crop (fractional, OOXML `a:srcRect`). */
2053
- crop?: ImageCrop;
2054
- /** Opacity in [0, 1] (OOXML `a:alphaModFix amt`). Undefined = fully opaque. */
2055
- opacity?: number;
2056
- /** Whether this is a decorative image */
2057
- decorative?: boolean;
2058
- /**
2059
- * `wp:anchor layoutInCell` — when true (default), an anchored image inside
2060
- * a table cell is constrained to the cell. When false, the image escapes
2061
- * the cell into the page area. Round-tripped on save.
2062
- */
2063
- layoutInCell?: boolean;
2064
- /**
2065
- * `wp:anchor allowOverlap` — when true (default), anchored objects may
2066
- * overlap; when false, Word repositions them to avoid collisions. We
2067
- * don't currently reposition; we round-trip the flag so saving preserves
2068
- * the author's intent.
2069
- */
2070
- allowOverlap?: boolean;
2071
- /** Hyperlink URL for clickable image */
2072
- hlinkHref?: string;
2073
- /** Image outline/border */
2074
- outline?: ShapeOutline;
2075
- /** Image effects */
2076
- effects?: {
2077
- brightness?: number;
2078
- contrast?: number;
2079
- saturation?: number;
2080
- /** Ordered blip-effect list. Undefined = legacy scalar effects only. */
2081
- ordered?: ImageEffect[];
2082
- };
2083
- /** Rotated layout bbox. Undefined = use untransformed `size`. */
2084
- rotationBounds?: ImageRotationBounds;
2085
- /** Complete picture hyperlink metadata. Undefined = use `hlinkHref`. */
2086
- hyperlink?: ImageHyperlink;
2087
- /** Effect extents in EMUs. Undefined = no extra wrap/ink extent. */
2088
- effectExtent?: ImagePadding;
2089
- }
2090
-
2091
- /**
2092
- * DrawingML chart model for basic rendered charts.
2093
- *
2094
- * This is intentionally normalized for display rather than lossless OOXML
2095
- * round-trip. Unsupported chart families stay in the original package parts.
2096
- */
2097
-
2098
- type ChartType = 'bar' | 'column' | 'line' | 'pie' | 'doughnut';
2099
- type ChartGrouping = 'standard' | 'clustered' | 'stacked' | 'percentStacked';
2100
- interface ChartPoint {
2101
- index?: number;
2102
- value?: number;
2103
- category?: string;
2104
- color?: string;
2105
- explosion?: number;
2106
- marker?: {
2107
- symbol?: string;
2108
- size?: number;
2109
- color?: string;
2110
- };
2111
- label?: string;
2112
- }
2113
- interface ChartSeries {
2114
- name?: string;
2115
- categories: string[];
2116
- values: number[];
2117
- color?: string;
2118
- index?: number;
2119
- order?: number;
2120
- categoryFormula?: string;
2121
- valueFormula?: string;
2122
- axisIds?: string[];
2123
- points?: ChartPoint[];
2124
- grouping?: ChartGrouping;
2125
- marker?: {
2126
- symbol?: string;
2127
- size?: number;
2128
- color?: string;
2129
- };
2130
- smooth?: boolean;
2131
- }
2132
- interface ChartAxis {
2133
- id?: string;
2134
- title?: string;
2135
- min?: number;
2136
- max?: number;
2137
- labels?: string[];
2138
- axisType?: 'category' | 'value' | 'date' | 'series';
2139
- position?: 'left' | 'right' | 'top' | 'bottom';
2140
- crossAxisId?: string;
2141
- crosses?: 'autoZero' | 'min' | 'max' | 'value';
2142
- crossesAt?: number;
2143
- majorUnit?: number;
2144
- minorUnit?: number;
2145
- logarithmicBase?: number;
2146
- reversed?: boolean;
2147
- numberFormat?: string;
2148
- majorTickMark?: string;
2149
- minorTickMark?: string;
2150
- tickLabelPosition?: string;
2151
- hidden?: boolean;
2152
- }
2153
- /** One chart-family element inside `c:plotArea`. */
2154
- interface ChartPlotGroup {
2155
- chartType?: ChartType | 'area' | 'scatter' | 'radar' | 'stock' | 'bubble' | 'ofPie' | 'surface';
2156
- grouping?: ChartGrouping;
2157
- overlap?: number;
2158
- gapWidth?: number;
2159
- axisIds?: string[];
2160
- series?: ChartSeries[];
2161
- varyColors?: boolean;
2162
- firstSliceAngle?: number;
2163
- holeSize?: number;
2164
- showDataLabels?: boolean;
2165
- }
2166
- interface ChartLegend {
2167
- position?: 'left' | 'right' | 'top' | 'bottom';
2168
- visible?: boolean;
2169
- }
2170
- interface Chart {
2171
- type: 'chart';
2172
- chartType: ChartType;
2173
- /** Relationship id used by the owning drawing part. */
2174
- rId?: string;
2175
- /** Normalized package path, e.g. word/charts/chart1.xml. */
2176
- path?: string;
2177
- title?: string;
2178
- legend?: ChartLegend;
2179
- series: ChartSeries[];
2180
- axes?: {
2181
- category?: ChartAxis;
2182
- value?: ChartAxis;
2183
- };
2184
- /** Drawing extent from wp:extent in EMUs. */
2185
- size?: ImageSize;
2186
- /** Wrap metadata from the containing drawing; v1 layout treats charts as inline blocks. */
2187
- wrap?: ImageWrap;
2188
- /** Floating anchor. Undefined = inline legacy behavior. */
2189
- position?: ImagePosition;
2190
- /** Multiple/combo plot groups. Undefined = synthesize one from legacy fields. */
2191
- plotGroups?: ChartPlotGroup[];
2192
- /** Complete axis collection keyed through plot-group `axisIds`. */
2193
- axisList?: ChartAxis[];
2194
- /** Chart accessibility description. */
2195
- description?: string;
2196
- /** Decorative flag. Undefined = false. */
2197
- decorative?: boolean;
2198
- /** Stable z-order for anchored charts. Undefined = source order. */
2199
- relativeHeight?: number;
2200
- }
2201
-
2202
2202
  export { type FieldType as $, type AbstractNumbering as A, type BlockContent as B, type CellMarker as C, type DrawingScene as D, type EndnoteProperties as E, type FootnoteProperties as F, type CommentAuthor as G, type HeaderFooter as H, type CommentRangeEnd as I, type CommentRangeStart as J, type CommentReferenceContent as K, type ComplexField as L, type ContentPosition as M, type NoteKind as N, DEFAULT_WATERMARK_PRESETS as O, type PresetGeometryPathCommand as P, type Deletion as Q, type RevisionInfo as R, type SectionProperties as S, type DrawingContent as T, type DrawingSceneNode as U, type EndnotePosition as V, type Watermark as W, type Field as X, type FieldCharContent as Y, type FieldFormData as Z, type FieldInlineContent as _, type SdtControlState as a, type SimpleField as a$, type FooterReference as a0, type FootnotePosition as a1, type HeaderFooterType as a2, type HeaderReference as a3, type Hyperlink as a4, type HyperlinkContent as a5, type Image as a6, type ImageCrop as a7, type ImageEffect as a8, type ImageHyperlink as a9, type NumberFormat as aA, type NumberingInstance as aB, type PageNumberingProperties as aC, type PageOrientation as aD, type ParagraphContent as aE, type ParagraphPropertyChange as aF, type PictureWatermark as aG, type PropertyChangeInfo as aH, type Run as aI, type RunContent as aJ, type RunPropertyChange as aK, type SdtCheckboxGlyph as aL, type SdtDataBinding as aM, type SdtDateState as aN, type SdtGalleryState as aO, type SdtType as aP, type Section as aQ, type SectionStart as aR, type SeparatorContent as aS, type Shape as aT, type ShapeContent as aU, type ShapeFill as aV, type ShapeFillPaint as aW, type ShapeOutline as aX, type ShapeStrokePaint as aY, type ShapeTextBody as aZ, type ShapeType as a_, type ImagePadding as aa, type ImagePosition as ab, type ImageRotationBounds as ac, type ImageSize as ad, type ImageTransform as ae, type ImageWrap as af, type ImageWrapPoint as ag, type InlineSdt as ah, type Insertion as ai, type InstrTextContent as aj, type LevelSuffix as ak, type LineNumberRestart as al, type ListLevel as am, type ListRendering as an, type MathEquation as ao, type MoveFrom as ap, type MoveFromRangeEnd as aq, type MoveFromRangeStart as ar, type MoveTo as as, type MoveToRangeEnd as at, type MoveToRangeStart as au, type NoBreakHyphenContent as av, type NoteNumberRestart as aw, type NoteRefMarkContent as ax, type NoteReferenceContent as ay, type NoteSeparatorReference as az, type SdtProperties as b, type SoftHyphenContent as b0, type StructuredFieldContent as b1, type StructuredFieldTree as b2, type SymbolContent as b3, type TabContent as b4, type Table as b5, type TableCell as b6, type TableCellPropertyChange as b7, type TablePropertyChange as b8, type TableRow as b9, type TableRowPropertyChange as ba, type TableStructuralChangeInfo as bb, type TextBox as bc, type TextContent as bd, type TextWatermark as be, type TrackedChangeInfo as bf, type TrackedRunChange as bg, type VerticalAlign as bh, pictureWatermarkDisplayEmu as bi, type ShapeEffect as c, type ShapeTextBodyProperties as d, type Chart as e, type Paragraph as f, type Comment as g, type DocumentBody as h, type NumberingDefinitions as i, type Footnote as j, type Endnote as k, type BookmarkRange as l, type BlockSdt as m, type BookmarkEnd as n, type BookmarkStart as o, type BreakContent as p, type ChartAxis as q, type ChartContent as r, type ChartGrouping as s, type ChartLegend as t, type ChartPlotGroup as u, type ChartPoint as v, type ChartSeries as w, type ChartType as x, type Column as y, type CommentAnchorRange as z };