@xlsx-editor.dev/core 0.0.0-placeholder.0 → 0.1.0-beta.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/LICENSE +217 -0
- package/README.md +254 -2
- package/THIRD_PARTY_NOTICES.md +78 -0
- package/dist/automation.d.ts +299 -0
- package/dist/automation.js +42 -0
- package/dist/builtins-nmHrq2Et.d.ts +37 -0
- package/dist/cascade.d.ts +196 -0
- package/dist/cascade.js +60 -0
- package/dist/cell-format-DW8yF-c-.d.ts +226 -0
- package/dist/chunk-2DLJYRJC.js +3171 -0
- package/dist/chunk-2ZU4337U.js +204 -0
- package/dist/chunk-44L37ENZ.js +8219 -0
- package/dist/chunk-77N55BLP.js +911 -0
- package/dist/chunk-7PV5HQPE.js +84 -0
- package/dist/chunk-E4VJJ556.js +756 -0
- package/dist/chunk-KG4IL4JI.js +436 -0
- package/dist/chunk-PLDK4XO6.js +9125 -0
- package/dist/chunk-PRHLYXHL.js +1699 -0
- package/dist/chunk-TE4FXG5T.js +3156 -0
- package/dist/contracts.d.ts +32 -0
- package/dist/contracts.js +0 -0
- package/dist/dist-C7NLNUMD.js +2850 -0
- package/dist/editor.d.ts +3167 -0
- package/dist/editor.js +309 -0
- package/dist/harfbuzz-measurer-CkKfsEyu.d.ts +128 -0
- package/dist/harfbuzz.wasm +0 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +309 -0
- package/dist/layout.d.ts +111 -0
- package/dist/layout.js +104 -0
- package/dist/merge-commands-DthcNpfw.d.ts +53 -0
- package/dist/node-module-shim-LQXGL47O.js +18 -0
- package/dist/ops-CfUCjyph.d.ts +629 -0
- package/dist/output.d.ts +177 -0
- package/dist/output.js +29 -0
- package/dist/sheet-index-P5vevMWX.d.ts +52 -0
- package/dist/sheet-layout-D9M_4EBn.d.ts +494 -0
- package/dist/sheet-protection-D8goxm58.d.ts +209 -0
- package/dist/store.d.ts +615 -0
- package/dist/store.js +272 -0
- package/dist/theme-BprDji6x.d.ts +16 -0
- package/dist/units-D6CD_A5I.d.ts +13 -0
- package/dist/workbook-index-DsbeR8Kb.d.ts +294 -0
- package/licenses/Emscripten-LICENSE.txt +102 -0
- package/licenses/HarfBuzz-COPYING.txt +42 -0
- package/licenses/HarfBuzz-USE-MIT.txt +21 -0
- package/licenses/HarfBuzz-source-notices.txt +4508 -0
- package/licenses/README.md +19 -0
- package/licenses/Unicode-LICENSE.txt +39 -0
- package/licenses/compiler-rt-LICENSE.txt +311 -0
- package/licenses/harfbuzz-manifest.json +84 -0
- package/licenses/musl-COPYRIGHT.txt +193 -0
- package/package.json +79 -6
- package/src/styles/editor.css +1933 -0
- package/src/styles/editor.css.d.ts +2 -0
package/dist/store.d.ts
ADDED
|
@@ -0,0 +1,615 @@
|
|
|
1
|
+
import { R as RangeBox } from './sheet-protection-D8goxm58.js';
|
|
2
|
+
export { C as CellAddress, D as DEFAULT_LIMITS, M as MAX_COLS, a as MAX_COLUMN_WIDTH, b as MAX_FORMAT_NEW_CELLS, c as MAX_RESIZE_NEW_ROWS, d as MAX_ROWS, e as MAX_ROW_HEIGHT, f as ResourceLimits, S as STRUCTURE_PERMIT, g as SheetProtection, W as WorkbookProtection, h as cellLocked, i as clearBlocker, j as clearFormatsOverflow, k as clearRangeBlocker, l as columnLetters, m as columnNumber, n as formatCellRef, o as formatRangeOverflow, p as lockedCellIn, q as parseCellRef, r as protectionRefusal, s as rangeBounds, t as readSheetProtection, u as readWorkbookProtection, v as resolveLimits, w as wrappedValueCell } from './sheet-protection-D8goxm58.js';
|
|
3
|
+
import { E as Element, a as XmlPart, N as Node, X as XlsxPackage, W as WorkbookIndex } from './workbook-index-DsbeR8Kb.js';
|
|
4
|
+
export { A as Attr, C as CONTENT_TYPES_PART, b as NamespaceDecl, c as NodeId, d as NodeKind, P as PackagePart, e as PackageRejection, f as PackageResult, R as Relationship, S as SheetEntry, g as SheetState, h as StyleLists, T as TextNode, i as XmlLimits, j as XmlPartRejection, k as XmlPartResult, l as XmlRejection, Z as ZipLimits, m as binaryPartOf, n as canonicalPackageFingerprint, o as contentTypeOf, p as decodeXml, q as equivalentPartName, r as kindOf, s as localNameKeys, t as mainWorkbookPart, u as packageFingerprints, v as parseXmlPart, w as parseXmlPartSteps, x as partOf, y as partPastLimit, z as readXlsx, B as readXlsxSteps, D as relTarget, F as relTargetByType, G as relationshipById, H as relationshipsOf, I as relsPartName, J as sharedStringItems, K as sheetByName, L as sheetNameKey, M as sheetsByKey, O as styleLists, Q as themeRoot, U as workbookIndex, V as xmlPartOf } from './workbook-index-DsbeR8Kb.js';
|
|
5
|
+
import { S as SheetIndex, C as CellEntry } from './sheet-index-P5vevMWX.js';
|
|
6
|
+
export { a as SheetProblem, c as cellKey, k as keyAddress, s as sheetIndex } from './sheet-index-P5vevMWX.js';
|
|
7
|
+
import { O as OpRejection, H as HistoryOp, W as WorkbookOp } from './ops-CfUCjyph.js';
|
|
8
|
+
export { C as CellInput, a as FIRST_CUSTOM_NUMFMT_ID, F as FormatPatch, I as InverseOp, M as MAX_FONT_NAME_LENGTH, b as MAX_FORMAT_CODE_LENGTH, P as PATCH_BORDER_STYLES, c as PATCH_HORIZONTAL, d as PATCH_VERTICAL, e as PatchBorderStyle, f as PatchGroups, g as PatchHorizontal, h as PatchVertical, i as STRUCTURE_SUBJECT_KINDS, S as StructuralOpName, j as StructureSubject, k as StructureSubjectKind, l as lowerNumberFormat, p as patchGroups, m as patchProblem, s as structureBlocker } from './ops-CfUCjyph.js';
|
|
9
|
+
|
|
10
|
+
declare const NS: Readonly<{
|
|
11
|
+
x: "http://schemas.openxmlformats.org/spreadsheetml/2006/main";
|
|
12
|
+
xdr: "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing";
|
|
13
|
+
a: "http://schemas.openxmlformats.org/drawingml/2006/main";
|
|
14
|
+
r: "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
15
|
+
mc: "http://schemas.openxmlformats.org/markup-compatibility/2006";
|
|
16
|
+
pic: "http://schemas.openxmlformats.org/drawingml/2006/picture";
|
|
17
|
+
c: "http://schemas.openxmlformats.org/drawingml/2006/chart";
|
|
18
|
+
rel: "http://schemas.openxmlformats.org/package/2006/relationships";
|
|
19
|
+
ct: "http://schemas.openxmlformats.org/package/2006/content-types";
|
|
20
|
+
xml: "http://www.w3.org/XML/1998/namespace";
|
|
21
|
+
xmlns: "http://www.w3.org/2000/xmlns/";
|
|
22
|
+
xsi: "http://www.w3.org/2001/XMLSchema-instance";
|
|
23
|
+
}>;
|
|
24
|
+
/** The SpreadsheetML namespace of ECMA-376 Strict. The engine reads Transitional only. */
|
|
25
|
+
declare const STRICT_SPREADSHEETML = "http://purl.oclc.org/ooxml/spreadsheetml/main";
|
|
26
|
+
/** A conventional prefix the engine knows. */
|
|
27
|
+
type KnownPrefix = keyof typeof NS;
|
|
28
|
+
/** An expanded element or attribute name. */
|
|
29
|
+
interface QName {
|
|
30
|
+
readonly ns: string;
|
|
31
|
+
readonly local: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The expanded name for a conventional `prefix:local` spelling. Unprefixed means no namespace
|
|
35
|
+
* (the usual case for attributes). Throws on an unknown prefix: this is for engine code, never
|
|
36
|
+
* for file data.
|
|
37
|
+
*/
|
|
38
|
+
declare function q(name: string): QName;
|
|
39
|
+
/** The conventional prefix for a namespace URI, used when the engine creates nodes. */
|
|
40
|
+
declare function conventionalPrefix(ns: string): string | undefined;
|
|
41
|
+
/** Relationship types the engine follows. */
|
|
42
|
+
declare const REL: Readonly<{
|
|
43
|
+
officeDocument: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument";
|
|
44
|
+
worksheet: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet";
|
|
45
|
+
chartsheet: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet";
|
|
46
|
+
sharedStrings: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings";
|
|
47
|
+
styles: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles";
|
|
48
|
+
theme: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme";
|
|
49
|
+
calcChain: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain";
|
|
50
|
+
drawing: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing";
|
|
51
|
+
image: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image";
|
|
52
|
+
hyperlink: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink";
|
|
53
|
+
}>;
|
|
54
|
+
/** Content types the engine reads. */
|
|
55
|
+
declare const CONTENT_TYPE: Readonly<{
|
|
56
|
+
workbook: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml";
|
|
57
|
+
template: "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml";
|
|
58
|
+
worksheet: "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml";
|
|
59
|
+
sharedStrings: "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml";
|
|
60
|
+
styles: "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml";
|
|
61
|
+
theme: "application/vnd.openxmlformats-officedocument.theme+xml";
|
|
62
|
+
drawing: "application/vnd.openxmlformats-officedocument.drawing+xml";
|
|
63
|
+
relationships: "application/vnd.openxmlformats-package.relationships+xml";
|
|
64
|
+
}>;
|
|
65
|
+
|
|
66
|
+
/** Whether an element has the given expanded name. */
|
|
67
|
+
declare function is(el: Element | undefined, name: string | QName): el is Element;
|
|
68
|
+
/** The first child element with the given name. */
|
|
69
|
+
declare function child(el: Element | undefined, name: string | QName): Element | undefined;
|
|
70
|
+
/** All child elements with the given name. */
|
|
71
|
+
declare function children(el: Element | undefined, name: string | QName): Element[];
|
|
72
|
+
/** All child elements. */
|
|
73
|
+
declare function elements(el: Element | undefined): Element[];
|
|
74
|
+
/** Follow a chain of child names. */
|
|
75
|
+
declare function path(el: Element | undefined, ...names: string[]): Element | undefined;
|
|
76
|
+
/** An attribute value, by conventional name (`val`, `r:embed`). */
|
|
77
|
+
declare function attr(el: Element | undefined, name: string | QName): string | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* An integer attribute. Non-numeric or out-of-range values read as `undefined`, so a corrupt
|
|
80
|
+
* file falls back to the inherited value instead of propagating NaN into layout.
|
|
81
|
+
*/
|
|
82
|
+
declare function intAttr(el: Element | undefined, name: string | QName): number | undefined;
|
|
83
|
+
/** An `xsd:boolean` attribute: `1`/`true` and `0`/`false`. */
|
|
84
|
+
declare function boolAttr(el: Element | undefined, name: string | QName): boolean | undefined;
|
|
85
|
+
/** Concatenated descendant text. */
|
|
86
|
+
declare function textOf(el: Element | undefined): string;
|
|
87
|
+
/** Depth-first search for the first descendant element with the given name. */
|
|
88
|
+
declare function find(el: Element | undefined, name: string | QName, maxDepth?: number): Element | undefined;
|
|
89
|
+
|
|
90
|
+
/** Serialize one part to an XML string with the standard OOXML declaration. */
|
|
91
|
+
declare function serializeXmlPart(part: XmlPart): string;
|
|
92
|
+
/**
|
|
93
|
+
* {@link serializeXmlPart}, yielding between the children of a wide element. A caller that
|
|
94
|
+
* stops between yields gives the page a turn. The text is the same either way.
|
|
95
|
+
*/
|
|
96
|
+
declare function serializeXmlPartSteps(part: XmlPart): Generator<void, string>;
|
|
97
|
+
/**
|
|
98
|
+
* The canonical form of a subtree: expanded names, attributes sorted by expanded name, no
|
|
99
|
+
* prefixes, no namespace declarations, no ids. Two trees with the same canonical form are the
|
|
100
|
+
* same document content however a writer spelled them.
|
|
101
|
+
*/
|
|
102
|
+
declare function canonicalForm(node: Node): string;
|
|
103
|
+
/** SHA-256 of the canonical form: the structural fingerprint of one part. */
|
|
104
|
+
declare function canonicalFingerprint(part: XmlPart): string;
|
|
105
|
+
/**
|
|
106
|
+
* SHA-256 of raw bytes, for binary parts. Uses the platform hash where the runtime has a
|
|
107
|
+
* synchronous one (Bun, Node.js) and the pure-JavaScript one elsewhere; both give the same
|
|
108
|
+
* digest.
|
|
109
|
+
*/
|
|
110
|
+
declare function bytesFingerprint(bytes: Uint8Array): string;
|
|
111
|
+
|
|
112
|
+
/** Serialize the package to `.xlsx` bytes. Modeled parts re-emit normalized; others as read. */
|
|
113
|
+
declare function writeXlsx(pkg: XlsxPackage): Uint8Array<ArrayBuffer>;
|
|
114
|
+
/**
|
|
115
|
+
* {@link writeXlsx}, yielding inside a long part and between slices of a long ZIP entry. The
|
|
116
|
+
* package is immutable, so the bytes describe `pkg` even when the workbook moves on between
|
|
117
|
+
* steps. The bytes are the same either way.
|
|
118
|
+
*/
|
|
119
|
+
declare function writeXlsxSteps(pkg: XlsxPackage): Generator<void, Uint8Array<ArrayBuffer>>;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* A non-negative decimal integer of up to 9 digits, or undefined. The 9-digit cap is an engine
|
|
123
|
+
* limit and is less than the `xsd:unsignedInt` range of the schema.
|
|
124
|
+
*/
|
|
125
|
+
declare function formatIndex(raw: string | undefined): number | undefined;
|
|
126
|
+
/** The cell format of a row (`x:row/@s` with `@customFormat`), or undefined. */
|
|
127
|
+
declare function rowFormat(row: Element | null | undefined): number | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* The column formats (`x:col/@style`) other than 0 of the 0-based columns `left` to `right`, as
|
|
130
|
+
* a sparse map. Where styled `x:col` ranges overlap, the first one by `min` wins, for any
|
|
131
|
+
* window, so every caller reads one rule (`columnSpans`). The cost is a binary search and the
|
|
132
|
+
* width of the range, never the number of `x:col` elements.
|
|
133
|
+
*/
|
|
134
|
+
declare function columnFormats(root: Element, left: number, right: number): Map<number, number>;
|
|
135
|
+
/**
|
|
136
|
+
* The column format (`x:col/@style`) of the 0-based column `col`, or undefined for 0 or none,
|
|
137
|
+
* by the rule of `columnFormats`. A lookup for each cell of a paste costs a binary search, not a
|
|
138
|
+
* walk over every `x:col`.
|
|
139
|
+
*/
|
|
140
|
+
declare function columnFormatAt(root: Element, col: number): number | undefined;
|
|
141
|
+
/**
|
|
142
|
+
* The cell format that the empty cell at 0-based `row`, `col` shows. With `cellXfs`, the number
|
|
143
|
+
* of cell formats, an index past them is 0.
|
|
144
|
+
*/
|
|
145
|
+
declare function inheritedFormat(sheet: SheetIndex, row: number, col: number, cellXfs?: number): number;
|
|
146
|
+
|
|
147
|
+
/** Decode `_xHHHH_` escapes. Text without an escape comes back unchanged. */
|
|
148
|
+
declare function decodeXstring(s: string): string;
|
|
149
|
+
/**
|
|
150
|
+
* The offset of the first UTF-16 code unit of `s` that XML 1.0 cannot hold as character data
|
|
151
|
+
* (a control character, U+FFFE, U+FFFF, or a lone surrogate), or -1 when every unit fits. A
|
|
152
|
+
* valid surrogate pair fits. One linear pass.
|
|
153
|
+
*/
|
|
154
|
+
declare function xmlInvalidAt(s: string): number;
|
|
155
|
+
/**
|
|
156
|
+
* Encode text for an `ST_Xstring` value: escape each code unit XML cannot hold, and the
|
|
157
|
+
* underscore of each literal `_xHHHH_` sequence. `decodeXstring(encodeXstring(s)) === s`.
|
|
158
|
+
* A lone surrogate is escaped, because XML text cannot hold one.
|
|
159
|
+
* Carriage returns are escaped too, because XML end-of-line handling turns a bare CR into LF.
|
|
160
|
+
*/
|
|
161
|
+
declare function encodeXstring(s: string): string;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* The longest formula text the tokenizer reads, in UTF-16 code units. This is the engine's own
|
|
165
|
+
* cap: `ST_Formula` in sml.xsd has no `maxLength`.
|
|
166
|
+
*/
|
|
167
|
+
declare const MAX_FORMULA_LENGTH = 8192;
|
|
168
|
+
/** The most tokens one formula can hold. */
|
|
169
|
+
declare const MAX_FORMULA_TOKENS = 4096;
|
|
170
|
+
/** The deepest nesting of parentheses, braces, and structured-reference brackets. */
|
|
171
|
+
declare const MAX_FORMULA_DEPTH = 64;
|
|
172
|
+
/** One axis of a reference: a 0-based index, and whether it has a `$` marker. */
|
|
173
|
+
interface RefAxis {
|
|
174
|
+
readonly index: number;
|
|
175
|
+
readonly absolute: boolean;
|
|
176
|
+
}
|
|
177
|
+
/** One end of a reference. A whole-column end has no row; a whole-row end has no column. */
|
|
178
|
+
interface RefEnd {
|
|
179
|
+
readonly row?: RefAxis;
|
|
180
|
+
readonly col?: RefAxis;
|
|
181
|
+
}
|
|
182
|
+
/** The sheet part of a reference or a name, as written: `Sheet1!`, `'My sheet'!`, `[1]S!`. */
|
|
183
|
+
interface SheetPrefix {
|
|
184
|
+
/** The text as written, with the `!`. Moving a reference keeps it verbatim. */
|
|
185
|
+
readonly raw: string;
|
|
186
|
+
/** The sheet names, unquoted: one, or two for a sheet range (`Sheet1:Sheet3!`). */
|
|
187
|
+
readonly sheets: readonly string[];
|
|
188
|
+
/** The external workbook of `[n]` or `[Book.xlsx]`, as written, when the prefix has one. */
|
|
189
|
+
readonly book?: string;
|
|
190
|
+
}
|
|
191
|
+
interface TokenBase {
|
|
192
|
+
/** The text of the token as written. */
|
|
193
|
+
readonly text: string;
|
|
194
|
+
/** The offset of the token in the formula text. */
|
|
195
|
+
readonly start: number;
|
|
196
|
+
}
|
|
197
|
+
/** The kinds of token that carry no more than their text. */
|
|
198
|
+
type PlainTokenKind = 'number' | 'string' | 'boolean' | 'function' | 'structured' | 'operator' | 'open' | 'close' | 'arrayOpen' | 'arrayClose' | 'separator' | 'space';
|
|
199
|
+
/** A reference token: one cell, a range, whole columns, or whole rows. */
|
|
200
|
+
interface ReferenceToken extends TokenBase {
|
|
201
|
+
readonly kind: 'reference';
|
|
202
|
+
readonly shape: 'cell' | 'range' | 'columns' | 'rows';
|
|
203
|
+
readonly sheet?: SheetPrefix;
|
|
204
|
+
readonly from: RefEnd;
|
|
205
|
+
/** The second end of a range, whole columns, or whole rows. */
|
|
206
|
+
readonly to?: RefEnd;
|
|
207
|
+
}
|
|
208
|
+
/** One token of a formula. */
|
|
209
|
+
type FormulaToken = ReferenceToken | (TokenBase & {
|
|
210
|
+
readonly kind: 'name' | 'error';
|
|
211
|
+
readonly sheet?: SheetPrefix;
|
|
212
|
+
}) | (TokenBase & {
|
|
213
|
+
readonly kind: PlainTokenKind;
|
|
214
|
+
});
|
|
215
|
+
/** Why the tokenizer cannot read a formula. */
|
|
216
|
+
type FormulaProblem = 'empty' | 'too-long' | 'too-many-tokens' | 'too-deep' | 'unterminated-string' | 'unterminated-sheet-name' | 'unterminated-bracket' | 'unbalanced' | 'unexpected-character' | 'bad-number' | 'bad-name' | 'bad-error'
|
|
217
|
+
/** A code unit that XML 1.0 cannot hold: a control character or a lone surrogate. */
|
|
218
|
+
| 'invalid-character'
|
|
219
|
+
/** An R1C1 reference, such as `R1C1` or `RC[-1]`. */
|
|
220
|
+
| 'r1c1-reference'
|
|
221
|
+
/** An operator or a group with no operand (`A1+`, `1+*2`, `()`): `checkFormulaGrammar`. */
|
|
222
|
+
| 'missing-operand'
|
|
223
|
+
/** Two operands with no operator between them (`1 2`, `A1"x"`): `checkFormulaGrammar`. */
|
|
224
|
+
| 'missing-operator'
|
|
225
|
+
/** A `,` or `;` outside a function call, a group, or an array: `checkFormulaGrammar`. */
|
|
226
|
+
| 'misplaced-separator'
|
|
227
|
+
/**
|
|
228
|
+
* The range operator `:` with an operand that is not a reference (`1.5:2`, `"a":"b"`), or a
|
|
229
|
+
* row range outside the grid (`0:3`, `1:1048577`).
|
|
230
|
+
*/
|
|
231
|
+
| 'bad-range';
|
|
232
|
+
type TokenizeResult = {
|
|
233
|
+
readonly ok: true;
|
|
234
|
+
readonly tokens: readonly FormulaToken[];
|
|
235
|
+
} | {
|
|
236
|
+
readonly ok: false;
|
|
237
|
+
readonly problem: FormulaProblem;
|
|
238
|
+
readonly at: number;
|
|
239
|
+
};
|
|
240
|
+
/**
|
|
241
|
+
* Whether a sheet name must be written in quotes: it has the shape of an A1 cell in the grid
|
|
242
|
+
* (`A1`), of an R1C1 reference (`R1C1`, `R`), or of a boolean (`TRUE`), so a reader could take
|
|
243
|
+
* the unquoted name for that operand.
|
|
244
|
+
*/
|
|
245
|
+
declare function sheetNameNeedsQuotes(name: string): boolean;
|
|
246
|
+
/** Read formula text (without the leading `=`). Never throws. */
|
|
247
|
+
declare function tokenizeFormula(text: string): TokenizeResult;
|
|
248
|
+
|
|
249
|
+
/** Why a reference of a typed formula names nothing that the workbook holds. */
|
|
250
|
+
type FormulaReferenceProblem = 'unknown-sheet' | 'unknown-external' | 'unknown-table' | 'unquoted-sheet-name';
|
|
251
|
+
/** What a formula of the workbook can name. Names are in upper case. */
|
|
252
|
+
interface FormulaScope {
|
|
253
|
+
readonly sheets: ReadonlySet<string>;
|
|
254
|
+
/**
|
|
255
|
+
* The number of `x:externalReferences/x:externalReference` entries (`CT_ExternalReference`,
|
|
256
|
+
* sml.xsd): `[1]` to `[n]`.
|
|
257
|
+
*/
|
|
258
|
+
readonly externals: number;
|
|
259
|
+
readonly tables: ReadonlySet<string>;
|
|
260
|
+
/** The defined names of the workbook (`x:definedName/@name`, `CT_DefinedName`, sml.xsd). */
|
|
261
|
+
readonly names: ReadonlySet<string>;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Why a formula cannot be written. `ambiguous-sheet-range`: an unquoted sheet range whose start
|
|
266
|
+
* or end reads as a cell reference (`ambiguousSheetRange`). `name-rebinds`: a name with no sheet
|
|
267
|
+
* prefix would bind to another defined name (`qualifyFormula`).
|
|
268
|
+
*/
|
|
269
|
+
type FormulaWriteProblem = FormulaProblem | FormulaReferenceProblem | 'out-of-grid' | 'unsupported-function' | 'ambiguous-sheet-range' | 'name-rebinds' | 'scoped-function';
|
|
270
|
+
/**
|
|
271
|
+
* Whether a sheet range prefix is unquoted and one of its names reads as a cell, row, or R1C1
|
|
272
|
+
* reference (`A1`, `$B$2`, `12`, `R1C1`). The tokenizer reads `A1:Sheet1!B2` as the sheet range
|
|
273
|
+
* `A1:Sheet1`, but the text can also mean the range from `A1` to `Sheet1!B2`. An edit that
|
|
274
|
+
* rewrites or qualifies such a prefix cannot keep its meaning, so it is refused.
|
|
275
|
+
*/
|
|
276
|
+
declare function ambiguousSheetRange(prefix: SheetPrefix): boolean;
|
|
277
|
+
type FormulaTextResult = {
|
|
278
|
+
readonly ok: true;
|
|
279
|
+
readonly text: string;
|
|
280
|
+
} | {
|
|
281
|
+
readonly ok: false;
|
|
282
|
+
readonly problem: FormulaWriteProblem;
|
|
283
|
+
readonly at: number;
|
|
284
|
+
/** What the problem names: the function name of `unsupported-function`. */
|
|
285
|
+
readonly subject?: string;
|
|
286
|
+
};
|
|
287
|
+
/** A row and column offset. */
|
|
288
|
+
interface FormulaOffset {
|
|
289
|
+
readonly rows: number;
|
|
290
|
+
readonly cols: number;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* The text of tokens, with the relative references moved by `offset`. A reference that moves
|
|
294
|
+
* out of the grid fails with `out-of-grid` and its offset.
|
|
295
|
+
*/
|
|
296
|
+
declare function formatTokens(tokens: readonly FormulaToken[], offset?: FormulaOffset): FormulaTextResult;
|
|
297
|
+
/** Read formula text and write it back as entered, or the reason it cannot be read. */
|
|
298
|
+
declare function normalizeFormula(text: string): FormulaTextResult;
|
|
299
|
+
/**
|
|
300
|
+
* Read formula text that a user entered, check its grammar (`checkFormulaGrammar`) and, with
|
|
301
|
+
* `scope`, that each sheet, external workbook, and table it names is one that the workbook
|
|
302
|
+
* holds (`checkFormulaReferences`), and write it back as entered. Formula text from the file
|
|
303
|
+
* goes through `normalizeFormula` or `moveFormula` instead, which never apply these checks.
|
|
304
|
+
*/
|
|
305
|
+
declare function readFormulaInput(text: string, scope?: FormulaScope): FormulaTextResult;
|
|
306
|
+
/** Formula text with every relative reference moved by `offset`. */
|
|
307
|
+
declare function moveFormula(text: string, offset: FormulaOffset): FormulaTextResult;
|
|
308
|
+
/**
|
|
309
|
+
* The position of the first range whose start has no sheet prefix and whose end has an unquoted
|
|
310
|
+
* prefix of one local sheet, joined by `:` with no space (`A1:S!B2`), or -1. The tokenizer reads
|
|
311
|
+
* such text as a range from `A1` to `S!B2`, but the text can also mean the sheet range
|
|
312
|
+
* `A1:S`. An edit that rewrites the prefix cannot keep its meaning, so it is refused, as for
|
|
313
|
+
* `ambiguousSheetRange`.
|
|
314
|
+
*/
|
|
315
|
+
declare function crossSheetRangeAt(tokens: readonly FormulaToken[]): number;
|
|
316
|
+
/**
|
|
317
|
+
* Copied formula text with every relative reference moved by `offset`, as `moveFormula`, but an
|
|
318
|
+
* unquoted sheet range that `ambiguousSheetRange` reports fails with `ambiguous-sheet-range`:
|
|
319
|
+
* in `A1:S!B2`, the tokenizer reads `A1:S` as a sheet range and would move only `B2`, but the
|
|
320
|
+
* text can also mean the range from `A1` to `S!B2`. A paste refuses such text, as a cut to
|
|
321
|
+
* another sheet does (`qualifyFormula`).
|
|
322
|
+
*/
|
|
323
|
+
declare function moveCopiedFormula(text: string, offset: FormulaOffset): FormulaTextResult;
|
|
324
|
+
/**
|
|
325
|
+
* Formula text with each reference that has no sheet prefix qualified by `prefix`, the prefix
|
|
326
|
+
* text with its `!` (`Data!`, `'My data'!`), unless `references` is false. A cut that moves a
|
|
327
|
+
* formula to another sheet keeps the cells it referred to this way; a copy to another sheet
|
|
328
|
+
* keeps its references on the target sheet and applies only the name rules that follow.
|
|
329
|
+
*
|
|
330
|
+
* A name with no sheet prefix that `localNames` holds (the names that the source sheet scopes,
|
|
331
|
+
* as `sheetNameKey` folds them) gets the prefix too, so it does not bind to a name of the
|
|
332
|
+
* target sheet. A function name counts as a name here, because a defined name can hold a
|
|
333
|
+
* function (`myFn(1)`), but formula text cannot give a function call a sheet prefix: a
|
|
334
|
+
* function name that `localNames` holds fails with `scoped-function`. Every other token keeps
|
|
335
|
+
* its text. A sheet range
|
|
336
|
+
* that `ambiguousSheetRange` reports fails with `ambiguous-sheet-range`. A name with no sheet
|
|
337
|
+
* prefix that the target sheet scopes and the source sheet does not (`targetNames` holds it and
|
|
338
|
+
* `localNames` does not) fails with `name-rebinds`: on the target sheet it would bind to the
|
|
339
|
+
* target's name, and no prefix names the workbook scope.
|
|
340
|
+
*/
|
|
341
|
+
declare function qualifyFormula(text: string, prefix: string, localNames?: ReadonlySet<string>, targetNames?: ReadonlySet<string>, references?: boolean): FormulaTextResult;
|
|
342
|
+
|
|
343
|
+
/** Why the grammar check refused formula text, and the offset of the token. */
|
|
344
|
+
interface GrammarProblem {
|
|
345
|
+
readonly problem: FormulaProblem;
|
|
346
|
+
readonly at: number;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* The first range end next to `:` that has the shape of a cell or column end
|
|
350
|
+
* (`REF_SHAPE`) but is not one of the defined names `names` (in upper case): a broken range
|
|
351
|
+
* end, refused with `bad-range`. Null when there is none.
|
|
352
|
+
*/
|
|
353
|
+
declare function checkRangeEnds(tokens: readonly FormulaToken[], names: ReadonlySet<string>): GrammarProblem | null;
|
|
354
|
+
/** The first grammar problem of a token list from `tokenizeFormula`, or null. */
|
|
355
|
+
declare function checkFormulaGrammar(tokens: readonly FormulaToken[]): GrammarProblem | null;
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* The formula text of a cell, as a formula bar shows it without `=`: the text of `x:f`, or for
|
|
359
|
+
* a shared formula child, the master's text moved by the child's offset. Undefined when the
|
|
360
|
+
* cell has no formula, or the child's master text cannot be read. `f` is the cell's direct
|
|
361
|
+
* `x:f` by default; the formula bar passes the `x:f` of a wrapper branch (`wrappedFormula`), so
|
|
362
|
+
* a wrapped shared child shows the formula of its direct master too.
|
|
363
|
+
*/
|
|
364
|
+
declare function sharedFormulaText(part: XmlPart, entry: CellEntry, f?: Element | undefined): string | undefined;
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Why a value edit or a clear cannot keep a child of the cell `old`, or undefined. Two kinds of
|
|
368
|
+
* child can hold another form of the value that the edit would leave out of date: a non-empty
|
|
369
|
+
* child in the markup compatibility namespace that is not value content, and an element in
|
|
370
|
+
* another namespace with value content in it. The edit refuses that cell with
|
|
371
|
+
* `cell-alternate-content`, with the sheet and the cell as the subject, such as `Data!B5`.
|
|
372
|
+
* `buildCell` keeps every other child.
|
|
373
|
+
*/
|
|
374
|
+
declare function cellChildBlocker(sheet: string, ref: string, old: Element): OpRejection | undefined;
|
|
375
|
+
/**
|
|
376
|
+
* Whether `s` is an ISO 8601 calendar date (`YYYY-MM-DD`) with an optional time
|
|
377
|
+
* (`THH:MM`, `THH:MM:SS`, `THH:MM:SS.fff`) and no time zone: the form of `t="d"` values that
|
|
378
|
+
* the cascade reads. One pass, no regular expression.
|
|
379
|
+
*/
|
|
380
|
+
declare function isIsoDate(s: string): boolean;
|
|
381
|
+
/**
|
|
382
|
+
* How many array and data table masters a worksheet has, and how many of them have an `@ref`
|
|
383
|
+
* that names no range of the grid, which could cover any cell. Read once per part.
|
|
384
|
+
*/
|
|
385
|
+
declare function arrayRangeCount(part: XmlPart): {
|
|
386
|
+
readonly all: number;
|
|
387
|
+
readonly unreadable: number;
|
|
388
|
+
};
|
|
389
|
+
/**
|
|
390
|
+
* The first array or data table range that meets the 0-based bounds, or undefined. An edit
|
|
391
|
+
* inside such a range is refused.
|
|
392
|
+
*/
|
|
393
|
+
declare function arrayFormulaIn(part: XmlPart, top: number, left: number, bottom: number, right: number): string | undefined;
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Whether a parsed sheet part can hold a formula cell: {@link partHasFormula}, or a root in
|
|
397
|
+
* another namespace than the Transitional SpreadsheetML namespace (a Strict root), whose cells
|
|
398
|
+
* the scan does not read. The stale flag and the stale notice both read it.
|
|
399
|
+
*/
|
|
400
|
+
declare function sheetMayHoldFormula(part: XmlPart): boolean;
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Whether a cell holds a formula: an `x:f` child (`CT_Cell`, Part 1, 18.3.1.4), or an `x:f` child
|
|
404
|
+
* of a branch of a markup-compatibility wrapper child ({@link wrappedFormula}).
|
|
405
|
+
*/
|
|
406
|
+
declare function cellHasFormula(cell: Element): boolean;
|
|
407
|
+
/** The `x:f` of the first wrapper branch that holds one, for the formula bar. */
|
|
408
|
+
declare function wrappedFormula(cell: Element): Element | undefined;
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* The first `x:mergeCell/@ref` of a worksheet root that meets `box`, or undefined. The merge op
|
|
412
|
+
* and the editor's `selectionMerged` both read it, so a state and a command agree on every ref
|
|
413
|
+
* that parses, also a one-cell or an overlapping ref of the file. The parsed refs are kept for
|
|
414
|
+
* each root.
|
|
415
|
+
*/
|
|
416
|
+
declare function mergedRefMeeting(root: Element, box: RangeBox): string | undefined;
|
|
417
|
+
/** A cell whose content is about to change: whether it then holds a value or a formula. */
|
|
418
|
+
interface CellOverride {
|
|
419
|
+
readonly row: number;
|
|
420
|
+
readonly col: number;
|
|
421
|
+
readonly holds: boolean;
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* The first cell of `box`, in reading order, that a merge of `box` would empty: a cell other than
|
|
425
|
+
* the top-left cell that holds a value or a formula. Undefined when none does. The merge op refuses
|
|
426
|
+
* with it, and the editor snapshot reads it so that a host can ask the user before the command.
|
|
427
|
+
* It reads the cells that exist, never the cells that `box` names. `edit` is an open cell edit,
|
|
428
|
+
* which a merge commits first: its cell then counts as it would be after the commit.
|
|
429
|
+
*/
|
|
430
|
+
declare function firstValueLost(part: XmlPart, box: RangeBox, edit?: CellOverride): string | undefined;
|
|
431
|
+
|
|
432
|
+
/** The most records that one style list holds after an edit. */
|
|
433
|
+
declare const MAX_STYLE_RECORDS = 64000;
|
|
434
|
+
|
|
435
|
+
/** What made a transaction. */
|
|
436
|
+
type TransactOrigin = 'user' | 'undo' | 'redo' | 'system';
|
|
437
|
+
/** What a committed transaction changed. */
|
|
438
|
+
interface StoreChange {
|
|
439
|
+
readonly fromRevision: number;
|
|
440
|
+
readonly toRevision: number;
|
|
441
|
+
readonly origin: TransactOrigin;
|
|
442
|
+
/** Part names whose content changed. Layout re-does only what these touch. */
|
|
443
|
+
readonly parts: readonly string[];
|
|
444
|
+
readonly label?: string;
|
|
445
|
+
/**
|
|
446
|
+
* The ops as committed, with the side-effect ops that the transaction added at the end. An
|
|
447
|
+
* undo or a redo commits inverse ops (`InverseOp`), which `transact` does not take.
|
|
448
|
+
*/
|
|
449
|
+
readonly ops: readonly HistoryOp[];
|
|
450
|
+
}
|
|
451
|
+
/** The outcome of a transaction. */
|
|
452
|
+
type TransactResult = {
|
|
453
|
+
readonly ok: true;
|
|
454
|
+
readonly revision: number;
|
|
455
|
+
} | {
|
|
456
|
+
readonly ok: false;
|
|
457
|
+
readonly rejection: OpRejection;
|
|
458
|
+
};
|
|
459
|
+
/** Options for one transaction. */
|
|
460
|
+
interface TransactOptions {
|
|
461
|
+
/** A short label for the history entry (`set value`). */
|
|
462
|
+
readonly label?: string;
|
|
463
|
+
/** What made the transaction; `user` when omitted. */
|
|
464
|
+
readonly origin?: TransactOrigin;
|
|
465
|
+
/**
|
|
466
|
+
* Whether this transaction enters the undo stack. Omitted: `true` for `user`, `false` for
|
|
467
|
+
* `system`. A transaction outside the history clears the undo and redo stacks. The stale
|
|
468
|
+
* flag is not such a transaction: it is a side effect of the user transaction.
|
|
469
|
+
*/
|
|
470
|
+
readonly recordsHistory?: boolean;
|
|
471
|
+
/**
|
|
472
|
+
* The revision that the caller read the references of its ops against. When the store has
|
|
473
|
+
* moved on since, the transaction is refused with `stale-revision`, because a reference can
|
|
474
|
+
* now name another cell (a structural edit moved it). Omitted: the current revision.
|
|
475
|
+
*/
|
|
476
|
+
readonly baseRevision?: number;
|
|
477
|
+
/**
|
|
478
|
+
* The selection before the transaction, kept with its history entry:
|
|
479
|
+
* {@link WorkbookDocumentStore.selectionForUndo} gives it back. Omitted: undo of the entry
|
|
480
|
+
* names no selection.
|
|
481
|
+
*/
|
|
482
|
+
readonly selectionBefore?: HistorySelection;
|
|
483
|
+
/**
|
|
484
|
+
* The selection after the transaction, kept with its history entry:
|
|
485
|
+
* {@link WorkbookDocumentStore.selectionForRedo} gives it back. Omitted: redo of the entry
|
|
486
|
+
* names no selection. Its sheet is a worksheet after the ops, so a rename or an add can name
|
|
487
|
+
* the new sheet.
|
|
488
|
+
*/
|
|
489
|
+
readonly selectionAfter?: HistorySelection;
|
|
490
|
+
/**
|
|
491
|
+
* The name of the sheet that the transaction edits, kept with its history entry also when
|
|
492
|
+
* it keeps no selection: {@link WorkbookDocumentStore.sheetForUndo} gives it back, so a host
|
|
493
|
+
* can name the sheet that an undo or a redo changes. It is a worksheet before or after the
|
|
494
|
+
* ops: a delete names the deleted sheet, and an add the added one.
|
|
495
|
+
*/
|
|
496
|
+
readonly sheet?: string;
|
|
497
|
+
}
|
|
498
|
+
/** A cell of a {@link HistorySelection}, 0-based. */
|
|
499
|
+
interface HistoryCell {
|
|
500
|
+
readonly row: number;
|
|
501
|
+
readonly col: number;
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* A selection that a history entry keeps: a sheet by name, a range, the active cell, the
|
|
505
|
+
* anchor that the range extends from, and the focus corner that Shift+Arrow moves.
|
|
506
|
+
*/
|
|
507
|
+
interface HistorySelection {
|
|
508
|
+
readonly sheet: string;
|
|
509
|
+
readonly range: RangeBox;
|
|
510
|
+
readonly active: HistoryCell;
|
|
511
|
+
readonly anchor: HistoryCell;
|
|
512
|
+
readonly focus: HistoryCell;
|
|
513
|
+
}
|
|
514
|
+
/** Part names whose part object differs between two packages. */
|
|
515
|
+
declare function changedParts(a: XlsxPackage, b: XlsxPackage): string[];
|
|
516
|
+
/** The transactional document store of one workbook. */
|
|
517
|
+
declare class WorkbookDocumentStore {
|
|
518
|
+
#private;
|
|
519
|
+
constructor(pkg: XlsxPackage);
|
|
520
|
+
/** The current package. Reference-stable until the next commit. */
|
|
521
|
+
get package(): XlsxPackage;
|
|
522
|
+
/** Monotonic revision, bumped by every commit (including undo and redo). */
|
|
523
|
+
get revision(): number;
|
|
524
|
+
/**
|
|
525
|
+
* How many committed edits can have changed what a formula that names `sheets` refers to: each
|
|
526
|
+
* insert or delete of rows or columns, and each rename, move, or delete of a sheet of `sheets`.
|
|
527
|
+
* With `span`, for a formula with a reference across a span of sheets (`Jan:Mar!A1`), each add,
|
|
528
|
+
* rename, move, or delete of any sheet counts: the span can then hold other sheets, and the
|
|
529
|
+
* formula does not name them. An undo and a redo of such an edit count too, so the number never
|
|
530
|
+
* goes back.
|
|
531
|
+
*/
|
|
532
|
+
referenceEdits(sheets: readonly string[], span?: boolean): number;
|
|
533
|
+
get canUndo(): boolean;
|
|
534
|
+
get canRedo(): boolean;
|
|
535
|
+
/**
|
|
536
|
+
* The selection before the entry that {@link undo} reverts next, as a copy, or null when its
|
|
537
|
+
* transaction supplied none. A host restores it after the undo.
|
|
538
|
+
*/
|
|
539
|
+
selectionForUndo(): HistorySelection | null;
|
|
540
|
+
/** The label of the entry that {@link undo} reverts next (`renameSheet`), or null. */
|
|
541
|
+
labelForUndo(): string | null;
|
|
542
|
+
/** The label of the entry that {@link redo} applies next, or null. */
|
|
543
|
+
labelForRedo(): string | null;
|
|
544
|
+
/**
|
|
545
|
+
* The sheet of the entry that {@link undo} reverts next, or null when it names none. For a
|
|
546
|
+
* rename, it is the name of the sheet before the rename: the name that the undo gives back.
|
|
547
|
+
*/
|
|
548
|
+
sheetForUndo(): string | null;
|
|
549
|
+
/**
|
|
550
|
+
* The sheet of the entry that {@link redo} applies next, or null when it names none. For a
|
|
551
|
+
* rename, it is the name of the sheet before the rename, as {@link sheetForUndo} gives.
|
|
552
|
+
*/
|
|
553
|
+
sheetForRedo(): string | null;
|
|
554
|
+
/**
|
|
555
|
+
* The selection after the entry that {@link redo} applies next, as a copy, or null when its
|
|
556
|
+
* transaction supplied none. A host restores it after the redo.
|
|
557
|
+
*/
|
|
558
|
+
selectionForRedo(): HistorySelection | null;
|
|
559
|
+
/** Validate ops, and the parts they leave, without committing. */
|
|
560
|
+
dryRun(ops: readonly WorkbookOp[]): TransactResult;
|
|
561
|
+
/** Apply ops atomically and publish one change. */
|
|
562
|
+
transact(ops: readonly WorkbookOp[], options?: TransactOptions): TransactResult;
|
|
563
|
+
/**
|
|
564
|
+
* Undo the newest history entry. When its inverse no longer applies, the store clears both
|
|
565
|
+
* stacks, because no older entry can apply either, and returns the reason.
|
|
566
|
+
*/
|
|
567
|
+
undo(): TransactResult;
|
|
568
|
+
/** Redo the newest undone entry, with the same refusal rule as {@link undo}. */
|
|
569
|
+
redo(): TransactResult;
|
|
570
|
+
/** Subscribe to committed changes. Returns the unsubscribe function. */
|
|
571
|
+
subscribe(listener: (change: StoreChange) => void): () => void;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* The first part that refuses every edit that moves or renames a reference, whatever it names:
|
|
576
|
+
* a chart or pivot part, a sheet that is not a worksheet, or a relationship outside the
|
|
577
|
+
* allowlists. Undefined when there is none.
|
|
578
|
+
*/
|
|
579
|
+
declare function workbookPartBlocker(pkg: XlsxPackage, index: WorkbookIndex): OpRejection | undefined;
|
|
580
|
+
|
|
581
|
+
/** The prefix text of one sheet or a sheet range, with the `!`: `Data!`, `'Data 1'!`. */
|
|
582
|
+
declare function sheetPrefixText(sheets: readonly string[]): string;
|
|
583
|
+
|
|
584
|
+
/** The package with the save rules applied. The same package object when nothing changes. */
|
|
585
|
+
declare function applySaveRules(pkg: XlsxPackage): XlsxPackage;
|
|
586
|
+
/** Save a workbook to `.xlsx` bytes, with the save rules applied. */
|
|
587
|
+
declare function saveXlsx(pkg: XlsxPackage): Uint8Array<ArrayBuffer>;
|
|
588
|
+
/** {@link saveXlsx}, yielding between units of work. The bytes are the same either way. */
|
|
589
|
+
declare function saveXlsxSteps(pkg: XlsxPackage): Generator<void, Uint8Array<ArrayBuffer>>;
|
|
590
|
+
/**
|
|
591
|
+
* The fidelity oracles. The canonical fingerprint is what a package holds after the
|
|
592
|
+
* save rules; the semantic digest is the fingerprint of the package that a save reopens to.
|
|
593
|
+
* Equal values prove that save loses nothing the model carries.
|
|
594
|
+
*/
|
|
595
|
+
declare function workbookOracles(pkg: XlsxPackage, write?: (pkg: XlsxPackage) => Uint8Array): {
|
|
596
|
+
fingerprint: string;
|
|
597
|
+
digest: string;
|
|
598
|
+
changedParts: readonly string[];
|
|
599
|
+
};
|
|
600
|
+
|
|
601
|
+
/** One hyperlink of a sheet. */
|
|
602
|
+
interface HyperlinkProjection {
|
|
603
|
+
/** The cell or range the hyperlink covers, as the file states it. */
|
|
604
|
+
readonly ref: string;
|
|
605
|
+
/** A sanitized external URL, when the target is one and the allowlist accepts it. */
|
|
606
|
+
readonly href?: string;
|
|
607
|
+
/** A place in the workbook (`Sheet2!A1`), when the hyperlink names one. */
|
|
608
|
+
readonly location?: string;
|
|
609
|
+
readonly display?: string;
|
|
610
|
+
}
|
|
611
|
+
/** The hyperlinks of a worksheet part, in document order. */
|
|
612
|
+
declare function sheetHyperlinks(pkg: XlsxPackage, part: XmlPart): HyperlinkProjection[];
|
|
613
|
+
|
|
614
|
+
export { CONTENT_TYPE, CellEntry, Element, HistoryOp, MAX_FORMULA_DEPTH, MAX_FORMULA_LENGTH, MAX_FORMULA_TOKENS, MAX_STYLE_RECORDS, NS, Node, OpRejection, REL, RangeBox, STRICT_SPREADSHEETML, SheetIndex, WorkbookDocumentStore, WorkbookIndex, WorkbookOp, XlsxPackage, XmlPart, ambiguousSheetRange, applySaveRules, arrayFormulaIn, arrayRangeCount, attr, boolAttr, bytesFingerprint, canonicalFingerprint, canonicalForm, cellChildBlocker, cellHasFormula, changedParts, checkFormulaGrammar, checkRangeEnds, child, children, columnFormatAt, columnFormats, conventionalPrefix, crossSheetRangeAt, decodeXstring, elements, encodeXstring, find, firstValueLost, formatIndex, formatTokens, inheritedFormat, intAttr, is, isIsoDate, mergedRefMeeting, moveCopiedFormula, moveFormula, normalizeFormula, path, q, qualifyFormula, readFormulaInput, rowFormat, saveXlsx, saveXlsxSteps, serializeXmlPart, serializeXmlPartSteps, sharedFormulaText, sheetHyperlinks, sheetMayHoldFormula, sheetNameNeedsQuotes, sheetPrefixText, textOf, tokenizeFormula, workbookOracles, workbookPartBlocker, wrappedFormula, writeXlsx, writeXlsxSteps, xmlInvalidAt };
|
|
615
|
+
export type { CellOverride, FormulaOffset, FormulaProblem, FormulaTextResult, FormulaToken, FormulaWriteProblem, GrammarProblem, HistoryCell, HistorySelection, HyperlinkProjection, KnownPrefix, PlainTokenKind, QName, RefAxis, RefEnd, ReferenceToken, SheetPrefix, StoreChange, TokenizeResult, TransactOptions, TransactOrigin, TransactResult };
|