reamkit 1.15.1 → 1.15.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.
- package/dist/esm/core/arc-to-bezier.d.ts +23 -0
- package/dist/esm/core/arc-to-bezier.js +23 -0
- package/dist/esm/core/bidi/algorithm.d.ts +26 -0
- package/dist/esm/core/bidi/algorithm.js +21 -0
- package/dist/esm/core/bidi/char-types.d.ts +17 -0
- package/dist/esm/core/bidi/char-types.js +10 -0
- package/dist/esm/core/bidi/index.d.ts +42 -0
- package/dist/esm/core/bidi/index.js +27 -0
- package/dist/esm/core/bidi/segments.d.ts +22 -0
- package/dist/esm/core/bidi/segments.js +14 -0
- package/dist/esm/core/bytes.d.ts +20 -0
- package/dist/esm/core/bytes.js +24 -1
- package/dist/esm/core/converter/facade.d.ts +38 -1
- package/dist/esm/core/converter/facade.js +25 -0
- package/dist/esm/core/converter/project.d.ts +12 -0
- package/dist/esm/core/converter/project.js +11 -0
- package/dist/esm/core/converter/ream.d.ts +107 -0
- package/dist/esm/core/converter/ream.js +76 -0
- package/dist/esm/core/crypto/asn1.d.ts +77 -0
- package/dist/esm/core/crypto/asn1.js +65 -0
- package/dist/esm/core/crypto/cms.d.ts +25 -0
- package/dist/esm/core/crypto/cms.js +8 -0
- package/dist/esm/core/document-model/index.d.ts +7 -0
- package/dist/esm/core/document-model/types.d.ts +328 -0
- package/dist/esm/core/drawingml/chart-geometry.d.ts +125 -0
- package/dist/esm/core/drawingml/chart-geometry.js +96 -0
- package/dist/esm/core/drawingml/chart-parser.d.ts +34 -0
- package/dist/esm/core/drawingml/chart-parser.js +34 -0
- package/dist/esm/core/drawingml/chart-serializer.d.ts +12 -0
- package/dist/esm/core/drawingml/chart-serializer.js +12 -0
- package/dist/esm/core/drawingml/colors.d.ts +53 -0
- package/dist/esm/core/drawingml/colors.js +41 -0
- package/dist/esm/core/drawingml/preset-geometry.d.ts +30 -0
- package/dist/esm/core/drawingml/preset-geometry.js +30 -0
- package/dist/esm/core/drawingml/shape-render.d.ts +54 -0
- package/dist/esm/core/drawingml/shape-render.js +54 -0
- package/dist/esm/core/drawingml/sparkline-geometry.d.ts +15 -0
- package/dist/esm/core/drawingml/sparkline-geometry.js +13 -0
- package/dist/esm/core/drawingml/theme-parser.d.ts +11 -0
- package/dist/esm/core/drawingml/theme-parser.js +11 -0
- package/dist/esm/core/font/arabic-joining.d.ts +21 -0
- package/dist/esm/core/font/arabic-joining.js +16 -0
- package/dist/esm/core/font/binary-reader.d.ts +17 -0
- package/dist/esm/core/font/binary-reader.js +17 -0
- package/dist/esm/core/font/font-registry.d.ts +37 -0
- package/dist/esm/core/font/font-registry.js +31 -0
- package/dist/esm/core/font/measure.d.ts +20 -0
- package/dist/esm/core/font/measure.js +11 -0
- package/dist/esm/core/font/opentype-layout.d.ts +49 -0
- package/dist/esm/core/font/opentype-layout.js +37 -0
- package/dist/esm/core/font/ttf-parser.d.ts +32 -0
- package/dist/esm/core/font/ttf-parser.js +7 -0
- package/dist/esm/core/font/ttf-subset.d.ts +21 -0
- package/dist/esm/core/font/ttf-subset.js +21 -0
- package/dist/esm/core/fonts/provider.d.ts +8 -1
- package/dist/esm/core/fonts/provider.js +1 -0
- package/dist/esm/core/fonts/remote-fonts.d.ts +22 -0
- package/dist/esm/core/fonts/remote-fonts.js +16 -0
- package/dist/esm/core/hyphenation/index.d.ts +25 -0
- package/dist/esm/core/hyphenation/index.js +17 -0
- package/dist/esm/core/hyphenation/liang.d.ts +27 -0
- package/dist/esm/core/hyphenation/liang.js +14 -0
- package/dist/esm/core/images.d.ts +32 -0
- package/dist/esm/core/images.js +12 -0
- package/dist/esm/core/ir/adapters.d.ts +23 -0
- package/dist/esm/core/ir/features.d.ts +8 -0
- package/dist/esm/core/ir/features.js +1 -0
- package/dist/esm/core/ir/flow.d.ts +20 -0
- package/dist/esm/core/ir/index.d.ts +7 -0
- package/dist/esm/core/ir/loss.d.ts +12 -0
- package/dist/esm/core/ir/loss.js +8 -0
- package/dist/esm/core/ir/resources.d.ts +12 -0
- package/dist/esm/core/ir/resources.js +11 -0
- package/dist/esm/core/ir/sheet.d.ts +81 -0
- package/dist/esm/core/ir/units.d.ts +9 -0
- package/dist/esm/core/ir/units.js +2 -0
- package/dist/esm/core/line-breaker/cjk.d.ts +26 -0
- package/dist/esm/core/line-breaker/cjk.js +60 -0
- package/dist/esm/core/line-breaker/greedy.d.ts +14 -0
- package/dist/esm/core/line-breaker/greedy.js +14 -0
- package/dist/esm/core/line-breaker/index.d.ts +1 -0
- package/dist/esm/core/line-breaker/index.js +3 -0
- package/dist/esm/core/line-breaker/knuth-plass.d.ts +29 -5
- package/dist/esm/core/line-breaker/knuth-plass.js +10 -5
- package/dist/esm/core/numbering/apply.d.ts +19 -0
- package/dist/esm/core/numbering/apply.js +19 -0
- package/dist/esm/core/numbering/state.d.ts +15 -0
- package/dist/esm/core/numbering/state.js +15 -0
- package/dist/esm/core/ole/cfb.d.ts +19 -0
- package/dist/esm/core/ole/cfb.js +16 -0
- package/dist/esm/core/opc/core-properties.d.ts +12 -0
- package/dist/esm/core/opc/core-properties.js +5 -0
- package/dist/esm/core/opc/opc-writer.d.ts +24 -4
- package/dist/esm/core/opc/opc-writer.js +12 -0
- package/dist/esm/core/opc/package.d.ts +55 -0
- package/dist/esm/core/opc/package.js +49 -1
- package/dist/esm/core/opc/relationship-types.d.ts +8 -0
- package/dist/esm/core/opc/relationship-types.js +5 -0
- package/dist/esm/core/opc/relationships.d.ts +12 -0
- package/dist/esm/core/opc/relationships.js +7 -0
- package/dist/esm/core/po-helpers.d.ts +38 -0
- package/dist/esm/core/po-helpers.js +33 -0
- package/dist/esm/core/spreadsheet-model/types.d.ts +302 -0
- package/dist/esm/core/style-cascade/resolver.d.ts +31 -0
- package/dist/esm/core/style-cascade/resolver.js +31 -0
- package/dist/esm/core/style-cascade/table.d.ts +7 -0
- package/dist/esm/core/style-cascade/table.js +7 -0
- package/dist/esm/core/style-cascade/types.d.ts +27 -0
- package/dist/esm/core/style-cascade/types.js +2 -0
- package/dist/esm/core/vector.d.ts +67 -0
- package/dist/esm/core/vector.js +23 -0
- package/dist/esm/excel/activex-parser.d.ts +31 -0
- package/dist/esm/excel/activex-parser.js +24 -0
- package/dist/esm/excel/cell-reference.d.ts +14 -0
- package/dist/esm/excel/cell-reference.js +9 -0
- package/dist/esm/excel/column-bands.d.ts +29 -0
- package/dist/esm/excel/column-bands.js +27 -7
- package/dist/esm/excel/comments-parser.d.ts +19 -0
- package/dist/esm/excel/comments-parser.js +19 -0
- package/dist/esm/excel/conditional-format.d.ts +38 -0
- package/dist/esm/excel/conditional-format.js +25 -0
- package/dist/esm/excel/defined-name-ref.d.ts +21 -0
- package/dist/esm/excel/defined-name-ref.js +20 -0
- package/dist/esm/excel/form-control-parser.d.ts +13 -0
- package/dist/esm/excel/form-control-parser.js +5 -0
- package/dist/esm/excel/formula/context.d.ts +37 -0
- package/dist/esm/excel/formula/dates.d.ts +23 -0
- package/dist/esm/excel/formula/dates.js +20 -0
- package/dist/esm/excel/formula/eval.d.ts +21 -0
- package/dist/esm/excel/formula/eval.js +11 -0
- package/dist/esm/excel/formula/functions.d.ts +12 -0
- package/dist/esm/excel/formula/functions.js +12 -0
- package/dist/esm/excel/formula/index.d.ts +21 -0
- package/dist/esm/excel/formula/index.js +16 -0
- package/dist/esm/excel/formula/lexer.d.ts +12 -0
- package/dist/esm/excel/formula/lexer.js +10 -0
- package/dist/esm/excel/formula/parser.d.ts +20 -0
- package/dist/esm/excel/formula/parser.js +53 -0
- package/dist/esm/excel/formula/value.d.ts +53 -0
- package/dist/esm/excel/formula/value.js +30 -0
- package/dist/esm/excel/header-footer.d.ts +9 -0
- package/dist/esm/excel/header-footer.js +9 -0
- package/dist/esm/excel/number-format.d.ts +34 -0
- package/dist/esm/excel/number-format.js +34 -0
- package/dist/esm/excel/pivot-table-parser.d.ts +8 -0
- package/dist/esm/excel/pivot-table-parser.js +8 -0
- package/dist/esm/excel/print-model.d.ts +77 -1
- package/dist/esm/excel/print-model.js +230 -26
- package/dist/esm/excel/shared-strings-parser.d.ts +13 -0
- package/dist/esm/excel/shared-strings-parser.js +5 -0
- package/dist/esm/excel/sheet-drawing.d.ts +34 -0
- package/dist/esm/excel/sheet-drawing.js +21 -0
- package/dist/esm/excel/sheet-shape-parser.d.ts +12 -0
- package/dist/esm/excel/sheet-shape-parser.js +12 -0
- package/dist/esm/excel/sheet-to-flow.d.ts +29 -0
- package/dist/esm/excel/sheet-to-flow.js +24 -7
- package/dist/esm/excel/slicer-parser.d.ts +23 -0
- package/dist/esm/excel/slicer-parser.js +10 -0
- package/dist/esm/excel/styles-parser.d.ts +8 -0
- package/dist/esm/excel/styles-parser.js +8 -0
- package/dist/esm/excel/table-parser.d.ts +24 -0
- package/dist/esm/excel/table-parser.js +5 -0
- package/dist/esm/excel/workbook-parser.d.ts +17 -0
- package/dist/esm/excel/workbook-parser.js +5 -0
- package/dist/esm/excel/worksheet-parser.d.ts +9 -0
- package/dist/esm/excel/worksheet-parser.js +39 -6
- package/dist/esm/excel/xls/biff-chart.d.ts +10 -0
- package/dist/esm/excel/xls/biff-chart.js +10 -0
- package/dist/esm/excel/xls/biff-reader.d.ts +27 -0
- package/dist/esm/excel/xls/biff-reader.js +44 -0
- package/dist/esm/excel/xls/biff-styles.d.ts +20 -0
- package/dist/esm/excel/xls/biff-styles.js +20 -0
- package/dist/esm/excel/xls/escher.d.ts +27 -0
- package/dist/esm/excel/xls/escher.js +18 -0
- package/dist/esm/excel/xls/xls-reader.d.ts +6 -0
- package/dist/esm/excel/xls/xls-reader.js +6 -0
- package/dist/esm/excel/xlsx-reader.d.ts +30 -0
- package/dist/esm/excel/xlsx-reader.js +38 -4
- package/dist/esm/excel/xlsx-to-pdf.d.ts +27 -0
- package/dist/esm/excel/xlsx-writer.d.ts +14 -0
- package/dist/esm/excel/xlsx-writer.js +13 -0
- package/dist/esm/html/html-writer.d.ts +18 -0
- package/dist/esm/html/html-writer.js +18 -0
- package/dist/esm/index.d.ts +23 -0
- package/dist/esm/layout/math-layout.d.ts +39 -0
- package/dist/esm/layout/math-layout.js +18 -0
- package/dist/esm/layout/page-doc.d.ts +91 -0
- package/dist/esm/layout/styled-layout.d.ts +175 -0
- package/dist/esm/layout/styled-layout.js +136 -4
- package/dist/esm/pdf/builtin-fonts.d.ts +5 -0
- package/dist/esm/pdf/cid-font.d.ts +22 -0
- package/dist/esm/pdf/cid-font.js +10 -0
- package/dist/esm/pdf/embedded-file.d.ts +16 -0
- package/dist/esm/pdf/embedded-file.js +9 -0
- package/dist/esm/pdf/encryption.d.ts +59 -0
- package/dist/esm/pdf/encryption.js +37 -0
- package/dist/esm/pdf/icc-profile.d.ts +8 -0
- package/dist/esm/pdf/icc-profile.js +8 -0
- package/dist/esm/pdf/image-xobject.d.ts +19 -0
- package/dist/esm/pdf/image-xobject.js +9 -0
- package/dist/esm/pdf/objects.d.ts +40 -0
- package/dist/esm/pdf/objects.js +36 -0
- package/dist/esm/pdf/serialize.d.ts +18 -0
- package/dist/esm/pdf/serialize.js +18 -0
- package/dist/esm/pdf/shading.d.ts +16 -0
- package/dist/esm/pdf/shading.js +16 -0
- package/dist/esm/pdf/signature.d.ts +36 -0
- package/dist/esm/pdf/signature.js +22 -0
- package/dist/esm/pdf/struct-tree.d.ts +64 -0
- package/dist/esm/pdf/struct-tree.js +60 -0
- package/dist/esm/pdf/styled-page-emitter.d.ts +33 -0
- package/dist/esm/pdf/styled-page-emitter.js +21 -0
- package/dist/esm/pdf/styled-page-renderer.d.ts +18 -0
- package/dist/esm/pdf/styled-page-renderer.js +18 -0
- package/dist/esm/pdf/text-encoding.d.ts +16 -0
- package/dist/esm/pdf/text-page-renderer.d.ts +11 -0
- package/dist/esm/pdf/vector-graphics.d.ts +12 -0
- package/dist/esm/pdf/vector-graphics.js +12 -0
- package/dist/esm/pdf/writer.d.ts +39 -0
- package/dist/esm/pdf/writer.js +27 -0
- package/dist/esm/pdf/xmp.d.ts +16 -0
- package/dist/esm/pdf/xmp.js +9 -0
- package/dist/esm/pdf-reader/ccitt.d.ts +25 -0
- package/dist/esm/pdf-reader/ccitt.js +15 -0
- package/dist/esm/pdf-reader/cmap.d.ts +12 -0
- package/dist/esm/pdf-reader/cmap.js +9 -0
- package/dist/esm/pdf-reader/content.d.ts +69 -0
- package/dist/esm/pdf-reader/content.js +16 -0
- package/dist/esm/pdf-reader/crypto.d.ts +5 -0
- package/dist/esm/pdf-reader/crypto.js +5 -0
- package/dist/esm/pdf-reader/decrypt.d.ts +17 -0
- package/dist/esm/pdf-reader/decrypt.js +12 -0
- package/dist/esm/pdf-reader/document.d.ts +53 -0
- package/dist/esm/pdf-reader/document.js +50 -0
- package/dist/esm/pdf-reader/flow-build.d.ts +47 -0
- package/dist/esm/pdf-reader/flow-build.js +42 -0
- package/dist/esm/pdf-reader/font.d.ts +12 -0
- package/dist/esm/pdf-reader/font.js +12 -0
- package/dist/esm/pdf-reader/image-decode.d.ts +21 -0
- package/dist/esm/pdf-reader/image-decode.js +14 -0
- package/dist/esm/pdf-reader/images.d.ts +19 -0
- package/dist/esm/pdf-reader/images.js +9 -0
- package/dist/esm/pdf-reader/layout.d.ts +15 -0
- package/dist/esm/pdf-reader/layout.js +15 -0
- package/dist/esm/pdf-reader/lexer.d.ts +43 -0
- package/dist/esm/pdf-reader/lexer.js +38 -0
- package/dist/esm/pdf-reader/parser.d.ts +15 -0
- package/dist/esm/pdf-reader/parser.js +8 -0
- package/dist/esm/pdf-reader/png-encode.d.ts +9 -0
- package/dist/esm/pdf-reader/png-encode.js +8 -0
- package/dist/esm/pdf-reader/predictor.d.ts +9 -0
- package/dist/esm/pdf-reader/predictor.js +8 -0
- package/dist/esm/pdf-reader/reader.d.ts +16 -0
- package/dist/esm/pdf-reader/reader.js +16 -0
- package/dist/esm/pdf-reader/shading.d.ts +10 -0
- package/dist/esm/pdf-reader/shading.js +10 -0
- package/dist/esm/pdf-reader/struct-tree.d.ts +24 -0
- package/dist/esm/pdf-reader/struct-tree.js +12 -0
- package/dist/esm/pdf-reader/tagged.d.ts +13 -0
- package/dist/esm/pdf-reader/tagged.js +13 -0
- package/dist/esm/pdf-reader/text.d.ts +11 -0
- package/dist/esm/pdf-reader/text.js +11 -0
- package/dist/esm/pdf-reader/vector.d.ts +19 -0
- package/dist/esm/pdf-reader/vector.js +9 -0
- package/dist/esm/pptx/placeholder-cascade.d.ts +21 -0
- package/dist/esm/pptx/placeholder-cascade.js +10 -0
- package/dist/esm/pptx/ppt/ppt-reader.d.ts +16 -0
- package/dist/esm/pptx/ppt/ppt-reader.js +16 -0
- package/dist/esm/pptx/ppt/ppt-text.d.ts +55 -0
- package/dist/esm/pptx/ppt/ppt-text.js +14 -0
- package/dist/esm/pptx/pptx-reader.d.ts +21 -0
- package/dist/esm/pptx/pptx-reader.js +23 -2
- package/dist/esm/pptx/slide-parser.d.ts +102 -0
- package/dist/esm/pptx/slide-parser.js +78 -0
- package/dist/esm/pptx/sp-helpers.d.ts +28 -0
- package/dist/esm/pptx/sp-helpers.js +22 -0
- package/dist/esm/svg/svg-writer.d.ts +17 -0
- package/dist/esm/svg/svg-writer.js +16 -0
- package/dist/esm/word/doc/doc-reader.d.ts +16 -0
- package/dist/esm/word/doc/doc-reader.js +16 -0
- package/dist/esm/word/doc/doc-text.d.ts +77 -0
- package/dist/esm/word/doc/doc-text.js +13 -0
- package/dist/esm/word/document-parser.d.ts +134 -0
- package/dist/esm/word/document-parser.js +86 -0
- package/dist/esm/word/docx-reader.d.ts +16 -0
- package/dist/esm/word/docx-reader.js +18 -2
- package/dist/esm/word/docx-to-pdf.d.ts +52 -0
- package/dist/esm/word/docx-to-pdf.js +21 -0
- package/dist/esm/word/docx-writer.d.ts +17 -0
- package/dist/esm/word/docx-writer.js +17 -0
- package/dist/esm/word/drawing-parser.d.ts +88 -0
- package/dist/esm/word/drawing-parser.js +68 -0
- package/dist/esm/word/font-table.d.ts +24 -0
- package/dist/esm/word/font-table.js +24 -0
- package/dist/esm/word/numbering-parser.d.ts +11 -0
- package/dist/esm/word/numbering-parser.js +11 -0
- package/dist/esm/word/omml-parser.d.ts +15 -0
- package/dist/esm/word/omml-parser.js +15 -0
- package/dist/esm/word/omml-serializer.d.ts +9 -0
- package/dist/esm/word/omml-serializer.js +9 -0
- package/dist/esm/word/paragraph-properties.d.ts +10 -0
- package/dist/esm/word/paragraph-properties.js +10 -0
- package/dist/esm/word/po-to-flat.d.ts +11 -0
- package/dist/esm/word/po-to-flat.js +11 -0
- package/dist/esm/word/run-properties.d.ts +10 -0
- package/dist/esm/word/run-properties.js +10 -0
- package/dist/esm/word/settings-parser.d.ts +13 -0
- package/dist/esm/word/settings-parser.js +8 -0
- package/dist/esm/word/styles-parser.d.ts +10 -0
- package/dist/esm/word/styles-parser.js +10 -0
- package/dist/esm/word/table-parser.d.ts +11 -0
- package/dist/esm/word/table-parser.js +11 -0
- package/dist/esm/word/text-extractor.d.ts +9 -0
- package/dist/esm/word/xml-helpers.d.ts +44 -0
- package/dist/esm/word/xml-helpers.js +38 -0
- package/package.json +5 -2
|
@@ -1,14 +1,29 @@
|
|
|
1
1
|
import { NativeBag, Pt, ResourceId } from '../ir/index.js';
|
|
2
2
|
import { ShapeGradient } from '../vector.js';
|
|
3
|
+
/** Paragraph horizontal alignment (`w:jc`); `both` = justified. */
|
|
3
4
|
export type Alignment = 'left' | 'right' | 'center' | 'both' | 'distribute';
|
|
5
|
+
/** Run underline style (ECMA-376 §17.18.99 ST_Underline, the subset Ream renders). */
|
|
4
6
|
export type UnderlineStyle = 'none' | 'single' | 'double' | 'thick' | 'dotted' | 'dottedHeavy' | 'dash' | 'dashHeavy' | 'wave';
|
|
7
|
+
/** Run vertical alignment (`w:vertAlign`): baseline or super/subscript. */
|
|
5
8
|
export type VerticalAlign = 'baseline' | 'superscript' | 'subscript';
|
|
9
|
+
/**
|
|
10
|
+
* The four script slots of `w:rFonts` (§17.3.2.26). A character picks its font
|
|
11
|
+
* from the slot its Unicode range maps to (ASCII, high-ANSI, complex-script,
|
|
12
|
+
* East-Asian).
|
|
13
|
+
*/
|
|
6
14
|
export interface FontFamilyMap {
|
|
7
15
|
readonly ascii?: string;
|
|
8
16
|
readonly hAnsi?: string;
|
|
9
17
|
readonly cs?: string;
|
|
10
18
|
readonly eastAsia?: string;
|
|
11
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* ECMA-376 Part 1 §17.3.2 — Run Properties (`rPr`). All fields optional so the
|
|
22
|
+
* cascade can inherit them (undefined = "inherit from parent in the style
|
|
23
|
+
* chain"). Boolean toggle properties follow §17.17.4: an absent `<w:b/>` means
|
|
24
|
+
* "inherit"; a present `<w:b/>` with no val (or val=true/1/on) means true;
|
|
25
|
+
* val=false/0/off means explicit false.
|
|
26
|
+
*/
|
|
12
27
|
export interface RunProperties {
|
|
13
28
|
readonly styleId?: string;
|
|
14
29
|
readonly bold?: boolean;
|
|
@@ -19,9 +34,27 @@ export interface RunProperties {
|
|
|
19
34
|
readonly colorHex?: string;
|
|
20
35
|
readonly fontFamily?: FontFamilyMap;
|
|
21
36
|
readonly verticalAlign?: VerticalAlign;
|
|
37
|
+
/**
|
|
38
|
+
* ECMA-376 §17.3.2.30 — `w:rtl`. Marks the run as right-to-left, which seeds
|
|
39
|
+
* the BiDi algorithm with an R/AL bias even for neutral characters.
|
|
40
|
+
*/
|
|
22
41
|
readonly rtl?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* ECMA-376 §17.3.2.20 — `w:lang @w:val` (e.g. `"en-US"`, `"ru-RU"`). Used for
|
|
44
|
+
* the tagged-PDF per-element `/Lang`; does not affect visual layout.
|
|
45
|
+
*/
|
|
23
46
|
readonly lang?: string;
|
|
24
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* ECMA-376 Part 1 §17.3.1 — Paragraph Properties (`pPr`). All lengths in
|
|
50
|
+
* canonical Pt (converted from twips by the parser); all fields optional for
|
|
51
|
+
* cascade inheritance.
|
|
52
|
+
*
|
|
53
|
+
* `indentFirstLine` encodes both `<w:ind w:firstLine="…"/>` (positive value)
|
|
54
|
+
* and `<w:ind w:hanging="…"/>` (stored as the negative twips, so a hanging
|
|
55
|
+
* indent of 360 twips becomes `indentFirstLine = -18pt` — the first line ends up
|
|
56
|
+
* 360 twips to the left of `indentLeft`).
|
|
57
|
+
*/
|
|
25
58
|
export interface ParagraphProperties {
|
|
26
59
|
readonly styleId?: string;
|
|
27
60
|
readonly alignment?: Alignment;
|
|
@@ -32,22 +65,55 @@ export interface ParagraphProperties {
|
|
|
32
65
|
readonly indentLeft?: Pt;
|
|
33
66
|
readonly indentRight?: Pt;
|
|
34
67
|
readonly indentFirstLine?: Pt;
|
|
68
|
+
/** The implicit default run properties for runs in this paragraph (`w:pPr/w:rPr`). */
|
|
35
69
|
readonly runProperties?: RunProperties;
|
|
36
70
|
readonly numbering?: NumberingReference;
|
|
71
|
+
/**
|
|
72
|
+
* ECMA-376 Part 1 §17.3.1.21 — `w:pageBreakBefore`. When true, the paragraph
|
|
73
|
+
* starts on a fresh page even if there is room on the current one.
|
|
74
|
+
*/
|
|
37
75
|
readonly pageBreakBefore?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* ECMA-376 §17.3.1.6 — `w:bidi`. Sets the paragraph's base direction to RTL,
|
|
78
|
+
* so the BiDi paragraph embedding level is 1 and default alignment is right.
|
|
79
|
+
*/
|
|
38
80
|
readonly bidi?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* ECMA-376 §17.3.1.20 — `w:outlineLvl`. Outline level 0–8 maps to Heading 1–9;
|
|
83
|
+
* 9 (or absent) is body text. Drives tagged-PDF heading structure (H1–H6).
|
|
84
|
+
*/
|
|
39
85
|
readonly outlineLevel?: number;
|
|
40
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* ECMA-376 §20.4.2.8 — `wp:inline` picture extent inside a `w:r`. Stored on
|
|
89
|
+
* {@link Run} alongside (or instead of) `text` so layout can position the image
|
|
90
|
+
* as if it were a glyph in the line box.
|
|
91
|
+
*/
|
|
41
92
|
export interface InlineImage {
|
|
93
|
+
/**
|
|
94
|
+
* Content-addressed bytes in the document's `ResourceStore`; absent when the
|
|
95
|
+
* source relationship did not resolve (the layout box still reserves space).
|
|
96
|
+
*/
|
|
42
97
|
readonly resource?: ResourceId;
|
|
43
98
|
readonly width: Pt;
|
|
44
99
|
readonly height: Pt;
|
|
45
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* ECMA-376 Part 1 §22 — OfficeMathML (OMML). A recursive math element tree.
|
|
103
|
+
* The union grows by milestone; the layout engine renders structural elements
|
|
104
|
+
* (fraction bars, radicals, big operators, stretchy delimiters) as vector
|
|
105
|
+
* paths and ordinary symbols as font glyphs.
|
|
106
|
+
*/
|
|
46
107
|
export type MathNode = MathRow | MathRun | MathFraction | MathScript | MathRadical | MathNary | MathFunc | MathLimit | MathDelimiter | MathMatrix | MathAccent | MathBar | MathGroupChr | MathEqArray;
|
|
108
|
+
/** A sequence of sibling nodes (`m:oMath`, `m:e`, `m:num`, `m:den`, `m:fName` …). */
|
|
47
109
|
export interface MathRow {
|
|
48
110
|
readonly type: 'row';
|
|
49
111
|
readonly children: ReadonlyArray<MathNode>;
|
|
50
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* `m:r` / `m:t` — literal symbols. `italic`/`bold` come from `m:rPr`/`m:sty`;
|
|
115
|
+
* `nor` (normal text) forces upright. With none set, letters auto-italicise.
|
|
116
|
+
*/
|
|
51
117
|
export interface MathRun {
|
|
52
118
|
readonly type: 'run';
|
|
53
119
|
readonly text: string;
|
|
@@ -55,12 +121,14 @@ export interface MathRun {
|
|
|
55
121
|
readonly bold?: boolean;
|
|
56
122
|
readonly nor?: boolean;
|
|
57
123
|
}
|
|
124
|
+
/** `m:f` — fraction. `barless` = `m:fPr/m:type val="noBar"`. */
|
|
58
125
|
export interface MathFraction {
|
|
59
126
|
readonly type: 'fraction';
|
|
60
127
|
readonly num: MathNode;
|
|
61
128
|
readonly den: MathNode;
|
|
62
129
|
readonly barless?: boolean;
|
|
63
130
|
}
|
|
131
|
+
/** `m:sSup` / `m:sSub` / `m:sSubSup` / `m:sPre` (pre-scripts). */
|
|
64
132
|
export interface MathScript {
|
|
65
133
|
readonly type: 'script';
|
|
66
134
|
readonly base: MathNode;
|
|
@@ -68,11 +136,13 @@ export interface MathScript {
|
|
|
68
136
|
readonly sup?: MathNode;
|
|
69
137
|
readonly pre?: boolean;
|
|
70
138
|
}
|
|
139
|
+
/** `m:rad` — radical with optional degree (`m:deg`). */
|
|
71
140
|
export interface MathRadical {
|
|
72
141
|
readonly type: 'radical';
|
|
73
142
|
readonly radicand: MathNode;
|
|
74
143
|
readonly degree?: MathNode;
|
|
75
144
|
}
|
|
145
|
+
/** `m:nary` — n-ary operator (∑ ∏ ∫ …) with optional sub/sup limits. */
|
|
76
146
|
export interface MathNary {
|
|
77
147
|
readonly type: 'nary';
|
|
78
148
|
readonly op: string;
|
|
@@ -81,17 +151,20 @@ export interface MathNary {
|
|
|
81
151
|
readonly sup?: MathNode;
|
|
82
152
|
readonly limLoc?: 'undOvr' | 'subSup';
|
|
83
153
|
}
|
|
154
|
+
/** `m:func` — function application (sin x, …): a name applied to an argument. */
|
|
84
155
|
export interface MathFunc {
|
|
85
156
|
readonly type: 'func';
|
|
86
157
|
readonly name: MathNode;
|
|
87
158
|
readonly body: MathNode;
|
|
88
159
|
}
|
|
160
|
+
/** `m:limLow` / `m:limUpp` — a limit below/above the base. */
|
|
89
161
|
export interface MathLimit {
|
|
90
162
|
readonly type: 'limit';
|
|
91
163
|
readonly base: MathNode;
|
|
92
164
|
readonly lim: MathNode;
|
|
93
165
|
readonly pos: 'low' | 'upp';
|
|
94
166
|
}
|
|
167
|
+
/** `m:d` — delimiters around one or more elements. */
|
|
95
168
|
export interface MathDelimiter {
|
|
96
169
|
readonly type: 'delimiter';
|
|
97
170
|
readonly begChr: string;
|
|
@@ -99,53 +172,114 @@ export interface MathDelimiter {
|
|
|
99
172
|
readonly sepChr?: string;
|
|
100
173
|
readonly children: ReadonlyArray<MathNode>;
|
|
101
174
|
}
|
|
175
|
+
/** `m:m` — matrix of cells (rows × columns). */
|
|
102
176
|
export interface MathMatrix {
|
|
103
177
|
readonly type: 'matrix';
|
|
104
178
|
readonly rows: ReadonlyArray<ReadonlyArray<MathNode>>;
|
|
105
179
|
}
|
|
180
|
+
/** `m:acc` — accent character over a base (hat, bar, vec, dot, tilde …). */
|
|
106
181
|
export interface MathAccent {
|
|
107
182
|
readonly type: 'accent';
|
|
108
183
|
readonly char: string;
|
|
109
184
|
readonly base: MathNode;
|
|
110
185
|
}
|
|
186
|
+
/** `m:bar` — a bar above or below the base. */
|
|
111
187
|
export interface MathBar {
|
|
112
188
|
readonly type: 'bar';
|
|
113
189
|
readonly base: MathNode;
|
|
114
190
|
readonly pos: 'top' | 'bot';
|
|
115
191
|
}
|
|
192
|
+
/** `m:groupChr` — a grouping character (brace …) above or below the base. */
|
|
116
193
|
export interface MathGroupChr {
|
|
117
194
|
readonly type: 'groupChr';
|
|
118
195
|
readonly char: string;
|
|
119
196
|
readonly base: MathNode;
|
|
120
197
|
readonly pos: 'top' | 'bot';
|
|
121
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* `m:eqArr` — an equation array: a stack of equations, each on its own line,
|
|
201
|
+
* left-aligned, the block vertically centred on the math axis.
|
|
202
|
+
*/
|
|
122
203
|
export interface MathEqArray {
|
|
123
204
|
readonly type: 'eqArr';
|
|
124
205
|
readonly rows: ReadonlyArray<MathNode>;
|
|
125
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* ECMA-376 Part 1 §17.3.2 — a run: a span of `text` (or an inline image / math
|
|
209
|
+
* object) sharing one set of {@link RunProperties}, plus the reference markers
|
|
210
|
+
* (hyperlink, note, comment, page-number field) the layout acts on.
|
|
211
|
+
*/
|
|
126
212
|
export interface Run {
|
|
127
213
|
readonly native?: NativeBag;
|
|
128
214
|
readonly text: string;
|
|
129
215
|
readonly properties: RunProperties;
|
|
216
|
+
/**
|
|
217
|
+
* ECMA-376 §17.16.22 — the run sits inside a `w:hyperlink` whose `r:id`
|
|
218
|
+
* resolved to an external target. The URL is stored as written in the rels
|
|
219
|
+
* part; writers MUST pass it through the scheme allowlist (`core/links`)
|
|
220
|
+
* before emitting anything clickable.
|
|
221
|
+
*/
|
|
130
222
|
readonly href?: string;
|
|
223
|
+
/**
|
|
224
|
+
* §17.16.5.35 PAGE / §17.16.5.33 NUMPAGES — the run is a page-number field;
|
|
225
|
+
* `text` holds the source's cached result. Header/footer rendering
|
|
226
|
+
* substitutes the real number per page; body rendering keeps the cache.
|
|
227
|
+
*/
|
|
131
228
|
readonly field?: 'PAGE' | 'NUMPAGES';
|
|
229
|
+
/**
|
|
230
|
+
* §17.16.22 `w:hyperlink @w:anchor` — internal link target: a bookmark name
|
|
231
|
+
* in this document (never a URL — bypasses the scheme allowlist).
|
|
232
|
+
*/
|
|
132
233
|
readonly anchor?: string;
|
|
133
234
|
readonly footnoteRef?: string;
|
|
134
235
|
readonly endnoteRef?: string;
|
|
236
|
+
/**
|
|
237
|
+
* §17.13.4.1 `w:commentReference` — the run anchors a review comment by id;
|
|
238
|
+
* the comment's content/author live in `FlowDoc.comments`.
|
|
239
|
+
*/
|
|
135
240
|
readonly commentRef?: string;
|
|
241
|
+
/**
|
|
242
|
+
* §17.13.4.3/4 `w:commentRangeStart`/`End` — the ids of the comment ranges
|
|
243
|
+
* this run falls inside (a run may be covered by several). Renderers highlight
|
|
244
|
+
* the covered span; the marker run (`commentRef`) sits at the range's end.
|
|
245
|
+
*/
|
|
136
246
|
readonly commentRangeRefs?: ReadonlyArray<string>;
|
|
247
|
+
/**
|
|
248
|
+
* §17.11.13 `w:footnoteRef` / §17.11.5 `w:endnoteRef` — inside note content:
|
|
249
|
+
* render the OWNING note's number here.
|
|
250
|
+
*/
|
|
137
251
|
readonly noteNumber?: true;
|
|
252
|
+
/**
|
|
253
|
+
* The run is a list-item marker materialized by `applyNumbering` (`"1."`,
|
|
254
|
+
* `"•"`). Tagged PDF wraps its glyphs in a Lbl structure element (§14.8.4.3.3).
|
|
255
|
+
*/
|
|
138
256
|
readonly listMarker?: true;
|
|
257
|
+
/** When set, the run renders this image inline in the line; `text` is ignored. */
|
|
139
258
|
readonly inlineImage?: InlineImage;
|
|
259
|
+
/** When set, the run is an inline OfficeMath object; `text` is ignored. */
|
|
140
260
|
readonly math?: MathNode;
|
|
261
|
+
/**
|
|
262
|
+
* ECMA-376 Part 1 §17.3.3.1 — `w:br w:type="page"`. A forced page break: the
|
|
263
|
+
* paragraph's following content starts on a new page.
|
|
264
|
+
*/
|
|
141
265
|
readonly pageBreak?: boolean;
|
|
142
266
|
}
|
|
267
|
+
/** ECMA-376 Part 1 §17.3.1 — a paragraph: its {@link ParagraphProperties} and runs. */
|
|
143
268
|
export interface Paragraph {
|
|
144
269
|
readonly native?: NativeBag;
|
|
145
270
|
readonly properties: ParagraphProperties;
|
|
146
271
|
readonly runs: ReadonlyArray<Run>;
|
|
272
|
+
/**
|
|
273
|
+
* §17.13.6.2 `w:bookmarkStart` — names of bookmarks opening in (or
|
|
274
|
+
* immediately before) this paragraph. Paragraph-level v1: the destination
|
|
275
|
+
* is the paragraph's first line.
|
|
276
|
+
*/
|
|
147
277
|
readonly bookmarks?: ReadonlyArray<string>;
|
|
148
278
|
}
|
|
279
|
+
/**
|
|
280
|
+
* ECMA-376 Part 1 §17.13.4.2 `w:comment` — a review comment: its block content
|
|
281
|
+
* plus the author/date attribution. Anchored from a run's `commentRef`.
|
|
282
|
+
*/
|
|
149
283
|
export interface Comment {
|
|
150
284
|
readonly content: ReadonlyArray<BodyElement>;
|
|
151
285
|
readonly author?: string;
|
|
@@ -167,32 +301,46 @@ export interface Comment {
|
|
|
167
301
|
/** w15:done — the comment thread was marked resolved. */
|
|
168
302
|
readonly done?: boolean;
|
|
169
303
|
}
|
|
304
|
+
/** ECMA-376 Part 1 §17.9 — `w:numFmt` list marker format. */
|
|
170
305
|
export type NumberingFormat = 'decimal' | 'lowerLetter' | 'upperLetter' | 'lowerRoman' | 'upperRoman' | 'bullet' | 'none';
|
|
306
|
+
/** A paragraph's list reference (`w:numPr`): the numbering instance id + level. */
|
|
171
307
|
export interface NumberingReference {
|
|
172
308
|
readonly numId: string;
|
|
173
309
|
readonly ilvl: number;
|
|
174
310
|
}
|
|
311
|
+
/** One level of an abstract numbering definition (`w:lvl`): its format and chrome. */
|
|
175
312
|
export interface NumberingLevel {
|
|
176
313
|
readonly ilvl: number;
|
|
177
314
|
readonly start: number;
|
|
178
315
|
readonly format: NumberingFormat;
|
|
316
|
+
/** §17.9.11 `w:lvlText` — the marker template (e.g. `"%1."`). */
|
|
179
317
|
readonly lvlText: string;
|
|
180
318
|
readonly paragraphProperties: ParagraphProperties;
|
|
181
319
|
readonly runProperties: RunProperties;
|
|
182
320
|
}
|
|
321
|
+
/** §17.9.1 `w:abstractNum` — a reusable list definition keyed by level. */
|
|
183
322
|
export interface AbstractNumbering {
|
|
184
323
|
readonly id: string;
|
|
185
324
|
readonly levels: ReadonlyMap<number, NumberingLevel>;
|
|
186
325
|
}
|
|
326
|
+
/** §17.9.18 `w:num` — a concrete list instance bound to an {@link AbstractNumbering}. */
|
|
187
327
|
export interface NumberingInstance {
|
|
188
328
|
readonly numId: string;
|
|
189
329
|
readonly abstractNumId: string;
|
|
190
330
|
}
|
|
331
|
+
/** The parsed `word/numbering.xml`: abstract definitions + their instances. */
|
|
191
332
|
export interface Numbering {
|
|
192
333
|
readonly abstractNums: ReadonlyMap<string, AbstractNumbering>;
|
|
193
334
|
readonly numInstances: ReadonlyMap<string, NumberingInstance>;
|
|
194
335
|
}
|
|
336
|
+
/** ECMA-376 Part 1 §17.7 — `w:style @w:type` style category. */
|
|
195
337
|
export type StyleType = 'paragraph' | 'character' | 'table' | 'numbering';
|
|
338
|
+
/**
|
|
339
|
+
* §17.7.6 — one table-style formatting layer: the style's own base layer
|
|
340
|
+
* (`w:style/tblPr` + `tcPr` + `rPr` + `pPr`) or one conditional override
|
|
341
|
+
* (`w:tblStylePr`). Borders come from `tblBorders` (table layer) or `tcBorders`
|
|
342
|
+
* (region layer) — whichever the layer carries.
|
|
343
|
+
*/
|
|
196
344
|
export interface TableStyleLayer {
|
|
197
345
|
readonly borders?: CellBorders;
|
|
198
346
|
readonly cellMargins?: CellMargins;
|
|
@@ -200,11 +348,18 @@ export interface TableStyleLayer {
|
|
|
200
348
|
readonly runProperties?: RunProperties;
|
|
201
349
|
readonly paragraphProperties?: ParagraphProperties;
|
|
202
350
|
}
|
|
351
|
+
/** §17.7.6.3 `w:tblStylePr @w:type` — the table regions a conditional layer targets. */
|
|
203
352
|
export type TableStyleConditionType = 'wholeTable' | 'band1Vert' | 'band2Vert' | 'band1Horz' | 'band2Horz' | 'firstCol' | 'lastCol' | 'firstRow' | 'lastRow' | 'nwCell' | 'neCell' | 'swCell' | 'seCell';
|
|
353
|
+
/** A conditional table-style override: the region `type` and the layer it applies. */
|
|
204
354
|
export interface TableStyleCondition {
|
|
205
355
|
readonly type: TableStyleConditionType;
|
|
206
356
|
readonly layer: TableStyleLayer;
|
|
207
357
|
}
|
|
358
|
+
/**
|
|
359
|
+
* ECMA-376 §17.7 — one style definition: its id, category, `basedOn` parent,
|
|
360
|
+
* and the run/paragraph properties it contributes (plus the table-style layers
|
|
361
|
+
* for `type === 'table'`).
|
|
362
|
+
*/
|
|
208
363
|
export interface Style {
|
|
209
364
|
readonly id: string;
|
|
210
365
|
readonly type: StyleType;
|
|
@@ -212,22 +367,32 @@ export interface Style {
|
|
|
212
367
|
readonly isDefault: boolean;
|
|
213
368
|
readonly runProperties: RunProperties;
|
|
214
369
|
readonly paragraphProperties: ParagraphProperties;
|
|
370
|
+
/** Table styles only (§17.7.6): the base layer and conditional overrides. */
|
|
215
371
|
readonly tableLayer?: TableStyleLayer;
|
|
216
372
|
readonly tableConditions?: ReadonlyArray<TableStyleCondition>;
|
|
373
|
+
/** `w:tblPr/w:tblStyleRowBandSize` / `ColBandSize` (default 1). */
|
|
217
374
|
readonly rowBandSize?: number;
|
|
218
375
|
readonly colBandSize?: number;
|
|
219
376
|
}
|
|
377
|
+
/**
|
|
378
|
+
* The parsed `word/styles.xml`: document defaults (`docDefaults`) plus the
|
|
379
|
+
* styles map keyed by id. The cascade resolver merges these into the resolved
|
|
380
|
+
* property objects the renderer consumes.
|
|
381
|
+
*/
|
|
220
382
|
export interface StyleSheet {
|
|
221
383
|
readonly defaultRunProperties: RunProperties;
|
|
222
384
|
readonly defaultParagraphProperties: ParagraphProperties;
|
|
223
385
|
readonly styles: ReadonlyMap<string, Style>;
|
|
224
386
|
}
|
|
387
|
+
/** §17.18.2 ST_Border — a cell-border line style (the subset Ream renders). */
|
|
225
388
|
export type BorderStyle = 'none' | 'single' | 'double' | 'thick' | 'dotted' | 'dashed';
|
|
389
|
+
/** One border edge: its line style plus optional width and colour. */
|
|
226
390
|
export interface Border {
|
|
227
391
|
readonly style: BorderStyle;
|
|
228
392
|
readonly width?: Pt;
|
|
229
393
|
readonly colorHex?: string;
|
|
230
394
|
}
|
|
395
|
+
/** §17.4.39 `w:tcBorders` — the per-edge borders of a cell (or table). */
|
|
231
396
|
export interface CellBorders {
|
|
232
397
|
readonly top?: Border;
|
|
233
398
|
readonly right?: Border;
|
|
@@ -235,38 +400,78 @@ export interface CellBorders {
|
|
|
235
400
|
readonly left?: Border;
|
|
236
401
|
readonly insideH?: Border;
|
|
237
402
|
readonly insideV?: Border;
|
|
403
|
+
/**
|
|
404
|
+
* Diagonal strokes across the cell box: `diagonalDown` runs top-left →
|
|
405
|
+
* bottom-right, `diagonalUp` bottom-left → top-right (Excel diagonal borders).
|
|
406
|
+
*/
|
|
238
407
|
readonly diagonalDown?: Border;
|
|
239
408
|
readonly diagonalUp?: Border;
|
|
240
409
|
}
|
|
410
|
+
/** §17.4.42 `w:tcMar` — a cell's inner padding per side. */
|
|
241
411
|
export interface CellMargins {
|
|
242
412
|
readonly top?: Pt;
|
|
243
413
|
readonly right?: Pt;
|
|
244
414
|
readonly bottom?: Pt;
|
|
245
415
|
readonly left?: Pt;
|
|
246
416
|
}
|
|
417
|
+
/** §17.4.33 `w:shd` — a cell's solid background fill (6-hex). */
|
|
247
418
|
export interface CellShading {
|
|
248
419
|
readonly colorHex: string;
|
|
249
420
|
}
|
|
421
|
+
/**
|
|
422
|
+
* A conditional-format data bar: a horizontal bar of width `fraction` (`0..1` of
|
|
423
|
+
* the cell), painted over the shading and under the text (E-SHEET SC1c). It
|
|
424
|
+
* starts at `startFraction` from the cell's left (default 0); a mixed-sign range
|
|
425
|
+
* puts the axis inside the cell so negative bars run left of it (tail TC4).
|
|
426
|
+
*/
|
|
250
427
|
export interface CellDataBar {
|
|
251
428
|
readonly fraction: number;
|
|
252
429
|
readonly colorHex: string;
|
|
253
430
|
readonly startFraction?: number;
|
|
254
431
|
}
|
|
432
|
+
/**
|
|
433
|
+
* A conditional-format icon: a small glyph at the cell's left, chosen by the
|
|
434
|
+
* value's bucket (E-SHEET SC1c). Format-neutral — the xlsx layer maps Excel's
|
|
435
|
+
* named icon families (3TrafficLights, 3Arrows, …) onto these shapes + colours.
|
|
436
|
+
*/
|
|
255
437
|
export type CellIconShape = 'circle' | 'square' | 'diamond' | 'triangleUp' | 'triangleDown' | 'triangleRight' | 'check' | 'cross' | 'exclamation' | 'bars' | 'pie';
|
|
438
|
+
/** One resolved conditional-format icon: its {@link CellIconShape}, colour and fill level. */
|
|
256
439
|
export interface CellIcon {
|
|
257
440
|
readonly shape: CellIconShape;
|
|
258
441
|
readonly colorHex: string;
|
|
442
|
+
/**
|
|
443
|
+
* Meter glyphs (`bars` / `pie`): how many of `levels` units are filled with
|
|
444
|
+
* `colorHex`; the rest are drawn in a neutral grey. Absent for single glyphs.
|
|
445
|
+
*/
|
|
259
446
|
readonly fill?: {
|
|
260
447
|
readonly filled: number;
|
|
261
448
|
readonly levels: number;
|
|
262
449
|
};
|
|
263
450
|
}
|
|
451
|
+
/**
|
|
452
|
+
* A sparkline: a mini chart filling the cell, plotting `values` (E-SHEET SC2).
|
|
453
|
+
* Format-neutral — the xlsx layer resolves the data range to a value sequence;
|
|
454
|
+
* the layout renders line / column / win-loss geometry sized to the cell.
|
|
455
|
+
*/
|
|
264
456
|
export interface CellSparkline {
|
|
265
457
|
readonly kind: 'line' | 'column' | 'winLoss';
|
|
458
|
+
/**
|
|
459
|
+
* A blank/non-numeric cell in the range is a gap (`null`) so x-positions stay
|
|
460
|
+
* aligned: a line breaks across it, a column/win-loss skips its slot.
|
|
461
|
+
*/
|
|
266
462
|
readonly values: ReadonlyArray<number | null>;
|
|
267
463
|
readonly colorHex?: string;
|
|
268
464
|
}
|
|
465
|
+
/**
|
|
466
|
+
* Resolved position of a cell in a vertical merge group (ECMA-376 §17.4.85
|
|
467
|
+
* `vMerge` markers are resolved by the reader): `start` opens a group that at
|
|
468
|
+
* least one cell continues, `middle` / `end` are continuations; undefined =
|
|
469
|
+
* not merged. Continuation cells stay in their rows (they hold the column
|
|
470
|
+
* slot); writers that need an HTML-style rowSpan can derive it by counting a
|
|
471
|
+
* start's middle/end run downwards.
|
|
472
|
+
*/
|
|
269
473
|
export type CellMerge = 'start' | 'middle' | 'end';
|
|
474
|
+
/** §17.4.30 `w:tcPr` — a cell's properties: span/merge, chrome, and CF overlays. */
|
|
270
475
|
export interface CellProperties {
|
|
271
476
|
readonly width?: Pt;
|
|
272
477
|
readonly colSpan?: number;
|
|
@@ -277,15 +482,29 @@ export interface CellProperties {
|
|
|
277
482
|
readonly dataBar?: CellDataBar;
|
|
278
483
|
readonly icon?: CellIcon;
|
|
279
484
|
readonly sparkline?: CellSparkline;
|
|
485
|
+
/**
|
|
486
|
+
* A data-validation `list` cell (E-SHEET SV1): the renderer paints an in-cell
|
|
487
|
+
* dropdown affordance at the cell's right edge (a small button + ▾ glyph).
|
|
488
|
+
*/
|
|
280
489
|
readonly dropdown?: boolean;
|
|
281
490
|
}
|
|
491
|
+
/** §17.4.81 `w:trPr` — a table row's properties: height, split/header flags. */
|
|
282
492
|
export interface RowProperties {
|
|
283
493
|
readonly height?: Pt;
|
|
284
494
|
readonly heightRule?: 'auto' | 'atLeast' | 'exact';
|
|
285
495
|
readonly cantSplit?: boolean;
|
|
286
496
|
readonly isHeader?: boolean;
|
|
497
|
+
/**
|
|
498
|
+
* Force this row to begin a new page (xlsx manual `<rowBreaks>`). The renderer
|
|
499
|
+
* flushes the page before the row, then repeats any leading header rows.
|
|
500
|
+
*/
|
|
287
501
|
readonly pageBreakBefore?: boolean;
|
|
288
502
|
}
|
|
503
|
+
/**
|
|
504
|
+
* §17.4.62 `w:tblLook` — which of the table style's conditional formats apply.
|
|
505
|
+
* Modern files carry explicit attributes; legacy files a hex bitmask (both
|
|
506
|
+
* parsed). Band flags are negative ("no band") per the spec.
|
|
507
|
+
*/
|
|
289
508
|
export interface TableLook {
|
|
290
509
|
readonly firstRow?: boolean;
|
|
291
510
|
readonly lastRow?: boolean;
|
|
@@ -294,7 +513,12 @@ export interface TableLook {
|
|
|
294
513
|
readonly noHBand?: boolean;
|
|
295
514
|
readonly noVBand?: boolean;
|
|
296
515
|
}
|
|
516
|
+
/** §17.4.60 `w:tblPr` — a table's properties: style ref, width/layout, chrome. */
|
|
297
517
|
export interface TableProperties {
|
|
518
|
+
/**
|
|
519
|
+
* §17.7.6 — raw reference to a table style (resolved by the reader's
|
|
520
|
+
* `resolveTableStyles` transform; round-trip material afterwards).
|
|
521
|
+
*/
|
|
298
522
|
readonly styleId?: string;
|
|
299
523
|
readonly look?: TableLook;
|
|
300
524
|
readonly widthPt?: Pt;
|
|
@@ -303,34 +527,61 @@ export interface TableProperties {
|
|
|
303
527
|
readonly layout?: 'auto' | 'fixed';
|
|
304
528
|
readonly defaultCellMargins?: CellMargins;
|
|
305
529
|
readonly borders?: CellBorders;
|
|
530
|
+
/**
|
|
531
|
+
* ECMA-376 §17.4.27 (`w:jc`) / xlsx `<printOptions horizontalCentered>`.
|
|
532
|
+
* Centers or right-aligns a table narrower than the content width; absent ⇒ left.
|
|
533
|
+
*/
|
|
306
534
|
readonly alignment?: 'left' | 'center' | 'right';
|
|
535
|
+
/**
|
|
536
|
+
* A sticky-pane hint from a frozen worksheet view (E-SHEET SE3): the first
|
|
537
|
+
* `rows` rows / `cols` columns stay pinned while the rest scrolls. Consumed
|
|
538
|
+
* only by the HTML writer (an interactive target); PDF/SVG ignore it.
|
|
539
|
+
*/
|
|
307
540
|
readonly frozen?: {
|
|
308
541
|
readonly rows: number;
|
|
309
542
|
readonly cols: number;
|
|
310
543
|
};
|
|
311
544
|
}
|
|
545
|
+
/** §17.4.66 `w:tc` — a table cell: its {@link CellProperties} and block content. */
|
|
312
546
|
export interface TableCell {
|
|
313
547
|
readonly properties: CellProperties;
|
|
314
548
|
readonly content: ReadonlyArray<BodyElement>;
|
|
315
549
|
}
|
|
550
|
+
/** §17.4.79 `w:tr` — a table row: its {@link RowProperties} and cells. */
|
|
316
551
|
export interface TableRow {
|
|
317
552
|
readonly properties: RowProperties;
|
|
318
553
|
readonly cells: ReadonlyArray<TableCell>;
|
|
319
554
|
}
|
|
555
|
+
/**
|
|
556
|
+
* §17.4.38 `w:tbl` — a table: its {@link TableProperties}, the `w:tblGrid`
|
|
557
|
+
* column widths (`grid`), and its rows.
|
|
558
|
+
*/
|
|
320
559
|
export interface Table {
|
|
321
560
|
readonly native?: NativeBag;
|
|
322
561
|
readonly properties: TableProperties;
|
|
323
562
|
readonly grid: ReadonlyArray<Pt>;
|
|
324
563
|
readonly rows: ReadonlyArray<TableRow>;
|
|
325
564
|
}
|
|
565
|
+
/**
|
|
566
|
+
* ECMA-376 Part 1 §20.4.2.8 — a block-level image (`wp:inline` picture extent).
|
|
567
|
+
* EMU = English Metric Units: 914400 per inch (1 pt = 12700 EMU).
|
|
568
|
+
*/
|
|
326
569
|
export interface ImageBlock {
|
|
570
|
+
/** §20.4.2.3 — present when the drawing is anchored (floating). */
|
|
327
571
|
readonly float?: FloatAnchor;
|
|
328
572
|
readonly resource?: ResourceId;
|
|
329
573
|
readonly width: Pt;
|
|
330
574
|
readonly height: Pt;
|
|
331
575
|
readonly paragraphProperties: ParagraphProperties;
|
|
576
|
+
/** `wp:docPr @descr/@title` — alternate text for the tagged-PDF Figure (`/Alt`). */
|
|
332
577
|
readonly altText?: string;
|
|
333
578
|
}
|
|
579
|
+
/**
|
|
580
|
+
* §20.1.10.55 prstGeom path command (custGeom `<a:pathLst>`), in path-space
|
|
581
|
+
* units (`a:path @w/@h`). `quad` is elevated to cubic at layout; `arc` uses the
|
|
582
|
+
* DrawingML angle convention (1/60000°, clockwise, y-down) and is converted
|
|
583
|
+
* to beziers by the geometry layer.
|
|
584
|
+
*/
|
|
334
585
|
export type CustomPathCmd = {
|
|
335
586
|
readonly cmd: 'move';
|
|
336
587
|
readonly x: number;
|
|
@@ -362,24 +613,33 @@ export type CustomPathCmd = {
|
|
|
362
613
|
} | {
|
|
363
614
|
readonly cmd: 'close';
|
|
364
615
|
};
|
|
616
|
+
/**
|
|
617
|
+
* §20.1.9.11 `custGeom` — a custom geometry: its path-space extent
|
|
618
|
+
* (`pathWidth`/`pathHeight`) and the {@link CustomPathCmd} list that draws it.
|
|
619
|
+
*/
|
|
365
620
|
export interface CustomGeometry {
|
|
366
621
|
readonly pathWidth: number;
|
|
367
622
|
readonly pathHeight: number;
|
|
368
623
|
readonly commands: ReadonlyArray<CustomPathCmd>;
|
|
369
624
|
}
|
|
625
|
+
/** §20.1.10.55 `prstGeom` / §20.1.9.11 `custGeom` — a shape's geometry source. */
|
|
370
626
|
export interface ShapeGeometry {
|
|
371
627
|
readonly kind: 'preset' | 'custom';
|
|
372
628
|
readonly preset?: string;
|
|
373
629
|
readonly adjust?: ReadonlyMap<string, number>;
|
|
374
630
|
readonly custom?: CustomGeometry;
|
|
375
631
|
}
|
|
632
|
+
/** A shape's fill mode (`a:noFill`/`a:solidFill`/`a:gradFill`). */
|
|
376
633
|
export type ShapeFillKind = 'none' | 'solid' | 'gradient';
|
|
634
|
+
/** A shape's fill: none, a solid colour, or a {@link ShapeGradient}. */
|
|
377
635
|
export interface ShapeFill {
|
|
378
636
|
readonly kind: ShapeFillKind;
|
|
379
637
|
readonly colorHex?: string;
|
|
380
638
|
readonly gradient?: ShapeGradient;
|
|
381
639
|
}
|
|
640
|
+
/** §20.1.10.49 ST_PresetLineDashVal — a shape outline's preset dash pattern. */
|
|
382
641
|
export type ShapeDash = 'solid' | 'dot' | 'dash' | 'dashDot' | 'lgDash' | 'lgDashDot' | 'sysDash' | 'sysDot';
|
|
642
|
+
/** §20.1.2.2.24 `a:ln` — a shape's outline (stroke). */
|
|
383
643
|
export interface ShapeLine {
|
|
384
644
|
readonly width?: Pt;
|
|
385
645
|
readonly colorHex?: string;
|
|
@@ -387,11 +647,13 @@ export interface ShapeLine {
|
|
|
387
647
|
readonly cap?: 'flat' | 'round' | 'square';
|
|
388
648
|
readonly fill?: 'solid' | 'none';
|
|
389
649
|
}
|
|
650
|
+
/** §20.1.7.6 `a:xfrm` — a shape's rotation (1/60000°, clockwise) + flips. */
|
|
390
651
|
export interface ShapeTransform {
|
|
391
652
|
readonly rotation60k?: number;
|
|
392
653
|
readonly flipH?: boolean;
|
|
393
654
|
readonly flipV?: boolean;
|
|
394
655
|
}
|
|
656
|
+
/** `wps:txbx` (`w:txbxContent`) + `wps:bodyPr` — text inside a shape. */
|
|
395
657
|
export interface ShapeTextBody {
|
|
396
658
|
readonly content: ReadonlyArray<BodyElement>;
|
|
397
659
|
readonly insetLeft?: Pt;
|
|
@@ -400,7 +662,14 @@ export interface ShapeTextBody {
|
|
|
400
662
|
readonly insetBottom?: Pt;
|
|
401
663
|
readonly anchor?: 't' | 'ctr' | 'b';
|
|
402
664
|
}
|
|
665
|
+
/**
|
|
666
|
+
* A block-level DrawingML shape (§20.1): its size, {@link ShapeGeometry}, fill,
|
|
667
|
+
* outline, transform and optional text body. A standalone shape carries the
|
|
668
|
+
* paragraph's properties for block spacing / alignment, mirroring
|
|
669
|
+
* {@link ImageBlock}.
|
|
670
|
+
*/
|
|
403
671
|
export interface ShapeBlock {
|
|
672
|
+
/** §20.4.2.3 — present when the drawing is anchored (floating). */
|
|
404
673
|
readonly float?: FloatAnchor;
|
|
405
674
|
readonly width: Pt;
|
|
406
675
|
readonly height: Pt;
|
|
@@ -410,13 +679,24 @@ export interface ShapeBlock {
|
|
|
410
679
|
readonly transform?: ShapeTransform;
|
|
411
680
|
readonly text?: ShapeTextBody;
|
|
412
681
|
readonly paragraphProperties: ParagraphProperties;
|
|
682
|
+
/** `wp:docPr @descr/@title` — alternate text for the tagged-PDF Figure (`/Alt`). */
|
|
413
683
|
readonly altText?: string;
|
|
414
684
|
}
|
|
685
|
+
/**
|
|
686
|
+
* ECMA-376 Part 1 §21.2 — the kind of a DrawingML chart. A chart is referenced
|
|
687
|
+
* from a `w:drawing` (`a:graphicData uri=…/chart` → `c:chart r:id`) and its data
|
|
688
|
+
* lives in a separate chart part (e.g. `word/charts/chart1.xml`). The parsed
|
|
689
|
+
* {@link Chart} is keyed by that relationship id and supplied to the renderer
|
|
690
|
+
* alongside the body (mirroring image bytes), so {@link ChartBlock} only carries
|
|
691
|
+
* the ref.
|
|
692
|
+
*/
|
|
415
693
|
export type ChartType = 'bar' | 'line' | 'pie' | 'area' | 'scatter' | 'unknown';
|
|
694
|
+
/** A per-point colour override (`c:dPt`) at series index `idx`. */
|
|
416
695
|
export interface ChartDataPoint {
|
|
417
696
|
readonly idx: number;
|
|
418
697
|
readonly colorHex: string;
|
|
419
698
|
}
|
|
699
|
+
/** One chart data series (`c:ser`): its name, values and colour overrides. */
|
|
420
700
|
export interface ChartSeries {
|
|
421
701
|
readonly name?: string;
|
|
422
702
|
readonly values: ReadonlyArray<number>;
|
|
@@ -424,6 +704,7 @@ export interface ChartSeries {
|
|
|
424
704
|
readonly colorHex?: string;
|
|
425
705
|
readonly pointColors?: ReadonlyArray<ChartDataPoint>;
|
|
426
706
|
}
|
|
707
|
+
/** A parsed chart (§21.2): its type, title, categories, series and rendering options. */
|
|
427
708
|
export interface Chart {
|
|
428
709
|
readonly type: ChartType;
|
|
429
710
|
readonly title?: string;
|
|
@@ -437,16 +718,24 @@ export interface Chart {
|
|
|
437
718
|
readonly showValues?: boolean;
|
|
438
719
|
readonly catAxisTitle?: string;
|
|
439
720
|
readonly valAxisTitle?: string;
|
|
721
|
+
/**
|
|
722
|
+
* MS-ODRAWXML `chartColorStyle` (`colorsN.xml`): the cycle of series colours;
|
|
723
|
+
* overrides the built-in Office accent cycle when present.
|
|
724
|
+
*/
|
|
440
725
|
readonly seriesColorCycle?: ReadonlyArray<string>;
|
|
441
726
|
}
|
|
727
|
+
/** A block-level chart reference (`c:chart`): its size and relationship id. */
|
|
442
728
|
export interface ChartBlock {
|
|
729
|
+
/** §20.4.2.3 — present when the drawing is anchored (floating). */
|
|
443
730
|
readonly float?: FloatAnchor;
|
|
444
731
|
readonly chartRelId: string;
|
|
445
732
|
readonly width: Pt;
|
|
446
733
|
readonly height: Pt;
|
|
447
734
|
readonly paragraphProperties: ParagraphProperties;
|
|
735
|
+
/** `wp:docPr @descr/@title` — alternate text for the tagged-PDF Figure (`/Alt`). */
|
|
448
736
|
readonly altText?: string;
|
|
449
737
|
}
|
|
738
|
+
/** One top-level body item: a discriminated union over the block kinds. */
|
|
450
739
|
export type BodyElement = {
|
|
451
740
|
readonly kind: 'paragraph';
|
|
452
741
|
readonly paragraph: Paragraph;
|
|
@@ -463,11 +752,13 @@ export type BodyElement = {
|
|
|
463
752
|
readonly kind: 'chart';
|
|
464
753
|
readonly chart: ChartBlock;
|
|
465
754
|
};
|
|
755
|
+
/** ECMA-376 Part 1 §17.6.13 `w:pgSz` — the section's page dimensions + orientation. */
|
|
466
756
|
export interface PageSize {
|
|
467
757
|
readonly width: Pt;
|
|
468
758
|
readonly height: Pt;
|
|
469
759
|
readonly orientation?: 'portrait' | 'landscape';
|
|
470
760
|
}
|
|
761
|
+
/** §17.6.11 `w:pgMar` — the section's page margins (and header/footer offsets). */
|
|
471
762
|
export interface PageMargins {
|
|
472
763
|
readonly top: Pt;
|
|
473
764
|
readonly right: Pt;
|
|
@@ -476,20 +767,38 @@ export interface PageMargins {
|
|
|
476
767
|
readonly header?: Pt;
|
|
477
768
|
readonly footer?: Pt;
|
|
478
769
|
}
|
|
770
|
+
/** §17.10 — which page class a header/footer reference applies to. */
|
|
479
771
|
export type HeaderFooterType = 'default' | 'first' | 'even';
|
|
772
|
+
/** §17.10.5/§17.10.2 `w:headerReference`/`w:footerReference` — a typed rels pointer. */
|
|
480
773
|
export interface HeaderFooterReference {
|
|
481
774
|
readonly type: HeaderFooterType;
|
|
482
775
|
readonly relationshipId: string;
|
|
483
776
|
}
|
|
777
|
+
/** §17.6.17 `w:sectPr` — a section's page setup, header/footer refs and columns. */
|
|
484
778
|
export interface SectionProperties {
|
|
485
779
|
readonly pageSize?: PageSize;
|
|
486
780
|
readonly margins?: PageMargins;
|
|
487
781
|
readonly headers: ReadonlyArray<HeaderFooterReference>;
|
|
488
782
|
readonly footers: ReadonlyArray<HeaderFooterReference>;
|
|
783
|
+
/**
|
|
784
|
+
* ECMA-376 §17.10.6 — `w:titlePg` toggle in `sectPr`. When true the first page
|
|
785
|
+
* of the section uses the `first` header/footer references.
|
|
786
|
+
*/
|
|
489
787
|
readonly titlePg?: boolean;
|
|
788
|
+
/**
|
|
789
|
+
* ECMA-376 §17.15.1.36 — `w:evenAndOddHeaders` toggle in `word/settings.xml`
|
|
790
|
+
* (document-wide, not per-section). When true even-numbered pages use the
|
|
791
|
+
* `even` header/footer references.
|
|
792
|
+
*/
|
|
490
793
|
readonly evenAndOddHeaders?: boolean;
|
|
794
|
+
/** §17.6.4 `w:cols` — multi-column section layout. */
|
|
491
795
|
readonly columns?: SectionColumns;
|
|
492
796
|
}
|
|
797
|
+
/**
|
|
798
|
+
* §20.4.2.3 `wp:anchor` — a floating drawing's placement. v1 honours
|
|
799
|
+
* out-of-flow placement for wrap `'none'` (incl. `behindDoc`); the side-wrapping
|
|
800
|
+
* modes (square/tight/through) and `topAndBottom` stay in flow as blocks.
|
|
801
|
+
*/
|
|
493
802
|
export interface FloatAnchor {
|
|
494
803
|
readonly wrap: 'none' | 'square' | 'tight' | 'through' | 'topAndBottom';
|
|
495
804
|
readonly behind?: boolean;
|
|
@@ -503,6 +812,10 @@ export interface FloatAnchor {
|
|
|
503
812
|
readonly offsetPt?: Pt;
|
|
504
813
|
};
|
|
505
814
|
}
|
|
815
|
+
/**
|
|
816
|
+
* §17.6.4 — column definitions: an equal-width `count` + gutter, or explicit
|
|
817
|
+
* per-column widths/gutters (`w:col` children).
|
|
818
|
+
*/
|
|
506
819
|
export interface SectionColumns {
|
|
507
820
|
readonly count: number;
|
|
508
821
|
readonly spacePt: number;
|
|
@@ -511,23 +824,38 @@ export interface SectionColumns {
|
|
|
511
824
|
readonly spacePt: number;
|
|
512
825
|
}>;
|
|
513
826
|
}
|
|
827
|
+
/**
|
|
828
|
+
* One section descriptor for a multi-section document (ECMA-376 §17.6.17). Each
|
|
829
|
+
* section's `sectPr` lives either inside a paragraph's `pPr` (mid-document
|
|
830
|
+
* break) or as the final child of `w:body` (final section). Records the
|
|
831
|
+
* properties and the upper-exclusive bound in `BodyElement[]` the section
|
|
832
|
+
* covers — section i applies to
|
|
833
|
+
* `body[sections[i-1].endIndex..sections[i].endIndex)`.
|
|
834
|
+
*/
|
|
514
835
|
export interface Section {
|
|
515
836
|
readonly properties: SectionProperties;
|
|
516
837
|
readonly endIndex: number;
|
|
517
838
|
}
|
|
839
|
+
/** The parsed WordprocessingML document: body, stylesheet, numbering and section setup. */
|
|
518
840
|
export interface DocumentModel {
|
|
519
841
|
readonly body: ReadonlyArray<BodyElement>;
|
|
520
842
|
readonly styleSheet: StyleSheet;
|
|
521
843
|
readonly numbering?: Numbering;
|
|
522
844
|
readonly section?: SectionProperties;
|
|
523
845
|
}
|
|
846
|
+
/**
|
|
847
|
+
* Document metadata (PDF `/Info`-shaped, sourced from `docProps/core.xml` and/or
|
|
848
|
+
* caller options). Lives in the model so FlowDoc can carry it format-neutrally.
|
|
849
|
+
*/
|
|
524
850
|
export interface DocumentInfo {
|
|
525
851
|
readonly title?: string;
|
|
526
852
|
readonly author?: string;
|
|
527
853
|
readonly subject?: string;
|
|
528
854
|
readonly keywords?: string;
|
|
529
855
|
readonly creator?: string;
|
|
856
|
+
/** Producer; defaults to "Ream" if not provided. */
|
|
530
857
|
readonly producer?: string;
|
|
858
|
+
/** ISO 8601 date; converted to PDF date format (`D:YYYYMMDDHHmmSS`). */
|
|
531
859
|
readonly creationDate?: Date;
|
|
532
860
|
readonly modificationDate?: Date;
|
|
533
861
|
}
|