@sheetxl/io-xlsx 0.8.0-beta.7 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/LICENSE.md +8 -7
  2. package/browser/esm/7rZlWcm56hn3Jmnk.mjs +7021 -0
  3. package/browser/esm/AZus_5slvoIVhf1u.mjs +10323 -0
  4. package/browser/esm/B9QfzGvsvg-V3utu.mjs +4632 -0
  5. package/browser/esm/{CX3yVwe-BnhCk4FY.mjs → BIR_Si489gIkGOnc.mjs} +194 -144
  6. package/browser/esm/BJFvc-i40R4rPZ5y.mjs +2433 -0
  7. package/browser/esm/{CGXxwkCRWLc0gcRQ.mjs → BX8Ebx4NC5zp7_3J.mjs} +3 -3
  8. package/browser/esm/{B4eKxNwxJjHLN126.mjs → Bnxw38IvtA04zXEE.mjs} +2 -2
  9. package/browser/esm/{DwcLXqv8-6Tl1zLO.mjs → CfVhYH77KdrR3fEK.mjs} +3 -3
  10. package/browser/esm/index.mjs +3 -4
  11. package/browser/esm/jIQks3Crw6jehdDU.mjs +2474 -0
  12. package/browser/esm/{DUi-V-E_AJwTIqlO.mjs → qc9hnuR2z-whY8YO.mjs} +3 -3
  13. package/browser/esm/wZGpmkMUubNjClhG.mjs +104 -0
  14. package/licenses/dependencies.txt +2 -2
  15. package/node/esm/{C51yFT2l-6il_xXO.mjs → BNLHWJHyy5eB0P_4.mjs} +2 -2
  16. package/node/esm/CVtsY2F9A9NzEGLk.mjs +2478 -0
  17. package/node/esm/CoeQ0LO-nNXiowwv.mjs +7284 -0
  18. package/node/esm/CxY3iIYLXVhCebeV.mjs +4746 -0
  19. package/node/esm/D2CZy9TQM9h2uqBh.mjs +2562 -0
  20. package/node/esm/{CMq7eF1vxibUumqT.mjs → Dm0hvKcR4xb0TV_N.mjs} +3 -3
  21. package/node/esm/_IA1gQ-zFQYQSZSs.mjs +6957 -0
  22. package/node/esm/index.mjs +65 -28
  23. package/node/esm/{DLBm8l0jyL2fVlxg.mjs → zZFe3mW0xjmobowq.mjs} +3 -3
  24. package/package.json +9 -10
  25. package/types/src/AutoFilterRules.d.ts +85 -22
  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 +30 -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/CustGeomUtils.d.ts +7 -0
  80. package/types/src/reader/dom/DOMTransformer.d.ts +2 -2
  81. package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +13 -1
  82. package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +8 -3
  83. package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts +15 -2
  84. package/types/src/reader/domVisitors/CommentVisitor.d.ts +2 -2
  85. package/types/src/reader/domVisitors/DrawingCxnSpVisitor.d.ts +1 -0
  86. package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +30 -1
  87. package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +9 -0
  88. package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts +14 -2
  89. package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +30 -2
  90. package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts +20 -1
  91. package/types/src/reader/domVisitors/DrawingVisitor.d.ts +10 -0
  92. package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +1 -11
  93. package/types/src/reader/domVisitors/FeaturePropertyBagVisitor.d.ts +18 -0
  94. package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts +0 -11
  95. package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts +3 -2
  96. package/types/src/reader/domVisitors/FormControlPrVisitor.d.ts +9 -0
  97. package/types/src/reader/domVisitors/ObjectDefaultsVisitor.d.ts +11 -0
  98. package/types/src/reader/domVisitors/ShapeTextVisitor.d.ts +44 -0
  99. package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +2 -2
  100. package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +26 -5
  101. package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts +11 -2
  102. package/types/src/reader/domVisitors/SlicersVisitor.d.ts +9 -3
  103. package/types/src/reader/domVisitors/SortStateVisitor.d.ts +2 -2
  104. package/types/src/reader/domVisitors/TextPropertiesVisitor.d.ts +13 -1
  105. package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +2 -2
  106. package/types/src/reader/domVisitors/TimelinesVisitor.d.ts +13 -0
  107. package/types/src/reader/domVisitors/WorkbookVisitor.d.ts +0 -9
  108. package/types/src/reader/domVisitors/_Dxfs.d.ts +10 -0
  109. package/types/src/reader/domVisitors/index.d.ts +10 -36
  110. package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts +1 -0
  111. package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +31 -6
  112. package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +26 -8
  113. package/types/src/richValue/ErrorRichValueHandler.d.ts +22 -0
  114. package/types/src/richValue/IRichValueHandler.d.ts +109 -0
  115. package/types/src/richValue/LocalImageRichValueHandler.d.ts +18 -0
  116. package/types/src/richValue/RichDataParts.d.ts +69 -0
  117. package/types/src/richValue/RichRecordWriter.d.ts +61 -0
  118. package/types/src/richValue/RichValueHandlers.d.ts +25 -0
  119. package/types/src/richValue/RichValueResolver.d.ts +54 -0
  120. package/types/src/richValue/WebImageRichValueHandler.d.ts +37 -0
  121. package/types/src/richValue/index.d.ts +7 -0
  122. package/types/src/utils/DrawingMLText.d.ts +39 -0
  123. package/types/src/utils/FormControls.d.ts +170 -0
  124. package/types/src/utils/SharedNames.d.ts +13 -0
  125. package/types/src/utils/SpreadsheetFont.d.ts +38 -0
  126. package/types/src/utils/VmlNoteShapes.d.ts +25 -32
  127. package/types/src/utils/VmlNoteStyle.d.ts +25 -0
  128. package/types/src/utils/VmlPrefixes.d.ts +24 -0
  129. package/types/src/vba/VBAProject.d.ts +0 -19
  130. package/types/src/writer/EvaluationSheet.d.ts +5 -0
  131. package/types/src/writer/builder/Emitter.d.ts +5 -0
  132. package/types/src/writer/builder/OpcXmlUtils.d.ts +0 -8
  133. package/types/src/writer/builder/PackageBuilder.d.ts +4 -41
  134. package/types/src/writer/builder/Types.d.ts +28 -28
  135. package/types/src/writer/emitters/CommentsEmitter.d.ts +3 -3
  136. package/types/src/writer/emitters/DrawingEmitter.d.ts +2 -2
  137. package/types/src/writer/emitters/ExternalLinkEmitter.d.ts +0 -11
  138. package/types/src/writer/emitters/FeaturePropertyBagEmitter.d.ts +8 -0
  139. package/types/src/writer/emitters/LegacyDrawingEmitter.d.ts +4 -4
  140. package/types/src/writer/emitters/PivotTableEmitter.d.ts +30 -1
  141. package/types/src/writer/emitters/PropsCoreEmitter.d.ts +7 -2
  142. package/types/src/writer/emitters/PropsCustomEmitter.d.ts +15 -0
  143. package/types/src/writer/emitters/RichValuePartsEmitters.d.ts +36 -0
  144. package/types/src/writer/emitters/RichValueRelEmitter.d.ts +12 -0
  145. package/types/src/writer/emitters/RichValueStructureEmitter.d.ts +4 -3
  146. package/types/src/writer/emitters/RichValueTypesEmitter.d.ts +3 -2
  147. package/types/src/writer/emitters/RichValueWebImageEmitter.d.ts +24 -0
  148. package/types/src/writer/emitters/SharedStringsEmitter.d.ts +6 -3
  149. package/types/src/writer/emitters/SlicerEmitter.d.ts +132 -0
  150. package/types/src/writer/emitters/StylesEmitter.d.ts +35 -2
  151. package/types/src/writer/emitters/TableEmitter.d.ts +14 -0
  152. package/types/src/writer/emitters/WorkbookEmitter.d.ts +24 -2
  153. package/types/src/writer/emitters/WorksheetEmitter.d.ts +4 -3
  154. package/types/src/writer/utils/AutoFilter.d.ts +3 -3
  155. package/types/src/writer/utils/CellControlComplements.d.ts +29 -0
  156. package/types/src/writer/utils/CustGeomUtils.d.ts +5 -0
  157. package/types/src/writer/utils/DateSystem.d.ts +6 -0
  158. package/types/src/writer/utils/DefaultRows.d.ts +22 -0
  159. package/types/src/writer/utils/DrawMLUtils.d.ts +42 -3
  160. package/types/src/writer/utils/DummyFunction.d.ts +0 -25
  161. package/types/src/writer/utils/DxfCollector.d.ts +14 -11
  162. package/types/src/writer/utils/PrstGeomUtils.d.ts +14 -0
  163. package/types/src/writer/utils/RichValueCollector.d.ts +81 -129
  164. package/types/src/writer/utils/SheetStyleLayout.d.ts +86 -0
  165. package/types/src/writer/utils/TextUtils.d.ts +26 -2
  166. package/types/src/writer/utils/UnsupportedFunctions.d.ts +2 -2
  167. package/types/src/writer/utils/XfVariants.d.ts +61 -0
  168. package/browser/cjs/17tMBnuyu4YIxixh.cjs +0 -1
  169. package/browser/cjs/B6sirGz6w-Bm7Ofo.cjs +0 -1
  170. package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +0 -1
  171. package/browser/cjs/BxU-OlZIQViQl7gX.cjs +0 -1
  172. package/browser/cjs/CDs8etXnw0kbBKKv.cjs +0 -1
  173. package/browser/cjs/CIpMN7SDVREKQUQE.cjs +0 -6
  174. package/browser/cjs/CycnxkfuKrDdwoJN.cjs +0 -5
  175. package/browser/cjs/D3EWCPfCu-qMOIGd.cjs +0 -1
  176. package/browser/cjs/DHKWtqZ0vQfXrbq1.cjs +0 -2
  177. package/browser/cjs/MqKQ_B5qRARrRbO4.cjs +0 -24
  178. package/browser/cjs/index.cjs +0 -1
  179. package/browser/cjs/xQ6-wbTw5UzZUM1Y.cjs +0 -1
  180. package/browser/esm/9n64lXAgZUe3aThr.mjs +0 -159
  181. package/browser/esm/BsNoW41d6hdpxTTS.mjs +0 -67
  182. package/browser/esm/BvAptAMpZVyBCx6-.mjs +0 -2402
  183. package/browser/esm/CjKioy-GzeSf08f8.mjs +0 -3326
  184. package/browser/esm/cJxidonaVNZHAXiZ.mjs +0 -4532
  185. package/browser/esm/dsVZVtt5w_yLb967.mjs +0 -5300
  186. package/node/esm/BRQYaMYO4UfhjJHw.mjs +0 -170
  187. package/node/esm/BlbtH3EvAf3K4foF.mjs +0 -2450
  188. package/node/esm/DhSPOg9wN0kD87Tb.mjs +0 -3051
  189. package/node/esm/KeV-N47eTyh5YE70.mjs +0 -4642
  190. package/node/esm/s_yVG0m9KB14YKeN.mjs +0 -3412
  191. package/types/src/legacyChart/OOXMLMappings.d.ts +0 -8
  192. package/types/src/legacyChart/OOXMLUtils.d.ts +0 -78
  193. package/types/src/legacyChart/ToOOXMLConverter.d.ts +0 -30
  194. package/types/src/reader/domVisitors/AxisVisitor.d.ts +0 -12
  195. package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts +0 -6
  196. package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts +0 -6
  197. package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts +0 -7
  198. package/types/src/reader/domVisitors/ChartVisitor.d.ts +0 -7
  199. package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts +0 -8
  200. package/types/src/reader/domVisitors/DataPointVisitor.d.ts +0 -6
  201. package/types/src/reader/domVisitors/HyperlinkVisitor.d.ts +0 -6
  202. package/types/src/reader/domVisitors/LayoutVisitor.d.ts +0 -5
  203. package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts +0 -5
  204. package/types/src/reader/domVisitors/LegendVisitor.d.ts +0 -5
  205. package/types/src/reader/domVisitors/MarkerVisitor.d.ts +0 -5
  206. package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts +0 -6
  207. package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts +0 -5
  208. package/types/src/reader/domVisitors/RichValueDataVisitor.d.ts +0 -7
  209. package/types/src/reader/domVisitors/RichValueStructureVisitor.d.ts +0 -6
  210. package/types/src/reader/domVisitors/SeriesVisitor.d.ts +0 -8
  211. package/types/src/reader/domVisitors/TitleVisitor.d.ts +0 -9
  212. package/types/src/writer/emitters/ChartColorsEmitter.d.ts +0 -7
  213. package/types/src/writer/emitters/ChartEmitter.d.ts +0 -14
  214. package/types/src/writer/emitters/ChartStyleEmitter.d.ts +0 -46
  215. package/types/src/writer/utils/HiddenFormulaXfs.d.ts +0 -28
