reamkit 1.30.0 → 1.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/README.md +70 -24
  2. package/dist/esm/core/bidi/index.d.ts +10 -0
  3. package/dist/esm/core/bidi/index.js +18 -2
  4. package/dist/esm/core/converter/facade.js +10 -5
  5. package/dist/esm/core/converter/project.js +4 -1
  6. package/dist/esm/core/converter/ream.js +17 -6
  7. package/dist/esm/core/converter/sheet-images.d.ts +17 -0
  8. package/dist/esm/core/converter/sheet-images.js +33 -0
  9. package/dist/esm/core/crypto/offcrypto.js +1 -1
  10. package/dist/esm/core/document-model/index.d.ts +1 -1
  11. package/dist/esm/core/document-model/types.d.ts +175 -0
  12. package/dist/esm/core/drawingml/chart-geometry.d.ts +21 -8
  13. package/dist/esm/core/drawingml/chart-geometry.js +198 -108
  14. package/dist/esm/core/drawingml/chart-parser.js +73 -2
  15. package/dist/esm/core/drawingml/colors.d.ts +6 -0
  16. package/dist/esm/core/drawingml/colors.js +23 -3
  17. package/dist/esm/core/drawingml/shape-render.d.ts +3 -1
  18. package/dist/esm/core/drawingml/shape-render.js +4 -2
  19. package/dist/esm/core/font/index.d.ts +2 -0
  20. package/dist/esm/core/font/measure.d.ts +9 -0
  21. package/dist/esm/core/font/measure.js +9 -1
  22. package/dist/esm/core/font/ttf-build.d.ts +113 -0
  23. package/dist/esm/core/font/ttf-build.js +1224 -0
  24. package/dist/esm/core/font/ttf-subset.d.ts +19 -0
  25. package/dist/esm/core/font/ttf-subset.js +14 -1
  26. package/dist/esm/core/fonts/families.js +4 -2
  27. package/dist/esm/core/fonts/provider.d.ts +17 -0
  28. package/dist/esm/core/fonts/provider.js +27 -2
  29. package/dist/esm/core/fonts/remote-fonts.js +8 -1
  30. package/dist/esm/core/fonts/scripts.js +4 -2
  31. package/dist/esm/core/ir/flow.d.ts +77 -1
  32. package/dist/esm/core/ir/sheet.d.ts +43 -0
  33. package/dist/esm/core/number-format.js +16 -11
  34. package/dist/esm/core/numbering/index.d.ts +1 -1
  35. package/dist/esm/core/numbering/state.d.ts +11 -1
  36. package/dist/esm/core/numbering/state.js +10 -1
  37. package/dist/esm/core/spreadsheet-model/index.d.ts +1 -1
  38. package/dist/esm/core/spreadsheet-model/types.d.ts +96 -0
  39. package/dist/esm/core/style-cascade/resolver.js +39 -6
  40. package/dist/esm/core/style-cascade/types.d.ts +19 -1
  41. package/dist/esm/core/style-cascade/types.js +3 -0
  42. package/dist/esm/excel/column-bands.d.ts +39 -6
  43. package/dist/esm/excel/column-bands.js +41 -17
  44. package/dist/esm/excel/comments-parser.js +19 -0
  45. package/dist/esm/excel/conditional-format.d.ts +7 -3
  46. package/dist/esm/excel/conditional-format.js +77 -39
  47. package/dist/esm/excel/formula/context.d.ts +18 -0
  48. package/dist/esm/excel/formula/eval.js +51 -0
  49. package/dist/esm/excel/formula/index.d.ts +2 -2
  50. package/dist/esm/excel/formula/lexer.d.ts +1 -1
  51. package/dist/esm/excel/formula/lexer.js +41 -0
  52. package/dist/esm/excel/formula/parser.d.ts +25 -0
  53. package/dist/esm/excel/formula/parser.js +95 -0
  54. package/dist/esm/excel/print-model.d.ts +38 -1
  55. package/dist/esm/excel/print-model.js +522 -80
  56. package/dist/esm/excel/shared-strings-parser.d.ts +9 -0
  57. package/dist/esm/excel/shared-strings-parser.js +11 -1
  58. package/dist/esm/excel/sheet-drawing.d.ts +38 -2
  59. package/dist/esm/excel/sheet-drawing.js +47 -13
  60. package/dist/esm/excel/sheet-shape-parser.d.ts +6 -2
  61. package/dist/esm/excel/sheet-shape-parser.js +18 -6
  62. package/dist/esm/excel/sheet-to-flow.d.ts +17 -0
  63. package/dist/esm/excel/sheet-to-flow.js +434 -47
  64. package/dist/esm/excel/styles-parser.d.ts +9 -0
  65. package/dist/esm/excel/styles-parser.js +80 -26
  66. package/dist/esm/excel/table-parser.js +5 -0
  67. package/dist/esm/excel/table-style-presets.d.ts +26 -0
  68. package/dist/esm/excel/table-style-presets.js +1555 -0
  69. package/dist/esm/excel/table-style.d.ts +13 -0
  70. package/dist/esm/excel/table-style.js +75 -0
  71. package/dist/esm/excel/tint.d.ts +10 -0
  72. package/dist/esm/excel/tint.js +75 -0
  73. package/dist/esm/excel/vml-drawing.d.ts +41 -3
  74. package/dist/esm/excel/vml-drawing.js +143 -10
  75. package/dist/esm/excel/worksheet-parser.js +89 -15
  76. package/dist/esm/excel/xls/biff-reader.js +10 -2
  77. package/dist/esm/excel/xlsx-reader.js +195 -14
  78. package/dist/esm/excel/xlsx-writer.js +8 -7
  79. package/dist/esm/html/html-writer.js +202 -20
  80. package/dist/esm/index.d.ts +2 -2
  81. package/dist/esm/layout/fit-pages.d.ts +11 -0
  82. package/dist/esm/layout/fit-pages.js +86 -0
  83. package/dist/esm/layout/line-paint.d.ts +58 -0
  84. package/dist/esm/layout/line-paint.js +107 -0
  85. package/dist/esm/layout/page-doc.d.ts +61 -3
  86. package/dist/esm/layout/page-doc.js +141 -1
  87. package/dist/esm/layout/styled-layout.d.ts +55 -7
  88. package/dist/esm/layout/styled-layout.js +1154 -169
  89. package/dist/esm/layout/turned-section.d.ts +38 -0
  90. package/dist/esm/layout/turned-section.js +205 -0
  91. package/dist/esm/markdown/markdown-writer.js +17 -6
  92. package/dist/esm/pdf/styled-page-emitter.js +114 -60
  93. package/dist/esm/pdf/styled-page-renderer.js +1 -1
  94. package/dist/esm/pdf-reader/cff-outline.d.ts +27 -0
  95. package/dist/esm/pdf-reader/cff-outline.js +169 -21
  96. package/dist/esm/pdf-reader/content.d.ts +53 -0
  97. package/dist/esm/pdf-reader/content.js +9 -1
  98. package/dist/esm/pdf-reader/display.d.ts +36 -0
  99. package/dist/esm/pdf-reader/display.js +66 -1
  100. package/dist/esm/pdf-reader/document.js +5 -1
  101. package/dist/esm/pdf-reader/embedded-fonts.d.ts +2 -1
  102. package/dist/esm/pdf-reader/embedded-fonts.js +32 -2
  103. package/dist/esm/pdf-reader/encodings.d.ts +8 -0
  104. package/dist/esm/pdf-reader/encodings.js +25 -3
  105. package/dist/esm/pdf-reader/face-outlines.d.ts +78 -0
  106. package/dist/esm/pdf-reader/face-outlines.js +362 -0
  107. package/dist/esm/pdf-reader/figures.d.ts +52 -0
  108. package/dist/esm/pdf-reader/figures.js +433 -0
  109. package/dist/esm/pdf-reader/flow-build.d.ts +131 -5
  110. package/dist/esm/pdf-reader/flow-build.js +345 -26
  111. package/dist/esm/pdf-reader/font.js +321 -36
  112. package/dist/esm/pdf-reader/glyf-outline.d.ts +33 -0
  113. package/dist/esm/pdf-reader/glyf-outline.js +135 -1
  114. package/dist/esm/pdf-reader/glyph-names.js +154 -1
  115. package/dist/esm/pdf-reader/layout.d.ts +93 -0
  116. package/dist/esm/pdf-reader/layout.js +1703 -214
  117. package/dist/esm/pdf-reader/page-numbers.d.ts +53 -0
  118. package/dist/esm/pdf-reader/page-numbers.js +167 -0
  119. package/dist/esm/pdf-reader/tagged.js +182 -23
  120. package/dist/esm/pdf-reader/text.d.ts +6 -3
  121. package/dist/esm/pdf-reader/text.js +98 -9
  122. package/dist/esm/pdf-reader/type1-outline.d.ts +11 -0
  123. package/dist/esm/pdf-reader/type1-outline.js +63 -8
  124. package/dist/esm/pdf-reader/vector.js +71 -1
  125. package/dist/esm/svg/svg-text.d.ts +58 -0
  126. package/dist/esm/svg/svg-text.js +322 -0
  127. package/dist/esm/svg/svg-writer.js +135 -71
  128. package/dist/esm/word/doc/doc-reader.js +6 -2
  129. package/dist/esm/word/doc/doc-text.d.ts +6 -0
  130. package/dist/esm/word/doc/doc-text.js +19 -1
  131. package/dist/esm/word/document-parser.d.ts +2 -2
  132. package/dist/esm/word/document-parser.js +11 -1
  133. package/dist/esm/word/docx-reader.js +5 -3
  134. package/dist/esm/word/docx-writer.js +218 -23
  135. package/dist/esm/word/drawing-parser.d.ts +5 -3
  136. package/dist/esm/word/drawing-parser.js +49 -8
  137. package/dist/esm/word/font-embed.d.ts +30 -0
  138. package/dist/esm/word/font-embed.js +173 -0
  139. package/dist/esm/word/font-table.d.ts +10 -0
  140. package/dist/esm/word/font-table.js +13 -1
  141. package/dist/esm/word/index.js +1 -1
  142. package/dist/esm/word/numbering-parser.d.ts +3 -1
  143. package/dist/esm/word/numbering-parser.js +2 -1
  144. package/dist/esm/word/paragraph-properties.d.ts +7 -6
  145. package/dist/esm/word/paragraph-properties.js +14 -2
  146. package/dist/esm/word/run-properties.js +26 -0
  147. package/package.json +12 -3
