@sheetxl/io-xlsx 0.8.0-beta.9 → 1.0.2

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 (205) hide show
  1. package/LICENSE.md +8 -7
  2. package/browser/esm/BPn0BJd77_Q1lYVz.mjs +7021 -0
  3. package/browser/esm/BfV9IAl46gJxLRsa.mjs +2474 -0
  4. package/browser/esm/{DsSIg46AR7IFBN5N.mjs → C1Ql7gO6TtQglsOH.mjs} +939 -804
  5. package/browser/esm/{CxtFawTfwRTCC4Xr.mjs → C74cxGSvdlAfqeqF.mjs} +2 -2
  6. package/browser/esm/CZ3s0Cfjqm3BRszF.mjs +104 -0
  7. package/browser/esm/ChMFy3Rg97YbbuTB.mjs +4632 -0
  8. package/browser/esm/D2WBxzN8ubzIrJ4h.mjs +10323 -0
  9. package/browser/esm/{D-epcZSoKLbsAIaC.mjs → DtUTX1O34sAvjw_I.mjs} +3 -3
  10. package/browser/esm/{C-2KaUyV4gs-sDTZ.mjs → K9Sy1I7Pix2m7GJj.mjs} +194 -144
  11. package/browser/esm/{CRrTMRdN_IcSA_pm.mjs → cjLbism9wq4om43B.mjs} +3 -3
  12. package/browser/esm/index.mjs +3 -4
  13. package/browser/esm/rF6yS_NgcKLlMbGR.mjs +24 -0
  14. package/licenses/dependencies.txt +2 -2
  15. package/node/esm/BMVTOvvr98SnUmif.mjs +2478 -0
  16. package/node/esm/BXHjX5Jr7ZO7XFp1.mjs +6957 -0
  17. package/node/esm/{CBtj0-a4l2qux2hA.mjs → BeAzln1Wp4oOc7xJ.mjs} +3 -3
  18. package/node/esm/C2FEO68INNEEnWCd.mjs +4746 -0
  19. package/node/esm/DDI2JK7U9TLsIobf.mjs +2562 -0
  20. package/node/esm/DhIaDwktkAy1xpDs.mjs +7284 -0
  21. package/node/esm/{BCr4lCI6qQXXN0K1.mjs → el-uWAcXKFVwmwZ-.mjs} +3 -3
  22. package/node/esm/index.mjs +65 -28
  23. package/node/esm/{BsTMtvwpQoPNv95M.mjs → kFd-ABtolhQt-Hqv.mjs} +2 -2
  24. package/package.json +9 -10
  25. package/types/src/AutoFilterRules.d.ts +34 -44
  26. package/types/src/ConditionalFormatRules.d.ts +2 -2
  27. package/types/src/DataTableFormula.d.ts +26 -0
  28. package/types/src/DataValidationRules.d.ts +0 -5
  29. package/types/src/DefinedNameAttributes.d.ts +8 -0
  30. package/types/src/ExcelCalcStamp.d.ts +0 -36
  31. package/types/src/ExcelCompat.d.ts +15 -143
  32. package/types/src/ExcelFunctionFacts.d.ts +0 -272
  33. package/types/src/ExcelReservedNames.d.ts +0 -65
  34. package/types/src/KnownFonts.d.ts +37 -0
  35. package/types/src/LegacyFormula.d.ts +1 -46
  36. package/types/src/OOXMLExtensions.d.ts +24 -2
  37. package/types/src/PageLayoutAttributes.d.ts +8 -0
  38. package/types/src/Plugin.d.ts +15 -3
  39. package/types/src/ProtectionAttributes.d.ts +2 -2
  40. package/types/src/SheetKinds.d.ts +42 -0
  41. package/types/src/SheetViewAttributes.d.ts +4 -0
  42. package/types/src/SortExtent.d.ts +16 -0
  43. package/types/src/SourcePackage.d.ts +0 -44
  44. package/types/src/SparklineGroups.d.ts +52 -0
  45. package/types/src/Types.d.ts +13 -3
  46. package/types/src/XlsxHeader.d.ts +19 -0
  47. package/types/src/chart/ChartExXml.d.ts +38 -0
  48. package/types/src/chart/ChartPartXml.d.ts +47 -0
  49. package/types/src/chart/ChartSpaceXml.d.ts +37 -0
  50. package/types/src/chart/_XmlTree.d.ts +34 -0
  51. package/types/src/chart/_chartCodecs.d.ts +12 -0
  52. package/types/src/chart/_chartExCodecs.d.ts +7 -0
  53. package/types/src/chart/_chartExFold.d.ts +14 -0
  54. package/types/src/chart/_chartExMarkup.d.ts +236 -0
  55. package/types/src/chart/_chartExStyle.d.ts +13 -0
  56. package/types/src/chart/_codec.d.ts +78 -0
  57. package/types/src/chart/_drawingml.d.ts +10 -0
  58. package/types/src/chart/_xml.d.ts +70 -0
  59. package/types/src/pivot/PivotArea.d.ts +20 -0
  60. package/types/src/pivot/PivotCacheRead.d.ts +30 -0
  61. package/types/src/pivot/PivotCacheWrite.d.ts +23 -0
  62. package/types/src/pivot/PivotFilters.d.ts +29 -0
  63. package/types/src/pivot/PivotFormats.d.ts +60 -0
  64. package/types/src/pivot/PivotTableRead.d.ts +44 -0
  65. package/types/src/pivot/PivotTableWrite.d.ts +13 -0
  66. package/types/src/pivot/_PivotCacheXml.d.ts +48 -0
  67. package/types/src/pivot/_PivotTableXml.d.ts +23 -0
  68. package/types/src/reader/CellControls.d.ts +18 -0
  69. package/types/src/reader/DocumentPropertiesRead.d.ts +16 -0
  70. package/types/src/reader/DummyFunctionUnwrap.d.ts +43 -23
  71. package/types/src/reader/HeaderStyles.d.ts +15 -0
  72. package/types/src/reader/IsoDateCell.d.ts +20 -0
  73. package/types/src/reader/LibreOfficeDataTable.d.ts +12 -0
  74. package/types/src/reader/PivotButtons.d.ts +14 -0
  75. package/types/src/reader/PivotCellFormats.d.ts +22 -0
  76. package/types/src/reader/SlicerJoin.d.ts +26 -0
  77. package/types/src/reader/ZipReader.d.ts +1 -1
  78. package/types/src/reader/_SlicerRecord.d.ts +59 -0
  79. package/types/src/reader/dom/DOMTransformer.d.ts +2 -2
  80. package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +13 -1
  81. package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +3 -11
  82. package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts +8 -1
  83. package/types/src/reader/domVisitors/CommentVisitor.d.ts +2 -2
  84. package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +13 -6
  85. package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +9 -0
  86. package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts +10 -7
  87. package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +22 -13
  88. package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts +5 -5
  89. package/types/src/reader/domVisitors/DrawingVisitor.d.ts +4 -2
  90. package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +1 -11
  91. package/types/src/reader/domVisitors/FeaturePropertyBagVisitor.d.ts +18 -0
  92. package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts +0 -11
  93. package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts +3 -2
  94. package/types/src/reader/domVisitors/ObjectDefaultsVisitor.d.ts +11 -0
  95. package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +2 -2
  96. package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +26 -5
  97. package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts +11 -2
  98. package/types/src/reader/domVisitors/SlicersVisitor.d.ts +9 -3
  99. package/types/src/reader/domVisitors/SortStateVisitor.d.ts +2 -2
  100. package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +2 -2
  101. package/types/src/reader/domVisitors/TimelinesVisitor.d.ts +13 -0
  102. package/types/src/reader/domVisitors/WorkbookVisitor.d.ts +0 -9
  103. package/types/src/reader/domVisitors/_Dxfs.d.ts +10 -0
  104. package/types/src/reader/domVisitors/index.d.ts +6 -34
  105. package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts +1 -0
  106. package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +31 -6
  107. package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +26 -8
  108. package/types/src/richValue/ErrorRichValueHandler.d.ts +22 -0
  109. package/types/src/richValue/IRichValueHandler.d.ts +109 -0
  110. package/types/src/richValue/LocalImageRichValueHandler.d.ts +18 -0
  111. package/types/src/richValue/RichDataParts.d.ts +69 -0
  112. package/types/src/richValue/RichRecordWriter.d.ts +61 -0
  113. package/types/src/richValue/RichValueHandlers.d.ts +25 -0
  114. package/types/src/richValue/RichValueResolver.d.ts +54 -0
  115. package/types/src/richValue/WebImageRichValueHandler.d.ts +37 -0
  116. package/types/src/richValue/index.d.ts +7 -0
  117. package/types/src/utils/DrawingMLText.d.ts +2 -2
  118. package/types/src/utils/FormControls.d.ts +79 -6
  119. package/types/src/utils/SharedNames.d.ts +13 -0
  120. package/types/src/utils/SpreadsheetFont.d.ts +38 -0
  121. package/types/src/utils/VmlNoteShapes.d.ts +25 -32
  122. package/types/src/utils/VmlNoteStyle.d.ts +25 -0
  123. package/types/src/utils/VmlPrefixes.d.ts +24 -0
  124. package/types/src/vba/VBAProject.d.ts +0 -19
  125. package/types/src/writer/EvaluationSheet.d.ts +5 -0
  126. package/types/src/writer/builder/OpcXmlUtils.d.ts +0 -8
  127. package/types/src/writer/builder/PackageBuilder.d.ts +2 -41
  128. package/types/src/writer/builder/Types.d.ts +18 -28
  129. package/types/src/writer/emitters/CommentsEmitter.d.ts +3 -3
  130. package/types/src/writer/emitters/DrawingEmitter.d.ts +2 -2
  131. package/types/src/writer/emitters/ExternalLinkEmitter.d.ts +0 -11
  132. package/types/src/writer/emitters/FeaturePropertyBagEmitter.d.ts +8 -0
  133. package/types/src/writer/emitters/LegacyDrawingEmitter.d.ts +4 -4
  134. package/types/src/writer/emitters/PivotTableEmitter.d.ts +30 -1
  135. package/types/src/writer/emitters/PropsCoreEmitter.d.ts +7 -2
  136. package/types/src/writer/emitters/PropsCustomEmitter.d.ts +15 -0
  137. package/types/src/writer/emitters/RichValuePartsEmitters.d.ts +36 -0
  138. package/types/src/writer/emitters/RichValueRelEmitter.d.ts +12 -0
  139. package/types/src/writer/emitters/RichValueStructureEmitter.d.ts +4 -3
  140. package/types/src/writer/emitters/RichValueTypesEmitter.d.ts +3 -2
  141. package/types/src/writer/emitters/RichValueWebImageEmitter.d.ts +24 -0
  142. package/types/src/writer/emitters/SharedStringsEmitter.d.ts +6 -3
  143. package/types/src/writer/emitters/SlicerEmitter.d.ts +132 -0
  144. package/types/src/writer/emitters/StylesEmitter.d.ts +35 -2
  145. package/types/src/writer/emitters/TableEmitter.d.ts +14 -0
  146. package/types/src/writer/emitters/WorkbookEmitter.d.ts +24 -2
  147. package/types/src/writer/emitters/WorksheetEmitter.d.ts +4 -3
  148. package/types/src/writer/utils/AutoFilter.d.ts +3 -3
  149. package/types/src/writer/utils/CellControlComplements.d.ts +29 -0
  150. package/types/src/writer/utils/DateSystem.d.ts +6 -0
  151. package/types/src/writer/utils/DefaultRows.d.ts +22 -0
  152. package/types/src/writer/utils/DrawMLUtils.d.ts +8 -6
  153. package/types/src/writer/utils/DummyFunction.d.ts +0 -25
  154. package/types/src/writer/utils/DxfCollector.d.ts +14 -11
  155. package/types/src/writer/utils/PrstGeomUtils.d.ts +11 -3
  156. package/types/src/writer/utils/RichValueCollector.d.ts +81 -129
  157. package/types/src/writer/utils/SheetStyleLayout.d.ts +86 -0
  158. package/types/src/writer/utils/TextUtils.d.ts +6 -1
  159. package/types/src/writer/utils/UnsupportedFunctions.d.ts +2 -2
  160. package/types/src/writer/utils/XfVariants.d.ts +61 -0
  161. package/browser/cjs/B0Ugu_crqQYpdfQz.cjs +0 -1
  162. package/browser/cjs/B6sirGz6w-Bm7Ofo.cjs +0 -1
  163. package/browser/cjs/BHM3_D9PsNURVAVy.cjs +0 -1
  164. package/browser/cjs/BHWdwAQ322YA8JAZ.cjs +0 -6
  165. package/browser/cjs/CeuX8p1aBuKTuagi.cjs +0 -2
  166. package/browser/cjs/D3EWCPfCu-qMOIGd.cjs +0 -1
  167. package/browser/cjs/DSM4q1dhVVXvsgby.cjs +0 -30
  168. package/browser/cjs/DiAHwNv2I8RHE9GY.cjs +0 -1
  169. package/browser/cjs/index.cjs +0 -1
  170. package/browser/cjs/wrpXlaSBGEicQf6_.cjs +0 -6
  171. package/browser/cjs/xQ6-wbTw5UzZUM1Y.cjs +0 -1
  172. package/browser/esm/Bu64BYvRAlVftMr1.mjs +0 -67
  173. package/browser/esm/CWt4fDYEbj2hvsl_.mjs +0 -3346
  174. package/browser/esm/Ccnxz-y2WBEgfvvh.mjs +0 -6498
  175. package/browser/esm/Dx64JMAGwNNDBkC1.mjs +0 -4928
  176. package/browser/esm/Sv4twwEJDb9dZ91h.mjs +0 -149
  177. package/node/esm/BPn5XBizKkwaUqXB.mjs +0 -4285
  178. package/node/esm/BVV11IlqF6Lmlv8D.mjs +0 -154
  179. package/node/esm/BiJEEgltJzx94zIR.mjs +0 -3433
  180. package/node/esm/CkmZuMvRTpva7eQu.mjs +0 -5074
  181. package/node/esm/j0RE2usgdljRw_gr.mjs +0 -2345
  182. package/types/src/legacyChart/OOXMLMappings.d.ts +0 -8
  183. package/types/src/legacyChart/OOXMLUtils.d.ts +0 -78
  184. package/types/src/legacyChart/ToOOXMLConverter.d.ts +0 -30
  185. package/types/src/reader/domVisitors/AxisVisitor.d.ts +0 -12
  186. package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts +0 -6
  187. package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts +0 -6
  188. package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts +0 -7
  189. package/types/src/reader/domVisitors/ChartVisitor.d.ts +0 -7
  190. package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts +0 -8
  191. package/types/src/reader/domVisitors/DataPointVisitor.d.ts +0 -6
  192. package/types/src/reader/domVisitors/LayoutVisitor.d.ts +0 -5
  193. package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts +0 -5
  194. package/types/src/reader/domVisitors/LegendVisitor.d.ts +0 -5
  195. package/types/src/reader/domVisitors/MarkerVisitor.d.ts +0 -5
  196. package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts +0 -6
  197. package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts +0 -5
  198. package/types/src/reader/domVisitors/RichValueDataVisitor.d.ts +0 -7
  199. package/types/src/reader/domVisitors/RichValueStructureVisitor.d.ts +0 -6
  200. package/types/src/reader/domVisitors/SeriesVisitor.d.ts +0 -8
  201. package/types/src/reader/domVisitors/TitleVisitor.d.ts +0 -9
  202. package/types/src/writer/emitters/ChartColorsEmitter.d.ts +0 -7
  203. package/types/src/writer/emitters/ChartEmitter.d.ts +0 -14
  204. package/types/src/writer/emitters/ChartStyleEmitter.d.ts +0 -46
  205. package/types/src/writer/utils/HiddenFormulaXfs.d.ts +0 -28
