@sheetxl/io-xlsx 0.8.0-beta.10 → 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/{NQIuOQIleHC4NUW6.mjs → BiDqExNXiY7ykk8E.mjs} +527 -646
- package/browser/esm/{2EOdn2WRK5y1L58S.mjs → Bs0EzhdU8WgGfPzf.mjs} +2 -2
- package/browser/esm/CLWsOc6DO8l1G_LF.mjs +2213 -0
- package/browser/esm/{xc_LzCPgHn-acgFZ.mjs → CZ9I80og75SDRjv0.mjs} +2 -2
- package/browser/esm/{DXopGe8PrLWmwGaV.mjs → CuAXx5i4uqTz-mMY.mjs} +1 -1
- package/browser/esm/{BLXcoiDAaOMjFuhw.mjs → Cv3R6fGatARKedSn.mjs} +2531 -1952
- package/browser/esm/{B-jb5SuiVh5NnBG_.mjs → CzFYJPxmLyKgEKF0.mjs} +2 -2
- package/browser/esm/{BKT8OBj-bhQwdg49.mjs → DICL6ecj9BdJv8aX.mjs} +47 -10
- package/browser/esm/DatIA9fZbEPjW4bh.mjs +5638 -0
- package/browser/esm/index.mjs +2 -2
- package/browser/esm/{CI_CZI5m5-KkiAK5.mjs → yveeVJ6hKDI5KDEz.mjs} +1599 -990
- package/node/esm/B9Zn6H1RV07Ob377.mjs +2294 -0
- package/node/esm/Bpqm_PpGLpdjL47-.mjs +2368 -0
- package/node/esm/{BmdmvgO5Zdgx-RWo.mjs → CAJxmJdobUbzpUz5.mjs} +2 -2
- package/node/esm/{CHqRP_NjPpPd7m9L.mjs → CxlSbH7mmnEEsqmX.mjs} +1 -1
- package/node/esm/DD-yXSBzvDYy0TX5.mjs +5842 -0
- package/node/esm/{nNQ7MG89sGKwkjMA.mjs → DScqM1V4wPntNP6-.mjs} +1672 -1086
- package/node/esm/{O5mti2R9drFOlXc7.mjs → fopiRR7OiVoEiF7B.mjs} +2 -2
- package/node/esm/index.mjs +64 -27
- package/node/esm/{CtAF486aZqYzMeLM.mjs → ipiyzn5Pfohw2afB.mjs} +1777 -1157
- package/package.json +3 -3
- package/types/src/AutoFilterRules.d.ts +8 -1
- package/types/src/DefinedNameAttributes.d.ts +8 -0
- package/types/src/ExcelCompat.d.ts +15 -3
- package/types/src/KnownFonts.d.ts +50 -0
- package/types/src/LegacyFormula.d.ts +13 -0
- package/types/src/PageLayoutAttributes.d.ts +8 -0
- package/types/src/Plugin.d.ts +12 -0
- package/types/src/ProtectionAttributes.d.ts +2 -2
- 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/Types.d.ts +11 -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/IsoDateCell.d.ts +20 -0
- package/types/src/reader/LibreOfficeDataTable.d.ts +11 -0
- package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +13 -1
- package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +3 -3
- package/types/src/reader/domVisitors/CommentVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +3 -1
- package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +23 -8
- package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts +3 -2
- package/types/src/reader/domVisitors/ObjectDefaultsVisitor.d.ts +11 -0
- package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +2 -0
- package/types/src/reader/domVisitors/SortStateVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/_Dxfs.d.ts +10 -0
- package/types/src/reader/domVisitors/index.d.ts +2 -30
- package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +46 -6
- package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +16 -11
- package/types/src/utils/DrawingMLText.d.ts +2 -2
- package/types/src/utils/FormControls.d.ts +4 -4
- 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 +16 -23
- package/types/src/utils/VmlNoteStyle.d.ts +44 -0
- package/types/src/utils/VmlPrefixes.d.ts +24 -0
- package/types/src/writer/builder/PackageBuilder.d.ts +2 -0
- package/types/src/writer/builder/Types.d.ts +7 -0
- package/types/src/writer/emitters/CommentsEmitter.d.ts +3 -3
- package/types/src/writer/emitters/DrawingEmitter.d.ts +2 -2
- package/types/src/writer/emitters/LegacyDrawingEmitter.d.ts +4 -4
- 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 +3 -3
- package/types/src/writer/emitters/WorkbookEmitter.d.ts +5 -0
- package/types/src/writer/emitters/WorksheetEmitter.d.ts +4 -3
- package/types/src/writer/utils/AutoFilter.d.ts +1 -1
- package/types/src/writer/utils/DefaultRows.d.ts +38 -0
- package/types/src/writer/utils/DxfCollector.d.ts +11 -8
- package/types/src/writer/utils/HiddenFormulaXfs.d.ts +1 -1
- package/types/src/writer/utils/SheetStyleLayout.d.ts +73 -0
- package/types/src/writer/utils/TextUtils.d.ts +6 -1
- package/types/src/writer/utils/UnsupportedFunctions.d.ts +2 -2
- package/browser/esm/BPmehfSqdvgsLBsB.mjs +0 -5153
- package/node/esm/BpxxiZ2oKPkUSfdB.mjs +0 -2486
- package/node/esm/QS_theNoeqNGLStj.mjs +0 -5298
- 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/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
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/io-xlsx",
|
|
3
3
|
"description": "SheetXL - Import/Export from/to Excel",
|
|
4
|
-
"version": "0.8.0-beta.
|
|
4
|
+
"version": "0.8.0-beta.11",
|
|
5
5
|
"license": "SEE LICENSE IN <LICENSE>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"utilities"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@sheetxl/sdk": "^0.8.0-beta.
|
|
48
|
-
"@sheetxl/utils": "^0.8.0-beta.
|
|
47
|
+
"@sheetxl/sdk": "^0.8.0-beta.11",
|
|
48
|
+
"@sheetxl/utils": "^0.8.0-beta.11",
|
|
49
49
|
"@xmldom/xmldom": "^0.9.12",
|
|
50
50
|
"@zip.js/zip.js": "^2.23.0",
|
|
51
51
|
"web-streams-polyfill": "^4.3.0",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICondition } from '@sheetxl/sdk';
|
|
1
|
+
import { ICondition, ISort } from '@sheetxl/sdk';
|
|
2
2
|
/**
|
|
3
3
|
* The `dynamicFilter/@type` values that are a period (ST_DynamicFilterType less the two averages
|
|
4
4
|
* and `null`). The SDK's `last7Days` is not among them.
|
|
@@ -135,4 +135,11 @@ export declare function fromCondition(condition: ICondition.JSON | undefined | n
|
|
|
135
135
|
* under Display.
|
|
136
136
|
*/
|
|
137
137
|
export declare function toFilterItem(condition: ICondition.JSON | undefined | null): string | null;
|
|
138
|
+
/**
|
|
139
|
+
* The `sortCondition/@sortBy` for a sort's `sortOn`. Excel spells the fill `cellColor`; the other
|
|
140
|
+
* kinds are spelled the same. `value`, the default, is not written.
|
|
141
|
+
*/
|
|
142
|
+
export declare function toSortBy(sortOn: ISort.SortOn | undefined): string | undefined;
|
|
143
|
+
/** The `sortOn` a `sortCondition/@sortBy` means; see {@link toSortBy}. */
|
|
144
|
+
export declare function fromSortBy(sortBy: string | null | undefined): ISort.SortOn | undefined;
|
|
138
145
|
//# sourceMappingURL=AutoFilterRules.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `CT_DefinedName`'s attributes that SheetXL carries as `INamed.FileAttributes`, in schema order.
|
|
3
|
+
* `functionGroupId` is the one number among them.
|
|
4
|
+
*/
|
|
5
|
+
export declare const DEFINED_NAME_TEXT_ATTRIBUTES: readonly ["customMenu", "description", "help", "statusBar", "shortcutKey"];
|
|
6
|
+
/** The boolean ones, in schema order. Only a set flag is kept or written; each defaults to off. */
|
|
7
|
+
export declare const DEFINED_NAME_FLAG_ATTRIBUTES: readonly ["function", "vbProcedure", "xlm", "publishToServer", "workbookParameter"];
|
|
8
|
+
//# sourceMappingURL=DefinedNameAttributes.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IFunction, IRange, INamed,
|
|
1
|
+
import { IFunction, IRange, INamed, IWorksheet, ICalculation } from '@sheetxl/sdk';
|
|
2
2
|
/**
|
|
3
3
|
* The implicit-intersection translation between the modern (dynamic) formula model and what a
|
|
4
4
|
* legacy xlsx `<f>` means — item 47's `ExcelCompat.ts`, born in io-xlsx
|
|
@@ -230,6 +230,15 @@ export interface XlsxFormulaDialect {
|
|
|
230
230
|
/** A defined name's canonical text spelled for the file. */
|
|
231
231
|
writeName(text: string): string;
|
|
232
232
|
}
|
|
233
|
+
/**
|
|
234
|
+
* The external links a save writes, for {@link createXlsxFormulaDialect}.
|
|
235
|
+
*/
|
|
236
|
+
export interface XlsxExternalBooks {
|
|
237
|
+
/** How many `<externalReference>` positions the file will have. */
|
|
238
|
+
count: number;
|
|
239
|
+
/** Called for each citation of a position past {@link count}, as it is written `#REF!`. */
|
|
240
|
+
onDangling?: (n: number) => void;
|
|
241
|
+
}
|
|
233
242
|
/**
|
|
234
243
|
* Builds the dialect for a workbook.
|
|
235
244
|
*
|
|
@@ -239,14 +248,17 @@ export interface XlsxFormulaDialect {
|
|
|
239
248
|
* @param tables The workbook's table names. A bare table name (`=Sales`) parses as a name; the
|
|
240
249
|
* file spells it as the table's data body (`Sales[]`), so the writer has to know which names are
|
|
241
250
|
* tables.
|
|
251
|
+
* @param externalBooks The links a save writes. With it, {@link XlsxFormulaDialect.spell} and
|
|
252
|
+
* {@link XlsxFormulaDialect.writeName} write a citation of any other position as `#REF!`; a reader
|
|
253
|
+
* omits it.
|
|
242
254
|
*/
|
|
243
|
-
export declare function createXlsxFormulaDialect(names?: readonly INamed.JSON[] | null, tables?: readonly string[] | null): XlsxFormulaDialect;
|
|
255
|
+
export declare function createXlsxFormulaDialect(names?: readonly INamed.JSON[] | null, tables?: readonly string[] | null, externalBooks?: XlsxExternalBooks | null): XlsxFormulaDialect;
|
|
244
256
|
/**
|
|
245
257
|
* Rewrites a sheet's formulas, as the reader recorded them, into canonical text in place. Plain
|
|
246
258
|
* versus marked is a per-CELL fact on disk (`cm=` / `t="array"` are cell attributes), answered
|
|
247
259
|
* from the `formulaArray` extents the reader recorded.
|
|
248
260
|
*/
|
|
249
|
-
export declare function readSheetFormulas(sheet:
|
|
261
|
+
export declare function readSheetFormulas(sheet: IWorksheet.JSON, dialect: XlsxFormulaDialect): void;
|
|
250
262
|
/**
|
|
251
263
|
* The `@` nodes of a modern tree that the legacy read would put back on its own — the ones a
|
|
252
264
|
* PLAIN `<f>` does not need to spell.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { IFontCollection } from '@sheetxl/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* `x14ac:knownFonts` on `<fonts>` in `styles.xml`: whether a workbook's stored row heights were
|
|
4
|
+
* measured with the real fonts.
|
|
5
|
+
*
|
|
6
|
+
* Excel's rule, from `private-assets/design/rust/tools/oracle-excel-knownfonts.ps1` (2026-10-16):
|
|
7
|
+
* it writes the flag only when it knows every font in the file, and on open it keeps the stored
|
|
8
|
+
* heights of rows that are not custom only when the file has the flag, the Normal style's font is
|
|
9
|
+
* a theme font (`<scheme>`, as in every new workbook; one named outright is re-fitted whatever the
|
|
10
|
+
* flag says), and it knows every font itself; otherwise it re-fits those rows. Which font it is
|
|
11
|
+
* does not matter (Calibri, Arial and Aptos alike). Knowing a font, here, is measuring it with a
|
|
12
|
+
* table of its own: a shipped or added table, or an installed face, never a related family or a
|
|
13
|
+
* stand-in.
|
|
14
|
+
*/
|
|
15
|
+
/** The `paramMap` key under which the styles part leaves what it read about its fonts. */
|
|
16
|
+
export declare const KNOWN_FONTS_PARAM = "knownFonts";
|
|
17
|
+
/** One face a workbook's fonts name. */
|
|
18
|
+
export interface KnownFontFace {
|
|
19
|
+
family: string;
|
|
20
|
+
bold: boolean;
|
|
21
|
+
italic: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** What the styles part read: the flag, whether Normal's font is a theme font, and every face. */
|
|
24
|
+
export interface KnownFontsParam {
|
|
25
|
+
declared: boolean;
|
|
26
|
+
normalIsThemeFont: boolean;
|
|
27
|
+
faces: KnownFontFace[];
|
|
28
|
+
}
|
|
29
|
+
/** Whether `face` measures, now, from a table of its own. A face still loading is not known. */
|
|
30
|
+
export declare function isKnownFace(fonts: IFontCollection, face: KnownFontFace): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Whether `face` is a real font, one Excel would have: anything that resolves to more than a
|
|
33
|
+
* built-in generic table.
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* Looser than {@link isKnownFace} on purpose. Reading, the question is whether Excel knew the font
|
|
37
|
+
* when it measured the stored heights, not whether we can measure it: Aptos resolves to a related
|
|
38
|
+
* family's table here (`classified`), but Excel, which ships it, measured the file with the real
|
|
39
|
+
* face. A font nobody has resolves to a generic table, and Excel re-fits those rows too.
|
|
40
|
+
*/
|
|
41
|
+
export declare function isRecognizedFace(fonts: IFontCollection, face: KnownFontFace): boolean;
|
|
42
|
+
/** Whether every one of `faces` is recognized once its table has loaded. */
|
|
43
|
+
export declare function allFacesRecognized(faces: readonly KnownFontFace[]): Promise<boolean>;
|
|
44
|
+
/** The distinct faces of a list of font records, by family, weight and style. */
|
|
45
|
+
export declare function distinctFaces(fonts: readonly {
|
|
46
|
+
family?: string;
|
|
47
|
+
weight?: number;
|
|
48
|
+
style?: string;
|
|
49
|
+
}[]): KnownFontFace[];
|
|
50
|
+
//# sourceMappingURL=KnownFonts.d.ts.map
|
|
@@ -59,6 +59,19 @@ export declare const XLPM = "_xlpm.";
|
|
|
59
59
|
* the display form re-images from `NamedRef.optional`.
|
|
60
60
|
*/
|
|
61
61
|
export declare const XLOP = "_xlop.";
|
|
62
|
+
/**
|
|
63
|
+
* User-defined-function prefix (`_xludf.name`): a call to a function Excel does not resolve.
|
|
64
|
+
*
|
|
65
|
+
* Excel writes it on a name that would otherwise read as one of its own functions. Measured
|
|
66
|
+
* (`spreadsheetbench/formula-tests/probe-bare-future-function.ps1`, Excel 16.0, 2026-10-19): a
|
|
67
|
+
* function Excel stores with a prefix (`_xlfn.RRI`), stored BARE (`<f>RRI(A1,B1,C1)</f>`, as
|
|
68
|
+
* openpyxl and other non-Excel writers leave it), is read as a call to an unknown function -
|
|
69
|
+
* `=@RRI(A1,B1,C1)`, `#NAME?` - and saved untouched as `_xludf.RRI(A1,B1,C1)`; only re-entering
|
|
70
|
+
* the formula makes it the real `RRI`. The bare and the `_xludf.` spellings are the same formula to
|
|
71
|
+
* Excel, so the model holds both as `_xludf.RRI` and writes it bare: LibreOffice keeps whichever
|
|
72
|
+
* spelling it is given, and the bare one is what every other producer wrote.
|
|
73
|
+
*/
|
|
74
|
+
export declare const XLUDF = "_xludf.";
|
|
62
75
|
/**
|
|
63
76
|
* The write direction: modern (dynamic) tree → on-disk xlsx spellings, as an
|
|
64
77
|
* {@link ICalculation.FormulaTransform} — the `write` half of the xlsx dialect (`ExcelCompat`).
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IPageLayout } from '@sheetxl/sdk';
|
|
2
|
+
/** `pageSetup@cellComments` and the model's value for it. `none` is the model's default. */
|
|
3
|
+
export declare const CELL_COMMENTS: readonly [attribute: string, value: IPageLayout.PrintComments][];
|
|
4
|
+
/** `pageSetup@errors` and the model's value for it. `displayed` is the model's default. */
|
|
5
|
+
export declare const PRINT_ERRORS: readonly [attribute: string, value: IPageLayout.PrintErrorType][];
|
|
6
|
+
/** The headers and footers in `<headerFooter>`, in the schema's order. */
|
|
7
|
+
export declare const HEADER_FOOTER_ELEMENTS: readonly ["oddHeader", "oddFooter", "evenHeader", "evenFooter", "firstHeader", "firstFooter"];
|
|
8
|
+
//# sourceMappingURL=PageLayoutAttributes.d.ts.map
|
package/types/src/Plugin.d.ts
CHANGED
|
@@ -18,6 +18,18 @@ export declare const XLSX_FORMAT_KEY = "Excel";
|
|
|
18
18
|
* under an `.xlsm` name.
|
|
19
19
|
*/
|
|
20
20
|
export declare const XLSM_FORMAT_KEY = "ExcelMacro";
|
|
21
|
+
/**
|
|
22
|
+
* The registry key for an Excel template (`.xltx`). Like {@link XLSM_FORMAT_KEY}, a format of its
|
|
23
|
+
* own because being a template is a property of the file written, not of the workbook: only the
|
|
24
|
+
* workbook part's content type differs.
|
|
25
|
+
*/
|
|
26
|
+
export declare const XLTX_FORMAT_KEY = "ExcelTemplate";
|
|
27
|
+
/**
|
|
28
|
+
* The registry key for a macro-enabled Excel template (`.xltm`).
|
|
29
|
+
*/
|
|
30
|
+
export declare const XLTM_FORMAT_KEY = "ExcelMacroTemplate";
|
|
31
|
+
/** Every format key this package reads and writes, all with the one reader and writer. */
|
|
32
|
+
export declare const EXCEL_FORMAT_KEYS: readonly string[];
|
|
21
33
|
/**
|
|
22
34
|
* Registers all built-in read and write formats with the provided WorkbookIO registry.
|
|
23
35
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IWorksheetProtection, IWorkbookProtection } from '@sheetxl/sdk';
|
|
2
2
|
/**
|
|
3
3
|
* One protection attribute at the xlsx boundary.
|
|
4
4
|
*
|
|
@@ -19,7 +19,7 @@ export interface ProtectionAttribute<K extends string> {
|
|
|
19
19
|
ooxmlDefault: boolean;
|
|
20
20
|
}
|
|
21
21
|
/** `CT_SheetProtection`, in schema order. `showFormulas` has no attribute (formats carry it). */
|
|
22
|
-
export declare const
|
|
22
|
+
export declare const WorksheetProtectionAttributes: readonly ProtectionAttribute<keyof IWorksheetProtection.JSON>[];
|
|
23
23
|
/**
|
|
24
24
|
* `CT_WorkbookProtection`'s lock flags. `revision` belongs to shared workbooks: nothing sets it, so an
|
|
25
25
|
* unset one writes nothing rather than locking revisions on every protected workbook.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { IOpaqueSheet, IWorkbook, IWorksheet } from '@sheetxl/sdk';
|
|
2
|
+
/** What a part of one kind is written as. */
|
|
3
|
+
export interface SheetKindPart {
|
|
4
|
+
relType: string;
|
|
5
|
+
contentType: string;
|
|
6
|
+
folder: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const WorksheetPart: SheetKindPart;
|
|
9
|
+
/** As Excel writes each kind. */
|
|
10
|
+
export declare const SheetKindParts: Readonly<Record<IOpaqueSheet.Kind, SheetKindPart>>;
|
|
11
|
+
/** The worksheet a sheet ref holds, or `undefined` when it holds another kind (or nothing). */
|
|
12
|
+
export declare const worksheetJSON: (ref: IWorkbook.SheetRefJSON | null | undefined) => IWorksheet.JSON | undefined;
|
|
13
|
+
/** The carried part a sheet ref holds, or `undefined` when it holds a worksheet. */
|
|
14
|
+
export declare const opaqueSheetJSON: (ref: IWorkbook.SheetRefJSON | null | undefined) => IOpaqueSheet.JSON | undefined;
|
|
15
|
+
/** The kind a workbook relationship names, or `null` for a worksheet or anything else. */
|
|
16
|
+
export declare const sheetKindFromRelType: (relType: string | null | undefined) => IOpaqueSheet.Kind | null;
|
|
17
|
+
/**
|
|
18
|
+
* The attributes of the part's `sheetPr/tabColor`, or `null` when it has none.
|
|
19
|
+
*/
|
|
20
|
+
export declare const readTabColorAttributes: (xml: string) => Map<string, string> | null;
|
|
21
|
+
/**
|
|
22
|
+
* The part with its `sheetPr/tabColor` replaced by `tabColorXml` (a whole `<tabColor/>` element), or
|
|
23
|
+
* removed when that is `null`.
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* `tabColor` is the first child of `sheetPr` in every kind's schema, and `sheetPr` the first child of
|
|
27
|
+
* the root, so that is where each goes when absent.
|
|
28
|
+
*/
|
|
29
|
+
export declare const patchTabColor: (xml: string, tabColorXml: string | null) => string;
|
|
30
|
+
/**
|
|
31
|
+
* The part with its first `sheetView@tabSelected` saying whether the tab is selected.
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* A carried part keeps the source's flag, and Excel group-selects every sheet that has it on open
|
|
35
|
+
* (`probe-sheet-kinds-open.ps1`), so a stale one has to go.
|
|
36
|
+
*/
|
|
37
|
+
export declare const patchTabSelected: (xml: string, selected: boolean) => string;
|
|
38
|
+
/**
|
|
39
|
+
* A macro sheet's part as a worksheet's: the root renamed, the body unchanged.
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
* What Excel does saving a macro sheet into a workbook that cannot hold one (`.xlsx`): the tab comes
|
|
43
|
+
* back as a worksheet holding the same cells (`probe-sheet-kinds-open.ps1`). The macro sheet's body
|
|
44
|
+
* is a worksheet's, element for element in the same order, so only the root changes.
|
|
45
|
+
*/
|
|
46
|
+
export declare const macroSheetAsWorksheet: (xml: string) => string;
|
|
47
|
+
/**
|
|
48
|
+
* A macro sheet's part made independent of the workbook parts it cites by position: each shared
|
|
49
|
+
* string written inline, and the style, cell-metadata and value-metadata indexes dropped.
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* The part is carried, but the workbook's shared strings and styles are rebuilt on every save, so a
|
|
53
|
+
* carried index would name another string or format, or none (a repair prompt). An inline string is
|
|
54
|
+
* the same text; a dropped style is the default format, which is lost.
|
|
55
|
+
*/
|
|
56
|
+
export declare const detachMacroSheet: (xml: string, strings: readonly unknown[]) => string;
|
|
57
|
+
//# sourceMappingURL=SheetKinds.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IWorksheetView } from '@sheetxl/sdk';
|
|
2
|
+
/** The `sheetView` attribute that holds each view mode's own zoom. */
|
|
3
|
+
export declare const VIEW_MODE_ZOOM_ATTRIBUTES: readonly [mode: IWorksheetView.ViewMode, attribute: 'zoomScaleNormal' | 'zoomScaleSheetLayoutView' | 'zoomScalePageLayoutView'][];
|
|
4
|
+
//# sourceMappingURL=SheetViewAttributes.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IRange, ISort } from '@sheetxl/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* A `sortState` or `sortCondition` ref as an {@link ISort.Extent} of the table or filter range it
|
|
4
|
+
* belongs to, and back. Excel records the range it last sorted, which need not be the table's
|
|
5
|
+
* (`ISort.JSON.extent`).
|
|
6
|
+
*/
|
|
7
|
+
/** `ref`'s edges as offsets from `base`'s. */
|
|
8
|
+
export declare const toExtent: (base: IRange.Coords, ref: IRange.Coords) => ISort.Extent;
|
|
9
|
+
/** The range `extent` describes against `base`, or `null` when it would be empty or off the grid. */
|
|
10
|
+
export declare const fromExtent: (base: IRange.Coords, extent: ISort.Extent) => IRange.Coords | null;
|
|
11
|
+
/**
|
|
12
|
+
* A condition's extent, or `null` when its ref is just its column of the sort's range — the shape
|
|
13
|
+
* a sort made here writes, so it need not be carried.
|
|
14
|
+
*/
|
|
15
|
+
export declare const conditionExtent: (base: IRange.Coords, sortRange: IRange.Coords, ref: IRange.Coords) => ISort.Extent | null;
|
|
16
|
+
//# sourceMappingURL=SortExtent.d.ts.map
|
package/types/src/Types.d.ts
CHANGED
|
@@ -22,6 +22,17 @@ export interface WriteXLSXOptions extends IWorkbookIO.WriteOptions {
|
|
|
22
22
|
* what Excel's own *Save As* does.
|
|
23
23
|
*/
|
|
24
24
|
macroEnabled?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Whether to write a template (`.xltx`, or `.xltm` with {@link macroEnabled}) rather than a
|
|
27
|
+
* workbook.
|
|
28
|
+
*
|
|
29
|
+
* @defaultValue false
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Set by the format registration, like {@link macroEnabled}. Only the `xl/workbook.xml` content
|
|
33
|
+
* type differs; Excel opens a template as a new, unsaved workbook made from it.
|
|
34
|
+
*/
|
|
35
|
+
template?: boolean;
|
|
25
36
|
/**
|
|
26
37
|
* Callback invoked when a part is emitted.
|
|
27
38
|
*
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ICellHeader } from '@sheetxl/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* A row or column run as a sheet part carries it: the header's own state, plus the style and border
|
|
4
|
+
* flags xlsx keeps per row or column.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* The model has no header styles: a whole-row or whole-column style is a direct style over the whole
|
|
8
|
+
* row or column. The reader moves `s` there (`applyHeaderStyles`) and the writer works it out again
|
|
9
|
+
* (`layoutWorkbookStyles`).
|
|
10
|
+
*/
|
|
11
|
+
export interface XlsxHeader extends ICellHeader.JSON {
|
|
12
|
+
/** `<col style>` / `<row s customFormat="1">`: an index into the workbook's direct styles. */
|
|
13
|
+
s?: number;
|
|
14
|
+
/** `<row thickTop>`: the row gives a pixel to a thick line along its top. */
|
|
15
|
+
tt?: boolean;
|
|
16
|
+
/** `<row thickBot>`: the row gives a pixel to a medium or thick line along its bottom. */
|
|
17
|
+
tb?: boolean;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=XlsxHeader.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ChartModel } from '@sheetxl/sdk';
|
|
2
|
+
/** A chartex part as {@link readChartExSpace} reads it. */
|
|
3
|
+
export interface ChartExSpacePart {
|
|
4
|
+
model: ChartModel.ChartSpace;
|
|
5
|
+
/** How many elements were kept as markup because the model could not state them exactly. */
|
|
6
|
+
kept: number;
|
|
7
|
+
/** How many children the part states out of schema order (see `ChartSpacePart.reordered`). */
|
|
8
|
+
reordered: number;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the model states something otherwise than the part does, so a part written from it
|
|
11
|
+
* would differ (see `_chartExFold`). The part's own markup still writes back while the chart is
|
|
12
|
+
* untouched.
|
|
13
|
+
*/
|
|
14
|
+
lossy: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Reads a chartex part.
|
|
18
|
+
*
|
|
19
|
+
* @returns `null` when `xml` is not a `cx:chartSpace`.
|
|
20
|
+
*/
|
|
21
|
+
export declare const readChartExSpace: (xml: string) => ChartExSpacePart | null;
|
|
22
|
+
/**
|
|
23
|
+
* Writes a chartex part.
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* The chart space keeps the namespace declarations it was read with; the `cx`, `a` and `r`
|
|
27
|
+
* prefixes the writer uses are declared when it has none. Groups of a type the part cannot state
|
|
28
|
+
* are left out.
|
|
29
|
+
*/
|
|
30
|
+
export declare const writeChartExSpace: (chartSpace: ChartModel.ChartSpace) => string;
|
|
31
|
+
/**
|
|
32
|
+
* The markup a chartex part is saved as: `xml` as it is while it states what `model` does, so a
|
|
33
|
+
* chart nothing has changed is written byte for byte; otherwise the part written from `model`.
|
|
34
|
+
*
|
|
35
|
+
* @param xml The markup the chart was read from, when the part still carries it.
|
|
36
|
+
*/
|
|
37
|
+
export declare const writeChartExPart: (model: ChartModel.ChartSpace, xml: string | undefined) => string;
|
|
38
|
+
//# sourceMappingURL=ChartExXml.d.ts.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ChartModel } from '@sheetxl/sdk';
|
|
2
|
+
/** The two kinds of chart part: `c:chartSpace` and `cx:chartSpace`. */
|
|
3
|
+
export type ChartFamily = 'chart' | 'chartEx';
|
|
4
|
+
/** What a part of each family is, in the package and in the frame that cites it. */
|
|
5
|
+
export declare const CHART_PARTS: Readonly<Record<ChartFamily, {
|
|
6
|
+
relType: string;
|
|
7
|
+
contentType: string;
|
|
8
|
+
/** Where the part goes, beside the sheet's drawing. */
|
|
9
|
+
path: string;
|
|
10
|
+
/** The `graphicData` uri of a frame citing the part, and the namespace of its `chart` element. */
|
|
11
|
+
graphicUri: string;
|
|
12
|
+
}>>;
|
|
13
|
+
/** The family of a part, by the relationship that cites it. */
|
|
14
|
+
export declare const familyOfPart: (relType: string | undefined) => ChartFamily | null;
|
|
15
|
+
/** A chart part as {@link readChartModelPart} reads it. */
|
|
16
|
+
export interface ChartPartRead {
|
|
17
|
+
model: ChartModel.ChartSpace;
|
|
18
|
+
family: ChartFamily;
|
|
19
|
+
/** Elements kept as markup because the model could not state them exactly. */
|
|
20
|
+
kept: number;
|
|
21
|
+
/** Whether a part written from the model would state something otherwise (see `_chartExFold`). */
|
|
22
|
+
lossy: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Reads a chart part of either family.
|
|
26
|
+
*
|
|
27
|
+
* @returns `null` when `xml` is neither a `c:chartSpace` nor a `cx:chartSpace`.
|
|
28
|
+
*/
|
|
29
|
+
export declare const readChartModelPart: (xml: string) => ChartPartRead | null;
|
|
30
|
+
/** A chart part as {@link writeChartModelPart} writes it. */
|
|
31
|
+
export interface ChartPartWrite {
|
|
32
|
+
xml: string;
|
|
33
|
+
family: ChartFamily;
|
|
34
|
+
/** The types of the groups the part could not state, which are not in it. */
|
|
35
|
+
leftOut: string[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Writes a chart's model to the part its group types belong in.
|
|
39
|
+
*
|
|
40
|
+
* @param source The part the chart was read from: its family, and its markup while it still carries
|
|
41
|
+
* it. That markup is written as it is while it states what the model does.
|
|
42
|
+
*/
|
|
43
|
+
export declare const writeChartModelPart: (model: ChartModel.ChartSpace, source?: {
|
|
44
|
+
family?: ChartFamily | null;
|
|
45
|
+
xml?: string;
|
|
46
|
+
}) => ChartPartWrite;
|
|
47
|
+
//# sourceMappingURL=ChartPartXml.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ChartModel } from '@sheetxl/sdk';
|
|
2
|
+
/** A chart part as {@link readChartSpace} reads it. */
|
|
3
|
+
export interface ChartSpacePart {
|
|
4
|
+
model: ChartModel.ChartSpace;
|
|
5
|
+
/** How many elements were kept as markup because the model could not state them exactly. */
|
|
6
|
+
kept: number;
|
|
7
|
+
/**
|
|
8
|
+
* How many children the part states out of schema order. The model holds them; written back
|
|
9
|
+
* they come in schema order, so such a part is the same only apart from the order of children.
|
|
10
|
+
*/
|
|
11
|
+
reordered: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Reads a chart part.
|
|
15
|
+
*
|
|
16
|
+
* @returns `null` when `xml` is not a `c:chartSpace`: a `cx:chartSpace` (waterfall, treemap…) is
|
|
17
|
+
* read by `readChartExSpace`.
|
|
18
|
+
*/
|
|
19
|
+
export declare const readChartSpace: (xml: string) => ChartSpacePart | null;
|
|
20
|
+
export declare const DECLARATION = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n";
|
|
21
|
+
/**
|
|
22
|
+
* Writes a chart part.
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* The chart space keeps the namespace declarations it was read with; the `c`, `a` and `r` prefixes
|
|
26
|
+
* the writer uses are declared when it has none.
|
|
27
|
+
*/
|
|
28
|
+
export declare const writeChartSpace: (chartSpace: ChartModel.ChartSpace) => string;
|
|
29
|
+
/**
|
|
30
|
+
* The markup a chart part is saved as: `xml` as it is while it states what `model` does, so a
|
|
31
|
+
* chart nothing has changed is written byte for byte; otherwise the part written from `model`.
|
|
32
|
+
*
|
|
33
|
+
* @param xml The markup the chart was read from, when the part still carries it.
|
|
34
|
+
*/
|
|
35
|
+
export declare const writeChartPart: (model: ChartModel.ChartSpace, xml: string | undefined) => string;
|
|
36
|
+
//# sourceMappingURL=ChartSpaceXml.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A tree over a chart part's markup that remembers where each element is in the source.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* The chart reader keeps what it does not model as the source's own markup, so it needs each
|
|
6
|
+
* element's extent in the text, which a DOM does not give. Elements, attributes and character data
|
|
7
|
+
* only; comments and processing instructions are skipped.
|
|
8
|
+
*/
|
|
9
|
+
/** One element. `name` is the local name. */
|
|
10
|
+
export interface XmlElement {
|
|
11
|
+
name: string;
|
|
12
|
+
/** The name as the source spells it, prefix included. */
|
|
13
|
+
qname: string;
|
|
14
|
+
/** The attributes as the source spells them, undecoded. */
|
|
15
|
+
attrs: string;
|
|
16
|
+
children: (XmlElement | string)[];
|
|
17
|
+
/** Where the element starts in the source: at its open tag. */
|
|
18
|
+
start: number;
|
|
19
|
+
/** Just past the element's close tag, or past its open tag when it is empty. */
|
|
20
|
+
end: number;
|
|
21
|
+
/** Just past the open tag. */
|
|
22
|
+
contentStart: number;
|
|
23
|
+
/** At the close tag; equal to `contentStart` for an empty element. */
|
|
24
|
+
contentEnd: number;
|
|
25
|
+
}
|
|
26
|
+
export declare const decodeEntities: (text: string) => string;
|
|
27
|
+
/** Character data as it has to be spelled inside an element. */
|
|
28
|
+
export declare const encodeText: (text: string) => string;
|
|
29
|
+
/** The root element of `xml`, or `null` when there is none. */
|
|
30
|
+
export declare const parseFragment: (xml: string) => XmlElement | null;
|
|
31
|
+
export declare const childElements: (element: XmlElement) => XmlElement[];
|
|
32
|
+
/** The element's own character data; what its child elements hold is not read. */
|
|
33
|
+
export declare const readCharacters: (element: XmlElement) => string;
|
|
34
|
+
//# sourceMappingURL=_XmlTree.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ChartModel } from '@sheetxl/sdk';
|
|
2
|
+
import { Codec } from './_codec';
|
|
3
|
+
import { XmlWriter } from './_xml';
|
|
4
|
+
export declare const NUMBER_FORMAT: Codec;
|
|
5
|
+
/** The DrawingML element name of a group. */
|
|
6
|
+
export declare const groupElementName: (group: Pick<ChartModel.Group, "type" | "is3D">) => string;
|
|
7
|
+
/** `c:chartSpace`. */
|
|
8
|
+
export declare const CHART_SPACE: Codec;
|
|
9
|
+
export declare const writeChartSpaceElement: (writer: XmlWriter, chartSpace: ChartModel.ChartSpace) => void;
|
|
10
|
+
//# sourceMappingURL=_chartCodecs.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ChartExMarkup } from './_chartExMarkup';
|
|
2
|
+
import { Codec } from './_codec';
|
|
3
|
+
import { XmlWriter } from './_xml';
|
|
4
|
+
/** `cx:chartSpace`. */
|
|
5
|
+
export declare const CHART_EX_SPACE: Codec;
|
|
6
|
+
export declare const writeChartExSpaceElement: (writer: XmlWriter, chartSpace: ChartExMarkup.ChartSpace) => void;
|
|
7
|
+
//# sourceMappingURL=_chartExCodecs.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ChartModel } from '@sheetxl/sdk';
|
|
2
|
+
import { ChartExMarkup } from './_chartExMarkup';
|
|
3
|
+
/** The group types a `cx:chartSpace` part states. */
|
|
4
|
+
export declare const CHART_EX_GROUP_TYPES: ReadonlySet<string>;
|
|
5
|
+
/** A `cx:chartSpace` as the one chart model. */
|
|
6
|
+
export declare const foldChartEx: (chartSpace: ChartExMarkup.ChartSpace) => ChartModel.ChartSpace;
|
|
7
|
+
/**
|
|
8
|
+
* The one chart model as a `cx:chartSpace`. Groups of a type the part cannot state are left out;
|
|
9
|
+
* the caller says so.
|
|
10
|
+
*/
|
|
11
|
+
export declare const unfoldChartEx: (model: ChartModel.ChartSpace) => ChartExMarkup.ChartSpace;
|
|
12
|
+
/** Whether `model`, folded from `chartSpace`, unfolds to it again: whether the model states all it says. */
|
|
13
|
+
export declare const isLossless: (chartSpace: ChartExMarkup.ChartSpace, model: ChartModel.ChartSpace) => boolean;
|
|
14
|
+
//# sourceMappingURL=_chartExFold.d.ts.map
|