@@ -6,6 +6,12 @@ export type Alignment = 'left' | 'right' | 'center' | 'both' | 'distribute';
6
6
  export type UnderlineStyle = 'none' | 'single' | 'double' | 'thick' | 'dotted' | 'dottedHeavy' | 'dash' | 'dashHeavy' | 'wave';
7
7
  /** Run vertical alignment (`w:vertAlign`): baseline or super/subscript. */
8
8
  export type VerticalAlign = 'baseline' | 'superscript' | 'subscript';
9
+ /**
10
+ * [MS-DOCX] ST_Ligatures — which of a face's OpenType ligatures a run is set
11
+ * with (`w14:ligatures`): the standard ones (`liga`), the contextual (`clig`),
12
+ * the historical (`hlig`) and the discretionary (`dlig`), alone or together.
13
+ */
14
+ export type Ligatures = 'none' | 'standard' | 'contextual' | 'historical' | 'discretional' | 'standardContextual' | 'standardHistorical' | 'contextualHistorical' | 'standardDiscretional' | 'contextualDiscretional' | 'historicalDiscretional' | 'standardContextualHistorical' | 'standardContextualDiscretional' | 'standardHistoricalDiscretional' | 'contextualHistoricalDiscretional' | 'all';
9
15
  /**
10
16
  * The four script slots of `w:rFonts` (§17.3.2.26). A character picks its font
11
17
  * from the slot its Unicode range maps to (ASCII, high-ANSI, complex-script,
@@ -63,6 +69,21 @@ export interface RunProperties {
63
69
  * (negative tightens). Word states it in twentieths of a point.
64
70
  */
