@betteroffice/xlsx 0.3.0 → 0.5.1
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 +108 -192
- package/dist/asyncReplica-DuZEFXjI.d.ts +253 -0
- package/dist/chunk-DIDVDN7H.js +1 -0
- package/dist/chunk-HJJEOLPD.js +1 -0
- package/dist/chunk-JGTBRHCP.js +1 -0
- package/dist/chunk-K7TMSGNA.js +1 -0
- package/dist/chunk-SXM2HKJL.js +4 -0
- package/dist/collaboration.d.ts +19 -2
- package/dist/collaboration.js +1 -1
- package/dist/editPeer-DiFeIMPk.d.ts +1908 -0
- package/dist/generated/xlsx_wasm_bg.wasm +0 -0
- package/dist/headless.d.ts +9 -290
- package/dist/headless.js +1 -1
- package/dist/index.d.ts +6 -908
- package/dist/index.js +4 -1
- package/dist/types-DdoEoFSX.d.ts +350 -0
- package/dist/worker.d.ts +25 -0
- package/dist/worker.js +1 -0
- package/dist/xlsxSessionWorker.d.ts +2 -0
- package/dist/xlsxSessionWorker.mjs +1 -0
- package/package.json +13 -3
- package/dist/chunk-E6PJOEEH.js +0 -4
- package/dist/types-C24EBcAP.d.ts +0 -91
|
@@ -0,0 +1,1908 @@
|
|
|
1
|
+
import { i as PatternType, D as DisplayList, c as ChartRegion, R as Rect, d as Direction, k as SelectionData } from './types-DdoEoFSX.js';
|
|
2
|
+
import { C as CollaborationReplica, u as CollaborationUpdateOrigin, P as PipeCommandPayload, g as AwarenessCursor, m as AsyncReplicaAdapter } from './asyncReplica-DuZEFXjI.js';
|
|
3
|
+
|
|
4
|
+
/** Format-owned, structured-cloneable methods. */
|
|
5
|
+
type SessionMethods = Record<string, (...args: any[]) => unknown>;
|
|
6
|
+
type Promisified<M extends SessionMethods> = {
|
|
7
|
+
[K in keyof M]: (...args: Parameters<M[K]>) => Promise<Awaited<ReturnType<M[K]>>>;
|
|
8
|
+
};
|
|
9
|
+
interface SessionState {
|
|
10
|
+
format: string;
|
|
11
|
+
stage: 'preview' | 'ready';
|
|
12
|
+
version: number;
|
|
13
|
+
dirty: boolean;
|
|
14
|
+
}
|
|
15
|
+
type SessionFailureCode = 'crash' | 'trap' | 'out-of-memory' | 'message' | 'silence' | 'disposed';
|
|
16
|
+
/** A terminal session failure. */
|
|
17
|
+
declare class SessionFailure extends Error {
|
|
18
|
+
readonly code: SessionFailureCode;
|
|
19
|
+
readonly diagnostics?: string | undefined;
|
|
20
|
+
constructor(code: SessionFailureCode, message: string, diagnostics?: string | undefined);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface ChartSeriesInfo {
|
|
24
|
+
index: number;
|
|
25
|
+
name: string | null;
|
|
26
|
+
nameRef: string | null;
|
|
27
|
+
categoryRef: string | null;
|
|
28
|
+
valueRef: string | null;
|
|
29
|
+
}
|
|
30
|
+
interface ChartInfo {
|
|
31
|
+
id: string;
|
|
32
|
+
index: number;
|
|
33
|
+
part: string;
|
|
34
|
+
type: string;
|
|
35
|
+
anchorRange: string | null;
|
|
36
|
+
/** false when the chart part cannot be read; error says why and the rest is empty. */
|
|
37
|
+
editable: boolean;
|
|
38
|
+
error: string | null;
|
|
39
|
+
title: string | null;
|
|
40
|
+
/** a title Excel fills in, with no text of its own. */
|
|
41
|
+
autoTitle: boolean;
|
|
42
|
+
richTitle: boolean;
|
|
43
|
+
series: ChartSeriesInfo[];
|
|
44
|
+
}
|
|
45
|
+
type ChartSeriesName = {
|
|
46
|
+
text: string;
|
|
47
|
+
} | {
|
|
48
|
+
ref: string;
|
|
49
|
+
};
|
|
50
|
+
type ChartEdit = {
|
|
51
|
+
action: 'set_chart_title';
|
|
52
|
+
title: string | null;
|
|
53
|
+
} | {
|
|
54
|
+
action: 'set_series';
|
|
55
|
+
series: number;
|
|
56
|
+
name?: ChartSeriesName;
|
|
57
|
+
categories?: string;
|
|
58
|
+
values?: string;
|
|
59
|
+
};
|
|
60
|
+
type ChartMutation = {
|
|
61
|
+
sheet: number;
|
|
62
|
+
chart: number;
|
|
63
|
+
} & ChartEdit;
|
|
64
|
+
|
|
65
|
+
type XlsxDefinedNameOp = {
|
|
66
|
+
type: 'setDefinedName';
|
|
67
|
+
name: string;
|
|
68
|
+
refers_to: string;
|
|
69
|
+
scope?: number | null;
|
|
70
|
+
hidden?: boolean;
|
|
71
|
+
} | {
|
|
72
|
+
type: 'deleteDefinedName';
|
|
73
|
+
name: string;
|
|
74
|
+
scope?: number | null;
|
|
75
|
+
};
|
|
76
|
+
interface XlsxDefinedName {
|
|
77
|
+
name: string;
|
|
78
|
+
refersTo: string;
|
|
79
|
+
scope: number | null;
|
|
80
|
+
hidden: boolean;
|
|
81
|
+
}
|
|
82
|
+
interface XlsxDefinedNamesRequest {
|
|
83
|
+
/** Omitted selects all scopes; null selects workbook scope. */
|
|
84
|
+
scope?: number | null;
|
|
85
|
+
offset?: number;
|
|
86
|
+
limit?: number;
|
|
87
|
+
}
|
|
88
|
+
interface XlsxDefinedNamesResult {
|
|
89
|
+
version: string;
|
|
90
|
+
items: XlsxDefinedName[];
|
|
91
|
+
total: number;
|
|
92
|
+
nextOffset: number | null;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Result envelopes shared by the formats' host edit APIs. Targets, steps, receipts and failure
|
|
99
|
+
* codes stay format-owned; these shapes only fix how every format reports success and refusal.
|
|
100
|
+
*/
|
|
101
|
+
/** Why a host operation was refused, as data. The document is unchanged. */
|
|
102
|
+
interface OperationFailure<Code extends string, Target> {
|
|
103
|
+
code: Code;
|
|
104
|
+
/** The request step that failed, when one did. */
|
|
105
|
+
stepIndex?: number;
|
|
106
|
+
/** The earlier step an `overlapping-steps` failure conflicts with. */
|
|
107
|
+
conflictingStepIndex?: number;
|
|
108
|
+
/** The failing step's target as requested or resolved. */
|
|
109
|
+
target?: Target;
|
|
110
|
+
message: string;
|
|
111
|
+
}
|
|
112
|
+
/** A policy refusal carrying the version the document is still at. */
|
|
113
|
+
interface OperationRefusal<Failure> {
|
|
114
|
+
ok: false;
|
|
115
|
+
version: string;
|
|
116
|
+
failure: Failure;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* An accepted edit request. `applied` is false when every step was a no-op; the version then
|
|
120
|
+
* stays `baseVersion` and no history or change notification was produced.
|
|
121
|
+
*/
|
|
122
|
+
interface EditSuccess<Receipt> {
|
|
123
|
+
ok: true;
|
|
124
|
+
baseVersion: string;
|
|
125
|
+
version: string;
|
|
126
|
+
applied: boolean;
|
|
127
|
+
/** One receipt per request step, in request order. */
|
|
128
|
+
receipts: Receipt[];
|
|
129
|
+
}
|
|
130
|
+
/** A validated edit request. Validation reserves nothing and cannot be committed later. */
|
|
131
|
+
interface ValidationSuccess<Preview> {
|
|
132
|
+
ok: true;
|
|
133
|
+
baseVersion: string;
|
|
134
|
+
wouldApply: boolean;
|
|
135
|
+
previews: Preview[];
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Shapes shared by the formats' read-only structured exports. Content trees, anchors, story or
|
|
140
|
+
* sheet selectors, diagnostic codes and limits stay format-owned; these only fix how every format
|
|
141
|
+
* reports diagnostics, truncation and Markdown markers.
|
|
142
|
+
*/
|
|
143
|
+
type ExportSeverity = 'info' | 'warning' | 'error';
|
|
144
|
+
/** Something an export omitted or could not represent, anchored where it applies. */
|
|
145
|
+
interface ExportDiagnostic<Code extends string, Anchor> {
|
|
146
|
+
code: Code;
|
|
147
|
+
severity: ExportSeverity;
|
|
148
|
+
anchor: Anchor | null;
|
|
149
|
+
message: string;
|
|
150
|
+
}
|
|
151
|
+
/** Whether an export stopped at its limits before the end of the content. */
|
|
152
|
+
interface ExportCompletion {
|
|
153
|
+
truncated: boolean;
|
|
154
|
+
}
|
|
155
|
+
/** A Markdown marker comment and the anchor of the content it precedes. */
|
|
156
|
+
interface MarkdownAnchor<Anchor> {
|
|
157
|
+
marker: string;
|
|
158
|
+
anchor: Anchor;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Read-only structured export of workbook content and its Markdown projection. Every shape
|
|
163
|
+
* here is plain JSON; the walker, limits and Markdown renderer live in Rust.
|
|
164
|
+
*
|
|
165
|
+
* Export never recalculates: formula results are the stored values (`calculation.policy:
|
|
166
|
+
* 'asStored'`, `freshness: 'unverified'`). Anchors name positions by sheet id, index and name
|
|
167
|
+
* and A1 in the exported version or snapshot; none follows later row, column or sheet edits.
|
|
168
|
+
*/
|
|
169
|
+
|
|
170
|
+
/** A zero-based sheet index and at most one rectangular A1 range, defaulting to the used range. */
|
|
171
|
+
interface XlsxExportScope {
|
|
172
|
+
sheet: number;
|
|
173
|
+
range?: string;
|
|
174
|
+
}
|
|
175
|
+
/** Hidden sheets, rows, columns and names are excluded unless asked for. */
|
|
176
|
+
interface XlsxExportOptions {
|
|
177
|
+
/** Defaults to every sheet. Unions, whole rows or columns and sheet-qualified ranges refuse. */
|
|
178
|
+
scope?: readonly XlsxExportScope[];
|
|
179
|
+
includeHiddenSheets?: boolean;
|
|
180
|
+
includeHiddenRows?: boolean;
|
|
181
|
+
includeHiddenColumns?: boolean;
|
|
182
|
+
/** Defaults to `true`. */
|
|
183
|
+
includeDefinedNames?: boolean;
|
|
184
|
+
includeHiddenNames?: boolean;
|
|
185
|
+
/** Stored cells, 1 to 1,000,000; defaults to 100,000. */
|
|
186
|
+
maxCells?: number;
|
|
187
|
+
/** Compact UTF-8 JSON bytes of the content, at most 16 MiB; defaults to 8 MiB. */
|
|
188
|
+
maxBytes?: number;
|
|
189
|
+
}
|
|
190
|
+
/** Empty grid positions count toward `maxCells`. */
|
|
191
|
+
interface XlsxMarkdownOptions {
|
|
192
|
+
/** Grid rows per sheet; defaults to 200. */
|
|
193
|
+
maxRows?: number;
|
|
194
|
+
/** Grid columns per sheet; defaults to 50. */
|
|
195
|
+
maxColumns?: number;
|
|
196
|
+
/** Grid positions across all sheets; defaults to 10,000. */
|
|
197
|
+
maxCells?: number;
|
|
198
|
+
/** UTF-8 bytes of Markdown; defaults to 8 MiB. */
|
|
199
|
+
maxBytes?: number;
|
|
200
|
+
}
|
|
201
|
+
/** A sheet by the id edit batches take and, descriptively, its current position and name. */
|
|
202
|
+
interface XlsxSheetIdentity {
|
|
203
|
+
/** The exporting session's catalog id; `sheet:{index}` for bytes. */
|
|
204
|
+
sheetId: string;
|
|
205
|
+
index: number;
|
|
206
|
+
name: string;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* A `cell` or `range` anchor's `{ sheetId: sheet.sheetId, range: { kind: 'a1', a1 } }` is its
|
|
210
|
+
* `XlsxRangeTarget` at the exported version.
|
|
211
|
+
*/
|
|
212
|
+
type XlsxAnchor = {
|
|
213
|
+
kind: 'sheet';
|
|
214
|
+
sheet: XlsxSheetIdentity;
|
|
215
|
+
} | {
|
|
216
|
+
kind: 'cell';
|
|
217
|
+
sheet: XlsxSheetIdentity;
|
|
218
|
+
a1: string;
|
|
219
|
+
} | {
|
|
220
|
+
kind: 'range';
|
|
221
|
+
sheet: XlsxSheetIdentity;
|
|
222
|
+
a1: string;
|
|
223
|
+
} | {
|
|
224
|
+
kind: 'definedName';
|
|
225
|
+
name: string;
|
|
226
|
+
localSheet: XlsxSheetIdentity | null;
|
|
227
|
+
/** Position in the workbook's defined-name list. */
|
|
228
|
+
ordinal: number;
|
|
229
|
+
} | {
|
|
230
|
+
kind: 'sourcePart';
|
|
231
|
+
part: string;
|
|
232
|
+
partSha256: string;
|
|
233
|
+
path: number[];
|
|
234
|
+
};
|
|
235
|
+
/** Retained source XML: part, SHA-256 of its bytes, element-child ordinals from its root. */
|
|
236
|
+
interface XlsxSourcePart {
|
|
237
|
+
part: string;
|
|
238
|
+
partSha256: string;
|
|
239
|
+
path: number[];
|
|
240
|
+
}
|
|
241
|
+
type XlsxExportDiagnosticCode = 'hidden-content-excluded' | 'visibility-unknown' | 'unsupported-sheet' | 'unsupported-content' | 'object-placeholder' | 'unreadable-object' | 'provenance-unavailable' | 'comments-omitted' | 'rich-text-omitted' | 'formatting-approximate' | 'formula-cache-unverified' | 'formula-result-missing' | 'calculation-failure' | 'value-unavailable' | 'truncated' | 'markdown-lossy';
|
|
242
|
+
type XlsxExportDiagnostic = ExportDiagnostic<XlsxExportDiagnosticCode, XlsxAnchor>;
|
|
243
|
+
/** A cell value; `unavailable` stands for one JSON cannot carry, such as a non-finite number. */
|
|
244
|
+
type XlsxExportValue = XlsxCellValue | {
|
|
245
|
+
kind: 'unavailable';
|
|
246
|
+
reason: string;
|
|
247
|
+
};
|
|
248
|
+
/**
|
|
249
|
+
* `unverified`: a result is stored, not checked. `missing`: none is stored, and the value is the
|
|
250
|
+
* engine's placeholder. `uncertain`: presence cannot be established, as once anything has
|
|
251
|
+
* calculated since a file that stored none was read. `cycle` and `limited`: what the last
|
|
252
|
+
* calculation reported.
|
|
253
|
+
*/
|
|
254
|
+
type XlsxFormulaResult = 'unverified' | 'missing' | 'uncertain' | 'cycle' | 'limited';
|
|
255
|
+
interface XlsxExportCell {
|
|
256
|
+
id: string;
|
|
257
|
+
anchor: XlsxAnchor;
|
|
258
|
+
value: XlsxExportValue;
|
|
259
|
+
/** Without the leading `=`. */
|
|
260
|
+
formula: string | null;
|
|
261
|
+
/** The engine's formatting of the value, without column-width clipping or overflow. */
|
|
262
|
+
displayText: string;
|
|
263
|
+
numberFormat: string;
|
|
264
|
+
/** `null` for cells without a formula. */
|
|
265
|
+
formulaResult: XlsxFormulaResult | null;
|
|
266
|
+
merge: {
|
|
267
|
+
range: string;
|
|
268
|
+
origin: boolean;
|
|
269
|
+
} | null;
|
|
270
|
+
}
|
|
271
|
+
interface XlsxExportMerge {
|
|
272
|
+
id: string;
|
|
273
|
+
anchor: XlsxAnchor;
|
|
274
|
+
/** Whether the merge extends past the selected range. */
|
|
275
|
+
clipped: boolean;
|
|
276
|
+
}
|
|
277
|
+
/** A ListObject. */
|
|
278
|
+
interface XlsxExportTable {
|
|
279
|
+
id: string;
|
|
280
|
+
anchor: XlsxAnchor;
|
|
281
|
+
name: string;
|
|
282
|
+
headerRows: number;
|
|
283
|
+
totalsRows: number;
|
|
284
|
+
columns: string[];
|
|
285
|
+
clipped: boolean;
|
|
286
|
+
}
|
|
287
|
+
interface XlsxExportHyperlink {
|
|
288
|
+
id: string;
|
|
289
|
+
anchor: XlsxAnchor;
|
|
290
|
+
externalTarget: string | null;
|
|
291
|
+
location: string | null;
|
|
292
|
+
tooltip: string | null;
|
|
293
|
+
display: string | null;
|
|
294
|
+
clipped: boolean;
|
|
295
|
+
}
|
|
296
|
+
type XlsxObjectKind = 'chart' | 'picture' | 'shape' | 'group' | 'connector' | 'diagram' | 'graphicFrame' | 'contentPart' | 'unknown';
|
|
297
|
+
/** A drawing object as a placeholder: no chart data, image bytes or shape text. */
|
|
298
|
+
interface XlsxExportObject {
|
|
299
|
+
id: string;
|
|
300
|
+
kind: XlsxObjectKind;
|
|
301
|
+
/** The cells holding its corners; `null` when its grid position is unknown. */
|
|
302
|
+
anchor: XlsxAnchor | null;
|
|
303
|
+
name: string | null;
|
|
304
|
+
altText: string | null;
|
|
305
|
+
title: string | null;
|
|
306
|
+
hidden: boolean;
|
|
307
|
+
/** The chart or image part. */
|
|
308
|
+
part: string | null;
|
|
309
|
+
source: XlsxSourcePart | null;
|
|
310
|
+
}
|
|
311
|
+
interface XlsxExportDefinedName {
|
|
312
|
+
id: string;
|
|
313
|
+
anchor: XlsxAnchor;
|
|
314
|
+
name: string;
|
|
315
|
+
formula: string;
|
|
316
|
+
hidden: boolean;
|
|
317
|
+
localSheet: XlsxSheetIdentity | null;
|
|
318
|
+
}
|
|
319
|
+
type XlsxSheetVisibility = 'visible' | 'hidden' | 'veryHidden' | 'unknown';
|
|
320
|
+
/**
|
|
321
|
+
* One sheet. `truncated` means export stopped inside it: its lists are complete in the order
|
|
322
|
+
* hidden spans, merges, tables, hyperlinks, objects, cells, up to where it stopped.
|
|
323
|
+
*/
|
|
324
|
+
interface XlsxExportSheet extends ExportCompletion {
|
|
325
|
+
id: string;
|
|
326
|
+
anchor: XlsxAnchor;
|
|
327
|
+
kind: 'worksheet' | 'chartsheet' | 'dialogsheet' | 'macrosheet' | 'other';
|
|
328
|
+
visibility: XlsxSheetVisibility;
|
|
329
|
+
/** Stored cells and hyperlinks; drawings, merges and tables do not extend it. */
|
|
330
|
+
usedRange: string | null;
|
|
331
|
+
selectedRange: string | null;
|
|
332
|
+
/** Hidden row spans such as `"5:7"` inside the selected range, exported or not. */
|
|
333
|
+
hiddenRows: string[];
|
|
334
|
+
/** Hidden column spans such as `"C:D"` inside the selected range, exported or not. */
|
|
335
|
+
hiddenColumns: string[];
|
|
336
|
+
merges: XlsxExportMerge[];
|
|
337
|
+
tables: XlsxExportTable[];
|
|
338
|
+
hyperlinks: XlsxExportHyperlink[];
|
|
339
|
+
objects: XlsxExportObject[];
|
|
340
|
+
/** Stored cells in row-major order, styled empty cells included. */
|
|
341
|
+
cells: XlsxExportCell[];
|
|
342
|
+
source: XlsxSourcePart | null;
|
|
343
|
+
}
|
|
344
|
+
interface XlsxStructuredContent extends ExportCompletion {
|
|
345
|
+
schemaVersion: 1;
|
|
346
|
+
/** `session` for a live export, `snapshot` for bytes. */
|
|
347
|
+
anchorScope: 'session' | 'snapshot';
|
|
348
|
+
dateSystem: '1900' | '1904';
|
|
349
|
+
calculation: {
|
|
350
|
+
policy: 'asStored';
|
|
351
|
+
freshness: 'unverified';
|
|
352
|
+
};
|
|
353
|
+
included: {
|
|
354
|
+
hiddenSheets: boolean;
|
|
355
|
+
hiddenRows: boolean;
|
|
356
|
+
hiddenColumns: boolean;
|
|
357
|
+
definedNames: boolean;
|
|
358
|
+
hiddenNames: boolean;
|
|
359
|
+
};
|
|
360
|
+
sheets: XlsxExportSheet[];
|
|
361
|
+
definedNames: XlsxExportDefinedName[];
|
|
362
|
+
diagnostics: XlsxExportDiagnostic[];
|
|
363
|
+
}
|
|
364
|
+
interface XlsxMarkdownContent extends ExportCompletion {
|
|
365
|
+
markdown: string;
|
|
366
|
+
/** One per `<!-- xlsx-export:N -->` marker, in order. */
|
|
367
|
+
anchors: MarkdownAnchor<XlsxAnchor>[];
|
|
368
|
+
/** The structured export's diagnostics, then what Markdown lost. */
|
|
369
|
+
diagnostics: XlsxExportDiagnostic[];
|
|
370
|
+
}
|
|
371
|
+
type XlsxExportFailureCode = 'invalid-options' | 'invalid-scope' | 'limit-exceeded';
|
|
372
|
+
interface XlsxExportFailure {
|
|
373
|
+
code: XlsxExportFailureCode;
|
|
374
|
+
/** The sheet a scope failure names, else `null`. */
|
|
375
|
+
target: XlsxAnchor | null;
|
|
376
|
+
message: string;
|
|
377
|
+
}
|
|
378
|
+
type XlsxExportResult<T> = {
|
|
379
|
+
ok: true;
|
|
380
|
+
version: string;
|
|
381
|
+
content: T;
|
|
382
|
+
} | OperationRefusal<XlsxExportFailure>;
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Versioned reads and version-checked edit batches over one workbook. Every shape here is plain
|
|
386
|
+
* JSON; the semantics live in Rust.
|
|
387
|
+
*
|
|
388
|
+
* Rows and columns are zero-based and ranges inclusive. Sheet ids come from the current catalog:
|
|
389
|
+
* `sheet:{index}` standalone, the replica's sheet keys in collaboration. Versions and sheet ids
|
|
390
|
+
* are session-scoped; neither survives save and reopen. Standalone ids are positional, so each is
|
|
391
|
+
* valid only for the version it was read at.
|
|
392
|
+
*/
|
|
393
|
+
|
|
394
|
+
/** Provenance only: it neither grants permission nor selects history. */
|
|
395
|
+
type XlsxEditSource = 'host' | 'agent';
|
|
396
|
+
/**
|
|
397
|
+
* `separate`: exactly one undo step. `none`: no undo step, existing entries kept; standalone
|
|
398
|
+
* undo replays inverse operations, so undoing an older step that wrote the same cell still
|
|
399
|
+
* overwrites it.
|
|
400
|
+
*
|
|
401
|
+
* @experimental `none` only: its interaction with standalone undo may change in a minor release.
|
|
402
|
+
*/
|
|
403
|
+
type XlsxEditHistory = 'separate' | 'none';
|
|
404
|
+
interface XlsxCellPosition {
|
|
405
|
+
row: number;
|
|
406
|
+
col: number;
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* An A1 cell or `A1:B2` range (`$` allowed), or zero-based corners. Sheet-qualified, union,
|
|
410
|
+
* whole-row/column and named references are refused.
|
|
411
|
+
*/
|
|
412
|
+
type XlsxRangeAddress = {
|
|
413
|
+
kind: 'a1';
|
|
414
|
+
a1: string;
|
|
415
|
+
} | {
|
|
416
|
+
kind: 'rowCol';
|
|
417
|
+
start: XlsxCellPosition;
|
|
418
|
+
end: XlsxCellPosition;
|
|
419
|
+
};
|
|
420
|
+
interface XlsxRangeTarget {
|
|
421
|
+
sheetId: string;
|
|
422
|
+
range: XlsxRangeAddress;
|
|
423
|
+
}
|
|
424
|
+
/** One cell in canonical form. */
|
|
425
|
+
interface XlsxCellAddress {
|
|
426
|
+
sheetId: string;
|
|
427
|
+
row: number;
|
|
428
|
+
col: number;
|
|
429
|
+
a1: string;
|
|
430
|
+
}
|
|
431
|
+
type XlsxErrorValue = '#DIV/0!' | '#N/A' | '#NAME?' | '#NULL!' | '#NUM!' | '#REF!' | '#VALUE!' | '#SPILL!' | '#CALC!';
|
|
432
|
+
type XlsxCellValue = {
|
|
433
|
+
kind: 'empty';
|
|
434
|
+
} | {
|
|
435
|
+
kind: 'number';
|
|
436
|
+
value: number;
|
|
437
|
+
} | {
|
|
438
|
+
kind: 'text';
|
|
439
|
+
value: string;
|
|
440
|
+
} | {
|
|
441
|
+
kind: 'bool';
|
|
442
|
+
value: boolean;
|
|
443
|
+
} | {
|
|
444
|
+
kind: 'error';
|
|
445
|
+
value: XlsxErrorValue;
|
|
446
|
+
};
|
|
447
|
+
/** Conditions on a cell's pre-batch state; an absent field imposes none. */
|
|
448
|
+
interface XlsxCellGuard {
|
|
449
|
+
/** The stored value, a formula's current result included. */
|
|
450
|
+
value?: XlsxCellValue;
|
|
451
|
+
/** Formula source without the leading `=`; `null` asserts there is no formula. */
|
|
452
|
+
formula?: string | null;
|
|
453
|
+
/** The exact text the engine formats the cell as. */
|
|
454
|
+
displayText?: string;
|
|
455
|
+
}
|
|
456
|
+
/** Matrices are row-major and exactly the target's shape. */
|
|
457
|
+
type XlsxEditOperation = {
|
|
458
|
+
/** What a user would type, parsed against each cell's current number format. */
|
|
459
|
+
op: 'setCellInputs';
|
|
460
|
+
target: XlsxRangeTarget;
|
|
461
|
+
inputs: string[][];
|
|
462
|
+
} | {
|
|
463
|
+
op: 'setCellValues';
|
|
464
|
+
target: XlsxRangeTarget;
|
|
465
|
+
values: XlsxCellValue[][];
|
|
466
|
+
} | {
|
|
467
|
+
/** Formula source without the leading `=`, stored as a formula whatever the format. */
|
|
468
|
+
op: 'setFormulas';
|
|
469
|
+
target: XlsxRangeTarget;
|
|
470
|
+
formulas: string[][];
|
|
471
|
+
} | {
|
|
472
|
+
/** Relative mutations resolve against each cell's current format. */
|
|
473
|
+
op: 'setNumberFormat';
|
|
474
|
+
target: XlsxRangeTarget;
|
|
475
|
+
format: NumberFormatMutation;
|
|
476
|
+
} | {
|
|
477
|
+
op: 'patchStyle';
|
|
478
|
+
target: XlsxRangeTarget;
|
|
479
|
+
patch: RangeStylePatch;
|
|
480
|
+
};
|
|
481
|
+
type XlsxEditStep = XlsxEditOperation & {
|
|
482
|
+
expect?: {
|
|
483
|
+
cells: XlsxCellGuard[][];
|
|
484
|
+
};
|
|
485
|
+
};
|
|
486
|
+
/** Requests above 16 MiB and results above 64 MiB are refused with `limit-exceeded`. */
|
|
487
|
+
interface XlsxEditRequest {
|
|
488
|
+
/** The version the targets were read at; a changed workbook refuses with `stale-version`. */
|
|
489
|
+
expectVersion: string;
|
|
490
|
+
/** Defaults to `host`. */
|
|
491
|
+
source?: XlsxEditSource;
|
|
492
|
+
/** Defaults to `separate`. */
|
|
493
|
+
history?: XlsxEditHistory;
|
|
494
|
+
/** Overrides the handle clock for this request; without either clock, NOW() has no clock. */
|
|
495
|
+
calculation?: {
|
|
496
|
+
nowSerial?: number;
|
|
497
|
+
};
|
|
498
|
+
steps: readonly XlsxEditStep[];
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* `locked-target` covers any write to merged-cell followers, array-formula cells and locked
|
|
502
|
+
* cells of protected sheets, and formats on protected sheets that do not allow formatting cells.
|
|
503
|
+
* `read-only` comes only from an editor that does not accept edits.
|
|
504
|
+
*/
|
|
505
|
+
type XlsxEditFailureCode = 'stale-version' | 'missing-target' | 'content-mismatch' | 'overlapping-steps' | 'locked-target' | 'read-only' | 'unsupported' | 'invalid-step' | 'limit-exceeded';
|
|
506
|
+
type XlsxEditFailure = OperationFailure<XlsxEditFailureCode, XlsxRangeTarget>;
|
|
507
|
+
type XlsxEditRefusal = OperationRefusal<XlsxEditFailure>;
|
|
508
|
+
interface XlsxEditReceipt {
|
|
509
|
+
stepIndex: number;
|
|
510
|
+
changed: boolean;
|
|
511
|
+
target: XlsxRangeTarget;
|
|
512
|
+
/** Row-major. */
|
|
513
|
+
changedCells: XlsxCellAddress[];
|
|
514
|
+
}
|
|
515
|
+
/** What one step would do; it cannot be committed later. */
|
|
516
|
+
interface XlsxEditPreview {
|
|
517
|
+
stepIndex: number;
|
|
518
|
+
target: XlsxRangeTarget;
|
|
519
|
+
wouldChange: boolean;
|
|
520
|
+
changedCellCount: number;
|
|
521
|
+
}
|
|
522
|
+
interface XlsxEditCalculation {
|
|
523
|
+
/** Dependents whose value moved. */
|
|
524
|
+
changed: XlsxCellAddress[];
|
|
525
|
+
cycleCells: XlsxCellAddress[];
|
|
526
|
+
limitedCells: XlsxCellAddress[];
|
|
527
|
+
/** Whether a list stopped at 10,000 cells. */
|
|
528
|
+
truncated: boolean;
|
|
529
|
+
}
|
|
530
|
+
type XlsxEditResult = (EditSuccess<XlsxEditReceipt> & {
|
|
531
|
+
source: XlsxEditSource;
|
|
532
|
+
/** Sheets the batch or its recalculation changed, as ids in sheet order. */
|
|
533
|
+
changedSheets: string[];
|
|
534
|
+
calculation: XlsxEditCalculation;
|
|
535
|
+
}) | XlsxEditRefusal;
|
|
536
|
+
type XlsxValidationResult = ValidationSuccess<XlsxEditPreview> | XlsxEditRefusal;
|
|
537
|
+
interface XlsxReadRequest {
|
|
538
|
+
/** Empty reads only the sheet catalog. */
|
|
539
|
+
ranges: readonly XlsxRangeTarget[];
|
|
540
|
+
}
|
|
541
|
+
interface XlsxSheetEntry {
|
|
542
|
+
visibility?: XlsxSheetVisibility;
|
|
543
|
+
sheetId: string;
|
|
544
|
+
name: string;
|
|
545
|
+
/**
|
|
546
|
+
* False for non-worksheets, which batches refuse to write, and protected worksheets, which take
|
|
547
|
+
* content only in unlocked cells and formats only when they allow formatting cells.
|
|
548
|
+
*/
|
|
549
|
+
editable: boolean;
|
|
550
|
+
}
|
|
551
|
+
interface XlsxCellRead {
|
|
552
|
+
a1: string;
|
|
553
|
+
value: XlsxCellValue;
|
|
554
|
+
formula: string | null;
|
|
555
|
+
displayText: string;
|
|
556
|
+
}
|
|
557
|
+
interface XlsxRangeRead {
|
|
558
|
+
target: XlsxRangeTarget;
|
|
559
|
+
/** Row-major. */
|
|
560
|
+
cells: XlsxCellRead[][];
|
|
561
|
+
}
|
|
562
|
+
interface XlsxReadCalculation {
|
|
563
|
+
cycleCells: XlsxCellAddress[];
|
|
564
|
+
limitedCells: XlsxCellAddress[];
|
|
565
|
+
/** Whether a list stopped at 10,000 cells. */
|
|
566
|
+
truncated: boolean;
|
|
567
|
+
}
|
|
568
|
+
type XlsxReadResult = {
|
|
569
|
+
ok: true;
|
|
570
|
+
version: string;
|
|
571
|
+
sheets: XlsxSheetEntry[];
|
|
572
|
+
ranges: XlsxRangeRead[];
|
|
573
|
+
calculation: XlsxReadCalculation;
|
|
574
|
+
} | XlsxEditRefusal;
|
|
575
|
+
/** An exact, case-sensitive substring search over display text. */
|
|
576
|
+
interface XlsxFindRequest {
|
|
577
|
+
text: string;
|
|
578
|
+
/** Defaults to every sheet. */
|
|
579
|
+
sheetIds?: readonly string[];
|
|
580
|
+
/** Defaults to 100; at most 10,000. */
|
|
581
|
+
limit?: number;
|
|
582
|
+
}
|
|
583
|
+
interface XlsxFindMatch {
|
|
584
|
+
cell: XlsxCellAddress;
|
|
585
|
+
/** The cell's whole display text. */
|
|
586
|
+
text: string;
|
|
587
|
+
}
|
|
588
|
+
type XlsxFindResult = {
|
|
589
|
+
ok: true;
|
|
590
|
+
version: string;
|
|
591
|
+
matches: XlsxFindMatch[];
|
|
592
|
+
truncated: boolean;
|
|
593
|
+
} | XlsxEditRefusal;
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* A scrolled window into a sheet. `x`/`y` are content-pixel offsets into the
|
|
597
|
+
* non-frozen body. Mirrors the Rust `Viewport`.
|
|
598
|
+
*/
|
|
599
|
+
interface Viewport {
|
|
600
|
+
x: number;
|
|
601
|
+
y: number;
|
|
602
|
+
width: number;
|
|
603
|
+
height: number;
|
|
604
|
+
}
|
|
605
|
+
interface PrintMetrics {
|
|
606
|
+
dpi: number;
|
|
607
|
+
maxDigitWidth: number;
|
|
608
|
+
defaultRowHeightPt: number;
|
|
609
|
+
defaultColumnWidth?: number;
|
|
610
|
+
fontSizePt: number;
|
|
611
|
+
fontFamily: string;
|
|
612
|
+
fontAscent: number;
|
|
613
|
+
fontDescent: number;
|
|
614
|
+
}
|
|
615
|
+
type XlsxAutoFilterOp = {
|
|
616
|
+
type: 'setAutoFilter';
|
|
617
|
+
sheet: number;
|
|
618
|
+
range: string | null;
|
|
619
|
+
};
|
|
620
|
+
/**
|
|
621
|
+
* Chrome-facing sheet metadata: stable IDs, tab names, active index, and the
|
|
622
|
+
* scrollable content extent of the active sheet. Mirrors the Rust `SheetInfo`.
|
|
623
|
+
*/
|
|
624
|
+
interface SheetInfo {
|
|
625
|
+
autoFilter?: string | null;
|
|
626
|
+
sheetIds: string[];
|
|
627
|
+
sheetNames: string[];
|
|
628
|
+
activeSheet: number;
|
|
629
|
+
contentWidth: number;
|
|
630
|
+
contentHeight: number;
|
|
631
|
+
frozenRows: number;
|
|
632
|
+
frozenCols: number;
|
|
633
|
+
initialScrollX: number;
|
|
634
|
+
initialScrollY: number;
|
|
635
|
+
}
|
|
636
|
+
interface CellPosition {
|
|
637
|
+
x: number;
|
|
638
|
+
y: number;
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* Result of any mutating call: whether it changed the workbook and the
|
|
642
|
+
* (possibly grown) sheet metadata. Mirrors the Rust `EditResult`.
|
|
643
|
+
*
|
|
644
|
+
* `changed` lists the a1 addresses (on the active sheet) of *other* cells whose
|
|
645
|
+
* displayed value moved as a fallout of the edit — the dependents the recalc
|
|
646
|
+
* pass recomputed. It excludes the directly edited cell(s) and is omitted by
|
|
647
|
+
* cores built before the recalc engine, so treat it as additive.
|
|
648
|
+
*/
|
|
649
|
+
interface EditResult {
|
|
650
|
+
applied: boolean;
|
|
651
|
+
sheetInfo: SheetInfo;
|
|
652
|
+
changed?: string[];
|
|
653
|
+
limitedCells?: string[];
|
|
654
|
+
}
|
|
655
|
+
/** Facade stage latencies of one profiled mutation, in ms. */
|
|
656
|
+
interface EditProfile {
|
|
657
|
+
validateMs: number;
|
|
658
|
+
applyMs: number;
|
|
659
|
+
recalcMs: number;
|
|
660
|
+
resultMs: number;
|
|
661
|
+
}
|
|
662
|
+
interface ProfiledEditResult extends EditResult {
|
|
663
|
+
profile: EditProfile;
|
|
664
|
+
}
|
|
665
|
+
interface DisplayListProfile {
|
|
666
|
+
buildMs: number;
|
|
667
|
+
encodeMs: number;
|
|
668
|
+
}
|
|
669
|
+
interface ProfiledDisplayList {
|
|
670
|
+
displayList: DisplayList;
|
|
671
|
+
profile: DisplayListProfile;
|
|
672
|
+
}
|
|
673
|
+
interface CalculationStatus {
|
|
674
|
+
limitedCells: string[];
|
|
675
|
+
/** The last recalculation ran out of its budget; the cells it could not evaluate keep their saved values. */
|
|
676
|
+
budgetExhausted?: boolean;
|
|
677
|
+
}
|
|
678
|
+
type NumberFormat = 'automatic' | 'plainText' | 'number' | 'percent' | 'scientific' | 'currency' | 'date' | 'time' | 'custom';
|
|
679
|
+
type BorderPreset = 'all' | 'inner' | 'horizontal' | 'vertical' | 'outer' | 'left' | 'top' | 'right' | 'bottom' | 'none';
|
|
680
|
+
type BorderStyle = 'solid' | 'dashed' | 'dotted' | 'double';
|
|
681
|
+
type HorizontalAlignment = 'left' | 'center' | 'right';
|
|
682
|
+
type VerticalAlignment = 'top' | 'middle' | 'bottom';
|
|
683
|
+
type TextWrapping = 'overflow' | 'wrap' | 'clip';
|
|
684
|
+
type StyleProperty = 'bold' | 'italic' | 'strikethrough' | 'fontFamily' | 'fontSize' | 'textColor' | 'fillColor' | 'borders' | 'horizontalAlignment' | 'verticalAlignment' | 'textWrapping';
|
|
685
|
+
interface BorderPatch {
|
|
686
|
+
preset?: BorderPreset;
|
|
687
|
+
style?: BorderStyle;
|
|
688
|
+
color?: string;
|
|
689
|
+
}
|
|
690
|
+
interface RangeStylePatch {
|
|
691
|
+
bold?: boolean;
|
|
692
|
+
italic?: boolean;
|
|
693
|
+
strikethrough?: boolean;
|
|
694
|
+
fontFamily?: string;
|
|
695
|
+
fontSize?: number;
|
|
696
|
+
textColor?: string;
|
|
697
|
+
fillColor?: string;
|
|
698
|
+
border?: BorderPatch;
|
|
699
|
+
horizontalAlignment?: HorizontalAlignment;
|
|
700
|
+
verticalAlignment?: VerticalAlignment;
|
|
701
|
+
textWrapping?: TextWrapping;
|
|
702
|
+
clear?: StyleProperty[];
|
|
703
|
+
}
|
|
704
|
+
type NumberFormatMutation = Exclude<NumberFormat, 'custom'> | 'increaseDecimal' | 'decreaseDecimal' | {
|
|
705
|
+
type: 'custom';
|
|
706
|
+
pattern: string;
|
|
707
|
+
};
|
|
708
|
+
interface SelectionFormatting {
|
|
709
|
+
numberFormat?: NumberFormat;
|
|
710
|
+
numberFormatPattern?: string;
|
|
711
|
+
fontFamily?: string;
|
|
712
|
+
fontSize?: number;
|
|
713
|
+
bold?: boolean;
|
|
714
|
+
italic?: boolean;
|
|
715
|
+
strikethrough?: boolean;
|
|
716
|
+
textColor?: string;
|
|
717
|
+
fillColor?: string;
|
|
718
|
+
borderPreset?: BorderPreset;
|
|
719
|
+
borderStyle?: BorderStyle;
|
|
720
|
+
borderColor?: string;
|
|
721
|
+
horizontalAlignment?: HorizontalAlignment;
|
|
722
|
+
verticalAlignment?: VerticalAlignment;
|
|
723
|
+
textWrapping?: TextWrapping;
|
|
724
|
+
}
|
|
725
|
+
interface CapturedFormat<TFormat = unknown> {
|
|
726
|
+
rows: number;
|
|
727
|
+
columns: number;
|
|
728
|
+
formats: TFormat[];
|
|
729
|
+
sourceStyles?: (number | null)[];
|
|
730
|
+
sourceFormats?: unknown[];
|
|
731
|
+
}
|
|
732
|
+
type CapturedColor = 'Auto' | {
|
|
733
|
+
Rgb: string;
|
|
734
|
+
} | {
|
|
735
|
+
Indexed: number;
|
|
736
|
+
} | {
|
|
737
|
+
Theme: {
|
|
738
|
+
idx: number;
|
|
739
|
+
tint: number;
|
|
740
|
+
};
|
|
741
|
+
};
|
|
742
|
+
type CapturedFill = 'None' | {
|
|
743
|
+
Solid: CapturedColor;
|
|
744
|
+
} | {
|
|
745
|
+
Pattern: {
|
|
746
|
+
pattern: PatternType;
|
|
747
|
+
fg?: CapturedColor | null;
|
|
748
|
+
bg?: CapturedColor | null;
|
|
749
|
+
};
|
|
750
|
+
};
|
|
751
|
+
type CapturedBorderStyle = 'Thin' | 'Medium' | 'Thick' | 'Dashed' | 'Dotted' | 'Double' | 'Hair' | 'MediumDashed' | 'DashDot' | 'MediumDashDot' | 'DashDotDot' | 'MediumDashDotDot' | 'SlantDashDot';
|
|
752
|
+
interface CapturedBorderEdge {
|
|
753
|
+
style: CapturedBorderStyle;
|
|
754
|
+
color?: CapturedColor | null;
|
|
755
|
+
}
|
|
756
|
+
interface CapturedCellFormat {
|
|
757
|
+
font: {
|
|
758
|
+
name?: string | null;
|
|
759
|
+
size_pt?: number | null;
|
|
760
|
+
bold?: boolean;
|
|
761
|
+
italic?: boolean;
|
|
762
|
+
underline?: boolean;
|
|
763
|
+
strike?: boolean;
|
|
764
|
+
color?: CapturedColor | null;
|
|
765
|
+
};
|
|
766
|
+
fill: CapturedFill;
|
|
767
|
+
border: {
|
|
768
|
+
left?: CapturedBorderEdge | null;
|
|
769
|
+
right?: CapturedBorderEdge | null;
|
|
770
|
+
top?: CapturedBorderEdge | null;
|
|
771
|
+
bottom?: CapturedBorderEdge | null;
|
|
772
|
+
};
|
|
773
|
+
numberFormat: {
|
|
774
|
+
kind: 'builtin';
|
|
775
|
+
id: number;
|
|
776
|
+
} | {
|
|
777
|
+
kind: 'custom';
|
|
778
|
+
pattern: string;
|
|
779
|
+
};
|
|
780
|
+
alignment: {
|
|
781
|
+
h?: 'General' | 'Left' | 'Center' | 'Right' | 'Fill' | 'Justify' | 'CenterContinuous' | 'Distributed' | null;
|
|
782
|
+
v?: 'Top' | 'Center' | 'Bottom' | 'Justify' | 'Distributed' | null;
|
|
783
|
+
wrap_text?: boolean;
|
|
784
|
+
shrink_to_fit?: boolean;
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
interface CellPoint {
|
|
788
|
+
row: number;
|
|
789
|
+
col: number;
|
|
790
|
+
}
|
|
791
|
+
interface MergedRange {
|
|
792
|
+
start: CellPoint;
|
|
793
|
+
end: CellPoint;
|
|
794
|
+
}
|
|
795
|
+
interface WorkbookHyperlink {
|
|
796
|
+
range: MergedRange;
|
|
797
|
+
externalTarget?: string;
|
|
798
|
+
location?: string;
|
|
799
|
+
tooltip?: string;
|
|
800
|
+
display?: string;
|
|
801
|
+
}
|
|
802
|
+
interface DifferentialFormatInput {
|
|
803
|
+
fontColor?: string;
|
|
804
|
+
bold?: boolean;
|
|
805
|
+
italic?: boolean;
|
|
806
|
+
fill?: string;
|
|
807
|
+
}
|
|
808
|
+
interface ConditionalFormatRuleInput {
|
|
809
|
+
type: 'cellIs' | 'expression';
|
|
810
|
+
operator?: string;
|
|
811
|
+
formulas: string[];
|
|
812
|
+
}
|
|
813
|
+
interface ConditionalFormatInfo {
|
|
814
|
+
id: string;
|
|
815
|
+
range: string;
|
|
816
|
+
type: string;
|
|
817
|
+
operator?: string;
|
|
818
|
+
formulas: string[];
|
|
819
|
+
priority: number;
|
|
820
|
+
dxfId?: number;
|
|
821
|
+
format: DifferentialFormatInput;
|
|
822
|
+
editable: boolean;
|
|
823
|
+
}
|
|
824
|
+
type ConditionalFormatOp = {
|
|
825
|
+
type: 'addConditionalFormat';
|
|
826
|
+
sheet: number;
|
|
827
|
+
range: MergedRange;
|
|
828
|
+
kind: 'cellIs' | 'expression';
|
|
829
|
+
operator?: string;
|
|
830
|
+
formulas: string[];
|
|
831
|
+
format: DifferentialFormatInput;
|
|
832
|
+
} | {
|
|
833
|
+
type: 'removeConditionalFormat';
|
|
834
|
+
sheet: number;
|
|
835
|
+
id: string;
|
|
836
|
+
};
|
|
837
|
+
interface HistoryState {
|
|
838
|
+
canUndo: boolean;
|
|
839
|
+
canRedo: boolean;
|
|
840
|
+
undoDepth: number;
|
|
841
|
+
redoDepth: number;
|
|
842
|
+
}
|
|
843
|
+
type WorkbookUpdateOrigin = CollaborationUpdateOrigin;
|
|
844
|
+
/**
|
|
845
|
+
* `fromPeer` is true for every event a peer update caused through `applyUpdate`, including
|
|
846
|
+
* the `'local'` re-encoding a replica forwards after adopting a whole-document state.
|
|
847
|
+
*/
|
|
848
|
+
interface WorkbookUpdateInfo {
|
|
849
|
+
fromPeer: boolean;
|
|
850
|
+
}
|
|
851
|
+
type WorkbookUpdateListener = (update: Uint8Array, origin: WorkbookUpdateOrigin, info: WorkbookUpdateInfo) => void;
|
|
852
|
+
interface WorkbookCalculationContext {
|
|
853
|
+
nowSerial: number;
|
|
854
|
+
randSeed: number;
|
|
855
|
+
}
|
|
856
|
+
interface OpenWorkbookOptions {
|
|
857
|
+
/** Open a Yrs-backed replica that can accept peer updates. */
|
|
858
|
+
collaborative?: boolean;
|
|
859
|
+
/** Peer-unique positive safe integer. Generated securely when omitted. */
|
|
860
|
+
clientId?: number;
|
|
861
|
+
calculation?: WorkbookCalculationContext;
|
|
862
|
+
}
|
|
863
|
+
/**
|
|
864
|
+
* The editable view of one cell: A1 address, the exact string the user would
|
|
865
|
+
* edit (formulas as `=...`, guarded literals with a leading `'`), and whether
|
|
866
|
+
* that string is a formula. Mirrors the Rust `CellEdit`.
|
|
867
|
+
*/
|
|
868
|
+
interface CellEdit {
|
|
869
|
+
a1: string;
|
|
870
|
+
input: string;
|
|
871
|
+
isFormula: boolean;
|
|
872
|
+
isArrayFormula?: boolean;
|
|
873
|
+
}
|
|
874
|
+
interface XlsxTextSearchOptions {
|
|
875
|
+
/** Defaults to false. */
|
|
876
|
+
caseSensitive?: boolean;
|
|
877
|
+
/** Maximum matches; defaults to 1000. */
|
|
878
|
+
limit?: number;
|
|
879
|
+
}
|
|
880
|
+
/** Zero-based sheet, row, and column. */
|
|
881
|
+
interface XlsxTextMatch {
|
|
882
|
+
sheet: number;
|
|
883
|
+
sheetId: string;
|
|
884
|
+
sheetName: string;
|
|
885
|
+
row: number;
|
|
886
|
+
col: number;
|
|
887
|
+
a1: string;
|
|
888
|
+
/** Formatted display text. */
|
|
889
|
+
text: string;
|
|
890
|
+
}
|
|
891
|
+
/** One cell of a batch edit: target coordinates plus the raw user input. */
|
|
892
|
+
interface CellInputEdit {
|
|
893
|
+
row: number;
|
|
894
|
+
col: number;
|
|
895
|
+
input: string;
|
|
896
|
+
copyFrom?: CellPoint;
|
|
897
|
+
}
|
|
898
|
+
/**
|
|
899
|
+
* One edit inside a proposal. Same shape as {@link CellInputEdit} plus the
|
|
900
|
+
* sheet index — a proposal's cells carry their own sheet on the wire, so it
|
|
901
|
+
* can span sheets rather than being pinned to the active one.
|
|
902
|
+
*/
|
|
903
|
+
interface ProposalEdit extends CellInputEdit {
|
|
904
|
+
sheet: number;
|
|
905
|
+
numberFormat?: NumberFormatMutation;
|
|
906
|
+
}
|
|
907
|
+
/**
|
|
908
|
+
* One cell of a pending proposal: where it lands and the *formatted display
|
|
909
|
+
* texts* before/after applying it. `oldText`/`newText` are what the grid shows,
|
|
910
|
+
* not the raw input — the ghost decoration paints `newText` directly. Mirrors
|
|
911
|
+
* the Rust proposal cell.
|
|
912
|
+
*/
|
|
913
|
+
interface ProposalCell {
|
|
914
|
+
sheet: number;
|
|
915
|
+
row: number;
|
|
916
|
+
col: number;
|
|
917
|
+
a1: string;
|
|
918
|
+
oldText: string;
|
|
919
|
+
newText: string;
|
|
920
|
+
}
|
|
921
|
+
/**
|
|
922
|
+
* A pending, un-applied set of cell changes an agent has staged for human
|
|
923
|
+
* review. `note` is the agent's rationale (may be null); `cells` are the
|
|
924
|
+
* per-cell before/after previews. Applying it is one undo step.
|
|
925
|
+
*/
|
|
926
|
+
interface Proposal {
|
|
927
|
+
id: string;
|
|
928
|
+
agentId: string;
|
|
929
|
+
note: string | null;
|
|
930
|
+
cells: ProposalCell[];
|
|
931
|
+
}
|
|
932
|
+
/** A drifted proposal cell: its sheet index and catalog id beside the coordinates. */
|
|
933
|
+
interface StaleProposalTarget extends XlsxCellAddress {
|
|
934
|
+
sheet: number;
|
|
935
|
+
}
|
|
936
|
+
/**
|
|
937
|
+
* Thrown by {@link WorkbookHandle.acceptProposal} when the workbook changed
|
|
938
|
+
* under a proposal since it was staged (an edit touched one of its base cells)
|
|
939
|
+
* and `force` was not set. `cells` are the a1 addresses that moved, so the UI
|
|
940
|
+
* can name them and offer a force-apply; `targets` also carry each one's sheet.
|
|
941
|
+
*/
|
|
942
|
+
declare class StaleProposalError extends Error {
|
|
943
|
+
readonly cells: string[];
|
|
944
|
+
readonly targets: StaleProposalTarget[];
|
|
945
|
+
constructor(cells: string[], targets?: StaleProposalTarget[]);
|
|
946
|
+
}
|
|
947
|
+
/** A display-list viewport exceeds the counted cell limit. */
|
|
948
|
+
declare class DisplayTooLargeError extends Error {
|
|
949
|
+
readonly cells: number;
|
|
950
|
+
readonly maxCells: number;
|
|
951
|
+
readonly code = "displayTooLarge";
|
|
952
|
+
constructor(cells: number, maxCells: number);
|
|
953
|
+
}
|
|
954
|
+
/**
|
|
955
|
+
* A typed handle over an open workbook, hiding the wasm object and its JSON
|
|
956
|
+
* boundary. Call {@link WorkbookHandle.dispose} to free the wasm memory.
|
|
957
|
+
*/
|
|
958
|
+
interface WorkbookHandle extends CollaborationReplica {
|
|
959
|
+
readonly clientId: number;
|
|
960
|
+
setCalculationContext(context: WorkbookCalculationContext | null): void;
|
|
961
|
+
/** Available in both modes; encodes this handle's current Yrs state vector. */
|
|
962
|
+
encodeStateVector(): Uint8Array;
|
|
963
|
+
/** Available in both modes; pass a peer vector to encode only the missing state. */
|
|
964
|
+
encodeStateAsUpdate(remoteStateVector?: Uint8Array): Uint8Array;
|
|
965
|
+
/** Apply a peer update. Standalone handles throw the Rust `NotCollaborative` error. */
|
|
966
|
+
applyUpdate(update: Uint8Array): EditResult;
|
|
967
|
+
/** Observe owned update bytes from local commits and accepted remote updates. */
|
|
968
|
+
onUpdate(listener: WorkbookUpdateListener): () => void;
|
|
969
|
+
sheetInfo(): SheetInfo;
|
|
970
|
+
sheetCount(): number;
|
|
971
|
+
/** Metadata for `sheet`, with that index in `activeSheet`; leaves the workbook unchanged. */
|
|
972
|
+
sheetInfoFor(sheet: number): SheetInfo;
|
|
973
|
+
calculationStatus(): CalculationStatus;
|
|
974
|
+
/** Clamps tracks to the grid and truncates oversized frames at the scroll origin. */
|
|
975
|
+
displayList(viewport: Viewport): DisplayList;
|
|
976
|
+
/** `displayList` with build and encode time measured inside the core. */
|
|
977
|
+
displayListProfiled(viewport: Viewport): ProfiledDisplayList;
|
|
978
|
+
printDisplayList(sheet: number, range: string, metrics: PrintMetrics, gridlines: boolean): DisplayList;
|
|
979
|
+
/**
|
|
980
|
+
* the chart under a viewport-local point on the active sheet, or `null`,
|
|
981
|
+
* resolved against the current model from the same anchor geometry the
|
|
982
|
+
* display list is built from. the returned `label` is always empty: a hit
|
|
983
|
+
* test resolves anchors only and never reads a chart part.
|
|
984
|
+
*
|
|
985
|
+
* this answers for the model as it is now. chrome painting a frame should
|
|
986
|
+
* hit-test that frame's own `charts` with `chartRegionAtPoint` instead, or a
|
|
987
|
+
* mutation the canvas has not drawn yet will move the answer off the pixels.
|
|
988
|
+
*/
|
|
989
|
+
chartAtPoint(viewport: Viewport, x: number, y: number): ChartRegion | null;
|
|
990
|
+
/**
|
|
991
|
+
* slide the chart frame `chart` names — a {@link ChartRegion} id — by a
|
|
992
|
+
* content-pixel delta, clamped to the grid, as one undo step. the new anchor
|
|
993
|
+
* is written back on save. throws for a chart pinned to the sheet by an
|
|
994
|
+
* absolute anchor.
|
|
995
|
+
*/
|
|
996
|
+
moveChart(sheet: number, chart: string, dx: number, dy: number): EditResult;
|
|
997
|
+
setActiveSheet(index: number): void;
|
|
998
|
+
/**
|
|
999
|
+
* apply one user input to a cell (parses number/bool/formula/text) and
|
|
1000
|
+
* recalc its transitive dependents. one undo step; moved dependents come back
|
|
1001
|
+
* in `EditResult.changed`.
|
|
1002
|
+
*/
|
|
1003
|
+
editCell(sheet: number, row: number, col: number, input: string): EditResult;
|
|
1004
|
+
/** `editCell` with the facade's stage timings attached. */
|
|
1005
|
+
editCellProfiled(sheet: number, row: number, col: number, input: string): ProfiledEditResult;
|
|
1006
|
+
/** apply a batch of inputs (paste path) as one undo step; dependents recalc. */
|
|
1007
|
+
editCells(sheet: number, edits: CellInputEdit[]): EditResult;
|
|
1008
|
+
/** Move a range within one sheet and rewrite references in one native undo step. */
|
|
1009
|
+
moveRange(sheet: number, source: string, destination: string): EditResult;
|
|
1010
|
+
setHyperlink(sheet: number, hyperlink: WorkbookHyperlink): EditResult;
|
|
1011
|
+
removeHyperlink(sheet: number, range: MergedRange): EditResult;
|
|
1012
|
+
charts(sheet: number): ChartInfo[];
|
|
1013
|
+
editCharts(edits: ChartMutation[]): EditResult;
|
|
1014
|
+
conditionalFormats(sheet: number): ConditionalFormatInfo[];
|
|
1015
|
+
/** raw op-list escape hatch for structural ops (insert/delete rows, merges…). */
|
|
1016
|
+
applyOps(ops: unknown[]): EditResult;
|
|
1017
|
+
/** `applyOps` with the facade's stage timings attached. */
|
|
1018
|
+
applyOpsProfiled(ops: unknown[]): ProfiledEditResult;
|
|
1019
|
+
undo(): EditResult;
|
|
1020
|
+
redo(): EditResult;
|
|
1021
|
+
/** the editable view of one cell (formula bar / in-cell editor prefill). */
|
|
1022
|
+
cell(sheet: number, row: number, col: number): CellEdit;
|
|
1023
|
+
/** Searches formatted text in sheet and row order. */
|
|
1024
|
+
searchText(query: string, options?: XlsxTextSearchOptions): XlsxTextMatch[];
|
|
1025
|
+
cellPosition(sheet: number, row: number, col: number): CellPosition;
|
|
1026
|
+
/** Absolute sheet rectangle in unzoomed pixels. */
|
|
1027
|
+
cellRect(sheet: number, row: number, col: number): Rect;
|
|
1028
|
+
selectionData(sheet: number, row: number, col: number, direction?: Direction | 'usedRange' | 'rowEnd' | 'merge'): SelectionData;
|
|
1029
|
+
/** row-major editable views for a range, e.g. "A1:C3" (clipboard copy). */
|
|
1030
|
+
rangeCells(sheet: number, range: string): CellEdit[][];
|
|
1031
|
+
patchRangeStyle(sheet: number, range: string, patch: RangeStylePatch): EditResult;
|
|
1032
|
+
setNumberFormat(sheet: number, range: string, format: NumberFormatMutation): EditResult;
|
|
1033
|
+
selectionFormatting(sheet: number, range: string): SelectionFormatting;
|
|
1034
|
+
captureFormat(sheet: number, range: string): CapturedFormat;
|
|
1035
|
+
applyFormat(sheet: number, range: string, format: CapturedFormat): EditResult;
|
|
1036
|
+
mergedRanges(sheet: number, range: string): MergedRange[];
|
|
1037
|
+
visibleMergedRanges(sheet: number, viewport: Viewport): MergedRange[];
|
|
1038
|
+
historyState(): HistoryState;
|
|
1039
|
+
/**
|
|
1040
|
+
* render the current sheet viewport to png bytes via the native raster
|
|
1041
|
+
* backend — the same display list the canvas paints, rasterized server-side.
|
|
1042
|
+
* throws if the embedded wasm was built without png export (the `raster`
|
|
1043
|
+
* cargo feature); guard with {@link isPngExportAvailable}.
|
|
1044
|
+
*/
|
|
1045
|
+
renderPng(viewport: Viewport): Uint8Array;
|
|
1046
|
+
/**
|
|
1047
|
+
* render an a1 range (default: the used range) at an optional scale to png.
|
|
1048
|
+
* dimensions are capped wasm-side; same availability guard as renderPng.
|
|
1049
|
+
*/
|
|
1050
|
+
renderRangePng(opts?: {
|
|
1051
|
+
range?: string;
|
|
1052
|
+
scale?: number;
|
|
1053
|
+
}): Uint8Array;
|
|
1054
|
+
/** serialize the workbook back to .xlsx bytes. */
|
|
1055
|
+
save(): Uint8Array;
|
|
1056
|
+
/**
|
|
1057
|
+
* stage an agent's proposed edits for human review without applying them.
|
|
1058
|
+
* returns the {@link Proposal} with per-cell formatted before/after previews.
|
|
1059
|
+
* throws if the embedded wasm predates proposals; guard with
|
|
1060
|
+
* {@link WorkbookHandle.isProposalsAvailable}.
|
|
1061
|
+
*/
|
|
1062
|
+
propose(agentId: string, note: string | null, edits: ProposalEdit[]): Proposal;
|
|
1063
|
+
/** every pending proposal, oldest first. empty when none or unsupported. */
|
|
1064
|
+
listProposals(): Proposal[];
|
|
1065
|
+
/**
|
|
1066
|
+
* apply a pending proposal as one undo step and recalc dependents. throws
|
|
1067
|
+
* {@link StaleProposalError} when the base changed since it was staged and
|
|
1068
|
+
* `force` is not set; pass `{ force: true }` to apply anyway.
|
|
1069
|
+
*/
|
|
1070
|
+
acceptProposal(id: string, opts?: {
|
|
1071
|
+
force?: boolean;
|
|
1072
|
+
}): EditResult & {
|
|
1073
|
+
proposalId: string;
|
|
1074
|
+
};
|
|
1075
|
+
/** drop a pending proposal without applying it; false when the id was unknown. */
|
|
1076
|
+
rejectProposal(id: string): boolean;
|
|
1077
|
+
/** whether the embedded wasm core was built with the proposals api. */
|
|
1078
|
+
isProposalsAvailable(): boolean;
|
|
1079
|
+
/**
|
|
1080
|
+
* The session-scoped version of the committed workbook. Committed edits, peer updates, undo,
|
|
1081
|
+
* redo and a recalculation that changes values or what an export reports about results move
|
|
1082
|
+
* it; selection, the active sheet and proposals do not.
|
|
1083
|
+
*/
|
|
1084
|
+
version(): string;
|
|
1085
|
+
listDefinedNames(request?: XlsxDefinedNamesRequest): XlsxDefinedNamesResult;
|
|
1086
|
+
/** Cells with the version they were read at; empty `ranges` reads the sheet catalog. */
|
|
1087
|
+
readCells(request: XlsxReadRequest): XlsxReadResult;
|
|
1088
|
+
/** Exact, case-sensitive search over display text, one match per cell. */
|
|
1089
|
+
findText(request: XlsxFindRequest): XlsxFindResult;
|
|
1090
|
+
/** Resolves, stages and rehearses a batch like `applyEdits`, changing nothing. */
|
|
1091
|
+
validateEdits(request: XlsxEditRequest): XlsxValidationResult;
|
|
1092
|
+
/**
|
|
1093
|
+
* Applies every step as one committed, recalculated change, or refuses with nothing changed.
|
|
1094
|
+
* Update listeners run once, after the call returns. Malformed requests throw.
|
|
1095
|
+
*/
|
|
1096
|
+
applyEdits(request: XlsxEditRequest): XlsxEditResult;
|
|
1097
|
+
/**
|
|
1098
|
+
* Exports the committed workbook with the version it was read at: sparse cells with values,
|
|
1099
|
+
* formulas and display text, plus sheet metadata and diagnostics. Nothing is recalculated,
|
|
1100
|
+
* flushed or published. Options it cannot honor refuse; malformed ones throw.
|
|
1101
|
+
*/
|
|
1102
|
+
exportStructured(options?: XlsxExportOptions): XlsxExportResult<XlsxStructuredContent>;
|
|
1103
|
+
/** {@link WorkbookHandle.exportStructured} rendered as Markdown from the same read. */
|
|
1104
|
+
exportMarkdown(options?: XlsxExportOptions, markdownOptions?: XlsxMarkdownOptions): XlsxExportResult<XlsxMarkdownContent>;
|
|
1105
|
+
dispose(): void;
|
|
1106
|
+
}
|
|
1107
|
+
type WasmInitInput = InitInput | Promise<InitInput>;
|
|
1108
|
+
/** Initialize the workbook engine. Concurrent calls share the same attempt. */
|
|
1109
|
+
declare function initWasm(input?: WasmInitInput): Promise<void>;
|
|
1110
|
+
/** Maximum counted cells per frame, including boundary and frozen tracks; call after `initWasm`. */
|
|
1111
|
+
declare function getDisplayListCellLimit(): number;
|
|
1112
|
+
/**
|
|
1113
|
+
* Whether this environment exposes the WebAssembly runtime required by the core.
|
|
1114
|
+
*/
|
|
1115
|
+
declare function isWasmAvailable(): boolean;
|
|
1116
|
+
/**
|
|
1117
|
+
* Whether the embedded wasm core was built with png export (the `raster` cargo
|
|
1118
|
+
* feature). The wasm-bindgen method only exists on the class when compiled in,
|
|
1119
|
+
* so chrome can disable an export control instead of calling and catching.
|
|
1120
|
+
*/
|
|
1121
|
+
declare function isPngExportAvailable(): boolean;
|
|
1122
|
+
/**
|
|
1123
|
+
* Whether the embedded wasm core exposes the proposals api (propose / accept /
|
|
1124
|
+
* reject / list). The methods only exist on the class when compiled in, so the
|
|
1125
|
+
* UI can hide proposal chrome and degrade gracefully against an older module.
|
|
1126
|
+
*/
|
|
1127
|
+
declare function isProposalsAvailable(): boolean;
|
|
1128
|
+
/**
|
|
1129
|
+
* Open a workbook from raw `.xlsx` bytes, initializing the core if needed.
|
|
1130
|
+
* Throws an `Error` if the bytes are not a readable workbook.
|
|
1131
|
+
*/
|
|
1132
|
+
declare function openWorkbook(bytes: Uint8Array, options?: OpenWorkbookOptions): WorkbookHandle;
|
|
1133
|
+
/**
|
|
1134
|
+
* Exports `.xlsx` bytes as read, initializing the core if needed. Formula results are the
|
|
1135
|
+
* stored ones: nothing is recalculated and no clock is read, so the same bytes and options
|
|
1136
|
+
* always give the same content. Unreadable bytes and unusable options reject.
|
|
1137
|
+
*/
|
|
1138
|
+
declare function exportXlsxStructured(bytes: Uint8Array, options?: XlsxExportOptions): Promise<XlsxStructuredContent>;
|
|
1139
|
+
/** {@link exportXlsxStructured} rendered as Markdown. */
|
|
1140
|
+
declare function exportXlsxMarkdown(bytes: Uint8Array, options?: XlsxExportOptions, markdownOptions?: XlsxMarkdownOptions): Promise<XlsxMarkdownContent>;
|
|
1141
|
+
/** Renders structured content as Markdown; content that does not validate rejects. */
|
|
1142
|
+
declare function renderXlsxMarkdown(content: XlsxStructuredContent, options?: XlsxMarkdownOptions): Promise<XlsxMarkdownContent>;
|
|
1143
|
+
/**
|
|
1144
|
+
* The crate version string, for asserting wasm/js parity.
|
|
1145
|
+
*/
|
|
1146
|
+
declare function wasmVersion(): string;
|
|
1147
|
+
|
|
1148
|
+
/** @internal */
|
|
1149
|
+
type BaseRefusal = 'read-only' | 'stale' | 'superseded' | 'not-ready' | 'busy' | 'disposed' | 'invalid-payload' | 'unsupported' | 'dependency-refused' | 'unknown-outcome';
|
|
1150
|
+
/** @internal */
|
|
1151
|
+
type Refusal<F extends string = never> = {
|
|
1152
|
+
code: BaseRefusal | F;
|
|
1153
|
+
detail?: string;
|
|
1154
|
+
};
|
|
1155
|
+
/** @internal */
|
|
1156
|
+
type Dependency = 'doc' | 'selection' | 'layout';
|
|
1157
|
+
/** @internal Worker state at the read boundary. */
|
|
1158
|
+
type At = {
|
|
1159
|
+
incarnation: number;
|
|
1160
|
+
epoch: number;
|
|
1161
|
+
throughSeq: number;
|
|
1162
|
+
doc: number;
|
|
1163
|
+
selection: number;
|
|
1164
|
+
layout: number;
|
|
1165
|
+
};
|
|
1166
|
+
/** @internal */
|
|
1167
|
+
type Read<R, F extends string = never> = {
|
|
1168
|
+
ok: true;
|
|
1169
|
+
value: R;
|
|
1170
|
+
at: At;
|
|
1171
|
+
} | {
|
|
1172
|
+
ok: false;
|
|
1173
|
+
refusal: Refusal<F>;
|
|
1174
|
+
};
|
|
1175
|
+
declare const queryType: unique symbol;
|
|
1176
|
+
/** @internal */
|
|
1177
|
+
type StaleMode = 'answer-at-fence' | {
|
|
1178
|
+
readonly reject: readonly Dependency[];
|
|
1179
|
+
};
|
|
1180
|
+
/** @internal */
|
|
1181
|
+
interface QuerySpec<A extends unknown[] = unknown[], R = unknown, F extends string = string> {
|
|
1182
|
+
readonly stale: StaleMode;
|
|
1183
|
+
readonly refusals: readonly F[];
|
|
1184
|
+
readonly [queryType]?: (...args: A) => R;
|
|
1185
|
+
}
|
|
1186
|
+
/** @internal */
|
|
1187
|
+
type QueryTable = Record<string, QuerySpec<any[], any, string>>;
|
|
1188
|
+
/** @internal */
|
|
1189
|
+
type QueryFence = {
|
|
1190
|
+
session: string;
|
|
1191
|
+
incarnation: number;
|
|
1192
|
+
epoch: number;
|
|
1193
|
+
afterSeq: number;
|
|
1194
|
+
};
|
|
1195
|
+
/** @internal */
|
|
1196
|
+
type QueryReply = Read<unknown, string>;
|
|
1197
|
+
|
|
1198
|
+
/** @internal Command with a confirmed basis and a sequence assigned at send time. */
|
|
1199
|
+
type CommandEnvelope$1<P> = {
|
|
1200
|
+
session: string;
|
|
1201
|
+
incarnation: number;
|
|
1202
|
+
seq: number;
|
|
1203
|
+
basis: {
|
|
1204
|
+
epoch: number;
|
|
1205
|
+
version: number;
|
|
1206
|
+
};
|
|
1207
|
+
afterSeq?: number;
|
|
1208
|
+
expectVersion?: boolean;
|
|
1209
|
+
kind: string;
|
|
1210
|
+
payload: P;
|
|
1211
|
+
inputTime?: number;
|
|
1212
|
+
lastInputTime?: number;
|
|
1213
|
+
group?: string;
|
|
1214
|
+
replay?: true;
|
|
1215
|
+
};
|
|
1216
|
+
/** @internal Settled worker outcome for one command sequence. */
|
|
1217
|
+
type CommandOutcome = {
|
|
1218
|
+
seq: number;
|
|
1219
|
+
status: 'applied' | 'noop' | 'refused' | 'cancelled' | 'duplicate';
|
|
1220
|
+
reason?: string;
|
|
1221
|
+
committed?: false;
|
|
1222
|
+
affectedSeqs?: number[];
|
|
1223
|
+
};
|
|
1224
|
+
/** @internal Full or incremental frame identified by command coverage and revision. */
|
|
1225
|
+
type FrameEnvelope<F> = {
|
|
1226
|
+
coversThroughSeq: number;
|
|
1227
|
+
revision: number;
|
|
1228
|
+
baseRevision?: number;
|
|
1229
|
+
payload: F;
|
|
1230
|
+
};
|
|
1231
|
+
/** @internal Acknowledgement with authoritative state and an optional covering frame. */
|
|
1232
|
+
type CommandAck$1<S, E, F> = {
|
|
1233
|
+
session: string;
|
|
1234
|
+
incarnation: number;
|
|
1235
|
+
epoch: number;
|
|
1236
|
+
throughSeq: number;
|
|
1237
|
+
version: number;
|
|
1238
|
+
outcomes: CommandOutcome[];
|
|
1239
|
+
selection?: S;
|
|
1240
|
+
editState?: E;
|
|
1241
|
+
frame?: FrameEnvelope<F>;
|
|
1242
|
+
revisions?: {
|
|
1243
|
+
selection: number;
|
|
1244
|
+
layout: number;
|
|
1245
|
+
};
|
|
1246
|
+
};
|
|
1247
|
+
/** @internal Snapshot captured at a settled command boundary. */
|
|
1248
|
+
type Checkpoint = {
|
|
1249
|
+
state: Uint8Array;
|
|
1250
|
+
epoch: number;
|
|
1251
|
+
version: number;
|
|
1252
|
+
throughSeq: number;
|
|
1253
|
+
};
|
|
1254
|
+
/** @internal Local outcome; unsent cancellations have no sequence. */
|
|
1255
|
+
type TicketOutcome = Omit<CommandOutcome, 'seq'> & {
|
|
1256
|
+
seq?: number;
|
|
1257
|
+
};
|
|
1258
|
+
/** @internal Non-rejecting presentation settlement for tickets and coverage waiters. */
|
|
1259
|
+
type PresentationStatus = 'presented' | 'dropped';
|
|
1260
|
+
/** @internal Immediate local identity with a live send-time sequence getter. */
|
|
1261
|
+
type CommandTicket = {
|
|
1262
|
+
readonly id: number;
|
|
1263
|
+
readonly seq: number | undefined;
|
|
1264
|
+
readonly ack: Promise<TicketOutcome>;
|
|
1265
|
+
readonly presented: Promise<PresentationStatus>;
|
|
1266
|
+
};
|
|
1267
|
+
/** @internal Main-side command lane, distinct from resident scheduler lanes. */
|
|
1268
|
+
type CommandLane = 'input' | 'collab' | 'background';
|
|
1269
|
+
/** @internal Submission metadata, causal ticket dependency, and optional local echo. */
|
|
1270
|
+
type SubmitOptions<X> = {
|
|
1271
|
+
lane?: CommandLane;
|
|
1272
|
+
after?: CommandTicket;
|
|
1273
|
+
expectVersion?: boolean;
|
|
1274
|
+
inputTime?: number;
|
|
1275
|
+
lastInputTime?: number;
|
|
1276
|
+
group?: string;
|
|
1277
|
+
coalesceKey?: string;
|
|
1278
|
+
fence?: boolean;
|
|
1279
|
+
echo?: X;
|
|
1280
|
+
};
|
|
1281
|
+
/** @internal Unsent command accepted by the outbox and coalescing hook. */
|
|
1282
|
+
type CommandDraft<P, X> = {
|
|
1283
|
+
kind: string;
|
|
1284
|
+
payload: P;
|
|
1285
|
+
options: SubmitOptions<X>;
|
|
1286
|
+
};
|
|
1287
|
+
/** @internal Format-owned echo associated with a local ticket and optional sent sequence. */
|
|
1288
|
+
type EchoEntry<X> = {
|
|
1289
|
+
ticket: CommandTicket;
|
|
1290
|
+
seq?: number;
|
|
1291
|
+
value: X;
|
|
1292
|
+
};
|
|
1293
|
+
/** @internal Synchronous painters; present installs, retires, and redraws atomically. */
|
|
1294
|
+
type EchoHooks<X, F> = {
|
|
1295
|
+
paint(pending: readonly EchoEntry<X>[]): void;
|
|
1296
|
+
drop(entries: readonly EchoEntry<X>[], reason: string): void;
|
|
1297
|
+
present(frame: FrameEnvelope<F>, retired: readonly EchoEntry<X>[], remaining: readonly EchoEntry<X>[]): void | boolean;
|
|
1298
|
+
};
|
|
1299
|
+
/** @internal Painter timing within one synchronous submit, acknowledgement, or frame event. */
|
|
1300
|
+
type EchoOverrunSample = {
|
|
1301
|
+
hook: keyof EchoHooks<unknown, unknown>;
|
|
1302
|
+
elapsedMs: number;
|
|
1303
|
+
eventTotalMs: number;
|
|
1304
|
+
};
|
|
1305
|
+
/** @internal Latest confirmed worker state and installed frame coverage. */
|
|
1306
|
+
type EditSessionState<S, E> = {
|
|
1307
|
+
epoch: number;
|
|
1308
|
+
version: number;
|
|
1309
|
+
throughSeq: number;
|
|
1310
|
+
presentedThroughSeq: number;
|
|
1311
|
+
selection: S | undefined;
|
|
1312
|
+
editState: E | undefined;
|
|
1313
|
+
};
|
|
1314
|
+
/** @internal Shared asynchronous editor contract for worker and legacy backends. */
|
|
1315
|
+
interface EditSession<P, S, E, X> {
|
|
1316
|
+
readonly backend: 'worker' | 'legacy-sync' | 'legacy-in-thread';
|
|
1317
|
+
readonly state: EditSessionState<S, E>;
|
|
1318
|
+
submit(kind: string, payload: P, options?: SubmitOptions<X>): CommandTicket;
|
|
1319
|
+
attachEcho?(tickets: readonly CommandTicket[], preview: (draft: CommandDraft<P, X>, originalIntentCount: number) => X | undefined): boolean;
|
|
1320
|
+
whenPresented(seq: number): Promise<PresentationStatus>;
|
|
1321
|
+
subscribe(listener: (state: EditSessionState<S, E>) => void): () => void;
|
|
1322
|
+
flush(): Promise<void>;
|
|
1323
|
+
dispose(): Promise<void>;
|
|
1324
|
+
}
|
|
1325
|
+
/** @internal Initial acknowledgement and structural subset of the existing RPC client. */
|
|
1326
|
+
type CommandConnection<P, S, E, F> = {
|
|
1327
|
+
initial: CommandAck$1<S, E, F>;
|
|
1328
|
+
client: {
|
|
1329
|
+
readonly call: {
|
|
1330
|
+
edit(envelope: CommandEnvelope$1<P>): Promise<CommandAck$1<S, E, F>>;
|
|
1331
|
+
checkpoint(): Promise<Checkpoint>;
|
|
1332
|
+
/** @internal Posts queries after all edits previously handed to this connection. */
|
|
1333
|
+
query?(fence: QueryFence, kind: string, args: unknown[]): Promise<QueryReply>;
|
|
1334
|
+
};
|
|
1335
|
+
readonly failure: SessionFailure | undefined;
|
|
1336
|
+
onFailure(listener: (failure: SessionFailure) => void): () => void;
|
|
1337
|
+
/** @internal Subscribes to frames posted by this connection's worker. */
|
|
1338
|
+
onFrame?(listener: (frame: FrameEnvelope<F>) => void): () => void;
|
|
1339
|
+
onAck?(listener: (ack: CommandAck$1<S, E, F>) => void): () => void;
|
|
1340
|
+
dispose(): Promise<void>;
|
|
1341
|
+
};
|
|
1342
|
+
};
|
|
1343
|
+
/** @internal Recovery progress, replay divergence, and format history reset signal. */
|
|
1344
|
+
type RecoveryEvent = {
|
|
1345
|
+
phase: 'recovering' | 'recovered' | 'diverged' | 'failed';
|
|
1346
|
+
incarnation: number;
|
|
1347
|
+
attempt: number;
|
|
1348
|
+
diverged: number[];
|
|
1349
|
+
historyReset: boolean;
|
|
1350
|
+
failure?: SessionFailure;
|
|
1351
|
+
};
|
|
1352
|
+
/** @internal Format reopen and checkpoint hooks used by main-side recovery. */
|
|
1353
|
+
type RecoveryHooks<O, P, S, E, F> = {
|
|
1354
|
+
reopen(input: {
|
|
1355
|
+
source: O;
|
|
1356
|
+
checkpoint?: Checkpoint;
|
|
1357
|
+
session: string;
|
|
1358
|
+
incarnation: number;
|
|
1359
|
+
epoch: number;
|
|
1360
|
+
refusedSeqs: readonly number[];
|
|
1361
|
+
replayAppliedSeqs: readonly number[];
|
|
1362
|
+
}): Promise<CommandConnection<P, S, E, F>>;
|
|
1363
|
+
checkpoint?(connection: CommandConnection<P, S, E, F>): Promise<Checkpoint>;
|
|
1364
|
+
onRecovery?(event: RecoveryEvent): void;
|
|
1365
|
+
};
|
|
1366
|
+
/** @internal Worker-backed session limits, recovery, reconciliation, and injected scheduling. */
|
|
1367
|
+
type WorkerEditSessionOptions<O, P, S, E, F, X, Q extends QueryTable = {}> = {
|
|
1368
|
+
source: O;
|
|
1369
|
+
connection: CommandConnection<P, S, E, F>;
|
|
1370
|
+
queries?: Q;
|
|
1371
|
+
holdTimeoutMs?: number;
|
|
1372
|
+
timer?(callback: () => void, ms: number): () => void;
|
|
1373
|
+
recovery: RecoveryHooks<O, P, S, E, F>;
|
|
1374
|
+
echo?: EchoHooks<X, F>;
|
|
1375
|
+
/** @internal Releases rejected frame resources; accepted frames belong to the painter. */
|
|
1376
|
+
discardFrame?(frame: FrameEnvelope<F>): void;
|
|
1377
|
+
sameCoverageFrames?: boolean;
|
|
1378
|
+
/** @internal Commits presentation only after the echo hook accepts it; off by default. */
|
|
1379
|
+
transactionalPresentation?: boolean;
|
|
1380
|
+
/** @internal Handles echo capacity overflow; defaults to declining new entries. */
|
|
1381
|
+
echoOverflow?: 'decline' | 'evict-oldest';
|
|
1382
|
+
coalesce?(prev: CommandDraft<P, X>, next: CommandDraft<P, X>): CommandDraft<P, X> | undefined;
|
|
1383
|
+
/** @internal Keeps a matching draft queued while the matching command it follows is in flight, so a burst coalesces into one send. */
|
|
1384
|
+
holdForCoalescing?(draft: CommandDraft<P, X>): boolean;
|
|
1385
|
+
requestFullFrame(connection: CommandConnection<P, S, E, F>): Promise<CommandAck$1<S, E, F>>;
|
|
1386
|
+
maxInFlight?: number;
|
|
1387
|
+
inputBurstCap?: number;
|
|
1388
|
+
maxEchoEntries?: number;
|
|
1389
|
+
maxRecoveryAttempts?: number;
|
|
1390
|
+
checkpointPolicy?(stats: {
|
|
1391
|
+
applied: number;
|
|
1392
|
+
bytes: number;
|
|
1393
|
+
}): boolean;
|
|
1394
|
+
commandBytes?(envelope: CommandEnvelope$1<P>): number;
|
|
1395
|
+
/** @internal May share caller data only with a transport that copies before returning. */
|
|
1396
|
+
copyCommandForDispatch?(envelope: CommandEnvelope$1<P>): CommandEnvelope$1<P>;
|
|
1397
|
+
now?(): number;
|
|
1398
|
+
enqueue?(callback: () => void): void;
|
|
1399
|
+
onEchoOverrun?(sample: EchoOverrunSample): void;
|
|
1400
|
+
onAck?(ack: CommandAck$1<S, E, F>): void;
|
|
1401
|
+
};
|
|
1402
|
+
|
|
1403
|
+
declare const WORKBOOK_REPLAY_MUTATORS: {
|
|
1404
|
+
editCell: true;
|
|
1405
|
+
editCells: true;
|
|
1406
|
+
applyEdits: true;
|
|
1407
|
+
applyOps: true;
|
|
1408
|
+
propose: true;
|
|
1409
|
+
acceptProposal: true;
|
|
1410
|
+
rejectProposal: true;
|
|
1411
|
+
patchRangeStyle: true;
|
|
1412
|
+
setNumberFormat: true;
|
|
1413
|
+
applyFormat: true;
|
|
1414
|
+
moveChart: true;
|
|
1415
|
+
moveRange: true;
|
|
1416
|
+
undo: true;
|
|
1417
|
+
redo: true;
|
|
1418
|
+
setActiveSheet: true;
|
|
1419
|
+
};
|
|
1420
|
+
type WorkbookReplayMethod = keyof typeof WORKBOOK_REPLAY_MUTATORS;
|
|
1421
|
+
type WorkbookReplayOp = {
|
|
1422
|
+
[K in WorkbookReplayMethod]: {
|
|
1423
|
+
method: K;
|
|
1424
|
+
args: Parameters<WorkbookHandle[K]>;
|
|
1425
|
+
};
|
|
1426
|
+
}[WorkbookReplayMethod] & {
|
|
1427
|
+
calculation?: WorkbookCalculationContext;
|
|
1428
|
+
};
|
|
1429
|
+
interface WorkbookReplayEnvelope {
|
|
1430
|
+
sequence: number;
|
|
1431
|
+
calculation: WorkbookCalculationContext;
|
|
1432
|
+
op: WorkbookReplayOp;
|
|
1433
|
+
staleProposal?: {
|
|
1434
|
+
cells: string[];
|
|
1435
|
+
targets: StaleProposalTarget[];
|
|
1436
|
+
};
|
|
1437
|
+
}
|
|
1438
|
+
interface WorkbookReplayReply {
|
|
1439
|
+
sequence: number;
|
|
1440
|
+
revision: number;
|
|
1441
|
+
version: number;
|
|
1442
|
+
result: ReturnType<WorkbookHandle[WorkbookReplayMethod]>;
|
|
1443
|
+
}
|
|
1444
|
+
declare const workbookSessionInternals: WeakMap<WorkbookSession, {
|
|
1445
|
+
replay(envelope: WorkbookReplayEnvelope): Promise<WorkbookReplayReply>;
|
|
1446
|
+
initialVersion?: string;
|
|
1447
|
+
attachPeer?(version: string): Promise<void>;
|
|
1448
|
+
detachPeer?(): Promise<void>;
|
|
1449
|
+
editPeerAttached: boolean;
|
|
1450
|
+
cellInput?(sheet: number, row: number, col: number): Promise<string>;
|
|
1451
|
+
initialCalculation?: WorkbookCalculationContext | null;
|
|
1452
|
+
preview?(viewport: Viewport, sheet: number, ops: readonly WorkbookReplayOp[]): Promise<WorkbookFrame>;
|
|
1453
|
+
}>;
|
|
1454
|
+
|
|
1455
|
+
interface CommandIdentity {
|
|
1456
|
+
session: string;
|
|
1457
|
+
incarnation: string;
|
|
1458
|
+
}
|
|
1459
|
+
interface CommandBasis {
|
|
1460
|
+
epoch: number;
|
|
1461
|
+
version: string;
|
|
1462
|
+
}
|
|
1463
|
+
interface CommandEnvelope<K extends string, P> extends CommandIdentity {
|
|
1464
|
+
seq: number;
|
|
1465
|
+
basis: CommandBasis;
|
|
1466
|
+
afterSeq?: number;
|
|
1467
|
+
kind: K;
|
|
1468
|
+
payload: P;
|
|
1469
|
+
}
|
|
1470
|
+
interface CommandStatus<R = unknown> {
|
|
1471
|
+
seq: number;
|
|
1472
|
+
status: 'applied' | 'noop' | 'refused' | 'cancelled';
|
|
1473
|
+
reason?: string;
|
|
1474
|
+
committed?: boolean;
|
|
1475
|
+
affectedSeqs?: number[];
|
|
1476
|
+
result?: R;
|
|
1477
|
+
}
|
|
1478
|
+
interface CommandAck<S, E, F> {
|
|
1479
|
+
throughSeq: number;
|
|
1480
|
+
version: string;
|
|
1481
|
+
selection?: S;
|
|
1482
|
+
editState?: Partial<E>;
|
|
1483
|
+
statuses: CommandStatus[];
|
|
1484
|
+
frame?: F;
|
|
1485
|
+
}
|
|
1486
|
+
interface WorkbookCommandSelection extends XlsxRangeTarget {
|
|
1487
|
+
activeCell?: CellPoint;
|
|
1488
|
+
}
|
|
1489
|
+
interface WorkbookCommandContext extends CommandIdentity {
|
|
1490
|
+
basis: CommandBasis;
|
|
1491
|
+
}
|
|
1492
|
+
interface WorkbookIntent {
|
|
1493
|
+
inputTime?: number;
|
|
1494
|
+
undoGroupId?: string;
|
|
1495
|
+
selection?: WorkbookCommandSelection;
|
|
1496
|
+
}
|
|
1497
|
+
type CommandArgs<K extends WorkbookReplayMethod> = K extends 'propose' ? [string, string | null, (Parameters<WorkbookHandle['propose']>[2][number] & {
|
|
1498
|
+
target?: XlsxRangeTarget;
|
|
1499
|
+
})[]] : Extract<WorkbookReplayOp, {
|
|
1500
|
+
method: K;
|
|
1501
|
+
}>['args'];
|
|
1502
|
+
type ReplayPayload<K extends WorkbookReplayMethod> = Extract<WorkbookReplayOp, {
|
|
1503
|
+
method: K;
|
|
1504
|
+
}> extends infer O ? O extends WorkbookReplayOp ? Pick<O, 'calculation'> & {
|
|
1505
|
+
args: CommandArgs<K>;
|
|
1506
|
+
} & WorkbookIntent & {
|
|
1507
|
+
target?: XlsxRangeTarget;
|
|
1508
|
+
} & (K extends 'setActiveSheet' ? {
|
|
1509
|
+
expectVersion?: string;
|
|
1510
|
+
} : {}) : never : never;
|
|
1511
|
+
type WorkbookCommandKind = WorkbookReplayMethod | 'select' | 'setReadOnly' | 'applyUpdate' | 'collabPipe';
|
|
1512
|
+
type WorkbookToolbarPayload = {
|
|
1513
|
+
id: 'bold' | 'italic' | 'strikethrough' | 'paintFormat' | 'clear' | 'fontFamily' | 'fontSize' | 'fontSizeStep' | 'decimalPlaces' | 'textColor' | 'fillColor' | 'borderColor' | 'numberFormat' | 'borderPreset' | 'borderStyle' | 'merge' | 'horizontalAlignment' | 'verticalAlignment' | 'textWrapping';
|
|
1514
|
+
args: unknown;
|
|
1515
|
+
target: XlsxRangeTarget;
|
|
1516
|
+
} | {
|
|
1517
|
+
id: 'refreshProposals';
|
|
1518
|
+
args: unknown;
|
|
1519
|
+
target?: never;
|
|
1520
|
+
};
|
|
1521
|
+
type WorkbookCommandPayload<K extends WorkbookCommandKind> = K extends WorkbookReplayMethod ? ReplayPayload<K> | (K extends 'applyOps' ? WorkbookIntent & {
|
|
1522
|
+
toolbar: WorkbookToolbarPayload;
|
|
1523
|
+
} : never) | (K extends 'applyFormat' ? WorkbookIntent & {
|
|
1524
|
+
target: XlsxRangeTarget;
|
|
1525
|
+
formatToken: string;
|
|
1526
|
+
} | WorkbookIntent & {
|
|
1527
|
+
target: XlsxRangeTarget;
|
|
1528
|
+
capturedFrom: XlsxRangeTarget;
|
|
1529
|
+
} : never) : K extends 'collabPipe' ? PipeCommandPayload<AwarenessCursor> : K extends 'select' ? {
|
|
1530
|
+
selection: WorkbookCommandSelection;
|
|
1531
|
+
} : K extends 'applyUpdate' ? {
|
|
1532
|
+
update: Uint8Array;
|
|
1533
|
+
updates?: Uint8Array[];
|
|
1534
|
+
} : {
|
|
1535
|
+
readOnly: boolean;
|
|
1536
|
+
};
|
|
1537
|
+
interface WorkbookCommandFrameRequest {
|
|
1538
|
+
sheet: number;
|
|
1539
|
+
viewport: Viewport;
|
|
1540
|
+
zoom: number;
|
|
1541
|
+
dpr: number;
|
|
1542
|
+
generation: number;
|
|
1543
|
+
requestGeneration?: number;
|
|
1544
|
+
}
|
|
1545
|
+
type WorkbookCommand = {
|
|
1546
|
+
[K in WorkbookCommandKind]: CommandEnvelope<K, WorkbookCommandPayload<K>> & {
|
|
1547
|
+
frame?: WorkbookCommandFrameRequest;
|
|
1548
|
+
};
|
|
1549
|
+
}[WorkbookCommandKind];
|
|
1550
|
+
interface WorkbookEditState {
|
|
1551
|
+
historyReset?: boolean;
|
|
1552
|
+
canUndo: boolean;
|
|
1553
|
+
canRedo: boolean;
|
|
1554
|
+
formatting: SelectionFormatting;
|
|
1555
|
+
formattingAvailable: boolean;
|
|
1556
|
+
selectionEditable: boolean;
|
|
1557
|
+
mergedRanges: MergedRange[];
|
|
1558
|
+
calculation: CalculationStatus;
|
|
1559
|
+
sheets: WorkbookSheetSummary[];
|
|
1560
|
+
activeSheet: number;
|
|
1561
|
+
readOnly: boolean;
|
|
1562
|
+
}
|
|
1563
|
+
interface CommandFrameTags extends CommandIdentity {
|
|
1564
|
+
coversThroughSeq: number;
|
|
1565
|
+
requestGeneration: number;
|
|
1566
|
+
zoom: number;
|
|
1567
|
+
dpr: number;
|
|
1568
|
+
}
|
|
1569
|
+
type WorkbookCommandFrame = WorkbookFrame & CommandFrameTags;
|
|
1570
|
+
type WorkbookCommandWireFrame = WorkbookWireFrame & CommandFrameTags;
|
|
1571
|
+
type WorkbookAck = CommandAck<WorkbookCommandSelection, WorkbookEditState, WorkbookCommandFrame>;
|
|
1572
|
+
type WorkbookWireAck = CommandAck<WorkbookCommandSelection, WorkbookEditState, WorkbookCommandWireFrame> & {
|
|
1573
|
+
shared?: WorkbookSharedWireAck;
|
|
1574
|
+
};
|
|
1575
|
+
interface WorkbookEditPayload {
|
|
1576
|
+
payload: WorkbookCommand['payload'];
|
|
1577
|
+
frame?: WorkbookCommandFrameRequest;
|
|
1578
|
+
compatibility?: WorkbookCommand;
|
|
1579
|
+
dispatchOrder?: number;
|
|
1580
|
+
}
|
|
1581
|
+
type WorkbookSharedCommand = CommandEnvelope$1<WorkbookEditPayload>;
|
|
1582
|
+
type WorkbookSharedOutcome = CommandOutcome & {
|
|
1583
|
+
workbook?: CommandStatus;
|
|
1584
|
+
};
|
|
1585
|
+
type WorkbookSharedAck<F = WorkbookCommandFrame> = Omit<CommandAck$1<WorkbookCommandSelection, Partial<WorkbookEditState>, F>, 'outcomes'> & {
|
|
1586
|
+
engineVersion: string;
|
|
1587
|
+
outcomes: WorkbookSharedOutcome[];
|
|
1588
|
+
compatibility?: CommandAck<WorkbookCommandSelection, WorkbookEditState, F>;
|
|
1589
|
+
};
|
|
1590
|
+
type WorkbookSharedWireAck = WorkbookSharedAck<WorkbookCommandWireFrame>;
|
|
1591
|
+
type WorkbookEditConnection = Omit<CommandConnection<WorkbookEditPayload, WorkbookCommandSelection, Partial<WorkbookEditState>, WorkbookCommandFrame>, 'initial' | 'client'> & {
|
|
1592
|
+
initial: WorkbookSharedAck;
|
|
1593
|
+
client: Omit<CommandConnection<WorkbookEditPayload, WorkbookCommandSelection, Partial<WorkbookEditState>, WorkbookCommandFrame>['client'], 'call'> & {
|
|
1594
|
+
call: {
|
|
1595
|
+
edit(command: WorkbookSharedCommand): Promise<WorkbookSharedAck>;
|
|
1596
|
+
checkpoint(): Promise<Checkpoint>;
|
|
1597
|
+
};
|
|
1598
|
+
};
|
|
1599
|
+
};
|
|
1600
|
+
type WorkbookEditFrame = FrameEnvelope<WorkbookCommandFrame>;
|
|
1601
|
+
type WorkbookTicketOutcome = TicketOutcome & {
|
|
1602
|
+
workbook?: CommandStatus;
|
|
1603
|
+
};
|
|
1604
|
+
type WorkbookCommandTicket = Omit<CommandTicket, 'ack'> & {
|
|
1605
|
+
readonly ack: Promise<WorkbookTicketOutcome>;
|
|
1606
|
+
};
|
|
1607
|
+
type WorkbookSubmitOptions<X = unknown> = SubmitOptions<X>;
|
|
1608
|
+
type WorkbookEchoHooks<X = unknown> = EchoHooks<X, WorkbookCommandFrame>;
|
|
1609
|
+
|
|
1610
|
+
/** @experimental */
|
|
1611
|
+
declare class WorkbookPngUnavailableError extends Error {
|
|
1612
|
+
readonly code = "png-unavailable";
|
|
1613
|
+
constructor();
|
|
1614
|
+
}
|
|
1615
|
+
type WorkbookCheckpoint = Checkpoint & {
|
|
1616
|
+
encodeMs?: number;
|
|
1617
|
+
};
|
|
1618
|
+
/** @experimental Unzoomed sheet pixels. */
|
|
1619
|
+
type WorkbookSheetView = Pick<SheetInfo, 'contentWidth' | 'contentHeight' | 'frozenRows' | 'frozenCols' | 'initialScrollX' | 'initialScrollY'> & {
|
|
1620
|
+
sheet: number;
|
|
1621
|
+
version: string;
|
|
1622
|
+
frozenWidth: number;
|
|
1623
|
+
frozenHeight: number;
|
|
1624
|
+
};
|
|
1625
|
+
/** @experimental Absolute sheet rect and freeze-relative scroll position, in unzoomed pixels. */
|
|
1626
|
+
interface WorkbookCellGeometry {
|
|
1627
|
+
sheet: number;
|
|
1628
|
+
version: string;
|
|
1629
|
+
rect: Rect;
|
|
1630
|
+
scrollPosition: CellPosition;
|
|
1631
|
+
}
|
|
1632
|
+
/** @experimental Row-major editable cell text. */
|
|
1633
|
+
interface WorkbookCellInputs {
|
|
1634
|
+
sheet: number;
|
|
1635
|
+
version: string;
|
|
1636
|
+
cells: CellEdit[][];
|
|
1637
|
+
}
|
|
1638
|
+
/** @experimental */
|
|
1639
|
+
interface WorkbookFrameOptions {
|
|
1640
|
+
sheet?: number;
|
|
1641
|
+
}
|
|
1642
|
+
/** @experimental */
|
|
1643
|
+
interface WorkbookFrame {
|
|
1644
|
+
displayList: DisplayList;
|
|
1645
|
+
version: string;
|
|
1646
|
+
epoch: number;
|
|
1647
|
+
sequence: number;
|
|
1648
|
+
sheet: number;
|
|
1649
|
+
viewport: Viewport;
|
|
1650
|
+
mergedRanges?: MergedRange[];
|
|
1651
|
+
}
|
|
1652
|
+
/** @experimental */
|
|
1653
|
+
type WorkbookWireFrame = Omit<WorkbookFrame, 'displayList'> & {
|
|
1654
|
+
displayList: ArrayBuffer;
|
|
1655
|
+
};
|
|
1656
|
+
/**
|
|
1657
|
+
* Structured-cloneable workbook open options.
|
|
1658
|
+
* @experimental
|
|
1659
|
+
*/
|
|
1660
|
+
interface WorkbookSessionOpenOptions extends OpenWorkbookOptions {
|
|
1661
|
+
wasm?: ArrayBuffer | WebAssembly.Module;
|
|
1662
|
+
initialViewport?: WorkbookInitialPaintRequest;
|
|
1663
|
+
includeEditState?: boolean;
|
|
1664
|
+
initialUpdate?: Uint8Array;
|
|
1665
|
+
/** @internal */
|
|
1666
|
+
recoveryVersion?: string;
|
|
1667
|
+
}
|
|
1668
|
+
/** @experimental */
|
|
1669
|
+
interface WorkbookInitialPaintRequest {
|
|
1670
|
+
sheet?: number;
|
|
1671
|
+
width: number;
|
|
1672
|
+
height: number;
|
|
1673
|
+
zoom: number;
|
|
1674
|
+
dpr: number;
|
|
1675
|
+
requestGeneration: number;
|
|
1676
|
+
}
|
|
1677
|
+
/** @experimental */
|
|
1678
|
+
interface WorkbookInitialPaint<F = WorkbookCommandFrame> {
|
|
1679
|
+
sheetView: WorkbookSheetView;
|
|
1680
|
+
frame: F;
|
|
1681
|
+
editState: WorkbookEditState;
|
|
1682
|
+
}
|
|
1683
|
+
/** @experimental */
|
|
1684
|
+
type WorkbookSessionOpenReply = WorkbookSessionState & {
|
|
1685
|
+
pngExport?: boolean;
|
|
1686
|
+
clientId?: number;
|
|
1687
|
+
throughSeq?: number;
|
|
1688
|
+
revision?: number;
|
|
1689
|
+
historyReset?: boolean;
|
|
1690
|
+
initialPaint?: WorkbookInitialPaint<WorkbookCommandWireFrame>;
|
|
1691
|
+
editState?: WorkbookEditState;
|
|
1692
|
+
selection?: WorkbookCommandSelection;
|
|
1693
|
+
};
|
|
1694
|
+
/**
|
|
1695
|
+
* Sheet metadata; indices are zero-based.
|
|
1696
|
+
* @experimental
|
|
1697
|
+
*/
|
|
1698
|
+
interface WorkbookSheetSummary {
|
|
1699
|
+
id: string;
|
|
1700
|
+
index: number;
|
|
1701
|
+
name: string;
|
|
1702
|
+
}
|
|
1703
|
+
/**
|
|
1704
|
+
* Workbook projection; version counts applied batches.
|
|
1705
|
+
* @experimental
|
|
1706
|
+
*/
|
|
1707
|
+
type WorkbookSessionState = Omit<SessionState, 'stage'> & {
|
|
1708
|
+
format: 'xlsx';
|
|
1709
|
+
stage: 'preview' | 'ready' | 'failed';
|
|
1710
|
+
sheets: WorkbookSheetSummary[];
|
|
1711
|
+
activeSheet: number;
|
|
1712
|
+
commandContext?: WorkbookCommandContext;
|
|
1713
|
+
};
|
|
1714
|
+
/**
|
|
1715
|
+
* Workbook change notifications after applied batches.
|
|
1716
|
+
* @experimental
|
|
1717
|
+
*/
|
|
1718
|
+
interface WorkbookSessionEvents {
|
|
1719
|
+
changed: {
|
|
1720
|
+
version: number;
|
|
1721
|
+
dirty: boolean;
|
|
1722
|
+
};
|
|
1723
|
+
collaborationUpdate: {
|
|
1724
|
+
update: Uint8Array;
|
|
1725
|
+
origin: CollaborationUpdateOrigin;
|
|
1726
|
+
};
|
|
1727
|
+
}
|
|
1728
|
+
/**
|
|
1729
|
+
* Workbook RPC methods; engine version tokens remain strings.
|
|
1730
|
+
* @experimental
|
|
1731
|
+
*/
|
|
1732
|
+
type WorkbookSessionMethods = {
|
|
1733
|
+
open(bytes: ArrayBuffer, options?: WorkbookSessionOpenOptions): WorkbookSessionOpenReply;
|
|
1734
|
+
openRecovery(checkpoint: Checkpoint, options?: Pick<WorkbookSessionOpenOptions, 'wasm'>): WorkbookSessionOpenReply;
|
|
1735
|
+
version(): string;
|
|
1736
|
+
collaborationStateVector(): Uint8Array;
|
|
1737
|
+
collaborationStateAsUpdate(remoteStateVector?: Uint8Array): Uint8Array;
|
|
1738
|
+
listDefinedNames(request?: XlsxDefinedNamesRequest): XlsxDefinedNamesResult;
|
|
1739
|
+
readCells(request: XlsxReadRequest): XlsxReadResult;
|
|
1740
|
+
findText(request: XlsxFindRequest): XlsxFindResult;
|
|
1741
|
+
validateEdits(request: XlsxEditRequest): XlsxValidationResult;
|
|
1742
|
+
applyEdits(request: XlsxEditRequest): XlsxEditResult;
|
|
1743
|
+
command(command: WorkbookCommand): WorkbookWireAck;
|
|
1744
|
+
edit(command: WorkbookSharedCommand): WorkbookSharedWireAck;
|
|
1745
|
+
checkpoint(preserveHistory?: boolean): WorkbookCheckpoint;
|
|
1746
|
+
commandFrame(request?: WorkbookCommandFrameRequest): FrameEnvelope<WorkbookCommandWireFrame> | undefined;
|
|
1747
|
+
frame(viewport: Viewport, options?: WorkbookFrameOptions): WorkbookWireFrame;
|
|
1748
|
+
sheetView(sheet: number): WorkbookSheetView;
|
|
1749
|
+
cellGeometry(sheet: number, row: number, col: number): WorkbookCellGeometry;
|
|
1750
|
+
cellInputs(sheet: number, range: string): WorkbookCellInputs;
|
|
1751
|
+
selectionData(sheet: number, row: number, col: number, direction?: Direction | 'usedRange' | 'rowEnd' | 'merge'): SelectionData;
|
|
1752
|
+
captureFormat(sheet: number, range: string): CapturedFormat;
|
|
1753
|
+
sheets(): WorkbookSheetSummary[];
|
|
1754
|
+
calculationStatus(): CalculationStatus;
|
|
1755
|
+
renderPng(viewport: Viewport, options?: WorkbookFrameOptions): ArrayBuffer;
|
|
1756
|
+
renderRangePng(options?: {
|
|
1757
|
+
range?: string;
|
|
1758
|
+
scale?: number;
|
|
1759
|
+
}, frameOptions?: WorkbookFrameOptions): ArrayBuffer;
|
|
1760
|
+
exportStructured(options?: XlsxExportOptions): XlsxExportResult<XlsxStructuredContent>;
|
|
1761
|
+
exportMarkdown(options?: XlsxExportOptions, markdownOptions?: XlsxMarkdownOptions): XlsxExportResult<XlsxMarkdownContent>;
|
|
1762
|
+
printDisplayList(sheet: number, range: string, metrics: PrintMetrics, gridlines: boolean): ArrayBuffer;
|
|
1763
|
+
save(): ArrayBuffer;
|
|
1764
|
+
dispose(): void;
|
|
1765
|
+
};
|
|
1766
|
+
|
|
1767
|
+
type SessionOptions<X> = WorkerEditSessionOptions<unknown, WorkbookEditPayload, WorkbookCommandSelection, Partial<WorkbookEditState>, WorkbookCommandFrame, X>;
|
|
1768
|
+
interface WorkbookEditSession<X = unknown> extends EditSession<WorkbookEditPayload, WorkbookCommandSelection, Partial<WorkbookEditState>, X> {
|
|
1769
|
+
readonly engineVersion: string;
|
|
1770
|
+
readonly failure: SessionFailure | undefined;
|
|
1771
|
+
readonly presentationRevision: number | undefined;
|
|
1772
|
+
submit(kind: string, payload: WorkbookEditPayload, options?: WorkbookSubmitOptions<X>): WorkbookCommandTicket;
|
|
1773
|
+
command(input: WorkbookCommand): Promise<WorkbookAck>;
|
|
1774
|
+
runAfterEdits<T>(call: () => Promise<T>): Promise<T>;
|
|
1775
|
+
onAck(listener: (ack: WorkbookAck) => void): () => void;
|
|
1776
|
+
onFailure(listener: (failure: SessionFailure) => void): () => void;
|
|
1777
|
+
bindPresenter(echo: EchoHooks<X, WorkbookCommandFrame>): () => void;
|
|
1778
|
+
present(frame: FrameEnvelope<WorkbookCommandFrame>): void;
|
|
1779
|
+
markPresented(frame: Pick<WorkbookCommandFrame, 'session' | 'incarnation' | 'coversThroughSeq'> & Partial<WorkbookCommandFrame>): boolean;
|
|
1780
|
+
}
|
|
1781
|
+
declare function createWorkbookEditSession<X = unknown>(options: Omit<SessionOptions<X>, 'connection' | 'source' | 'recovery' | 'maxRecoveryAttempts' | 'transactionalPresentation' | 'echoOverflow' | 'sameCoverageFrames'> & {
|
|
1782
|
+
connection: WorkbookEditConnection;
|
|
1783
|
+
identity?: CommandIdentity;
|
|
1784
|
+
source?: unknown;
|
|
1785
|
+
recovery?: RecoveryHooks<unknown, WorkbookEditPayload, WorkbookCommandSelection, Partial<WorkbookEditState>, WorkbookCommandFrame>;
|
|
1786
|
+
onAdmit?(command: WorkbookSharedCommand): void;
|
|
1787
|
+
normalizePayload?(payload: WorkbookCommand['payload']): WorkbookCommand['payload'];
|
|
1788
|
+
}): WorkbookEditSession<X>;
|
|
1789
|
+
|
|
1790
|
+
/**
|
|
1791
|
+
* Options for opening a workbook in a dedicated worker.
|
|
1792
|
+
* @experimental
|
|
1793
|
+
*/
|
|
1794
|
+
interface OpenWorkbookSessionOptions extends OpenWorkbookOptions {
|
|
1795
|
+
worker?: () => Worker;
|
|
1796
|
+
wasm?: ArrayBuffer | WebAssembly.Module;
|
|
1797
|
+
/** Retain source bytes and a compiled module for edit peer hydration. */
|
|
1798
|
+
retainPeerHydration?: boolean;
|
|
1799
|
+
/** Aborting closes the session worker while the open is still in flight. */
|
|
1800
|
+
signal?: AbortSignal;
|
|
1801
|
+
initialViewport?: WorkbookSessionOpenOptions['initialViewport'];
|
|
1802
|
+
includeEditState?: boolean;
|
|
1803
|
+
initialUpdate?: Uint8Array;
|
|
1804
|
+
}
|
|
1805
|
+
/**
|
|
1806
|
+
* Async workbook access and its current local projection.
|
|
1807
|
+
* @experimental
|
|
1808
|
+
*/
|
|
1809
|
+
interface WorkbookSession {
|
|
1810
|
+
readonly pngExport?: boolean;
|
|
1811
|
+
readonly replica?: AsyncReplicaAdapter;
|
|
1812
|
+
bindCollaboration?(apply: (update: Uint8Array) => Promise<unknown>, applyChunks?: (updates: Uint8Array[]) => Promise<unknown>, applyPipe?: (payload: PipeCommandPayload<AwarenessCursor>) => Promise<unknown>): () => void;
|
|
1813
|
+
readonly state: WorkbookSessionState;
|
|
1814
|
+
readonly initialPaint?: WorkbookInitialPaint;
|
|
1815
|
+
readonly commandIdentity: CommandIdentity;
|
|
1816
|
+
readonly confirmedBasis: CommandBasis;
|
|
1817
|
+
readonly throughSeq: number;
|
|
1818
|
+
readonly presentedThroughSeq: number;
|
|
1819
|
+
readonly editState: Readonly<Partial<WorkbookEditState>>;
|
|
1820
|
+
readonly selection: WorkbookCommandSelection | undefined;
|
|
1821
|
+
readonly editSession?: WorkbookEditSession;
|
|
1822
|
+
submit(command: WorkbookCommand): Promise<CommandStatus>;
|
|
1823
|
+
onAck(listener: (ack: WorkbookAck) => void): () => void;
|
|
1824
|
+
markPresented(frame: WorkbookCommandFrame | Pick<WorkbookCommandFrame, 'session' | 'incarnation' | 'coversThroughSeq'>): boolean;
|
|
1825
|
+
whenPresented(seq: number): Promise<void>;
|
|
1826
|
+
readonly call: Promisified<Omit<WorkbookSessionMethods, 'open' | 'openRecovery' | 'dispose' | 'frame' | 'command' | 'edit' | 'checkpoint' | 'commandFrame' | 'renderPng' | 'renderRangePng' | 'printDisplayList'>> & {
|
|
1827
|
+
renderPng(viewport: Viewport, options?: WorkbookFrameOptions): Promise<Uint8Array>;
|
|
1828
|
+
renderRangePng(options?: {
|
|
1829
|
+
range?: string;
|
|
1830
|
+
scale?: number;
|
|
1831
|
+
}, frameOptions?: WorkbookFrameOptions): Promise<Uint8Array>;
|
|
1832
|
+
printDisplayList(...args: Parameters<WorkbookHandle['printDisplayList']>): Promise<ReturnType<WorkbookHandle['printDisplayList']>>;
|
|
1833
|
+
command(command: WorkbookCommand): Promise<WorkbookAck>;
|
|
1834
|
+
/**
|
|
1835
|
+
* @experimental A newer `frame` call replaces a queued one, which rejects with an error
|
|
1836
|
+
* named `SessionSuperseded`.
|
|
1837
|
+
*/
|
|
1838
|
+
frame(viewport: Viewport, options?: WorkbookFrameOptions): Promise<WorkbookFrame>;
|
|
1839
|
+
};
|
|
1840
|
+
save(): Promise<Uint8Array>;
|
|
1841
|
+
on<K extends keyof WorkbookSessionEvents>(name: K, listener: (payload: WorkbookSessionEvents[K]) => void): () => void;
|
|
1842
|
+
onFailure(listener: (failure: SessionFailure) => void): () => void;
|
|
1843
|
+
readonly failure: SessionFailure | undefined;
|
|
1844
|
+
dispose(): Promise<void>;
|
|
1845
|
+
}
|
|
1846
|
+
/** @internal */
|
|
1847
|
+
declare function hydratePeer(session: WorkbookSession): Promise<WorkbookHandle>;
|
|
1848
|
+
/**
|
|
1849
|
+
* Opens a worker session, transferring copies so caller buffers stay usable.
|
|
1850
|
+
* @experimental
|
|
1851
|
+
*/
|
|
1852
|
+
declare function openWorkbookSession(bytes: Uint8Array | ArrayBuffer, options?: OpenWorkbookSessionOptions): Promise<WorkbookSession>;
|
|
1853
|
+
|
|
1854
|
+
/** @experimental */
|
|
1855
|
+
declare class WorkbookRecoveryReplayError extends Error {
|
|
1856
|
+
readonly seq: number;
|
|
1857
|
+
readonly reason: string;
|
|
1858
|
+
readonly code = "workbook-recovery-refused";
|
|
1859
|
+
constructor(seq: number, reason: string);
|
|
1860
|
+
}
|
|
1861
|
+
/** @experimental */
|
|
1862
|
+
interface WorkbookSessionRecovery {
|
|
1863
|
+
readonly throughSeq: number;
|
|
1864
|
+
readonly retainedCommands: number;
|
|
1865
|
+
readonly checkpointIdleMs: number;
|
|
1866
|
+
capture(allowed: () => boolean): Promise<boolean>;
|
|
1867
|
+
save(assertCurrent: () => void, pending?: readonly Pick<WorkbookCommand, 'kind' | 'payload'>[]): Promise<Uint8Array>;
|
|
1868
|
+
}
|
|
1869
|
+
/** @experimental */
|
|
1870
|
+
declare const workbookSessionRecovery: WeakMap<WorkbookSession, WorkbookSessionRecovery>;
|
|
1871
|
+
|
|
1872
|
+
type WorkbookPeerHydrationErrorCode = 'mutation-outside-replay' | 'version-mismatch' | 'missing-hydration' | 'missing-module';
|
|
1873
|
+
declare class WorkbookPeerHydrationError extends Error {
|
|
1874
|
+
readonly code: WorkbookPeerHydrationErrorCode;
|
|
1875
|
+
readonly refusal: {
|
|
1876
|
+
code: WorkbookPeerHydrationErrorCode;
|
|
1877
|
+
};
|
|
1878
|
+
constructor(code: WorkbookPeerHydrationErrorCode, message: string);
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1881
|
+
interface WorkbookEditPeerOptions {
|
|
1882
|
+
session: WorkbookSession;
|
|
1883
|
+
peer: WorkbookHandle;
|
|
1884
|
+
now?(): number;
|
|
1885
|
+
randomSeed?(): number;
|
|
1886
|
+
onError?(error: Error): void;
|
|
1887
|
+
}
|
|
1888
|
+
type WorkbookEditPeer = Pick<WorkbookHandle, WorkbookReplayMethod> & {
|
|
1889
|
+
readonly state: 'ready' | 'failed';
|
|
1890
|
+
readonly error: Error | undefined;
|
|
1891
|
+
readonly acknowledgedSequence: number;
|
|
1892
|
+
readonly sentSequence: number;
|
|
1893
|
+
flush(): Promise<void>;
|
|
1894
|
+
save(): Promise<ArrayBuffer>;
|
|
1895
|
+
recoverySave(): {
|
|
1896
|
+
bytes: ArrayBuffer;
|
|
1897
|
+
recovery: true;
|
|
1898
|
+
};
|
|
1899
|
+
dispose(): void;
|
|
1900
|
+
};
|
|
1901
|
+
declare class WorkbookEditPeerFailedError extends Error {
|
|
1902
|
+
readonly failure: Error;
|
|
1903
|
+
constructor(failure: Error);
|
|
1904
|
+
}
|
|
1905
|
+
/** @internal */
|
|
1906
|
+
declare function createWorkbookEditPeer(options: WorkbookEditPeerOptions): WorkbookEditPeer;
|
|
1907
|
+
|
|
1908
|
+
export { type TextWrapping as $, type ExportSeverity as A, type BorderPatch as B, type CalculationStatus as C, type DifferentialFormatInput as D, type EditProfile as E, type HorizontalAlignment as F, type MergedRange as G, type HistoryState as H, type NumberFormatMutation as I, type OpenWorkbookSessionOptions as J, type OperationFailure as K, type OperationRefusal as L, type MarkdownAnchor as M, type NumberFormat as N, type OpenWorkbookOptions as O, type PrintMetrics as P, type ProfiledDisplayList as Q, type ProfiledEditResult as R, type Proposal as S, type ProposalCell as T, type ProposalEdit as U, type RangeStylePatch as V, type SelectionFormatting as W, type SheetInfo as X, StaleProposalError as Y, type StaleProposalTarget as Z, type StyleProperty as _, type BorderPreset as a, type XlsxExportOptions as a$, type ValidationSuccess as a0, type VerticalAlignment as a1, type Viewport as a2, type WasmInitInput as a3, type WorkbookCalculationContext as a4, type WorkbookCellGeometry as a5, type WorkbookCellInputs as a6, WorkbookEditPeerFailedError as a7, type WorkbookEditSession as a8, type WorkbookFrame as a9, type XlsxCellValue as aA, type XlsxDefinedName as aB, type XlsxDefinedNameOp as aC, type XlsxDefinedNamesRequest as aD, type XlsxDefinedNamesResult as aE, type XlsxEditCalculation as aF, type XlsxEditFailure as aG, type XlsxEditFailureCode as aH, type XlsxEditHistory as aI, type XlsxEditOperation as aJ, type XlsxEditPreview as aK, type XlsxEditReceipt as aL, type XlsxEditRefusal as aM, type XlsxEditRequest as aN, type XlsxEditResult as aO, type XlsxEditSource as aP, type XlsxEditStep as aQ, type XlsxErrorValue as aR, type XlsxExportCell as aS, type XlsxExportDefinedName as aT, type XlsxExportDiagnostic as aU, type XlsxExportDiagnosticCode as aV, type XlsxExportFailure as aW, type XlsxExportFailureCode as aX, type XlsxExportHyperlink as aY, type XlsxExportMerge as aZ, type XlsxExportObject as a_, type WorkbookFrameOptions as aa, type WorkbookHandle as ab, type WorkbookHyperlink as ac, type WorkbookInitialPaint as ad, type WorkbookInitialPaintRequest as ae, WorkbookPeerHydrationError as af, WorkbookPngUnavailableError as ag, WorkbookRecoveryReplayError as ah, type WorkbookSession as ai, type WorkbookSessionEvents as aj, type WorkbookSessionMethods as ak, type WorkbookSessionOpenOptions as al, type WorkbookSessionOpenReply as am, type WorkbookSessionRecovery as an, type WorkbookSessionState as ao, type WorkbookSheetSummary as ap, type WorkbookSheetView as aq, type WorkbookUpdateInfo as ar, type WorkbookUpdateListener as as, type WorkbookUpdateOrigin as at, type XlsxAnchor as au, type XlsxAutoFilterOp as av, type XlsxCellAddress as aw, type XlsxCellGuard as ax, type XlsxCellPosition as ay, type XlsxCellRead as az, type BorderStyle as b, type WorkbookSharedOutcome as b$, type XlsxExportResult as b0, type XlsxExportScope as b1, type XlsxExportSheet as b2, type XlsxExportTable as b3, type XlsxExportValue as b4, type XlsxFindMatch as b5, type XlsxFindRequest as b6, type XlsxFindResult as b7, type XlsxFormulaResult as b8, type XlsxMarkdownContent as b9, renderXlsxMarkdown as bA, wasmVersion as bB, workbookSessionRecovery as bC, type WorkbookReplayReply as bD, type WorkbookEditPeer as bE, type WorkbookReplayMethod as bF, type WorkbookReplayOp as bG, type CommandBasis as bH, type CommandIdentity as bI, type CommandStatus as bJ, type WorkbookAck as bK, type WorkbookCommand as bL, type WorkbookCommandContext as bM, type WorkbookCommandFrame as bN, type WorkbookCommandFrameRequest as bO, type WorkbookCommandKind as bP, type WorkbookCommandPayload as bQ, type WorkbookCommandSelection as bR, type WorkbookCommandTicket as bS, type WorkbookEchoHooks as bT, type WorkbookEditConnection as bU, type WorkbookEditFrame as bV, type WorkbookEditPayload as bW, type WorkbookEditPeerOptions as bX, type WorkbookEditState as bY, type WorkbookSharedAck as bZ, type WorkbookSharedCommand as b_, type XlsxMarkdownOptions as ba, type XlsxObjectKind as bb, type XlsxRangeAddress as bc, type XlsxRangeRead as bd, type XlsxRangeTarget as be, type XlsxReadCalculation as bf, type XlsxReadRequest as bg, type XlsxReadResult as bh, type XlsxSheetEntry as bi, type XlsxSheetIdentity as bj, type XlsxSheetVisibility as bk, type XlsxSourcePart as bl, type XlsxStructuredContent as bm, type XlsxTextMatch as bn, type XlsxTextSearchOptions as bo, type XlsxValidationResult as bp, createWorkbookEditSession as bq, exportXlsxMarkdown as br, exportXlsxStructured as bs, getDisplayListCellLimit as bt, initWasm as bu, isPngExportAvailable as bv, isProposalsAvailable as bw, isWasmAvailable as bx, openWorkbook as by, openWorkbookSession as bz, type CapturedBorderEdge as c, type WorkbookSharedWireAck as c0, type WorkbookSubmitOptions as c1, type WorkbookTicketOutcome as c2, createWorkbookEditPeer as c3, hydratePeer as c4, workbookSessionInternals as c5, type CapturedBorderStyle as d, type CapturedCellFormat as e, type CapturedColor as f, type CapturedFill as g, type CapturedFormat as h, type CellEdit as i, type CellInputEdit as j, type CellPoint as k, type CellPosition as l, type ChartEdit as m, type ChartInfo as n, type ChartMutation as o, type ChartSeriesInfo as p, type ChartSeriesName as q, type ConditionalFormatInfo as r, type ConditionalFormatOp as s, type ConditionalFormatRuleInput as t, type DisplayListProfile as u, DisplayTooLargeError as v, type EditResult as w, type EditSuccess as x, type ExportCompletion as y, type ExportDiagnostic as z };
|