@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
|
@@ -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
|
|
@@ -17,10 +17,27 @@ export { XLFN, XLWS } from './ExcelFunctionFacts';
|
|
|
17
17
|
* | trim-range | infix `.:.` / `.:` / `:.` | `_xlfn._TRO_ALL/_TRO_LEADING/_TRO_TRAILING(a:b)` |
|
|
18
18
|
* | bare built-in | named `SUM` (unresolved) | `_xleta.SUM` — from the MEASURED `ExcelFunctionFacts` map |
|
|
19
19
|
* | LET/LAMBDA parameter | named `x` | `_xlpm.x` — at the declaration AND at every use |
|
|
20
|
+
* | long string literal | `"…"` over 255 characters | `_xlfn._LONGTEXT("…255…","…255…",…)` |
|
|
20
21
|
*
|
|
21
22
|
* MS-XLSX Extensions to Office Open XML section 2.2.2 Formula:
|
|
22
23
|
* https://learn.microsoft.com/en-us/openspecs/office_standards/ms-xlsx/3d025add-118d-4413-9856-ab65712ec1b0
|
|
23
24
|
*/
|
|
25
|
+
/**
|
|
26
|
+
* The wrapper Excel spells a string literal longer than {@link LONGTEXT_CHUNK} characters with:
|
|
27
|
+
* the literal cut into chunks of at most that many characters, each a string argument, in order.
|
|
28
|
+
* Excel's formula grammar caps a literal at 255 characters; the model has no such cap and holds
|
|
29
|
+
* the literal whole, so the wrapper exists only on disk.
|
|
30
|
+
*
|
|
31
|
+
* Measured (Excel 16.0, 2026-09-23, `probe-dv-launder.ps1`): a 996-character data-validation list
|
|
32
|
+
* literal saved as `_xlfn._LONGTEXT("…","…","…","…")` with chunks of 255, 255, 255 and 231
|
|
33
|
+
* characters (`__tests__/data/conditions/dv-limits.xlsx`). The chunk is counted on the literal's
|
|
34
|
+
* characters, not its imaged form — how a doubled quote (`""`) counts toward the 255 is not yet
|
|
35
|
+
* measured. Excel opens a bare over-long literal in a DV formula (same probe); whether it opens
|
|
36
|
+
* one in a cell `<f>` is unmeasured, so the wrapper is written wherever Excel would write it.
|
|
37
|
+
*/
|
|
38
|
+
export declare const LONGTEXT = "_LONGTEXT";
|
|
39
|
+
/** The longest string literal Excel spells bare — see {@link LONGTEXT}. */
|
|
40
|
+
export declare const LONGTEXT_CHUNK = 255;
|
|
24
41
|
/**
|
|
25
42
|
* Eta-reduced-lambda prefix — a BUILT-IN function referenced WITHOUT parentheses
|
|
26
43
|
* (`=BYROW(A1:B3,SUM)`, and equally `=SUM(ABS)` or `=1+ABS`: Excel prefixes it wherever it
|
|
@@ -42,12 +59,27 @@ export declare const XLPM = "_xlpm.";
|
|
|
42
59
|
* the display form re-images from `NamedRef.optional`.
|
|
43
60
|
*/
|
|
44
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.";
|
|
45
75
|
/**
|
|
46
76
|
* The write direction: modern (dynamic) tree → on-disk xlsx spellings, as an
|
|
47
|
-
* {@link ICalculation.FormulaTransform}
|
|
77
|
+
* {@link ICalculation.FormulaTransform} — the `write` half of the xlsx dialect (`ExcelCompat`).
|
|
48
78
|
*
|
|
49
|
-
* @param definedNames
|
|
50
|
-
* resolves to a REAL defined name is a name, not an eta-reduced built-in,
|
|
79
|
+
* @param definedNames Answers whether an upper-cased spelling is one of the workbook's defined
|
|
80
|
+
* names. A bare name that resolves to a REAL defined name is a name, not an eta-reduced built-in,
|
|
81
|
+
* and stays bare. Asked as each formula is written, so an answer that reads the live names is
|
|
82
|
+
* about the names that save writes; a `Set` is a fixed answer.
|
|
51
83
|
*
|
|
52
84
|
* @remarks
|
|
53
85
|
* Pure syntax + the measured `ExcelFunctionFacts` rows — the transform never consults the calc
|
|
@@ -55,16 +87,18 @@ export declare const XLOP = "_xlop.";
|
|
|
55
87
|
* runs once per formula block on the compiled AST; formulas with nothing legacy in them return
|
|
56
88
|
* every node untouched, which skips recompilation entirely.
|
|
57
89
|
*/
|
|
58
|
-
export declare function createLegacyWriteTransform(definedNames?:
|
|
90
|
+
export declare function createLegacyWriteTransform(definedNames?: {
|
|
91
|
+
has(name: string): boolean;
|
|
92
|
+
}): ICalculation.FormulaTransform;
|
|
59
93
|
/**
|
|
60
94
|
* The read direction: on-disk xlsx spellings → the modern (dynamic) tree, applied by the reader
|
|
61
|
-
* at parse time (`
|
|
95
|
+
* at parse time (`ICellContainerOptions.getFormulaTransform`).
|
|
62
96
|
*
|
|
63
97
|
* @remarks
|
|
64
98
|
* The mirror of {@link createLegacyWriteTransform}: strip `_xlfn._xlws.` BEFORE `_xlfn.`;
|
|
65
99
|
* unwrap `SINGLE`/`ANCHORARRAY`/`_TRO_*` to their operators (matched on the bare name whether
|
|
66
|
-
* or not a prefix was present — parity with the tolerance the parser used to have);
|
|
67
|
-
* `_xleta.`/`_xlpm.` from names. `[#This Row]` → `@` needs nothing here — that spelling is
|
|
100
|
+
* or not a prefix was present — parity with the tolerance the parser used to have); join a
|
|
101
|
+
* `_LONGTEXT` call's chunks back into the one literal; strip `_xleta.`/`_xlpm.` from names. `[#This Row]` → `@` needs nothing here — that spelling is
|
|
68
102
|
* valid TYPED input and the SDK normalizes it for every dialect.
|
|
69
103
|
*
|
|
70
104
|
* Load-path only: typed text never gets this pass, so `=_xlfn.SUM(A1)` typed is an unknown
|
|
@@ -33,10 +33,22 @@ export declare const EXT_URI_CONDITIONAL_FORMATTINGS = "{78C0D931-6437-407d-A8EE
|
|
|
33
33
|
export declare const EXT_URI_CONDITIONAL_FORMATTINGS_LEGACY_TYPO = "{78C0D931-6839-4c89-B8D6-976A2CC4E5B4}";
|
|
34
34
|
/** `x14:id` on a legacy `cfRule` — the GUID linking it to its x14 twin. */
|
|
35
35
|
export declare const EXT_URI_CF_RULE_ID = "{B025F937-C7B1-47D3-B67F-A62EFF666E3E}";
|
|
36
|
-
/**
|
|
36
|
+
/** The x15 (Excel 2013) main namespace, declared on `<ext>` elements that carry x15 content. */
|
|
37
|
+
export declare const NS_X15 = "http://schemas.microsoft.com/office/spreadsheetml/2010/11/main";
|
|
38
|
+
/** `x14:slicerList` on the worksheet, as older Excel writes it. Read, never written. */
|
|
37
39
|
export declare const EXT_URI_SLICER_LIST = "{A8765BA9-456A-4dab-B4F3-ACF838C121DE}";
|
|
38
|
-
/** `
|
|
40
|
+
/** `x14:slicerList` on the worksheet under the x15 ext uri: what current Excel writes for a table slicer. */
|
|
39
41
|
export declare const EXT_URI_SLICER_LIST_X15 = "{3A4CF648-6AED-40f4-86FF-DC5316D8AED3}";
|
|
42
|
+
/** `x15:slicerCaches` on the workbook: the relationships to the table slicers' cache parts. */
|
|
43
|
+
export declare const EXT_URI_SLICER_CACHES_X15 = "{46BE6895-7355-4a93-B00E-2C351335B9C9}";
|
|
44
|
+
/** `x15:tableSlicerCache` in a slicer cache's `extLst`: the table and column a table slicer filters. */
|
|
45
|
+
export declare const EXT_URI_TABLE_SLICER_CACHE = "{2F2917AC-EB37-4324-AD4E-5DD8C200BD13}";
|
|
46
|
+
/**
|
|
47
|
+
* `xlrd2:filterColumn` on an autoFilter's `filterColumn` — a date-group filter as VBA/COM writes
|
|
48
|
+
* it. Excel's own dropdown writes the same groups in the main namespace; this is read, never
|
|
49
|
+
* written.
|
|
50
|
+
*/
|
|
51
|
+
export declare const EXT_URI_FILTER_COLUMN = "{1AD28BCE-077C-4C59-8B6E-1921CE8616D4}";
|
|
40
52
|
/**
|
|
41
53
|
* Ext uris the reader recognizes but does not read, with the feature name for the warning
|
|
42
54
|
* (design §2.2 / plan Phase 5: skipped ext content warns, it never disappears silently).
|
|
@@ -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
|
@@ -1,12 +1,35 @@
|
|
|
1
1
|
import { IWorkbookIO } from '@sheetxl/sdk';
|
|
2
2
|
/**
|
|
3
|
-
* The registry key
|
|
4
|
-
* source-package seam (`XLSXWriter.ts`) — an origin only ever gets a retained `SourcePackage` by
|
|
5
|
-
* successfully zip-parsing under {@link ReadFormat}'s handler, so this key alone is enough to tell
|
|
6
|
-
* a genuine xlsx/xlsm round trip from a `.sxl`/`.csv` origin, without needing path/extension info a
|
|
7
|
-
* server-side buffer read may not have. See `DESIGN-PACKAGE-PASSTHROUGH.md` §6.
|
|
3
|
+
* The registry key for Excel.
|
|
8
4
|
*/
|
|
9
5
|
export declare const XLSX_FORMAT_KEY = "Excel";
|
|
6
|
+
/**
|
|
7
|
+
* The registry key for macro-enabled Excel (`.xlsm`).
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* A separate registered format, not a second extension on {@link XLSX_FORMAT_KEY}: `DESIGN-IO.md`
|
|
11
|
+
* rejects one format owning several extensions precisely because the handler is never told which
|
|
12
|
+
* one is being written, and macro-enabledness is exactly such a per-extension decision. Both keys
|
|
13
|
+
* share one reader and one writer; only the *write* side is opinionated (the same shape `.sxl` and
|
|
14
|
+
* `.json` use).
|
|
15
|
+
*
|
|
16
|
+
* Splitting the **read** side too is what makes a plain save round-trip: an origin remembers the
|
|
17
|
+
* key it was read under, so an `.xlsm` opened as `Excel` would be saved back as `.xlsx` content
|
|
18
|
+
* under an `.xlsm` name.
|
|
19
|
+
*/
|
|
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[];
|
|
10
33
|
/**
|
|
11
34
|
* Registers all built-in read and write formats with the provided WorkbookIO registry.
|
|
12
35
|
*
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { IWorksheetProtection, IWorkbookProtection } from '@sheetxl/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* One protection attribute at the xlsx boundary.
|
|
4
|
+
*
|
|
5
|
+
* The model names what is ALLOWED (`true` = allowed); OOXML names what is PROTECTED (`"1"` = not
|
|
6
|
+
* allowed), so every value inverts on the way through. An omitted attribute is its `ooxmlDefault`
|
|
7
|
+
* (ECMA-376, confirmed against Excel), which is not the model's default: a bare
|
|
8
|
+
* `<sheetProtection sheet="1"/>` leaves objects and scenarios editable, while `lock()` with no
|
|
9
|
+
* options does not — Excel's own Protect Sheet writes `objects="1" scenarios="1"`.
|
|
10
|
+
*/
|
|
11
|
+
export interface ProtectionAttribute<K extends string> {
|
|
12
|
+
/** The model property. */
|
|
13
|
+
key: K;
|
|
14
|
+
/** The OOXML attribute. */
|
|
15
|
+
attribute: string;
|
|
16
|
+
/** Whether the model allows it when the property is unset. */
|
|
17
|
+
modelDefault: boolean;
|
|
18
|
+
/** Whether the OOXML attribute PROTECTS it when omitted. */
|
|
19
|
+
ooxmlDefault: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** `CT_SheetProtection`, in schema order. `showFormulas` has no attribute (formats carry it). */
|
|
22
|
+
export declare const WorksheetProtectionAttributes: readonly ProtectionAttribute<keyof IWorksheetProtection.JSON>[];
|
|
23
|
+
/**
|
|
24
|
+
* `CT_WorkbookProtection`'s lock flags. `revision` belongs to shared workbooks: nothing sets it, so an
|
|
25
|
+
* unset one writes nothing rather than locking revisions on every protected workbook.
|
|
26
|
+
*/
|
|
27
|
+
export declare const WorkbookProtectionAttributes: readonly ProtectionAttribute<keyof IWorkbookProtection.Properties>[];
|
|
28
|
+
/**
|
|
29
|
+
* The model value for an attribute as read. An omitted or unparseable attribute reads as its OOXML
|
|
30
|
+
* default.
|
|
31
|
+
*/
|
|
32
|
+
export declare const readProtectionAttribute: (spec: ProtectionAttribute<string>, value: string | null | undefined) => boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The attribute value to write for a model value, or `null` when it equals the OOXML default and is
|
|
35
|
+
* omitted, as Excel does.
|
|
36
|
+
*/
|
|
37
|
+
export declare const writeProtectionAttribute: (spec: ProtectionAttribute<string>, allowed: boolean | null | undefined) => "1" | "0" | null;
|
|
38
|
+
//# sourceMappingURL=ProtectionAttributes.d.ts.map
|
|
@@ -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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IWorkbook } from '@sheetxl/sdk';
|
|
2
2
|
/**
|
|
3
3
|
* The default upper bound, in decompressed bytes, on what a {@link SourcePackage} will retain.
|
|
4
4
|
*
|
|
@@ -35,16 +35,33 @@ export interface SourcePackagePart {
|
|
|
35
35
|
* @remarks
|
|
36
36
|
* Not a residue map: this holds every non-streamed part from the source zip, decompressed. Which
|
|
37
37
|
* of those a save actually copies through (vs. an emitter claiming the path, vs. a drop-bucket
|
|
38
|
-
* rule) is decided at write time, not here.
|
|
38
|
+
* rule) is decided at write time, not here. The one thing it is told rather than holding is
|
|
39
|
+
* {@link isAbsorbed} — which parts the read put on the model, so the writer need not guess.
|
|
39
40
|
*/
|
|
40
41
|
export declare class SourcePackage {
|
|
41
42
|
private readonly _parts;
|
|
43
|
+
private readonly _absorbed;
|
|
42
44
|
private readonly _totalBytes;
|
|
43
45
|
private _structurallyChanged;
|
|
44
|
-
constructor(parts: ReadonlyMap<string, SourcePackagePart>);
|
|
46
|
+
constructor(parts: ReadonlyMap<string, SourcePackagePart>, absorbed?: ReadonlySet<string> | null);
|
|
45
47
|
getNames(): string[];
|
|
46
48
|
has(name: string): boolean;
|
|
47
49
|
getPart(name: string): SourcePackagePart | null;
|
|
50
|
+
/**
|
|
51
|
+
* Whether the reader took this part onto the model, so a save writes it from there rather than
|
|
52
|
+
* copying it through — see `DESIGN-PACKAGE-PASSTHROUGH.md` §4.
|
|
53
|
+
*
|
|
54
|
+
* @remarks
|
|
55
|
+
* Identity only: a name, never content. What each absorbed part *says* lives on the model that
|
|
56
|
+
* absorbed it (a chart's part on its movable, a sheet's VML on the sheet, a cache's definition on
|
|
57
|
+
* the workbook), which is the whole point of `PLAN-MODEL-HOMES.md` — this set exists so the
|
|
58
|
+
* passthrough can tell "the model owns this one" from "nothing modeled it" without a list of path
|
|
59
|
+
* patterns standing in for the answer.
|
|
60
|
+
*
|
|
61
|
+
* Independent of whether the element that cited the part still exists: deleting the chart deletes
|
|
62
|
+
* its part with it, and the source's copy should go too.
|
|
63
|
+
*/
|
|
64
|
+
isAbsorbed(name: string): boolean;
|
|
48
65
|
/** Sum of {@link SourcePackagePart.data}'s byte lengths across every retained part. */
|
|
49
66
|
getTotalBytes(): number;
|
|
50
67
|
/**
|
|
@@ -60,17 +77,19 @@ export declare class SourcePackage {
|
|
|
60
77
|
hasStructuralChange(): boolean;
|
|
61
78
|
markStructuralChange(): void;
|
|
62
79
|
}
|
|
63
|
-
/** The package retained for `
|
|
64
|
-
export declare function getSourcePackage(
|
|
80
|
+
/** The package retained for `workbook`, or `null` if none was retained. */
|
|
81
|
+
export declare function getSourcePackage(workbook: IWorkbook | null | undefined): SourcePackage | null;
|
|
65
82
|
/**
|
|
66
|
-
* Retain `sourcePackage` for `
|
|
83
|
+
* Retain `sourcePackage` for `workbook`, replacing anything previously retained for it.
|
|
67
84
|
*
|
|
68
85
|
* @remarks
|
|
69
|
-
* Owned entirely by io-xlsx — the
|
|
70
|
-
*
|
|
71
|
-
*
|
|
86
|
+
* Owned entirely by io-xlsx — the workbook never learns this exists (no sdk change). Keyed by the
|
|
87
|
+
* WORKBOOK, not its origin: the parts belong to the model that was read, and pass through on every
|
|
88
|
+
* save of it wherever it is written — a Save As moves the workbook to a new origin, and the parts go
|
|
89
|
+
* with it. Fresh (and empty) for a copy or a new workbook; released via
|
|
90
|
+
* {@link releaseSourcePackage} on `IWorkbook.close()`.
|
|
72
91
|
*/
|
|
73
|
-
export declare function setSourcePackage(
|
|
74
|
-
/** Release whatever is retained for `
|
|
75
|
-
export declare function releaseSourcePackage(
|
|
92
|
+
export declare function setSourcePackage(workbook: IWorkbook, sourcePackage: SourcePackage): void;
|
|
93
|
+
/** Release whatever is retained for `workbook`, if anything. Safe to call unconditionally. */
|
|
94
|
+
export declare function releaseSourcePackage(workbook: IWorkbook | null | undefined): void;
|
|
76
95
|
//# sourceMappingURL=SourcePackage.d.ts.map
|
package/types/src/Types.d.ts
CHANGED
|
@@ -5,6 +5,34 @@ import { ReaderProfiler } from './reader/ReaderProfiler';
|
|
|
5
5
|
* Options for exporting to XLSX file format.
|
|
6
6
|
*/
|
|
7
7
|
export interface WriteXLSXOptions extends IWorkbookIO.WriteOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Whether to write a macro-enabled workbook (`.xlsm`) rather than a plain one (`.xlsx`).
|
|
10
|
+
*
|
|
11
|
+
* @defaultValue false
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* Set by the format registration, not by callers: `.xlsx` and `.xlsm` are two registered write
|
|
15
|
+
* formats sharing this one handler, which is how `DESIGN-IO.md` says a per-extension encoding
|
|
16
|
+
* decision must be expressed — a single format listing both extensions could not, because the
|
|
17
|
+
* handler is never told which of its extensions is being written.
|
|
18
|
+
*
|
|
19
|
+
* It decides **both halves together**, so the declaration can never disagree with the payload:
|
|
20
|
+
* the `xl/workbook.xml` content type, and whether a source package's `xl/vbaProject.bin` is
|
|
21
|
+
* carried through. Writing a macro workbook to `.xlsx` therefore drops the VBA project, which is
|
|
22
|
+
* what Excel's own *Save As* does.
|
|
23
|
+
*/
|
|
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;
|
|
8
36
|
/**
|
|
9
37
|
* Callback invoked when a part is emitted.
|
|
10
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
|