@@ -1,11 +1,3 @@
1
- /**
2
- * Minimal, dependency-free parsing for the two flat OPC manifest formats the writer needs to read
3
- * back from a retained source package: `[Content_Types].xml` and `*.rels`. Both are, per spec, a
4
- * single level of self-closing elements with only attributes — no text content, no nesting beyond
5
- * the root — so an attribute-order-independent regex parser is enough, and it keeps the writer from
6
- * needing a DOM parser (it otherwise only ever produces XML, never parses it). See
7
- * `DESIGN-PACKAGE-PASSTHROUGH.md` §6.
8
- */
9
1
  export declare function decodeXmlEntities(s: string): string;
10
2
  export interface SourceContentTypes {
11
3
  readonly defaults: readonly {
@@ -59,26 +59,19 @@ export declare class PackageBuilder<Out> {
59
59
  private _scheduledByNodeKey;
60
60
  private _nodesByPath;
61
61
  private _writtenPaths;
62
+ /** Claimed paths whose emitter regenerates every relationship ({@link IEmitter.regeneratesRelationships}). */
63
+ private _regeneratedPaths;
62
64
  private _partWriter;
63
65
  private _registry;
64
66
  private _options;
65
67
  private _sourcePackage;
66
68
  /** See {@link PackageBuilderOptions.macroEnabled}. */
67
69
  private _macroEnabled;
70
+ /** See {@link PackageBuilderOptions.template}. */
71
+ private _template;
68
72
  private _explicitRelTargets;
69
73
  private _mapState;
70
74
  constructor(zip: IZipBackend<Out>, registry: EmitterRegistry, options?: PackageBuilderOptions);
71
- /**
72
- * Whether a source part named `name` will be in this package once {@link _passthroughSourceParts}
73
- * has run — the drop rules of `DESIGN-PACKAGE-PASSTHROUGH.md` §4, as one predicate. `false` when
74
- * there is no source package or it has no such part.
75
- *
76
- * @remarks
77
- * Does not consider whether an emitter claimed the *path* — that part is then in the package, but
78
- * as the emitter's, not the source's. It does consider whether the reader took the part onto the
79
- * model ({@link ISourcePackage.isAbsorbed}), which is a different question: the model writes that
80
- * part wherever its own numbering puts it, which need not be where the source had it.
81
- */
82
75
  private _isSourcePartCarried;
83
76
  /**
84
77
  * Hold the source's own relationship ids back in `partPath`'s set, before the emitter rewriting
@@ -98,15 +91,6 @@ export declare class PackageBuilder<Out> {
98
91
  * @returns The resulting package as a Uint8Array.
99
92
  */
100
93
  build(options?: ZipBackendCloseOptions): Promise<Uint8Array>;
101
- /**
102
- * Copy through every source-package part no emitter claimed, once emission is complete and
103
- * {@link _writtenPaths} is final. See `DESIGN-PACKAGE-PASSTHROUGH.md` §4 (bucket rules) and §6
104
- * (the rels/content-types merge).
105
- *
106
- * @remarks
107
- * No re-fetch, no residue map: this only ever reads the bytes handed in via
108
- * {@link PackageBuilderOptions.sourcePackage} — see the design doc's non-goals (§7).
109
- */
110
94
  private _passthroughSourceParts;
111
95
  /**
112
96
  * Declare the workbook part's macro-enabled **variant** of `CT_Workbook` when the package being
@@ -134,27 +118,6 @@ export declare class PackageBuilder<Out> {
134
118
  * would let a stale declaration through on anything.
135
119
  */
136
120
  private _applyWorkbookContentTypeVariant;
137
- /**
138
- * Seed `sourcePart`'s {@link IRelationshipSet} with the source's edges, each under the source's
139
- * own id. Targets are carried forward as-is (still relative to the same referencing part, at the
140
- * same OPC path) — nothing to recompute.
141
- *
142
- * @remarks
143
- * Which edges come back depends on who wrote the part (`DESIGN-PACKAGE-PASSTHROUGH.md` §6):
144
- *
145
- * - A **preserved** part is the source's bytes, so its XML still cites the ids the source's
146
- * `.rels` defined; every edge whose target is still in the package comes back with that id.
147
- * Nothing else ever wrote into this set, so the ids are free.
148
- * - A **rewritten** part (the root, or one an emitter claimed) had its emitter recreate the edges
149
- * it cites, so only what the emitter did not recreate is added: not an edge whose target an
150
- * emitter claimed (its own, correct edge exists already — keeping both would duplicate it), not
151
- * one added by name through `addRelationship`. The set had the source's ids reserved before
152
- * the emitter allocated ({@link _reserveSourceRelIds}), so these too keep their names —
153
- * unless an emitter took the id as a hint for a different target, in which case it is fresh.
154
- *
155
- * An edge whose target did not survive at all is dropped either way (§5). A `TargetMode="External"`
156
- * or `#`-fragment target is not a part and is never resolved as one.
157
- */
158
121
  private _mergeSourceRelsInto;
159
122
  /**
160
123
  * Add a root part to the package.
@@ -161,26 +161,20 @@ export interface EmitContext {
161
161
  * @returns The rId of the added relationship.
162
162
  */
163
163
  addExternal(relTypeUri: string, targetUrl: string, idHint?: string): PackagePart;
164
+ addRelationship(relTypeUri: string, targetPartPath: string, idHint?: string): string | null;
164
165
  /**
165
- * Adds a relationship from the current part to a part that is already going to be in this
166
- * package, rather than creating one: either a part another emitter wrote — one that is shared,
167
- * written once by whoever owns it and referenced from each part that uses it (a pivot cache,
168
- * written by the workbook, from every pivot table on it) — or a part the source package carries
169
- * through untouched because nothing modeled it (a `<ddeLink>` external link).
166
+ * Whether the package will hold the source package's own bytes at `partPath`: the source has the
167
+ * part, the passthrough carries it, and no emitter has claimed the path so far.
170
168
  *
171
- * @param relTypeUri The relationship type URI.
172
- * @param targetPartPath The target's absolute path (relative to the package root, no leading `/`).
173
- * @param idHint A preferred id (e.g. the source's own original rId), honored only if free in this
174
- * part's set; it falls back silently to an auto-generated id otherwise, so a caller that needs the
175
- * id to line up with something it already wrote (a replayed fragment citing this target) must use
176
- * the returned value rather than assume the hint was honored.
177
- * @returns The id assigned, or `null` if the target will not be in the package — no emitter
178
- * claimed the path and no source part survives at it (there is no source package, it has no such
179
- * part, the model absorbed it, or it is in a drop bucket for this save; see
180
- * `DESIGN-PACKAGE-PASSTHROUGH.md` §4). Nothing was added in that case: the caller must not write
181
- * the element that would have cited it.
169
+ * @remarks
170
+ * The question a replayed source fragment asks before citing a part: {@link addRelationship}
171
+ * accepts a path an emitter wrote, and what an emitter wrote there may be a different part of the
172
+ * same kind (the writer numbers pivot caches its own way). An emitter scheduled later can still
173
+ * claim the path, so ask once the parts that could collide have been added.
174
+ *
175
+ * @param partPath The part's absolute path (relative to the package root, no leading `/`).
182
176
  */
183
- addRelationship(relTypeUri: string, targetPartPath: string, idHint?: string): string | null;
177
+ carriesSourcePart(partPath: string): boolean;
184
178
  /**
185
179
  * Waits for all dependants to be emitted.
186
180
  */
@@ -263,6 +257,16 @@ export interface IEmitter<T = any> {
263
257
  * The function that emits this part
264
258
  */
265
259
  emit: (instance: T, ctx: EmitContext) => Promise<void> | void;
260
+ /**
261
+ * Whether this emitter creates every relationship its part cites, so that nothing of the source
262
+ * part's relationship set — neither its ids nor its edges — is kept for it.
263
+ *
264
+ * @remarks
265
+ * The default keeps the source's ids reserved and merges its leftover edges back in, for a part
266
+ * that still replays fragments of the source citing them. One that regenerates the whole part
267
+ * from the model answers `true`; otherwise every save would add the source's edges beside its own.
268
+ */
269
+ regeneratesRelationships?: () => boolean;
266
270
  /**
267
271
  * Returns the default path for this part instance.
268
272
  *
@@ -286,11 +290,6 @@ export interface PackageBuilderOptions {
286
290
  * A map that can be used across emitters to share state.
287
291
  */
288
292
  mapState?: Map<string, any>;
289
- /**
290
- * The source package to seed the build from, if the destination is being saved back into the same
291
- * OOXML package family it was read from. Parts no emitter claims are copied through verbatim
292
- * instead of being dropped. See `DESIGN-PACKAGE-PASSTHROUGH.md`.
293
- */
294
293
  sourcePackage?: ISourcePackage | null;
295
294
  /**
296
295
  * Whether the package being built is macro-enabled (`.xlsm`) rather than plain (`.xlsx`).
@@ -304,6 +303,13 @@ export interface PackageBuilderOptions {
304
303
  * a source's VBA project, matching Excel's own *Save As*.
305
304
  */
306
305
  macroEnabled?: boolean;
306
+ /**
307
+ * Whether the package being built is a template (`.xltx`/`.xltm`). Only the `xl/workbook.xml`
308
+ * content-type variant follows from it.
309
+ *
310
+ * @defaultValue false
311
+ */
312
+ template?: boolean;
307
313
  /**
308
314
  * Callback invoked when a part is emitted.
309
315
  *
@@ -344,12 +350,6 @@ export interface ISourcePackagePart {
344
350
  readonly uncompressedSize: number;
345
351
  readonly raw?: ISourcePackageRawPart;
346
352
  }
347
- /**
348
- * Structural interface for a retained source package, seeded into {@link PackageBuilder} so an
349
- * xlsx→xlsx round trip can copy through the parts nothing modeled instead of dropping them. Kept
350
- * structural (not importing `../SourcePackage` directly) so `builder/` stays format-agnostic — see
351
- * `DESIGN-PACKAGE-PASSTHROUGH.md` §6.
352
- */
353
353
  export interface ISourcePackage {
354
354
  getNames(): string[];
355
355
  has(name: string): boolean;
@@ -1,4 +1,4 @@
1
- import { IComment, ISheet, IStyledFont, ITheme } from '@sheetxl/sdk';
1
+ import { IComment, IWorksheet, IFontStyle, ITheme } from '@sheetxl/sdk';
2
2
  import { Emitter, EmitContext, IXmlWriter } from '../builder';
3
3
  export declare const REL_TYPE_COMMENTS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";
4
4
  export declare const REL_TYPE_THREADED_COMMENTS = "http://schemas.microsoft.com/office/2017/10/relationships/threadedComment";
@@ -16,7 +16,7 @@ export interface CommentHandle {
16
16
  }
17
17
  /** What the worksheet emitter schedules: the sheet's comments, roots only, in reading order. */
18
18
  export interface CommentsPartHandle {
19
- sheet: ISheet;
19
+ sheet: IWorksheet;
20
20
  comments: CommentHandle[];
21
21
  }
22
22
  /**
@@ -46,7 +46,7 @@ export declare function writeRichText(xml: IXmlWriter, content: IComment.Content
46
46
  * A run's `<rPr>`, in the order Excel writes it. Only what the run sets is written, and a property
47
47
  * set off (`weight: 400`) is written off, since it overrides whatever the run would inherit.
48
48
  */
49
- export declare function writeRunProperties(xml: IXmlWriter, font: IStyledFont.JSON, theme: ITheme): void;
49
+ export declare function writeRunProperties(xml: IXmlWriter, font: IFontStyle.JSON, theme: ITheme): void;
50
50
  /**
51
51
  * The cell address of a comment, or `null` when its cell is gone.
52
52
  */
@@ -1,4 +1,4 @@
1
- import { IResourceCollection, IMovable, ISheet } from '@sheetxl/sdk';
1
+ import { IResourceCollection, IMovable, IWorksheet } from '@sheetxl/sdk';
2
2
  import { Emitter, EmitContext } from '../builder';
3
3
  export declare class DrawingEmitter extends Emitter<ModelHandle> {
4
4
  constructor();
@@ -6,7 +6,7 @@ export declare class DrawingEmitter extends Emitter<ModelHandle> {
6
6
  emit(handle: ModelHandle, ctx: EmitContext): Promise<void>;
7
7
  }
8
8
  type ModelHandle = {
9
- sheet: ISheet;
9
+ sheet: IWorksheet;
10
10
  movables?: IMovable[];
11
11
  jsonMovables?: IMovable.JSON[];
12
12
  resources: IResourceCollection;
@@ -1,16 +1,5 @@
1
1
  import { IExternalBook } from '@sheetxl/sdk';
2
2
  import { Emitter, EmitContext } from '../builder';
3
- /**
4
- * Emits one `xl/externalLinks/externalLinkN.xml` — the cached snapshot of another workbook that
5
- * `[n]` in a formula addresses. See `DESIGN-EXTERNAL-LINKS.md` §5 phase A.
6
- *
7
- * @remarks
8
- * The part is scheduled by `WorkbookEmitter`, which owns the `[n]` order and therefore the path
9
- * numbering; this emitter only writes what one {@link IExternalBook.JSON} says.
10
- *
11
- * DDE and OLE links never reach here — they are not modeled at all, and their bytes are carried
12
- * through the package instead (design doc §2.1).
13
- */
14
3
  export declare class ExternalLinkEmitter extends Emitter<IExternalBook.JSON> {
15
4
  constructor();
16
5
  /** @inheritdoc IEmitter.emit */
@@ -0,0 +1,8 @@
1
+ import { Emitter, EmitContext } from '../builder';
2
+ import { CellControlComplements } from '../utils/CellControlComplements';
3
+ export declare class FeaturePropertyBagEmitter extends Emitter<CellControlComplements> {
4
+ constructor();
5
+ /** @inheritdoc IEmitter.emit */
6
+ emit(controlComplements: CellControlComplements, ctx: EmitContext): void;
7
+ }
8
+ //# sourceMappingURL=FeaturePropertyBagEmitter.d.ts.map
@@ -1,7 +1,7 @@
1
- import { ISheet } from '@sheetxl/sdk';
1
+ import { IWorksheet } from '@sheetxl/sdk';
2
2
  import { Emitter, EmitContext } from '../builder';
3
3
  /**
4
- * Writes a sheet's legacy drawing ({@link ISheet.JSON.legacyDrawing}) back out as the VML part it
4
+ * Writes a sheet's legacy drawing ({@link IWorksheet.JSON.legacyDrawing}) back out as the VML part it
5
5
  * was read from.
6
6
  *
7
7
  * @remarks
@@ -10,9 +10,9 @@ import { Emitter, EmitContext } from '../builder';
10
10
  * Its images do have models, and are written from those: the part carries the relationship ids the
11
11
  * markup cites, so an image lands back under the id its `<v:imagedata>` names.
12
12
  */
13
- export declare class LegacyDrawingEmitter extends Emitter<ISheet.LegacyDrawingJSON> {
13
+ export declare class LegacyDrawingEmitter extends Emitter<IWorksheet.LegacyDrawingJSON> {
14
14
  constructor();
15
15
  /** @inheritdoc IEmitter.emit */
16
- emit(legacyDrawing: ISheet.LegacyDrawingJSON, ctx: EmitContext): Promise<void>;
16
+ emit(legacyDrawing: IWorksheet.LegacyDrawingJSON, ctx: EmitContext): Promise<void>;
17
17
  }
18
18
  //# sourceMappingURL=LegacyDrawingEmitter.d.ts.map
@@ -1,5 +1,6 @@
1
1
  import { IPivotTable } from '@sheetxl/sdk';
2
2
  import { Emitter, EmitContext } from '../builder';
3
+ import { PivotStylesWrite } from '../../pivot/PivotFormats';
3
4
  /** The relationship a pivot table has to the cache it summarizes. */
4
5
  export declare const REL_TYPE_PIVOT_CACHE_DEFINITION = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition";
5
6
  /**
@@ -8,6 +9,8 @@ export declare const REL_TYPE_PIVOT_CACHE_DEFINITION = "http://schemas.openxmlfo
8
9
  * {@link writePivotCaches}.
9
10
  */
10
11
  export declare const SHARED_STATE_PIVOT_CACHE_PATHS = "pivotCachePaths";
12
+ /** The `pivotCacheId` the cache with this id was written with, for a pivot slicer's items; `null` if none. */
13
+ export declare const slicerPivotCacheIdOf: (ctx: EmitContext, cacheId: number) => string | null;
11
14
  /**
12
15
  * Writes a sheet's {@link IPivotTable | pivot table} back out as the part it was read from.
13
16
  *
@@ -27,18 +30,44 @@ export declare class PivotTableEmitter extends Emitter<IPivotTable.JSON> {
27
30
  /** @inheritdoc IEmitter.emit */
28
31
  emit(pivotTable: IPivotTable.JSON, ctx: EmitContext): Promise<void>;
29
32
  }
33
+ /**
34
+ * The sheet's pivot rules as written: each rule's key (`IConditionalFormat.JSON.pivotKey`, its
35
+ * priority as read) to the priority it was written with.
36
+ */
37
+ export type PivotConditionalKeys = Map<number, number>;
38
+ /**
39
+ * `xml` with each `<conditionalFormat priority>` of the table restated as the priority its sheet
40
+ * rule was written with, and one whose rule was not written removed.
41
+ *
42
+ * @remarks
43
+ * The table names its conditional formats by the sheet-wide `<cfRule priority>`, and the writer
44
+ * renumbers those 1..N. A table entry that names no pivot rule, or a rule that is not the table's,
45
+ * is a file Excel opens only through repair (`pivot-probes/probe-pivot-cf.ps1`, 2026-10-24).
46
+ */
47
+ export declare const remapConditionalFormats: (xml: string, keys: PivotConditionalKeys) => string;
48
+ /**
49
+ * The save's ids for the formats a pivot part cites: number formats from the styles laid out
50
+ * before any part emits ({@link STYLES_LAYOUT_SHARED_STATE}), differential formats added to the
51
+ * dxfs the worksheets collect.
52
+ */
53
+ export declare const pivotStylesWriteOf: (ctx: EmitContext) => PivotStylesWrite;
30
54
  /** Where the workbook wrote the cache with this id, or `null` if it wrote none. */
31
55
  export declare const cachePathFor: (ctx: EmitContext, cacheId: number) => string | null;
32
56
  /**
33
57
  * Adds the workbook's pivot caches to the package, each with the records part its definition
34
58
  * references, and leaves where each landed in the shared states for the tables to find.
35
59
  *
60
+ * A cache is written as the part it was read from while it has one (it is unchanged since load),
61
+ * its source restated where the engine moved it, and from its model otherwise.
62
+ *
36
63
  * @remarks
37
64
  * Called by `WorkbookEmitter` **before** it schedules the sheets, since a table's relationship to
38
65
  * its cache needs the cache's path to exist by the time the sheet's part emits; the `<pivotCaches>`
39
66
  * element itself is written later, where `CT_Workbook` puts it, from the ids returned here.
67
+ *
68
+ * @param slicerCacheIds The caches pivot slicers index: each is written with a `pivotCacheId`.
40
69
  */
41
- export declare const writePivotCaches: (ctx: EmitContext, pivotCaches: readonly IPivotTable.CacheJSON[] | undefined) => Promise<{
70
+ export declare const writePivotCaches: (ctx: EmitContext, pivotCaches: readonly IPivotTable.CacheJSON[] | undefined, date1904?: boolean, slicerCacheIds?: ReadonlySet<number>) => Promise<{
42
71
  cacheId: number;
43
72
  relId: string;
44
73
  }[]>;
@@ -1,7 +1,12 @@
1
+ import { IWorkbook } from '@sheetxl/sdk';
1
2
  import { Emitter, EmitContext } from '../builder';
2
- export declare class PropsCoreEmitter extends Emitter<Map<any, string>> {
3
+ export declare class PropsCoreEmitter extends Emitter<ModelHandle> {
3
4
  constructor();
4
5
  /** @inheritdoc IEmitter.emit */
5
- emit(props: Map<any, string>, ctx: EmitContext): Promise<void>;
6
+ emit(handle: ModelHandle, ctx: EmitContext): Promise<void>;
6
7
  }
8
+ type ModelHandle = {
9
+ model: IWorkbook;
10
+ };
11
+ export {};
7
12
  //# sourceMappingURL=PropsCoreEmitter.d.ts.map
@@ -0,0 +1,15 @@
1
+ import { IWorkbook } from '@sheetxl/sdk';
2
+ import { Emitter, EmitContext } from '../builder';
3
+ /**
4
+ * `docProps/custom.xml`: the workbook's custom document properties. Added only when there are some.
5
+ */
6
+ export declare class PropsCustomEmitter extends Emitter<ModelHandle> {
7
+ constructor();
8
+ /** @inheritdoc IEmitter.emit */
9
+ emit(handle: ModelHandle, ctx: EmitContext): Promise<void>;
10
+ }
11
+ type ModelHandle = {
12
+ model: IWorkbook;
13
+ };
14
+ export {};
15
+ //# sourceMappingURL=PropsCustomEmitter.d.ts.map
@@ -0,0 +1,36 @@
1
+ import { Emitter, EmitContext } from '../builder';
2
+ import { RichValueCollector } from '../utils/RichValueCollector';
3
+ /**
4
+ * Emits `rdarray.xml`: the arrays rich values hold (`_array`), each `<a r>` its items row major.
5
+ */
6
+ export declare class RichValueArrayEmitter extends Emitter<RichValueCollector> {
7
+ constructor();
8
+ /** @inheritdoc IEmitter.emit */
9
+ emit(rvCollector: RichValueCollector, ctx: EmitContext): Promise<void>;
10
+ }
11
+ /**
12
+ * Emits `rdsupportingpropertybagstructure.xml`: one `<s>` per supporting property bag structure.
13
+ */
14
+ export declare class RichValueBagStructureEmitter extends Emitter<RichValueCollector> {
15
+ constructor();
16
+ /** @inheritdoc IEmitter.emit */
17
+ emit(rvCollector: RichValueCollector, ctx: EmitContext): Promise<void>;
18
+ }
19
+ /**
20
+ * Emits `rdsupportingpropertybag.xml`: the bag arrays (`spbArrays`) and the bags (`spbData`).
21
+ */
22
+ export declare class RichValueBagEmitter extends Emitter<RichValueCollector> {
23
+ constructor();
24
+ /** @inheritdoc IEmitter.emit */
25
+ emit(rvCollector: RichValueCollector, ctx: EmitContext): Promise<void>;
26
+ }
27
+ /**
28
+ * Emits `richStyles.xml`: the styles a `_Format` bag names by 1-based index, each its number
29
+ * format and its card role (`IsTitleField`, `IsHeroField`).
30
+ */
31
+ export declare class RichValueStylesEmitter extends Emitter<RichValueCollector> {
32
+ constructor();
33
+ /** @inheritdoc IEmitter.emit */
34
+ emit(rvCollector: RichValueCollector, ctx: EmitContext): Promise<void>;
35
+ }
36
+ //# sourceMappingURL=RichValuePartsEmitters.d.ts.map
@@ -0,0 +1,12 @@
1
+ import { IResource } from '@sheetxl/sdk';
2
+ import { Emitter, EmitContext } from '../builder';
3
+ /**
4
+ * Emits `richValueRel.xml`: for each picture a `_localImage` value names, a relationship to its
5
+ * media part, in `_rvRel:LocalImageIdentifier` order.
6
+ */
7
+ export declare class RichValueRelEmitter extends Emitter<readonly IResource[]> {
8
+ constructor();
9
+ /** @inheritdoc IEmitter.emit */
10
+ emit(resources: readonly IResource[], ctx: EmitContext): Promise<void>;
11
+ }
12
+ //# sourceMappingURL=RichValueRelEmitter.d.ts.map
@@ -1,8 +1,9 @@
1
1
  import { Emitter, EmitContext } from '../builder';
2
- import { RichValueCollector, RichPrimitiveType } from '../utils/RichValueCollector';
2
+ import { RichPrimitiveType } from '../../richValue';
3
+ import { RichValueCollector } from '../utils/RichValueCollector';
3
4
  /**
4
- * Emits `rdrichvaluestructure.xml` — one `<s>` element per unique handler
5
- * type registered in the {@link RichValueCollector}.
5
+ * Emits `rdrichvaluestructure.xml` — one `<s>` element per structure written
6
+ * in the {@link RichValueCollector}.
6
7
  *
7
8
  * @remarks
8
9
  * Example output for a workbook that only has extended-error rich values:
@@ -1,10 +1,11 @@
1
1
  import { Emitter, EmitContext } from '../builder';
2
+ import { RichValueCollector } from '../utils/RichValueCollector';
2
3
  /**
3
4
  * Emits Rich Values
4
5
  */
5
- export declare class RichValueTypesEmitter extends Emitter<Map<any, string>> {
6
+ export declare class RichValueTypesEmitter extends Emitter<RichValueCollector | null> {
6
7
  constructor();
7
8
  /** @inheritdoc IEmitter.emit */
8
- emit(_params: any, ctx: EmitContext): Promise<void>;
9
+ emit(rvCollector: RichValueCollector | null, ctx: EmitContext): Promise<void>;
9
10
  }
10
11
  //# sourceMappingURL=RichValueTypesEmitter.d.ts.map
@@ -0,0 +1,24 @@
1
+ import { IWorkbook } from '@sheetxl/sdk';
2
+ import { WrittenWebImage } from '../../richValue/WebImageRichValueHandler';
3
+ import { Emitter, EmitContext } from '../builder';
4
+ /** What {@link RichValueWebImageEmitter} writes: the pictures, and the workbook to fetch any without bytes through. */
5
+ export interface RichValueWebImages {
6
+ /** The pictures, in `WebImageIdentifier` order. */
7
+ images: readonly WrittenWebImage[];
8
+ workbook: IWorkbook;
9
+ }
10
+ /**
11
+ * Emits `rdRichValueWebImage.xml`: for each picture a `_webimage` value names, its source URL
12
+ * (`address`, an external hyperlink) and the picture itself (`blip`, a media part), as Excel keeps
13
+ * an `IMAGE`'s picture in the file.
14
+ *
15
+ * @remarks
16
+ * The picture is the value's resource; a value with none is fetched through the workbook, and a
17
+ * source with no picture to give is written with its address alone.
18
+ */
19
+ export declare class RichValueWebImageEmitter extends Emitter<RichValueWebImages> {
20
+ constructor();
21
+ /** @inheritdoc IEmitter.emit */
22
+ emit(webImages: RichValueWebImages, ctx: EmitContext): Promise<void>;
23
+ }
24
+ //# sourceMappingURL=RichValueWebImageEmitter.d.ts.map
@@ -1,4 +1,4 @@
1
- import { IStringCollection } from '@sheetxl/sdk';
1
+ import { ITheme, RichText } from '@sheetxl/sdk';
2
2
  import { Emitter, EmitContext } from '../builder';
3
3
  export declare class SharedStringsEmitter extends Emitter<ModelHandle> {
4
4
  constructor();
@@ -6,8 +6,11 @@ export declare class SharedStringsEmitter extends Emitter<ModelHandle> {
6
6
  emit(sharedStrings: ModelHandle, ctx: EmitContext): Promise<void>;
7
7
  }
8
8
  type ModelHandle = {
9
- json: string[];
10
- model: IStringCollection;
9
+ /** The strings, a `RichText` for one with runs. */
10
+ json: (string | RichText)[];
11
+ model: (string | RichText)[];
12
+ /** The workbook theme, for a run's theme color. */
13
+ theme?: ITheme;
11
14
  };
12
15
  export {};
13
16
  //# sourceMappingURL=SharedStringsEmitter.d.ts.map
@@ -0,0 +1,132 @@
1
+ import { ISheet, IWorksheet, ISlicer, IWorkbook } from '@sheetxl/sdk';
2
+ import { Emitter, EmitContext, IXmlWriter } from '../builder';
3
+ /** The relationship a sheet has to its slicer part. */
4
+ export declare const REL_TYPE_SLICER = "http://schemas.microsoft.com/office/2007/relationships/slicer";
5
+ /** The relationship the workbook has to each slicer cache part. */
6
+ export declare const REL_TYPE_SLICER_CACHE = "http://schemas.microsoft.com/office/2007/relationships/slicerCache";
7
+ /** The relationship a sheet has to its timeline part. */
8
+ export declare const REL_TYPE_TIMELINE = "http://schemas.microsoft.com/office/2011/relationships/timeline";
9
+ /** The relationship the workbook has to each timeline cache part. */
10
+ export declare const REL_TYPE_TIMELINE_CACHE = "http://schemas.microsoft.com/office/2011/relationships/timelineCache";
11
+ /**
12
+ * A sheet's slicer part: the table slicers, the pivot slicers, or the timelines placed on the
13
+ * sheet, in their movable order. Excel cites each kind from its own list, so each has its own part.
14
+ */
15
+ export interface SlicersPartHandle {
16
+ sheet: IWorksheet;
17
+ slicers: ISlicer[];
18
+ }
19
+ /** A slicer on pivot tables (read from a file): its pivot tables and cache as carried. */
20
+ export declare const pivotOf: (slicer: ISlicer) => ISlicer.PivotJSON | null;
21
+ /** Whether a slicer is a timeline: a slicer on pivot tables whose items are dates. */
22
+ export declare const isTimeline: (slicer: ISlicer) => boolean;
23
+ /**
24
+ * The slicers placed on a sheet that can be written, in movable order: a table slicer whose
25
+ * source names a live table, and every pivot slicer, which Excel keeps when its pivot tables are
26
+ * gone. A table slicer that names none has no column to filter and no cache to write, so it is not
27
+ * written.
28
+ */
29
+ export declare const collectSheetSlicers: (sheet: IWorksheet) => ISlicer[];
30
+ /**
31
+ * Writes a sheet's slicer part, `xl/slicers/slicerN.xml`: one `slicer` per slicer of the handle,
32
+ * as Excel writes them, each naming the cache the workbook writes for it.
33
+ *
34
+ * @remarks
35
+ * Scheduled from `WorksheetEmitter`, which cites the part from one of the sheet's slicer-list exts.
36
+ * Only what differs from a default is written beside the name, cache and caption; the row height
37
+ * always, in EMU, as Excel does.
38
+ */
39
+ export declare class SlicersEmitter extends Emitter<SlicersPartHandle> {
40
+ constructor();
41
+ /** @inheritdoc IEmitter.emit */
42
+ emit(handle: SlicersPartHandle, ctx: EmitContext): Promise<void>;
43
+ }
44
+ /**
45
+ * Writes one slicer's cache part, `xl/slicerCaches/slicerCacheN.xml`: its name, the column's name
46
+ * as `sourceName`, and the `x15:tableSlicerCache` ext naming the table by the id `TableEmitter`
47
+ * wrote it with and the column by its 1-based index.
48
+ *
49
+ * @remarks
50
+ * Scheduled from `WorkbookEmitter` once every sheet has been written and so every table has its
51
+ * id. The sort order, custom-list sort and cross filter are written only when not Excel's defaults.
52
+ */
53
+ export declare class SlicerCacheEmitter extends Emitter<ISlicer> {
54
+ constructor();
55
+ /** @inheritdoc IEmitter.emit */
56
+ emit(slicer: ISlicer, ctx: EmitContext): Promise<void>;
57
+ /**
58
+ * A pivot slicer's cache: its pivot tables, then its items. A slicer on worksheet pivot tables
59
+ * writes every item of its field once, in its order, selected as the first pivot table shows it
60
+ * (`pivot-probes/probe-pivot-slicer-edits.ps1`); a data-model slicer's are written as read.
61
+ */
62
+ emitPivot(slicer: ISlicer, pivot: ISlicer.PivotJSON, ctx: EmitContext): void;
63
+ }
64
+ /**
65
+ * The pivot caches the workbook's slicers on worksheet pivot tables index: each is written with a
66
+ * `pivotCacheId` for the slicer to name it by.
67
+ */
68
+ export declare const pivotSlicerCacheIdsOf: (workbook: IWorkbook) => Set<number>;
69
+ /**
70
+ * Writes a sheet's timeline part, `xl/timelines/timelineN.xml`: one `timeline` per timeline of the
71
+ * handle, its name, cache and caption from the slicer and everything else as read.
72
+ */
73
+ export declare class TimelinesEmitter extends Emitter<SlicersPartHandle> {
74
+ constructor();
75
+ /** @inheritdoc IEmitter.emit */
76
+ emit(handle: SlicersPartHandle, ctx: EmitContext): Promise<void>;
77
+ }
78
+ /**
79
+ * Writes one timeline's cache part, `xl/timelineCaches/timelineCacheN.xml`: its name, source name
80
+ * and pivot tables, then its state as read.
81
+ */
82
+ export declare class TimelineCacheEmitter extends Emitter<ISlicer> {
83
+ constructor();
84
+ /** @inheritdoc IEmitter.emit */
85
+ emit(slicer: ISlicer, ctx: EmitContext): Promise<void>;
86
+ }
87
+ /** Shared-states key under which `WorkbookEmitter` leaves the `sheetId` each sheet is written with. */
88
+ export declare const SHARED_STATE_SHEET_IDS = "sheetIdsBySheet";
89
+ /** The `sheetId` each sheet is written with; a pivot slicer's cache names its pivot table's sheet by it. */
90
+ export declare const sheetIdsOf: (ctx: EmitContext) => Map<ISheet, number>;
91
+ /** The relationships to the slicer caches written, by the list the workbook cites each kind from. */
92
+ export interface SlicerCacheRelIds {
93
+ /** Table slicers' caches, cited from `x15:slicerCaches`. */
94
+ table: string[];
95
+ /** Pivot slicers' caches, cited from `x14:slicerCaches`. */
96
+ pivot: string[];
97
+ /** Timelines' caches, cited from `x15:timelineCacheRefs`. */
98
+ timeline: string[];
99
+ /** The names of the slicer caches written, table and pivot; each needs a workbook name. */
100
+ cacheNames: string[];
101
+ }
102
+ /**
103
+ * Schedules a cache part for every slicer of the workbook, in sheet order and then movable order,
104
+ * and returns the relationship ids the workbook cites them by and the slicer caches' names.
105
+ *
106
+ * @remarks
107
+ * Called by `WorkbookEmitter` **after** the sheets have been written, since a cache names its table
108
+ * by the id the sheet minted when it scheduled the table part. A table slicer whose table was not
109
+ * scheduled is left out, with its slicer element still in the sheet's part; Excel repairs that
110
+ * rather than refuse the file.
111
+ */
112
+ export declare const writeSlicerCaches: (ctx: EmitContext, workbook: IWorkbook) => SlicerCacheRelIds;
113
+ /**
114
+ * The sheet's slicer-list exts: schedules a slicer part for the sheet's pivot slicers, one for its
115
+ * table slicers and a timeline part for its timelines, and cites each from the list Excel reads it
116
+ * from: pivot slicers from the `x14` list, table slicers from the `x15` one, timelines from
117
+ * `x15:timelineRefs`. Written inside the worksheet's `extLst`, after the conditional formats and
118
+ * data validations, where Excel puts them.
119
+ */
120
+ export declare const writeSlicerListExt: (ctx: EmitContext, xml: IXmlWriter, handle: SlicersPartHandle) => void;
121
+ /** The workbook's `x15:timelineCacheRefs` ext: one `x15:timelineCacheRef` per timeline cache written. */
122
+ export declare const writeTimelineCacheRefsExt: (xml: IXmlWriter, relIds: readonly string[]) => void;
123
+ /**
124
+ * The workbook's `x14:slicerCaches` ext: one `x14:slicerCache` per pivot slicer cache written.
125
+ */
126
+ export declare const writePivotSlicerCachesExt: (xml: IXmlWriter, relIds: readonly string[]) => void;
127
+ /**
128
+ * The workbook's `x15:slicerCaches` ext: one `x14:slicerCache` per table slicer cache written.
129
+ * Written inside the workbook's `extLst`, before the calc features, where Excel puts it.
130
+ */
131
+ export declare const writeSlicerCachesExt: (xml: IXmlWriter, relIds: readonly string[]) => void;
132
+ //# sourceMappingURL=SlicerEmitter.d.ts.map