@sheetxl/io-xlsx 0.8.0-beta.12 → 0.8.0-beta.13
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/{DO75RoAQTgMuVzXv.mjs → 20e8E-6B9lZDdDO3.mjs} +2 -2
- package/browser/esm/{DKnOwucZq4z9_-r-.mjs → B4_m1DDdERBw_oc_.mjs} +4 -4
- package/browser/esm/{DsppUz-14Z7ti9i3.mjs → B8HGBRlYw3gtV6cS.mjs} +1 -1
- package/browser/esm/{aUBXbTh2r0u3x4Xo.mjs → BUnVDknxJ3z7Byym.mjs} +2 -2
- package/browser/esm/{D8k22TSWPd_RHEpj.mjs → BZULU4MreyJ0WsDY.mjs} +988 -1008
- package/browser/esm/{9dwUocbOsJuAcmKn.mjs → BduVw3dFdh9sSGv_.mjs} +2234 -2250
- package/browser/esm/CM4k1dv3DNPThvDz.mjs +24 -0
- package/browser/esm/{BIvDjK4Zl8bWRgl8.mjs → CkEGcTzeyh7cqVVb.mjs} +2 -2
- package/browser/esm/{DVLJTjJCGqrJUa8c.mjs → DmW0VCJFl3eX7pBV.mjs} +61 -61
- package/browser/esm/{CcH5ITJFTMVWUJO9.mjs → eFR-PmxEV53J-933.mjs} +1041 -1041
- package/browser/esm/index.mjs +2 -2
- package/browser/esm/{DeMZN_qj__PKo4Wh.mjs → khCH6SyDFBiHzmSl.mjs} +1 -1
- package/node/esm/{DXusvwW73FUDSyvD.mjs → BqB-dnUZaszNS--K.mjs} +1129 -1129
- package/node/esm/{CDKm5s3JE_d99TJw.mjs → ByC9KtkF09muIv1I.mjs} +81 -81
- package/node/esm/{DCaAOfuW-w_dx_qd.mjs → CHElwgFJ32Hh_gHU.mjs} +2 -2
- package/node/esm/{DSgxL0sBZtWMydVl.mjs → CIpg0EBGoVM58ajd.mjs} +2 -2
- package/node/esm/{C78E45n6j2E8rruH.mjs → CJt_Kh2EU8DlMcus.mjs} +818 -819
- package/node/esm/{DsyuWxk3bdGhJUQN.mjs → COzTSkHGuyKdKaxO.mjs} +1 -1
- package/node/esm/{BmIIQODk4dBVIXA4.mjs → Cc4XXs0Y2lL-2Et9.mjs} +976 -994
- package/node/esm/{C-e5AO_4TnGywT-m.mjs → DmvVllQAwUtHEJbX.mjs} +1 -1
- package/node/esm/index.mjs +4 -4
- package/package.json +3 -3
- package/types/src/AutoFilterRules.d.ts +0 -42
- package/types/src/DataTableFormula.d.ts +0 -10
- package/types/src/DataValidationRules.d.ts +0 -5
- package/types/src/ExcelCalcStamp.d.ts +0 -36
- package/types/src/ExcelCompat.d.ts +0 -140
- package/types/src/ExcelFunctionFacts.d.ts +0 -272
- package/types/src/ExcelReservedNames.d.ts +0 -64
- package/types/src/KnownFonts.d.ts +0 -13
- package/types/src/LegacyFormula.d.ts +0 -58
- package/types/src/Plugin.d.ts +3 -3
- package/types/src/SheetKinds.d.ts +0 -15
- package/types/src/SourcePackage.d.ts +0 -44
- package/types/src/Types.d.ts +2 -3
- package/types/src/chart/_chartExStyle.d.ts +0 -9
- package/types/src/reader/DummyFunctionUnwrap.d.ts +43 -23
- package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +0 -8
- package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +0 -10
- package/types/src/reader/domVisitors/FeaturePropertyBagVisitor.d.ts +0 -9
- package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts +0 -11
- package/types/src/reader/domVisitors/WorkbookVisitor.d.ts +0 -9
- package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +0 -15
- package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +3 -1
- package/types/src/richValue/WebImageRichValueHandler.d.ts +0 -5
- package/types/src/utils/VmlNoteStyle.d.ts +0 -19
- package/types/src/vba/VBAProject.d.ts +0 -19
- package/types/src/writer/builder/OpcXmlUtils.d.ts +0 -8
- package/types/src/writer/builder/PackageBuilder.d.ts +0 -41
- package/types/src/writer/builder/Types.d.ts +0 -30
- package/types/src/writer/emitters/ExternalLinkEmitter.d.ts +0 -11
- package/types/src/writer/emitters/FeaturePropertyBagEmitter.d.ts +0 -10
- package/types/src/writer/utils/DefaultRows.d.ts +0 -16
- package/types/src/writer/utils/DummyFunction.d.ts +0 -23
|
@@ -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
|
|
@@ -12,14 +12,6 @@ export declare class AutoFilterVisitor implements Visitor {
|
|
|
12
12
|
processColorFilter(context: ExecutionContext, elem: Element): ICondition.JSON;
|
|
13
13
|
processCustomFilter(context: ExecutionContext, elem: Element): ICondition.JSON | null;
|
|
14
14
|
processCustomFilters(context: ExecutionContext, elem: Element): ICondition.JSON;
|
|
15
|
-
/**
|
|
16
|
-
* `dynamicFilter` is Excel's Average (`aboveAverage` / `belowAverage`) or a TimePeriod.
|
|
17
|
-
*
|
|
18
|
-
* @remarks
|
|
19
|
-
* `val` and `maxVal` are Excel's cache of the last evaluation (the average; a period's start
|
|
20
|
-
* and exclusive end), not an anchor and not a deviation count. Excel honors `type` alone and
|
|
21
|
-
* rewrites them on save (`probe-filter-dynamic`), so they are dropped here.
|
|
22
|
-
*/
|
|
23
15
|
processDynamicFilter(context: ExecutionContext, elem: Element): ICondition.JSON;
|
|
24
16
|
processDateGroupItem(context: ExecutionContext, elem: Element): ICondition.DateGroupItem;
|
|
25
17
|
processFilterItem(context: ExecutionContext, elem: Element): Scalar | undefined;
|
|
@@ -32,16 +32,6 @@ export declare class ExternalLinkVisitor implements Visitor {
|
|
|
32
32
|
private _findAbsoluteUrlRelId;
|
|
33
33
|
}
|
|
34
34
|
export declare namespace ExternalLinkVisitor {
|
|
35
|
-
/**
|
|
36
|
-
* The `r:id`s the part's XML points at, handed to `XLSXReader` so it can say which of the part's
|
|
37
|
-
* relationships is the book's own path and which is the 2021 `absoluteUrl` companion — then
|
|
38
|
-
* stripped. **Not part of {@link IExternalBook.JSON}**: an rId is a name inside one package, and
|
|
39
|
-
* a saved book gets fresh ones.
|
|
40
|
-
*
|
|
41
|
-
* @remarks
|
|
42
|
-
* The relationship type cannot answer this on its own — both can be `externalLinkPath` (measured
|
|
43
|
-
* on task 40234).
|
|
44
|
-
*/
|
|
45
35
|
interface RelIds {
|
|
46
36
|
__bookRelId?: string;
|
|
47
37
|
__absoluteUrlRelId?: string;
|
|
@@ -11,15 +11,6 @@ import { Visitor, ExecutionContext } from '../dom';
|
|
|
11
11
|
export interface FeaturePropertyBags {
|
|
12
12
|
controls: (ICellControl.JSON | null)[];
|
|
13
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
14
|
export declare class FeaturePropertyBagVisitor implements Visitor {
|
|
24
15
|
visit(context: ExecutionContext, elem: Element, jsonParent: any): FeaturePropertyBags;
|
|
25
16
|
private _readBag;
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
import { ITheme } from '@sheetxl/sdk';
|
|
2
2
|
import { Visitor, ExecutionContext } from '../dom';
|
|
3
3
|
import { ColorContainerVisitor } from './ColorContainerVisitor';
|
|
4
|
-
/**
|
|
5
|
-
* Parses the source theme's `<a:fmtScheme>` (fill/line/effect/background-fill style lists) into
|
|
6
|
-
* typed `ITheme.JSON` fields (`fillStyleLst`/`lnStyleLst`/`effectStyleLst`/`bgFillStyleLst`) so
|
|
7
|
-
* idx-referencing shape/chart styles (`<a:lnRef idx="N">`, `<a:fillRef>`, `<a:effectRef>`) keep
|
|
8
|
-
* resolving against the same source definitions on save — see DESIGN-PACKAGE-PASSTHROUGH.md §11.2.
|
|
9
|
-
*
|
|
10
|
-
* Each list that is fully modeled is kept, so the theme draws with the file's own fills and
|
|
11
|
-
* lines. If any list isn't (an effect outside the "common" set — see `IEffect` — or a
|
|
12
|
-
* `scene3d`/`sp3d` on an effect style), the whole `<a:fmtScheme>` is also captured verbatim
|
|
13
|
-
* (`ITheme.JSON.formatSchemeXml`) and `ThemeEmitter` replays that instead of writing the lists.
|
|
14
|
-
*/
|
|
15
4
|
export declare class FmtSchemeVisitor extends ColorContainerVisitor implements Visitor {
|
|
16
5
|
visit(context: ExecutionContext, elemParent: Element, jsonParent: ITheme.JSON): void;
|
|
17
6
|
private parseFillList;
|
|
@@ -20,15 +20,6 @@ export declare class WorkbookVisitor extends SheetColorContainerVisitor {
|
|
|
20
20
|
* `getRef`, which normalizes an empty visitor result to `null` and attaches `sources`).
|
|
21
21
|
*/
|
|
22
22
|
processExternalReferences(context: ExecutionContext, elem: Element, jsonParent: IWorkbook.JSON): any;
|
|
23
|
-
/**
|
|
24
|
-
* `<pivotCaches><pivotCache cacheId="n" r:id="rIdN"/></pivotCaches>` — the workbook's pivot
|
|
25
|
-
* caches, each carried whole: its definition part and, through that part's own relationships,
|
|
26
|
-
* its records. See `PLAN-MODEL-HOMES.md` step 4.
|
|
27
|
-
*
|
|
28
|
-
* @remarks
|
|
29
|
-
* The id is the join key: every pivot table names the cache it summarizes by `cacheId`, and the
|
|
30
|
-
* writer puts the same id back so the two still meet.
|
|
31
|
-
*/
|
|
32
23
|
processPivotCaches(context: ExecutionContext, elem: Element, jsonParent: IWorkbook.JSON): any;
|
|
33
24
|
processBookViews(context: ExecutionContext, elem: Element, jsonParent: IWorkbook.JSON): any;
|
|
34
25
|
processWorkbookView(context: ExecutionContext, elem: Element, jsonParent: IWorkbook.JSON): any;
|
|
@@ -43,20 +43,5 @@ export declare class RunCollector {
|
|
|
43
43
|
*/
|
|
44
44
|
take(): IRichText.Run[] | null;
|
|
45
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
46
|
export declare function completeRuns(runs: readonly IRichText.Run[], defaultFont: IFontStyle.JSON | undefined): IRichText.Run[];
|
|
62
47
|
//# sourceMappingURL=SharedStringsVisitor.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Scalar, Tuple, IWorksheet } from '@sheetxl/sdk';
|
|
2
2
|
import { SaxParser } from '../sax';
|
|
3
3
|
import { OnWarning } from '../Warning';
|
|
4
4
|
/**
|
|
@@ -6,6 +6,8 @@ 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
|
+
/** {@link IsKnownFunction}, set when wrapped formulas are to be restored. Read at the first wrapper. */
|
|
10
|
+
export declare const PARAM_IS_KNOWN_FUNCTION = "isKnownFunction";
|
|
9
11
|
/**
|
|
10
12
|
* The `paramMap` key under which the reader hands the worksheet visitor `workbookPr@date1904`, for
|
|
11
13
|
* `t="d"` cells. Read per cell, not when the visitor is made: it is set once `workbook.xml` is read,
|
|
@@ -19,11 +19,6 @@ export interface WrittenWebImage {
|
|
|
19
19
|
* indexes this list. Empty when the part is absent.
|
|
20
20
|
*/
|
|
21
21
|
export declare const readWebImages: (ctx: RichValueReadContext) => WebImage[];
|
|
22
|
-
/**
|
|
23
|
-
* How a picture reached its cell, as a `_webimage`'s `CalcOrigin` says it: 1 for the result of an
|
|
24
|
-
* `IMAGE` call and 4 for a reference to one (`=A3`), as Excel writes them (probe-image-fetch,
|
|
25
|
-
* 2026-10-27). 2 for any other formula and 5 for a literal are [MS-XLSX]'s values as read, unprobed.
|
|
26
|
-
*/
|
|
27
22
|
export declare const calcOriginOf: (formula: string | null) => number;
|
|
28
23
|
/**
|
|
29
24
|
* Excel's `_webimage` structure: a picture as a cell value (`IMAGE`), read as and written from an
|
|
@@ -1,23 +1,4 @@
|
|
|
1
1
|
import { IColor, IFill, IStroke } from '@sheetxl/sdk';
|
|
2
|
-
/**
|
|
3
|
-
* A note box's fill and line: the VML of the note's `<v:shape>` and the model's
|
|
4
|
-
* {@link IFill.JSON} / {@link IStroke.JSON}, both ways.
|
|
5
|
-
*
|
|
6
|
-
* @remarks
|
|
7
|
-
* Probed with hidden COM (2026-10-20, `comments-probes/probe-note-format.ps1`). Excel writes the
|
|
8
|
-
* fill as `fillcolor` on the shape with its transparency as `<v:fill opacity>`, and no fill as
|
|
9
|
-
* `filled="f"` (the color left where it was). The line is `strokecolor`, `strokeweight` and
|
|
10
|
-
* `stroked="f"` on the shape, with the dash and the compound on `<v:stroke dashstyle linestyle>`.
|
|
11
|
-
* A color is a CSS color (`red`, `#cfc`), or a name and a palette index (`infoBackground [80]`);
|
|
12
|
-
* Excel refuses a theme color here, so one is written as the color it resolves to.
|
|
13
|
-
*
|
|
14
|
-
* A named VML dash draws the same lengths as the DrawingML preset it is mapped to (`shortdash`
|
|
15
|
-
* is `sysDash`, `3 1`), so a note draws the dash VML draws. Excel's own pairing through COM is
|
|
16
|
-
* not by length and is not followed.
|
|
17
|
-
*
|
|
18
|
-
* Only a solid fill is modeled. A gradient, pattern or picture fill (`<v:fill type>`) is left in
|
|
19
|
-
* the markup as it was read, and the box draws Excel's default fill.
|
|
20
|
-
*/
|
|
21
2
|
/** A note box's fill and line, as the model states them. */
|
|
22
3
|
export interface NoteShapeStyle {
|
|
23
4
|
fill?: IFill.JSON;
|
|
@@ -45,25 +45,6 @@ export declare namespace VBAProject {
|
|
|
45
45
|
codePage: number;
|
|
46
46
|
modules: Module[];
|
|
47
47
|
}
|
|
48
|
-
/**
|
|
49
|
-
* Extract all VBA modules, with their source, from a raw `xl/vbaProject.bin`.
|
|
50
|
-
*
|
|
51
|
-
* The `dir` stream is a flat sequence of `Id(2) Size(4) Data(Size)` records,
|
|
52
|
-
* **with one exception**: `PROJECTVERSION` (0x0009) stores a fixed reserved value
|
|
53
|
-
* `4` in the size slot but is followed by 6 bytes (VersionMajor + VersionMinor).
|
|
54
|
-
* Treating its size as a skip length misaligns everything after it — which is why
|
|
55
|
-
* a naive walk never finds the module records.
|
|
56
|
-
*
|
|
57
|
-
* @param vbaProjectBin The bytes of the `xl/vbaProject.bin` part.
|
|
58
|
-
* @returns The parsed project, or `null` if the bytes are not a compound file.
|
|
59
|
-
*
|
|
60
|
-
* @remarks
|
|
61
|
-
* Deliberately eager. A lazy variant existed briefly, deferring each module's stream until
|
|
62
|
-
* someone read it; measured on the corpus it saved **7µs** — the cost is the compound-file walk
|
|
63
|
-
* and the `dir` decompress, which happen either way, and the per-module streams are noise beside
|
|
64
|
-
* them. What it cost was a module JSON whose properties existed before their values did, which
|
|
65
|
-
* is not a trade worth making for microseconds.
|
|
66
|
-
*/
|
|
67
48
|
const extract: (vbaProjectBin: Uint8Array | ArrayBuffer) => Project | null;
|
|
68
49
|
/** A module's source, separated into the part VBA hides and the part it shows. */
|
|
69
50
|
interface Source {
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Minimal, dependency-free parsing for the two flat OPC manifest formats the writer needs to read
|
|
3
|
-
* back from a retained source package: `[Content_Types].xml` and `*.rels`. Both are, per spec, a
|
|
4
|
-
* single level of self-closing elements with only attributes — no text content, no nesting beyond
|
|
5
|
-
* the root — so an attribute-order-independent regex parser is enough, and it keeps the writer from
|
|
6
|
-
* needing a DOM parser (it otherwise only ever produces XML, never parses it). See
|
|
7
|
-
* `DESIGN-PACKAGE-PASSTHROUGH.md` §6.
|
|
8
|
-
*/
|
|
9
1
|
export declare function decodeXmlEntities(s: string): string;
|
|
10
2
|
export interface SourceContentTypes {
|
|
11
3
|
readonly defaults: readonly {
|
|
@@ -72,17 +72,6 @@ export declare class PackageBuilder<Out> {
|
|
|
72
72
|
private _explicitRelTargets;
|
|
73
73
|
private _mapState;
|
|
74
74
|
constructor(zip: IZipBackend<Out>, registry: EmitterRegistry, options?: PackageBuilderOptions);
|
|
75
|
-
/**
|
|
76
|
-
* Whether a source part named `name` will be in this package once {@link _passthroughSourceParts}
|
|
77
|
-
* has run — the drop rules of `DESIGN-PACKAGE-PASSTHROUGH.md` §4, as one predicate. `false` when
|
|
78
|
-
* there is no source package or it has no such part.
|
|
79
|
-
*
|
|
80
|
-
* @remarks
|
|
81
|
-
* Does not consider whether an emitter claimed the *path* — that part is then in the package, but
|
|
82
|
-
* as the emitter's, not the source's. It does consider whether the reader took the part onto the
|
|
83
|
-
* model ({@link ISourcePackage.isAbsorbed}), which is a different question: the model writes that
|
|
84
|
-
* part wherever its own numbering puts it, which need not be where the source had it.
|
|
85
|
-
*/
|
|
86
75
|
private _isSourcePartCarried;
|
|
87
76
|
/**
|
|
88
77
|
* Hold the source's own relationship ids back in `partPath`'s set, before the emitter rewriting
|
|
@@ -102,15 +91,6 @@ export declare class PackageBuilder<Out> {
|
|
|
102
91
|
* @returns The resulting package as a Uint8Array.
|
|
103
92
|
*/
|
|
104
93
|
build(options?: ZipBackendCloseOptions): Promise<Uint8Array>;
|
|
105
|
-
/**
|
|
106
|
-
* Copy through every source-package part no emitter claimed, once emission is complete and
|
|
107
|
-
* {@link _writtenPaths} is final. See `DESIGN-PACKAGE-PASSTHROUGH.md` §4 (bucket rules) and §6
|
|
108
|
-
* (the rels/content-types merge).
|
|
109
|
-
*
|
|
110
|
-
* @remarks
|
|
111
|
-
* No re-fetch, no residue map: this only ever reads the bytes handed in via
|
|
112
|
-
* {@link PackageBuilderOptions.sourcePackage} — see the design doc's non-goals (§7).
|
|
113
|
-
*/
|
|
114
94
|
private _passthroughSourceParts;
|
|
115
95
|
/**
|
|
116
96
|
* Declare the workbook part's macro-enabled **variant** of `CT_Workbook` when the package being
|
|
@@ -138,27 +118,6 @@ export declare class PackageBuilder<Out> {
|
|
|
138
118
|
* would let a stale declaration through on anything.
|
|
139
119
|
*/
|
|
140
120
|
private _applyWorkbookContentTypeVariant;
|
|
141
|
-
/**
|
|
142
|
-
* Seed `sourcePart`'s {@link IRelationshipSet} with the source's edges, each under the source's
|
|
143
|
-
* own id. Targets are carried forward as-is (still relative to the same referencing part, at the
|
|
144
|
-
* same OPC path) — nothing to recompute.
|
|
145
|
-
*
|
|
146
|
-
* @remarks
|
|
147
|
-
* Which edges come back depends on who wrote the part (`DESIGN-PACKAGE-PASSTHROUGH.md` §6):
|
|
148
|
-
*
|
|
149
|
-
* - A **preserved** part is the source's bytes, so its XML still cites the ids the source's
|
|
150
|
-
* `.rels` defined; every edge whose target is still in the package comes back with that id.
|
|
151
|
-
* Nothing else ever wrote into this set, so the ids are free.
|
|
152
|
-
* - A **rewritten** part (the root, or one an emitter claimed) had its emitter recreate the edges
|
|
153
|
-
* it cites, so only what the emitter did not recreate is added: not an edge whose target an
|
|
154
|
-
* emitter claimed (its own, correct edge exists already — keeping both would duplicate it), not
|
|
155
|
-
* one added by name through `addRelationship`. The set had the source's ids reserved before
|
|
156
|
-
* the emitter allocated ({@link _reserveSourceRelIds}), so these too keep their names —
|
|
157
|
-
* unless an emitter took the id as a hint for a different target, in which case it is fresh.
|
|
158
|
-
*
|
|
159
|
-
* An edge whose target did not survive at all is dropped either way (§5). A `TargetMode="External"`
|
|
160
|
-
* or `#`-fragment target is not a part and is never resolved as one.
|
|
161
|
-
*/
|
|
162
121
|
private _mergeSourceRelsInto;
|
|
163
122
|
/**
|
|
164
123
|
* Add a root part to the package.
|
|
@@ -161,25 +161,6 @@ export interface EmitContext {
|
|
|
161
161
|
* @returns The rId of the added relationship.
|
|
162
162
|
*/
|
|
163
163
|
addExternal(relTypeUri: string, targetUrl: string, idHint?: string): PackagePart;
|
|
164
|
-
/**
|
|
165
|
-
* Adds a relationship from the current part to a part that is already going to be in this
|
|
166
|
-
* package, rather than creating one: either a part another emitter wrote — one that is shared,
|
|
167
|
-
* written once by whoever owns it and referenced from each part that uses it (a pivot cache,
|
|
168
|
-
* written by the workbook, from every pivot table on it) — or a part the source package carries
|
|
169
|
-
* through untouched because nothing modeled it (a `<ddeLink>` external link).
|
|
170
|
-
*
|
|
171
|
-
* @param relTypeUri The relationship type URI.
|
|
172
|
-
* @param targetPartPath The target's absolute path (relative to the package root, no leading `/`).
|
|
173
|
-
* @param idHint A preferred id (e.g. the source's own original rId), honored only if free in this
|
|
174
|
-
* part's set; it falls back silently to an auto-generated id otherwise, so a caller that needs the
|
|
175
|
-
* id to line up with something it already wrote (a replayed fragment citing this target) must use
|
|
176
|
-
* the returned value rather than assume the hint was honored.
|
|
177
|
-
* @returns The id assigned, or `null` if the target will not be in the package — no emitter
|
|
178
|
-
* claimed the path and no source part survives at it (there is no source package, it has no such
|
|
179
|
-
* part, the model absorbed it, or it is in a drop bucket for this save; see
|
|
180
|
-
* `DESIGN-PACKAGE-PASSTHROUGH.md` §4). Nothing was added in that case: the caller must not write
|
|
181
|
-
* the element that would have cited it.
|
|
182
|
-
*/
|
|
183
164
|
addRelationship(relTypeUri: string, targetPartPath: string, idHint?: string): string | null;
|
|
184
165
|
/**
|
|
185
166
|
* Waits for all dependants to be emitted.
|
|
@@ -296,11 +277,6 @@ export interface PackageBuilderOptions {
|
|
|
296
277
|
* A map that can be used across emitters to share state.
|
|
297
278
|
*/
|
|
298
279
|
mapState?: Map<string, any>;
|
|
299
|
-
/**
|
|
300
|
-
* The source package to seed the build from, if the destination is being saved back into the same
|
|
301
|
-
* OOXML package family it was read from. Parts no emitter claims are copied through verbatim
|
|
302
|
-
* instead of being dropped. See `DESIGN-PACKAGE-PASSTHROUGH.md`.
|
|
303
|
-
*/
|
|
304
280
|
sourcePackage?: ISourcePackage | null;
|
|
305
281
|
/**
|
|
306
282
|
* Whether the package being built is macro-enabled (`.xlsm`) rather than plain (`.xlsx`).
|
|
@@ -361,12 +337,6 @@ export interface ISourcePackagePart {
|
|
|
361
337
|
readonly uncompressedSize: number;
|
|
362
338
|
readonly raw?: ISourcePackageRawPart;
|
|
363
339
|
}
|
|
364
|
-
/**
|
|
365
|
-
* Structural interface for a retained source package, seeded into {@link PackageBuilder} so an
|
|
366
|
-
* xlsx→xlsx round trip can copy through the parts nothing modeled instead of dropping them. Kept
|
|
367
|
-
* structural (not importing `../SourcePackage` directly) so `builder/` stays format-agnostic — see
|
|
368
|
-
* `DESIGN-PACKAGE-PASSTHROUGH.md` §6.
|
|
369
|
-
*/
|
|
370
340
|
export interface ISourcePackage {
|
|
371
341
|
getNames(): string[];
|
|
372
342
|
has(name: string): boolean;
|
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
import { IExternalBook } from '@sheetxl/sdk';
|
|
2
2
|
import { Emitter, EmitContext } from '../builder';
|
|
3
|
-
/**
|
|
4
|
-
* Emits one `xl/externalLinks/externalLinkN.xml` — the cached snapshot of another workbook that
|
|
5
|
-
* `[n]` in a formula addresses. See `DESIGN-EXTERNAL-LINKS.md` §5 phase A.
|
|
6
|
-
*
|
|
7
|
-
* @remarks
|
|
8
|
-
* The part is scheduled by `WorkbookEmitter`, which owns the `[n]` order and therefore the path
|
|
9
|
-
* numbering; this emitter only writes what one {@link IExternalBook.JSON} says.
|
|
10
|
-
*
|
|
11
|
-
* DDE and OLE links never reach here — they are not modeled at all, and their bytes are carried
|
|
12
|
-
* through the package instead (design doc §2.1).
|
|
13
|
-
*/
|
|
14
3
|
export declare class ExternalLinkEmitter extends Emitter<IExternalBook.JSON> {
|
|
15
4
|
constructor();
|
|
16
5
|
/** @inheritdoc IEmitter.emit */
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import { Emitter, EmitContext } from '../builder';
|
|
2
2
|
import { CellControlComplements } from '../utils/CellControlComplements';
|
|
3
|
-
/**
|
|
4
|
-
* Writes `xl/featurePropertyBag/featurePropertyBag.xml`: the controls the cell xfs' `xfComplement`
|
|
5
|
-
* indices stand for.
|
|
6
|
-
*
|
|
7
|
-
* @remarks
|
|
8
|
-
* The chain Excel writes for a checkbox (measured 2026-10-27, `checkbox.xlsx`), bags referenced by
|
|
9
|
-
* position: the control bag, an `XFControls` bag naming it as `CellControl`, an `XFComplement` bag
|
|
10
|
-
* naming that, and last one `XFComplements` bag whose `MappedFeaturePropertyBags` array lists the
|
|
11
|
-
* `XFComplement` bags. An xf's `xfComplement i` indexes that array, not the bags.
|
|
12
|
-
*/
|
|
13
3
|
export declare class FeaturePropertyBagEmitter extends Emitter<CellControlComplements> {
|
|
14
4
|
constructor();
|
|
15
5
|
/** @inheritdoc IEmitter.emit */
|
|
@@ -18,21 +18,5 @@ export interface DefaultRows {
|
|
|
18
18
|
* no run lists, at the height they no longer get by default.
|
|
19
19
|
*/
|
|
20
20
|
export declare const listedRowRuns: (rows: ITypes.RunCoordValue<XlsxHeader>[], defaultRun: ITypes.RunCoordValue<XlsxHeader>, unlistedHeight: number, maxRows: number) => ITypes.RunCoordValue<XlsxHeader>[];
|
|
21
|
-
/**
|
|
22
|
-
* How a sheet's unlisted rows are written: Excel's `sheetFormatPr` is its cache of the row height
|
|
23
|
-
* every row shares, so the height that covers most of the sheet is written once there rather than as
|
|
24
|
-
* a row element per row.
|
|
25
|
-
*
|
|
26
|
-
* @remarks
|
|
27
|
-
* Excel computes an unlisted row's height from the Normal font plus a pixel for each `thickTop`/
|
|
28
|
-
* `thickBottom` (`probe-sheet-thick-derive.ps1`); it moves the flags there only for a style on whole
|
|
29
|
-
* columns, and our export promotes a style on most of a column to one, so the default takes the flags
|
|
30
|
-
* of the run it replaces. A height those explain is written that way, so Excel keeps sizing the rows
|
|
31
|
-
* itself; any other is written as a custom height.
|
|
32
|
-
*
|
|
33
|
-
* @param normalHeight The Normal font's row height, in points.
|
|
34
|
-
* @param maxRows The sheet's row count.
|
|
35
|
-
* @returns `null` when the rows share no height but the Normal one.
|
|
36
|
-
*/
|
|
37
21
|
export declare const resolveDefaultRows: (json: XlsxWorksheetJSON, normalHeight: number, maxRows: number) => DefaultRows | null;
|
|
38
22
|
//# sourceMappingURL=DefaultRows.d.ts.map
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
import { Scalar, IWorkbook } from '@sheetxl/sdk';
|
|
2
|
-
/**
|
|
3
|
-
* Exporting a formula Excel cannot evaluate.
|
|
4
|
-
*
|
|
5
|
-
* Excel has no notion of "a function I do not know but should keep working". A name it does not
|
|
6
|
-
* have evaluates to `#NAME?` and the computed value is gone — so a user's own UDF, or one of the
|
|
7
|
-
* 29 built-ins Excel lacks, survives a save as an error and nothing else.
|
|
8
|
-
*
|
|
9
|
-
* Google Sheets solved this years ago and the shape is a de-facto convention, so we emit THEIR
|
|
10
|
-
* spelling rather than inventing one — the same text is then understood by Sheets, by Grid, and by
|
|
11
|
-
* our own reader, which needs a single unwrap path either way:
|
|
12
|
-
*
|
|
13
|
-
* ```
|
|
14
|
-
* IFERROR(__xludf.DUMMYFUNCTION("ISEMAIL(""biggie"")"),FALSE)
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* The unknown call errors in Excel, `IFERROR` yields the literal, and the cell keeps showing the
|
|
18
|
-
* right answer. The original formula text rides along as a string argument, which is what lets the
|
|
19
|
-
* round trip back into SheetXL be lossless.
|
|
20
|
-
*
|
|
21
|
-
* The trade is real and worth stating: **the formula is dead in Excel.** It never recalculates, so
|
|
22
|
-
* editing a precedent leaves a stale value with no visual cue. That is Google's trade too; the
|
|
23
|
-
* alternative (emit bare, show `#NAME?`) loses the value instead. See CALC-ISSUES item 7.
|
|
24
|
-
*/
|
|
25
2
|
/** Google's marker. Deliberately their exact spelling — see the note above. */
|
|
26
3
|
export declare const DUMMY_FUNCTION = "__xludf.DUMMYFUNCTION";
|
|
27
4
|
/**
|