65
71
  readonly letterSpacingPt?: Pt;
72
+ /**
73
+ * §17.3.2.43 `w:w` — each character set at this share of its own width
74
+ * (1 is as the face sets it), the glyph itself narrowed or widened.
75
+ */
76
+ readonly widthScale?: number;
77
+ /**
78
+ * §17.3.2.19 `w:kern` — the run's glyph pairs are KERNED, at this size and
79
+ * above (0 turns kerning off). Word kerns nothing a run does not ask for.
80
+ */
81
+ readonly kerningMinPt?: Pt;
82
+ /**
83
+ * [MS-DOCX] `w14:ligatures` — the face's ligatures the run is set with.
84
+ * Word forms none at all in a document it opens in compatibility mode.
85
+ */
86
+ readonly ligatures?: Ligatures;
66
87
  /**
67
88
  * §21.1.2.3.9 `a:rPr/a:ln` — a line drawn round the glyphs themselves, which
68
89
  * DrawingML puts on a run and ISO 32000-1 §9.3.6 calls a text rendering mode
@@ -220,6 +241,24 @@ export interface ParagraphProperties {
220
241
  * starts on a fresh page even if there is room on the current one.
221
242
  */
222
243
  readonly pageBreakBefore?: boolean;
244
+ /**
245
+ * ECMA-376 Part 1 §17.3.1.14 — `w:keepNext`. The paragraph stands on the
246
+ * same page as the start of the one after it: a heading is not left at the
247
+ * foot of a page with its text on the next.
248
+ */
249
+ readonly keepNext?: boolean;
250
+ /**
251
+ * ECMA-376 Part 1 §17.3.1.15 — `w:keepLines`. The paragraph's lines stand on
252
+ * one page, wherever one page holds them all.
253
+ */
254
+ readonly keepLines?: boolean;
255
+ /**
256
+ * ECMA-376 Part 1 §17.3.1.44 — `w:widowControl`. When on, a page or column
257
+ * break that would leave the paragraph's first line alone at the foot of one
258
+ * page, or its last line alone at the head of the next, is moved so that
259
+ * neither stands alone. Word applies it wherever nothing says otherwise.
260
+ */
261
+ readonly widowControl?: boolean;
223
262
  /**
224
263
  * ECMA-376 §17.3.1.6 — `w:bidi`. Sets the paragraph's base direction to RTL,
225
264
  * so the BiDi paragraph embedding level is 1 and default alignment is right.
@@ -692,6 +731,19 @@ export interface CellDataBar {
692
731
  * axis, and which way that is depends on the sign.
693
732
  */
