@sheetxl/io-xlsx 0.8.0-beta.1 → 0.8.0-beta.11
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/browser/esm/BiDqExNXiY7ykk8E.mjs +2327 -0
- package/browser/esm/{Ctqql4O-3xj2K8vv.mjs → Bs0EzhdU8WgGfPzf.mjs} +193 -143
- package/browser/esm/CLWsOc6DO8l1G_LF.mjs +2213 -0
- package/browser/esm/{CLWzJJyoSrykkVLX.mjs → CZ9I80og75SDRjv0.mjs} +2 -2
- package/browser/esm/{Dz1Dp8DDJvhd09RR.mjs → CuAXx5i4uqTz-mMY.mjs} +1 -1
- package/browser/esm/Cv3R6fGatARKedSn.mjs +8635 -0
- package/browser/esm/{BkNXyG6NC-w5Xo92.mjs → CzFYJPxmLyKgEKF0.mjs} +28 -13
- package/browser/esm/DICL6ecj9BdJv8aX.mjs +104 -0
- package/browser/esm/DatIA9fZbEPjW4bh.mjs +5638 -0
- package/browser/esm/index.mjs +2 -3
- package/browser/esm/yveeVJ6hKDI5KDEz.mjs +4168 -0
- package/licenses/dependencies.txt +2 -2
- package/node/esm/B9Zn6H1RV07Ob377.mjs +2294 -0
- package/node/esm/Bpqm_PpGLpdjL47-.mjs +2368 -0
- package/node/esm/{fOnuUjpPCAzmuIXN.mjs → CAJxmJdobUbzpUz5.mjs} +2 -2
- package/node/esm/{CEV7nKotMpeRRnQC.mjs → CxlSbH7mmnEEsqmX.mjs} +1 -1
- package/node/esm/DD-yXSBzvDYy0TX5.mjs +5842 -0
- package/node/esm/DScqM1V4wPntNP6-.mjs +5235 -0
- package/node/esm/{CEAmv36xpTNgFwl_.mjs → fopiRR7OiVoEiF7B.mjs} +49 -35
- package/node/esm/index.mjs +77 -25
- package/node/esm/ipiyzn5Pfohw2afB.mjs +4271 -0
- package/package.json +7 -8
- package/types/src/AutoFilterRules.d.ts +94 -11
- package/types/src/ConditionalFormatRules.d.ts +5 -5
- package/types/src/DataValidationRules.d.ts +18 -2
- package/types/src/DefinedNameAttributes.d.ts +8 -0
- package/types/src/ExcelCalcStamp.d.ts +39 -0
- package/types/src/ExcelCompat.d.ts +209 -42
- package/types/src/ExcelReservedNames.d.ts +3 -4
- package/types/src/KnownFonts.d.ts +50 -0
- package/types/src/LegacyFormula.d.ts +41 -7
- package/types/src/OOXMLExtensions.d.ts +14 -2
- package/types/src/PageLayoutAttributes.d.ts +8 -0
- package/types/src/Plugin.d.ts +28 -5
- package/types/src/ProtectionAttributes.d.ts +38 -0
- package/types/src/SheetKinds.d.ts +57 -0
- package/types/src/SheetViewAttributes.d.ts +4 -0
- package/types/src/SortExtent.d.ts +16 -0
- package/types/src/SourcePackage.d.ts +31 -12
- package/types/src/Types.d.ts +28 -0
- package/types/src/XlsxHeader.d.ts +19 -0
- package/types/src/chart/ChartExXml.d.ts +38 -0
- package/types/src/chart/ChartPartXml.d.ts +47 -0
- package/types/src/chart/ChartSpaceXml.d.ts +36 -0
- package/types/src/chart/_XmlTree.d.ts +34 -0
- package/types/src/chart/_chartCodecs.d.ts +10 -0
- package/types/src/chart/_chartExCodecs.d.ts +7 -0
- package/types/src/chart/_chartExFold.d.ts +14 -0
- package/types/src/chart/_chartExMarkup.d.ts +236 -0
- package/types/src/chart/_chartExStyle.d.ts +22 -0
- package/types/src/chart/_codec.d.ts +78 -0
- package/types/src/chart/_drawingml.d.ts +10 -0
- package/types/src/chart/_xml.d.ts +70 -0
- package/types/src/reader/DocumentPropertiesRead.d.ts +16 -0
- package/types/src/reader/DummyFunctionUnwrap.d.ts +2 -2
- package/types/src/reader/HeaderStyles.d.ts +15 -0
- package/types/src/reader/HiddenFormulas.d.ts +16 -0
- package/types/src/reader/IsoDateCell.d.ts +20 -0
- package/types/src/reader/LibreOfficeDataTable.d.ts +11 -0
- package/types/src/reader/SlicerJoin.d.ts +24 -0
- package/types/src/reader/Warning.d.ts +29 -0
- package/types/src/reader/ZipReader.d.ts +1 -1
- package/types/src/reader/_SlicerRecord.d.ts +37 -0
- package/types/src/reader/dom/CustGeomUtils.d.ts +7 -0
- package/types/src/reader/dom/DOMTransformer.d.ts +2 -2
- package/types/src/reader/dom/ExecutionContext.d.ts +16 -3
- package/types/src/reader/dom/Types.d.ts +19 -3
- package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +13 -1
- package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +16 -3
- package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts +15 -2
- package/types/src/reader/domVisitors/CommentVisitor.d.ts +24 -2
- package/types/src/reader/domVisitors/CommentsVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/DrawingCxnSpVisitor.d.ts +1 -0
- package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +34 -1
- package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +9 -0
- package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts +14 -2
- package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +30 -2
- package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts +20 -1
- package/types/src/reader/domVisitors/DrawingVisitor.d.ts +10 -0
- package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +21 -3
- package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts +4 -4
- package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts +3 -2
- package/types/src/reader/domVisitors/FormControlPrVisitor.d.ts +9 -0
- package/types/src/reader/domVisitors/ObjectDefaultsVisitor.d.ts +11 -0
- package/types/src/reader/domVisitors/ShapeTextVisitor.d.ts +44 -0
- package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +3 -3
- package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +21 -6
- package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts +7 -2
- package/types/src/reader/domVisitors/SlicersVisitor.d.ts +7 -3
- package/types/src/reader/domVisitors/SortStateVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/TextPropertiesVisitor.d.ts +13 -1
- package/types/src/reader/domVisitors/ThreadedCommentVisitor.d.ts +18 -1
- package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/WorkbookVisitor.d.ts +11 -1
- package/types/src/reader/domVisitors/_Dxfs.d.ts +10 -0
- package/types/src/reader/domVisitors/index.d.ts +6 -32
- package/types/src/reader/sax/LeanSaxParser.d.ts +58 -0
- package/types/src/reader/sax/SaxParser.d.ts +11 -1
- package/types/src/reader/sax/SaxVisitor.d.ts +3 -2
- package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts +9 -0
- package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +46 -6
- package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +23 -11
- package/types/src/utils/DrawingMLText.d.ts +39 -0
- package/types/src/utils/FormControls.d.ts +170 -0
- package/types/src/utils/SharedNames.d.ts +13 -0
- package/types/src/utils/SpreadsheetFont.d.ts +38 -0
- package/types/src/utils/VmlNoteShapes.d.ts +128 -0
- package/types/src/utils/VmlNoteStyle.d.ts +44 -0
- package/types/src/utils/VmlPrefixes.d.ts +24 -0
- package/types/src/vba/VBAProject.d.ts +52 -4
- package/types/src/writer/builder/ContentTypes.d.ts +13 -0
- package/types/src/writer/builder/Emitter.d.ts +11 -6
- package/types/src/writer/builder/OpcXmlUtils.d.ts +2 -0
- package/types/src/writer/builder/PackageBuilder.d.ts +74 -22
- package/types/src/writer/builder/PartWriter.d.ts +5 -0
- package/types/src/writer/builder/RelationshipSet.d.ts +3 -0
- package/types/src/writer/builder/Types.d.ts +124 -38
- package/types/src/writer/builder/_Types.d.ts +17 -0
- package/types/src/writer/emitters/CommentsEmitter.d.ts +58 -0
- package/types/src/writer/emitters/DrawingEmitter.d.ts +2 -2
- package/types/src/writer/emitters/EmbeddedPartEmitter.d.ts +60 -0
- package/types/src/writer/emitters/ExternalLinkEmitter.d.ts +19 -0
- package/types/src/writer/emitters/LegacyDrawingEmitter.d.ts +18 -0
- package/types/src/writer/emitters/PersonsEmitter.d.ts +17 -0
- package/types/src/writer/emitters/PivotTableEmitter.d.ts +45 -0
- package/types/src/writer/emitters/PropsCoreEmitter.d.ts +7 -2
- package/types/src/writer/emitters/PropsCustomEmitter.d.ts +15 -0
- package/types/src/writer/emitters/SharedStringsEmitter.d.ts +6 -3
- package/types/src/writer/emitters/SlicerEmitter.d.ts +66 -0
- package/types/src/writer/emitters/StylesEmitter.d.ts +2 -2
- package/types/src/writer/emitters/TableEmitter.d.ts +14 -0
- package/types/src/writer/emitters/ThreadedCommentsEmitter.d.ts +27 -0
- package/types/src/writer/emitters/WorkbookEmitter.d.ts +21 -3
- package/types/src/writer/emitters/WorksheetEmitter.d.ts +4 -3
- package/types/src/writer/utils/AutoFilter.d.ts +3 -3
- package/types/src/writer/utils/CustGeomUtils.d.ts +5 -0
- package/types/src/writer/utils/DefaultRows.d.ts +38 -0
- package/types/src/writer/utils/DrawMLUtils.d.ts +57 -3
- package/types/src/writer/utils/DummyFunction.d.ts +0 -2
- package/types/src/writer/utils/DxfCollector.d.ts +14 -11
- package/types/src/writer/utils/HiddenFormulaXfs.d.ts +28 -0
- package/types/src/writer/utils/PrstGeomUtils.d.ts +6 -0
- package/types/src/writer/utils/SheetStyleLayout.d.ts +73 -0
- package/types/src/writer/utils/TextUtils.d.ts +26 -2
- package/types/src/writer/utils/UnsupportedFunctions.d.ts +2 -2
- package/browser/cjs/B6sirGz6w-Bm7Ofo.cjs +0 -1
- package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +0 -1
- package/browser/cjs/BAtEL-5TLyoaPFDP.cjs +0 -2
- package/browser/cjs/Bg0e53JZa8vhmm5a.cjs +0 -1
- package/browser/cjs/CIpMN7SDVREKQUQE.cjs +0 -6
- package/browser/cjs/CK5FFUvet6FnIYO_.cjs +0 -5
- package/browser/cjs/D5Y4KQhKdukOkjvA.cjs +0 -2
- package/browser/cjs/DV6LeTEiiFUrZoxj.cjs +0 -1
- package/browser/cjs/DWkuoJSgvcXJTdN1.cjs +0 -1
- package/browser/cjs/Db8YjGM6TG34c8aT.cjs +0 -1
- package/browser/cjs/index.cjs +0 -1
- package/browser/cjs/xQ6-wbTw5UzZUM1Y.cjs +0 -1
- package/browser/esm/4BWLu134ABlCQEtM.mjs +0 -3655
- package/browser/esm/BzQ_lPzc8C4OTIGZ.mjs +0 -99
- package/browser/esm/CJknI8BYGSZr-4zS.mjs +0 -52
- package/browser/esm/Cok_fBIUCHDSrKw0.mjs +0 -2211
- package/browser/esm/D-m_kQLaewdwuXaF.mjs +0 -2685
- package/browser/esm/Dj7D2nVdAZ3TiUks.mjs +0 -4743
- package/browser/esm/ijQzHH-bvDfUHIi1.mjs +0 -24
- package/node/esm/CF1R5ovFsRNu--Rw.mjs +0 -3744
- package/node/esm/Ctcl4jN52INWpKWC.mjs +0 -2255
- package/node/esm/CvnRSooxEQdlJgMn.mjs +0 -2766
- package/node/esm/DQd0vxzTaPt2qSL-.mjs +0 -108
- package/node/esm/ssSlRCbCqxvZ9IX8.mjs +0 -2481
- package/types/src/legacyChart/OOXMLMappings.d.ts +0 -8
- package/types/src/legacyChart/OOXMLUtils.d.ts +0 -78
- package/types/src/legacyChart/ToOOXMLConverter.d.ts +0 -30
- package/types/src/reader/domVisitors/AxisVisitor.d.ts +0 -12
- package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts +0 -6
- package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts +0 -6
- package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts +0 -7
- package/types/src/reader/domVisitors/ChartVisitor.d.ts +0 -7
- package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts +0 -8
- package/types/src/reader/domVisitors/DataPointVisitor.d.ts +0 -6
- package/types/src/reader/domVisitors/HyperlinkVisitor.d.ts +0 -6
- package/types/src/reader/domVisitors/LayoutVisitor.d.ts +0 -5
- package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts +0 -5
- package/types/src/reader/domVisitors/LegendVisitor.d.ts +0 -5
- package/types/src/reader/domVisitors/MarkerVisitor.d.ts +0 -5
- package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts +0 -6
- package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts +0 -5
- package/types/src/reader/domVisitors/SeriesVisitor.d.ts +0 -8
- package/types/src/reader/domVisitors/TitleVisitor.d.ts +0 -9
- package/types/src/writer/emitters/ChartColorsEmitter.d.ts +0 -7
- package/types/src/writer/emitters/ChartEmitter.d.ts +0 -14
- package/types/src/writer/emitters/ChartStyleEmitter.d.ts +0 -46
|
@@ -129,8 +129,12 @@ export interface EmitContext {
|
|
|
129
129
|
* "worksheets/sheet2.xml", etc.
|
|
130
130
|
* This can also be used for folder names such as
|
|
131
131
|
* "charts/chart{n}/chart1.xml".
|
|
132
|
+
*
|
|
133
|
+
* @param idHint A preferred relationship id, for a caller whose content already cites one. Honored
|
|
134
|
+
* only if free in this part's set, so read the returned {@link PackagePart.relId} rather than
|
|
135
|
+
* assuming it.
|
|
132
136
|
*/
|
|
133
|
-
addPart<T = any>(kind: string, instance: T, pathTemplate?: string): PackagePart;
|
|
137
|
+
addPart<T = any>(kind: string, instance: T, pathTemplate?: string, idHint?: string): PackagePart;
|
|
134
138
|
/**
|
|
135
139
|
* Adds a binary part at a path.
|
|
136
140
|
*
|
|
@@ -138,48 +142,45 @@ export interface EmitContext {
|
|
|
138
142
|
* @param contentType The content type for the extension.
|
|
139
143
|
* @param relTypeUri The relationship type URI.
|
|
140
144
|
* @param pathTemplate This is a relative path from the package root
|
|
145
|
+
* @param override Whether an existing part at the resolved path is the same part, rather than a
|
|
146
|
+
* collision to number around.
|
|
147
|
+
* @param idHint A preferred relationship id, for a caller whose content already cites one (a
|
|
148
|
+
* replayed fragment). Honored only if free in this part's set, so the caller has to check the
|
|
149
|
+
* returned {@link PackagePart.relId} rather than assume it.
|
|
141
150
|
*/
|
|
142
|
-
addBinary(bytes: Uint8Array, contentType: string, relTypeUri: string, pathTemplate: string, override?: boolean): PackagePart;
|
|
151
|
+
addBinary(bytes: Uint8Array, contentType: string, relTypeUri: string, pathTemplate: string, override?: boolean, idHint?: string): PackagePart;
|
|
143
152
|
/**
|
|
144
153
|
* Adds an external relationship to the current part.
|
|
145
154
|
*
|
|
146
155
|
* @param relTypeUri The relationship type URI.
|
|
147
156
|
* @param targetUrl The target URL.
|
|
157
|
+
* @param idHint A preferred relationship id, for a caller whose content already cites one (a
|
|
158
|
+
* replayed part's `<worksheetSource r:id>`). Honored only if free in this part's set, so read the
|
|
159
|
+
* returned {@link PackagePart.relId} rather than assuming it.
|
|
148
160
|
*
|
|
149
161
|
* @returns The rId of the added relationship.
|
|
150
162
|
*/
|
|
151
|
-
addExternal(relTypeUri: string, targetUrl: string): PackagePart;
|
|
163
|
+
addExternal(relTypeUri: string, targetUrl: string, idHint?: string): PackagePart;
|
|
152
164
|
/**
|
|
153
|
-
* Adds a relationship from the current part to
|
|
154
|
-
*
|
|
155
|
-
*
|
|
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).
|
|
156
170
|
*
|
|
157
171
|
* @param relTypeUri The relationship type URI.
|
|
158
172
|
* @param targetPartPath The target's absolute path (relative to the package root, no leading `/`).
|
|
159
|
-
* @param idHint A preferred id (e.g. the source's own original rId)
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
* more than one reference — unlike `addPreservedRelationship`, which links to the one shared
|
|
171
|
-
* target — e.g. a chart part, which a same-source movable copy would otherwise leave two anchors
|
|
172
|
-
* both pointing at (see `DESIGN-PACKAGE-PASSTHROUGH.md` §11.2). The copy's own relationships (if
|
|
173
|
-
* it has a `.rels` part in the source) are carried forward verbatim to the new path, so nested
|
|
174
|
-
* references inside the copied bytes (e.g. a chart's colors/style/embedded data) keep resolving.
|
|
175
|
-
*
|
|
176
|
-
* @param sourcePartPath The absolute path of the source part to copy (no leading `/`).
|
|
177
|
-
* @param contentType The content type for the copy.
|
|
178
|
-
* @param relTypeUri The relationship type URI.
|
|
179
|
-
* @param pathTemplate The path template for the copy — same `{n}` rules as `addBinary`.
|
|
180
|
-
* @returns The new part, or `null` if there is no source package or the source part is missing.
|
|
181
|
-
*/
|
|
182
|
-
forkPreservedPart(sourcePartPath: string, contentType: string, relTypeUri: string, pathTemplate: string): PackagePart | null;
|
|
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.
|
|
182
|
+
*/
|
|
183
|
+
addRelationship(relTypeUri: string, targetPartPath: string, idHint?: string): string | null;
|
|
183
184
|
/**
|
|
184
185
|
* Waits for all dependants to be emitted.
|
|
185
186
|
*/
|
|
@@ -194,31 +195,84 @@ export interface EmitContext {
|
|
|
194
195
|
getSharedStates(): Map<string, any>;
|
|
195
196
|
/**
|
|
196
197
|
* Warns that something is not quite right.
|
|
198
|
+
*
|
|
199
|
+
* @param message What was found.
|
|
200
|
+
* @param context Locates the finding. Defaults to the path of the part being emitted.
|
|
201
|
+
* @param onceKey Reports only the first warning carrying this key, for one write. A finding whose
|
|
202
|
+
* message names the specific thing it found (a formula, a length) is one per instance without a
|
|
203
|
+
* key and one per file with one. Keys are stable dotted identifiers (`xlsx.dv.listUnion`), never
|
|
204
|
+
* derived from the message text.
|
|
197
205
|
*/
|
|
198
|
-
warn(message: string, context?: any): void;
|
|
206
|
+
warn(message: string, context?: any, onceKey?: string): void;
|
|
207
|
+
/**
|
|
208
|
+
* Reports a fault in the writer itself — an inconsistency the user did not cause and cannot act on
|
|
209
|
+
* (a relationship id that could not be kept, an entry the model should never hold).
|
|
210
|
+
*
|
|
211
|
+
* @remarks
|
|
212
|
+
* Goes to the console, not to {@link warn}: a warning tells the user that something in their
|
|
213
|
+
* workbook was not written, and this is not that.
|
|
214
|
+
*
|
|
215
|
+
* @param message What was found.
|
|
216
|
+
* @param context Locates the finding. Defaults to the path of the part being emitted.
|
|
217
|
+
*/
|
|
218
|
+
log(message: string, context?: any): void;
|
|
199
219
|
}
|
|
220
|
+
/**
|
|
221
|
+
* Shared-states key: the workbook's resources by the id the writer's JSON references them by.
|
|
222
|
+
*
|
|
223
|
+
* @remarks
|
|
224
|
+
* The JSON the emitters write from is built with a resource writer rather than embedding, and that
|
|
225
|
+
* writer fills this map as it is handed each resource. It is complete before any sheet part emits,
|
|
226
|
+
* so an emitter holding a `resId` from that JSON looks it up here to get back to the model's
|
|
227
|
+
* resource. Declared here rather than on the emitter that fills it because the emitters that read
|
|
228
|
+
* it sit below that one in the import graph.
|
|
229
|
+
*
|
|
230
|
+
* @see {@link EmitContext.getSharedStates}
|
|
231
|
+
*/
|
|
232
|
+
export declare const SHARED_STATE_RESOURCES_BY_ID = "resourcesById";
|
|
200
233
|
/**
|
|
201
234
|
* A part emitter knows how to write a specific part type to XML (or binary).
|
|
202
235
|
*/
|
|
203
236
|
export interface IEmitter<T = any> {
|
|
204
237
|
/**
|
|
205
|
-
* The type/kind of this part emitter
|
|
238
|
+
* The type/kind of this part emitter.
|
|
206
239
|
*/
|
|
207
|
-
|
|
240
|
+
getKind(): string;
|
|
208
241
|
/**
|
|
209
|
-
*
|
|
242
|
+
* The content type to declare in `[Content_Types].xml` for this part.
|
|
243
|
+
*
|
|
244
|
+
* @remarks
|
|
245
|
+
* Takes the instance because an emitter's kind is not always one type of document part: one that
|
|
246
|
+
* replays a subtree carried on the model writes whatever each part in it says it is. Most emitters
|
|
247
|
+
* answer with the single type they were constructed with and ignore the argument.
|
|
248
|
+
*
|
|
249
|
+
* With no instance, the answer is what this emitter always writes, or `''` for one that only ever
|
|
250
|
+
* knows per instance.
|
|
210
251
|
*/
|
|
211
|
-
|
|
252
|
+
getContentType(instance?: T): string;
|
|
212
253
|
/**
|
|
213
|
-
*
|
|
254
|
+
* The relationship type to write into the referencing part's `.rels`.
|
|
255
|
+
*
|
|
214
256
|
* @remarks
|
|
215
|
-
*
|
|
257
|
+
* Takes the instance for the same reason as {@link IEmitter.getContentType}, and answers the same
|
|
258
|
+
* way with none. An empty result means no relationship is created, and the part will not be listed
|
|
259
|
+
* in any `.rels`.
|
|
216
260
|
*/
|
|
217
|
-
|
|
261
|
+
getRelTypeUri(instance?: T): string;
|
|
218
262
|
/**
|
|
219
263
|
* The function that emits this part
|
|
220
264
|
*/
|
|
221
265
|
emit: (instance: T, ctx: EmitContext) => Promise<void> | void;
|
|
266
|
+
/**
|
|
267
|
+
* Whether this emitter creates every relationship its part cites, so that nothing of the source
|
|
268
|
+
* part's relationship set — neither its ids nor its edges — is kept for it.
|
|
269
|
+
*
|
|
270
|
+
* @remarks
|
|
271
|
+
* The default keeps the source's ids reserved and merges its leftover edges back in, for a part
|
|
272
|
+
* that still replays fragments of the source citing them. One that regenerates the whole part
|
|
273
|
+
* from the model answers `true`; otherwise every save would add the source's edges beside its own.
|
|
274
|
+
*/
|
|
275
|
+
regeneratesRelationships?: () => boolean;
|
|
222
276
|
/**
|
|
223
277
|
* Returns the default path for this part instance.
|
|
224
278
|
*
|
|
@@ -248,6 +302,25 @@ export interface PackageBuilderOptions {
|
|
|
248
302
|
* instead of being dropped. See `DESIGN-PACKAGE-PASSTHROUGH.md`.
|
|
249
303
|
*/
|
|
250
304
|
sourcePackage?: ISourcePackage | null;
|
|
305
|
+
/**
|
|
306
|
+
* Whether the package being built is macro-enabled (`.xlsm`) rather than plain (`.xlsx`).
|
|
307
|
+
*
|
|
308
|
+
* @defaultValue false
|
|
309
|
+
*
|
|
310
|
+
* @remarks
|
|
311
|
+
* Set from the resolved write format, and it governs the **declaration and the payload
|
|
312
|
+
* together** so the two can never disagree: the `xl/workbook.xml` content-type variant, and
|
|
313
|
+
* whether a retained `xl/vbaProject.bin` is carried through. Writing to `.xlsx` therefore drops
|
|
314
|
+
* a source's VBA project, matching Excel's own *Save As*.
|
|
315
|
+
*/
|
|
316
|
+
macroEnabled?: boolean;
|
|
317
|
+
/**
|
|
318
|
+
* Whether the package being built is a template (`.xltx`/`.xltm`). Only the `xl/workbook.xml`
|
|
319
|
+
* content-type variant follows from it.
|
|
320
|
+
*
|
|
321
|
+
* @defaultValue false
|
|
322
|
+
*/
|
|
323
|
+
template?: boolean;
|
|
251
324
|
/**
|
|
252
325
|
* Callback invoked when a part is emitted.
|
|
253
326
|
*
|
|
@@ -266,6 +339,14 @@ export interface PackageBuilderOptions {
|
|
|
266
339
|
* @param error The error that occurred.
|
|
267
340
|
*/
|
|
268
341
|
onPartError?: (kind: string, path: string, error: any) => void | Promise<void>;
|
|
342
|
+
/**
|
|
343
|
+
* Receives every {@link BuildContext.warn} an emitter raises, in emit order and undeduplicated.
|
|
344
|
+
*
|
|
345
|
+
* @remarks
|
|
346
|
+
* Without one, warnings go to the console. The writer that owns the build collects them here and
|
|
347
|
+
* decides how to report them (see `writeXLSX`).
|
|
348
|
+
*/
|
|
349
|
+
onWarning?: (message: string, context: any, onceKey?: string) => void;
|
|
269
350
|
}
|
|
270
351
|
/** A part's still-compressed bytes — structurally matches `../SourcePackage.SourcePackageRawPart`. */
|
|
271
352
|
export interface ISourcePackageRawPart {
|
|
@@ -290,6 +371,11 @@ export interface ISourcePackage {
|
|
|
290
371
|
getNames(): string[];
|
|
291
372
|
has(name: string): boolean;
|
|
292
373
|
getPart(name: string): ISourcePackagePart | null;
|
|
374
|
+
/**
|
|
375
|
+
* See `../SourcePackage.SourcePackage.isAbsorbed` — whether the reader took this part onto the
|
|
376
|
+
* model, so an emitter writes it and the source's copy is surplus.
|
|
377
|
+
*/
|
|
378
|
+
isAbsorbed(name: string): boolean;
|
|
293
379
|
/** See `../SourcePackage.SourcePackage.hasStructuralChange` — gates §4's drop-if-changed bucket. */
|
|
294
380
|
hasStructuralChange(): boolean;
|
|
295
381
|
}
|
|
@@ -42,6 +42,16 @@ export interface IPartWriter<Out = any> {
|
|
|
42
42
|
* @param contentType - OPC content type for the extension.
|
|
43
43
|
*/
|
|
44
44
|
addDefaultType(extension: string, contentType: string): void;
|
|
45
|
+
/**
|
|
46
|
+
* Replace the content type already declared for `path`, keeping its position in the manifest.
|
|
47
|
+
*
|
|
48
|
+
* @remarks
|
|
49
|
+
* {@link addContentType} is first-wins, which is what the emitters racing to declare a part
|
|
50
|
+
* want. This is the exception, for a part whose *variant* is only decidable once the whole
|
|
51
|
+
* package is known — see `PackageBuilder._carryWorkbookContentTypeVariant`. A no-op when `path`
|
|
52
|
+
* has no content type yet: it replaces a declaration, never invents one.
|
|
53
|
+
*/
|
|
54
|
+
replaceContentType(path: string, contentType: string): void;
|
|
45
55
|
/**
|
|
46
56
|
* Get the relationship set for `sourcePart`.
|
|
47
57
|
*
|
|
@@ -94,6 +104,13 @@ export interface IRelationshipSet {
|
|
|
94
104
|
external?: boolean;
|
|
95
105
|
idHint?: string;
|
|
96
106
|
}): string;
|
|
107
|
+
/**
|
|
108
|
+
* Hold `ids` back from auto-assignment, so that an edge added later with one of them as its
|
|
109
|
+
* `idHint` gets it. For a part rewritten over a source part: the source's own ids are reserved
|
|
110
|
+
* before its emitter allocates anything, its edges go above them, and a source edge merged back in
|
|
111
|
+
* afterwards keeps the name any verbatim fragment inside the part still cites.
|
|
112
|
+
*/
|
|
113
|
+
reserve(ids: Iterable<string>): void;
|
|
97
114
|
/**
|
|
98
115
|
* List all relationships in this set.
|
|
99
116
|
*/
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { IComment, IWorksheet, IFontStyle, ITheme } from '@sheetxl/sdk';
|
|
2
|
+
import { Emitter, EmitContext, IXmlWriter } from '../builder';
|
|
3
|
+
export declare const REL_TYPE_COMMENTS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";
|
|
4
|
+
export declare const REL_TYPE_THREADED_COMMENTS = "http://schemas.microsoft.com/office/2017/10/relationships/threadedComment";
|
|
5
|
+
/**
|
|
6
|
+
* A comment as the emitters take it: the model and the cell it is on, resolved once by the
|
|
7
|
+
* worksheet emitter for both parts.
|
|
8
|
+
*/
|
|
9
|
+
export interface CommentHandle {
|
|
10
|
+
comment: IComment;
|
|
11
|
+
/** The cell address, `B307`. */
|
|
12
|
+
ref: string;
|
|
13
|
+
/** The 0-based cell. */
|
|
14
|
+
row: number;
|
|
15
|
+
col: number;
|
|
16
|
+
}
|
|
17
|
+
/** What the worksheet emitter schedules: the sheet's comments, roots only, in reading order. */
|
|
18
|
+
export interface CommentsPartHandle {
|
|
19
|
+
sheet: IWorksheet;
|
|
20
|
+
comments: CommentHandle[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Writes `xl/comments{n}.xml`: every comment on the sheet as a legacy `<comment>`.
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* A note writes its own text, runs and all. A threaded comment writes the shadow Excel writes
|
|
27
|
+
* beside every thread — an author of `tc={id}` and the boilerplate an older Excel shows —
|
|
28
|
+
* which a current Excel pairs with the thread by `ref`. Authors are the part's `<authors>`
|
|
29
|
+
* list, one entry per distinct display name (and per thread for the shadows).
|
|
30
|
+
*/
|
|
31
|
+
export declare class CommentsEmitter extends Emitter<CommentsPartHandle> {
|
|
32
|
+
constructor();
|
|
33
|
+
/** @inheritdoc IEmitter.emit */
|
|
34
|
+
emit(handle: CommentsPartHandle, ctx: EmitContext): Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The text a pre-2018 Excel shows for a thread it cannot read, as Excel itself writes it: the
|
|
38
|
+
* root, then each reply.
|
|
39
|
+
*/
|
|
40
|
+
export declare function shadowText(comment: IComment): string;
|
|
41
|
+
/**
|
|
42
|
+
* `<r><rPr/><t>` per run, or a single `<t>` for plain text.
|
|
43
|
+
*/
|
|
44
|
+
export declare function writeRichText(xml: IXmlWriter, content: IComment.Content, theme: ITheme): void;
|
|
45
|
+
/**
|
|
46
|
+
* A run's `<rPr>`, in the order Excel writes it. Only what the run sets is written, and a property
|
|
47
|
+
* set off (`weight: 400`) is written off, since it overrides whatever the run would inherit.
|
|
48
|
+
*/
|
|
49
|
+
export declare function writeRunProperties(xml: IXmlWriter, font: IFontStyle.JSON, theme: ITheme): void;
|
|
50
|
+
/**
|
|
51
|
+
* The cell address of a comment, or `null` when its cell is gone.
|
|
52
|
+
*/
|
|
53
|
+
export declare function commentRef(comment: IComment): {
|
|
54
|
+
ref: string;
|
|
55
|
+
row: number;
|
|
56
|
+
col: number;
|
|
57
|
+
} | null;
|
|
58
|
+
//# sourceMappingURL=CommentsEmitter.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IResourceCollection, IMovable,
|
|
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:
|
|
9
|
+
sheet: IWorksheet;
|
|
10
10
|
movables?: IMovable[];
|
|
11
11
|
jsonMovables?: IMovable.JSON[];
|
|
12
12
|
resources: IResourceCollection;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { IEmbeddedPart } from '@sheetxl/sdk';
|
|
2
|
+
import { Emitter, EmitContext, PackagePart } from '../builder';
|
|
3
|
+
/**
|
|
4
|
+
* Writes a part carried in the writer's JSON back into the package, and every part it references.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* The counterpart of `readEmbeddedPart` in the reader, and the same argument in reverse: a chart
|
|
8
|
+
* names its style, its colors, the shapes drawn over it and sometimes an embedded workbook by
|
|
9
|
+
* relationship id, so all of them come back or the file does not open. Each part says what it is
|
|
10
|
+
* (`type`, `contentType`), which is why one emitter can write all of them — see
|
|
11
|
+
* {@link IEmitter.getContentType}.
|
|
12
|
+
*
|
|
13
|
+
* Names are the source's, renumbered where they collide, and every part is written beside the one
|
|
14
|
+
* that references it. Neither is required by OPC — a part is found through its relationship, never
|
|
15
|
+
* by its name — but keeping `style1.xml` called that makes the output readable, and keeping a
|
|
16
|
+
* chart's shapes under `xl/charts/` is what retires the hazard of a sheet's `drawing{n}` landing on
|
|
17
|
+
* the drawing a chart's `<c:userShapes>` cites.
|
|
18
|
+
*/
|
|
19
|
+
export declare class EmbeddedPartEmitter extends Emitter<IEmbeddedPart.JSON> {
|
|
20
|
+
constructor();
|
|
21
|
+
/** @inheritdoc IEmitter.getContentType */
|
|
22
|
+
getContentType(part?: IEmbeddedPart.JSON): string;
|
|
23
|
+
/**
|
|
24
|
+
* @inheritdoc IEmitter.getRelTypeUri
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* `''` with no part, since this emitter claims no relationship type of its own — it writes
|
|
28
|
+
* whatever the part it is handed says it is.
|
|
29
|
+
*/
|
|
30
|
+
getRelTypeUri(part?: IEmbeddedPart.JSON): string;
|
|
31
|
+
/** @inheritdoc IEmitter.getPath */
|
|
32
|
+
getPath(part: IEmbeddedPart.JSON): string;
|
|
33
|
+
/** @inheritdoc IEmitter.emit */
|
|
34
|
+
emit(part: IEmbeddedPart.JSON, ctx: EmitContext): Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Adds a part's children to the package, each under the relationship id the part's own markup
|
|
38
|
+
* cites it by.
|
|
39
|
+
*
|
|
40
|
+
* @remarks
|
|
41
|
+
* Exported because the part at the top of a subtree is added by whoever holds it (a chart, by its
|
|
42
|
+
* anchor) rather than by this emitter, and its children still have to be written the same way.
|
|
43
|
+
*/
|
|
44
|
+
export declare const writeChildren: (part: IEmbeddedPart.JSON, ctx: EmitContext) => Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Adds one carried part to the package, returning the relationship id it actually got.
|
|
47
|
+
*
|
|
48
|
+
* @remarks
|
|
49
|
+
* A part whose id could not be honored is reported by the caller rewriting the reference, not here:
|
|
50
|
+
* the markup that cites it is the caller's, and only the caller can rewrite it.
|
|
51
|
+
*
|
|
52
|
+
* `pathTemplate` is for the part at the top of a subtree, whose caller knows where its kind belongs
|
|
53
|
+
* (a chart under `xl/charts/`); everything below it is written beside its own parent, so naming the
|
|
54
|
+
* top names the lot.
|
|
55
|
+
*
|
|
56
|
+
* A part that is content rather than markup names its bytes by `resId`, resolved against
|
|
57
|
+
* {@link SHARED_STATE_RESOURCES_BY_ID} — complete before any part that could cite one emits.
|
|
58
|
+
*/
|
|
59
|
+
export declare const writeEmbeddedPart: (part: IEmbeddedPart.JSON, ctx: EmitContext, pathTemplate?: string) => Promise<PackagePart | null>;
|
|
60
|
+
//# sourceMappingURL=EmbeddedPartEmitter.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IExternalBook } from '@sheetxl/sdk';
|
|
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
|
+
export declare class ExternalLinkEmitter extends Emitter<IExternalBook.JSON> {
|
|
15
|
+
constructor();
|
|
16
|
+
/** @inheritdoc IEmitter.emit */
|
|
17
|
+
emit(json: IExternalBook.JSON, ctx: EmitContext): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=ExternalLinkEmitter.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IWorksheet } from '@sheetxl/sdk';
|
|
2
|
+
import { Emitter, EmitContext } from '../builder';
|
|
3
|
+
/**
|
|
4
|
+
* Writes a sheet's legacy drawing ({@link IWorksheet.JSON.legacyDrawing}) back out as the VML part it
|
|
5
|
+
* was read from.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* The markup is replayed as it was read — the shapes in it (a note's box, a form control's shape,
|
|
9
|
+
* a header/footer picture) have no models of their own yet, so there is nothing to write it from.
|
|
10
|
+
* Its images do have models, and are written from those: the part carries the relationship ids the
|
|
11
|
+
* markup cites, so an image lands back under the id its `<v:imagedata>` names.
|
|
12
|
+
*/
|
|
13
|
+
export declare class LegacyDrawingEmitter extends Emitter<IWorksheet.LegacyDrawingJSON> {
|
|
14
|
+
constructor();
|
|
15
|
+
/** @inheritdoc IEmitter.emit */
|
|
16
|
+
emit(legacyDrawing: IWorksheet.LegacyDrawingJSON, ctx: EmitContext): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=LegacyDrawingEmitter.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IPersonCollection } from '@sheetxl/sdk';
|
|
2
|
+
import { Emitter, EmitContext } from '../builder';
|
|
3
|
+
export declare const REL_TYPE_PERSON = "http://schemas.microsoft.com/office/2017/10/relationships/person";
|
|
4
|
+
/**
|
|
5
|
+
* Writes `xl/persons/person.xml`: the workbook's people, one `<person>` each.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Written only when a sheet has a threaded comment — a legacy-note-only file has no persons
|
|
9
|
+
* part, and Excel writes none. A person with no provider is written as Excel writes one typed
|
|
10
|
+
* with no account behind it, `providerId="None"`.
|
|
11
|
+
*/
|
|
12
|
+
export declare class PersonsEmitter extends Emitter<IPersonCollection> {
|
|
13
|
+
constructor();
|
|
14
|
+
/** @inheritdoc IEmitter.emit */
|
|
15
|
+
emit(people: IPersonCollection, ctx: EmitContext): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=PersonsEmitter.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { IPivotTable } from '@sheetxl/sdk';
|
|
2
|
+
import { Emitter, EmitContext } from '../builder';
|
|
3
|
+
/** The relationship a pivot table has to the cache it summarizes. */
|
|
4
|
+
export declare const REL_TYPE_PIVOT_CACHE_DEFINITION = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition";
|
|
5
|
+
/**
|
|
6
|
+
* Shared-states key under which `WorkbookEmitter` leaves the part path of each pivot cache it
|
|
7
|
+
* wrote, by `cacheId`, for the pivot tables on every sheet to relate themselves to. See
|
|
8
|
+
* {@link writePivotCaches}.
|
|
9
|
+
*/
|
|
10
|
+
export declare const SHARED_STATE_PIVOT_CACHE_PATHS = "pivotCachePaths";
|
|
11
|
+
/**
|
|
12
|
+
* Writes a sheet's {@link IPivotTable | pivot table} back out as the part it was read from.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* The markup is replayed as it was read — the table has no model yet, so there is nothing to
|
|
16
|
+
* write it from. Its one relationship is not replayed but made: the cache it summarizes is the
|
|
17
|
+
* workbook's, written once by `WorkbookEmitter` and shared by every table that names its
|
|
18
|
+
* `cacheId`, so each table relates itself to wherever that part landed this time.
|
|
19
|
+
*
|
|
20
|
+
* Nothing in the sheet's own markup cites a pivot table — the sheet's relationship to it is the
|
|
21
|
+
* whole citation — which is why this is scheduled from `WorksheetEmitter` with no element written.
|
|
22
|
+
*/
|
|
23
|
+
export declare class PivotTableEmitter extends Emitter<IPivotTable.JSON> {
|
|
24
|
+
constructor();
|
|
25
|
+
/** @inheritdoc IEmitter.getContentType */
|
|
26
|
+
getContentType(pivotTable?: IPivotTable.JSON): string;
|
|
27
|
+
/** @inheritdoc IEmitter.emit */
|
|
28
|
+
emit(pivotTable: IPivotTable.JSON, ctx: EmitContext): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
/** Where the workbook wrote the cache with this id, or `null` if it wrote none. */
|
|
31
|
+
export declare const cachePathFor: (ctx: EmitContext, cacheId: number) => string | null;
|
|
32
|
+
/**
|
|
33
|
+
* Adds the workbook's pivot caches to the package, each with the records part its definition
|
|
34
|
+
* references, and leaves where each landed in the shared states for the tables to find.
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* Called by `WorkbookEmitter` **before** it schedules the sheets, since a table's relationship to
|
|
38
|
+
* its cache needs the cache's path to exist by the time the sheet's part emits; the `<pivotCaches>`
|
|
39
|
+
* element itself is written later, where `CT_Workbook` puts it, from the ids returned here.
|
|
40
|
+
*/
|
|
41
|
+
export declare const writePivotCaches: (ctx: EmitContext, pivotCaches: readonly IPivotTable.CacheJSON[] | undefined) => Promise<{
|
|
42
|
+
cacheId: number;
|
|
43
|
+
relId: string;
|
|
44
|
+
}[]>;
|
|
45
|
+
//# sourceMappingURL=PivotTableEmitter.d.ts.map
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import { IWorkbook } from '@sheetxl/sdk';
|
|
1
2
|
import { Emitter, EmitContext } from '../builder';
|
|
2
|
-
export declare class PropsCoreEmitter extends Emitter<
|
|
3
|
+
export declare class PropsCoreEmitter extends Emitter<ModelHandle> {
|
|
3
4
|
constructor();
|
|
4
5
|
/** @inheritdoc IEmitter.emit */
|
|
5
|
-
emit(
|
|
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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
10
|
-
|
|
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,66 @@
|
|
|
1
|
+
import { 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
|
+
/** A sheet's slicer part: every table slicer placed on the sheet, in its movable order. */
|
|
8
|
+
export interface SlicersPartHandle {
|
|
9
|
+
sheet: IWorksheet;
|
|
10
|
+
slicers: ISlicer[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The table slicers placed on a sheet, in movable order: those whose source names a live table.
|
|
14
|
+
* A slicer that names none has no column to filter and no cache to write, so it is not written.
|
|
15
|
+
*/
|
|
16
|
+
export declare const collectSheetSlicers: (sheet: IWorksheet) => ISlicer[];
|
|
17
|
+
/**
|
|
18
|
+
* Writes a sheet's slicer part, `xl/slicers/slicerN.xml`: one `slicer` per table slicer placed on
|
|
19
|
+
* the sheet, as Excel writes them, each naming the cache the workbook writes for it.
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
* Scheduled from `WorksheetEmitter`, which cites the part from the sheet's `x14:slicerList` ext.
|
|
23
|
+
* Only what differs from a default is written beside the name, cache and caption; the row height
|
|
24
|
+
* always, in EMU, as Excel does.
|
|
25
|
+
*/
|
|
26
|
+
export declare class SlicersEmitter extends Emitter<SlicersPartHandle> {
|
|
27
|
+
constructor();
|
|
28
|
+
/** @inheritdoc IEmitter.emit */
|
|
29
|
+
emit(handle: SlicersPartHandle, ctx: EmitContext): Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Writes one slicer's cache part, `xl/slicerCaches/slicerCacheN.xml`: its name, the column's name
|
|
33
|
+
* as `sourceName`, and the `x15:tableSlicerCache` ext naming the table by the id `TableEmitter`
|
|
34
|
+
* wrote it with and the column by its 1-based index.
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* Scheduled from `WorkbookEmitter` once every sheet has been written and so every table has its
|
|
38
|
+
* id. The sort order, custom-list sort and cross filter are written only when not Excel's defaults.
|
|
39
|
+
*/
|
|
40
|
+
export declare class SlicerCacheEmitter extends Emitter<ISlicer> {
|
|
41
|
+
constructor();
|
|
42
|
+
/** @inheritdoc IEmitter.emit */
|
|
43
|
+
emit(slicer: ISlicer, ctx: EmitContext): Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Schedules a cache part for every table slicer of the workbook, in sheet order and then movable
|
|
47
|
+
* order, and returns the relationship ids the workbook cites them by.
|
|
48
|
+
*
|
|
49
|
+
* @remarks
|
|
50
|
+
* Called by `WorkbookEmitter` **after** the sheets have been written, since a cache names its table
|
|
51
|
+
* by the id the sheet minted when it scheduled the table part. A slicer whose table was not
|
|
52
|
+
* scheduled is left out, with its slicer element still in the sheet's part; Excel repairs that
|
|
53
|
+
* rather than refuse the file.
|
|
54
|
+
*/
|
|
55
|
+
export declare const writeSlicerCaches: (ctx: EmitContext, workbook: IWorkbook) => string[];
|
|
56
|
+
/**
|
|
57
|
+
* The sheet's `x15` slicer-list ext: schedules the sheet's slicer part and cites it. Written inside
|
|
58
|
+
* the worksheet's `extLst`, after the conditional formats and data validations, where Excel puts it.
|
|
59
|
+
*/
|
|
60
|
+
export declare const writeSlicerListExt: (ctx: EmitContext, xml: IXmlWriter, handle: SlicersPartHandle) => void;
|
|
61
|
+
/**
|
|
62
|
+
* The workbook's `x15:slicerCaches` ext: one `x14:slicerCache` per cache part written. Written
|
|
63
|
+
* inside the workbook's `extLst`, before the calc features, where Excel puts it.
|
|
64
|
+
*/
|
|
65
|
+
export declare const writeSlicerCachesExt: (xml: IXmlWriter, relIds: readonly string[]) => void;
|
|
66
|
+
//# sourceMappingURL=SlicerEmitter.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ICellStyle, ITheme, IStyleCollection } from '@sheetxl/sdk';
|
|
2
2
|
import { Emitter, IXmlWriter, EmitContext } from '../builder';
|
|
3
3
|
/**
|
|
4
4
|
* Emits the styles.xml part.
|
|
@@ -18,7 +18,7 @@ export declare class StylesEmitter extends Emitter<ModelHandle> {
|
|
|
18
18
|
*
|
|
19
19
|
* @returns `numFmtId`, advanced if this dxf consumed one.
|
|
20
20
|
*/
|
|
21
|
-
export declare function writeDxf(ctx: EmitContext, xml: IXmlWriter, dxf:
|
|
21
|
+
export declare function writeDxf(ctx: EmitContext, xml: IXmlWriter, dxf: ICellStyle.Properties, styles: IStyleCollection, theme: ITheme, tag?: string, numFmtId?: number): number;
|
|
22
22
|
type ModelHandle = {
|
|
23
23
|
json: IStyleCollection.JSON;
|
|
24
24
|
styles: IStyleCollection;
|