@sheetxl/io-xlsx 0.8.0-beta.9 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +8 -7
- package/browser/esm/BPn0BJd77_Q1lYVz.mjs +7021 -0
- package/browser/esm/BfV9IAl46gJxLRsa.mjs +2474 -0
- package/browser/esm/{DsSIg46AR7IFBN5N.mjs → C1Ql7gO6TtQglsOH.mjs} +939 -804
- package/browser/esm/{CxtFawTfwRTCC4Xr.mjs → C74cxGSvdlAfqeqF.mjs} +2 -2
- package/browser/esm/CZ3s0Cfjqm3BRszF.mjs +104 -0
- package/browser/esm/ChMFy3Rg97YbbuTB.mjs +4632 -0
- package/browser/esm/D2WBxzN8ubzIrJ4h.mjs +10323 -0
- package/browser/esm/{D-epcZSoKLbsAIaC.mjs → DtUTX1O34sAvjw_I.mjs} +3 -3
- package/browser/esm/{C-2KaUyV4gs-sDTZ.mjs → K9Sy1I7Pix2m7GJj.mjs} +194 -144
- package/browser/esm/{CRrTMRdN_IcSA_pm.mjs → cjLbism9wq4om43B.mjs} +3 -3
- package/browser/esm/index.mjs +3 -4
- package/browser/esm/rF6yS_NgcKLlMbGR.mjs +24 -0
- package/licenses/dependencies.txt +2 -2
- package/node/esm/BMVTOvvr98SnUmif.mjs +2478 -0
- package/node/esm/BXHjX5Jr7ZO7XFp1.mjs +6957 -0
- package/node/esm/{CBtj0-a4l2qux2hA.mjs → BeAzln1Wp4oOc7xJ.mjs} +3 -3
- package/node/esm/C2FEO68INNEEnWCd.mjs +4746 -0
- package/node/esm/DDI2JK7U9TLsIobf.mjs +2562 -0
- package/node/esm/DhIaDwktkAy1xpDs.mjs +7284 -0
- package/node/esm/{BCr4lCI6qQXXN0K1.mjs → el-uWAcXKFVwmwZ-.mjs} +3 -3
- package/node/esm/index.mjs +65 -28
- package/node/esm/{BsTMtvwpQoPNv95M.mjs → kFd-ABtolhQt-Hqv.mjs} +2 -2
- package/package.json +9 -10
- package/types/src/AutoFilterRules.d.ts +34 -44
- package/types/src/ConditionalFormatRules.d.ts +2 -2
- package/types/src/DataTableFormula.d.ts +26 -0
- package/types/src/DataValidationRules.d.ts +0 -5
- package/types/src/DefinedNameAttributes.d.ts +8 -0
- package/types/src/ExcelCalcStamp.d.ts +0 -36
- package/types/src/ExcelCompat.d.ts +15 -143
- package/types/src/ExcelFunctionFacts.d.ts +0 -272
- package/types/src/ExcelReservedNames.d.ts +0 -65
- package/types/src/KnownFonts.d.ts +37 -0
- package/types/src/LegacyFormula.d.ts +1 -46
- package/types/src/OOXMLExtensions.d.ts +24 -2
- package/types/src/PageLayoutAttributes.d.ts +8 -0
- package/types/src/Plugin.d.ts +15 -3
- package/types/src/ProtectionAttributes.d.ts +2 -2
- package/types/src/SheetKinds.d.ts +42 -0
- package/types/src/SheetViewAttributes.d.ts +4 -0
- package/types/src/SortExtent.d.ts +16 -0
- package/types/src/SourcePackage.d.ts +0 -44
- package/types/src/SparklineGroups.d.ts +52 -0
- package/types/src/Types.d.ts +13 -3
- 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 +37 -0
- package/types/src/chart/_XmlTree.d.ts +34 -0
- package/types/src/chart/_chartCodecs.d.ts +12 -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 +13 -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/pivot/PivotArea.d.ts +20 -0
- package/types/src/pivot/PivotCacheRead.d.ts +30 -0
- package/types/src/pivot/PivotCacheWrite.d.ts +23 -0
- package/types/src/pivot/PivotFilters.d.ts +29 -0
- package/types/src/pivot/PivotFormats.d.ts +60 -0
- package/types/src/pivot/PivotTableRead.d.ts +44 -0
- package/types/src/pivot/PivotTableWrite.d.ts +13 -0
- package/types/src/pivot/_PivotCacheXml.d.ts +48 -0
- package/types/src/pivot/_PivotTableXml.d.ts +23 -0
- package/types/src/reader/CellControls.d.ts +18 -0
- package/types/src/reader/DocumentPropertiesRead.d.ts +16 -0
- package/types/src/reader/DummyFunctionUnwrap.d.ts +43 -23
- 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 +12 -0
- package/types/src/reader/PivotButtons.d.ts +14 -0
- package/types/src/reader/PivotCellFormats.d.ts +22 -0
- package/types/src/reader/SlicerJoin.d.ts +26 -0
- package/types/src/reader/ZipReader.d.ts +1 -1
- package/types/src/reader/_SlicerRecord.d.ts +59 -0
- package/types/src/reader/dom/DOMTransformer.d.ts +2 -2
- package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +13 -1
- package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +3 -11
- package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts +8 -1
- package/types/src/reader/domVisitors/CommentVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +13 -6
- package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +9 -0
- package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts +10 -7
- package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +22 -13
- package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts +5 -5
- package/types/src/reader/domVisitors/DrawingVisitor.d.ts +4 -2
- package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +1 -11
- package/types/src/reader/domVisitors/FeaturePropertyBagVisitor.d.ts +18 -0
- package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts +0 -11
- 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 +26 -5
- package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts +11 -2
- package/types/src/reader/domVisitors/SlicersVisitor.d.ts +9 -3
- 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/TimelinesVisitor.d.ts +13 -0
- package/types/src/reader/domVisitors/WorkbookVisitor.d.ts +0 -9
- package/types/src/reader/domVisitors/_Dxfs.d.ts +10 -0
- package/types/src/reader/domVisitors/index.d.ts +6 -34
- package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts +1 -0
- package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +31 -6
- package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +26 -8
- package/types/src/richValue/ErrorRichValueHandler.d.ts +22 -0
- package/types/src/richValue/IRichValueHandler.d.ts +109 -0
- package/types/src/richValue/LocalImageRichValueHandler.d.ts +18 -0
- package/types/src/richValue/RichDataParts.d.ts +69 -0
- package/types/src/richValue/RichRecordWriter.d.ts +61 -0
- package/types/src/richValue/RichValueHandlers.d.ts +25 -0
- package/types/src/richValue/RichValueResolver.d.ts +54 -0
- package/types/src/richValue/WebImageRichValueHandler.d.ts +37 -0
- package/types/src/richValue/index.d.ts +7 -0
- package/types/src/utils/DrawingMLText.d.ts +2 -2
- package/types/src/utils/FormControls.d.ts +79 -6
- 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 +25 -32
- package/types/src/utils/VmlNoteStyle.d.ts +25 -0
- package/types/src/utils/VmlPrefixes.d.ts +24 -0
- package/types/src/vba/VBAProject.d.ts +0 -19
- package/types/src/writer/EvaluationSheet.d.ts +5 -0
- package/types/src/writer/builder/OpcXmlUtils.d.ts +0 -8
- package/types/src/writer/builder/PackageBuilder.d.ts +2 -41
- package/types/src/writer/builder/Types.d.ts +18 -28
- 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/ExternalLinkEmitter.d.ts +0 -11
- package/types/src/writer/emitters/FeaturePropertyBagEmitter.d.ts +8 -0
- package/types/src/writer/emitters/LegacyDrawingEmitter.d.ts +4 -4
- package/types/src/writer/emitters/PivotTableEmitter.d.ts +30 -1
- 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/RichValuePartsEmitters.d.ts +36 -0
- package/types/src/writer/emitters/RichValueRelEmitter.d.ts +12 -0
- package/types/src/writer/emitters/RichValueStructureEmitter.d.ts +4 -3
- package/types/src/writer/emitters/RichValueTypesEmitter.d.ts +3 -2
- package/types/src/writer/emitters/RichValueWebImageEmitter.d.ts +24 -0
- package/types/src/writer/emitters/SharedStringsEmitter.d.ts +6 -3
- package/types/src/writer/emitters/SlicerEmitter.d.ts +132 -0
- package/types/src/writer/emitters/StylesEmitter.d.ts +35 -2
- package/types/src/writer/emitters/TableEmitter.d.ts +14 -0
- package/types/src/writer/emitters/WorkbookEmitter.d.ts +24 -2
- 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/CellControlComplements.d.ts +29 -0
- package/types/src/writer/utils/DateSystem.d.ts +6 -0
- package/types/src/writer/utils/DefaultRows.d.ts +22 -0
- package/types/src/writer/utils/DrawMLUtils.d.ts +8 -6
- package/types/src/writer/utils/DummyFunction.d.ts +0 -25
- package/types/src/writer/utils/DxfCollector.d.ts +14 -11
- package/types/src/writer/utils/PrstGeomUtils.d.ts +11 -3
- package/types/src/writer/utils/RichValueCollector.d.ts +81 -129
- package/types/src/writer/utils/SheetStyleLayout.d.ts +86 -0
- package/types/src/writer/utils/TextUtils.d.ts +6 -1
- package/types/src/writer/utils/UnsupportedFunctions.d.ts +2 -2
- package/types/src/writer/utils/XfVariants.d.ts +61 -0
- package/browser/cjs/B0Ugu_crqQYpdfQz.cjs +0 -1
- package/browser/cjs/B6sirGz6w-Bm7Ofo.cjs +0 -1
- package/browser/cjs/BHM3_D9PsNURVAVy.cjs +0 -1
- package/browser/cjs/BHWdwAQ322YA8JAZ.cjs +0 -6
- package/browser/cjs/CeuX8p1aBuKTuagi.cjs +0 -2
- package/browser/cjs/D3EWCPfCu-qMOIGd.cjs +0 -1
- package/browser/cjs/DSM4q1dhVVXvsgby.cjs +0 -30
- package/browser/cjs/DiAHwNv2I8RHE9GY.cjs +0 -1
- package/browser/cjs/index.cjs +0 -1
- package/browser/cjs/wrpXlaSBGEicQf6_.cjs +0 -6
- package/browser/cjs/xQ6-wbTw5UzZUM1Y.cjs +0 -1
- package/browser/esm/Bu64BYvRAlVftMr1.mjs +0 -67
- package/browser/esm/CWt4fDYEbj2hvsl_.mjs +0 -3346
- package/browser/esm/Ccnxz-y2WBEgfvvh.mjs +0 -6498
- package/browser/esm/Dx64JMAGwNNDBkC1.mjs +0 -4928
- package/browser/esm/Sv4twwEJDb9dZ91h.mjs +0 -149
- package/node/esm/BPn5XBizKkwaUqXB.mjs +0 -4285
- package/node/esm/BVV11IlqF6Lmlv8D.mjs +0 -154
- package/node/esm/BiJEEgltJzx94zIR.mjs +0 -3433
- package/node/esm/CkmZuMvRTpva7eQu.mjs +0 -5074
- package/node/esm/j0RE2usgdljRw_gr.mjs +0 -2345
- 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/RichValueDataVisitor.d.ts +0 -7
- package/types/src/reader/domVisitors/RichValueStructureVisitor.d.ts +0 -6
- 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/types/src/writer/utils/HiddenFormulaXfs.d.ts +0 -28
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { XmlElement } from './_XmlTree';
|
|
2
|
+
import { Scope, XmlWriter } from './_xml';
|
|
3
|
+
/** What one read of a part shares. */
|
|
4
|
+
export declare class ReadContext {
|
|
5
|
+
readonly xml: string;
|
|
6
|
+
readonly rootScope: Scope;
|
|
7
|
+
/** Elements kept as markup because the model could not state them exactly. */
|
|
8
|
+
kept: number;
|
|
9
|
+
/** Children read out of schema order, which a writer puts back in it. */
|
|
10
|
+
reordered: number;
|
|
11
|
+
/** How the writer's `c:`, `cx:` and `a:` read in this part: the part's own namespaces. */
|
|
12
|
+
readonly writeScope: Scope;
|
|
13
|
+
constructor(xml: string, rootScope: Scope);
|
|
14
|
+
/**
|
|
15
|
+
* The source markup of `element`, made to stand alone: a namespace declared between the root
|
|
16
|
+
* and the element is declared on it.
|
|
17
|
+
*/
|
|
18
|
+
markupOf(element: XmlElement, scope: Scope): string;
|
|
19
|
+
}
|
|
20
|
+
export type Vocabulary = 'c' | 'a' | 'c15' | 'cx';
|
|
21
|
+
export interface AttributeSpec {
|
|
22
|
+
name: string;
|
|
23
|
+
key: string;
|
|
24
|
+
read(text: string): unknown;
|
|
25
|
+
write(value: any): string;
|
|
26
|
+
}
|
|
27
|
+
export interface FieldSpec {
|
|
28
|
+
/** The local names the field reads; more than one for a choice (`noFill`, `solidFill`…). */
|
|
29
|
+
tags: readonly string[];
|
|
30
|
+
key: string;
|
|
31
|
+
ns: Vocabulary;
|
|
32
|
+
many?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The value of `element`, or `undefined` when the model cannot state it: it is then kept as
|
|
35
|
+
* markup. `scope` includes what `element` declares itself.
|
|
36
|
+
*/
|
|
37
|
+
read(element: XmlElement, scope: Scope, context: ReadContext): unknown;
|
|
38
|
+
write(writer: XmlWriter, value: any): void;
|
|
39
|
+
/** Where the value lives on its holder, when that is not `key`: one child that states several fields. */
|
|
40
|
+
get?(holder: any): unknown;
|
|
41
|
+
set?(holder: any, value: any): void;
|
|
42
|
+
}
|
|
43
|
+
export interface Codec {
|
|
44
|
+
attributes?: readonly AttributeSpec[];
|
|
45
|
+
fields: readonly FieldSpec[];
|
|
46
|
+
/** Called with what was read, before it is returned. */
|
|
47
|
+
afterRead?(value: any, element: XmlElement, scope: Scope, context: ReadContext): void;
|
|
48
|
+
/**
|
|
49
|
+
* Attributes written besides the stated ones, unless the element kept the same attribute as
|
|
50
|
+
* read: a namespace an extension declares for its children (`xmlns:c15`), as Excel does.
|
|
51
|
+
*/
|
|
52
|
+
declares?(value: any): readonly [string, string][];
|
|
53
|
+
}
|
|
54
|
+
/** Reads `element` by `codec`. `scope` is the scope `element` sits in. */
|
|
55
|
+
export declare const readElement: (element: XmlElement, codec: Codec, scope: Scope, context: ReadContext) => any;
|
|
56
|
+
/** Writes `value` as the element `name` by `codec`. */
|
|
57
|
+
export declare const writeElement: (writer: XmlWriter, name: string, value: any, codec: Codec) => void;
|
|
58
|
+
export declare const qualified: (ns: Vocabulary, tag: string) => string;
|
|
59
|
+
/** A value element of `kind`: `<c:tag val="…"/>`. A `bool` with no `val` is `true`, as `CT_Boolean` says. */
|
|
60
|
+
export declare const val: (tag: string, kind: "bool" | "int" | "num" | "str", key?: string, ns?: Vocabulary) => FieldSpec;
|
|
61
|
+
/** An element holding only text: `<c:f>Sheet1!$A$1</c:f>`. */
|
|
62
|
+
export declare const text: (tag: string, key?: string, ns?: Vocabulary) => FieldSpec;
|
|
63
|
+
/** A child element read by its own codec; `many` for one that repeats. */
|
|
64
|
+
export declare const element: (tag: string, codec: Codec | (() => Codec), key?: string, options?: {
|
|
65
|
+
many?: boolean;
|
|
66
|
+
ns?: Vocabulary;
|
|
67
|
+
}) => FieldSpec;
|
|
68
|
+
/** An attribute of `kind`. `scale` divides what the file states: `sz="1400"` with `scale` 100 is `14`. */
|
|
69
|
+
export declare const attribute: (name: string, kind: "bool" | "int" | "num" | "str", key?: string, scale?: number) => AttributeSpec;
|
|
70
|
+
/** An attribute stated as one of two words: `b="1"` for `weight: 700`. */
|
|
71
|
+
export declare const mappedAttribute: (name: string, key: string, read: (text: string) => unknown, write: (value: any) => string) => AttributeSpec;
|
|
72
|
+
/**
|
|
73
|
+
* `field`, but its value is kept only when writing it gives back markup of the same canonical
|
|
74
|
+
* form; otherwise the element stays as markup. For values the model states in other units or
|
|
75
|
+
* spellings than the file (colors, angles, fills).
|
|
76
|
+
*/
|
|
77
|
+
export declare const exact: (field: FieldSpec) => FieldSpec;
|
|
78
|
+
//# sourceMappingURL=_codec.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Codec } from './_codec';
|
|
2
|
+
import { XmlWriter } from './_xml';
|
|
3
|
+
export declare const writeColor: (writer: XmlWriter, color: string) => void;
|
|
4
|
+
/** `c:spPr`. */
|
|
5
|
+
export declare const SHAPE_PROPERTIES: Codec;
|
|
6
|
+
/** `a:rPr`, `a:defRPr`, `a:endParaRPr`. */
|
|
7
|
+
export declare const RUN_PROPERTIES: Codec;
|
|
8
|
+
/** `c:txPr`, `c:rich`: `a:bodyPr`, `a:lstStyle`, `a:p`. */
|
|
9
|
+
export declare const TEXT_BODY: Codec;
|
|
10
|
+
//# sourceMappingURL=_drawingml.d.ts.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { XmlElement } from './_XmlTree';
|
|
2
|
+
export declare const NS: {
|
|
3
|
+
readonly c: "http://schemas.openxmlformats.org/drawingml/2006/chart";
|
|
4
|
+
readonly cStrict: "http://purl.oclc.org/ooxml/drawingml/chart";
|
|
5
|
+
readonly a: "http://schemas.openxmlformats.org/drawingml/2006/main";
|
|
6
|
+
readonly aStrict: "http://purl.oclc.org/ooxml/drawingml/main";
|
|
7
|
+
readonly r: "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
8
|
+
readonly rStrict: "http://purl.oclc.org/ooxml/officeDocument/relationships";
|
|
9
|
+
readonly c15: "http://schemas.microsoft.com/office/drawing/2012/chart";
|
|
10
|
+
readonly cx: "http://schemas.microsoft.com/office/drawing/2014/chartex";
|
|
11
|
+
readonly xml: "http://www.w3.org/XML/1998/namespace";
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The prefixes the writer spells the vocabularies with. `c15` is written only inside markup that
|
|
15
|
+
* declares it so: an extension states its own namespace.
|
|
16
|
+
*/
|
|
17
|
+
export declare const WRITE_PREFIX: {
|
|
18
|
+
readonly c: "c";
|
|
19
|
+
readonly a: "a";
|
|
20
|
+
readonly r: "r";
|
|
21
|
+
readonly c15: "c15";
|
|
22
|
+
readonly cx: "cx";
|
|
23
|
+
};
|
|
24
|
+
export declare const isChartNs: (uri: string | undefined) => boolean;
|
|
25
|
+
export declare const isDrawingNs: (uri: string | undefined) => boolean;
|
|
26
|
+
export declare const isChartExNs: (uri: string | undefined) => boolean;
|
|
27
|
+
/** Prefix to namespace, `''` for the default namespace. */
|
|
28
|
+
export type Scope = Readonly<Record<string, string>>;
|
|
29
|
+
export declare const EMPTY_SCOPE: Scope;
|
|
30
|
+
/** An element's attributes in source order, values decoded. */
|
|
31
|
+
export declare const readAttributes: (element: XmlElement) => [name: string, value: string][];
|
|
32
|
+
/** The scope inside `element`: `scope` plus the namespaces the element declares. */
|
|
33
|
+
export declare const scopeOf: (element: XmlElement, scope: Scope) => Scope;
|
|
34
|
+
/** The namespace of an element, in the scope that holds it (its own declarations included). */
|
|
35
|
+
export declare const namespaceOf: (element: XmlElement, inner: Scope) => string | undefined;
|
|
36
|
+
/** Builds markup. Names are written as given; text and attribute values are escaped. */
|
|
37
|
+
export declare class XmlWriter {
|
|
38
|
+
private readonly _parts;
|
|
39
|
+
open(name: string, attributes?: readonly (readonly [string, string])[] | null, empty?: boolean): this;
|
|
40
|
+
close(name: string): this;
|
|
41
|
+
/** `<name val="value"/>`. */
|
|
42
|
+
val(name: string, value: string): this;
|
|
43
|
+
text(text: string): this;
|
|
44
|
+
/** Markup written as it is. */
|
|
45
|
+
raw(markup: string): this;
|
|
46
|
+
toString(): string;
|
|
47
|
+
}
|
|
48
|
+
export declare const encodeAttribute: (value: string) => string;
|
|
49
|
+
/** `"1"`/`"0"` for a schema boolean, `null` for anything else. */
|
|
50
|
+
export declare const readBoolean: (text: string) => boolean | null;
|
|
51
|
+
export declare const writeBoolean: (value: boolean) => string;
|
|
52
|
+
/**
|
|
53
|
+
* An attribute value in canonical form: a schema boolean as `1`/`0` and a number as the shortest
|
|
54
|
+
* spelling of its value, so `true` and `1`, or `100` and `100.0`, compare equal.
|
|
55
|
+
*/
|
|
56
|
+
export declare const canonicalValue: (value: string) => string;
|
|
57
|
+
/**
|
|
58
|
+
* Markup in canonical form: namespaces resolved (prefixes and where they are declared do not
|
|
59
|
+
* matter), attributes sorted with their values in {@link canonicalValue} form, whitespace between
|
|
60
|
+
* elements and comments dropped, and a chart `CT_Boolean` with no `val` given its default.
|
|
61
|
+
*
|
|
62
|
+
* @remarks
|
|
63
|
+
* Two pieces of markup with the same canonical form mean the same thing to a reader of the schema.
|
|
64
|
+
* This is the equality the chart model's round trip is held to. With `anyOrder` the order of an
|
|
65
|
+
* element's children does not count either: for a part that states them out of schema order.
|
|
66
|
+
*/
|
|
67
|
+
export declare const canonicalize: (element: XmlElement, scope: Scope, anyOrder?: boolean) => string;
|
|
68
|
+
/** The canonical form of a fragment of markup, its prefixes read in `scope`; `null` if it holds no element. */
|
|
69
|
+
export declare const canonicalizeMarkup: (markup: string, scope: Scope) => string | null;
|
|
70
|
+
//# sourceMappingURL=_xml.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IPivotTable, IRange } from '@sheetxl/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* How many rows and columns the page fields take: down then across (or across then down),
|
|
4
|
+
* wrapping after `pageWrap`: the sdk's `pageCountsOf`, which the layout places them by.
|
|
5
|
+
*/
|
|
6
|
+
export declare const pageCounts: (json: IPivotTable.JSON) => {
|
|
7
|
+
rows: number;
|
|
8
|
+
columns: number;
|
|
9
|
+
} | null;
|
|
10
|
+
/**
|
|
11
|
+
* The cells a table takes: its location, and above it its page fields and the blank row between,
|
|
12
|
+
* each page field a caption and its selection with a column between. The origin of
|
|
13
|
+
* {@link IPivotTable.JSON.buttons}.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* A modeled table's page counts follow from its page fields; one carried as its part alone states
|
|
17
|
+
* them on `<location>`.
|
|
18
|
+
*/
|
|
19
|
+
export declare const pivotAreaOf: (json: IPivotTable.JSON) => IRange.Coords | null;
|
|
20
|
+
//# sourceMappingURL=PivotArea.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IEmbeddedPart, IPivotTable } from '@sheetxl/sdk';
|
|
2
|
+
/** The relationship a cache definition has to its records. */
|
|
3
|
+
export declare const REL_TYPE_PIVOT_CACHE_RECORDS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheRecords";
|
|
4
|
+
/** A cache's model: what {@link IPivotTable.CacheJSON} holds besides its id and part. */
|
|
5
|
+
export type PivotCacheModel = Omit<IPivotTable.CacheJSON, 'cacheId' | 'part'>;
|
|
6
|
+
/**
|
|
7
|
+
* Reads the model of a pivot cache from its parts: the definition and, through its relationship,
|
|
8
|
+
* the records.
|
|
9
|
+
*
|
|
10
|
+
* @returns The model, or `null` when the cache holds what the model does not type yet: a source
|
|
11
|
+
* other than a range or a name in this workbook, or item properties. Such a cache is carried as
|
|
12
|
+
* its part alone.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Every field's records become item ids, an inline field's included: its values are its items,
|
|
16
|
+
* in the order they first appear, and the field is marked `inline` so it is written back inline.
|
|
17
|
+
*
|
|
18
|
+
* @param numberFormat What a field's `numFmtId` names in the file: its code, or a built-in's id;
|
|
19
|
+
* `undefined` for General.
|
|
20
|
+
*/
|
|
21
|
+
export declare const readPivotCacheModel: (part: IEmbeddedPart.JSON, date1904: boolean, numberFormat: (id: number) => string | number | undefined) => PivotCacheModel | null;
|
|
22
|
+
/**
|
|
23
|
+
* The cells a cache's `<worksheetSource>` names, read apart from the model so a cache carried as
|
|
24
|
+
* its part has its source too: the engine holds it, and the writer restates the part with it.
|
|
25
|
+
*
|
|
26
|
+
* @returns `undefined` for a source that is not a worksheet's, or is in another workbook (cited by
|
|
27
|
+
* a relationship, `r:id`): such a source is written as read.
|
|
28
|
+
*/
|
|
29
|
+
export declare const readPivotCacheSource: (xml: string) => IPivotTable.CacheSourceJSON | undefined;
|
|
30
|
+
//# sourceMappingURL=PivotCacheRead.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IEmbeddedPart, IPivotTable } from '@sheetxl/sdk';
|
|
2
|
+
import { PivotStylesWrite } from './PivotFormats';
|
|
3
|
+
/**
|
|
4
|
+
* The definition part of a modeled cache, its records part as its one child, both written from
|
|
5
|
+
* the model.
|
|
6
|
+
*
|
|
7
|
+
* @returns `null` when the cache is not modeled.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* The `<sharedItems>` summary attributes are derived from the items by Excel's rules
|
|
11
|
+
* (`pivot-probes/probe-pivot-cache-items.ps1`, 2026-10-24): booleans and errors count as text, a
|
|
12
|
+
* blank makes a field semi-mixed, more than one kind among text or booleans, errors, numbers and
|
|
13
|
+
* dates makes it mixed, and `maxDate` is the day after the latest date when that has no time.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* A cache's part as read with its `<worksheetSource>` restated as `source`, where the engine has
|
|
17
|
+
* moved it since (an insert, a table renamed or converted to a range): `ref`, `sheet` and `name`
|
|
18
|
+
* set or removed to match. Unchanged when it still reads so, or when `source` is absent (a source
|
|
19
|
+
* the model does not type, written as read).
|
|
20
|
+
*/
|
|
21
|
+
export declare const restatePivotCacheSource: (xml: string, source: IPivotTable.CacheSourceJSON | undefined) => string;
|
|
22
|
+
export declare const writePivotCacheModel: (json: IPivotTable.CacheJSON, date1904: boolean, styles: PivotStylesWrite) => IEmbeddedPart.JSON | null;
|
|
23
|
+
//# sourceMappingURL=PivotCacheWrite.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IPivotTable } from '@sheetxl/sdk';
|
|
2
|
+
import { ElementSpan } from './_PivotCacheXml';
|
|
3
|
+
/**
|
|
4
|
+
* Reads one `<filter>` of a pivot table.
|
|
5
|
+
*
|
|
6
|
+
* @throws `Unmodeled` for what the model does not type: OLAP attributes, an extension, a column
|
|
7
|
+
* that is not one criterion, or a type whose operands are not as Excel spells them.
|
|
8
|
+
*/
|
|
9
|
+
export declare const readPivotFilter: (xml: string, span: ElementSpan) => IPivotTable.PivotFilterJSON;
|
|
10
|
+
/**
|
|
11
|
+
* Writes one `<filter>` of a pivot table, `index` its position among the table's filters.
|
|
12
|
+
*
|
|
13
|
+
* @returns `null`, after `warn`, when no pivot filter type spells the condition (a value filter
|
|
14
|
+
* on text, a top N percent by count, a label filter's blank test).
|
|
15
|
+
* @param date1904 The workbook's date system, for a relative period's window.
|
|
16
|
+
*/
|
|
17
|
+
export declare const writePivotFilter: (filter: IPivotTable.PivotFilterJSON, index: number, warn?: (message: string) => void, date1904?: boolean) => string | null;
|
|
18
|
+
/** The filters of a definition, read from its `<filters>`. */
|
|
19
|
+
export declare const readPivotFilters: (xml: string, span: ElementSpan) => IPivotTable.PivotFilterJSON[];
|
|
20
|
+
/**
|
|
21
|
+
* The definition's `<filters>`, or `null`.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* Each filter's column may hold a `<filters>` values list of its own, so the element ends at the
|
|
25
|
+
* last close before the definition's extensions, not the first. A filter may hold extensions of its
|
|
26
|
+
* own, so the definition's are the first after the last filter.
|
|
27
|
+
*/
|
|
28
|
+
export declare const findFilters: (xml: string) => ElementSpan | null;
|
|
29
|
+
//# sourceMappingURL=PivotFilters.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ICellStyle, IPivotTable } from '@sheetxl/sdk';
|
|
2
|
+
import { ElementSpan } from './_PivotCacheXml';
|
|
3
|
+
/**
|
|
4
|
+
* What a pivot part's format ids name in the file being read: its number formats and its
|
|
5
|
+
* differential formats (`dxfs`), from the styles part.
|
|
6
|
+
*/
|
|
7
|
+
export interface PivotStylesRead {
|
|
8
|
+
/** The number format `numFmtId` names: its code, or a built-in's id; `undefined` for General. */
|
|
9
|
+
numberFormat(id: number): string | number | undefined;
|
|
10
|
+
/** The differential format `dxfId` names, or `undefined` when the file has none at that index. */
|
|
11
|
+
dxf(id: number): ICellStyle.Properties | undefined;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* What a file's format ids name, from its styles part as read: its custom number formats by id,
|
|
15
|
+
* its `dxfs` by index (`SheetStyleVisitor`).
|
|
16
|
+
*/
|
|
17
|
+
export declare const pivotStylesRead: (numFmts: ReadonlyMap<number, string> | undefined, dxfs: ReadonlyMap<number, ICellStyle.Properties> | undefined) => PivotStylesRead;
|
|
18
|
+
/**
|
|
19
|
+
* The ids a pivot part cites in the file being written: the save numbers its number formats and
|
|
20
|
+
* differential formats afresh, so a part restates each from what it names.
|
|
21
|
+
*/
|
|
22
|
+
export interface PivotStylesWrite {
|
|
23
|
+
/** The `numFmtId` of a number format: a built-in's own, or the one this save gives a code. */
|
|
24
|
+
numFmtId(format: string | number): number;
|
|
25
|
+
/** The `dxfId` of a differential format, added to the save's `dxfs`. */
|
|
26
|
+
dxfId(style: ICellStyle.Properties): number;
|
|
27
|
+
}
|
|
28
|
+
/** A `<pivotArea>`. */
|
|
29
|
+
export declare const readPivotArea: (xml: string, span: ElementSpan) => IPivotTable.PivotAreaJSON;
|
|
30
|
+
/** A `<pivotArea>` as Excel spells it: `fieldPosition` always, the rest at their defaults left out. */
|
|
31
|
+
export declare const writePivotArea: (area: IPivotTable.PivotAreaJSON) => string;
|
|
32
|
+
/** The definition's own `<formats>` (not an extension's), or `null`. */
|
|
33
|
+
export declare const findFormats: (xml: string) => ElementSpan | null;
|
|
34
|
+
/** `<formats>`: each `<format>`'s differential format, from the file's `dxfs`, and its area. */
|
|
35
|
+
export declare const readFormats: (xml: string, span: ElementSpan, styles: PivotStylesRead) => IPivotTable.PivotFormatJSON[];
|
|
36
|
+
/** `<formats>`, each format's differential format added to the save's. */
|
|
37
|
+
export declare const writeFormats: (formats: readonly IPivotTable.PivotFormatJSON[], styles: PivotStylesWrite) => string;
|
|
38
|
+
/**
|
|
39
|
+
* What the format ids a part cites name in the file being read, for a part carried without a
|
|
40
|
+
* model: each custom `numFmtId`'s code and each `dxfId`'s differential format, wherever they
|
|
41
|
+
* stand in it. `undefined` when it cites none the save would renumber.
|
|
42
|
+
*/
|
|
43
|
+
export declare const readPartFormats: (xml: string, styles: PivotStylesRead) => IPivotTable.PartFormatsJSON | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* A table's definition as read, with the format ids it cites restated in the save's numbering:
|
|
46
|
+
* each field's and data field's `numFmtId`, each format's `dxfId`, from the model's; for a table
|
|
47
|
+
* with no model, from what its ids named when read ({@link readPartFormats}).
|
|
48
|
+
*
|
|
49
|
+
* @remarks
|
|
50
|
+
* The save numbers number formats and differential formats afresh, so a part written as read
|
|
51
|
+
* would otherwise name another format, or none (`pivot-probes/probe-pivot-formats.ps1`,
|
|
52
|
+
* `probe-repair-open.ps1`: a `dxfId` past the save's `dxfs` is a repair on open).
|
|
53
|
+
*/
|
|
54
|
+
export declare const restatePivotTableFormats: (xml: string, json: IPivotTable.JSON, styles: PivotStylesWrite) => string;
|
|
55
|
+
/**
|
|
56
|
+
* A cache's definition as read, with each field's `numFmtId` restated in the save's numbering;
|
|
57
|
+
* for a cache with no model, from what its ids named when read ({@link readPartFormats}).
|
|
58
|
+
*/
|
|
59
|
+
export declare const restatePivotCacheFormats: (xml: string, cache: IPivotTable.CacheJSON, styles: PivotStylesWrite) => string;
|
|
60
|
+
//# sourceMappingURL=PivotFormats.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { IPivotTable } from '@sheetxl/sdk';
|
|
2
|
+
import { PivotStylesRead } from './PivotFormats';
|
|
3
|
+
/** A table's model: what {@link IPivotTable.JSON} holds besides its name, cache, location, part and buttons. */
|
|
4
|
+
export type PivotTableModel = Omit<IPivotTable.JSON, 'name' | 'cacheId' | 'location' | 'part' | 'partFormats' | 'buttons'>;
|
|
5
|
+
/** `axis` as OOXML spells it, by the model's name. */
|
|
6
|
+
export declare const AXIS_BY_NAME: {
|
|
7
|
+
readonly row: "axisRow";
|
|
8
|
+
readonly column: "axisCol";
|
|
9
|
+
readonly page: "axisPage";
|
|
10
|
+
readonly values: "axisValues";
|
|
11
|
+
};
|
|
12
|
+
/** The subtotal functions a field can show, each an attribute `<name>Subtotal`. */
|
|
13
|
+
export declare const SUBTOTALS: readonly Exclude<IPivotTable.PivotSubtotal, 'default'>[];
|
|
14
|
+
/** `baseItem`'s two positions that are not an item: the one before and the one after. */
|
|
15
|
+
export declare const BASE_ITEM_PREVIOUS = 1048828;
|
|
16
|
+
export declare const BASE_ITEM_NEXT = 1048829;
|
|
17
|
+
/** The show-values-as kinds Excel writes as the x14 extension, with no `showDataAs`. */
|
|
18
|
+
export declare const X14_SHOW_DATA_AS: ReadonlySet<string>;
|
|
19
|
+
/** The extension of a data field that holds its newer show-values-as. */
|
|
20
|
+
export declare const EXT_URI_DATA_FIELD = "{E15A36E0-9728-4e99-A89B-3F7291B0FE68}";
|
|
21
|
+
/** The extension of a field that holds its repeated labels. */
|
|
22
|
+
export declare const EXT_URI_PIVOT_FIELD = "{2946ED86-A175-432a-8AC1-64E0C546D7DE}";
|
|
23
|
+
/**
|
|
24
|
+
* A field's sort by value, Excel's `autoSortScope`: a reference to the data field, then one per
|
|
25
|
+
* item of the scope's line, in field-index order, the innermost marked `defaultSubtotal` when the
|
|
26
|
+
* line is its subtotal (`pivot-probes/probe-pivot-sort-scope.ps1`). `scope` is in axis order.
|
|
27
|
+
*/
|
|
28
|
+
export declare const autoSortScope: (dataField: number, scope?: IPivotTable.PivotSortScopeJSON) => string;
|
|
29
|
+
/**
|
|
30
|
+
* The `<location ref>` of a table's definition, or `null` when it states none.
|
|
31
|
+
*/
|
|
32
|
+
export declare const readPivotTableLocation: (xml: string) => string | null;
|
|
33
|
+
/**
|
|
34
|
+
* Reads the model of a pivot table from its definition's markup.
|
|
35
|
+
*
|
|
36
|
+
* @returns The model, or `null` when the markup holds what the model cannot answer for yet: OLAP
|
|
37
|
+
* hierarchies, item properties beyond those typed, a filter no pivot filter type spells, or an
|
|
38
|
+
* extension on a field or data field other than Excel's repeat labels and show-values-as. Such a
|
|
39
|
+
* table is carried as its part alone.
|
|
40
|
+
*
|
|
41
|
+
* @param styles What the markup's format ids name in the file.
|
|
42
|
+
*/
|
|
43
|
+
export declare const readPivotTableModel: (xml: string, styles: PivotStylesRead) => PivotTableModel | null;
|
|
44
|
+
//# sourceMappingURL=PivotTableRead.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IPivotTable } from '@sheetxl/sdk';
|
|
2
|
+
import { PivotStylesWrite } from './PivotFormats';
|
|
3
|
+
/**
|
|
4
|
+
* A modeled table's definition markup, written from the model: its remainder with what is
|
|
5
|
+
* modeled put back where the schema puts it, each setting spelled as Excel spells it.
|
|
6
|
+
*
|
|
7
|
+
* @param styles The save's ids for the formats the table cites.
|
|
8
|
+
* @param warn Told of a filter no pivot filter type spells; it is left out.
|
|
9
|
+
* @param date1904 The workbook's date system, for the window a relative date filter was evaluated over.
|
|
10
|
+
* @returns `null` when the table is not modeled.
|
|
11
|
+
*/
|
|
12
|
+
export declare const writePivotTableModel: (json: IPivotTable.JSON, styles: PivotStylesWrite, warn?: (message: string) => void, date1904?: boolean) => string | null;
|
|
13
|
+
//# sourceMappingURL=PivotTableWrite.d.ts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where an element is in `xml`: from its `<` to past its end, and its content between.
|
|
3
|
+
*/
|
|
4
|
+
export interface ElementSpan {
|
|
5
|
+
readonly start: number;
|
|
6
|
+
/** Past the open tag's `>`. */
|
|
7
|
+
readonly contentStart: number;
|
|
8
|
+
/** At the close tag's `<`; `contentStart` when the element is empty. */
|
|
9
|
+
readonly contentEnd: number;
|
|
10
|
+
readonly end: number;
|
|
11
|
+
/** The open tag's attributes, as written. */
|
|
12
|
+
readonly attributes: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The first unprefixed `<name>` at or after `from`, or `null`.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* For elements that do not contain another of their own name, as every element this is asked
|
|
19
|
+
* for is.
|
|
20
|
+
*/
|
|
21
|
+
export declare const findElement: (xml: string, name: string, from?: number, to?: number) => ElementSpan | null;
|
|
22
|
+
/** An open tag's attributes by name, decoded. */
|
|
23
|
+
export declare const parseAttributes: (attributes: string) => Map<string, string>;
|
|
24
|
+
/** `attributes` without the ones named. */
|
|
25
|
+
export declare const removeAttributes: (attributes: string, names: readonly string[]) => string;
|
|
26
|
+
/** Text for an attribute value. */
|
|
27
|
+
export declare const escapeAttribute: (value: string) => string;
|
|
28
|
+
/**
|
|
29
|
+
* `xml` with the first unprefixed `<name>`'s attributes restated as `values` says: a string sets one
|
|
30
|
+
* (in its place when written, after the others when not), `undefined` removes it. The same string,
|
|
31
|
+
* byte for byte, when each already reads as asked, so a part restated with what it holds is
|
|
32
|
+
* unchanged.
|
|
33
|
+
*/
|
|
34
|
+
export declare const restateAttributes: (xml: string, name: string, values: Readonly<Record<string, string | undefined>>) => string;
|
|
35
|
+
/** ` name="value"` per entry with a value. */
|
|
36
|
+
export declare const writeAttributes: (entries: readonly (readonly [string, string | number | undefined])[]) => string;
|
|
37
|
+
/**
|
|
38
|
+
* The serial of a cache's date text, or `null` when it is not one.
|
|
39
|
+
*
|
|
40
|
+
* @remarks
|
|
41
|
+
* A cache counts days from 1899-12-30 for every serial, with no 1900 leap day: serial 1 is
|
|
42
|
+
* `1899-12-31`, serial 61 is `1900-03-01` (`pivot-probes/probe-pivot-cache-items.ps1`,
|
|
43
|
+
* 2026-10-24). A cell's `t="d"` text follows the leap day; a cache's does not.
|
|
44
|
+
*/
|
|
45
|
+
export declare const cacheDateToSerial: (text: string, date1904: boolean) => number | null;
|
|
46
|
+
/** A serial as a cache's date text, to the second. See {@link cacheDateToSerial}. */
|
|
47
|
+
export declare const serialToCacheDate: (serial: number, date1904: boolean) => string;
|
|
48
|
+
//# sourceMappingURL=_PivotCacheXml.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ElementSpan } from './_PivotCacheXml';
|
|
2
|
+
/** Thrown inside the read for markup the model does not type; the table is carried as its part. */
|
|
3
|
+
export declare class Unmodeled extends Error {
|
|
4
|
+
}
|
|
5
|
+
export declare const unmodeled: () => never;
|
|
6
|
+
export declare const isTrue: (value: string | undefined) => boolean;
|
|
7
|
+
export declare const isFalse: (value: string | undefined) => boolean;
|
|
8
|
+
export declare const integer: (value: string | undefined) => number;
|
|
9
|
+
/** Each attribute's name must be one of `allowed`. */
|
|
10
|
+
export declare const only: (attributes: Map<string, string>, allowed: readonly string[]) => void;
|
|
11
|
+
/** The children of `span` named `name`, each self-closing, with nothing else between. */
|
|
12
|
+
export declare const children: (xml: string, span: ElementSpan, name: string) => Map<string, string>[];
|
|
13
|
+
/**
|
|
14
|
+
* The children of `span`, each an element named `name` with or without content, with nothing
|
|
15
|
+
* else between.
|
|
16
|
+
*/
|
|
17
|
+
export declare const elements: (xml: string, span: ElementSpan, name: string) => ElementSpan[];
|
|
18
|
+
/** Every child element of `span` with its name, with nothing but whitespace between. */
|
|
19
|
+
export declare const childElements: (xml: string, span: ElementSpan) => {
|
|
20
|
+
name: string;
|
|
21
|
+
span: ElementSpan;
|
|
22
|
+
}[];
|
|
23
|
+
//# sourceMappingURL=_PivotTableXml.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IWorkbook } from '@sheetxl/sdk';
|
|
2
|
+
import { FeaturePropertyBags } from './domVisitors/FeaturePropertyBagVisitor';
|
|
3
|
+
/** The `paramMap` key under which the styles part leaves its cell xfs' complement indices. */
|
|
4
|
+
export declare const XF_COMPLEMENTS_PARAM = "xfComplements";
|
|
5
|
+
/**
|
|
6
|
+
* Splits the cell-control layer back out of the xfs: Excel's per-format checkboxes become the
|
|
7
|
+
* model's anchored `cellControls`, and the styles stay styles.
|
|
8
|
+
*
|
|
9
|
+
* Excel stores a checkbox on the cell's xf (`xfComplement` → the feature property bags), the model
|
|
10
|
+
* keeps it apart. Runs after `applyHeaderStyles`, so `directStyles` already holds every cell's
|
|
11
|
+
* resolved xf as runs (a cell's own over its row's over its column's); each run whose xf carries a
|
|
12
|
+
* control becomes a range of that control, one entry per control per sheet, never a per-cell walk.
|
|
13
|
+
*
|
|
14
|
+
* xf 0 is skipped: it is the format of every unstyled cell, and a control there would cover the
|
|
15
|
+
* whole sheet.
|
|
16
|
+
*/
|
|
17
|
+
export declare const applyCellControls: (jsonWB: IWorkbook.JSON, xfComplements: ReadonlyMap<number, number> | undefined, bags: FeaturePropertyBags | undefined) => void;
|
|
18
|
+
//# sourceMappingURL=CellControls.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IDocumentProperties } from '@sheetxl/sdk';
|
|
2
|
+
import { CustomPropertyEntry } from './domVisitors/AppPropertiesVisitor';
|
|
3
|
+
/** A `docProps` child as the property visitors read it: its local name and text. */
|
|
4
|
+
interface PropertyEntry {
|
|
5
|
+
key: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The workbook's document properties from the three parts' property lists, or `undefined` when
|
|
10
|
+
* they hold none.
|
|
11
|
+
*
|
|
12
|
+
* @param warn Told about each custom property that is dropped.
|
|
13
|
+
*/
|
|
14
|
+
export declare const readDocumentProperties: (core: PropertyEntry[] | undefined, app: PropertyEntry[] | undefined, custom?: CustomPropertyEntry[], warn?: (message: string, onceKey: string) => void) => IDocumentProperties.JSON | undefined;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=DocumentPropertiesRead.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { INamed, ITypes, IWorkbook } from '@sheetxl/sdk';
|
|
2
2
|
/** What a cell's `<f>` turned out to be. */
|
|
3
3
|
export type Unwrapped =
|
|
4
4
|
/** Not a wrapper — use the text as-is. */
|
|
@@ -12,21 +12,12 @@ export type Unwrapped =
|
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* A cell the original spilled INTO. It has no formula of its own and its cached value belongs to
|
|
15
|
-
* the anchor's result, so
|
|
16
|
-
* restored anchor from spilling and turn it into `#SPILL!`.
|
|
15
|
+
* the anchor's result, so it has to end up inside the anchor's extent — a plain value there would
|
|
16
|
+
* block the restored anchor from spilling and turn it into `#SPILL!`.
|
|
17
17
|
*/
|
|
18
18
|
| {
|
|
19
19
|
kind: 'spilled';
|
|
20
20
|
};
|
|
21
|
-
/** A wrapped cell found during parsing, resolved later by {@link applyDummyFunctionUnwrap}. */
|
|
22
|
-
export interface DummyWrapRecord {
|
|
23
|
-
/** Identity of the sheet's parse-time JSON; the reader maps it to the constructed sheet. */
|
|
24
|
-
sheet: object;
|
|
25
|
-
rowIndex: number;
|
|
26
|
-
colIndex: number;
|
|
27
|
-
/** The original formula text, or `null` when this cell is a spilled-into placeholder. */
|
|
28
|
-
formula: string | null;
|
|
29
|
-
}
|
|
30
21
|
/**
|
|
31
22
|
* Classifies a raw `<f>` text.
|
|
32
23
|
*
|
|
@@ -40,19 +31,48 @@ export declare const unwrapDummyFunction: (text: string) => Unwrapped;
|
|
|
40
31
|
* cannot be mistaken for a call, which is the whole reason this is not a regex.
|
|
41
32
|
*/
|
|
42
33
|
export declare const extractFunctionNames: (text: string) => string[];
|
|
34
|
+
/** Whether a function called by a wrapped formula can run in the workbook being read. */
|
|
35
|
+
export type IsKnownFunction = (name: string) => boolean;
|
|
36
|
+
/**
|
|
37
|
+
* The functions a workbook will have, answered before it exists: the built-in declarations, the
|
|
38
|
+
* file's defined names, and the functions the caller is supplying to it.
|
|
39
|
+
*/
|
|
40
|
+
export declare const createIsKnownFunction: (names: readonly INamed.JSON[] | undefined, providers: IWorkbook.ConstructorOptions["functions"]) => IsKnownFunction;
|
|
43
41
|
/**
|
|
44
|
-
*
|
|
42
|
+
* Whether a wrapped formula calls a volatile function. The wrapper does not say so: to Excel it is
|
|
43
|
+
* a call to one unknown function.
|
|
44
|
+
*/
|
|
45
|
+
export declare const callsVolatileFunction: (formula: string) => boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Decides, one wrapper at a time as a sheet's cells are read, what each becomes.
|
|
48
|
+
*
|
|
49
|
+
* A wrapper whose functions are all known becomes the formula it wrapped, and a spilling one a
|
|
50
|
+
* dynamic array over the cached values of its placeholders. That is what the model loads for any
|
|
51
|
+
* stored array formula, so it opens with the file's values and is evaluated for the same reasons.
|
|
45
52
|
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* wrapper at least still shows the right answer. So a wrapper naming anything unknown (a Sheets
|
|
50
|
-
* function we do not implement, a UDF this session has not registered) is left exactly as it was.
|
|
53
|
+
* A wrapper naming anything unknown (a Sheets function we do not implement, a UDF nobody supplied)
|
|
54
|
+
* stays as it is, along with its placeholders: unwrapped, it would be `#NAME?` the first time it
|
|
55
|
+
* ran, and the wrapper keeps the right value on screen and in the next save.
|
|
51
56
|
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* and
|
|
55
|
-
*
|
|
57
|
+
* The cells arrive in reading order, so an anchor precedes its placeholders. Only the placeholder
|
|
58
|
+
* side needs looking up: a block is rectangular, so its first row is what runs right of the anchor,
|
|
59
|
+
* and each later row sits under the one above. A block's own column takes a placeholder ahead of a
|
|
60
|
+
* neighbor's row, because a scalar wrapper beside a spill is the usual reason the two ever touch.
|
|
56
61
|
*/
|
|
57
|
-
export declare
|
|
62
|
+
export declare class DummyFunctionRestorer {
|
|
63
|
+
private _isKnown;
|
|
64
|
+
private _restored;
|
|
65
|
+
/** The block last seen in each column. */
|
|
66
|
+
private _byColumn;
|
|
67
|
+
constructor(isKnown: IsKnownFunction);
|
|
68
|
+
/** Whether the wrapped formula at this cell is restored. A cell is asked about at most once. */
|
|
69
|
+
anchor(rowIndex: number, colIndex: number, formula: string): boolean;
|
|
70
|
+
/** Whether the placeholder at this cell belongs to a restored block. */
|
|
71
|
+
placeholder(rowIndex: number, colIndex: number): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Every restored block, whether it spilled or not. An unmarked formula is a legacy one to the
|
|
74
|
+
* load, and would have its `@`s put back; the text in a wrapper was never spelled that way.
|
|
75
|
+
*/
|
|
76
|
+
getFormulaArray(): [ref: string, kind: ITypes.FormulaArrayKind][];
|
|
77
|
+
}
|
|
58
78
|
//# sourceMappingURL=DummyFunctionUnwrap.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IWorkbook } from '@sheetxl/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Moves `<col style>` and `<row s customFormat>` off the headers and into each sheet's direct styles,
|
|
4
|
+
* as whole-column and whole-row ranges.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* Where they cross, a cell's own style wins over its row's, and a row's over its column's: Excel
|
|
8
|
+
* resolves a cell with no `<c>` from its row first. A cell the file lists with no style is Normal
|
|
9
|
+
* there (the sheet visitor records it as style 0), while an unstyled block with nothing over it is
|
|
10
|
+
* dropped.
|
|
11
|
+
*
|
|
12
|
+
* Runs after `applyHiddenFormulas`, which counts the header styles a sheet uses.
|
|
13
|
+
*/
|
|
14
|
+
export declare const applyHeaderStyles: (jsonWB: IWorkbook.JSON) => void;
|
|
15
|
+
//# sourceMappingURL=HeaderStyles.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading a `t="d"` cell: an ISO 8601 date, time, date-time or duration (ECMA-376 §18.17.4).
|
|
3
|
+
*
|
|
4
|
+
* Excel never writes these, but openpyxl does when `wb.iso_dates` is set, and so does pandas
|
|
5
|
+
* through it. The model holds dates as serials, so the text becomes one here.
|
|
6
|
+
*
|
|
7
|
+
* The fields are taken as wall clock: a `Z` or a `±hh:mm` offset is accepted and ignored, which
|
|
8
|
+
* is what openpyxl does on read. Nothing goes through a JS `Date`, which would bring a timezone in
|
|
9
|
+
* and cannot express Excel's phantom `1900-02-29`.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* The serial for a `t="d"` cell's text, or `null` when the text is not one of the ISO forms or names
|
|
13
|
+
* a moment the date system cannot hold (before its epoch). The caller keeps the text then, so
|
|
14
|
+
* nothing is lost.
|
|
15
|
+
*
|
|
16
|
+
* @param text The cell's `<v>` text.
|
|
17
|
+
* @param date1904 Whether the workbook uses the 1904 date system.
|
|
18
|
+
*/
|
|
19
|
+
export declare const isoDateToSerial: (text: string, date1904?: boolean) => number | null;
|
|
20
|
+
//# sourceMappingURL=IsoDateCell.d.ts.map
|