@@ -1,13 +1,4 @@
1
1
  import { IWorkbook } from '@sheetxl/sdk';
2
- /**
3
- * The default upper bound, in decompressed bytes, on what a {@link SourcePackage} will retain.
4
- *
5
- * @remarks
6
- * Applies to the retained parts only — worksheet/chartsheet bodies and shared strings are never
7
- * retained (they are always model-owned and rewritten on every save), so this is not the file's
8
- * uncompressed size, just the "side parts" (styles, drawings, media, printer settings, …) that
9
- * would otherwise be copied through untouched. See `DESIGN-PACKAGE-PASSTHROUGH.md`.
10
- */
11
2
  export declare const SOURCE_PACKAGE_MAX_BYTES: number;
12
3
  /**
13
4
  * A part's still-compressed bytes, sliced directly out of the source zip's local file header —
@@ -27,17 +18,6 @@ export interface SourcePackagePart {
27
18
  /** Present when the source's compressed bytes could be sliced out directly; see {@link SourcePackageRawPart}. */
28
19
  readonly raw?: SourcePackageRawPart;
29
20
  }
30
- /**
31
- * The parts of a source OOXML package that SheetXL read but does not model — retained verbatim so
32
- * a save can pass them through instead of silently dropping them. See
33
- * `DESIGN-PACKAGE-PASSTHROUGH.md`.
34
- *
35
- * @remarks
36
- * Not a residue map: this holds every non-streamed part from the source zip, decompressed. Which
37
- * of those a save actually copies through (vs. an emitter claiming the path, vs. a drop-bucket
38
- * rule) is decided at write time, not here. The one thing it is told rather than holding is
39
- * {@link isAbsorbed} — which parts the read put on the model, so the writer need not guess.
40
- */
41
21
  export declare class SourcePackage {
42
22
  private readonly _parts;
43
23
  private readonly _absorbed;
@@ -47,33 +27,9 @@ export declare class SourcePackage {
47
27
  getNames(): string[];
48
28
  has(name: string): boolean;
49
29
  getPart(name: string): SourcePackagePart | null;
50
- /**
51
- * Whether the reader took this part onto the model, so a save writes it from there rather than
52
- * copying it through — see `DESIGN-PACKAGE-PASSTHROUGH.md` §4.
53
- *
54
- * @remarks
55
- * Identity only: a name, never content. What each absorbed part *says* lives on the model that
56
- * absorbed it (a chart's part on its movable, a sheet's VML on the sheet, a cache's definition on
57
- * the workbook), which is the whole point of `PLAN-MODEL-HOMES.md` — this set exists so the
58
- * passthrough can tell "the model owns this one" from "nothing modeled it" without a list of path
59
- * patterns standing in for the answer.
60
- *
61
- * Independent of whether the element that cited the part still exists: deleting the chart deletes
62
- * its part with it, and the source's copy should go too.
63
- */
64
30
  isAbsorbed(name: string): boolean;
65
31
  /** Sum of {@link SourcePackagePart.data}'s byte lengths across every retained part. */
66
32
  getTotalBytes(): number;
67
- /**
68
- * A one-way latch: once true, stays true for this package's lifetime (i.e. until the origin is
69
- * closed and a fresh read replaces it). Set by the reader when it detects a structural edit —
70
- * sheet add/delete/reorder, row/column insert/delete — since the read that produced this package.
71
- *
72
- * @remarks
73
- * Deliberately never resets on an undo: an undo doesn't guarantee the exact original XML-level
74
- * geometry a preserved part assumed, and the parts this gates (`DESIGN-PACKAGE-PASSTHROUGH.md`
75
- * §4's drop-if-structure-changed bucket) are exactly the ones a wrong guess here would corrupt.
76
- */
77
33
  hasStructuralChange(): boolean;
78
34
  markStructuralChange(): void;
79
35
  }
@@ -0,0 +1,52 @@
1
+ import { IRange, ISparklineGroup } from '@sheetxl/sdk';
2
+ /**
3
+ * `x14:sparklineGroups` ({@link EXT_URI_SPARKLINE_GROUPS}) as the sheet JSON keeps it.
4
+ *
5
+ * @remarks
6
+ * The file states one `x14:sparkline` per cell, each with its own `xm:f`. The reader states them
7
+ * so; the group folds them into ranges that read alike on load, and the writer asks the group
8
+ * what each cell reads.
9
+ *
10
+ * Attributes are kept when they differ from the schema's default (MS-XLSX `CT_SparklineGroup`),
11
+ * which is what an absent attribute means to Excel, so a resave states what the file stated.
12
+ */
13
+ /** The eight color children, in the schema's order. */
14
+ export declare const SPARKLINE_COLOR_KEYS: readonly ["colorSeries", "colorNegative", "colorAxis", "colorMarkers", "colorFirst", "colorLast", "colorHigh", "colorLow"];
15
+ export type SparklineColorKey = typeof SPARKLINE_COLOR_KEYS[number];
16
+ /**
17
+ * The group's properties from its attributes.
18
+ *
19
+ * @param attributes The element's attributes, as read.
20
+ */
21
+ export declare function readSparklineGroupAttributes(attributes: Readonly<Record<string, string>>): ISparklineGroup.Properties;
22
+ /**
23
+ * The attributes a group is written with: what differs from the schema's default, and `rest`.
24
+ */
25
+ export declare function sparklineGroupAttributes(properties: Readonly<ISparklineGroup.Properties>): Record<string, string | number>;
26
+ /**
27
+ * A group read from the file, as the sheet JSON's reference: one range and its data per cell, in
28
+ * file order. The group folds them into ranges when it loads. `null` for a group with no
29
+ * sparkline.
30
+ */
31
+ export declare function toSparklineGroupRef(properties: ISparklineGroup.Properties, entries: readonly {
32
+ location: IRange.CellCoords;
33
+ data: string;
34
+ }[]): IRange.JSONReferenceEntry<ISparklineGroup.JSON> | null;
35
+ /**
36
+ * A data formula as the file states it: always on a sheet. A bare area names the group's own.
37
+ */
38
+ export declare function qualifySparklineData(data: string, sheetName: string): string;
39
+ /**
40
+ * A group's sparklines one per cell, as the file states them: the location as `xm:sqref` text and
41
+ * the data as `xm:f` text.
42
+ *
43
+ * @remarks
44
+ * A cell's data is the address it reads. Where a range's data is not an area (a name, `#REF!`),
45
+ * the range's own text is written for each of its cells; an area a cell would read off the sheet
46
+ * is `#REF!`.
47
+ */
48
+ export declare function sparklinesOf(group: ISparklineGroup, sheetName: string): {
49
+ sqref: string;
50
+ f: string;
51
+ }[];
52
+ //# sourceMappingURL=SparklineGroups.d.ts.map
@@ -12,9 +12,8 @@ export interface WriteXLSXOptions extends IWorkbookIO.WriteOptions {
12
12
  *
13
13
  * @remarks
14
14
  * Set by the format registration, not by callers: `.xlsx` and `.xlsm` are two registered write
15
- * formats sharing this one handler, which is how `DESIGN-IO.md` says a per-extension encoding
16
- * decision must be expressed — a single format listing both extensions could not, because the
17
- * handler is never told which of its extensions is being written.
15
+ * formats sharing this one handler. A single format listing both extensions could not express
16
+ * this, because the handler is never told which of its extensions is being written.
18
17
  *
19
18
  * It decides **both halves together**, so the declaration can never disagree with the payload:
20
19
  * the `xl/workbook.xml` content type, and whether a source package's `xl/vbaProject.bin` is
@@ -22,6 +21,17 @@ export interface WriteXLSXOptions extends IWorkbookIO.WriteOptions {
22
21
  * what Excel's own *Save As* does.
23
22
  */
24
23
  macroEnabled?: boolean;
24
+ /**
25
+ * Whether to write a template (`.xltx`, or `.xltm` with {@link macroEnabled}) rather than a
26
+ * workbook.
27
+ *
28
+ * @defaultValue false
29
+ *
30
+ * @remarks
31
+ * Set by the format registration, like {@link macroEnabled}. Only the `xl/workbook.xml` content
32
+ * type differs; Excel opens a template as a new, unsaved workbook made from it.
33
+ */
34
+ template?: boolean;
25
35
  /**
26
36
  * Callback invoked when a part is emitted.
27
37
  *
@@ -0,0 +1,19 @@
1
+ import { ICellHeader } from '@sheetxl/sdk';
2
+ /**
3
+ * A row or column run as a sheet part carries it: the header's own state, plus the style and border
4
+ * flags xlsx keeps per row or column.
5
+ *
6
+ * @remarks
7
+ * The model has no header styles: a whole-row or whole-column style is a direct style over the whole
8
+ * row or column. The reader moves `s` there (`applyHeaderStyles`) and the writer works it out again
9
+ * (`layoutWorkbookStyles`).
10
+ */
11
+ export interface XlsxHeader extends ICellHeader.JSON {
12
+ /** `<col style>` / `<row s customFormat="1">`: an index into the workbook's direct styles. */
13
+ s?: number;
14
+ /** `<row thickTop>`: the row gives a pixel to a thick line along its top. */
15
+ tt?: boolean;
16
+ /** `<row thickBot>`: the row gives a pixel to a medium or thick line along its bottom. */
17
+ tb?: boolean;
18
+ }
19
+ //# sourceMappingURL=XlsxHeader.d.ts.map
@@ -0,0 +1,38 @@
1
+ import { ChartModel } from '@sheetxl/sdk';
2
+ /** A chartex part as {@link readChartExSpace} reads it. */
3
+ export interface ChartExSpacePart {
4
+ model: ChartModel.ChartSpace;
5
+ /** How many elements were kept as markup because the model could not state them exactly. */
6
+ kept: number;
7
+ /** How many children the part states out of schema order (see `ChartSpacePart.reordered`). */
8
+ reordered: number;
9
+ /**
10
+ * Whether the model states something otherwise than the part does, so a part written from it
11
+ * would differ (see `_chartExFold`). The part's own markup still writes back while the chart is
12
+ * untouched.
13
+ */
14
+ lossy: boolean;
15
+ }
16
+ /**
17
+ * Reads a chartex part.
18
+ *
19
+ * @returns `null` when `xml` is not a `cx:chartSpace`.
20
+ */
21
+ export declare const readChartExSpace: (xml: string) => ChartExSpacePart | null;
22
+ /**
23
+ * Writes a chartex part.
24
+ *
25
+ * @remarks
26
+ * The chart space keeps the namespace declarations it was read with; the `cx`, `a` and `r`
27
+ * prefixes the writer uses are declared when it has none. Groups of a type the part cannot state
28
+ * are left out.
29
+ */
30
+ export declare const writeChartExSpace: (chartSpace: ChartModel.ChartSpace) => string;
31
+ /**
32
+ * The markup a chartex part is saved as: `xml` as it is while it states what `model` does, so a
33
+ * chart nothing has changed is written byte for byte; otherwise the part written from `model`.
34
+ *
35
+ * @param xml The markup the chart was read from, when the part still carries it.
36
+ */
37
+ export declare const writeChartExPart: (model: ChartModel.ChartSpace, xml: string | undefined) => string;
38
+ //# sourceMappingURL=ChartExXml.d.ts.map
@@ -0,0 +1,47 @@
1
+ import { ChartModel } from '@sheetxl/sdk';
2
+ /** The two kinds of chart part: `c:chartSpace` and `cx:chartSpace`. */
3
+ export type ChartFamily = 'chart' | 'chartEx';
4
+ /** What a part of each family is, in the package and in the frame that cites it. */
5
+ export declare const CHART_PARTS: Readonly<Record<ChartFamily, {
6
+ relType: string;
7
+ contentType: string;
8
+ /** Where the part goes, beside the sheet's drawing. */
9
+ path: string;
10
+ /** The `graphicData` uri of a frame citing the part, and the namespace of its `chart` element. */
11
+ graphicUri: string;
12
+ }>>;
13
+ /** The family of a part, by the relationship that cites it. */
14
+ export declare const familyOfPart: (relType: string | undefined) => ChartFamily | null;
15
+ /** A chart part as {@link readChartModelPart} reads it. */
16
+ export interface ChartPartRead {
17
+ model: ChartModel.ChartSpace;
18
+ family: ChartFamily;
19
+ /** Elements kept as markup because the model could not state them exactly. */
20
+ kept: number;
21
+ /** Whether a part written from the model would state something otherwise (see `_chartExFold`). */
22
+ lossy: boolean;
23
+ }
24
+ /**
25
+ * Reads a chart part of either family.
26
+ *
27
+ * @returns `null` when `xml` is neither a `c:chartSpace` nor a `cx:chartSpace`.
28
+ */
29
+ export declare const readChartModelPart: (xml: string) => ChartPartRead | null;
30
+ /** A chart part as {@link writeChartModelPart} writes it. */
31
+ export interface ChartPartWrite {
32
+ xml: string;
33
+ family: ChartFamily;
34
+ /** The types of the groups the part could not state, which are not in it. */
35
+ leftOut: string[];
36
+ }
37
+ /**
38
+ * Writes a chart's model to the part its group types belong in.
39
+ *
40
+ * @param source The part the chart was read from: its family, and its markup while it still carries
41
+ * it. That markup is written as it is while it states what the model does.
42
+ */
43
+ export declare const writeChartModelPart: (model: ChartModel.ChartSpace, source?: {
44
+ family?: ChartFamily | null;
45
+ xml?: string;
46
+ }) => ChartPartWrite;
47
+ //# sourceMappingURL=ChartPartXml.d.ts.map
@@ -0,0 +1,37 @@
1
+ import { ChartModel } from '@sheetxl/sdk';
2
+ /** A chart part as {@link readChartSpace} reads it. */
3
+ export interface ChartSpacePart {
4
+ model: ChartModel.ChartSpace;
5
+ /** How many elements were kept as markup because the model could not state them exactly. */
6
+ kept: number;
7
+ /**
8
+ * How many children the part states out of schema order. The model holds them; written back
9
+ * they come in schema order, so such a part is the same only apart from the order of children.
10
+ */
11
+ reordered: number;
12
+ }
13
+ /**
14
+ * Reads a chart part.
15
+ *
16
+ * @returns `null` when `xml` is not a `c:chartSpace`: a `cx:chartSpace` (waterfall, treemap…) is
17
+ * read by `readChartExSpace`.
18
+ */
19
+ export declare const readChartSpace: (xml: string) => ChartSpacePart | null;
20
+ export declare const DECLARATION = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n";
21
+ /**
22
+ * Writes a chart part.
23
+ *
24
+ * @remarks
25
+ * The chart space keeps the namespace declarations it was read with; the `c`, `a` and `r` prefixes
26
+ * the writer uses are declared when it has none.
27
+ */
28
+ export declare const writeChartSpace: (chartSpace: ChartModel.ChartSpace) => string;
29
+ /**
30
+ * The markup a chart part is saved as: `xml` as it is while it states what `model` does, so a
31
+ * chart nothing has changed is written byte for byte; otherwise the part written from `model`. A
32
+ * part stating a label position Excel refuses is always written from `model`, which leaves it out.
33
+ *
34
+ * @param xml The markup the chart was read from, when the part still carries it.
35
+ */
36
+ export declare const writeChartPart: (model: ChartModel.ChartSpace, xml: string | undefined) => string;
37
+ //# sourceMappingURL=ChartSpaceXml.d.ts.map
@@ -0,0 +1,34 @@
1
+ /**
2
+ * A tree over a chart part's markup that remembers where each element is in the source.
3
+ *
4
+ * @remarks
5
+ * The chart reader keeps what it does not model as the source's own markup, so it needs each
6
+ * element's extent in the text, which a DOM does not give. Elements, attributes and character data
7
+ * only; comments and processing instructions are skipped.
8
+ */
9
+ /** One element. `name` is the local name. */
10
+ export interface XmlElement {
11
+ name: string;
12
+ /** The name as the source spells it, prefix included. */
13
+ qname: string;
14
+ /** The attributes as the source spells them, undecoded. */
15
+ attrs: string;
16
+ children: (XmlElement | string)[];
17
+ /** Where the element starts in the source: at its open tag. */
18
+ start: number;
19
+ /** Just past the element's close tag, or past its open tag when it is empty. */
20
+ end: number;
21
+ /** Just past the open tag. */
22
+ contentStart: number;
23
+ /** At the close tag; equal to `contentStart` for an empty element. */
24
+ contentEnd: number;
25
+ }
26
+ export declare const decodeEntities: (text: string) => string;
27
+ /** Character data as it has to be spelled inside an element. */
28
+ export declare const encodeText: (text: string) => string;
29
+ /** The root element of `xml`, or `null` when there is none. */
30
+ export declare const parseFragment: (xml: string) => XmlElement | null;
31
+ export declare const childElements: (element: XmlElement) => XmlElement[];
32
+ /** The element's own character data; what its child elements hold is not read. */
33
+ export declare const readCharacters: (element: XmlElement) => string;
34
+ //# sourceMappingURL=_XmlTree.d.ts.map
@@ -0,0 +1,12 @@
1
+ import { ChartModel } from '@sheetxl/sdk';
2
+ import { Codec } from './_codec';
3
+ import { XmlWriter } from './_xml';
4
+ export declare const NUMBER_FORMAT: Codec;
5
+ /** The DrawingML element name of a group. */
6
+ export declare const groupElementName: (group: Pick<ChartModel.Group, "type" | "is3D">) => string;
7
+ /** Whether a group, a series or a point of the chart states a `dLblPos` its type does not offer. */
8
+ export declare const statesRefusedLabelPosition: (chartSpace: ChartModel.ChartSpace) => boolean;
9
+ /** `c:chartSpace`. */
10
+ export declare const CHART_SPACE: Codec;
11
+ export declare const writeChartSpaceElement: (writer: XmlWriter, chartSpace: ChartModel.ChartSpace) => void;
12
+ //# sourceMappingURL=_chartCodecs.d.ts.map
@@ -0,0 +1,7 @@
1
+ import { ChartExMarkup } from './_chartExMarkup';
2
+ import { Codec } from './_codec';
3
+ import { XmlWriter } from './_xml';
4
+ /** `cx:chartSpace`. */
5
+ export declare const CHART_EX_SPACE: Codec;
6
+ export declare const writeChartExSpaceElement: (writer: XmlWriter, chartSpace: ChartExMarkup.ChartSpace) => void;
7
+ //# sourceMappingURL=_chartExCodecs.d.ts.map
@@ -0,0 +1,14 @@
1
+ import { ChartModel } from '@sheetxl/sdk';
2
+ import { ChartExMarkup } from './_chartExMarkup';
3
+ /** The group types a `cx:chartSpace` part states. */
4
+ export declare const CHART_EX_GROUP_TYPES: ReadonlySet<string>;
5
+ /** A `cx:chartSpace` as the one chart model. */
6
+ export declare const foldChartEx: (chartSpace: ChartExMarkup.ChartSpace) => ChartModel.ChartSpace;
7
+ /**
8
+ * The one chart model as a `cx:chartSpace`. Groups of a type the part cannot state are left out;
9
+ * the caller says so.
10
+ */
11
+ export declare const unfoldChartEx: (model: ChartModel.ChartSpace) => ChartExMarkup.ChartSpace;
12
+ /** Whether `model`, folded from `chartSpace`, unfolds to it again: whether the model states all it says. */
13
+ export declare const isLossless: (chartSpace: ChartExMarkup.ChartSpace, model: ChartModel.ChartSpace) => boolean;
14
+ //# sourceMappingURL=_chartExFold.d.ts.map
@@ -0,0 +1,236 @@
1
+ import { ChartModel } from '@sheetxl/sdk';
2
+ /**
3
+ * A `cx:chartSpace` part as the chartex codecs read and write it, element for element: the step
4
+ * between the markup and {@link ChartModel}, which states a 2016 chart as groups and series like any
5
+ * other (`_chartExFold`).
6
+ *
7
+ * @remarks
8
+ * Names are the vocabulary's own (`layoutId`, `catScaling`, `dataLabels`) except the collections
9
+ * (`data`, `dimensions`, `levels`, `series`, `points`, `labels`, `axes`), and whatever is not
10
+ * read is kept as markup in the {@link ChartModel.Unknown} bag of the element that held it. A series
11
+ * names its data by `dataId`; the data lists its dimensions, each a formula and the values it last
12
+ * read.
13
+ */
14
+ export declare namespace ChartExMarkup {
15
+ /** Any element of the model. */
16
+ type Element = ChartModel.Element;
17
+ /** `cx:chartSpace`, the root of a chartex part. */
18
+ interface ChartSpace extends Element {
19
+ chartData: ChartData;
20
+ chart: Chart;
21
+ spPr?: ChartModel.ShapeProperties;
22
+ txPr?: ChartModel.TextBody;
23
+ }
24
+ /** `cx:chartData`: the data every series of the chart reads. */
25
+ interface ChartData extends Element {
26
+ /** In the order the file lists them. */
27
+ data: Data[];
28
+ }
29
+ /** `cx:data`: the dimensions one series plots. */
30
+ interface Data extends Element {
31
+ /** What a series' `dataId` names it by. */
32
+ id: number;
33
+ /** `cx:numDim` and `cx:strDim`, in the order the file lists them. */
34
+ dimensions: Dimension[];
35
+ }
36
+ /** What a numeric dimension holds: values, x and y, sizes, or the values a region map colors by. */
37
+ type NumericDimensionType = 'val' | 'x' | 'y' | 'size' | 'colorVal';
38
+ /** What a string dimension holds: categories, the text a region map colors by, or entity ids. */
39
+ type StringDimensionType = 'cat' | 'colorStr' | 'entityId';
40
+ /**
41
+ * `cx:numDim` or `cx:strDim`, told apart by `type`: one dimension of a series' data.
42
+ *
43
+ * @remarks
44
+ * Excel names a hidden defined name in `f` (`_xlchart.v1.0`), whose own formula is the range.
45
+ */
46
+ interface Dimension extends Element {
47
+ type: NumericDimensionType | StringDimensionType;
48
+ /** The values' formula. */
49
+ f?: DataReference;
50
+ /** The formula of the dimension's name: the cell above the values. */
51
+ nf?: DataReference;
52
+ /** `cx:lvl`: the values as last read, one level per row or column of the range, the outermost first. */
53
+ levels?: Level[];
54
+ }
55
+ /** `cx:f`, `cx:nf`: a formula. */
56
+ interface DataReference extends Element {
57
+ f: string;
58
+ /** Whether the range is read by column (the default) or by row. */
59
+ dir?: 'col' | 'row';
60
+ }
61
+ /** `cx:lvl`: one level of cached values. */
62
+ interface Level extends Element {
63
+ ptCount?: number;
64
+ /** Numeric levels state the format their values were read with. */
65
+ formatCode?: string;
66
+ name?: string;
67
+ /** By `idx`: a point the level leaves out is blank. */
68
+ points?: Point[];
69
+ }
70
+ /** `cx:pt`. */
71
+ interface Point extends Element {
72
+ idx: number;
73
+ /** The value as the file spells it. */
74
+ v: string;
75
+ }
76
+ /** `cx:chart`. */
77
+ interface Chart extends Element {
78
+ title?: Title;
79
+ plotArea: PlotArea;
80
+ legend?: Legend;
81
+ }
82
+ type SidePosition = 'l' | 't' | 'r' | 'b';
83
+ type PositionAlign = 'min' | 'ctr' | 'max';
84
+ /** `cx:title`. */
85
+ interface Title extends Element {
86
+ pos?: SidePosition;
87
+ align?: PositionAlign;
88
+ overlay?: boolean;
89
+ tx?: Text;
90
+ spPr?: ChartModel.ShapeProperties;
91
+ txPr?: ChartModel.TextBody;
92
+ }
93
+ /** `cx:tx`: text read from a cell, written into the chart, or rich text. */
94
+ interface Text extends Element {
95
+ txData?: TextData;
96
+ rich?: ChartModel.TextBody;
97
+ }
98
+ /** `cx:txData`: a formula naming a cell and the text it last read, or text written into the chart. */
99
+ interface TextData extends Element {
100
+ f?: DataReference;
101
+ v?: string;
102
+ }
103
+ /** `cx:plotArea`. */
104
+ interface PlotArea extends Element {
105
+ plotAreaRegion: PlotAreaRegion;
106
+ /** `cx:axis`, in the order the file lists them. */
107
+ axes: Axis[];
108
+ spPr?: ChartModel.ShapeProperties;
109
+ }
110
+ /** `cx:plotAreaRegion`: the series, drawn over one surface. */
111
+ interface PlotAreaRegion extends Element {
112
+ plotSurface?: PlotSurface;
113
+ series: Series[];
114
+ }
115
+ interface PlotSurface extends Element {
116
+ spPr?: ChartModel.ShapeProperties;
117
+ }
118
+ /**
119
+ * How a series is drawn. A histogram is a `clusteredColumn` series with binning; a pareto adds a
120
+ * `paretoLine` series owned by it (`ownerIdx`).
121
+ */
122
+ type LayoutId = 'boxWhisker' | 'clusteredColumn' | 'funnel' | 'paretoLine' | 'regionMap' | 'sunburst' | 'treemap' | 'waterfall';
123
+ /** `cx:series`. */
124
+ interface Series extends Element {
125
+ layoutId: LayoutId;
126
+ hidden?: boolean;
127
+ /** The index of the series this one belongs to: a pareto's line names its columns. */
128
+ ownerIdx?: number;
129
+ uniqueId?: string;
130
+ formatIdx?: number;
131
+ tx?: Text;
132
+ spPr?: ChartModel.ShapeProperties;
133
+ /** `cx:dataPt`: what one point states for itself. */
134
+ points?: DataPoint[];
135
+ dataLabels?: DataLabels;
136
+ /** The {@link Data.id} of the data the series plots. */
137
+ dataId?: number;
138
+ layoutPr?: LayoutProperties;
139
+ /** `cx:axisId`: the axes the series draws against, when it says. */
140
+ axisIds?: number[];
141
+ }
142
+ /** `cx:dataPt`. */
143
+ interface DataPoint extends Element {
144
+ idx: number;
145
+ spPr?: ChartModel.ShapeProperties;
146
+ }
147
+ type DataLabelPosition = 'bestFit' | 'b' | 'ctr' | 'inBase' | 'inEnd' | 'l' | 'outEnd' | 'r' | 't';
148
+ /** What `cx:dataLabels` and `cx:dataLabel` share. */
149
+ interface DataLabelOptions extends Element {
150
+ pos?: DataLabelPosition;
151
+ numFmt?: ChartModel.NumberFormat;
152
+ spPr?: ChartModel.ShapeProperties;
153
+ txPr?: ChartModel.TextBody;
154
+ visibility?: DataLabelVisibility;
155
+ separator?: string;
156
+ }
157
+ /** `cx:dataLabels`: the labels of a series, with the ones that differ listed in `labels`. */
158
+ interface DataLabels extends DataLabelOptions {
159
+ labels?: DataLabel[];
160
+ /** `cx:dataLabelHidden`: the points that show no label. */
161
+ hiddenLabels?: HiddenDataLabel[];
162
+ }
163
+ /** `cx:dataLabel`: the label of one point. */
164
+ interface DataLabel extends DataLabelOptions {
165
+ idx: number;
166
+ }
167
+ interface HiddenDataLabel extends Element {
168
+ idx: number;
169
+ }
170
+ /** `cx:visibility` of a label: what it shows. */
171
+ interface DataLabelVisibility extends Element {
172
+ seriesName?: boolean;
173
+ categoryName?: boolean;
174
+ value?: boolean;
175
+ }
176
+ /** `cx:layoutPr`: the model's layout options, and the indexes of a waterfall's totals. */
177
+ interface LayoutProperties extends ChartModel.LayoutProperties {
178
+ /** `cx:subtotals`: the indexes of the points that are totals. */
179
+ subtotals?: number[];
180
+ }
181
+ /** `cx:axis`. */
182
+ interface Axis extends Element {
183
+ id: number;
184
+ hidden?: boolean;
185
+ /** A category axis states this, a value axis {@link valScaling}. */
186
+ catScaling?: CategoryAxisScaling;
187
+ valScaling?: ValueAxisScaling;
188
+ title?: AxisTitle;
189
+ units?: AxisUnits;
190
+ majorGridlines?: Gridlines;
191
+ minorGridlines?: Gridlines;
192
+ majorTickMarks?: TickMarks;
193
+ minorTickMarks?: TickMarks;
194
+ /** `cx:tickLabels`: the axis shows its labels. Present when stated. */
195
+ tickLabels?: Element;
196
+ numFmt?: ChartModel.NumberFormat;
197
+ spPr?: ChartModel.ShapeProperties;
198
+ txPr?: ChartModel.TextBody;
199
+ }
200
+ interface CategoryAxisScaling extends Element {
201
+ /** The gap between categories as a fraction of a category's width. A stated `auto` is kept as markup. */
202
+ gapWidth?: number;
203
+ }
204
+ /** A bound or unit not stated is automatic. A stated `auto` is kept as markup. */
205
+ interface ValueAxisScaling extends Element {
206
+ max?: number;
207
+ min?: number;
208
+ majorUnit?: number;
209
+ minorUnit?: number;
210
+ }
211
+ interface AxisTitle extends Element {
212
+ tx?: Text;
213
+ spPr?: ChartModel.ShapeProperties;
214
+ txPr?: ChartModel.TextBody;
215
+ }
216
+ /** `cx:units`: the axis labels in hundreds, thousands… or as percentages. */
217
+ interface AxisUnits extends Element {
218
+ unit?: string;
219
+ unitsLabel?: AxisTitle;
220
+ }
221
+ interface Gridlines extends Element {
222
+ spPr?: ChartModel.ShapeProperties;
223
+ }
224
+ interface TickMarks extends Element {
225
+ type?: ChartModel.TickMark;
226
+ }
227
+ /** `cx:legend`. */
228
+ interface Legend extends Element {
229
+ pos?: SidePosition;
230
+ align?: PositionAlign;
231
+ overlay?: boolean;
232
+ spPr?: ChartModel.ShapeProperties;
233
+ txPr?: ChartModel.TextBody;
234
+ }
235
+ }
236
+ //# sourceMappingURL=_chartExMarkup.d.ts.map
@@ -0,0 +1,13 @@
1
+ export declare const CHART_STYLE_PART: {
2
+ type: string;
3
+ contentType: string;
4
+ name: string;
5
+ xml: string;
6
+ };
7
+ export declare const CHART_COLORS_PART: {
8
+ type: string;
9
+ contentType: string;
10
+ name: string;
11
+ xml: string;
12
+ };
13
+ //# sourceMappingURL=_chartExStyle.d.ts.map