@sheetxl/io-xlsx 0.8.0-beta.10 → 0.8.0-beta.12
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/{BLXcoiDAaOMjFuhw.mjs → 9dwUocbOsJuAcmKn.mjs} +3021 -1986
- package/browser/esm/{xc_LzCPgHn-acgFZ.mjs → BIvDjK4Zl8bWRgl8.mjs} +2 -2
- package/browser/esm/CcH5ITJFTMVWUJO9.mjs +6154 -0
- package/browser/esm/{CI_CZI5m5-KkiAK5.mjs → D8k22TSWPd_RHEpj.mjs} +1798 -1009
- package/browser/esm/{BKT8OBj-bhQwdg49.mjs → DKnOwucZq4z9_-r-.mjs} +47 -10
- package/browser/esm/{2EOdn2WRK5y1L58S.mjs → DO75RoAQTgMuVzXv.mjs} +2 -2
- package/browser/esm/{NQIuOQIleHC4NUW6.mjs → DVLJTjJCGqrJUa8c.mjs} +587 -705
- package/browser/esm/DeMZN_qj__PKo4Wh.mjs +2265 -0
- package/browser/esm/{DXopGe8PrLWmwGaV.mjs → DsppUz-14Z7ti9i3.mjs} +1 -1
- package/browser/esm/{B-jb5SuiVh5NnBG_.mjs → aUBXbTh2r0u3x4Xo.mjs} +2 -2
- package/browser/esm/index.mjs +2 -2
- package/node/esm/BmIIQODk4dBVIXA4.mjs +4455 -0
- package/node/esm/{CHqRP_NjPpPd7m9L.mjs → C-e5AO_4TnGywT-m.mjs} +1 -1
- package/node/esm/C78E45n6j2E8rruH.mjs +5694 -0
- package/node/esm/CDKm5s3JE_d99TJw.mjs +2369 -0
- package/node/esm/{BmdmvgO5Zdgx-RWo.mjs → DCaAOfuW-w_dx_qd.mjs} +2 -2
- package/node/esm/{O5mti2R9drFOlXc7.mjs → DSgxL0sBZtWMydVl.mjs} +2 -2
- package/node/esm/DXusvwW73FUDSyvD.mjs +6367 -0
- package/node/esm/DsyuWxk3bdGhJUQN.mjs +2346 -0
- package/node/esm/index.mjs +64 -27
- package/package.json +3 -3
- package/types/src/AutoFilterRules.d.ts +8 -1
- package/types/src/DataTableFormula.d.ts +36 -0
- package/types/src/DefinedNameAttributes.d.ts +8 -0
- package/types/src/ExcelCompat.d.ts +15 -3
- package/types/src/KnownFonts.d.ts +50 -0
- package/types/src/LegacyFormula.d.ts +13 -0
- package/types/src/PageLayoutAttributes.d.ts +8 -0
- package/types/src/Plugin.d.ts +12 -0
- package/types/src/ProtectionAttributes.d.ts +2 -2
- package/types/src/SheetKinds.d.ts +57 -0
- package/types/src/SheetViewAttributes.d.ts +4 -0
- package/types/src/SortExtent.d.ts +16 -0
- package/types/src/Types.d.ts +11 -0
- package/types/src/XlsxHeader.d.ts +19 -0
- package/types/src/chart/ChartExXml.d.ts +38 -0
- package/types/src/chart/ChartPartXml.d.ts +47 -0
- package/types/src/chart/ChartSpaceXml.d.ts +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 +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/CellControls.d.ts +18 -0
- package/types/src/reader/DocumentPropertiesRead.d.ts +16 -0
- package/types/src/reader/DummyFunctionUnwrap.d.ts +2 -2
- package/types/src/reader/HeaderStyles.d.ts +15 -0
- package/types/src/reader/IsoDateCell.d.ts +20 -0
- package/types/src/reader/LibreOfficeDataTable.d.ts +12 -0
- package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +13 -1
- package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +3 -3
- package/types/src/reader/domVisitors/CommentVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +3 -1
- package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +23 -8
- package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +1 -1
- package/types/src/reader/domVisitors/FeaturePropertyBagVisitor.d.ts +27 -0
- 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 +8 -0
- package/types/src/reader/domVisitors/SortStateVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/_Dxfs.d.ts +10 -0
- package/types/src/reader/domVisitors/index.d.ts +4 -34
- package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts +1 -0
- package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +46 -6
- package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +24 -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 +42 -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 +4 -4
- package/types/src/utils/SharedNames.d.ts +13 -0
- package/types/src/utils/SpreadsheetFont.d.ts +38 -0
- package/types/src/utils/VmlNoteShapes.d.ts +16 -23
- package/types/src/utils/VmlNoteStyle.d.ts +44 -0
- package/types/src/utils/VmlPrefixes.d.ts +24 -0
- package/types/src/writer/builder/PackageBuilder.d.ts +2 -0
- package/types/src/writer/builder/Types.d.ts +7 -0
- package/types/src/writer/emitters/CommentsEmitter.d.ts +3 -3
- package/types/src/writer/emitters/DrawingEmitter.d.ts +2 -2
- package/types/src/writer/emitters/FeaturePropertyBagEmitter.d.ts +18 -0
- package/types/src/writer/emitters/LegacyDrawingEmitter.d.ts +4 -4
- package/types/src/writer/emitters/PropsCoreEmitter.d.ts +7 -2
- package/types/src/writer/emitters/PropsCustomEmitter.d.ts +15 -0
- package/types/src/writer/emitters/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 +8 -5
- package/types/src/writer/emitters/StylesEmitter.d.ts +2 -0
- package/types/src/writer/emitters/WorkbookEmitter.d.ts +5 -0
- package/types/src/writer/emitters/WorksheetEmitter.d.ts +4 -3
- package/types/src/writer/utils/AutoFilter.d.ts +1 -1
- package/types/src/writer/utils/CellControlComplements.d.ts +29 -0
- package/types/src/writer/utils/DefaultRows.d.ts +38 -0
- package/types/src/writer/utils/DxfCollector.d.ts +11 -8
- package/types/src/writer/utils/HiddenFormulaXfs.d.ts +1 -1
- package/types/src/writer/utils/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/browser/esm/BPmehfSqdvgsLBsB.mjs +0 -5153
- package/node/esm/BpxxiZ2oKPkUSfdB.mjs +0 -2486
- package/node/esm/CtAF486aZqYzMeLM.mjs +0 -3651
- package/node/esm/QS_theNoeqNGLStj.mjs +0 -5298
- package/node/esm/nNQ7MG89sGKwkjMA.mjs +0 -4649
- 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
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { IGroup, IMovable, IShape } from '@sheetxl/sdk';
|
|
1
|
+
import { IGroup, IMovable, IShape, ITheme } from '@sheetxl/sdk';
|
|
2
2
|
import { Visitor, ExecutionContext } from '../dom';
|
|
3
|
+
/** Every reference a `style` element states, defaults included. */
|
|
4
|
+
export declare const readStyleRefsElement: (context: ExecutionContext, elemStyle: Element) => ITheme.StyleRefsJSON;
|
|
3
5
|
export declare class DrawingElementVisitor implements Visitor {
|
|
4
6
|
visit(context: ExecutionContext, elem: Element, json: IMovable.JSON): IMovable.JSON | undefined;
|
|
5
7
|
/** A `cNvPr`'s title and hyperlinks onto the JSON that will hold the content's identity. */
|
|
@@ -2,13 +2,13 @@ import { IMovable } from '@sheetxl/sdk';
|
|
|
2
2
|
import { Visitor, ExecutionContext } from '../dom';
|
|
3
3
|
import { DrawingElementVisitor } from './DrawingElementVisitor';
|
|
4
4
|
/**
|
|
5
|
-
* A `graphicFrame`: a chart (
|
|
5
|
+
* A `graphicFrame`: a chart (its part read into its model), a slicer, or another graphic,
|
|
6
6
|
* placed by a movable or a member of a group.
|
|
7
7
|
*/
|
|
8
8
|
export declare class DrawingGraphicFrameVisitor extends DrawingElementVisitor implements Visitor {
|
|
9
9
|
visit(context: ExecutionContext, elem: Element, json: IMovable.JSON): any;
|
|
10
10
|
/**
|
|
11
|
-
* The content a frame's `graphic/graphicData` names: a chart as its
|
|
11
|
+
* The content a frame's `graphic/graphicData` names: a chart as its model and part,
|
|
12
12
|
* a slicer or anything else by its relationship.
|
|
13
13
|
*/
|
|
14
14
|
protected readGraphic(context: ExecutionContext, elem: Element): IMovable.ContentJSON<any>;
|
|
@@ -1,20 +1,35 @@
|
|
|
1
|
-
import { IMovable } from '@sheetxl/sdk';
|
|
1
|
+
import { IMovable, IPicture } from '@sheetxl/sdk';
|
|
2
2
|
import { Visitor, ExecutionContext } from '../dom';
|
|
3
3
|
import { DrawingElementVisitor } from './DrawingElementVisitor';
|
|
4
4
|
/**
|
|
5
5
|
* A `pic`: the picture content of a movable, or of a member of a group.
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* What the element itself states — its image and how it fills the frame, its non-visual
|
|
9
|
+
* properties and locks — is read here onto the picture's JSON; its frame properties (the shape
|
|
10
|
+
* it is cropped to, a fill behind the image, a border, effects) are read into the same JSON by
|
|
11
|
+
* the `spPr` visitor the walker runs over its children, and what that reads of placement is
|
|
12
|
+
* hoisted onto the movable afterwards. A member of a group is read the same way, as a movable of
|
|
13
|
+
* the group's `members`.
|
|
11
14
|
*/
|
|
12
15
|
export declare class DrawingPicVisitor extends DrawingElementVisitor implements Visitor {
|
|
13
|
-
visit(context: ExecutionContext, elem: Element, jsonHandle: IMovable.JSON):
|
|
16
|
+
visit(context: ExecutionContext, elem: Element, jsonHandle: IMovable.JSON): any;
|
|
14
17
|
/**
|
|
15
|
-
* The
|
|
16
|
-
*
|
|
18
|
+
* The image (`blipFill`), the macro and publish flag, the resize preference and the locks onto
|
|
19
|
+
* the content; the aspect lock onto the movable too, as a shape's is.
|
|
17
20
|
*/
|
|
18
|
-
protected
|
|
21
|
+
protected readPictureDetails(context: ExecutionContext, elem: Element, image: PictureImage | undefined, movable: IMovable.JSON, content: IPicture.JSON): void;
|
|
22
|
+
/**
|
|
23
|
+
* The picture's image and how it fills the frame: the `blipFill` read as an image fill is.
|
|
24
|
+
* `undefined` when the element has no `blip`, `null` when the blip names no relationship
|
|
25
|
+
* (warned once). The whole image stretched over the whole frame is the default and is left out.
|
|
26
|
+
*/
|
|
27
|
+
protected readImage(context: ExecutionContext, elem: Element): PictureImage | null | undefined;
|
|
28
|
+
}
|
|
29
|
+
/** What a `blipFill` gives a picture: its image as a resource, and how it fills the frame. */
|
|
30
|
+
interface PictureImage {
|
|
31
|
+
resId: number | undefined;
|
|
32
|
+
image: IPicture.ImageJSON | undefined;
|
|
19
33
|
}
|
|
34
|
+
export {};
|
|
20
35
|
//# sourceMappingURL=DrawingPicVisitor.d.ts.map
|
|
@@ -23,7 +23,7 @@ export declare class ExternalLinkVisitor implements Visitor {
|
|
|
23
23
|
* Cached types measured across the bench corpus are `n`, `str`, `b`, `e` — strings are inline in
|
|
24
24
|
* `<v>`, never an sst index (design doc §1). Mirrors `WorksheetVisitor`'s scalar coercion for `n`
|
|
25
25
|
* / `b` / `e`; `str` here is the literal value (unlike a live sheet's `str`, which is a formula
|
|
26
|
-
* marker whose text lives elsewhere), so it needs no `{t,v}` wrapper — `
|
|
26
|
+
* marker whose text lives elsewhere), so it needs no `{t,v}` wrapper — `Scalar.JSON`'s untyped arm
|
|
27
27
|
* is a bare JS primitive, self-typed at runtime.
|
|
28
28
|
*/
|
|
29
29
|
private _readCellValue;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ICellControl } from '@sheetxl/sdk';
|
|
2
|
+
import { Visitor, ExecutionContext } from '../dom';
|
|
3
|
+
/**
|
|
4
|
+
* What `xl/featurePropertyBag/featurePropertyBag.xml` says the cell xfs' complements are.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* `controls[i]` is the control an xf with `xfComplement i="i"` carries, or `null` when the chain
|
|
8
|
+
* names something SheetXL does not read (a foreign bag type is warned about, and its cells keep
|
|
9
|
+
* their values).
|
|
10
|
+
*/
|
|
11
|
+
export interface FeaturePropertyBags {
|
|
12
|
+
controls: (ICellControl.JSON | null)[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Reads the feature property bags into the controls their complements stand for.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* The chain (measured 2026-10-27, `checkbox.xlsx`): the `XFComplements` bag's
|
|
19
|
+
* `MappedFeaturePropertyBags` array lists `XFComplement` bags, by position among all bags; each
|
|
20
|
+
* names an `XFControls` bag (`k="XFControls"`), which names the control bag (`k="CellControl"`),
|
|
21
|
+
* whose type is the control (`Checkbox`).
|
|
22
|
+
*/
|
|
23
|
+
export declare class FeaturePropertyBagVisitor implements Visitor {
|
|
24
|
+
visit(context: ExecutionContext, elem: Element, jsonParent: any): FeaturePropertyBags;
|
|
25
|
+
private _readBag;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=FeaturePropertyBagVisitor.d.ts.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ITheme
|
|
1
|
+
import { ITheme } from '@sheetxl/sdk';
|
|
2
2
|
import { Visitor, ExecutionContext } from '../dom';
|
|
3
3
|
export declare class FontSchemeVisitor implements Visitor {
|
|
4
4
|
visit(context: ExecutionContext, elemParent: Element, jsonParent: ITheme.JSON): ITheme.FontSchemeJSON;
|
|
5
|
-
|
|
5
|
+
/** A `majorFont`/`minorFont`: the latin, East Asian and complex-script fonts, then the fonts by script. */
|
|
6
|
+
processFontCollection(context: ExecutionContext, elem: Element): ITheme.FontCollectionJSON | undefined;
|
|
6
7
|
}
|
|
7
8
|
//# sourceMappingURL=FontSchemeVisitor.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IShape, ITheme } from '@sheetxl/sdk';
|
|
2
|
+
import { Visitor, ExecutionContext } from '../dom';
|
|
3
|
+
/**
|
|
4
|
+
* A theme's `objectDefaults`: each of `spDef`, `lnDef` and `txDef` read as the shape JSON it gives a
|
|
5
|
+
* new object, its style references in full.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ObjectDefaultsVisitor implements Visitor {
|
|
8
|
+
visit(context: ExecutionContext, elemParent: Element, jsonParent: ITheme.JSON): object;
|
|
9
|
+
processDefault(context: ExecutionContext, elemDef: Element): IShape.JSON;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=ObjectDefaultsVisitor.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IFill, IBorders,
|
|
1
|
+
import { IFill, IBorders, IFontStyle } from '@sheetxl/sdk';
|
|
2
2
|
import { Visitor, ExecutionContext } from '../dom';
|
|
3
3
|
export declare class SheetColorContainerVisitor implements Visitor {
|
|
4
4
|
visit(_context: ExecutionContext, _elemParent: Element, _jsonParent: any): any;
|
|
@@ -7,7 +7,7 @@ export declare class SheetColorContainerVisitor implements Visitor {
|
|
|
7
7
|
*/
|
|
8
8
|
processDataBarColor(context: ExecutionContext, elemColor: Element, jsonParent: any, key: string, auto?: string): any;
|
|
9
9
|
processFonts(context: ExecutionContext, elem: Element, jsonParent: any): any;
|
|
10
|
-
processFont(context: ExecutionContext, elem: Element, jsonFont:
|
|
10
|
+
processFont(context: ExecutionContext, elem: Element, jsonFont: IFontStyle.Properties<string>): any;
|
|
11
11
|
processFills(context: ExecutionContext, elem: Element, jsonParent: any): any;
|
|
12
12
|
processFill(context: ExecutionContext, elem: Element, jsonParent: any, index: number): any;
|
|
13
13
|
processGradientFill(context: ExecutionContext, elem: Element, jsonParent: IFill.GradientJSON): any;
|
|
@@ -3,6 +3,8 @@ import { Visitor, ExecutionContext } from '../dom';
|
|
|
3
3
|
import { SheetColorContainerVisitor } from './SheetColorContainerVisitor';
|
|
4
4
|
export declare class SheetStyleVisitor extends SheetColorContainerVisitor implements Visitor {
|
|
5
5
|
visit(context: ExecutionContext, elem: Element, jsonParent: IStyleCollection.JSON): any;
|
|
6
|
+
/** The font of the Normal style (`builtinId` 0): its named xf's `fontId`, 0 when not stated. */
|
|
7
|
+
normalFontId(context: ExecutionContext, elem: Element): number;
|
|
6
8
|
processIndexColors(context: ExecutionContext, elem: Element, jsonParent: any): void;
|
|
7
9
|
processMruColors(context: ExecutionContext, elem: Element, jsonParent: any): void;
|
|
8
10
|
processNumFmts(context: ExecutionContext, elem: Element, _jsonParent: any[] | null): void;
|
|
@@ -14,6 +16,12 @@ export declare class SheetStyleVisitor extends SheetColorContainerVisitor implem
|
|
|
14
16
|
* the sheets are read (`applyHiddenFormulas`), since a format alone cannot say it.
|
|
15
17
|
*/
|
|
16
18
|
collectHiddenXfs(elem: Element): Set<number>;
|
|
19
|
+
/**
|
|
20
|
+
* The cell xfs whose `extLst` carries an `xfComplement`, by xf index, with the complement index.
|
|
21
|
+
* They become cell controls once the sheets and the feature property bags are read
|
|
22
|
+
* (`applyCellControls`); the style itself does not keep them.
|
|
23
|
+
*/
|
|
24
|
+
collectXfComplements(elem: Element): Map<number, number>;
|
|
17
25
|
processProtection(context: ExecutionContext, elem: Element, jsonParent: any): any;
|
|
18
26
|
processDXF(context: ExecutionContext, elem: Element, jsonParent: ICellStyle.JSON): any;
|
|
19
27
|
processDXFs(context: ExecutionContext, elem: Element, jsonParent: any[]): any;
|
|
@@ -2,7 +2,7 @@ import { IRange, ITable, ISort } from '@sheetxl/sdk';
|
|
|
2
2
|
import { Visitor, ExecutionContext } from '../dom';
|
|
3
3
|
export declare class SortStateVisitor implements Visitor {
|
|
4
4
|
visit(context: ExecutionContext, elem: Element, jsonParent: ITable.JSON): ISort.JSON | undefined;
|
|
5
|
-
processSortCondition(context: ExecutionContext, elem: Element, refRange: IRange.Coords, defaultCriteria: ISort.Criteria): ISort.Options | null | undefined;
|
|
6
|
-
processSortConditions(context: ExecutionContext, elem: Element, sorts: ISort.Options[], refRange: IRange.Coords, defaultCriteria: ISort.Criteria): void;
|
|
5
|
+
processSortCondition(context: ExecutionContext, elem: Element, refRange: IRange.Coords, defaultCriteria: ISort.Criteria, conditionRefs?: IRange.Coords[]): ISort.Options | null | undefined;
|
|
6
|
+
processSortConditions(context: ExecutionContext, elem: Element, sorts: ISort.Options[], refRange: IRange.Coords, defaultCriteria: ISort.Criteria, conditionRefs?: IRange.Coords[]): void;
|
|
7
7
|
}
|
|
8
8
|
//# sourceMappingURL=SortStateVisitor.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IRange,
|
|
1
|
+
import { IRange, IWorksheet } from '@sheetxl/sdk';
|
|
2
2
|
import { Visitor, ExecutionContext } from '../dom';
|
|
3
3
|
export declare class ThreadedCommentsVisitor implements Visitor {
|
|
4
|
-
visit(context: ExecutionContext, elem: Element, jsonParent:
|
|
4
|
+
visit(context: ExecutionContext, elem: Element, jsonParent: IWorksheet.JSON): IRange.JSONReferenceEntry<any>[] | undefined;
|
|
5
5
|
}
|
|
6
6
|
//# sourceMappingURL=ThreadedCommentsVisitor.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ICellStyle } from '@sheetxl/sdk';
|
|
2
|
+
import { ExecutionContext } from '../dom';
|
|
3
|
+
/**
|
|
4
|
+
* The format an element's `dxfId` names, for a color filter or sort, read from the styles part's
|
|
5
|
+
* `<dxfs>` (`SheetStyleVisitor.processDXFs`).
|
|
6
|
+
*
|
|
7
|
+
* @returns `undefined` without a `dxfId`; `{}` when the id is not in the table.
|
|
8
|
+
*/
|
|
9
|
+
export declare const readDxfAttribute: (context: ExecutionContext, elem: Element) => ICellStyle.Properties | undefined;
|
|
10
|
+
//# sourceMappingURL=_Dxfs.d.ts.map
|
|
@@ -1,27 +1,13 @@
|
|
|
1
1
|
import { RelsVisitor } from './RelsVisitor';
|
|
2
2
|
import { CorePropertiesVisitor } from './CorePropertiesVisitor';
|
|
3
3
|
import { AppPropertiesVisitor } from './AppPropertiesVisitor';
|
|
4
|
-
import { ChartSpaceVisitor } from './ChartSpaceVisitor';
|
|
5
|
-
import { ChartVisitor } from './ChartVisitor';
|
|
6
|
-
import { PlotAreaVisitor } from './PlotAreaVisitor';
|
|
7
4
|
import { ShapePropertiesVisitor } from './ShapePropertiesVisitor';
|
|
8
|
-
import { BarChartTypeVisitor } from './BarChartTypeVisitor';
|
|
9
|
-
import { ChartTypeVisitor } from './ChartTypeVisitor';
|
|
10
|
-
import { DataLabelsVisitor } from './DataLabelsVisitor';
|
|
11
|
-
import { SeriesVisitor } from './SeriesVisitor';
|
|
12
|
-
import { DataPointVisitor } from './DataPointVisitor';
|
|
13
|
-
import { MarkerVisitor } from './MarkerVisitor';
|
|
14
|
-
import { AxisVisitor } from './AxisVisitor';
|
|
15
5
|
import { TextPropertiesVisitor } from './TextPropertiesVisitor';
|
|
16
6
|
import { ShapeTextVisitor } from './ShapeTextVisitor';
|
|
17
|
-
import { LegendEntryVisitor } from './LegendEntryVisitor';
|
|
18
|
-
import { LegendVisitor } from './LegendVisitor';
|
|
19
|
-
import { NegativeShapeVisitor } from './NegativeShapeVisitor';
|
|
20
|
-
import { TitleVisitor } from './TitleVisitor';
|
|
21
|
-
import { LayoutVisitor } from './LayoutVisitor';
|
|
22
7
|
import { ThemeVisitor } from './ThemeVisitor';
|
|
23
8
|
import { ClrSchemeVisitor } from './ClrSchemeVisitor';
|
|
24
9
|
import { FontSchemeVisitor } from './FontSchemeVisitor';
|
|
10
|
+
import { ObjectDefaultsVisitor } from './ObjectDefaultsVisitor';
|
|
25
11
|
import { FmtSchemeVisitor } from './FmtSchemeVisitor';
|
|
26
12
|
import { AutoFilterVisitor } from './AutoFilterVisitor';
|
|
27
13
|
import { SortStateVisitor } from './SortStateVisitor';
|
|
@@ -41,8 +27,7 @@ import { DrawingPicVisitor } from './DrawingPicVisitor';
|
|
|
41
27
|
import { DrawingGrpSpVisitor } from './DrawingGrpSpVisitor';
|
|
42
28
|
import { DrawingCxnSpVisitor } from './DrawingCxnSpVisitor';
|
|
43
29
|
import { MetadataVisitor } from './MetadataVisitor';
|
|
44
|
-
import {
|
|
45
|
-
import { RichValueDataVisitor } from './RichValueDataVisitor';
|
|
30
|
+
import { FeaturePropertyBagVisitor } from './FeaturePropertyBagVisitor';
|
|
46
31
|
import { CommentsVisitor } from './CommentsVisitor';
|
|
47
32
|
import { CommentVisitor } from './CommentVisitor';
|
|
48
33
|
import { ThreadedCommentsVisitor } from './ThreadedCommentsVisitor';
|
|
@@ -52,27 +37,13 @@ export declare const BuiltInVisitors: {
|
|
|
52
37
|
RelsVisitor: typeof RelsVisitor;
|
|
53
38
|
CorePropertiesVisitor: typeof CorePropertiesVisitor;
|
|
54
39
|
AppPropertiesVisitor: typeof AppPropertiesVisitor;
|
|
55
|
-
ChartSpaceVisitor: typeof ChartSpaceVisitor;
|
|
56
|
-
ChartVisitor: typeof ChartVisitor;
|
|
57
|
-
PlotAreaVisitor: typeof PlotAreaVisitor;
|
|
58
40
|
ShapePropertiesVisitor: typeof ShapePropertiesVisitor;
|
|
59
|
-
BarChartTypeVisitor: typeof BarChartTypeVisitor;
|
|
60
|
-
ChartTypeVisitor: typeof ChartTypeVisitor;
|
|
61
|
-
DataLabelsVisitor: typeof DataLabelsVisitor;
|
|
62
|
-
SeriesVisitor: typeof SeriesVisitor;
|
|
63
|
-
DataPointVisitor: typeof DataPointVisitor;
|
|
64
|
-
MarkerVisitor: typeof MarkerVisitor;
|
|
65
|
-
AxisVisitor: typeof AxisVisitor;
|
|
66
41
|
TextPropertiesVisitor: typeof TextPropertiesVisitor;
|
|
67
42
|
ShapeTextVisitor: typeof ShapeTextVisitor;
|
|
68
|
-
LegendEntryVisitor: typeof LegendEntryVisitor;
|
|
69
|
-
LegendVisitor: typeof LegendVisitor;
|
|
70
|
-
NegativeShapeVisitor: typeof NegativeShapeVisitor;
|
|
71
|
-
TitleVisitor: typeof TitleVisitor;
|
|
72
|
-
LayoutVisitor: typeof LayoutVisitor;
|
|
73
43
|
ThemeVisitor: typeof ThemeVisitor;
|
|
74
44
|
ClrSchemeVisitor: typeof ClrSchemeVisitor;
|
|
75
45
|
FontSchemeVisitor: typeof FontSchemeVisitor;
|
|
46
|
+
ObjectDefaultsVisitor: typeof ObjectDefaultsVisitor;
|
|
76
47
|
FmtSchemeVisitor: typeof FmtSchemeVisitor;
|
|
77
48
|
AutoFilterVisitor: typeof AutoFilterVisitor;
|
|
78
49
|
SortStateVisitor: typeof SortStateVisitor;
|
|
@@ -92,8 +63,7 @@ export declare const BuiltInVisitors: {
|
|
|
92
63
|
DrawingGrpSpVisitor: typeof DrawingGrpSpVisitor;
|
|
93
64
|
DrawingCxnSpVisitor: typeof DrawingCxnSpVisitor;
|
|
94
65
|
MetadataVisitor: typeof MetadataVisitor;
|
|
95
|
-
|
|
96
|
-
RichValueDataVisitor: typeof RichValueDataVisitor;
|
|
66
|
+
FeaturePropertyBagVisitor: typeof FeaturePropertyBagVisitor;
|
|
97
67
|
CommentsVisitor: typeof CommentsVisitor;
|
|
98
68
|
CommentVisitor: typeof CommentVisitor;
|
|
99
69
|
ThreadedCommentsVisitor: typeof ThreadedCommentsVisitor;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IRichText, IFontStyle } from '@sheetxl/sdk';
|
|
1
2
|
import { SaxParser } from '../sax';
|
|
2
3
|
/**
|
|
3
4
|
* Streaming SAX handler for `xl/sharedStrings.xml`, a flat repeated structure:
|
|
@@ -10,13 +11,52 @@ import { SaxParser } from '../sax';
|
|
|
10
11
|
* ```
|
|
11
12
|
*
|
|
12
13
|
* We collect all `<t>` text while inside an `<si>` and emit the concatenated,
|
|
13
|
-
* unescaped string when the `<si>` closes
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* (`<rPh>`/`<phoneticPr>`) are skipped so they don't leak into the value.
|
|
14
|
+
* unescaped string when the `<si>` closes, with the runs when the string has any
|
|
15
|
+
* (`<r>` with its `<rPr>`, read as the font properties it sets, as a note's runs are).
|
|
16
|
+
* Phonetic guides (`<rPh>`/`<phoneticPr>`) are skipped so they don't leak into the value.
|
|
17
17
|
*
|
|
18
|
-
* @param onString Called once per `<si>`, in document order, with the value
|
|
18
|
+
* @param onString Called once per `<si>`, in document order, with the value and, for a rich
|
|
19
|
+
* string, its runs.
|
|
19
20
|
* @param onWarning Optional sink for parse errors.
|
|
20
21
|
*/
|
|
21
|
-
export declare const createSharedStringsSaxVisitor: (onString: (text: string) => void, onWarning?: (message: string) => void) => SaxParser.EventHandler;
|
|
22
|
+
export declare const createSharedStringsSaxVisitor: (onString: (text: string, runs?: IRichText.Run[]) => void, onWarning?: (message: string) => void) => SaxParser.EventHandler;
|
|
23
|
+
/**
|
|
24
|
+
* Collects the `<r>` runs of a rich string from SAX events (a shared `<si>` or an inline `<is>`):
|
|
25
|
+
* each run's text and what its `<rPr>` sets. Fed the local names of the tags inside the string
|
|
26
|
+
* and the text inside its `<t>` elements.
|
|
27
|
+
*/
|
|
28
|
+
export declare class RunCollector {
|
|
29
|
+
private _runs;
|
|
30
|
+
private _text;
|
|
31
|
+
private _font;
|
|
32
|
+
private _inRun;
|
|
33
|
+
private _inRPr;
|
|
34
|
+
reset(): void;
|
|
35
|
+
onOpenTag(local: string, attributes: Record<string, string>): void;
|
|
36
|
+
/** The text inside a `<t>`; the caller gates it as it gates the string's own text. */
|
|
37
|
+
onText(text: string): void;
|
|
38
|
+
onCloseTag(local: string): void;
|
|
39
|
+
/**
|
|
40
|
+
* The runs collected since the last reset, or `null` when the string is plain: no `<r>` at
|
|
41
|
+
* all, or none with an `<rPr>` (runs that set nothing are only how some writers split text).
|
|
42
|
+
* Resets.
|
|
43
|
+
*/
|
|
44
|
+
take(): IRichText.Run[] | null;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The runs as a cell holds them: a run with an `<rPr>` gets the whole font Excel reads it as,
|
|
48
|
+
* a run without one stays bare.
|
|
49
|
+
*
|
|
50
|
+
* @remarks
|
|
51
|
+
* Measured (`probe-rich-partial.ps1`, 2026-10-18): Excel reads an `<rPr>` as absolute over the
|
|
52
|
+
* workbook's DEFAULT font, not the cell's. `<rPr><i/></rPr>` over an Arial 12 bold cell renders
|
|
53
|
+
* Calibri 11 italic, not bold; an empty `<rPr/>` (openpyxl) renders the default font; only a run
|
|
54
|
+
* with no `<rPr>` inherits the cell font. So a run with an `<rPr>` is completed here from the
|
|
55
|
+
* default font with every toggle off, then what the `<rPr>` states; the run then means the same
|
|
56
|
+
* read as a delta over any cell font.
|
|
57
|
+
*
|
|
58
|
+
* @param defaultFont The workbook's Normal font (family, size, color); absent, Excel's
|
|
59
|
+
* own default.
|
|
60
|
+
*/
|
|
61
|
+
export declare function completeRuns(runs: readonly IRichText.Run[], defaultFont: IFontStyle.JSON | undefined): IRichText.Run[];
|
|
22
62
|
//# sourceMappingURL=SharedStringsVisitor.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Tuple,
|
|
1
|
+
import { Tuple, Scalar, IWorksheet } from '@sheetxl/sdk';
|
|
2
2
|
import { SaxParser } from '../sax';
|
|
3
3
|
import { OnWarning } from '../Warning';
|
|
4
4
|
/**
|
|
@@ -6,7 +6,19 @@ import { OnWarning } from '../Warning';
|
|
|
6
6
|
* dialect (`XlsxFormulaDialect`), for condition formulas. Set before any sheet streams.
|
|
7
7
|
*/
|
|
8
8
|
export declare const PARAM_FORMULA_DIALECT = "formulaDialect";
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* The `paramMap` key under which the reader hands the worksheet visitor `workbookPr@date1904`, for
|
|
11
|
+
* `t="d"` cells. Read per cell, not when the visitor is made: it is set once `workbook.xml` is read,
|
|
12
|
+
* which is after the sheets' parses start but before any of their cells stream.
|
|
13
|
+
*/
|
|
14
|
+
export declare const PARAM_DATE_1904 = "date1904";
|
|
15
|
+
/** The runs of each rich shared string, by id (`Map<number, IRichText.Run[]>`). */
|
|
16
|
+
export declare const PARAM_RICH_STRINGS = "richStrings";
|
|
17
|
+
/** The workbook's Normal font (`IFontStyle.JSON`), which a rich run's `<rPr>` is read over. */
|
|
18
|
+
export declare const PARAM_DEFAULT_FONT = "defaultFont";
|
|
19
|
+
/** What an inline string resolves to: a shared-string id, or a rich value when it has runs. */
|
|
20
|
+
type InlineStringResult = number | Scalar.JSONTypedValue | undefined;
|
|
21
|
+
export declare const createWorksheetSaxVisitor: (sheet: IWorksheet.JSON, getRef: (relId: string, as?: "resource" | "legacyDrawing" | "part" | "formControl") => any, // TODO - this should be a context like DOM.
|
|
10
22
|
addSharedString: (str: string) => number, mapDxfs?: Map<number, any>, onEnd?: () => void, onWarning?: OnWarning, onProgress?: (amount: number, total?: number) => void, paramMap?: Map<string, any>) => SaxParser.EventHandler;
|
|
11
23
|
export declare class RowAttributeType {
|
|
12
24
|
static Collapsed: number;
|
|
@@ -19,14 +31,18 @@ export declare class RowAttributeType {
|
|
|
19
31
|
static R: number;
|
|
20
32
|
static S: number;
|
|
21
33
|
static Spans: number;
|
|
22
|
-
static ThickBot: number;
|
|
23
|
-
static ThickTop: number;
|
|
24
34
|
}
|
|
25
35
|
/**
|
|
26
|
-
*
|
|
36
|
+
* The address of a formula that is a `HYPERLINK` call and nothing else: the first argument when
|
|
37
|
+
* it is a literal string, `null` when it is computed (`HYPERLINK(B2)`), and `undefined` when
|
|
38
|
+
* the formula is not a top-level `HYPERLINK` call.
|
|
27
39
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
40
|
+
* @remarks
|
|
41
|
+
* Excel stores a `HYPERLINK` result as its plain value (`t="str"` friendly name) and nothing in
|
|
42
|
+
* `<hyperlinks>`; it makes the cell a link on open from the formula text. A nested call
|
|
43
|
+
* (`IF(c, HYPERLINK(...))`) is not read as a link.
|
|
30
44
|
*/
|
|
31
|
-
export declare const
|
|
45
|
+
export declare const topLevelHyperlinkAddress: (a1: string) => string | null | undefined;
|
|
46
|
+
export declare const createSheetDataSaxVisitor: (tupleBuilder: Tuple.IBuilder<Scalar.JSON>, sheet: IWorksheet.JSON, delegate: SaxParser.EventHandler, onWarning: OnWarning | undefined, onProgress: ((amount: number, total?: number) => void) | undefined, stringHandler: SaxParser.EventHandler<InlineStringResult>, paramMap?: Map<string, any>, addSharedString?: (str: string) => number, isZeroHeight?: () => boolean, lastInlineText?: () => string) => SaxParser.EventHandler;
|
|
47
|
+
export {};
|
|
32
48
|
//# sourceMappingURL=WorksheetVisitor.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IRichValueHandler } from './IRichValueHandler';
|
|
2
|
+
/**
|
|
3
|
+
* Excel's `_error` structure: an error Excel has no cell error code for (`#SPILL!`, `#CALC!`,
|
|
4
|
+
* `#BUSY!`, …), written as `#VALUE!` with a rich value saying which.
|
|
5
|
+
*
|
|
6
|
+
* ```xml
|
|
7
|
+
* <s t="_error">
|
|
8
|
+
* <k n="errorType" t="i"/>
|
|
9
|
+
* <k n="subType" t="i"/>
|
|
10
|
+
* </s>
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* `errorType` does NOT align to `ERROR.TYPE()`: the OOXML sequence is 0-based and skips `#FIELD!`,
|
|
15
|
+
* so it is the error's code minus one. Excel's other keys (`#SPILL!`'s `rwOffset`/`colOffset`,
|
|
16
|
+
* `#PYTHON!`'s `correlationId`, a fetch's `subType` 10) are read past and written as 0 or not at
|
|
17
|
+
* all: an error with a subtype is a rich error kind, not yet built.
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export declare const ErrorRichValueHandler: IRichValueHandler;
|
|
22
|
+
//# sourceMappingURL=ErrorRichValueHandler.d.ts.map
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { IRichData, IWorkbook, Scalar } from '@sheetxl/sdk';
|
|
2
|
+
import { DomParser, FileLookup } from '../reader/ReaderUtils';
|
|
3
|
+
import { EmitContext } from '../writer/builder';
|
|
4
|
+
/**
|
|
5
|
+
* OOXML primitive-value type codes used in `<k t="…">` attributes inside `<rvStructures>`.
|
|
6
|
+
*
|
|
7
|
+
* "d" - Date/Time (ISO-8601 string)
|
|
8
|
+
* "i" - Integer (32-bit signed)
|
|
9
|
+
* "b" - Boolean
|
|
10
|
+
* "e" - Error value
|
|
11
|
+
* "s" - Inline string
|
|
12
|
+
* "r" - Nested rich value
|
|
13
|
+
* "a" - Array data (rdarray.xml)
|
|
14
|
+
* "spb" - Supporting property bag
|
|
15
|
+
*/
|
|
16
|
+
export type RichPrimitiveType = 'd' | 'i' | 'b' | 'e' | 's' | 'r' | 'a' | 'spb';
|
|
17
|
+
/**
|
|
18
|
+
* One key of a rich value structure: its name (`n=` on `<k>`), its type (`t=`), and the text
|
|
19
|
+
* written when a value has none for it (`''` when omitted).
|
|
20
|
+
*/
|
|
21
|
+
export type RichValueProp = [name: string, type: RichPrimitiveType, defaultValue?: string];
|
|
22
|
+
/** A key's flags in `rdRichValueTypes.xml`: `[flag name, value]`. */
|
|
23
|
+
export type RichValueKeyFlags = [key: string, flags: [name: string, value: string][]];
|
|
24
|
+
/**
|
|
25
|
+
* How one Excel rich value structure (`<s t="_webimage">`) reads into a cell value and writes back
|
|
26
|
+
* out of one.
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* One handler per structure type. A handler maps the structure's keys to and from a cell value (an
|
|
30
|
+
* error, or the JSON of one of our rich data kinds) and owns the parts the structure needs beyond
|
|
31
|
+
* the rich value itself (the web image part and its media for `_webimage`). It works per file:
|
|
32
|
+
* {@link beginRead} and {@link beginWrite} start one file's state, as `strings.beginPersist()` does.
|
|
33
|
+
*
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
export interface IRichValueHandler {
|
|
37
|
+
/** Excel's structure type: `t=` on `<s>`. */
|
|
38
|
+
readonly structure: string;
|
|
39
|
+
/**
|
|
40
|
+
* The types of our rich data kinds this structure writes (`IRichData.getKind().getName()`). An error
|
|
41
|
+
* that is not a rich value is written by the `_error` structure, which lists none.
|
|
42
|
+
*/
|
|
43
|
+
readonly kinds: readonly string[];
|
|
44
|
+
/**
|
|
45
|
+
* Whether this structure writes `value`, where two structures write one kind (a web picture and
|
|
46
|
+
* a picture placed in a cell are both `image`). Omitted, every value of its kinds.
|
|
47
|
+
*/
|
|
48
|
+
writes?(value: Scalar): boolean;
|
|
49
|
+
/** Starts reading one file: reads the parts the structure resolves against. */
|
|
50
|
+
beginRead(ctx: RichValueReadContext): IRichValueReader;
|
|
51
|
+
/** Starts writing one file. */
|
|
52
|
+
beginWrite(ctx: RichValueWriteContext): IRichValueWriter;
|
|
53
|
+
}
|
|
54
|
+
/** What a handler reads a file's parts through. @internal */
|
|
55
|
+
export interface RichValueReadContext {
|
|
56
|
+
getFile: FileLookup;
|
|
57
|
+
domParser: DomParser;
|
|
58
|
+
/** The external target of the relationship `relId` of `part`, or `null`. */
|
|
59
|
+
getAddress(part: string, relId: string): string | null;
|
|
60
|
+
/** The bytes of the part the relationship `relId` of `part` names, or `null`. */
|
|
61
|
+
getBytes(part: string, relId: string): ArrayBuffer | null;
|
|
62
|
+
/**
|
|
63
|
+
* Adds a picture the file holds to the workbook as the copy of `source`, and answers the id a
|
|
64
|
+
* value's JSON names it by (`resId`).
|
|
65
|
+
*/
|
|
66
|
+
addFetched(bytes: ArrayBuffer, source: string): number | null;
|
|
67
|
+
/** Marks a part as read into the model, so it is not carried through as unknown. */
|
|
68
|
+
markAbsorbed(part: string): void;
|
|
69
|
+
}
|
|
70
|
+
/** One file's reading of a structure. @internal */
|
|
71
|
+
export interface IRichValueReader {
|
|
72
|
+
/**
|
|
73
|
+
* The cell value one `<rv>` reads as: an error, or a rich data kind's JSON.
|
|
74
|
+
*
|
|
75
|
+
* @param values The `<v>`s by key name; integers are numbers, everything else text.
|
|
76
|
+
* @returns `undefined` when the values cannot be read; the rich value is then kept as read.
|
|
77
|
+
*/
|
|
78
|
+
read(values: Record<string, string | number>): Scalar | IRichData.JSON | undefined;
|
|
79
|
+
}
|
|
80
|
+
/** What a handler writes a file through. @internal */
|
|
81
|
+
export interface RichValueWriteContext {
|
|
82
|
+
readonly workbook: IWorkbook;
|
|
83
|
+
}
|
|
84
|
+
/** One file's writing of a structure. @internal */
|
|
85
|
+
export interface IRichValueWriter {
|
|
86
|
+
/** {@inheritDoc IRichValueHandler.structure} */
|
|
87
|
+
readonly structure: string;
|
|
88
|
+
/** The keys written, as `<k>` in `rdrichvaluestructure.xml`; an `<rv>` has a `<v>` for each. */
|
|
89
|
+
readonly props: readonly RichValueProp[];
|
|
90
|
+
/**
|
|
91
|
+
* The `<v>`s for one cell value, parallel to {@link props}, or `null` when it cannot be
|
|
92
|
+
* written by this structure.
|
|
93
|
+
*
|
|
94
|
+
* @param formula The cell's formula text, or `null` for a literal.
|
|
95
|
+
*/
|
|
96
|
+
write(value: Scalar, formula: string | null): string[] | null;
|
|
97
|
+
/** The key flags written for the structure in `rdRichValueTypes.xml`, if any. */
|
|
98
|
+
getKeyFlags?(): readonly RichValueKeyFlags[];
|
|
99
|
+
/** Adds the parts the written values need, once every sheet is written. */
|
|
100
|
+
addParts?(ctx: EmitContext): void;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The `<v>`s of `props` read from a record by name: a missing or `null` value writes the prop's
|
|
104
|
+
* default.
|
|
105
|
+
*
|
|
106
|
+
* @internal
|
|
107
|
+
*/
|
|
108
|
+
export declare const valuesOf: (props: readonly RichValueProp[], record: Record<string, unknown>) => string[];
|
|
109
|
+
//# sourceMappingURL=IRichValueHandler.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IRichValueHandler } from './IRichValueHandler';
|
|
2
|
+
/** The part listing the pictures `_localImage` rich values name, by position. */
|
|
3
|
+
export declare const RICH_VALUE_REL_PART = "/xl/richData/richValueRel.xml";
|
|
4
|
+
/**
|
|
5
|
+
* Excel's `_localImage` structure: a picture placed in a cell (Insert ▸ Picture ▸ Place in Cell),
|
|
6
|
+
* read as and written from an `image` value whose source is `resource:<id>` and which holds its
|
|
7
|
+
* picture.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* The structure names its picture by position in richValueRel.xml, whose relationship is the media
|
|
11
|
+
* part; there is no source URL, so reading mints one. A literal is `CalcOrigin` 5 (an Excel file,
|
|
12
|
+
* 2026-10-28); a formula over one is written as a `_webimage`'s would be, unprobed. Alt text has
|
|
13
|
+
* no key here: the file for it is unprobed.
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export declare const LocalImageRichValueHandler: IRichValueHandler;
|
|
18
|
+
//# sourceMappingURL=LocalImageRichValueHandler.d.ts.map
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { DomParser, FileLookup } from '../reader/ReaderUtils';
|
|
2
|
+
/** The rich data parts, by zip name. */
|
|
3
|
+
export declare const RICH_DATA_PART: {
|
|
4
|
+
readonly structures: "xl/richData/rdrichvaluestructure.xml";
|
|
5
|
+
readonly values: "xl/richData/rdrichvalue.xml";
|
|
6
|
+
readonly arrays: "xl/richData/rdarray.xml";
|
|
7
|
+
readonly bagStructures: "xl/richData/rdsupportingpropertybagstructure.xml";
|
|
8
|
+
readonly bags: "xl/richData/rdsupportingpropertybag.xml";
|
|
9
|
+
readonly types: "xl/richData/rdRichValueTypes.xml";
|
|
10
|
+
readonly richStyles: "xl/richData/richStyles.xml";
|
|
11
|
+
};
|
|
12
|
+
/** A key and its type code (`t=`; absent for a number). */
|
|
13
|
+
export type RichKey = readonly [name: string, type: string | null];
|
|
14
|
+
/** One `<s>` of rdrichvaluestructure.xml. */
|
|
15
|
+
export interface RichStructure {
|
|
16
|
+
readonly t: string;
|
|
17
|
+
readonly keys: readonly RichKey[];
|
|
18
|
+
}
|
|
19
|
+
/** One `<rv>`: its structure, its `<v>`s in key order, and the `<fb>` cached number if any. */
|
|
20
|
+
export interface RawRichValue {
|
|
21
|
+
readonly s: number;
|
|
22
|
+
readonly values: readonly string[];
|
|
23
|
+
readonly fb: string | null;
|
|
24
|
+
}
|
|
25
|
+
/** A typed item of an array or a bag array: `<v t="…">text</v>`. */
|
|
26
|
+
export interface RichItem {
|
|
27
|
+
readonly t: string | null;
|
|
28
|
+
readonly text: string;
|
|
29
|
+
}
|
|
30
|
+
/** One `<a>` of rdarray.xml: its items, row major. */
|
|
31
|
+
export interface RichArrayPart {
|
|
32
|
+
readonly rows: number;
|
|
33
|
+
readonly columns: number;
|
|
34
|
+
readonly items: readonly RichItem[];
|
|
35
|
+
}
|
|
36
|
+
/** One `<spb>`: its bag structure and its `<v>`s in key order. */
|
|
37
|
+
export interface RichBag {
|
|
38
|
+
readonly s: number;
|
|
39
|
+
readonly values: readonly string[];
|
|
40
|
+
}
|
|
41
|
+
/** A key's flags, by flag name (`ShowInCardView` → `'0'`). */
|
|
42
|
+
export type RichKeyFlags = ReadonlyMap<string, string>;
|
|
43
|
+
/** One `<rSty>` of richStyles.xml, resolved: its number format and its card roles. */
|
|
44
|
+
export interface RichStyle {
|
|
45
|
+
readonly numberFormat: string | null;
|
|
46
|
+
readonly isTitle: boolean;
|
|
47
|
+
readonly isHero: boolean;
|
|
48
|
+
}
|
|
49
|
+
/** Everything the rich data parts of one file say. Empty lists for parts the file lacks. */
|
|
50
|
+
export interface RichDataParts {
|
|
51
|
+
readonly structures: readonly RichStructure[];
|
|
52
|
+
readonly values: readonly RawRichValue[];
|
|
53
|
+
readonly arrays: readonly RichArrayPart[];
|
|
54
|
+
readonly bagStructures: readonly (readonly RichKey[])[];
|
|
55
|
+
readonly bagArrays: readonly (readonly RichItem[])[];
|
|
56
|
+
readonly bags: readonly RichBag[];
|
|
57
|
+
/** Flags every structure's keys share. */
|
|
58
|
+
readonly globalKeyFlags: ReadonlyMap<string, RichKeyFlags>;
|
|
59
|
+
/** Flags by structure type, then key. */
|
|
60
|
+
readonly typeKeyFlags: ReadonlyMap<string, ReadonlyMap<string, RichKeyFlags>>;
|
|
61
|
+
readonly richStyles: readonly RichStyle[];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Reads every rich data part of a file. A part the file lacks reads as empty.
|
|
65
|
+
*
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
export declare const readRichDataParts: (getFile: FileLookup, domParser: DomParser) => RichDataParts;
|
|
69
|
+
//# sourceMappingURL=RichDataParts.d.ts.map
|