xls-codec 4.7.6 → 4.9.0
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/README.md +11 -5
- package/dist/biff/cursor.cjs +12 -1
- package/dist/biff/cursor.d.cts +1 -1
- package/dist/biff/cursor.d.ts +1 -1
- package/dist/biff/cursor.js +12 -1
- package/dist/biff/ptg.cjs +16 -2
- package/dist/biff/ptg.d.cts +2 -2
- package/dist/biff/ptg.d.ts +2 -2
- package/dist/biff/ptg.js +16 -3
- package/dist/biff/record-types.cjs +25 -1
- package/dist/biff/record-types.d.cts +18 -2
- package/dist/biff/record-types.d.ts +18 -2
- package/dist/biff/record-types.js +18 -2
- package/dist/biff/strings.d.cts +1 -1
- package/dist/biff/strings.d.ts +1 -1
- package/dist/biff/substreams.cjs +7 -8
- package/dist/biff/substreams.d.cts +1 -1
- package/dist/biff/substreams.d.ts +1 -1
- package/dist/biff/substreams.js +7 -8
- package/dist/biff/xf-colors.d.cts +1 -1
- package/dist/biff/xf-colors.d.ts +1 -1
- package/dist/biff/xf-writer.d.cts +1 -1
- package/dist/biff/xf-writer.d.ts +1 -1
- package/dist/{conditional-format-12-D-X5g_O3.d.ts → conditional-format-12-C3nwy1f8.d.ts} +10 -5
- package/dist/{conditional-format-12-DBhe7Zo6.d.cts → conditional-format-12-D65-ruTq.d.cts} +10 -5
- package/dist/conditional-format-BRMUTRP1.d.ts +41 -0
- package/dist/conditional-format-Cth_afMy.d.cts +41 -0
- package/dist/content.cjs +50 -18
- package/dist/content.js +50 -18
- package/dist/{cursor-VMtw9uVP.d.cts → cursor-CnEuX5qE.d.cts} +3 -1
- package/dist/{cursor-VMtw9uVP.d.ts → cursor-CnEuX5qE.d.ts} +3 -1
- package/dist/{data-validation-DfpjUN-N.d.cts → data-validation-BgUt8CbE.d.cts} +2 -2
- package/dist/{data-validation-BXvIVU0e.d.ts → data-validation-Cq6iD8lB.d.ts} +2 -2
- package/dist/drawing/blips.cjs +83 -0
- package/dist/drawing/blips.d.cts +10 -0
- package/dist/drawing/blips.d.ts +10 -0
- package/dist/drawing/blips.js +82 -0
- package/dist/drawing/bytes.cjs +15 -0
- package/dist/drawing/bytes.d.cts +5 -0
- package/dist/drawing/bytes.d.ts +5 -0
- package/dist/drawing/bytes.js +14 -0
- package/dist/drawing/escher-constants.cjs +52 -0
- package/dist/drawing/escher-constants.d.cts +34 -0
- package/dist/drawing/escher-constants.d.ts +34 -0
- package/dist/drawing/escher-constants.js +34 -0
- package/dist/drawing/escher.cjs +84 -0
- package/dist/drawing/escher.d.cts +30 -0
- package/dist/drawing/escher.d.ts +30 -0
- package/dist/drawing/escher.js +80 -0
- package/dist/drawing/shapes.cjs +80 -0
- package/dist/drawing/shapes.d.cts +24 -0
- package/dist/drawing/shapes.d.ts +24 -0
- package/dist/drawing/shapes.js +79 -0
- package/dist/index.cjs +11 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +4 -4
- package/dist/{print-names-CCwUHAoL.d.cts → print-names-B2OR0fvs.d.cts} +1 -1
- package/dist/{print-names-CxAbgcjB.d.ts → print-names-BXcmmwVi.d.ts} +1 -1
- package/dist/{ptg-CCBbJLZJ.d.cts → ptg-75v7MhaA.d.cts} +7 -1
- package/dist/{ptg-CCBbJLZJ.d.ts → ptg-75v7MhaA.d.ts} +7 -1
- package/dist/{substreams-Dp5cZoUo.d.ts → substreams-CgTHx5kX.d.ts} +1 -1
- package/dist/{substreams-CHv3oWmn.d.cts → substreams-XDNgDvRJ.d.cts} +1 -1
- package/dist/units.cjs +7 -0
- package/dist/units.d.cts +6 -1
- package/dist/units.d.ts +6 -1
- package/dist/units.js +6 -1
- package/dist/workbook/chart.cjs +230 -0
- package/dist/workbook/chart.d.cts +19 -0
- package/dist/workbook/chart.d.ts +19 -0
- package/dist/workbook/chart.js +229 -0
- package/dist/workbook/comments.cjs +2 -1
- package/dist/workbook/comments.d.cts +7 -2
- package/dist/workbook/comments.d.ts +7 -2
- package/dist/workbook/comments.js +2 -2
- package/dist/workbook/conditional-format-12.cjs +32 -1
- package/dist/workbook/conditional-format-12.d.cts +2 -2
- package/dist/workbook/conditional-format-12.d.ts +2 -2
- package/dist/workbook/conditional-format-12.js +33 -3
- package/dist/workbook/conditional-format-ex.cjs +53 -0
- package/dist/workbook/conditional-format-ex.d.cts +13 -0
- package/dist/workbook/conditional-format-ex.d.ts +13 -0
- package/dist/workbook/conditional-format-ex.js +52 -0
- package/dist/workbook/conditional-format.cjs +46 -23
- package/dist/workbook/conditional-format.d.cts +2 -2
- package/dist/workbook/conditional-format.d.ts +2 -2
- package/dist/workbook/conditional-format.js +46 -23
- package/dist/workbook/data-validation.d.cts +1 -1
- package/dist/workbook/data-validation.d.ts +1 -1
- package/dist/workbook/drawing.cjs +270 -0
- package/dist/workbook/drawing.d.cts +31 -0
- package/dist/workbook/drawing.d.ts +31 -0
- package/dist/workbook/drawing.js +268 -0
- package/dist/workbook/globals-writer.d.cts +2 -2
- package/dist/workbook/globals-writer.d.ts +2 -2
- package/dist/workbook/globals.d.cts +4 -4
- package/dist/workbook/globals.d.ts +4 -4
- package/dist/workbook/print-names.d.cts +1 -1
- package/dist/workbook/print-names.d.ts +1 -1
- package/dist/workbook/sheet-writer.cjs +1 -1
- package/dist/workbook/sheet-writer.js +1 -1
- package/dist/workbook/sheet.cjs +11 -0
- package/dist/workbook/sheet.d.cts +5 -5
- package/dist/workbook/sheet.d.ts +5 -5
- package/dist/workbook/sheet.js +12 -1
- package/dist/{xf-colors-mqerVt2O.d.cts → xf-colors-aeH9Ax3Q.d.cts} +1 -1
- package/dist/{xf-colors-d3OvRw76.d.ts → xf-colors-kdNsiNYt.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/conditional-format-Czh2oTzQ.d.cts +0 -29
- package/dist/conditional-format-DOdazxWe.d.ts +0 -29
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/drawing/shapes.d.ts
|
|
2
|
+
/** One drawing shape's own fixed geometry and identity -- what a Sp/Opt/ClientAnchor triple inside one SpContainer states. Nothing about what KIND of content the shape holds (a picture, a chart, an autoshape) lives here: that is the paired Obj record's own ftCmo.ot, resolved by workbook/drawing.ts once shapes and Obj records are matched up. */
|
|
3
|
+
interface DrawingShape {
|
|
4
|
+
readonly shapeType: number;
|
|
5
|
+
readonly spid: number;
|
|
6
|
+
/** 1-based index into the workbook's own Blip Store ([MS-ODRAW] "pib"), present only for a shape whose Opt property table actually states one -- a picture shape, in practice. */
|
|
7
|
+
readonly blipIndex: number | undefined;
|
|
8
|
+
readonly anchor: ShapeAnchor;
|
|
9
|
+
}
|
|
10
|
+
/** [MS-XLS] 2.5.163 OfficeArtClientAnchorSheet: a shape's placement as a top-left and bottom-right corner, each a cell plus a fractional offset within it -- dxL/dxR in 1/1024ths of that cell's own width, dyT/dyB in 1/256ths of that cell's own height (the two axes use different denominators; see this record's own field-by-field citation in escher-constants.ts). */
|
|
11
|
+
interface ShapeAnchor {
|
|
12
|
+
readonly colL: number;
|
|
13
|
+
readonly dxL: number;
|
|
14
|
+
readonly rwT: number;
|
|
15
|
+
readonly dyT: number;
|
|
16
|
+
readonly colR: number;
|
|
17
|
+
readonly dxR: number;
|
|
18
|
+
readonly rwB: number;
|
|
19
|
+
readonly dyB: number;
|
|
20
|
+
}
|
|
21
|
+
/** Reads one worksheet's own concatenated MsoDrawing bytes into an ordered list of its real (non-patriarch) top-level shapes. A stream this reader cannot make sense of at all (empty, or carrying no DgContainer) yields no shapes rather than throwing -- workbook/drawing.ts already treats "this sheet has a drawing" as optional. */
|
|
22
|
+
declare function readSheetShapes(drawingBytes: Uint8Array<ArrayBuffer>): readonly DrawingShape[];
|
|
23
|
+
//#endregion
|
|
24
|
+
export { DrawingShape, ShapeAnchor, readSheetShapes };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { BiffFormatError } from "../biff/records.js";
|
|
2
|
+
import { BlockCursor } from "../biff/cursor.js";
|
|
3
|
+
import { ESCHER_CLIENT_ANCHOR, ESCHER_OPT, ESCHER_SP, ESCHER_SPGR_CONTAINER } from "./escher-constants.js";
|
|
4
|
+
import { childrenOfType, readEscherRecords } from "./escher.js";
|
|
5
|
+
//#region src/drawing/shapes.ts
|
|
6
|
+
const CLIENT_ANCHOR_SIZE = 18;
|
|
7
|
+
/** Reads one worksheet's own concatenated MsoDrawing bytes into an ordered list of its real (non-patriarch) top-level shapes. A stream this reader cannot make sense of at all (empty, or carrying no DgContainer) yields no shapes rather than throwing -- workbook/drawing.ts already treats "this sheet has a drawing" as optional. */
|
|
8
|
+
function readSheetShapes(drawingBytes) {
|
|
9
|
+
if (drawingBytes.length === 0) return [];
|
|
10
|
+
const dg = readEscherRecords(drawingBytes).find((record) => record.kind === "container" && record.recType === 61442);
|
|
11
|
+
if (dg === void 0) return [];
|
|
12
|
+
const rootSpgr = childrenOfType(dg, ESCHER_SPGR_CONTAINER)[0];
|
|
13
|
+
if (rootSpgr?.kind !== "container") return [];
|
|
14
|
+
return readGroupShapes(rootSpgr);
|
|
15
|
+
}
|
|
16
|
+
/** The root group's own direct children, in document order, restricted to the two kinds a shape tree ever nests: further shape groups and ordinary shape containers. Keeps document order across a mix of the two (a real drawing can place a group between two ordinary shapes) rather than processing every group before every plain shape. */
|
|
17
|
+
function interleaveGroupOrder(group) {
|
|
18
|
+
return group.children.filter((child) => child.kind === "container" && (child.recType === 61444 || child.recType === 61443));
|
|
19
|
+
}
|
|
20
|
+
/** A nested shape group: its own first child SpContainer is the group's own shape record (no cell anchor, [MS-ODRAW] "fGroup"/"fChild"), and every shape after it -- ordinary or a further nested group -- is a real child shape, read the identical way. */
|
|
21
|
+
function readGroupShapes(group) {
|
|
22
|
+
const [, ...rest] = interleaveGroupOrder(group);
|
|
23
|
+
const shapes = [];
|
|
24
|
+
for (const child of rest) if (child.recType === 61443) shapes.push(...readGroupShapes(child));
|
|
25
|
+
else {
|
|
26
|
+
const shape = readShapeContainer(child);
|
|
27
|
+
if (shape !== void 0) shapes.push(shape);
|
|
28
|
+
}
|
|
29
|
+
return shapes;
|
|
30
|
+
}
|
|
31
|
+
/** One SpContainer's own Sp/Opt/ClientAnchor children -- undefined when the shape carries no cell anchor at all (a malformed or unusually authored file; every real placed shape has one). */
|
|
32
|
+
function readShapeContainer(container) {
|
|
33
|
+
const sp = childrenOfType(container, ESCHER_SP)[0];
|
|
34
|
+
if (sp?.kind !== "atom") return;
|
|
35
|
+
const spid = new BlockCursor([sp.data]).u32();
|
|
36
|
+
const anchorRecord = childrenOfType(container, ESCHER_CLIENT_ANCHOR)[0];
|
|
37
|
+
if (anchorRecord?.kind !== "atom") return;
|
|
38
|
+
const anchor = readClientAnchor(anchorRecord.data);
|
|
39
|
+
if (anchor === void 0) return;
|
|
40
|
+
const opt = childrenOfType(container, ESCHER_OPT)[0];
|
|
41
|
+
let blipIndex;
|
|
42
|
+
if (opt?.kind === "atom") try {
|
|
43
|
+
blipIndex = readPibProperty(opt.data);
|
|
44
|
+
} catch (error) {
|
|
45
|
+
if (!(error instanceof BiffFormatError)) throw error;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
shapeType: sp.recInstance,
|
|
49
|
+
spid,
|
|
50
|
+
blipIndex,
|
|
51
|
+
anchor
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function readClientAnchor(data) {
|
|
55
|
+
if (data.length < CLIENT_ANCHOR_SIZE) return;
|
|
56
|
+
const cursor = new BlockCursor([data]);
|
|
57
|
+
cursor.skip(2);
|
|
58
|
+
return {
|
|
59
|
+
colL: cursor.u16(),
|
|
60
|
+
dxL: cursor.i16(),
|
|
61
|
+
rwT: cursor.u16(),
|
|
62
|
+
dyT: cursor.i16(),
|
|
63
|
+
colR: cursor.u16(),
|
|
64
|
+
dxR: cursor.i16(),
|
|
65
|
+
rwB: cursor.u16(),
|
|
66
|
+
dyB: cursor.i16()
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/** Walks an Opt atom's own FOPTE array looking for the `pib` property ([MS-ODRAW] "pib": opid.opid MUST be 0x0104) -- undefined when the shape states no `pib` at all, or states one through the complex-data trailer form (fComplex set) this reader does not resolve, which is not the common inline-index shape a picture shape's own pib actually takes. */
|
|
70
|
+
function readPibProperty(data) {
|
|
71
|
+
const cursor = new BlockCursor([data]);
|
|
72
|
+
while (cursor.hasMore()) {
|
|
73
|
+
const opid = cursor.u16();
|
|
74
|
+
const op = cursor.u32();
|
|
75
|
+
if (opid === 260 && (opid & 32768) === 0) return op;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
export { readSheetShapes };
|
package/dist/index.cjs
CHANGED
|
@@ -6,12 +6,12 @@ const require_units = require("./units.cjs");
|
|
|
6
6
|
const require_biff_substreams = require("./biff/substreams.cjs");
|
|
7
7
|
const require_biff_cursor = require("./biff/cursor.cjs");
|
|
8
8
|
const require_biff_strings = require("./biff/strings.cjs");
|
|
9
|
+
const require_biff_errors = require("./biff/errors.cjs");
|
|
9
10
|
const require_biff_write_errors = require("./biff/write-errors.cjs");
|
|
10
11
|
const require_serial = require("./serial.cjs");
|
|
11
12
|
const require_biff_builder = require("./biff/builder.cjs");
|
|
12
13
|
const require_biff_record_writer = require("./biff/record-writer.cjs");
|
|
13
14
|
const require_workbook_globals = require("./workbook/globals.cjs");
|
|
14
|
-
const require_biff_errors = require("./biff/errors.cjs");
|
|
15
15
|
const require_biff_rk = require("./biff/rk.cjs");
|
|
16
16
|
const require_workbook_sheet = require("./workbook/sheet.cjs");
|
|
17
17
|
const require_content = require("./content.cjs");
|
|
@@ -30,9 +30,12 @@ exports.BOF_TYPE_WORKSHEET = require_biff_record_types.BOF_TYPE_WORKSHEET;
|
|
|
30
30
|
exports.BiffFormatError = require_biff_records.BiffFormatError;
|
|
31
31
|
exports.BiffWriteError = require_biff_write_errors.BiffWriteError;
|
|
32
32
|
exports.BlockCursor = require_biff_cursor.BlockCursor;
|
|
33
|
+
exports.DEFAULT_COLUMN_WIDTH_CHARS = require_units.DEFAULT_COLUMN_WIDTH_CHARS;
|
|
34
|
+
exports.DEFAULT_ROW_HEIGHT_PT = require_units.DEFAULT_ROW_HEIGHT_PT;
|
|
33
35
|
exports.GENERAL_CELL_XF_INDEX = require_workbook_globals_writer.GENERAL_CELL_XF_INDEX;
|
|
34
36
|
exports.HEADER_SIZE = require_biff_records.HEADER_SIZE;
|
|
35
37
|
exports.MAX_RECORD_DATA_SIZE = require_biff_record_types.MAX_RECORD_DATA_SIZE;
|
|
38
|
+
exports.RECORD_AI = require_biff_record_types.RECORD_AI;
|
|
36
39
|
exports.RECORD_ARRAY = require_biff_record_types.RECORD_ARRAY;
|
|
37
40
|
exports.RECORD_BLANK = require_biff_record_types.RECORD_BLANK;
|
|
38
41
|
exports.RECORD_BOF = require_biff_record_types.RECORD_BOF;
|
|
@@ -46,6 +49,7 @@ exports.RECORD_CALCREFMODE = require_biff_record_types.RECORD_CALCREFMODE;
|
|
|
46
49
|
exports.RECORD_CALCSAVERECALC = require_biff_record_types.RECORD_CALCSAVERECALC;
|
|
47
50
|
exports.RECORD_CF = require_biff_record_types.RECORD_CF;
|
|
48
51
|
exports.RECORD_CF12 = require_biff_record_types.RECORD_CF12;
|
|
52
|
+
exports.RECORD_CFEX = require_biff_record_types.RECORD_CFEX;
|
|
49
53
|
exports.RECORD_COLINFO = require_biff_record_types.RECORD_COLINFO;
|
|
50
54
|
exports.RECORD_CONDFMT = require_biff_record_types.RECORD_CONDFMT;
|
|
51
55
|
exports.RECORD_CONDFMT12 = require_biff_record_types.RECORD_CONDFMT12;
|
|
@@ -71,6 +75,9 @@ exports.RECORD_LABELSST = require_biff_record_types.RECORD_LABELSST;
|
|
|
71
75
|
exports.RECORD_LBL = require_biff_record_types.RECORD_LBL;
|
|
72
76
|
exports.RECORD_LEFTMARGIN = require_biff_record_types.RECORD_LEFTMARGIN;
|
|
73
77
|
exports.RECORD_MERGECELLS = require_biff_record_types.RECORD_MERGECELLS;
|
|
78
|
+
exports.RECORD_MSODRAWING = require_biff_record_types.RECORD_MSODRAWING;
|
|
79
|
+
exports.RECORD_MSODRAWINGGROUP = require_biff_record_types.RECORD_MSODRAWINGGROUP;
|
|
80
|
+
exports.RECORD_MSODRAWINGSELECTION = require_biff_record_types.RECORD_MSODRAWINGSELECTION;
|
|
74
81
|
exports.RECORD_MULBLANK = require_biff_record_types.RECORD_MULBLANK;
|
|
75
82
|
exports.RECORD_MULRK = require_biff_record_types.RECORD_MULRK;
|
|
76
83
|
exports.RECORD_NOTE = require_biff_record_types.RECORD_NOTE;
|
|
@@ -84,8 +91,11 @@ exports.RECORD_RK = require_biff_record_types.RECORD_RK;
|
|
|
84
91
|
exports.RECORD_ROW = require_biff_record_types.RECORD_ROW;
|
|
85
92
|
exports.RECORD_RRDHEAD = require_biff_record_types.RECORD_RRDHEAD;
|
|
86
93
|
exports.RECORD_RRDINFO = require_biff_record_types.RECORD_RRDINFO;
|
|
94
|
+
exports.RECORD_SERIES = require_biff_record_types.RECORD_SERIES;
|
|
95
|
+
exports.RECORD_SERIESTEXT = require_biff_record_types.RECORD_SERIESTEXT;
|
|
87
96
|
exports.RECORD_SETUP = require_biff_record_types.RECORD_SETUP;
|
|
88
97
|
exports.RECORD_SHRFMLA = require_biff_record_types.RECORD_SHRFMLA;
|
|
98
|
+
exports.RECORD_SIINDEX = require_biff_record_types.RECORD_SIINDEX;
|
|
89
99
|
exports.RECORD_SST = require_biff_record_types.RECORD_SST;
|
|
90
100
|
exports.RECORD_STRING = require_biff_record_types.RECORD_STRING;
|
|
91
101
|
exports.RECORD_STYLE = require_biff_record_types.RECORD_STYLE;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { writeBofData } from "./biff/bof-writer.cjs";
|
|
2
2
|
import { RecordBuilder } from "./biff/builder.cjs";
|
|
3
|
-
import { t as BlockCursor } from "./cursor-
|
|
3
|
+
import { t as BlockCursor } from "./cursor-CnEuX5qE.cjs";
|
|
4
4
|
import { errorCodeOf, errorTextOf } from "./biff/errors.cjs";
|
|
5
|
-
import { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF } from "./biff/record-types.cjs";
|
|
5
|
+
import { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_CFEX, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF } from "./biff/record-types.cjs";
|
|
6
6
|
import { concatRecords, writeRecord } from "./biff/record-writer.cjs";
|
|
7
7
|
import { i as readRecords, n as BiffRecord, r as HEADER_SIZE, t as BiffFormatError } from "./records-G82UEVq8.cjs";
|
|
8
8
|
import { decodeRkNumber } from "./biff/rk.cjs";
|
|
9
9
|
import { writeRichExtendedString, writeShortXLUnicodeString, writeXLUnicodeString } from "./biff/string-writer.cjs";
|
|
10
10
|
import { readRichExtendedString, readShortXLUnicodeString, readXLUnicodeString, readXLUnicodeStringNoCch } from "./biff/strings.cjs";
|
|
11
|
-
import { a as splitSubstreams, i as recordByteLength, n as Substream, r as groupRecords, t as RecordGroup } from "./substreams-
|
|
11
|
+
import { a as splitSubstreams, i as recordByteLength, n as Substream, r as groupRecords, t as RecordGroup } from "./substreams-XDNgDvRJ.cjs";
|
|
12
12
|
import { BiffWriteError } from "./biff/write-errors.cjs";
|
|
13
13
|
import { writeCellXfRecord, writeFontRecord, writeFormatRecord, writePaletteRecord, writeStyleRecord, writeStyleXfRecord } from "./biff/xf-writer.cjs";
|
|
14
14
|
import { SUMMARY_INFORMATION_STREAM, WorkbookStreams, isXlsFile, readWorkbookStreams } from "./container.cjs";
|
|
15
15
|
import { XlsContentDocument, readXls, readXlsContent } from "./content.cjs";
|
|
16
16
|
import { layoutMetadataToSummaryInformation } from "./metadata.cjs";
|
|
17
17
|
import { isoDateTimeToSerial, isoDateToSerial, isoTimeToSerial, serialToIsoDate, serialToIsoDateTime, serialToIsoTime } from "./serial.cjs";
|
|
18
|
-
import { columnWidthToPoints, inchesToPoints, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, twipsToPoints } from "./units.cjs";
|
|
18
|
+
import { DEFAULT_COLUMN_WIDTH_CHARS, DEFAULT_ROW_HEIGHT_PT, columnWidthToPoints, inchesToPoints, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, twipsToPoints } from "./units.cjs";
|
|
19
19
|
import { CellFormat, SheetEntry, WorkbookGlobals, formatCodeOf, readWorkbookGlobals } from "./workbook/globals.cjs";
|
|
20
20
|
import { CellXfPlanEntry, GENERAL_CELL_XF_INDEX, WorkbookGlobalsBuild, WorkbookGlobalsPlan, buildWorkbookGlobals } from "./workbook/globals-writer.cjs";
|
|
21
21
|
import { RawCell, RawCellValue, RawColumn, RawPrintSettings, RawRange, RawRow, RawSheet, readSheetRecords } from "./workbook/sheet.cjs";
|
|
22
22
|
import { SheetWriteContext, buildWorksheetSubstream } from "./workbook/sheet-writer.cjs";
|
|
23
23
|
import { writeXls, writeXlsContent } from "./write.cjs";
|
|
24
24
|
export * from "excel-number-format";
|
|
25
|
-
export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, BiffFormatError, BiffRecord, BiffWriteError, BlockCursor, CellFormat, CellXfPlanEntry, GENERAL_CELL_XF_INDEX, HEADER_SIZE, MAX_RECORD_DATA_SIZE, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF, RawCell, RawCellValue, RawColumn, RawPrintSettings, RawRange, RawRow, RawSheet, RecordBuilder, RecordGroup, SUMMARY_INFORMATION_STREAM, SheetEntry, SheetWriteContext, Substream, WorkbookGlobals, WorkbookGlobalsBuild, WorkbookGlobalsPlan, WorkbookStreams, XlsContentDocument, buildWorkbookGlobals, buildWorksheetSubstream, columnWidthToPoints, concatRecords, decodeRkNumber, errorCodeOf, errorTextOf, formatCodeOf, groupRecords, inchesToPoints, isXlsFile, isoDateTimeToSerial, isoDateToSerial, isoTimeToSerial, layoutMetadataToSummaryInformation, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, readRecords, readRichExtendedString, readSheetRecords, readShortXLUnicodeString, readWorkbookGlobals, readWorkbookStreams, readXLUnicodeString, readXLUnicodeStringNoCch, readXls, readXlsContent, recordByteLength, serialToIsoDate, serialToIsoDateTime, serialToIsoTime, splitSubstreams, twipsToPoints, writeBofData, writeCellXfRecord, writeFontRecord, writeFormatRecord, writePaletteRecord, writeRecord, writeRichExtendedString, writeShortXLUnicodeString, writeStyleRecord, writeStyleXfRecord, writeXLUnicodeString, writeXls, writeXlsContent };
|
|
25
|
+
export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, BiffFormatError, BiffRecord, BiffWriteError, BlockCursor, CellFormat, CellXfPlanEntry, DEFAULT_COLUMN_WIDTH_CHARS, DEFAULT_ROW_HEIGHT_PT, GENERAL_CELL_XF_INDEX, HEADER_SIZE, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_CFEX, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF, RawCell, RawCellValue, RawColumn, RawPrintSettings, RawRange, RawRow, RawSheet, RecordBuilder, RecordGroup, SUMMARY_INFORMATION_STREAM, SheetEntry, SheetWriteContext, Substream, WorkbookGlobals, WorkbookGlobalsBuild, WorkbookGlobalsPlan, WorkbookStreams, XlsContentDocument, buildWorkbookGlobals, buildWorksheetSubstream, columnWidthToPoints, concatRecords, decodeRkNumber, errorCodeOf, errorTextOf, formatCodeOf, groupRecords, inchesToPoints, isXlsFile, isoDateTimeToSerial, isoDateToSerial, isoTimeToSerial, layoutMetadataToSummaryInformation, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, readRecords, readRichExtendedString, readSheetRecords, readShortXLUnicodeString, readWorkbookGlobals, readWorkbookStreams, readXLUnicodeString, readXLUnicodeStringNoCch, readXls, readXlsContent, recordByteLength, serialToIsoDate, serialToIsoDateTime, serialToIsoTime, splitSubstreams, twipsToPoints, writeBofData, writeCellXfRecord, writeFontRecord, writeFormatRecord, writePaletteRecord, writeRecord, writeRichExtendedString, writeShortXLUnicodeString, writeStyleRecord, writeStyleXfRecord, writeXLUnicodeString, writeXls, writeXlsContent };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { writeBofData } from "./biff/bof-writer.js";
|
|
2
2
|
import { RecordBuilder } from "./biff/builder.js";
|
|
3
|
-
import { t as BlockCursor } from "./cursor-
|
|
3
|
+
import { t as BlockCursor } from "./cursor-CnEuX5qE.js";
|
|
4
4
|
import { errorCodeOf, errorTextOf } from "./biff/errors.js";
|
|
5
|
-
import { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF } from "./biff/record-types.js";
|
|
5
|
+
import { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_CFEX, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF } from "./biff/record-types.js";
|
|
6
6
|
import { concatRecords, writeRecord } from "./biff/record-writer.js";
|
|
7
7
|
import { i as readRecords, n as BiffRecord, r as HEADER_SIZE, t as BiffFormatError } from "./records-G82UEVq8.js";
|
|
8
8
|
import { decodeRkNumber } from "./biff/rk.js";
|
|
9
9
|
import { writeRichExtendedString, writeShortXLUnicodeString, writeXLUnicodeString } from "./biff/string-writer.js";
|
|
10
10
|
import { readRichExtendedString, readShortXLUnicodeString, readXLUnicodeString, readXLUnicodeStringNoCch } from "./biff/strings.js";
|
|
11
|
-
import { a as splitSubstreams, i as recordByteLength, n as Substream, r as groupRecords, t as RecordGroup } from "./substreams-
|
|
11
|
+
import { a as splitSubstreams, i as recordByteLength, n as Substream, r as groupRecords, t as RecordGroup } from "./substreams-CgTHx5kX.js";
|
|
12
12
|
import { BiffWriteError } from "./biff/write-errors.js";
|
|
13
13
|
import { writeCellXfRecord, writeFontRecord, writeFormatRecord, writePaletteRecord, writeStyleRecord, writeStyleXfRecord } from "./biff/xf-writer.js";
|
|
14
14
|
import { SUMMARY_INFORMATION_STREAM, WorkbookStreams, isXlsFile, readWorkbookStreams } from "./container.js";
|
|
15
15
|
import { XlsContentDocument, readXls, readXlsContent } from "./content.js";
|
|
16
16
|
import { layoutMetadataToSummaryInformation } from "./metadata.js";
|
|
17
17
|
import { isoDateTimeToSerial, isoDateToSerial, isoTimeToSerial, serialToIsoDate, serialToIsoDateTime, serialToIsoTime } from "./serial.js";
|
|
18
|
-
import { columnWidthToPoints, inchesToPoints, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, twipsToPoints } from "./units.js";
|
|
18
|
+
import { DEFAULT_COLUMN_WIDTH_CHARS, DEFAULT_ROW_HEIGHT_PT, columnWidthToPoints, inchesToPoints, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, twipsToPoints } from "./units.js";
|
|
19
19
|
import { CellFormat, SheetEntry, WorkbookGlobals, formatCodeOf, readWorkbookGlobals } from "./workbook/globals.js";
|
|
20
20
|
import { CellXfPlanEntry, GENERAL_CELL_XF_INDEX, WorkbookGlobalsBuild, WorkbookGlobalsPlan, buildWorkbookGlobals } from "./workbook/globals-writer.js";
|
|
21
21
|
import { RawCell, RawCellValue, RawColumn, RawPrintSettings, RawRange, RawRow, RawSheet, readSheetRecords } from "./workbook/sheet.js";
|
|
22
22
|
import { SheetWriteContext, buildWorksheetSubstream } from "./workbook/sheet-writer.js";
|
|
23
23
|
import { writeXls, writeXlsContent } from "./write.js";
|
|
24
24
|
export * from "excel-number-format";
|
|
25
|
-
export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, BiffFormatError, BiffRecord, BiffWriteError, BlockCursor, CellFormat, CellXfPlanEntry, GENERAL_CELL_XF_INDEX, HEADER_SIZE, MAX_RECORD_DATA_SIZE, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF, RawCell, RawCellValue, RawColumn, RawPrintSettings, RawRange, RawRow, RawSheet, RecordBuilder, RecordGroup, SUMMARY_INFORMATION_STREAM, SheetEntry, SheetWriteContext, Substream, WorkbookGlobals, WorkbookGlobalsBuild, WorkbookGlobalsPlan, WorkbookStreams, XlsContentDocument, buildWorkbookGlobals, buildWorksheetSubstream, columnWidthToPoints, concatRecords, decodeRkNumber, errorCodeOf, errorTextOf, formatCodeOf, groupRecords, inchesToPoints, isXlsFile, isoDateTimeToSerial, isoDateToSerial, isoTimeToSerial, layoutMetadataToSummaryInformation, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, readRecords, readRichExtendedString, readSheetRecords, readShortXLUnicodeString, readWorkbookGlobals, readWorkbookStreams, readXLUnicodeString, readXLUnicodeStringNoCch, readXls, readXlsContent, recordByteLength, serialToIsoDate, serialToIsoDateTime, serialToIsoTime, splitSubstreams, twipsToPoints, writeBofData, writeCellXfRecord, writeFontRecord, writeFormatRecord, writePaletteRecord, writeRecord, writeRichExtendedString, writeShortXLUnicodeString, writeStyleRecord, writeStyleXfRecord, writeXLUnicodeString, writeXls, writeXlsContent };
|
|
25
|
+
export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, BiffFormatError, BiffRecord, BiffWriteError, BlockCursor, CellFormat, CellXfPlanEntry, DEFAULT_COLUMN_WIDTH_CHARS, DEFAULT_ROW_HEIGHT_PT, GENERAL_CELL_XF_INDEX, HEADER_SIZE, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_CFEX, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF, RawCell, RawCellValue, RawColumn, RawPrintSettings, RawRange, RawRow, RawSheet, RecordBuilder, RecordGroup, SUMMARY_INFORMATION_STREAM, SheetEntry, SheetWriteContext, Substream, WorkbookGlobals, WorkbookGlobalsBuild, WorkbookGlobalsPlan, WorkbookStreams, XlsContentDocument, buildWorkbookGlobals, buildWorksheetSubstream, columnWidthToPoints, concatRecords, decodeRkNumber, errorCodeOf, errorTextOf, formatCodeOf, groupRecords, inchesToPoints, isXlsFile, isoDateTimeToSerial, isoDateToSerial, isoTimeToSerial, layoutMetadataToSummaryInformation, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, readRecords, readRichExtendedString, readSheetRecords, readShortXLUnicodeString, readWorkbookGlobals, readWorkbookStreams, readXLUnicodeString, readXLUnicodeStringNoCch, readXls, readXlsContent, recordByteLength, serialToIsoDate, serialToIsoDateTime, serialToIsoTime, splitSubstreams, twipsToPoints, writeBofData, writeCellXfRecord, writeFontRecord, writeFormatRecord, writePaletteRecord, writeRecord, writeRichExtendedString, writeShortXLUnicodeString, writeStyleRecord, writeStyleXfRecord, writeXLUnicodeString, writeXls, writeXlsContent };
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF } from "./biff/record-types.js";
|
|
1
|
+
import { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_CFEX, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF } from "./biff/record-types.js";
|
|
2
2
|
import { BiffFormatError, HEADER_SIZE, readRecords } from "./biff/records.js";
|
|
3
3
|
import { SUMMARY_INFORMATION_STREAM, isXlsFile, readWorkbookStreams } from "./container.js";
|
|
4
|
-
import { columnWidthToPoints, inchesToPoints, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, twipsToPoints } from "./units.js";
|
|
4
|
+
import { DEFAULT_COLUMN_WIDTH_CHARS, DEFAULT_ROW_HEIGHT_PT, columnWidthToPoints, inchesToPoints, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, twipsToPoints } from "./units.js";
|
|
5
5
|
import { groupRecords, recordByteLength, splitSubstreams } from "./biff/substreams.js";
|
|
6
6
|
import { BlockCursor } from "./biff/cursor.js";
|
|
7
7
|
import { readRichExtendedString, readShortXLUnicodeString, readXLUnicodeString, readXLUnicodeStringNoCch } from "./biff/strings.js";
|
|
8
|
+
import { errorCodeOf, errorTextOf } from "./biff/errors.js";
|
|
8
9
|
import { BiffWriteError } from "./biff/write-errors.js";
|
|
9
10
|
import { isoDateTimeToSerial, isoDateToSerial, isoTimeToSerial, serialToIsoDate, serialToIsoDateTime, serialToIsoTime } from "./serial.js";
|
|
10
11
|
import { RecordBuilder } from "./biff/builder.js";
|
|
11
12
|
import { concatRecords, writeRecord } from "./biff/record-writer.js";
|
|
12
13
|
import { formatCodeOf, readWorkbookGlobals } from "./workbook/globals.js";
|
|
13
|
-
import { errorCodeOf, errorTextOf } from "./biff/errors.js";
|
|
14
14
|
import { decodeRkNumber } from "./biff/rk.js";
|
|
15
15
|
import { readSheetRecords } from "./workbook/sheet.js";
|
|
16
16
|
import { readXls, readXlsContent } from "./content.js";
|
|
@@ -22,4 +22,4 @@ import { GENERAL_CELL_XF_INDEX, buildWorkbookGlobals } from "./workbook/globals-
|
|
|
22
22
|
import { buildWorksheetSubstream } from "./workbook/sheet-writer.js";
|
|
23
23
|
import { writeXls, writeXlsContent } from "./write.js";
|
|
24
24
|
export * from "excel-number-format";
|
|
25
|
-
export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, BiffFormatError, BiffWriteError, BlockCursor, GENERAL_CELL_XF_INDEX, HEADER_SIZE, MAX_RECORD_DATA_SIZE, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF, RecordBuilder, SUMMARY_INFORMATION_STREAM, buildWorkbookGlobals, buildWorksheetSubstream, columnWidthToPoints, concatRecords, decodeRkNumber, errorCodeOf, errorTextOf, formatCodeOf, groupRecords, inchesToPoints, isXlsFile, isoDateTimeToSerial, isoDateToSerial, isoTimeToSerial, layoutMetadataToSummaryInformation, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, readRecords, readRichExtendedString, readSheetRecords, readShortXLUnicodeString, readWorkbookGlobals, readWorkbookStreams, readXLUnicodeString, readXLUnicodeStringNoCch, readXls, readXlsContent, recordByteLength, serialToIsoDate, serialToIsoDateTime, serialToIsoTime, splitSubstreams, twipsToPoints, writeBofData, writeCellXfRecord, writeFontRecord, writeFormatRecord, writePaletteRecord, writeRecord, writeRichExtendedString, writeShortXLUnicodeString, writeStyleRecord, writeStyleXfRecord, writeXLUnicodeString, writeXls, writeXlsContent };
|
|
25
|
+
export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, BiffFormatError, BiffWriteError, BlockCursor, DEFAULT_COLUMN_WIDTH_CHARS, DEFAULT_ROW_HEIGHT_PT, GENERAL_CELL_XF_INDEX, HEADER_SIZE, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_CFEX, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF, RecordBuilder, SUMMARY_INFORMATION_STREAM, buildWorkbookGlobals, buildWorksheetSubstream, columnWidthToPoints, concatRecords, decodeRkNumber, errorCodeOf, errorTextOf, formatCodeOf, groupRecords, inchesToPoints, isXlsFile, isoDateTimeToSerial, isoDateToSerial, isoTimeToSerial, layoutMetadataToSummaryInformation, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, readRecords, readRichExtendedString, readSheetRecords, readShortXLUnicodeString, readWorkbookGlobals, readWorkbookStreams, readXLUnicodeString, readXLUnicodeStringNoCch, readXls, readXlsContent, recordByteLength, serialToIsoDate, serialToIsoDateTime, serialToIsoTime, splitSubstreams, twipsToPoints, writeBofData, writeCellXfRecord, writeFontRecord, writeFormatRecord, writePaletteRecord, writeRecord, writeRichExtendedString, writeShortXLUnicodeString, writeStyleRecord, writeStyleXfRecord, writeXLUnicodeString, writeXls, writeXlsContent };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as RecordGroup } from "./substreams-
|
|
1
|
+
import { t as RecordGroup } from "./substreams-XDNgDvRJ.cjs";
|
|
2
2
|
import { ContentSheetPrintRange, ContentSheetRepeatRange } from "document-schema.js";
|
|
3
3
|
//#region src/workbook/print-names.d.ts
|
|
4
4
|
/** One sheet's print names, as the Lbl records of the globals substream carry them. Every field is absent when the workbook declares no such name for that sheet. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as RecordGroup } from "./substreams-
|
|
1
|
+
import { t as RecordGroup } from "./substreams-CgTHx5kX.js";
|
|
2
2
|
import { ContentSheetPrintRange, ContentSheetRepeatRange } from "document-schema.js";
|
|
3
3
|
//#region src/workbook/print-names.d.ts
|
|
4
4
|
/** One sheet's print names, as the Lbl records of the globals substream carry them. Every field is absent when the workbook declares no such name for that sheet. */
|
|
@@ -37,8 +37,14 @@ interface ParseFormulaOptions {
|
|
|
37
37
|
readonly relativeTo?: FormulaOrigin;
|
|
38
38
|
/** The RgbExtra trailer following `rgce` in the same CellParsedFormula/ArrayParsedFormula ([MS-XLS] 7dd67f0a/242bcf20) -- consulted only when `rgce` contains a PtgArray, one PtgExtraArray pulled off the front for each in the order both arrays share ([MS-XLS] 70f743b2: "The order of the structures MUST be the same as the order of the Ptgs"). Absent (or exhausted before a PtgArray needs it) aborts the parse rather than guessing at the array's values. */
|
|
39
39
|
readonly rgcb?: Uint8Array<ArrayBuffer>;
|
|
40
|
+
/** Invoked with the raw, unquoted text of every PtgStr operand this formula contains, in encounter order -- a side channel for a caller that needs a literal string operand out of a formula whose overall shape it isn't otherwise trying to interpret (conditional-format-12.ts's own readCfTextFilterRule, extracting the search text CFExTextTemplateParams itself has no field for). Does not affect the returned formula text, which still renders the same operand quoted via quoteStringLiteral as it always has. */
|
|
41
|
+
readonly onStringLiteral?: (value: string) => void;
|
|
40
42
|
}
|
|
41
43
|
declare function parseFormulaText(rgce: Uint8Array<ArrayBuffer>, context: FormulaSheetContext, options?: ParseFormulaOptions): string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Returns the raw text of the first PtgStr operand `rgce` contains, or undefined if it contains none -- a narrower question than parseFormulaText's own "render the whole formula", answerable even when the formula wraps that operand in functions this reader has no other reason to understand. Exists for conditional-format-12.ts's own readCfTextFilterRule: a CF12/CFExNonCF12 containsText-family rule states which of the four text-comparison sub-types it is via CFExTextTemplateParams.ctp, but carries the literal search text nowhere else but as this operand in its own formula (Excel's real generated shape being e.g. NOT(ISERROR(SEARCH("text",A1))) for containsText -- see conditional-format-ex.ts's own top comment for the full citation). Walks the whole token stream via parseFormulaText's own onStringLiteral hook rather than scanning for the PtgStr opcode directly, since a raw byte scan cannot tell an opcode byte from a length or count belonging to some other token's own payload.
|
|
46
|
+
*/
|
|
47
|
+
declare function extractFirstStringLiteral(rgce: Uint8Array<ArrayBuffer>, context: FormulaSheetContext): string | undefined;
|
|
42
48
|
/**
|
|
43
49
|
* If `rgce` is EXACTLY one PtgExp token -- which is the only shape a Formula record belonging to a shared or array formula group ever has, including the group's own base cell, which points at itself -- returns the (row, column) of the Formula record that carries the real expression (a ShrFmla or Array record immediately follows it). Returns undefined for every other rgce, so a caller can try this first and fall back to parseFormulaText for a formula that merely happens to open with byte 0x01 for some other reason (it cannot: no other single-byte-opcode Ptg in this reader's vocabulary is 0x01, but a malformed or foreign rgce is not assumed well-formed here either) or is simply longer than five bytes.
|
|
44
50
|
*
|
|
@@ -46,4 +52,4 @@ declare function parseFormulaText(rgce: Uint8Array<ArrayBuffer>, context: Formul
|
|
|
46
52
|
*/
|
|
47
53
|
declare function readPtgExpBase(rgce: Uint8Array<ArrayBuffer>): FormulaOrigin | undefined;
|
|
48
54
|
//#endregion
|
|
49
|
-
export { SheetRange as a, ParseFormulaOptions as i, FormulaOrigin as n,
|
|
55
|
+
export { SheetRange as a, readPtgExpBase as c, ParseFormulaOptions as i, FormulaOrigin as n, extractFirstStringLiteral as o, FormulaSheetContext as r, parseFormulaText as s, ExternalSheetLabel as t };
|
|
@@ -37,8 +37,14 @@ interface ParseFormulaOptions {
|
|
|
37
37
|
readonly relativeTo?: FormulaOrigin;
|
|
38
38
|
/** The RgbExtra trailer following `rgce` in the same CellParsedFormula/ArrayParsedFormula ([MS-XLS] 7dd67f0a/242bcf20) -- consulted only when `rgce` contains a PtgArray, one PtgExtraArray pulled off the front for each in the order both arrays share ([MS-XLS] 70f743b2: "The order of the structures MUST be the same as the order of the Ptgs"). Absent (or exhausted before a PtgArray needs it) aborts the parse rather than guessing at the array's values. */
|
|
39
39
|
readonly rgcb?: Uint8Array<ArrayBuffer>;
|
|
40
|
+
/** Invoked with the raw, unquoted text of every PtgStr operand this formula contains, in encounter order -- a side channel for a caller that needs a literal string operand out of a formula whose overall shape it isn't otherwise trying to interpret (conditional-format-12.ts's own readCfTextFilterRule, extracting the search text CFExTextTemplateParams itself has no field for). Does not affect the returned formula text, which still renders the same operand quoted via quoteStringLiteral as it always has. */
|
|
41
|
+
readonly onStringLiteral?: (value: string) => void;
|
|
40
42
|
}
|
|
41
43
|
declare function parseFormulaText(rgce: Uint8Array<ArrayBuffer>, context: FormulaSheetContext, options?: ParseFormulaOptions): string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Returns the raw text of the first PtgStr operand `rgce` contains, or undefined if it contains none -- a narrower question than parseFormulaText's own "render the whole formula", answerable even when the formula wraps that operand in functions this reader has no other reason to understand. Exists for conditional-format-12.ts's own readCfTextFilterRule: a CF12/CFExNonCF12 containsText-family rule states which of the four text-comparison sub-types it is via CFExTextTemplateParams.ctp, but carries the literal search text nowhere else but as this operand in its own formula (Excel's real generated shape being e.g. NOT(ISERROR(SEARCH("text",A1))) for containsText -- see conditional-format-ex.ts's own top comment for the full citation). Walks the whole token stream via parseFormulaText's own onStringLiteral hook rather than scanning for the PtgStr opcode directly, since a raw byte scan cannot tell an opcode byte from a length or count belonging to some other token's own payload.
|
|
46
|
+
*/
|
|
47
|
+
declare function extractFirstStringLiteral(rgce: Uint8Array<ArrayBuffer>, context: FormulaSheetContext): string | undefined;
|
|
42
48
|
/**
|
|
43
49
|
* If `rgce` is EXACTLY one PtgExp token -- which is the only shape a Formula record belonging to a shared or array formula group ever has, including the group's own base cell, which points at itself -- returns the (row, column) of the Formula record that carries the real expression (a ShrFmla or Array record immediately follows it). Returns undefined for every other rgce, so a caller can try this first and fall back to parseFormulaText for a formula that merely happens to open with byte 0x01 for some other reason (it cannot: no other single-byte-opcode Ptg in this reader's vocabulary is 0x01, but a malformed or foreign rgce is not assumed well-formed here either) or is simply longer than five bytes.
|
|
44
50
|
*
|
|
@@ -46,4 +52,4 @@ declare function parseFormulaText(rgce: Uint8Array<ArrayBuffer>, context: Formul
|
|
|
46
52
|
*/
|
|
47
53
|
declare function readPtgExpBase(rgce: Uint8Array<ArrayBuffer>): FormulaOrigin | undefined;
|
|
48
54
|
//#endregion
|
|
49
|
-
export { SheetRange as a, ParseFormulaOptions as i, FormulaOrigin as n,
|
|
55
|
+
export { SheetRange as a, readPtgExpBase as c, ParseFormulaOptions as i, FormulaOrigin as n, extractFirstStringLiteral as o, FormulaSheetContext as r, parseFormulaText as s, ExternalSheetLabel as t };
|
|
@@ -17,7 +17,7 @@ interface Substream {
|
|
|
17
17
|
}
|
|
18
18
|
/** Joins each record to the Continue records following it, keeping the blocks separate. */
|
|
19
19
|
declare function groupRecords(records: readonly BiffRecord[]): readonly RecordGroup[];
|
|
20
|
-
/** Splits a grouped record sequence into its substreams, verifying each BOF declares BIFF8. */
|
|
20
|
+
/** Splits a grouped record sequence into its substreams, verifying each BOF declares BIFF8. A BOF met while a substream is already open pushes that substream onto a stack and starts a nested one; the nested substream is closed and reported (via its own EOF) before its parent resumes collecting records -- see this module's own top comment for why a stack, not a flat "BOF ends the previous substream", is what a chart embedded in a worksheet needs. */
|
|
21
21
|
declare function splitSubstreams(groups: readonly RecordGroup[]): readonly Substream[];
|
|
22
22
|
//#endregion
|
|
23
23
|
export { splitSubstreams as a, recordByteLength as i, Substream as n, groupRecords as r, RecordGroup as t };
|
|
@@ -17,7 +17,7 @@ interface Substream {
|
|
|
17
17
|
}
|
|
18
18
|
/** Joins each record to the Continue records following it, keeping the blocks separate. */
|
|
19
19
|
declare function groupRecords(records: readonly BiffRecord[]): readonly RecordGroup[];
|
|
20
|
-
/** Splits a grouped record sequence into its substreams, verifying each BOF declares BIFF8. */
|
|
20
|
+
/** Splits a grouped record sequence into its substreams, verifying each BOF declares BIFF8. A BOF met while a substream is already open pushes that substream onto a stack and starts a nested one; the nested substream is closed and reported (via its own EOF) before its parent resumes collecting records -- see this module's own top comment for why a stack, not a flat "BOF ends the previous substream", is what a chart embedded in a worksheet needs. */
|
|
21
21
|
declare function splitSubstreams(groups: readonly RecordGroup[]): readonly Substream[];
|
|
22
22
|
//#endregion
|
|
23
23
|
export { splitSubstreams as a, recordByteLength as i, Substream as n, groupRecords as r, RecordGroup as t };
|
package/dist/units.cjs
CHANGED
|
@@ -13,6 +13,11 @@ const MILLIMETRES_PER_INCH = 25.4;
|
|
|
13
13
|
* 7 is the Calibri-11-at-96dpi value every mainstream spreadsheet tool assumes by default, and the same constant ooxml.js's xlsx reader uses -- so a column of a given width reads back the same number of points whether it arrived as .xls or .xlsx. This package has no font-metrics engine and so cannot compute a workbook's actual digit width from whatever font its Normal style really uses: a workbook using a materially narrower or wider font reads column widths that are honestly approximate rather than exact.
|
|
14
14
|
*/
|
|
15
15
|
const MAX_DIGIT_WIDTH_PX = 7;
|
|
16
|
+
/**
|
|
17
|
+
* Excel's own "Normal" style column width (8.43 characters) and default row height (15pt), for a worksheet grid cell a drawing shape's own anchor names but that carries no explicit ColInfo/Row record of its own to size it -- the identical fallback constants ooxml.js's own xlsx drawing reader uses for the same reason (no font-metrics engine to derive a workbook's real default from), so a shape anchored to an undeclared cell places identically whether it arrived as .xls or .xlsx.
|
|
18
|
+
*/
|
|
19
|
+
const DEFAULT_COLUMN_WIDTH_CHARS = 8.43;
|
|
20
|
+
const DEFAULT_ROW_HEIGHT_PT = 15;
|
|
16
21
|
/** A Row record's height, in twips, as points. */
|
|
17
22
|
function twipsToPoints(twips) {
|
|
18
23
|
return twips / TWIPS_PER_POINT;
|
|
@@ -58,6 +63,8 @@ function pointsToColumnWidth(points) {
|
|
|
58
63
|
return Math.max(coldx, 0);
|
|
59
64
|
}
|
|
60
65
|
//#endregion
|
|
66
|
+
exports.DEFAULT_COLUMN_WIDTH_CHARS = DEFAULT_COLUMN_WIDTH_CHARS;
|
|
67
|
+
exports.DEFAULT_ROW_HEIGHT_PT = DEFAULT_ROW_HEIGHT_PT;
|
|
61
68
|
exports.columnWidthToPoints = columnWidthToPoints;
|
|
62
69
|
exports.inchesToPoints = inchesToPoints;
|
|
63
70
|
exports.millimetresToPoints = millimetresToPoints;
|
package/dist/units.d.cts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
//#region src/units.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Excel's own "Normal" style column width (8.43 characters) and default row height (15pt), for a worksheet grid cell a drawing shape's own anchor names but that carries no explicit ColInfo/Row record of its own to size it -- the identical fallback constants ooxml.js's own xlsx drawing reader uses for the same reason (no font-metrics engine to derive a workbook's real default from), so a shape anchored to an undeclared cell places identically whether it arrived as .xls or .xlsx.
|
|
4
|
+
*/
|
|
5
|
+
declare const DEFAULT_COLUMN_WIDTH_CHARS = 8.43;
|
|
6
|
+
declare const DEFAULT_ROW_HEIGHT_PT = 15;
|
|
2
7
|
/** A Row record's height, in twips, as points. */
|
|
3
8
|
declare function twipsToPoints(twips: number): number;
|
|
4
9
|
/** A margin record's own Xnum ([MS-XLS] 2.4.151 and its three siblings), in inches, as points. */
|
|
@@ -22,4 +27,4 @@ declare function pointsToTwips(points: number): number;
|
|
|
22
27
|
*/
|
|
23
28
|
declare function pointsToColumnWidth(points: number): number;
|
|
24
29
|
//#endregion
|
|
25
|
-
export { columnWidthToPoints, inchesToPoints, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, twipsToPoints };
|
|
30
|
+
export { DEFAULT_COLUMN_WIDTH_CHARS, DEFAULT_ROW_HEIGHT_PT, columnWidthToPoints, inchesToPoints, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, twipsToPoints };
|
package/dist/units.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
//#region src/units.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Excel's own "Normal" style column width (8.43 characters) and default row height (15pt), for a worksheet grid cell a drawing shape's own anchor names but that carries no explicit ColInfo/Row record of its own to size it -- the identical fallback constants ooxml.js's own xlsx drawing reader uses for the same reason (no font-metrics engine to derive a workbook's real default from), so a shape anchored to an undeclared cell places identically whether it arrived as .xls or .xlsx.
|
|
4
|
+
*/
|
|
5
|
+
declare const DEFAULT_COLUMN_WIDTH_CHARS = 8.43;
|
|
6
|
+
declare const DEFAULT_ROW_HEIGHT_PT = 15;
|
|
2
7
|
/** A Row record's height, in twips, as points. */
|
|
3
8
|
declare function twipsToPoints(twips: number): number;
|
|
4
9
|
/** A margin record's own Xnum ([MS-XLS] 2.4.151 and its three siblings), in inches, as points. */
|
|
@@ -22,4 +27,4 @@ declare function pointsToTwips(points: number): number;
|
|
|
22
27
|
*/
|
|
23
28
|
declare function pointsToColumnWidth(points: number): number;
|
|
24
29
|
//#endregion
|
|
25
|
-
export { columnWidthToPoints, inchesToPoints, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, twipsToPoints };
|
|
30
|
+
export { DEFAULT_COLUMN_WIDTH_CHARS, DEFAULT_ROW_HEIGHT_PT, columnWidthToPoints, inchesToPoints, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, twipsToPoints };
|
package/dist/units.js
CHANGED
|
@@ -12,6 +12,11 @@ const MILLIMETRES_PER_INCH = 25.4;
|
|
|
12
12
|
* 7 is the Calibri-11-at-96dpi value every mainstream spreadsheet tool assumes by default, and the same constant ooxml.js's xlsx reader uses -- so a column of a given width reads back the same number of points whether it arrived as .xls or .xlsx. This package has no font-metrics engine and so cannot compute a workbook's actual digit width from whatever font its Normal style really uses: a workbook using a materially narrower or wider font reads column widths that are honestly approximate rather than exact.
|
|
13
13
|
*/
|
|
14
14
|
const MAX_DIGIT_WIDTH_PX = 7;
|
|
15
|
+
/**
|
|
16
|
+
* Excel's own "Normal" style column width (8.43 characters) and default row height (15pt), for a worksheet grid cell a drawing shape's own anchor names but that carries no explicit ColInfo/Row record of its own to size it -- the identical fallback constants ooxml.js's own xlsx drawing reader uses for the same reason (no font-metrics engine to derive a workbook's real default from), so a shape anchored to an undeclared cell places identically whether it arrived as .xls or .xlsx.
|
|
17
|
+
*/
|
|
18
|
+
const DEFAULT_COLUMN_WIDTH_CHARS = 8.43;
|
|
19
|
+
const DEFAULT_ROW_HEIGHT_PT = 15;
|
|
15
20
|
/** A Row record's height, in twips, as points. */
|
|
16
21
|
function twipsToPoints(twips) {
|
|
17
22
|
return twips / TWIPS_PER_POINT;
|
|
@@ -57,4 +62,4 @@ function pointsToColumnWidth(points) {
|
|
|
57
62
|
return Math.max(coldx, 0);
|
|
58
63
|
}
|
|
59
64
|
//#endregion
|
|
60
|
-
export { columnWidthToPoints, inchesToPoints, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, twipsToPoints };
|
|
65
|
+
export { DEFAULT_COLUMN_WIDTH_CHARS, DEFAULT_ROW_HEIGHT_PT, columnWidthToPoints, inchesToPoints, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, twipsToPoints };
|