694
733
  readonly negative?: boolean;
734
+ /** The bar is one solid colour, not faded from the axis (`<x14:dataBar gradient="0">`). */
735
+ readonly solid?: boolean;
736
+ }
737
+ /**
738
+ * How a window flags a cell that carries a note: red for a legacy note, purple
739
+ * for a threaded comment, in the top corner on the side the cell ends — the
740
+ * right, or the left on a sheet that reads from the right.
741
+ */
742
+ export interface CellNoteFlag {
743
+ readonly kind: 'note' | 'thread';
744
+ /** The note as one reads it on hover: author and text, a conversation line by line. */
745
+ readonly text: string;
746
+ readonly atLeft?: boolean;
695
747
  }
696
748
  /**
697
749
  * A conditional-format icon: a small glyph at the cell's left, chosen by the
@@ -762,6 +814,12 @@ export interface CellProperties {
762
814
  * what a merge wants.
763
815
  */
764
816
  readonly paintColumns?: number;
817
+ /**
818
+ * The paint covers the LAST {@link paintColumns} of the span rather than the
819
+ * first. A sheet that reads from the right runs a cell's text over the
820
+ * neighbours on its left, so the cell the paint belongs to ends the span.
821
+ */
822
+ readonly paintAtEnd?: boolean;
765
823
  readonly shading?: CellShading;
766
824
  readonly dataBar?: CellDataBar;
767
825
  readonly icon?: CellIcon;
@@ -771,6 +829,12 @@ export interface CellProperties {
771
829
  * dropdown affordance at the cell's right edge (a small button + ▾ glyph).
772
830
  */
773
831
  readonly dropdown?: boolean;
832
+ /**
833
+ * A note or comment on the cell, as a WINDOW flags it (E-SHEET W7): a small
834
+ * triangle in the cell's top corner, the note's text shown on hover where
835
+ * the medium can. Set by screen projections only — paper never shows it.
836
+ */
837
+ readonly noteFlag?: CellNoteFlag;
774
838
  /**
775
839
  * The cell's text is not allowed to wrap: it renders on one line and whatever
776
840
  * does not fit the cell box is cut, as a spreadsheet cell without `wrapText`
@@ -828,6 +892,13 @@ export interface RowProperties {
828
892
  * header row `w:firstRow="1"` so it is painted like the first.
829
893
  */
830
894
  readonly conditional?: RowConditionalFormat;
895
+ /**
896
+ * Where a spreadsheet row's top stands on its sheet, measured down from the
897
+ * sheet's first row in the frame its table's drawings are placed in (see
898
+ * {@link TableOverlay}). A row the sheet does not have — the printed column
899
+ * letters — carries none.
900
+ */
901
+ readonly sheetTopPt?: Pt;
831
902
  }
