@rosperitus/excelerate 0.14.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1508 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /**
5
+ * What `setDocumentProperties` takes: a named field is set, `null` clears it,
6
+ * a missing one stays. `custom` replaces the whole list; `type` is optional.
7
+ */
8
+ export type DocumentPropertiesPatch = Partial<
9
+ Record<Exclude<keyof DocumentProperties, "custom">, string | null>
10
+ > & {
11
+ custom?: { name: string; value: string | number | boolean; type?: CustomProperty["type"] }[];
12
+ };
13
+ /**
14
+ * A style to write, as `setCellStyle` takes it. Every field is optional and
15
+ * what is left out keeps the value the cell had, so `{ font: { bold: true } }`
16
+ * makes a cell bold without touching its number format.
17
+ */
18
+ export interface CellStylePatch {
19
+ numberFormat?: string;
20
+ font?: Partial<{
21
+ name: string;
22
+ size: number;
23
+ bold: boolean;
24
+ italic: boolean;
25
+ underline: string;
26
+ strike: boolean;
27
+ color: StyleColor;
28
+ }>;
29
+ fill?: Partial<{ pattern: string; foreground: StyleColor; background: StyleColor }>;
30
+ borders?: Partial<{
31
+ left: Partial<BorderSide>;
32
+ right: Partial<BorderSide>;
33
+ top: Partial<BorderSide>;
34
+ bottom: Partial<BorderSide>;
35
+ }>;
36
+ alignment?: Partial<{
37
+ horizontal: string | null;
38
+ vertical: string | null;
39
+ wrapText: boolean;
40
+ shrinkToFit: boolean;
41
+ indent: number;
42
+ textRotation: number;
43
+ }>;
44
+ }
45
+ /**
46
+ * Sort keys: a 1-based column number of the sheet (a row number when sorting
47
+ * columns) or a header's text; a minus in front sorts largest first.
48
+ */
49
+ export type SortKeys = (number | string)[];
50
+ /** How `sortRange` reads its range. */
51
+ export interface SortRangeOptions {
52
+ /** The first row (or column) is a header: it stays put and names keys. */
53
+ header?: boolean;
54
+ /** Reorder columns left to right instead of rows. */
55
+ byColumns?: boolean;
56
+ }
57
+ /**
58
+ * Styles to write over a rectangle, as `setRangeStyles` takes them: `grid`
59
+ * points into `styles`, and `null` or `-1` leaves its cell as it is. What
60
+ * `getRangeStyles` returns fits here unchanged.
61
+ */
62
+ export interface RangeStylesPatch {
63
+ styles: CellStylePatch[];
64
+ grid: (number | null)[][];
65
+ }
66
+ /**
67
+ * A colour to draw with: `#RRGGBB`, `#AARRGGBB` (the alpha is the opacity) or
68
+ * a theme colour by name - `accent1` to `accent6`, `tx1`, `tx2`, `bg1`,
69
+ * `bg2`, `hlink`, `folHlink` - which follows the workbook's theme.
70
+ */
71
+ export type DrawingColorInput = string;
72
+ /** A fill to write: the form `shapes` reads, without `other`. */
73
+ export type DrawingFillInput =
74
+ | { type: "none" }
75
+ | { type: "solid"; color: DrawingColorInput }
76
+ | {
77
+ type: "gradient";
78
+ stops: { position: number; color: DrawingColorInput }[];
79
+ angle?: number | null;
80
+ path?: "shape" | "circle" | "rect" | null;
81
+ }
82
+ | { type: "pattern"; preset?: string | null; foreground?: DrawingColorInput; background?: DrawingColorInput };
83
+ /**
84
+ * Fill and outline to lay over an object's own: a field left out stays,
85
+ * `null` gives it back to the style. `line.width` is in points.
86
+ */
87
+ export interface DrawingFormatPatch {
88
+ fill?: DrawingFillInput | null;
89
+ line?: { fill?: DrawingFillInput | null; width?: number | null } | null;
90
+ }
91
+ /** What `setShapeFormat` takes. `rotation` is in degrees clockwise. */
92
+ export interface ShapeFormatPatch extends DrawingFormatPatch {
93
+ font?: Pick<RunFont, "name" | "size" | "bold" | "italic" | "color">;
94
+ rotation?: number;
95
+ flipH?: boolean;
96
+ flipV?: boolean;
97
+ }
98
+ /**
99
+ * What a table column keeps, as `setTableFilter` takes it: the shown values,
100
+ * one or two comparisons, or the largest or smallest few.
101
+ */
102
+ export type TableFilter =
103
+ | { values: (string | number)[]; blank?: boolean }
104
+ | { custom: { op: "=" | "<>" | ">" | ">=" | "<" | "<="; value: string | number }[]; and?: boolean }
105
+ | { top: number; percent?: boolean }
106
+ | { bottom: number; percent?: boolean };
107
+ /** What `setChartFormat` takes: the chart area and the plot area. */
108
+ export interface ChartFormatPatch {
109
+ format?: DrawingFormatPatch | null;
110
+ plotFormat?: DrawingFormatPatch | null;
111
+ }
112
+ /** What `removeDuplicates` did. */
113
+ export interface DuplicatesRemoved {
114
+ /** Rows dropped as repeats of a row above them. */
115
+ removed: number;
116
+ /** Data rows left, the header not counted. */
117
+ remaining: number;
118
+ }
119
+ /** How `removeDuplicates` compares rows. */
120
+ export interface RemoveDuplicatesOptions {
121
+ /** 1-based sheet columns to compare; every column of the range when left out. */
122
+ columns?: number[];
123
+ /** The first row is a header: it stays and is not compared. */
124
+ header?: boolean;
125
+ }
126
+ /** How `textToColumns` cuts text: by `delimiters` or, when given, by `widths`. */
127
+ export interface TextToColumnsOptions {
128
+ /** Delimiter characters, each one a delimiter: `";"`, `",\t"`. A tab when left out. */
129
+ delimiters?: string;
130
+ /** Character positions to cut before, for fixed width. */
131
+ widths?: number[];
132
+ /** A run of delimiters counts as one. */
133
+ mergeConsecutive?: boolean;
134
+ /** The quote inside which delimiters are text; `"` when left out, `null` for none. */
135
+ qualifier?: string | null;
136
+ /** The first cell written; the range's own first cell when left out. */
137
+ destination?: string;
138
+ }
139
+ /** A rule for `addDataValidation`. Formulas are written for the first cell of `sqref`. */
140
+ export interface NewDataValidation {
141
+ /** The cells, space-separated: `"B2:B100"`, `"B2:B9 D2:D9"`. */
142
+ sqref: string;
143
+ type: "whole" | "decimal" | "list" | "date" | "time" | "textLength" | "custom";
144
+ operator?:
145
+ | "between" | "notBetween" | "equal" | "notEqual"
146
+ | "greaterThan" | "lessThan" | "greaterThanOrEqual" | "lessThanOrEqual";
147
+ /** First bound, the list (`"\"Yes,No\""` or `"$E$1:$E$5"`) or the custom formula. */
148
+ formula1?: string;
149
+ /** Second bound, for `between` and `notBetween`. */
150
+ formula2?: string;
151
+ /** Empty cells pass. On when left out. */
152
+ allowBlank?: boolean;
153
+ /** The in-cell arrow of a list. On when left out. */
154
+ showDropDown?: boolean;
155
+ showInputMessage?: boolean;
156
+ showErrorMessage?: boolean;
157
+ errorStyle?: "stop" | "warning" | "information";
158
+ errorTitle?: string;
159
+ error?: string;
160
+ promptTitle?: string;
161
+ prompt?: string;
162
+ }
163
+
164
+
165
+
166
+ /** What a cell can hold on the JS side. An error cell reads as its code, `#DIV/0!`. */
167
+ export type CellValue = number | string | boolean | null;
168
+ /** A rectangle of cells, row by row, as `getRange` returns it. */
169
+ export type CellGrid = CellValue[][];
170
+ /**
171
+ * One row with its styling, as `getRowAt` returns it. `formatted` is `null`
172
+ * when the call asked for values alone. `bold` is one byte per cell, 0 or 1.
173
+ */
174
+ export interface SheetRow {
175
+ values: CellValue[];
176
+ formatted: string[] | null;
177
+ bold: Uint8Array;
178
+ indent: Uint32Array;
179
+ hidden: boolean;
180
+ }
181
+ /** Where a drawing object sits, in the 1-based numbers a user sees. */
182
+ export interface ObjectAnchor {
183
+ kind: "twoCell" | "oneCell" | "absolute";
184
+ row: number | null;
185
+ column: number | null;
186
+ }
187
+ /** How a sheet is frozen and shown, as `sheetView` returns it. */
188
+ export interface SheetViewInfo {
189
+ frozenRows: number;
190
+ frozenColumns: number;
191
+ zoom: number | null;
192
+ showGridLines: boolean;
193
+ showRowColHeaders: boolean;
194
+ rightToLeft: boolean;
195
+ topLeftCell: string | null;
196
+ }
197
+ /** One of the user's own document properties. */
198
+ export interface CustomProperty {
199
+ name: string;
200
+ type: "text" | "integer" | "number" | "boolean" | "date";
201
+ value: string | number | boolean;
202
+ }
203
+ /** Title, author, dates and the user's fields, as `documentProperties` returns them. Dates are ISO 8601. */
204
+ export interface DocumentProperties {
205
+ title: string | null;
206
+ subject: string | null;
207
+ creator: string | null;
208
+ keywords: string | null;
209
+ description: string | null;
210
+ lastModifiedBy: string | null;
211
+ category: string | null;
212
+ contentStatus: string | null;
213
+ language: string | null;
214
+ identifier: string | null;
215
+ revision: string | null;
216
+ version: string | null;
217
+ created: string | null;
218
+ modified: string | null;
219
+ lastPrinted: string | null;
220
+ company: string | null;
221
+ manager: string | null;
222
+ custom: CustomProperty[];
223
+ }
224
+ /** A name that stands for a formula, as `definedNames` returns it. */
225
+ export interface WorkbookName {
226
+ name: string;
227
+ formula: string;
228
+ sheet: number | null;
229
+ hidden: boolean;
230
+ }
231
+ /** A rule limiting what a cell accepts, as `dataValidations` returns it. */
232
+ export interface SheetValidation {
233
+ sqref: string[];
234
+ type: string;
235
+ operator: string;
236
+ formula1: string;
237
+ formula2: string;
238
+ allowBlank: boolean;
239
+ showDropDown: boolean;
240
+ }
241
+ /** One conditional formatting block, as `conditionalFormats` returns it. */
242
+ export interface SheetConditionalFormat {
243
+ sqref: string[];
244
+ rules: { type: string; priority: number; operator: string | null; formulas: string[]; text: string | null }[];
245
+ }
246
+ /** The autofilter over a range, as `autoFilter` returns it. */
247
+ export interface SheetAutoFilter {
248
+ range: string;
249
+ columns: { colId: number; kind: "values" | "custom" | "dynamic" | "top10" | "color" | "icon" | "none" }[];
250
+ }
251
+ /** A pivot report on the sheet, as `pivotTables` returns it. */
252
+ export interface SheetPivotTable {
253
+ name: string;
254
+ location: string | null;
255
+ cacheId: number;
256
+ rowFields: number;
257
+ columnFields: number;
258
+ valueFields: number;
259
+ }
260
+ /** How a sheet or the workbook is locked, as `sheetProtection` returns it. */
261
+ export interface ProtectionInfo { locked: boolean; hasPassword: boolean }
262
+ /** How `toCsv` writes, and how `Book.readCsv` reads. */
263
+ export interface CsvOptions {
264
+ delimiter?: string;
265
+ contiguous?: boolean;
266
+ preserveEmptyFields?: boolean;
267
+ }
268
+ /** A note on a cell, as `comments` returns it. */
269
+ export interface SheetComment { address: string; author: string; text: string }
270
+ /** A link over a cell or a block of them, as `hyperlinks` returns it. */
271
+ export interface SheetHyperlink {
272
+ range: string;
273
+ target: string;
274
+ external: boolean;
275
+ display: string | null;
276
+ tooltip: string | null;
277
+ }
278
+ /** A table over a block of cells, as `tables` returns it. */
279
+ export interface SheetTable {
280
+ name: string;
281
+ displayName: string;
282
+ range: string;
283
+ headerRowCount: number | null;
284
+ totalsRowCount: number | null;
285
+ columns: string[];
286
+ }
287
+ /** A chart on the sheet, as `charts` returns it. */
288
+ export interface SheetChart {
289
+ name: string;
290
+ title: string | null;
291
+ kinds: string[];
292
+ seriesCount: number;
293
+ anchor: ObjectAnchor;
294
+ /** The chart area's fill and outline; `null` leaves them to the chart style. */
295
+ format: DrawingFormat | null;
296
+ /** The plot area's, the same way. */
297
+ plotFormat: DrawingFormat | null;
298
+ }
299
+ /** A picture on the sheet, as `images` returns it. Bytes come from `imageData`. */
300
+ export interface SheetImage {
301
+ name: string;
302
+ description: string;
303
+ format: string;
304
+ byteLength: number;
305
+ anchor: ObjectAnchor;
306
+ }
307
+ /** A drawn shape, as `shapes` returns it. */
308
+ export interface SheetShape {
309
+ name: string;
310
+ description: string;
311
+ geometry: string | null;
312
+ text: string;
313
+ anchor: ObjectAnchor;
314
+ /** Degrees clockwise about the centre. */
315
+ rotation: number;
316
+ /** Mirrored left to right, before it is turned. */
317
+ flipH: boolean;
318
+ /** Mirrored top to bottom, before it is turned. */
319
+ flipV: boolean;
320
+ /** What Excel fills it with: its own, else its style's. */
321
+ fill: DrawingFill;
322
+ /** Its outline, the same way. */
323
+ line: DrawingLine;
324
+ /** The font of its text as the first run states it, the colour from the style if not. */
325
+ font: RunFont;
326
+ }
327
+ /**
328
+ * A colour of a drawing, resolved through the workbook theme to `#AARRGGBB` (`FF` for opaque);
329
+ * `null` for one no theme defines.
330
+ */
331
+ export type DrawingColor = string | null;
332
+ /** How a drawing object or chart area is filled. `position` is in percent, `angle` in degrees. */
333
+ export type DrawingFill =
334
+ | { type: "none" }
335
+ | { type: "solid"; color: DrawingColor }
336
+ | {
337
+ type: "gradient";
338
+ stops: { position: number; color: DrawingColor }[];
339
+ angle: number | null;
340
+ path: "shape" | "circle" | "rect" | null;
341
+ }
342
+ | { type: "pattern"; preset: string | null; foreground: DrawingColor; background: DrawingColor }
343
+ | { type: "other" };
344
+ /** An outline: `fill` is `null` and `width` (points) is `null` where the file is silent. */
345
+ export interface DrawingLine {
346
+ fill: DrawingFill | null;
347
+ width: number | null;
348
+ }
349
+ /** The fill and outline an element states; `null` in either leaves it to the style. */
350
+ export interface DrawingFormat {
351
+ fill: DrawingFill | null;
352
+ line: DrawingLine | null;
353
+ }
354
+ /**
355
+ * A colour as the file states it: `null` when the file leaves it to the
356
+ * reader, `#AARRGGBB` when it names one outright, and `indexed:N` or
357
+ * `theme:N` when it points into the legacy palette or the workbook theme -
358
+ * a theme colour carries its tint as `theme:4@-0.25`.
359
+ */
360
+ export type StyleColor = string | null;
361
+ /**
362
+ * What a run of formatted text changes about the cell's font; a field left
363
+ * out is the cell's own. `size` in points.
364
+ */
365
+ export interface RunFont {
366
+ name?: string;
367
+ size?: number;
368
+ bold?: boolean;
369
+ italic?: boolean;
370
+ underline?: string;
371
+ strike?: boolean;
372
+ color?: StyleColor;
373
+ script?: "superscript" | "subscript" | "baseline";
374
+ }
375
+ /** One run of formatted text, as `getRichText` returns it. */
376
+ export interface TextRun { text: string; font?: RunFont | null }
377
+ /** One side of a cell's border. */
378
+ export interface BorderSide { style: string; color: StyleColor }
379
+ /** How a cell is painted, as `cellStyle` returns it. */
380
+ export interface CellStyle {
381
+ numberFormat: string;
382
+ font: {
383
+ name: string;
384
+ size: number;
385
+ bold: boolean;
386
+ italic: boolean;
387
+ underline: string;
388
+ strike: boolean;
389
+ color: StyleColor;
390
+ };
391
+ fill: { pattern: string; foreground: StyleColor; background: StyleColor };
392
+ borders: {
393
+ left: BorderSide;
394
+ right: BorderSide;
395
+ top: BorderSide;
396
+ bottom: BorderSide;
397
+ };
398
+ alignment: {
399
+ horizontal: string | null;
400
+ vertical: string | null;
401
+ wrapText: boolean;
402
+ shrinkToFit: boolean;
403
+ indent: number;
404
+ textRotation: number;
405
+ };
406
+ }
407
+ /**
408
+ * The styles of a rectangle, as `getRangeStyles` returns them: each distinct
409
+ * style once in `styles`, and `grid` - row by row - pointing into it.
410
+ */
411
+ export interface RangeStyles {
412
+ styles: CellStyle[];
413
+ grid: number[][];
414
+ }
415
+ /** Limits for `goalSeek`; the workbook's iteration settings when left out. */
416
+ export interface GoalSeekOptions {
417
+ maxIterations?: number;
418
+ tolerance?: number;
419
+ }
420
+ /** How `goalSeek` ended. */
421
+ export interface GoalSeekResult {
422
+ /** The value left in the changing cell: the best one tried. */
423
+ value: number;
424
+ /** What the set cell computes with it; `null` when that is not a number. */
425
+ result: number | null;
426
+ /** How many times the set cell was computed. */
427
+ iterations: number;
428
+ /** Whether `result` is within the tolerance of the target. */
429
+ converged: boolean;
430
+ }
431
+ /** The rule a value breaks, as `checkValidation` reports it. */
432
+ export interface ValidationProblem {
433
+ /** How Excel reports it: `stop` refuses the entry, the others only warn. */
434
+ style: "stop" | "warning" | "information";
435
+ title: string;
436
+ /** The rule's own message; empty when it has none. */
437
+ message: string;
438
+ sqref: string[];
439
+ }
440
+
441
+
442
+
443
+ /**
444
+ * A workbook.
445
+ */
446
+ export class Book {
447
+ free(): void;
448
+ [Symbol.dispose](): void;
449
+ /**
450
+ * The tab a reader opens the workbook on.
451
+ */
452
+ activeSheet(): number;
453
+ /**
454
+ * Adds a data validation rule to a sheet, as Data - Data Validation
455
+ * does: `type` is `"whole"`, `"decimal"`, `"list"`, `"date"`, `"time"`,
456
+ * `"textLength"` or `"custom"`, `operator` one of `"between"` (the
457
+ * default), `"notBetween"`, `"equal"`, `"notEqual"`, `"greaterThan"`,
458
+ * `"lessThan"`, `"greaterThanOrEqual"`, `"lessThanOrEqual"`. Formulas are
459
+ * written for the first cell of `sqref`; a list is `"\"Yes,No\""` or a
460
+ * range such as `"$E$1:$E$5"`.
461
+ *
462
+ * ```js
463
+ * book.addDataValidation(0, { sqref: "B2:B100", type: "list", formula1: "\"Yes,No\"" });
464
+ * ```
465
+ */
466
+ addDataValidation(sheet: number, rule: NewDataValidation): void;
467
+ /**
468
+ * Appends a sheet and returns its index.
469
+ */
470
+ addSheet(title: string): number;
471
+ /**
472
+ * Draws a table over a range, the thing `Sales[Amount]` names.
473
+ *
474
+ * The first row of the range is the header unless `headerRow` says
475
+ * otherwise, and the column names are read from it. The name must be
476
+ * unique in the workbook, as Excel requires.
477
+ */
478
+ addTable(sheet: number, name: string, range: string, header_row?: boolean | null): void;
479
+ /**
480
+ * The array formulas of a sheet, as the areas they cover: `["B2:B4"]`.
481
+ * The formula itself is on the top left cell of each.
482
+ */
483
+ arrayFormulas(sheet: number): string[];
484
+ /**
485
+ * The autofilter over a sheet, or `undefined` when it has none. What the
486
+ * filter hides is a property of each row - see `rowHidden`.
487
+ */
488
+ autoFilter(sheet: number): SheetAutoFilter | undefined;
489
+ /**
490
+ * Whether a cell is bold.
491
+ *
492
+ * The one flag, without building the rest of the style: a parser that
493
+ * looks for a header row asks this of every cell, and `cellStyle` would
494
+ * make it pay for the font, fill and four borders it never reads.
495
+ */
496
+ cellBold(sheet: number, address: string): boolean;
497
+ /**
498
+ * The same by 1-based row and column.
499
+ */
500
+ cellBoldAt(sheet: number, row: number, column: number): boolean;
501
+ /**
502
+ * How many non-empty cells the workbook holds, or one sheet of it.
503
+ */
504
+ cellCount(sheet?: number | null): number;
505
+ /**
506
+ * The indent of a cell, in Excel's indent steps (0 when it has none).
507
+ *
508
+ * Indent lives on the cell's style, and a spreadsheet only honours it for
509
+ * left, right and distributed alignment - but the number is returned as
510
+ * the file states it, whatever the alignment.
511
+ */
512
+ cellIndent(sheet: number, address: string): number;
513
+ /**
514
+ * The same by 1-based row and column.
515
+ */
516
+ cellIndentAt(sheet: number, row: number, column: number): number;
517
+ /**
518
+ * How a cell is painted: number format, font, fill, borders and text
519
+ * placement, as the file states them.
520
+ *
521
+ * A cell the file says nothing about answers with Excel's defaults, which
522
+ * is what Excel itself shows for it.
523
+ */
524
+ cellStyle(sheet: number, address: string): CellStyle;
525
+ /**
526
+ * The same by 1-based row and column.
527
+ */
528
+ cellStyleAt(sheet: number, row: number, column: number): CellStyle;
529
+ /**
530
+ * The charts on a sheet. `kinds` names the plots drawn in each -
531
+ * `barChart`, `lineChart` - and a combination chart has more than one.
532
+ */
533
+ charts(sheet: number): SheetChart[];
534
+ /**
535
+ * Whether `value` would be accepted in a cell under its data validation
536
+ * rule: `null` when it would (or there is no rule), otherwise what Excel
537
+ * would report, `{ style, title, message, sqref }`.
538
+ *
539
+ * ```js
540
+ * const problem = book.checkValidation(0, "B5", 150);
541
+ * if (problem) alert(problem.message || "Not allowed");
542
+ * ```
543
+ */
544
+ checkValidation(sheet: number, address: string, value: CellValue): ValidationProblem | null;
545
+ /**
546
+ * Empties a cell, style and all.
547
+ */
548
+ clear(sheet: number, address: string): void;
549
+ /**
550
+ * The same by 1-based row and column.
551
+ */
552
+ clearAt(sheet: number, row: number, column: number): void;
553
+ /**
554
+ * The same for a column, named by its letters: `columnLevel(0, "C")`.
555
+ */
556
+ columnLevel(sheet: number, column: string): number;
557
+ /**
558
+ * The width of a column in characters, or `undefined` when the sheet
559
+ * leaves it to the default. `column` is 1-based.
560
+ */
561
+ columnWidth(sheet: number, column: number): number | undefined;
562
+ /**
563
+ * The notes on a sheet, in address order.
564
+ */
565
+ comments(sheet: number): SheetComment[];
566
+ /**
567
+ * The conditional formatting of a sheet, block by block. The formatting
568
+ * each rule applies is not modelled here - it lives in the workbook's
569
+ * differential styles - but what the rule tests is.
570
+ */
571
+ conditionalFormats(sheet: number): SheetConditionalFormat[];
572
+ /**
573
+ * Copies a rectangle of cells so its top left corner lands on `to`,
574
+ * rewriting the formulas as Excel rewrites a copied formula: `=A1` one
575
+ * row down reads `=A2`, `$A$1` stays put.
576
+ *
577
+ * `toSheet` defaults to the sheet copied from. A cell the source leaves
578
+ * empty empties the target, the way pasting a block does.
579
+ */
580
+ copyRange(sheet: number, range: string, to: string, to_sheet?: number | null): void;
581
+ /**
582
+ * The rules limiting what cells accept: the dropdown lists, the ranges,
583
+ * the dates.
584
+ */
585
+ dataValidations(sheet: number): SheetValidation[];
586
+ /**
587
+ * The names the workbook defines: what `=Total` and `Print_Area` stand
588
+ * for. `sheet` is set on a name local to one sheet.
589
+ */
590
+ definedNames(): WorkbookName[];
591
+ /**
592
+ * What Excel shows under File > Info: every text field is a string or
593
+ * `null`, dates in ISO 8601. `custom` lists the user's own fields with
594
+ * their type: `text`, `integer`, `number`, `boolean` or `date`.
595
+ */
596
+ documentProperties(): DocumentProperties;
597
+ /**
598
+ * Evaluates a formula (with or without the leading `=`) as if it sat in
599
+ * `address` of `sheet`, and returns its result.
600
+ */
601
+ evaluate(sheet: number, address: string, formula: string): CellValue;
602
+ /**
603
+ * The other workbooks this one reads, in the order `[1]Sheet1!A1` counts
604
+ * them. A path is `undefined` where the file does not name one.
605
+ */
606
+ externalBooks(): any[];
607
+ /**
608
+ * Copies the first row of a range into the rows below it, as Ctrl+D.
609
+ */
610
+ fillDown(sheet: number, range: string): void;
611
+ /**
612
+ * Copies the first column of a range into the columns to its right, as
613
+ * Ctrl+R.
614
+ */
615
+ fillRight(sheet: number, range: string): void;
616
+ /**
617
+ * Continues what the first cells of a range start, as dragging the fill
618
+ * handle does: `1, 2` goes on `3, 4`, `Кв1` to `Кв2`, `Jan` to `Feb`, a
619
+ * date by a day; anything else repeats. `"down"` fills each column,
620
+ * `"right"` each row; `"up"` and `"left"` run the series back from the
621
+ * last cells.
622
+ */
623
+ fillSeries(sheet: number, range: string, direction: "down" | "right" | "up" | "left"): void;
624
+ /**
625
+ * Reads a workbook and hands sheet `sheet` over row by row, without
626
+ * building its grid: `callback(row, data)` gets the 1-based row number
627
+ * and what `getRowAt` would answer for it, and the row is dropped once
628
+ * the callback returns.
629
+ *
630
+ * The workbook comes back whole but for that sheet's cells. Only xlsx
631
+ * streams; any other format is read whole and then handed over the same
632
+ * way, so the callback sees the same rows but nothing is saved.
633
+ * A callback that throws is not called again, and what it threw comes
634
+ * out of `forEachRow` once the read is over.
635
+ */
636
+ static forEachRow(bytes: Uint8Array, name: string | null | undefined, sheet: number, callback: Function, formatted?: boolean | null): Book;
637
+ /**
638
+ * Freezes the first `rows` rows and `columns` columns, so they stay put
639
+ * while the rest scrolls. `freezePanes(0, 1, 0)` pins the header row;
640
+ * `freezePanes(0, 0, 0)` unfreezes.
641
+ */
642
+ freezePanes(sheet: number, rows: number, columns: number): void;
643
+ /**
644
+ * The value at `address` on sheet `sheet`, as a JS number, string, boolean
645
+ * or `null`. A formula cell gives its cached result, not its text.
646
+ */
647
+ get(sheet: number, address: string): CellValue;
648
+ /**
649
+ * The same by 1-based row and column.
650
+ */
651
+ getAt(sheet: number, row: number, column: number): CellValue;
652
+ /**
653
+ * The cell as a spreadsheet would display it: the value run through its
654
+ * number format, so `0.256` under `0.0%` reads `25.6%`.
655
+ */
656
+ getFormatted(sheet: number, address: string): string;
657
+ /**
658
+ * The same by 1-based row and column.
659
+ */
660
+ getFormattedAt(sheet: number, row: number, column: number): string;
661
+ /**
662
+ * The formula text of a cell without its leading `=`, or `undefined` when
663
+ * the cell holds a plain value.
664
+ */
665
+ getFormula(sheet: number, address: string): string | undefined;
666
+ /**
667
+ * The same by 1-based row and column.
668
+ */
669
+ getFormulaAt(sheet: number, row: number, column: number): string | undefined;
670
+ /**
671
+ * A rectangle of cells, row by row. One call across the boundary instead
672
+ * of one per cell, which is what makes reading a sheet worth doing.
673
+ */
674
+ getRange(sheet: number, range: string): CellGrid;
675
+ /**
676
+ * The same by numbers: the top-left cell, then how many rows and columns
677
+ * to take. `getRangeAt(0, 1, 1, 3, 2)` is `A1:B3`.
678
+ */
679
+ getRangeAt(sheet: number, row: number, column: number, rows: number, columns: number): CellGrid;
680
+ /**
681
+ * The styles of a rectangle in one call: each distinct style once, and a
682
+ * grid of indexes into them. `cellStyle` per cell costs a crossing and a
683
+ * whole style object per cell; a formatted table of ten thousand cells
684
+ * usually has a dozen styles.
685
+ */
686
+ getRangeStyles(sheet: number, range: string): RangeStyles;
687
+ /**
688
+ * The same by numbers, as `getRangeAt` takes them.
689
+ */
690
+ getRangeStylesAt(sheet: number, row: number, column: number, rows: number, columns: number): RangeStyles;
691
+ /**
692
+ * The runs of a cell's formatted text: `{ text, font }` each, `font`
693
+ * naming only what the run changes about the cell's font, or `null` for
694
+ * a run in the cell's own. `null` for a cell without formatted text.
695
+ */
696
+ getRichText(sheet: number, address: string): TextRun[] | null;
697
+ /**
698
+ * The same by 1-based row and column.
699
+ */
700
+ getRichTextAt(sheet: number, row: number, column: number): TextRun[] | null;
701
+ /**
702
+ * A whole row in one crossing of the boundary: values, displayed text,
703
+ * bold and indent, plus whether the row is hidden.
704
+ *
705
+ * The arrays run from column 1 to the last column this row has a cell in,
706
+ * so a row of ten cells costs one call rather than forty.
707
+ *
708
+ * `formatted` is what the number format makes of each value, and building
709
+ * it allocates a string per cell - which a caller reading values does not
710
+ * want to pay half a sheet over. Pass `false` and the field comes back
711
+ * `null`; `getFormattedAt` still answers for the cells that need it.
712
+ */
713
+ getRowAt(sheet: number, row: number, formatted?: boolean | null): SheetRow;
714
+ /**
715
+ * Finds the value of `changing` that makes the formula in `set` compute
716
+ * `target`, as Excel's Goal Seek does, both cells on `sheet`. The best
717
+ * value found is left in `changing` and what reads it is recomputed.
718
+ * `options.maxIterations` and `options.tolerance` default to the
719
+ * workbook's own iteration settings (100 and 0.001 unless it says
720
+ * otherwise). Returns `{ value, result, iterations, converged }`.
721
+ *
722
+ * ```js
723
+ * const { value, converged } = book.goalSeek(0, "B4", 300, "B1");
724
+ * ```
725
+ */
726
+ goalSeek(sheet: number, set: string, target: number, changing: string, options?: GoalSeekOptions): GoalSeekResult;
727
+ /**
728
+ * The hyperlinks of a sheet. `external` tells a URL from a jump inside
729
+ * the workbook.
730
+ */
731
+ hyperlinks(sheet: number): SheetHyperlink[];
732
+ /**
733
+ * The bytes of one picture, by its position in `images`.
734
+ */
735
+ imageData(sheet: number, index: number): Uint8Array;
736
+ /**
737
+ * The pictures on a sheet, without their bytes: `imageData` fetches those
738
+ * for the one that is wanted.
739
+ */
740
+ images(sheet: number): SheetImage[];
741
+ /**
742
+ * Inserts blank cells over a range, pushing what was there `"down"` or
743
+ * `"right"` - Excel's "Insert Cells", which moves part of a row rather
744
+ * than the whole of it. `copyOrigin` works as in `insertRows`.
745
+ */
746
+ insertCells(sheet: number, range: string, shift: "down" | "right", copyOrigin?: "before" | "after" | "none"): void;
747
+ /**
748
+ * Inserts `count` columns to the left of column `at`, 1-based.
749
+ * `copyOrigin` works as in `insertRows`, with left and right.
750
+ */
751
+ insertColumns(sheet: number, at: number, count: number, copyOrigin?: "before" | "after" | "none"): void;
752
+ /**
753
+ * `insertRowsMany` for columns.
754
+ */
755
+ insertColumnsMany(sheet: number, places: [number, number][], copyOrigin?: "before" | "after" | "none"): void;
756
+ /**
757
+ * Inserts `count` rows above row `at`, moving everything below down.
758
+ * `copyOrigin` - `"before"` (the row above), `"after"` (the row below)
759
+ * or `"none"` - says whose formatting the new rows take. Left out, it is
760
+ * `"before"`, as in Excel.
761
+ *
762
+ * Formulas across the whole workbook follow the cells they read, and so
763
+ * do merges, links, validations, tables and drawings. `at` is the number
764
+ * a user sees.
765
+ */
766
+ insertRows(sheet: number, at: number, count: number, copyOrigin?: "before" | "after" | "none"): void;
767
+ /**
768
+ * Inserts rows at many places in one pass: `places` is `[at, count]`
769
+ * pairs, numbered as the sheet is before the call, in any order.
770
+ * `book.insertRowsMany(0, [[5, 1], [9, 1]])` puts a row above each of
771
+ * rows 5 and 9 - the old row 9, now row 10. Each new block takes its
772
+ * formatting from its own neighbour, as `copyOrigin` says.
773
+ *
774
+ * The result is that of the single inserts made from the bottom up, but
775
+ * the workbook is walked once rather than once per place: four thousand
776
+ * subtotal rows into forty thousand take milliseconds, not a minute.
777
+ */
778
+ insertRowsMany(sheet: number, places: [number, number][], copyOrigin?: "before" | "after" | "none"): void;
779
+ /**
780
+ * The cells of a sheet whose values break their data validation rule,
781
+ * as Excel's Circle Invalid Data finds them: `["B3", "B9"]`.
782
+ */
783
+ invalidCells(sheet: number): string[];
784
+ /**
785
+ * Merges a block of cells: `merge(0, "A1:C1")`.
786
+ */
787
+ merge(sheet: number, range: string): void;
788
+ /**
789
+ * The merged areas of a sheet, as `"A1:C1"` strings in the order the file
790
+ * lists them.
791
+ */
792
+ mergedRanges(sheet: number): string[];
793
+ /**
794
+ * The merged areas of a sheet as numbers: four per area, `[r1, c1, r2,
795
+ * c2]`, rows and columns 1-based.
796
+ *
797
+ * One typed array instead of a JS string per area, which is what a sheet
798
+ * carrying three hundred thousand of them needs.
799
+ */
800
+ mergedRangesAt(sheet: number): Uint32Array;
801
+ /**
802
+ * Moves a rectangle of cells, leaving the source empty.
803
+ *
804
+ * A moved formula keeps reading the cells it read; the formulas elsewhere
805
+ * that read *these* cells follow them instead, as they do when Excel cuts
806
+ * and pastes.
807
+ */
808
+ moveRange(sheet: number, range: string, to: string, to_sheet?: number | null): void;
809
+ /**
810
+ * Moves a sheet along the tab bar. Formulas are untouched - a sheet is
811
+ * named, not numbered - but every index moves, this one included, so read
812
+ * `sheetIndex` again afterwards.
813
+ */
814
+ moveSheet(from: number, to: number): void;
815
+ /**
816
+ * A new workbook with one empty sheet.
817
+ */
818
+ constructor();
819
+ /**
820
+ * The pivot reports laid out on a sheet. The numbers they show are cells
821
+ * like any others; this says where a report sits and how wide its axes
822
+ * are.
823
+ */
824
+ pivotTables(sheet: number): SheetPivotTable[];
825
+ /**
826
+ * Locks a sheet against editing, optionally behind a password.
827
+ *
828
+ * This is the lock Excel offers under "Protect Sheet": it stops a user
829
+ * editing, it does not encrypt anything. The password is stored as Excel
830
+ * stores it - SHA-512 over a random salt, 100,000 spins - and
831
+ * `verifySheetPassword` checks it back.
832
+ */
833
+ protectSheet(sheet: number, password?: string | null): void;
834
+ /**
835
+ * Locks the structure of the workbook: which sheets there are, and their
836
+ * order. `windows` locks the window layout as well.
837
+ */
838
+ protectWorkbook(password?: string | null, windows?: boolean | null): void;
839
+ /**
840
+ * Reads a workbook of any format this crate supports, working the format
841
+ * out from the bytes themselves.
842
+ *
843
+ * `name` is the file name they came from, if the caller has one: it
844
+ * settles what the bytes cannot say (a `.csv` against a `.html`) and names
845
+ * the sheet of a SYLK file. `password` opens a workbook saved with a
846
+ * password to open; without it only one encrypted to be opened
847
+ * read-only reads.
848
+ */
849
+ static read(bytes: Uint8Array, name?: string | null, max_expanded?: number | null, on_progress?: Function | null, password?: string | null): Book;
850
+ /**
851
+ * Reads CSV with the guesses overridden: the delimiter, whether a row
852
+ * that produced no cell is skipped, whether an empty field becomes an
853
+ * empty string rather than no cell at all.
854
+ *
855
+ * `Book.read` guesses all of this from the bytes, which is right for a
856
+ * file of unknown origin; this is for one whose shape you already know.
857
+ */
858
+ static readCsv(bytes: Uint8Array, options: CsvOptions): Book;
859
+ /**
860
+ * Recomputes every formula and stores the results beside them, so that
861
+ * `get` and `toCsv` show this engine's answers rather than the cache the
862
+ * file was saved with. Returns how many formulas were computed.
863
+ *
864
+ * With no argument the whole workbook is recomputed; with a sheet index,
865
+ * only that sheet's formulas are - though they still read the whole
866
+ * workbook, as a cross-sheet reference must.
867
+ */
868
+ recalculate(sheet?: number | null, on_progress?: Function | null): number;
869
+ /**
870
+ * Recomputes the formula in one cell and stores its result. Returns
871
+ * whether there was a formula there.
872
+ *
873
+ * Not the same as `recalculateFrom`, which recomputes the formulas
874
+ * *reading* this cell and leaves the cell itself alone.
875
+ */
876
+ recalculateCell(sheet: number, address: string): boolean;
877
+ /**
878
+ * The same by 1-based row and column.
879
+ */
880
+ recalculateCellAt(sheet: number, row: number, column: number): boolean;
881
+ /**
882
+ * Recomputes only what depends on one cell that changed - the formulas
883
+ * reading it, the formulas reading those, and so on. Returns how many were
884
+ * computed. This is the pass to run after `set`.
885
+ *
886
+ * For a batch of edits use `recalculateFromMany`, which answers them all
887
+ * in one pass.
888
+ */
889
+ recalculateFrom(sheet: number, address: string): number;
890
+ /**
891
+ * The same by 1-based row and column.
892
+ */
893
+ recalculateFromAt(sheet: number, row: number, column: number): number;
894
+ /**
895
+ * The same for a batch of cells, all on sheet `sheet`, answered in one
896
+ * pass: editing a hundred cells costs one walk of the workbook, not a
897
+ * hundred.
898
+ *
899
+ * The index of what reads what is built on the first call and kept, so a
900
+ * run of edits parses the formulas only once. `set` keeps it in step.
901
+ */
902
+ recalculateFromMany(sheet: number, addresses: string[]): number;
903
+ /**
904
+ * Registers a function of your own, callable from any formula in the
905
+ * workbook by that name.
906
+ *
907
+ * The function is handed the arguments already computed - a range arrives
908
+ * as an array of arrays - and whatever it returns becomes the value. A
909
+ * name a built-in claims stays the built-in's: a workbook where `SUM`
910
+ * means something else is a workbook nobody else can read.
911
+ *
912
+ * ```js
913
+ * book.registerFunction("MYRATE", (base) => base * 1.5 + 0.5);
914
+ * book.evaluate(0, "A1", "=MYRATE(10)"); // 15.5
915
+ * ```
916
+ */
917
+ registerFunction(name: string, _function: Function): void;
918
+ /**
919
+ * The names registered, in no particular order.
920
+ */
921
+ registeredFunctions(): string[];
922
+ /**
923
+ * Removes the cells of a range, pulling the rest back over the hole from
924
+ * below (`"up"`) or from the right (`"left"`).
925
+ */
926
+ removeCells(sheet: number, range: string, shift: "up" | "left"): void;
927
+ /**
928
+ * Removes `count` columns from column `at`, 1-based.
929
+ */
930
+ removeColumns(sheet: number, at: number, count: number): void;
931
+ /**
932
+ * `removeRowsMany` for columns.
933
+ */
934
+ removeColumnsMany(sheet: number, places: [number, number][]): void;
935
+ /**
936
+ * Takes a note off a cell. Answers whether there was one.
937
+ */
938
+ removeComment(sheet: number, address: string): boolean;
939
+ /**
940
+ * Removes a defined name. Answers whether there was one.
941
+ */
942
+ removeDefinedName(name: string, sheet?: number | null): boolean;
943
+ /**
944
+ * Removes the rows of a range that repeat a row above them, as Excel's
945
+ * Remove Duplicates does: cells are compared by the text they show,
946
+ * without regard to case. `options.columns` are the 1-based sheet
947
+ * columns compared (all of the range when left out), and
948
+ * `options.header` keeps the first row out of it. Returns
949
+ * `{ removed, remaining }`.
950
+ *
951
+ * ```js
952
+ * book.removeDuplicates(0, "A1:C500", { columns: [1, 3], header: true });
953
+ * ```
954
+ */
955
+ removeDuplicates(sheet: number, range: string, options?: RemoveDuplicatesOptions): DuplicatesRemoved;
956
+ /**
957
+ * Takes the link off a range. Answers whether there was one.
958
+ */
959
+ removeHyperlink(sheet: number, range: string): boolean;
960
+ /**
961
+ * Removes `count` rows from row `at` down. A formula that read a removed
962
+ * cell reads `#REF!` afterwards.
963
+ */
964
+ removeRows(sheet: number, at: number, count: number): void;
965
+ /**
966
+ * Removes rows at many places in one pass: `[at, count]` pairs, numbered
967
+ * as the sheet is before the call. Blocks that overlap are merged.
968
+ */
969
+ removeRowsMany(sheet: number, places: [number, number][]): void;
970
+ /**
971
+ * Removes a sheet. References to it from anywhere in the workbook become
972
+ * `#REF!`, the way Excel writes them, and the sheets after it shift down
973
+ * by one index.
974
+ */
975
+ removeSheet(sheet: number): void;
976
+ /**
977
+ * Removes a table by name. Answers whether there was one.
978
+ */
979
+ removeTable(sheet: number, name: string): boolean;
980
+ /**
981
+ * Renames a sheet.
982
+ */
983
+ renameSheet(sheet: number, title: string): void;
984
+ /**
985
+ * The height of a row in points, or `undefined` when the sheet leaves it
986
+ * to the default. `row` is the number a user sees.
987
+ */
988
+ rowHeight(sheet: number, row: number): number | undefined;
989
+ /**
990
+ * Whether a row is hidden. `row` is the number a user sees.
991
+ */
992
+ rowHidden(sheet: number, row: number): boolean;
993
+ /**
994
+ * How deeply a row is grouped: 0 when it is not, 1 for the outermost
995
+ * group, and so on. `row` is the number a user sees.
996
+ */
997
+ rowLevel(sheet: number, row: number): number;
998
+ /**
999
+ * Writes a value: a number, boolean, or string. A string starting with `=`
1000
+ * becomes a formula.
1001
+ */
1002
+ set(sheet: number, address: string, value: CellValue): void;
1003
+ /**
1004
+ * Sets that tab.
1005
+ */
1006
+ setActiveSheet(sheet: number): void;
1007
+ /**
1008
+ * The same by 1-based row and column.
1009
+ */
1010
+ setAt(sheet: number, row: number, column: number, value: CellValue): void;
1011
+ /**
1012
+ * Paints a cell: a number format, a font, a fill, borders, alignment, or
1013
+ * any part of those.
1014
+ *
1015
+ * The patch is laid over the style the cell has, so a field left out
1016
+ * keeps what was there - `{ font: { bold: true } }` does not reset the
1017
+ * number format. Equal styles share one entry in the workbook's table,
1018
+ * so painting a column costs one style, not one per cell.
1019
+ *
1020
+ * ```js
1021
+ * book.setCellStyle(0, "B2", {
1022
+ * numberFormat: "#,##0.00",
1023
+ * font: { bold: true, color: "#FF1F4E79" },
1024
+ * fill: { pattern: "solid", foreground: "#FFFFE699" },
1025
+ * alignment: { horizontal: "right" },
1026
+ * });
1027
+ * ```
1028
+ */
1029
+ setCellStyle(sheet: number, address: string, patch: CellStylePatch): void;
1030
+ /**
1031
+ * The same by 1-based row and column.
1032
+ */
1033
+ setCellStyleAt(sheet: number, row: number, column: number, patch: CellStylePatch): void;
1034
+ /**
1035
+ * Changes the fill and outline of a chart's chart area (`format`) and
1036
+ * plot area (`plotFormat`), by its position in `charts`; each takes
1037
+ * `{ fill, line }` as `setShapeFormat` does, or `null` to leave the area
1038
+ * to the chart style.
1039
+ */
1040
+ setChartFormat(sheet: number, index: number, patch: ChartFormatPatch): void;
1041
+ /**
1042
+ * Hides a column, or shows it again. `column` is 1-based.
1043
+ */
1044
+ setColumnHidden(sheet: number, column: number, hidden: boolean): void;
1045
+ /**
1046
+ * Sets the width of a column in characters of the default font, or gives
1047
+ * it back to the sheet default with `undefined`. `column` is 1-based.
1048
+ *
1049
+ * A run of columns that covered this one is split around it, so the
1050
+ * neighbours keep the width they had.
1051
+ */
1052
+ setColumnWidth(sheet: number, column: number, width?: number | null): void;
1053
+ /**
1054
+ * Puts a note on a cell, replacing any note already there.
1055
+ */
1056
+ setComment(sheet: number, address: string, author: string, text: string): void;
1057
+ /**
1058
+ * Defines a name, replacing one of the same name. `formula` is what it
1059
+ * stands for - `Sheet1!$A$1:$A$9` or a constant - and `sheet` makes the
1060
+ * name local to that sheet instead of the workbook.
1061
+ */
1062
+ setDefinedName(name: string, formula: string, sheet?: number | null): void;
1063
+ /**
1064
+ * Changes the fields the patch names and leaves the rest: a string sets
1065
+ * one, `null` clears it. `custom`, when given, replaces the list; a
1066
+ * field's type is taken from `type` or else from the value (a whole
1067
+ * number is an integer).
1068
+ */
1069
+ setDocumentProperties(patch: DocumentPropertiesPatch): void;
1070
+ /**
1071
+ * Puts a link over a cell or a block of them.
1072
+ *
1073
+ * `target` is a URL or a file path unless `inside` is true, and then it
1074
+ * is a place in this workbook: `'Sheet 2'!A1`.
1075
+ */
1076
+ setHyperlink(sheet: number, range: string, target: string, inside?: boolean | null, display?: string | null, tooltip?: string | null): void;
1077
+ /**
1078
+ * Writes a rectangle of values with `at` as its top-left corner. Rows may
1079
+ * differ in length; a `null` leaves its cell empty.
1080
+ */
1081
+ setRange(sheet: number, at: string, values: CellGrid): void;
1082
+ /**
1083
+ * The same with the corner given as 1-based row and column.
1084
+ */
1085
+ setRangeAt(sheet: number, row: number, column: number, values: CellGrid): void;
1086
+ /**
1087
+ * The same over a rectangle: `setRangeStyle(0, "A1:D1", { font: { bold:
1088
+ * true } })`. Cells the range covers but the sheet has no value for are
1089
+ * created empty, which is what carries the style.
1090
+ */
1091
+ setRangeStyle(sheet: number, range: string, patch: CellStylePatch): void;
1092
+ /**
1093
+ * Paints a rectangle cell by cell in one call, `at` its top-left corner:
1094
+ * `grid` points into `styles`, each a patch as `setCellStyle` takes it,
1095
+ * and `null` or `-1` leaves its cell alone. The output of
1096
+ * `getRangeStyles` goes back in unchanged, so a block's formatting can be
1097
+ * read, edited in JS and written back - or copied somewhere else.
1098
+ */
1099
+ setRangeStyles(sheet: number, at: string, styles: RangeStylesPatch): void;
1100
+ /**
1101
+ * The same with the corner given as 1-based row and column.
1102
+ */
1103
+ setRangeStylesAt(sheet: number, row: number, column: number, styles: RangeStylesPatch): void;
1104
+ /**
1105
+ * Writes formatted text: runs as `getRichText` returns them, each with
1106
+ * its own text and the part of the font it changes (`font` may be left
1107
+ * out or `null` for the cell's own).
1108
+ */
1109
+ setRichText(sheet: number, address: string, runs: TextRun[]): void;
1110
+ /**
1111
+ * The same by 1-based row and column.
1112
+ */
1113
+ setRichTextAt(sheet: number, row: number, column: number, runs: TextRun[]): void;
1114
+ /**
1115
+ * Sets the height of a row in points, or gives it back to the sheet
1116
+ * default with `undefined`. `row` is the number a user sees.
1117
+ */
1118
+ setRowHeight(sheet: number, row: number, height?: number | null): void;
1119
+ /**
1120
+ * Hides a row, or shows it again.
1121
+ */
1122
+ setRowHidden(sheet: number, row: number, hidden: boolean): void;
1123
+ /**
1124
+ * Changes how a shape looks, by its position in `shapes`:
1125
+ *
1126
+ * ```js
1127
+ * book.setShapeFormat(0, 2, {
1128
+ * fill: { type: "solid", color: "accent2" },
1129
+ * line: { width: 2 },
1130
+ * font: { bold: true, color: "#FFFFFFFF" },
1131
+ * rotation: 15,
1132
+ * });
1133
+ * ```
1134
+ *
1135
+ * `fill`, `line`, `font`, `rotation` (degrees clockwise), `flipH` and
1136
+ * `flipV`; a field left out stays as it was, `null` for `fill` or `line`
1137
+ * gives it back to the shape's style. A colour is `#RRGGBB`,
1138
+ * `#AARRGGBB` or a theme colour by name (`accent1`, `tx1`, `bg2`), which
1139
+ * follows the theme. The rest of the shape - effects, other runs, the
1140
+ * outline's dashes - stays in the file as it was.
1141
+ */
1142
+ setShapeFormat(sheet: number, index: number, patch: ShapeFormatPatch): void;
1143
+ /**
1144
+ * Gives a sheet a tab or takes it away: `"visible"`, `"hidden"` or
1145
+ * `"veryHidden"`.
1146
+ *
1147
+ * A very hidden sheet is not in the dialog Excel offers for unhiding one.
1148
+ * Either way the sheet keeps its index, which is what every other call
1149
+ * counts.
1150
+ */
1151
+ setSheetVisibility(sheet: number, state: string): void;
1152
+ /**
1153
+ * Shows or hides the grid lines, and the row and column headings with
1154
+ * `headers`.
1155
+ */
1156
+ setShowGridLines(sheet: number, show: boolean, headers?: boolean | null): void;
1157
+ /**
1158
+ * Filters a table by one of its columns, named by its header or
1159
+ * numbered from 1, and hides the data rows the table's criteria reject,
1160
+ * as Excel does. `null` takes the column's criterion off.
1161
+ *
1162
+ * ```js
1163
+ * book.setTableFilter("Sales", "Region", { values: ["South", "West"] });
1164
+ * book.setTableFilter("Sales", "Amount", { custom: [{ op: ">", value: 100 }] });
1165
+ * book.setTableFilter("Sales", 3, { top: 5 }); // or { bottom: 10, percent: true }
1166
+ * ```
1167
+ *
1168
+ * `values` keeps a row whose cell shows one of them, `blank: true` the
1169
+ * empty ones too; `custom` takes one or two comparisons (`=`, `<>`, `>`,
1170
+ * `>=`, `<`, `<=`; `*` and `?` in `=` and `<>`), joined by `or` unless
1171
+ * `and` is set. Criteria on several columns all have to hold.
1172
+ */
1173
+ setTableFilter(name: string, column: string | number, criteria: TableFilter | null): void;
1174
+ /**
1175
+ * The zoom a reader opens the sheet at, in percent; `undefined` gives it
1176
+ * back to 100.
1177
+ */
1178
+ setZoom(sheet: number, percent?: number | null): void;
1179
+ /**
1180
+ * The drawn shapes of a sheet, text and all, with the look Excel shows:
1181
+ * fill, outline and font are the shape's own with its style filling in
1182
+ * the rest, colours resolved through the workbook theme.
1183
+ */
1184
+ shapes(sheet: number): SheetShape[];
1185
+ /**
1186
+ * The tab index of a sheet by name, or `undefined` when there is none.
1187
+ * Names are compared the way Excel does, ignoring case.
1188
+ */
1189
+ sheetIndex(name: string): number | undefined;
1190
+ /**
1191
+ * Sheet titles, in tab order.
1192
+ */
1193
+ sheetNames(): string[];
1194
+ /**
1195
+ * Whether a sheet is locked, and whether the lock has a password.
1196
+ */
1197
+ sheetProtection(sheet: number): ProtectionInfo;
1198
+ /**
1199
+ * How the sheet is frozen and shown.
1200
+ */
1201
+ sheetView(sheet: number): SheetViewInfo;
1202
+ /**
1203
+ * Whether a sheet has a tab: `"visible"`, `"hidden"` or `"veryHidden"`.
1204
+ *
1205
+ * `sheetNames` lists every sheet, hidden ones included, because that is
1206
+ * what the index of every other call counts.
1207
+ */
1208
+ sheetVisibility(sheet: number): string;
1209
+ /**
1210
+ * Sorts the rows of a range, or its columns. A key is a column number of
1211
+ * the sheet, 1-based (a row number when sorting columns), or the text of
1212
+ * a header when `options.header` says the first line is one; a minus
1213
+ * sorts it largest first: `[2, -4]`, `["Region", "-Amount"]`. The first
1214
+ * key decides first.
1215
+ *
1216
+ * ```js
1217
+ * book.sortRange(0, "A1:D100", ["Region", "-Amount"], { header: true });
1218
+ * ```
1219
+ */
1220
+ sortRange(sheet: number, range: string, keys: SortKeys, options?: SortRangeOptions): void;
1221
+ /**
1222
+ * Sorts the data rows of a table, found by name anywhere in the book;
1223
+ * its header and totals rows stay put. Keys name its columns, as in
1224
+ * `sortRange`: `book.sortTable("Sales", ["-Amount"])`.
1225
+ */
1226
+ sortTable(name: string, keys: SortKeys): void;
1227
+ /**
1228
+ * The tables of a sheet: what a structured reference like `Sales[Amount]`
1229
+ * names.
1230
+ */
1231
+ tables(sheet: number): SheetTable[];
1232
+ /**
1233
+ * Splits the text of each cell in the first column of `range` across
1234
+ * the columns to its right, as Excel's Text to Columns does. Pieces that
1235
+ * read as numbers, booleans or errors become them. Returns how many
1236
+ * columns the widest row took.
1237
+ *
1238
+ * `options.delimiters` is a string of delimiter characters (`";"`,
1239
+ * `",\t"`), or `options.widths` the character positions to cut before
1240
+ * for fixed width; `mergeConsecutive` treats a run of delimiters as one,
1241
+ * `qualifier` is the quote (`"` unless given; `null` for none), and
1242
+ * `destination` is the first cell written (the range's own when left
1243
+ * out).
1244
+ *
1245
+ * ```js
1246
+ * book.textToColumns(0, "A2:A100", { delimiters: ";" });
1247
+ * book.textToColumns(0, "A2:A100", { widths: [4, 10], destination: "C2" });
1248
+ * ```
1249
+ */
1250
+ textToColumns(sheet: number, range: string, options: TextToColumnsOptions): number;
1251
+ /**
1252
+ * One sheet as CSV, comma-separated unless `options.delimiter` says
1253
+ * otherwise - a semicolon for a locale where the comma is the decimal
1254
+ * mark.
1255
+ */
1256
+ toCsv(sheet: number, options?: CsvOptions): string;
1257
+ /**
1258
+ * The workbook as an HTML page, or one sheet of it. `fragment` leaves out
1259
+ * the `<html>` wrapper, for embedding in a page that already has one.
1260
+ */
1261
+ toHtml(sheet?: number | null, fragment?: boolean | null): string;
1262
+ /**
1263
+ * The workbook as an `OpenDocument` spreadsheet.
1264
+ */
1265
+ toOds(): Uint8Array;
1266
+ /**
1267
+ * The workbook as a BIFF8 `.xls` file.
1268
+ *
1269
+ * Formulas are written as tokens with their cached result; what BIFF8
1270
+ * cannot hold - a structured reference, a row past 65536 - is written as
1271
+ * the value, so call `recalculate` first if the cache is stale.
1272
+ */
1273
+ toXls(): Uint8Array;
1274
+ /**
1275
+ * The workbook as an xlsx package.
1276
+ */
1277
+ toXlsx(on_progress?: Function | null): Uint8Array;
1278
+ /**
1279
+ * Takes a merge back out. Answers whether there was one.
1280
+ */
1281
+ unmerge(sheet: number, range: string): boolean;
1282
+ /**
1283
+ * Unlocks a sheet, password and all.
1284
+ */
1285
+ unprotectSheet(sheet: number): void;
1286
+ /**
1287
+ * Unlocks the workbook.
1288
+ */
1289
+ unprotectWorkbook(): void;
1290
+ /**
1291
+ * Forgets a function registered earlier; answers whether there was one.
1292
+ */
1293
+ unregisterFunction(name: string): boolean;
1294
+ /**
1295
+ * The used range of a sheet as `A1:D9`, or `undefined` if it holds
1296
+ * nothing. This is the rectangle to walk; the sheet itself is sparse.
1297
+ */
1298
+ usedRange(sheet: number): string | undefined;
1299
+ /**
1300
+ * The used range of a sheet as `"A1:D20"` without walking the rows;
1301
+ * `undefined` for an empty sheet.
1302
+ *
1303
+ * Rows are exact, columns an upper bound: removing a cell never narrows
1304
+ * them. `usedRange` answers the same until a cell in an edge column is
1305
+ * removed, and walks the rows after that to give the exact rectangle.
1306
+ */
1307
+ usedRangeHint(sheet: number): string | undefined;
1308
+ /**
1309
+ * The choices of the drop-down list on a cell, as Excel shows them; an
1310
+ * empty array when the cell has no list rule.
1311
+ */
1312
+ validationList(sheet: number, address: string): string[];
1313
+ /**
1314
+ * Whether that password unlocks the sheet. `false` for a sheet with no
1315
+ * password on it, and for a hash this crate cannot check.
1316
+ */
1317
+ verifySheetPassword(sheet: number, password: string): boolean;
1318
+ /**
1319
+ * Whether the workbook's structure is locked, and whether behind a
1320
+ * password.
1321
+ */
1322
+ workbookProtection(): ProtectionInfo;
1323
+ }
1324
+
1325
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
1326
+
1327
+ export interface InitOutput {
1328
+ readonly memory: WebAssembly.Memory;
1329
+ readonly __wbg_book_free: (a: number, b: number) => void;
1330
+ readonly book_activeSheet: (a: number) => number;
1331
+ readonly book_addDataValidation: (a: number, b: number, c: any) => [number, number];
1332
+ readonly book_addSheet: (a: number, b: number, c: number) => [number, number, number];
1333
+ readonly book_addTable: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
1334
+ readonly book_arrayFormulas: (a: number, b: number) => [number, number, number, number];
1335
+ readonly book_autoFilter: (a: number, b: number) => [number, number, number];
1336
+ readonly book_cellBold: (a: number, b: number, c: number, d: number) => [number, number, number];
1337
+ readonly book_cellBoldAt: (a: number, b: number, c: number, d: number) => [number, number, number];
1338
+ readonly book_cellCount: (a: number, b: number) => number;
1339
+ readonly book_cellIndent: (a: number, b: number, c: number, d: number) => [number, number, number];
1340
+ readonly book_cellIndentAt: (a: number, b: number, c: number, d: number) => [number, number, number];
1341
+ readonly book_cellStyle: (a: number, b: number, c: number, d: number) => [number, number, number];
1342
+ readonly book_cellStyleAt: (a: number, b: number, c: number, d: number) => [number, number, number];
1343
+ readonly book_charts: (a: number, b: number) => [number, number, number];
1344
+ readonly book_checkValidation: (a: number, b: number, c: number, d: number, e: any) => [number, number, number];
1345
+ readonly book_clear: (a: number, b: number, c: number, d: number) => [number, number];
1346
+ readonly book_clearAt: (a: number, b: number, c: number, d: number) => [number, number];
1347
+ readonly book_columnLevel: (a: number, b: number, c: number, d: number) => [number, number, number];
1348
+ readonly book_columnWidth: (a: number, b: number, c: number) => [number, number, number, number];
1349
+ readonly book_comments: (a: number, b: number) => [number, number, number];
1350
+ readonly book_conditionalFormats: (a: number, b: number) => [number, number, number];
1351
+ readonly book_copyRange: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
1352
+ readonly book_dataValidations: (a: number, b: number) => [number, number, number];
1353
+ readonly book_definedNames: (a: number) => any;
1354
+ readonly book_documentProperties: (a: number) => any;
1355
+ readonly book_evaluate: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
1356
+ readonly book_externalBooks: (a: number) => [number, number];
1357
+ readonly book_fillDown: (a: number, b: number, c: number, d: number) => [number, number];
1358
+ readonly book_fillRight: (a: number, b: number, c: number, d: number) => [number, number];
1359
+ readonly book_fillSeries: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
1360
+ readonly book_forEachRow: (a: number, b: number, c: number, d: number, e: number, f: any, g: number) => [number, number, number];
1361
+ readonly book_freezePanes: (a: number, b: number, c: number, d: number) => [number, number];
1362
+ readonly book_get: (a: number, b: number, c: number, d: number) => [number, number, number];
1363
+ readonly book_getAt: (a: number, b: number, c: number, d: number) => [number, number, number];
1364
+ readonly book_getFormatted: (a: number, b: number, c: number, d: number) => [number, number, number, number];
1365
+ readonly book_getFormattedAt: (a: number, b: number, c: number, d: number) => [number, number, number, number];
1366
+ readonly book_getFormula: (a: number, b: number, c: number, d: number) => [number, number];
1367
+ readonly book_getFormulaAt: (a: number, b: number, c: number, d: number) => [number, number];
1368
+ readonly book_getRange: (a: number, b: number, c: number, d: number) => [number, number, number];
1369
+ readonly book_getRangeAt: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
1370
+ readonly book_getRangeStyles: (a: number, b: number, c: number, d: number) => [number, number, number];
1371
+ readonly book_getRangeStylesAt: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
1372
+ readonly book_getRichText: (a: number, b: number, c: number, d: number) => [number, number, number];
1373
+ readonly book_getRichTextAt: (a: number, b: number, c: number, d: number) => [number, number, number];
1374
+ readonly book_getRowAt: (a: number, b: number, c: number, d: number) => [number, number, number];
1375
+ readonly book_goalSeek: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: any) => [number, number, number];
1376
+ readonly book_hyperlinks: (a: number, b: number) => [number, number, number];
1377
+ readonly book_imageData: (a: number, b: number, c: number) => [number, number, number, number];
1378
+ readonly book_images: (a: number, b: number) => [number, number, number];
1379
+ readonly book_insertCells: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number];
1380
+ readonly book_insertColumns: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
1381
+ readonly book_insertColumnsMany: (a: number, b: number, c: any, d: number, e: number) => [number, number];
1382
+ readonly book_insertRows: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
1383
+ readonly book_insertRowsMany: (a: number, b: number, c: any, d: number, e: number) => [number, number];
1384
+ readonly book_invalidCells: (a: number, b: number) => [number, number, number, number];
1385
+ readonly book_merge: (a: number, b: number, c: number, d: number) => [number, number];
1386
+ readonly book_mergedRanges: (a: number, b: number) => [number, number, number, number];
1387
+ readonly book_mergedRangesAt: (a: number, b: number) => [number, number, number];
1388
+ readonly book_moveRange: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
1389
+ readonly book_moveSheet: (a: number, b: number, c: number) => [number, number];
1390
+ readonly book_new: () => number;
1391
+ readonly book_pivotTables: (a: number, b: number) => [number, number, number];
1392
+ readonly book_protectSheet: (a: number, b: number, c: number, d: number) => [number, number];
1393
+ readonly book_protectWorkbook: (a: number, b: number, c: number, d: number) => [number, number];
1394
+ readonly book_read: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
1395
+ readonly book_readCsv: (a: number, b: number, c: any) => [number, number, number];
1396
+ readonly book_recalculate: (a: number, b: number, c: number) => number;
1397
+ readonly book_recalculateCell: (a: number, b: number, c: number, d: number) => [number, number, number];
1398
+ readonly book_recalculateCellAt: (a: number, b: number, c: number, d: number) => [number, number, number];
1399
+ readonly book_recalculateFrom: (a: number, b: number, c: number, d: number) => [number, number, number];
1400
+ readonly book_recalculateFromAt: (a: number, b: number, c: number, d: number) => [number, number, number];
1401
+ readonly book_recalculateFromMany: (a: number, b: number, c: number, d: number) => [number, number, number];
1402
+ readonly book_registerFunction: (a: number, b: number, c: number, d: any) => void;
1403
+ readonly book_registeredFunctions: (a: number) => [number, number];
1404
+ readonly book_removeCells: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
1405
+ readonly book_removeColumns: (a: number, b: number, c: number, d: number) => [number, number];
1406
+ readonly book_removeColumnsMany: (a: number, b: number, c: any) => [number, number];
1407
+ readonly book_removeComment: (a: number, b: number, c: number, d: number) => [number, number, number];
1408
+ readonly book_removeDefinedName: (a: number, b: number, c: number, d: number) => number;
1409
+ readonly book_removeDuplicates: (a: number, b: number, c: number, d: number, e: any) => [number, number, number];
1410
+ readonly book_removeHyperlink: (a: number, b: number, c: number, d: number) => [number, number, number];
1411
+ readonly book_removeRows: (a: number, b: number, c: number, d: number) => [number, number];
1412
+ readonly book_removeRowsMany: (a: number, b: number, c: any) => [number, number];
1413
+ readonly book_removeSheet: (a: number, b: number) => [number, number];
1414
+ readonly book_removeTable: (a: number, b: number, c: number, d: number) => [number, number, number];
1415
+ readonly book_renameSheet: (a: number, b: number, c: number, d: number) => [number, number];
1416
+ readonly book_rowHeight: (a: number, b: number, c: number) => [number, number, number, number];
1417
+ readonly book_rowHidden: (a: number, b: number, c: number) => [number, number, number];
1418
+ readonly book_rowLevel: (a: number, b: number, c: number) => [number, number, number];
1419
+ readonly book_set: (a: number, b: number, c: number, d: number, e: any) => [number, number];
1420
+ readonly book_setActiveSheet: (a: number, b: number) => [number, number];
1421
+ readonly book_setAt: (a: number, b: number, c: number, d: number, e: any) => [number, number];
1422
+ readonly book_setCellStyle: (a: number, b: number, c: number, d: number, e: any) => [number, number];
1423
+ readonly book_setCellStyleAt: (a: number, b: number, c: number, d: number, e: any) => [number, number];
1424
+ readonly book_setChartFormat: (a: number, b: number, c: number, d: any) => [number, number];
1425
+ readonly book_setColumnHidden: (a: number, b: number, c: number, d: number) => [number, number];
1426
+ readonly book_setColumnWidth: (a: number, b: number, c: number, d: number, e: number) => [number, number];
1427
+ readonly book_setComment: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number];
1428
+ readonly book_setDefinedName: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
1429
+ readonly book_setDocumentProperties: (a: number, b: any) => [number, number];
1430
+ readonly book_setHyperlink: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number];
1431
+ readonly book_setRange: (a: number, b: number, c: number, d: number, e: any) => [number, number];
1432
+ readonly book_setRangeAt: (a: number, b: number, c: number, d: number, e: any) => [number, number];
1433
+ readonly book_setRangeStyle: (a: number, b: number, c: number, d: number, e: any) => [number, number];
1434
+ readonly book_setRangeStyles: (a: number, b: number, c: number, d: number, e: any) => [number, number];
1435
+ readonly book_setRangeStylesAt: (a: number, b: number, c: number, d: number, e: any) => [number, number];
1436
+ readonly book_setRichText: (a: number, b: number, c: number, d: number, e: any) => [number, number];
1437
+ readonly book_setRichTextAt: (a: number, b: number, c: number, d: number, e: any) => [number, number];
1438
+ readonly book_setRowHeight: (a: number, b: number, c: number, d: number, e: number) => [number, number];
1439
+ readonly book_setRowHidden: (a: number, b: number, c: number, d: number) => [number, number];
1440
+ readonly book_setShapeFormat: (a: number, b: number, c: number, d: any) => [number, number];
1441
+ readonly book_setSheetVisibility: (a: number, b: number, c: number, d: number) => [number, number];
1442
+ readonly book_setShowGridLines: (a: number, b: number, c: number, d: number) => [number, number];
1443
+ readonly book_setTableFilter: (a: number, b: number, c: number, d: any, e: any) => [number, number];
1444
+ readonly book_setZoom: (a: number, b: number, c: number) => [number, number];
1445
+ readonly book_shapes: (a: number, b: number) => [number, number, number];
1446
+ readonly book_sheetIndex: (a: number, b: number, c: number) => number;
1447
+ readonly book_sheetNames: (a: number) => [number, number];
1448
+ readonly book_sheetProtection: (a: number, b: number) => [number, number, number];
1449
+ readonly book_sheetView: (a: number, b: number) => [number, number, number];
1450
+ readonly book_sheetVisibility: (a: number, b: number) => [number, number, number, number];
1451
+ readonly book_sortRange: (a: number, b: number, c: number, d: number, e: any, f: any) => [number, number];
1452
+ readonly book_sortTable: (a: number, b: number, c: number, d: any) => [number, number];
1453
+ readonly book_tables: (a: number, b: number) => [number, number, number];
1454
+ readonly book_textToColumns: (a: number, b: number, c: number, d: number, e: any) => [number, number, number];
1455
+ readonly book_toCsv: (a: number, b: number, c: any) => [number, number, number, number];
1456
+ readonly book_toHtml: (a: number, b: number, c: number) => [number, number, number, number];
1457
+ readonly book_toOds: (a: number) => [number, number, number, number];
1458
+ readonly book_toXls: (a: number) => [number, number, number, number];
1459
+ readonly book_toXlsx: (a: number, b: number) => [number, number, number, number];
1460
+ readonly book_unmerge: (a: number, b: number, c: number, d: number) => [number, number, number];
1461
+ readonly book_unprotectSheet: (a: number, b: number) => [number, number];
1462
+ readonly book_unprotectWorkbook: (a: number) => void;
1463
+ readonly book_unregisterFunction: (a: number, b: number, c: number) => number;
1464
+ readonly book_usedRange: (a: number, b: number) => [number, number];
1465
+ readonly book_usedRangeHint: (a: number, b: number) => [number, number, number, number];
1466
+ readonly book_validationList: (a: number, b: number, c: number, d: number) => [number, number, number, number];
1467
+ readonly book_verifySheetPassword: (a: number, b: number, c: number, d: number) => [number, number, number];
1468
+ readonly book_workbookProtection: (a: number) => any;
1469
+ readonly rust_zstd_wasm_shim_calloc: (a: number, b: number) => number;
1470
+ readonly rust_zstd_wasm_shim_free: (a: number) => void;
1471
+ readonly rust_zstd_wasm_shim_malloc: (a: number) => number;
1472
+ readonly rust_zstd_wasm_shim_memcmp: (a: number, b: number, c: number) => number;
1473
+ readonly rust_zstd_wasm_shim_memcpy: (a: number, b: number, c: number) => number;
1474
+ readonly rust_zstd_wasm_shim_memmove: (a: number, b: number, c: number) => number;
1475
+ readonly rust_zstd_wasm_shim_memset: (a: number, b: number, c: number) => number;
1476
+ readonly rust_zstd_wasm_shim_qsort: (a: number, b: number, c: number, d: number) => void;
1477
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
1478
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
1479
+ readonly __wbindgen_exn_store: (a: number) => void;
1480
+ readonly __externref_table_alloc: () => number;
1481
+ readonly __wbindgen_externrefs: WebAssembly.Table;
1482
+ readonly __externref_table_dealloc: (a: number) => void;
1483
+ readonly __externref_drop_slice: (a: number, b: number) => void;
1484
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
1485
+ readonly __wbindgen_start: () => void;
1486
+ }
1487
+
1488
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
1489
+
1490
+ /**
1491
+ * Instantiates the given `module`, which can either be bytes or
1492
+ * a precompiled `WebAssembly.Module`.
1493
+ *
1494
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
1495
+ *
1496
+ * @returns {InitOutput}
1497
+ */
1498
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
1499
+
1500
+ /**
1501
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
1502
+ * for everything else, calls `WebAssembly.instantiate` directly.
1503
+ *
1504
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
1505
+ *
1506
+ * @returns {Promise<InitOutput>}
1507
+ */
1508
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;