832
903
  /** §17.4.7 — the row-level conditional-format flags a `w:cnfStyle` declares. */
833
904
  export interface RowConditionalFormat {
@@ -861,6 +932,14 @@ export interface TableProperties {
861
932
  readonly layout?: 'auto' | 'fixed';
862
933
  readonly defaultCellMargins?: CellMargins;
863
934
  readonly borders?: CellBorders;
935
+ /**
936
+ * A worksheet's gridlines as its WINDOW draws them (§18.3.1.87), where the
937
+ * sheet was projected for a screen: the line a cell's edge takes when no
938
+ * border claims it — but not around a filled cell, whose fill covers them.
939
+ * A screen-only hint: the paginated layout draws a grid only where the
940
+ * sheet PRINTS one, and that comes as `borders`.
941
+ */
942
+ readonly gridlines?: Border;
864
943
  /**
865
944
  * ECMA-376 §17.4.27 (`w:jc`) / xlsx `<printOptions horizontalCentered>`.
866
945
  * Centers or right-aligns a table narrower than the content width; absent ⇒ left.
@@ -907,6 +986,32 @@ export interface Table {
907
986
  readonly properties: TableProperties;
908
987
  readonly grid: ReadonlyArray<Pt>;
909
988
  readonly rows: ReadonlyArray<TableRow>;
989
+ /** The drawings that lie over a spreadsheet grid and print with it. */
990
+ readonly overlay?: TableOverlay;
991
+ }
992
+ /**
993
+ * §20.5 — a spreadsheet's drawings over the part of the sheet one table
994
+ * prints. A drawing is anchored to cells, not to paper: each page the table
995
+ * spans shows the part of every drawing that lies over the rows and columns it
996
+ * prints, and cuts it off where they end — a chart across a page break is
997
+ * printed in two pieces, a drawing in the repeated title rows on every page,
998
+ * and what runs out of the print area not at all. Excel prints a sheet so.
999
+ */
1000
+ export interface TableOverlay {
1001
+ /** Where the sheet's columns this table prints begin, in the drawings' frame. */
1002
+ readonly sheetLeftPt: Pt;
1003
+ /** How wide those columns run. */
1004
+ readonly widthPt: Pt;
1005
+ /** Where they stand in the table, from its left edge (past a printed row-number column). */
1006
+ readonly leftPt: Pt;
1007
+ /** §18.3.1.87 — the sheet reads from the right: its first column stands at the right. */
1008
+ readonly mirrored?: boolean;
1009
+ /**
1010
+ * The drawings, out-of-flow floats placed in the sheet's own frame: `posH`
1011
+ * from the sheet's left edge, `posV` from its top, the frame of
1012
+ * {@link RowProperties.sheetTopPt}.
1013
+ */
1014
+ readonly drawings: ReadonlyArray<BodyElement>;
910
1015
  }
911
1016
  /**
912
1017
  * ECMA-376 Part 1 §20.4.2.8 — a block-level image (`wp:inline` picture extent).
@@ -1176,6 +1281,13 @@ export interface ShapeTextBody {
1176
1281
  readonly insetRight?: Pt;
1177
1282
  readonly insetBottom?: Pt;
1178
1283
  readonly anchor?: 't' | 'ctr' | 'b';
1284
+ /**
1285
+ * §20.1.2.1.1 `a:bodyPr @wrap="none"` — the lines run as far as their words
1286
+ * do, whatever the box's width. A label placed where a page set it is sized
1287
+ * to the words it was measured from, and set in a face a little wider it
1288
+ * broke inside its one word.
1289
+ */
1290
+ readonly noWrap?: boolean;
1179
1291
  /**
1180
1292
  * §20.1.10.83 ST_TextVerticalType (`a:bodyPr @vert`) — text set along the
1181
1293
  * box's long axis rather than across it. `vert` reads top-to-bottom (turned a
@@ -1384,6 +1496,16 @@ export interface Chart {
1384
1496
  readonly categories: ReadonlyArray<string>;
1385
1497
  /** §21.2.2.24 `c:cat/…/c:f` — where the categories live, when uncached. */
1386
1498
  readonly categoriesRef?: string;
1499
+ /**
1500
+ * §21.2.2.115 `c:multiLvlStrCache` — the outer levels of a category axis
1501
+ * labelled on more than one: each level's groups, innermost level first,
1502
+ * each group from the category it starts at to the next group's start.
1503
+ * {@link Chart.categories} is the innermost level, one label per category.
1504
+ */
1505
+ readonly categoryGroups?: ReadonlyArray<ReadonlyArray<{
1506
+ readonly start: number;
1507
+ readonly label: string;
1508
+ }>>;
1387
1509
  readonly series: ReadonlyArray<ChartSeries>;
1388
1510
  readonly hasLegend: boolean;
1389
1511
  readonly legendPos?: 'r' | 'l' | 't' | 'b';
@@ -1404,6 +1526,27 @@ export interface Chart {
1404
1526
  * and we printed the ranking upside down).
1405
1527
  */
1406
1528
  readonly catAxisReversed?: boolean;
1529
+ /**
1530
+ * §21.2.2.33/§21.2.2.34 `c:catAx/c:crosses`, `c:crossesAt` — where along the
1531
+ * value axis the category axis lies, and so where bars grow from: at the
1532
+ * axis's minimum or maximum, or at a stated value. Absent ⇒ `autoZero`, at
1533
+ * zero (or the end of the value axis nearest it).
1534
+ */
1535
+ readonly catAxisCrosses?: 'min' | 'max' | number;
1536
+ /**
1537
+ * §21.2.2.207 `c:catAx/c:tickLblPos` — where the category labels stand: at
1538
+ * the low or high end of the value axis, or nowhere. Absent ⇒ `nextTo`,
1539
+ * beside the category axis wherever it crosses — on the zero line of a chart
1540
+ * with values below zero.
1541
+ */
1542
+ readonly catTickLabelPos?: 'low' | 'high' | 'none';
1543
+ /**
1544
+ * §21.2.2.33 `c:valAx/c:crosses` — where along the category axis the value
1545
+ * axis lies: at the last category (`max`) or the first (absent, `autoZero`).
1546
+ * The first is at the far end when the categories run backwards
1547
+ * ({@link Chart.catAxisReversed}): a ranked bar chart has its values on top.
1548
+ */
1549
+ readonly valAxisCrosses?: 'min' | 'max' | number;
1407
1550
  readonly valAxisTitle?: string;
1408
1551
  /** §21.2.2.168 — the title of the secondary value axis, when one is drawn. */
1409
1552
  readonly secondaryValAxisTitle?: string;
@@ -1434,6 +1577,11 @@ export interface Chart {
1434
1577
  */
1435
1578
  readonly valAxisMin?: number;
1436
1579
  readonly valAxisMax?: number;
1580
+ /**
1581
+ * §21.2.2.98 `c:valAx/c:majorUnit` — the step between the value axis's
1582
+ * labels, when the author fixed it. Absent ⇒ the application's own choice.
1583
+ */
1584
+ readonly valAxisMajorUnit?: number;
1437
1585
  /**
1438
1586
  * §21.2.2.198 `c:chartSpace/c:spPr` — the frame around the whole chart: its
1439
1587
  * background fill and its outline. Excel writes both on every chart it
@@ -1543,6 +1691,12 @@ export interface SectionProperties {
1543
1691
  * printed with. Absent ⇒ the count carries on from the section before.
1544
1692
  */
1545
1693
  readonly pageNumberStart?: number;
1694
+ /**
1695
+ * §17.6.12 `w:pgNumType w:fmt` — how a PAGE field prints the section's page
1696
+ * numbers (§17.18.59): `lowerRoman` numbers a book's front matter i, ii,
1697
+ * iii before its body starts again at 1. Absent ⇒ decimal.
1698
+ */
1699
+ readonly pageNumberFormat?: NumberingFormat;
1546
1700
  /** §17.6.8 `w:lnNumType` — line numbers printed in the margin beside the text. */
1547
1701
  readonly lineNumbering?: {
1548
1702
  /** Print every `countBy`-th line (default 1). */
@@ -1579,6 +1733,17 @@ export interface SectionProperties {
1579
1733
  * distinguished from `nextPage`.)
1580
1734
  */
1581
1735
  readonly sectionStart?: 'continuous' | 'nextPage' | 'oddPage' | 'evenPage';
1736
+ /**
1737
+ * §17.6.20 `w:textDirection` — which way the section's lines run. `tbRl`
1738
+ * sets each line top to bottom and the next one to the left of it: the
1739
+ * text turned a quarter clockwise on the sheet, which is how a viewer shows
1740
+ * a page turned by `/Rotate 90` whose words stood upright in its box. Word
1741
+ * lays a section out that way for `btLr` as well, so the layout reads both
1742
+ * alike. Only the body's text turns: the headers, the footers and every
1743
+ * drawing anchored to the page keep the sheet's own axes. Absent ⇒ left to
1744
+ * right, top to bottom.
1745
+ */
1746
+ readonly textDirection?: 'tbRl' | 'btLr';
1582
1747
  /**
1583
1748
  * §17.6.5 `w:docGrid` — the line grid a `lines`/`linesAndChars` section rules
1584
1749
  * its text onto, as the pitch in points. Every line of the section's text is
@@ -1681,6 +1846,16 @@ export interface SectionColumns {
1681
1846
  export interface Section {
1682
1847
  readonly properties: SectionProperties;
1683
1848
  readonly endIndex: number;
1849
+ /**
1850
+ * The worksheet this section IS, where a workbook was projected for a screen
1851
+ * rather than for paper (`ProjectSheetOptions.screen`): its tab's name. Such
1852
+ * a section is one surface with no pages — the grid as Excel shows it — and
1853
+ * a float in it is placed from the surface's top-left corner, which is the
1854
+ * corner of the first cell.
1855
+ */
1856
+ readonly sheet?: {
1857
+ readonly name: string;
1858
+ };
1684
1859
  }
1685
1860
  /** The parsed WordprocessingML document: body, stylesheet, numbering and section setup. */
1686
1861
  export interface DocumentModel {
@@ -118,17 +118,30 @@ export interface Scale {
118
118
  readonly step: number;
119
119
  }
120
120
  /**
121
- * Compute a human-friendly axis {@link Scale} for the data range using
122
- * Heckbert's "nice numbers" algorithm: rounded endpoints and a 1/2/5·10ⁿ step
123
- * that yields about `maxTicks` ticks. A degenerate range (`dataMin === dataMax`)
124
- * is widened by 1 so the axis is non-empty.
121
+ * The scale Excel gives a value axis it is left to choose, measured against
122
+ * Excel's own PDF of eight column charts (2026-10-01):
125
123
  *
126
- * @param dataMin The smallest data value to cover.
127
- * @param dataMax The largest data value to cover.
128
- * @param maxTicks Target upper bound on tick count (default 6).
124
+ * - the ends: values all of one sign put the axis's near end at zero —
125
+ * unless their spread is under a sixth of the largest of them, when it
126
+ * stops half a spread short of the nearest (93…97 runs from 91) — and the
127
+ * far end, like both ends of a range across zero, takes 5% of the spread
128
+ * beyond the data before it is rounded out to the step;
129
+ * - the step: the smallest 1, 2 or 5 × 10ⁿ that leaves at most ten intervals
130
+ * (`maxIntervals`), whatever the chart's height — 3 750 runs 0…4 000 by 500
131
+ * on a 150pt chart as on a 400pt one. Only an axis too short to hold the
132
+ * labels asks for fewer, and the caller says so.
133
+ *
134
+ * Every case of the probe lands where Excel puts it: −1…1.2 on −1.5…1.5 by
135
+ * 0.5, 0.3…4.7 on 0…5 by 0.5, 120…950 on 0…1 000 by 100, 0.012…0.047 on
136
+ * 0…0.05 by 0.005. Heckbert's nice numbers with a budget of ticks by height
137
+ * stepped the budget chart by 1 000 and started 93…97 at zero.
138
+ *
139
+ * @param dataMin The smallest value to cover.
140
+ * @param dataMax The largest value to cover.
141
+ * @param maxIntervals At most this many steps between the ends (default 10).
129
142
  * @returns The rounded min/max and tick step.
130
143
  */
131
- export declare function niceScale(dataMin: number, dataMax: number, maxTicks?: number): Scale;
144
+ export declare function niceScale(dataMin: number, dataMax: number, maxIntervals?: number): Scale;
132
145
  /**
133
146
  * Format an axis tick value, choosing decimal places from the tick `step` so
134
147
  * `0.25`-spaced ticks read `0.25` while integer steps drop the fraction.