@rosperitus/excelerate 0.15.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.
package/README.md CHANGED
@@ -74,6 +74,23 @@ book.setRange(0, "F1", [["Jan", "Кв1", 1], [null, null, 3]]);
74
74
  book.fillSeries(0, "F1:H6", "down"); // Feb..Jun, Кв2..Кв6, 5, 7, 9, 11
75
75
  ```
76
76
 
77
+ Clean up imported data, then ask what input reaches a target:
78
+
79
+ ```ts
80
+ import { Book } from "@rosperitus/excelerate";
81
+
82
+ const book = new Book();
83
+ book.setRange(0, "A1", [["Ann;41"], ["Bob;37"], ["ann;41"]]);
84
+ book.textToColumns(0, "A1:A3", { delimiters: ";" }); // Ann | 41 ...
85
+ book.removeDuplicates(0, "A1:B3"); // { removed: 1, remaining: 2 }
86
+
87
+ book.setRange(0, "D1", [[0.01, "=PMT(D1,36,-10000)"]]);
88
+ const { value } = book.goalSeek(0, "E1", 300, "D1"); // the monthly rate: 0.0042...
89
+
90
+ book.addDataValidation(0, { sqref: "B1:B100", type: "whole", formula1: "18", formula2: "99" });
91
+ book.checkValidation(0, "B5", 12); // { style: "stop", ... }
92
+ ```
93
+
77
94
  ## In the browser
78
95
 
79
96
  The package carries a second build for browsers and bundlers (Vite, webpack,
@@ -259,6 +276,14 @@ class Book {
259
276
  fillRight(sheet: number, range: string): void;
260
277
  fillSeries(sheet: number, range: string, direction: "down" | "right" | "up" | "left"): void;
261
278
 
279
+ // Data tools, as Excel's Remove Duplicates, Text to Columns and Data Validation
280
+ removeDuplicates(sheet: number, range: string, options?: RemoveDuplicatesOptions): DuplicatesRemoved;
281
+ textToColumns(sheet: number, range: string, options: TextToColumnsOptions): number;
282
+ addDataValidation(sheet: number, rule: NewDataValidation): void;
283
+ checkValidation(sheet: number, address: string, value: CellValue): ValidationProblem | null;
284
+ invalidCells(sheet: number): string[]; // Circle Invalid Data
285
+ validationList(sheet: number, address: string): string[]; // a drop-down's choices
286
+
262
287
  // What is on a sheet besides cells
263
288
  comments(sheet: number): SheetComment[];
264
289
  hyperlinks(sheet: number): SheetHyperlink[];
@@ -328,6 +353,7 @@ class Book {
328
353
  recalculateCell(sheet: number, address: string): boolean;
329
354
  recalculateFrom(sheet: number, address: string): number;
330
355
  recalculateFromMany(sheet: number, addresses: string[]): number;
356
+ goalSeek(sheet: number, set: string, target: number, changing: string, options?: GoalSeekOptions): GoalSeekResult;
331
357
 
332
358
  // Functions of your own, for names no built-in claims
333
359
  registerFunction(name: string, fn: (...args: (CellValue | CellGrid)[]) => CellValue | CellGrid): void;
package/excelerate.d.ts CHANGED
@@ -109,6 +109,57 @@ export interface ChartFormatPatch {
109
109
  format?: DrawingFormatPatch | null;
110
110
  plotFormat?: DrawingFormatPatch | null;
111
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
+ }
112
163
 
113
164
 
114
165
 
@@ -361,6 +412,31 @@ export interface RangeStyles {
361
412
  styles: CellStyle[];
362
413
  grid: number[][];
363
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
+ }
364
440
 
365
441
 
366
442
 
@@ -374,6 +450,20 @@ export class Book {
374
450
  * The tab a reader opens the workbook on.
375
451
  */
376
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;
377
467
  /**
378
468
  * Appends a sheet and returns its index.
379
469
  */
@@ -441,6 +531,17 @@ export class Book {
441
531
  * `barChart`, `lineChart` - and a combination chart has more than one.
442
532
  */
443
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;
444
545
  /**
445
546
  * Empties a cell, style and all.
446
547
  */
@@ -610,6 +711,19 @@ export class Book {
610
711
  * `null`; `getFormattedAt` still answers for the cells that need it.
611
712
  */
612
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;
613
727
  /**
614
728
  * The hyperlinks of a sheet. `external` tells a URL from a jump inside
615
729
  * the workbook.
@@ -662,6 +776,11 @@ export class Book {
662
776
  * subtotal rows into forty thousand take milliseconds, not a minute.
663
777
  */
664
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[];
665
784
  /**
666
785
  * Merges a block of cells: `merge(0, "A1:C1")`.
667
786
  */
@@ -821,6 +940,19 @@ export class Book {
821
940
  * Removes a defined name. Answers whether there was one.
822
941
  */
823
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;
824
956
  /**
825
957
  * Takes the link off a range. Answers whether there was one.
826
958
  */
@@ -1097,6 +1229,25 @@ export class Book {
1097
1229
  * names.
1098
1230
  */
1099
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;
1100
1251
  /**
1101
1252
  * One sheet as CSV, comma-separated unless `options.delimiter` says
1102
1253
  * otherwise - a semicolon for a locale where the comma is the decimal
@@ -1154,6 +1305,11 @@ export class Book {
1154
1305
  * removed, and walks the rows after that to give the exact rectangle.
1155
1306
  */
1156
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[];
1157
1313
  /**
1158
1314
  * Whether that password unlocks the sheet. `false` for a sheet with no
1159
1315
  * password on it, and for a hash this crate cannot check.
package/excelerate.js CHANGED
@@ -28,6 +28,27 @@ class Book {
28
28
  const ret = wasm.book_activeSheet(this.__wbg_ptr);
29
29
  return ret >>> 0;
30
30
  }
31
+ /**
32
+ * Adds a data validation rule to a sheet, as Data - Data Validation
33
+ * does: `type` is `"whole"`, `"decimal"`, `"list"`, `"date"`, `"time"`,
34
+ * `"textLength"` or `"custom"`, `operator` one of `"between"` (the
35
+ * default), `"notBetween"`, `"equal"`, `"notEqual"`, `"greaterThan"`,
36
+ * `"lessThan"`, `"greaterThanOrEqual"`, `"lessThanOrEqual"`. Formulas are
37
+ * written for the first cell of `sqref`; a list is `"\"Yes,No\""` or a
38
+ * range such as `"$E$1:$E$5"`.
39
+ *
40
+ * ```js
41
+ * book.addDataValidation(0, { sqref: "B2:B100", type: "list", formula1: "\"Yes,No\"" });
42
+ * ```
43
+ * @param {number} sheet
44
+ * @param {NewDataValidation} rule
45
+ */
46
+ addDataValidation(sheet, rule) {
47
+ const ret = wasm.book_addDataValidation(this.__wbg_ptr, sheet, rule);
48
+ if (ret[1]) {
49
+ throw takeFromExternrefTable0(ret[0]);
50
+ }
51
+ }
31
52
  /**
32
53
  * Appends a sheet and returns its index.
33
54
  * @param {string} title
@@ -212,6 +233,29 @@ class Book {
212
233
  }
213
234
  return takeFromExternrefTable0(ret[0]);
214
235
  }
236
+ /**
237
+ * Whether `value` would be accepted in a cell under its data validation
238
+ * rule: `null` when it would (or there is no rule), otherwise what Excel
239
+ * would report, `{ style, title, message, sqref }`.
240
+ *
241
+ * ```js
242
+ * const problem = book.checkValidation(0, "B5", 150);
243
+ * if (problem) alert(problem.message || "Not allowed");
244
+ * ```
245
+ * @param {number} sheet
246
+ * @param {string} address
247
+ * @param {CellValue} value
248
+ * @returns {ValidationProblem | null}
249
+ */
250
+ checkValidation(sheet, address, value) {
251
+ const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
252
+ const len0 = WASM_VECTOR_LEN;
253
+ const ret = wasm.book_checkValidation(this.__wbg_ptr, sheet, ptr0, len0, value);
254
+ if (ret[2]) {
255
+ throw takeFromExternrefTable0(ret[1]);
256
+ }
257
+ return takeFromExternrefTable0(ret[0]);
258
+ }
215
259
  /**
216
260
  * Empties a cell, style and all.
217
261
  * @param {number} sheet
@@ -703,6 +747,35 @@ class Book {
703
747
  }
704
748
  return takeFromExternrefTable0(ret[0]);
705
749
  }
750
+ /**
751
+ * Finds the value of `changing` that makes the formula in `set` compute
752
+ * `target`, as Excel's Goal Seek does, both cells on `sheet`. The best
753
+ * value found is left in `changing` and what reads it is recomputed.
754
+ * `options.maxIterations` and `options.tolerance` default to the
755
+ * workbook's own iteration settings (100 and 0.001 unless it says
756
+ * otherwise). Returns `{ value, result, iterations, converged }`.
757
+ *
758
+ * ```js
759
+ * const { value, converged } = book.goalSeek(0, "B4", 300, "B1");
760
+ * ```
761
+ * @param {number} sheet
762
+ * @param {string} set
763
+ * @param {number} target
764
+ * @param {string} changing
765
+ * @param {GoalSeekOptions} [options]
766
+ * @returns {GoalSeekResult}
767
+ */
768
+ goalSeek(sheet, set, target, changing, options) {
769
+ const ptr0 = passStringToWasm0(set, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
770
+ const len0 = WASM_VECTOR_LEN;
771
+ const ptr1 = passStringToWasm0(changing, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
772
+ const len1 = WASM_VECTOR_LEN;
773
+ const ret = wasm.book_goalSeek(this.__wbg_ptr, sheet, ptr0, len0, target, ptr1, len1, options);
774
+ if (ret[2]) {
775
+ throw takeFromExternrefTable0(ret[1]);
776
+ }
777
+ return takeFromExternrefTable0(ret[0]);
778
+ }
706
779
  /**
707
780
  * The hyperlinks of a sheet. `external` tells a URL from a jump inside
708
781
  * the workbook.
@@ -839,6 +912,21 @@ class Book {
839
912
  throw takeFromExternrefTable0(ret[0]);
840
913
  }
841
914
  }
915
+ /**
916
+ * The cells of a sheet whose values break their data validation rule,
917
+ * as Excel's Circle Invalid Data finds them: `["B3", "B9"]`.
918
+ * @param {number} sheet
919
+ * @returns {string[]}
920
+ */
921
+ invalidCells(sheet) {
922
+ const ret = wasm.book_invalidCells(this.__wbg_ptr, sheet);
923
+ if (ret[3]) {
924
+ throw takeFromExternrefTable0(ret[2]);
925
+ }
926
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]);
927
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
928
+ return v1;
929
+ }
842
930
  /**
843
931
  * Merges a block of cells: `merge(0, "A1:C1")`.
844
932
  * @param {number} sheet
@@ -1222,6 +1310,31 @@ class Book {
1222
1310
  const ret = wasm.book_removeDefinedName(this.__wbg_ptr, ptr0, len0, isLikeNone(sheet) ? Number.MAX_SAFE_INTEGER : (sheet) >>> 0);
1223
1311
  return ret !== 0;
1224
1312
  }
1313
+ /**
1314
+ * Removes the rows of a range that repeat a row above them, as Excel's
1315
+ * Remove Duplicates does: cells are compared by the text they show,
1316
+ * without regard to case. `options.columns` are the 1-based sheet
1317
+ * columns compared (all of the range when left out), and
1318
+ * `options.header` keeps the first row out of it. Returns
1319
+ * `{ removed, remaining }`.
1320
+ *
1321
+ * ```js
1322
+ * book.removeDuplicates(0, "A1:C500", { columns: [1, 3], header: true });
1323
+ * ```
1324
+ * @param {number} sheet
1325
+ * @param {string} range
1326
+ * @param {RemoveDuplicatesOptions} [options]
1327
+ * @returns {DuplicatesRemoved}
1328
+ */
1329
+ removeDuplicates(sheet, range, options) {
1330
+ const ptr0 = passStringToWasm0(range, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1331
+ const len0 = WASM_VECTOR_LEN;
1332
+ const ret = wasm.book_removeDuplicates(this.__wbg_ptr, sheet, ptr0, len0, options);
1333
+ if (ret[2]) {
1334
+ throw takeFromExternrefTable0(ret[1]);
1335
+ }
1336
+ return takeFromExternrefTable0(ret[0]);
1337
+ }
1225
1338
  /**
1226
1339
  * Takes the link off a range. Answers whether there was one.
1227
1340
  * @param {number} sheet
@@ -1906,6 +2019,37 @@ class Book {
1906
2019
  }
1907
2020
  return takeFromExternrefTable0(ret[0]);
1908
2021
  }
2022
+ /**
2023
+ * Splits the text of each cell in the first column of `range` across
2024
+ * the columns to its right, as Excel's Text to Columns does. Pieces that
2025
+ * read as numbers, booleans or errors become them. Returns how many
2026
+ * columns the widest row took.
2027
+ *
2028
+ * `options.delimiters` is a string of delimiter characters (`";"`,
2029
+ * `",\t"`), or `options.widths` the character positions to cut before
2030
+ * for fixed width; `mergeConsecutive` treats a run of delimiters as one,
2031
+ * `qualifier` is the quote (`"` unless given; `null` for none), and
2032
+ * `destination` is the first cell written (the range's own when left
2033
+ * out).
2034
+ *
2035
+ * ```js
2036
+ * book.textToColumns(0, "A2:A100", { delimiters: ";" });
2037
+ * book.textToColumns(0, "A2:A100", { widths: [4, 10], destination: "C2" });
2038
+ * ```
2039
+ * @param {number} sheet
2040
+ * @param {string} range
2041
+ * @param {TextToColumnsOptions} options
2042
+ * @returns {number}
2043
+ */
2044
+ textToColumns(sheet, range, options) {
2045
+ const ptr0 = passStringToWasm0(range, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2046
+ const len0 = WASM_VECTOR_LEN;
2047
+ const ret = wasm.book_textToColumns(this.__wbg_ptr, sheet, ptr0, len0, options);
2048
+ if (ret[2]) {
2049
+ throw takeFromExternrefTable0(ret[1]);
2050
+ }
2051
+ return ret[0] >>> 0;
2052
+ }
1909
2053
  /**
1910
2054
  * One sheet as CSV, comma-separated unless `options.delimiter` says
1911
2055
  * otherwise - a semicolon for a locale where the comma is the decimal
@@ -2080,6 +2224,24 @@ class Book {
2080
2224
  }
2081
2225
  return v1;
2082
2226
  }
2227
+ /**
2228
+ * The choices of the drop-down list on a cell, as Excel shows them; an
2229
+ * empty array when the cell has no list rule.
2230
+ * @param {number} sheet
2231
+ * @param {string} address
2232
+ * @returns {string[]}
2233
+ */
2234
+ validationList(sheet, address) {
2235
+ const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2236
+ const len0 = WASM_VECTOR_LEN;
2237
+ const ret = wasm.book_validationList(this.__wbg_ptr, sheet, ptr0, len0);
2238
+ if (ret[3]) {
2239
+ throw takeFromExternrefTable0(ret[2]);
2240
+ }
2241
+ var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]);
2242
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2243
+ return v2;
2244
+ }
2083
2245
  /**
2084
2246
  * Whether that password unlocks the sheet. `false` for a sheet with no
2085
2247
  * password on it, and for a hash this crate cannot check.
Binary file
package/index.d.ts CHANGED
@@ -110,30 +110,32 @@ export declare class SheetRange {
110
110
  * `sheet.setColumnWidth(2, 14).setRowHidden(5, true).getRange("A1:C3")`.
111
111
  */
112
112
  type SheetActionName =
113
- | "clear" | "clearAt" | "copyRange" | "fillDown" | "fillRight" | "fillSeries"
114
- | "freezePanes" | "insertCells" | "insertColumns" | "insertColumnsMany"
115
- | "insertRows" | "insertRowsMany" | "merge" | "moveRange" | "protectSheet"
116
- | "removeCells" | "removeColumns" | "removeColumnsMany" | "removeRows"
117
- | "removeRowsMany" | "set" | "setAt" | "setCellStyle" | "setCellStyleAt"
118
- | "setChartFormat" | "setColumnHidden" | "setColumnWidth" | "setComment"
119
- | "setHyperlink" | "setRange" | "setRangeAt" | "setRangeStyle"
120
- | "setRangeStyles" | "setRangeStylesAt" | "setRichText" | "setRichTextAt"
121
- | "setRowHeight" | "setRowHidden" | "setShapeFormat" | "setSheetVisibility"
122
- | "setShowGridLines" | "setZoom" | "sortRange" | "unprotectSheet";
113
+ | "addDataValidation" | "clear" | "clearAt" | "copyRange" | "fillDown"
114
+ | "fillRight" | "fillSeries" | "freezePanes" | "insertCells" | "insertColumns"
115
+ | "insertColumnsMany" | "insertRows" | "insertRowsMany" | "merge"
116
+ | "moveRange" | "protectSheet" | "removeCells" | "removeColumns"
117
+ | "removeColumnsMany" | "removeRows" | "removeRowsMany" | "set" | "setAt"
118
+ | "setCellStyle" | "setCellStyleAt" | "setChartFormat" | "setColumnHidden"
119
+ | "setColumnWidth" | "setComment" | "setHyperlink" | "setRange" | "setRangeAt"
120
+ | "setRangeStyle" | "setRangeStyles" | "setRangeStylesAt" | "setRichText"
121
+ | "setRichTextAt" | "setRowHeight" | "setRowHidden" | "setShapeFormat"
122
+ | "setSheetVisibility" | "setShowGridLines" | "setZoom" | "sortRange"
123
+ | "unprotectSheet";
123
124
  type SheetQueryName =
124
125
  | "arrayFormulas" | "autoFilter" | "cellBold" | "cellBoldAt" | "cellCount"
125
126
  | "cellIndent" | "cellIndentAt" | "cellStyle" | "cellStyleAt" | "charts"
126
- | "columnLevel" | "columnWidth" | "comments" | "conditionalFormats"
127
- | "dataValidations" | "evaluate" | "get" | "getAt" | "getFormatted"
128
- | "getFormattedAt" | "getFormula" | "getFormulaAt" | "getRange" | "getRangeAt"
129
- | "getRangeStyles" | "getRangeStylesAt" | "getRichText" | "getRichTextAt"
130
- | "getRowAt" | "hyperlinks" | "imageData" | "images" | "mergedRanges"
131
- | "mergedRangesAt" | "pivotTables" | "recalculateCell" | "recalculateCellAt"
132
- | "recalculateFrom" | "recalculateFromAt" | "recalculateFromMany"
133
- | "removeComment" | "removeHyperlink" | "removeTable" | "rowHeight"
127
+ | "checkValidation" | "columnLevel" | "columnWidth" | "comments"
128
+ | "conditionalFormats" | "dataValidations" | "evaluate" | "get" | "getAt"
129
+ | "getFormatted" | "getFormattedAt" | "getFormula" | "getFormulaAt"
130
+ | "getRange" | "getRangeAt" | "getRangeStyles" | "getRangeStylesAt"
131
+ | "getRichText" | "getRichTextAt" | "getRowAt" | "goalSeek" | "hyperlinks"
132
+ | "imageData" | "images" | "invalidCells" | "mergedRanges" | "mergedRangesAt"
133
+ | "pivotTables" | "recalculateCell" | "recalculateCellAt" | "recalculateFrom"
134
+ | "recalculateFromAt" | "recalculateFromMany" | "removeComment"
135
+ | "removeDuplicates" | "removeHyperlink" | "removeTable" | "rowHeight"
134
136
  | "rowHidden" | "rowLevel" | "shapes" | "sheetProtection" | "sheetView"
135
- | "sheetVisibility" | "toCsv" | "toHtml" | "unmerge" | "usedRange"
136
- | "usedRangeHint" | "verifySheetPassword";
137
+ | "sheetVisibility" | "textToColumns" | "toCsv" | "toHtml" | "unmerge"
138
+ | "usedRange" | "usedRangeHint" | "validationList" | "verifySheetPassword";
137
139
  /** Every `Book` method without a sheet is a `Workbook` method, chaining the same way. */
138
140
  type BookActionName =
139
141
  | "moveSheet" | "protectWorkbook" | "registerFunction" | "setDefinedName"
package/index.js CHANGED
@@ -12,29 +12,31 @@ module.exports = require("./excelerate.js");
12
12
 
13
13
  function build(Book) {
14
14
  const SHEET_ACTIONS = [
15
- "clear", "clearAt", "copyRange", "fillDown", "fillRight", "fillSeries",
16
- "freezePanes", "insertCells", "insertColumns", "insertColumnsMany",
17
- "insertRows", "insertRowsMany", "merge", "moveRange", "protectSheet",
18
- "removeCells", "removeColumns", "removeColumnsMany", "removeRows",
19
- "removeRowsMany", "set", "setAt", "setCellStyle", "setCellStyleAt",
20
- "setChartFormat", "setColumnHidden", "setColumnWidth", "setComment",
21
- "setHyperlink", "setRange", "setRangeAt", "setRangeStyle", "setRangeStyles",
22
- "setRangeStylesAt", "setRichText", "setRichTextAt", "setRowHeight",
23
- "setRowHidden", "setShapeFormat", "setSheetVisibility", "setShowGridLines",
24
- "setZoom", "sortRange", "unprotectSheet",
15
+ "addDataValidation", "clear", "clearAt", "copyRange", "fillDown", "fillRight",
16
+ "fillSeries", "freezePanes", "insertCells", "insertColumns",
17
+ "insertColumnsMany", "insertRows", "insertRowsMany", "merge", "moveRange",
18
+ "protectSheet", "removeCells", "removeColumns", "removeColumnsMany",
19
+ "removeRows", "removeRowsMany", "set", "setAt", "setCellStyle",
20
+ "setCellStyleAt", "setChartFormat", "setColumnHidden", "setColumnWidth",
21
+ "setComment", "setHyperlink", "setRange", "setRangeAt", "setRangeStyle",
22
+ "setRangeStyles", "setRangeStylesAt", "setRichText", "setRichTextAt",
23
+ "setRowHeight", "setRowHidden", "setShapeFormat", "setSheetVisibility",
24
+ "setShowGridLines", "setZoom", "sortRange", "unprotectSheet",
25
25
  ];
26
26
  const SHEET_QUERIES = [
27
27
  "arrayFormulas", "autoFilter", "cellBold", "cellBoldAt", "cellCount",
28
28
  "cellIndent", "cellIndentAt", "cellStyle", "cellStyleAt", "charts",
29
- "columnLevel", "columnWidth", "comments", "conditionalFormats",
30
- "dataValidations", "evaluate", "get", "getAt", "getFormatted", "getFormattedAt",
31
- "getFormula", "getFormulaAt", "getRange", "getRangeAt", "getRangeStyles",
32
- "getRangeStylesAt", "getRichText", "getRichTextAt", "getRowAt", "hyperlinks",
33
- "imageData", "images", "mergedRanges", "mergedRangesAt", "pivotTables",
29
+ "checkValidation", "columnLevel", "columnWidth", "comments",
30
+ "conditionalFormats", "dataValidations", "evaluate", "get", "getAt",
31
+ "getFormatted", "getFormattedAt", "getFormula", "getFormulaAt", "getRange",
32
+ "getRangeAt", "getRangeStyles", "getRangeStylesAt", "getRichText",
33
+ "getRichTextAt", "getRowAt", "goalSeek", "hyperlinks", "imageData", "images",
34
+ "invalidCells", "mergedRanges", "mergedRangesAt", "pivotTables",
34
35
  "recalculateCell", "recalculateCellAt", "recalculateFrom", "recalculateFromAt",
35
- "recalculateFromMany", "removeComment", "removeHyperlink", "removeTable",
36
- "rowHeight", "rowHidden", "rowLevel", "shapes", "sheetProtection", "sheetView",
37
- "sheetVisibility", "toCsv", "toHtml", "unmerge", "usedRange", "usedRangeHint",
36
+ "recalculateFromMany", "removeComment", "removeDuplicates", "removeHyperlink",
37
+ "removeTable", "rowHeight", "rowHidden", "rowLevel", "shapes",
38
+ "sheetProtection", "sheetView", "sheetVisibility", "textToColumns", "toCsv",
39
+ "toHtml", "unmerge", "usedRange", "usedRangeHint", "validationList",
38
40
  "verifySheetPassword",
39
41
  ];
40
42
  const BOOK_ACTIONS = [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rosperitus/excelerate",
3
3
  "description": "Read, write and recalculate spreadsheets: xlsx, xls, ods, csv, html, and a 518-function formula engine",
4
- "version": "0.15.0",
4
+ "version": "0.16.0",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -109,6 +109,57 @@ export interface ChartFormatPatch {
109
109
  format?: DrawingFormatPatch | null;
110
110
  plotFormat?: DrawingFormatPatch | null;
111
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
+ }
112
163
 
113
164
 
114
165
 
@@ -361,6 +412,31 @@ export interface RangeStyles {
361
412
  styles: CellStyle[];
362
413
  grid: number[][];
363
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
+ }
364
440
 
365
441
 
366
442
 
@@ -374,6 +450,20 @@ export class Book {
374
450
  * The tab a reader opens the workbook on.
375
451
  */
376
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;
377
467
  /**
378
468
  * Appends a sheet and returns its index.
379
469
  */
@@ -441,6 +531,17 @@ export class Book {
441
531
  * `barChart`, `lineChart` - and a combination chart has more than one.
442
532
  */
443
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;
444
545
  /**
445
546
  * Empties a cell, style and all.
446
547
  */
@@ -610,6 +711,19 @@ export class Book {
610
711
  * `null`; `getFormattedAt` still answers for the cells that need it.
611
712
  */
612
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;
613
727
  /**
614
728
  * The hyperlinks of a sheet. `external` tells a URL from a jump inside
615
729
  * the workbook.
@@ -662,6 +776,11 @@ export class Book {
662
776
  * subtotal rows into forty thousand take milliseconds, not a minute.
663
777
  */
664
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[];
665
784
  /**
666
785
  * Merges a block of cells: `merge(0, "A1:C1")`.
667
786
  */
@@ -821,6 +940,19 @@ export class Book {
821
940
  * Removes a defined name. Answers whether there was one.
822
941
  */
823
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;
824
956
  /**
825
957
  * Takes the link off a range. Answers whether there was one.
826
958
  */
@@ -1097,6 +1229,25 @@ export class Book {
1097
1229
  * names.
1098
1230
  */
1099
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;
1100
1251
  /**
1101
1252
  * One sheet as CSV, comma-separated unless `options.delimiter` says
1102
1253
  * otherwise - a semicolon for a locale where the comma is the decimal
@@ -1154,6 +1305,11 @@ export class Book {
1154
1305
  * removed, and walks the rows after that to give the exact rectangle.
1155
1306
  */
1156
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[];
1157
1313
  /**
1158
1314
  * Whether that password unlocks the sheet. `false` for a sheet with no
1159
1315
  * password on it, and for a hash this crate cannot check.
@@ -1172,6 +1328,7 @@ export interface InitOutput {
1172
1328
  readonly memory: WebAssembly.Memory;
1173
1329
  readonly __wbg_book_free: (a: number, b: number) => void;
1174
1330
  readonly book_activeSheet: (a: number) => number;
1331
+ readonly book_addDataValidation: (a: number, b: number, c: any) => [number, number];
1175
1332
  readonly book_addSheet: (a: number, b: number, c: number) => [number, number, number];
1176
1333
  readonly book_addTable: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
1177
1334
  readonly book_arrayFormulas: (a: number, b: number) => [number, number, number, number];
@@ -1184,6 +1341,7 @@ export interface InitOutput {
1184
1341
  readonly book_cellStyle: (a: number, b: number, c: number, d: number) => [number, number, number];
1185
1342
  readonly book_cellStyleAt: (a: number, b: number, c: number, d: number) => [number, number, number];
1186
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];
1187
1345
  readonly book_clear: (a: number, b: number, c: number, d: number) => [number, number];
1188
1346
  readonly book_clearAt: (a: number, b: number, c: number, d: number) => [number, number];
1189
1347
  readonly book_columnLevel: (a: number, b: number, c: number, d: number) => [number, number, number];
@@ -1214,6 +1372,7 @@ export interface InitOutput {
1214
1372
  readonly book_getRichText: (a: number, b: number, c: number, d: number) => [number, number, number];
1215
1373
  readonly book_getRichTextAt: (a: number, b: number, c: number, d: number) => [number, number, number];
1216
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];
1217
1376
  readonly book_hyperlinks: (a: number, b: number) => [number, number, number];
1218
1377
  readonly book_imageData: (a: number, b: number, c: number) => [number, number, number, number];
1219
1378
  readonly book_images: (a: number, b: number) => [number, number, number];
@@ -1222,6 +1381,7 @@ export interface InitOutput {
1222
1381
  readonly book_insertColumnsMany: (a: number, b: number, c: any, d: number, e: number) => [number, number];
1223
1382
  readonly book_insertRows: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
1224
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];
1225
1385
  readonly book_merge: (a: number, b: number, c: number, d: number) => [number, number];
1226
1386
  readonly book_mergedRanges: (a: number, b: number) => [number, number, number, number];
1227
1387
  readonly book_mergedRangesAt: (a: number, b: number) => [number, number, number];
@@ -1246,6 +1406,7 @@ export interface InitOutput {
1246
1406
  readonly book_removeColumnsMany: (a: number, b: number, c: any) => [number, number];
1247
1407
  readonly book_removeComment: (a: number, b: number, c: number, d: number) => [number, number, number];
1248
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];
1249
1410
  readonly book_removeHyperlink: (a: number, b: number, c: number, d: number) => [number, number, number];
1250
1411
  readonly book_removeRows: (a: number, b: number, c: number, d: number) => [number, number];
1251
1412
  readonly book_removeRowsMany: (a: number, b: number, c: any) => [number, number];
@@ -1290,6 +1451,7 @@ export interface InitOutput {
1290
1451
  readonly book_sortRange: (a: number, b: number, c: number, d: number, e: any, f: any) => [number, number];
1291
1452
  readonly book_sortTable: (a: number, b: number, c: number, d: any) => [number, number];
1292
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];
1293
1455
  readonly book_toCsv: (a: number, b: number, c: any) => [number, number, number, number];
1294
1456
  readonly book_toHtml: (a: number, b: number, c: number) => [number, number, number, number];
1295
1457
  readonly book_toOds: (a: number) => [number, number, number, number];
@@ -1301,6 +1463,7 @@ export interface InitOutput {
1301
1463
  readonly book_unregisterFunction: (a: number, b: number, c: number) => number;
1302
1464
  readonly book_usedRange: (a: number, b: number) => [number, number];
1303
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];
1304
1467
  readonly book_verifySheetPassword: (a: number, b: number, c: number, d: number) => [number, number, number];
1305
1468
  readonly book_workbookProtection: (a: number) => any;
1306
1469
  readonly rust_zstd_wasm_shim_calloc: (a: number, b: number) => number;
package/web/excelerate.js CHANGED
@@ -28,6 +28,27 @@ export class Book {
28
28
  const ret = wasm.book_activeSheet(this.__wbg_ptr);
29
29
  return ret >>> 0;
30
30
  }
31
+ /**
32
+ * Adds a data validation rule to a sheet, as Data - Data Validation
33
+ * does: `type` is `"whole"`, `"decimal"`, `"list"`, `"date"`, `"time"`,
34
+ * `"textLength"` or `"custom"`, `operator` one of `"between"` (the
35
+ * default), `"notBetween"`, `"equal"`, `"notEqual"`, `"greaterThan"`,
36
+ * `"lessThan"`, `"greaterThanOrEqual"`, `"lessThanOrEqual"`. Formulas are
37
+ * written for the first cell of `sqref`; a list is `"\"Yes,No\""` or a
38
+ * range such as `"$E$1:$E$5"`.
39
+ *
40
+ * ```js
41
+ * book.addDataValidation(0, { sqref: "B2:B100", type: "list", formula1: "\"Yes,No\"" });
42
+ * ```
43
+ * @param {number} sheet
44
+ * @param {NewDataValidation} rule
45
+ */
46
+ addDataValidation(sheet, rule) {
47
+ const ret = wasm.book_addDataValidation(this.__wbg_ptr, sheet, rule);
48
+ if (ret[1]) {
49
+ throw takeFromExternrefTable0(ret[0]);
50
+ }
51
+ }
31
52
  /**
32
53
  * Appends a sheet and returns its index.
33
54
  * @param {string} title
@@ -212,6 +233,29 @@ export class Book {
212
233
  }
213
234
  return takeFromExternrefTable0(ret[0]);
214
235
  }
236
+ /**
237
+ * Whether `value` would be accepted in a cell under its data validation
238
+ * rule: `null` when it would (or there is no rule), otherwise what Excel
239
+ * would report, `{ style, title, message, sqref }`.
240
+ *
241
+ * ```js
242
+ * const problem = book.checkValidation(0, "B5", 150);
243
+ * if (problem) alert(problem.message || "Not allowed");
244
+ * ```
245
+ * @param {number} sheet
246
+ * @param {string} address
247
+ * @param {CellValue} value
248
+ * @returns {ValidationProblem | null}
249
+ */
250
+ checkValidation(sheet, address, value) {
251
+ const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
252
+ const len0 = WASM_VECTOR_LEN;
253
+ const ret = wasm.book_checkValidation(this.__wbg_ptr, sheet, ptr0, len0, value);
254
+ if (ret[2]) {
255
+ throw takeFromExternrefTable0(ret[1]);
256
+ }
257
+ return takeFromExternrefTable0(ret[0]);
258
+ }
215
259
  /**
216
260
  * Empties a cell, style and all.
217
261
  * @param {number} sheet
@@ -703,6 +747,35 @@ export class Book {
703
747
  }
704
748
  return takeFromExternrefTable0(ret[0]);
705
749
  }
750
+ /**
751
+ * Finds the value of `changing` that makes the formula in `set` compute
752
+ * `target`, as Excel's Goal Seek does, both cells on `sheet`. The best
753
+ * value found is left in `changing` and what reads it is recomputed.
754
+ * `options.maxIterations` and `options.tolerance` default to the
755
+ * workbook's own iteration settings (100 and 0.001 unless it says
756
+ * otherwise). Returns `{ value, result, iterations, converged }`.
757
+ *
758
+ * ```js
759
+ * const { value, converged } = book.goalSeek(0, "B4", 300, "B1");
760
+ * ```
761
+ * @param {number} sheet
762
+ * @param {string} set
763
+ * @param {number} target
764
+ * @param {string} changing
765
+ * @param {GoalSeekOptions} [options]
766
+ * @returns {GoalSeekResult}
767
+ */
768
+ goalSeek(sheet, set, target, changing, options) {
769
+ const ptr0 = passStringToWasm0(set, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
770
+ const len0 = WASM_VECTOR_LEN;
771
+ const ptr1 = passStringToWasm0(changing, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
772
+ const len1 = WASM_VECTOR_LEN;
773
+ const ret = wasm.book_goalSeek(this.__wbg_ptr, sheet, ptr0, len0, target, ptr1, len1, options);
774
+ if (ret[2]) {
775
+ throw takeFromExternrefTable0(ret[1]);
776
+ }
777
+ return takeFromExternrefTable0(ret[0]);
778
+ }
706
779
  /**
707
780
  * The hyperlinks of a sheet. `external` tells a URL from a jump inside
708
781
  * the workbook.
@@ -839,6 +912,21 @@ export class Book {
839
912
  throw takeFromExternrefTable0(ret[0]);
840
913
  }
841
914
  }
915
+ /**
916
+ * The cells of a sheet whose values break their data validation rule,
917
+ * as Excel's Circle Invalid Data finds them: `["B3", "B9"]`.
918
+ * @param {number} sheet
919
+ * @returns {string[]}
920
+ */
921
+ invalidCells(sheet) {
922
+ const ret = wasm.book_invalidCells(this.__wbg_ptr, sheet);
923
+ if (ret[3]) {
924
+ throw takeFromExternrefTable0(ret[2]);
925
+ }
926
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]);
927
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
928
+ return v1;
929
+ }
842
930
  /**
843
931
  * Merges a block of cells: `merge(0, "A1:C1")`.
844
932
  * @param {number} sheet
@@ -1222,6 +1310,31 @@ export class Book {
1222
1310
  const ret = wasm.book_removeDefinedName(this.__wbg_ptr, ptr0, len0, isLikeNone(sheet) ? Number.MAX_SAFE_INTEGER : (sheet) >>> 0);
1223
1311
  return ret !== 0;
1224
1312
  }
1313
+ /**
1314
+ * Removes the rows of a range that repeat a row above them, as Excel's
1315
+ * Remove Duplicates does: cells are compared by the text they show,
1316
+ * without regard to case. `options.columns` are the 1-based sheet
1317
+ * columns compared (all of the range when left out), and
1318
+ * `options.header` keeps the first row out of it. Returns
1319
+ * `{ removed, remaining }`.
1320
+ *
1321
+ * ```js
1322
+ * book.removeDuplicates(0, "A1:C500", { columns: [1, 3], header: true });
1323
+ * ```
1324
+ * @param {number} sheet
1325
+ * @param {string} range
1326
+ * @param {RemoveDuplicatesOptions} [options]
1327
+ * @returns {DuplicatesRemoved}
1328
+ */
1329
+ removeDuplicates(sheet, range, options) {
1330
+ const ptr0 = passStringToWasm0(range, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1331
+ const len0 = WASM_VECTOR_LEN;
1332
+ const ret = wasm.book_removeDuplicates(this.__wbg_ptr, sheet, ptr0, len0, options);
1333
+ if (ret[2]) {
1334
+ throw takeFromExternrefTable0(ret[1]);
1335
+ }
1336
+ return takeFromExternrefTable0(ret[0]);
1337
+ }
1225
1338
  /**
1226
1339
  * Takes the link off a range. Answers whether there was one.
1227
1340
  * @param {number} sheet
@@ -1906,6 +2019,37 @@ export class Book {
1906
2019
  }
1907
2020
  return takeFromExternrefTable0(ret[0]);
1908
2021
  }
2022
+ /**
2023
+ * Splits the text of each cell in the first column of `range` across
2024
+ * the columns to its right, as Excel's Text to Columns does. Pieces that
2025
+ * read as numbers, booleans or errors become them. Returns how many
2026
+ * columns the widest row took.
2027
+ *
2028
+ * `options.delimiters` is a string of delimiter characters (`";"`,
2029
+ * `",\t"`), or `options.widths` the character positions to cut before
2030
+ * for fixed width; `mergeConsecutive` treats a run of delimiters as one,
2031
+ * `qualifier` is the quote (`"` unless given; `null` for none), and
2032
+ * `destination` is the first cell written (the range's own when left
2033
+ * out).
2034
+ *
2035
+ * ```js
2036
+ * book.textToColumns(0, "A2:A100", { delimiters: ";" });
2037
+ * book.textToColumns(0, "A2:A100", { widths: [4, 10], destination: "C2" });
2038
+ * ```
2039
+ * @param {number} sheet
2040
+ * @param {string} range
2041
+ * @param {TextToColumnsOptions} options
2042
+ * @returns {number}
2043
+ */
2044
+ textToColumns(sheet, range, options) {
2045
+ const ptr0 = passStringToWasm0(range, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2046
+ const len0 = WASM_VECTOR_LEN;
2047
+ const ret = wasm.book_textToColumns(this.__wbg_ptr, sheet, ptr0, len0, options);
2048
+ if (ret[2]) {
2049
+ throw takeFromExternrefTable0(ret[1]);
2050
+ }
2051
+ return ret[0] >>> 0;
2052
+ }
1909
2053
  /**
1910
2054
  * One sheet as CSV, comma-separated unless `options.delimiter` says
1911
2055
  * otherwise - a semicolon for a locale where the comma is the decimal
@@ -2080,6 +2224,24 @@ export class Book {
2080
2224
  }
2081
2225
  return v1;
2082
2226
  }
2227
+ /**
2228
+ * The choices of the drop-down list on a cell, as Excel shows them; an
2229
+ * empty array when the cell has no list rule.
2230
+ * @param {number} sheet
2231
+ * @param {string} address
2232
+ * @returns {string[]}
2233
+ */
2234
+ validationList(sheet, address) {
2235
+ const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2236
+ const len0 = WASM_VECTOR_LEN;
2237
+ const ret = wasm.book_validationList(this.__wbg_ptr, sheet, ptr0, len0);
2238
+ if (ret[3]) {
2239
+ throw takeFromExternrefTable0(ret[2]);
2240
+ }
2241
+ var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]);
2242
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2243
+ return v2;
2244
+ }
2083
2245
  /**
2084
2246
  * Whether that password unlocks the sheet. `false` for a sheet with no
2085
2247
  * password on it, and for a hash this crate cannot check.
Binary file
@@ -3,6 +3,7 @@
3
3
  export const memory: WebAssembly.Memory;
4
4
  export const __wbg_book_free: (a: number, b: number) => void;
5
5
  export const book_activeSheet: (a: number) => number;
6
+ export const book_addDataValidation: (a: number, b: number, c: any) => [number, number];
6
7
  export const book_addSheet: (a: number, b: number, c: number) => [number, number, number];
7
8
  export const book_addTable: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
8
9
  export const book_arrayFormulas: (a: number, b: number) => [number, number, number, number];
@@ -15,6 +16,7 @@ export const book_cellIndentAt: (a: number, b: number, c: number, d: number) =>
15
16
  export const book_cellStyle: (a: number, b: number, c: number, d: number) => [number, number, number];
16
17
  export const book_cellStyleAt: (a: number, b: number, c: number, d: number) => [number, number, number];
17
18
  export const book_charts: (a: number, b: number) => [number, number, number];
19
+ export const book_checkValidation: (a: number, b: number, c: number, d: number, e: any) => [number, number, number];
18
20
  export const book_clear: (a: number, b: number, c: number, d: number) => [number, number];
19
21
  export const book_clearAt: (a: number, b: number, c: number, d: number) => [number, number];
20
22
  export const book_columnLevel: (a: number, b: number, c: number, d: number) => [number, number, number];
@@ -45,6 +47,7 @@ export const book_getRangeStylesAt: (a: number, b: number, c: number, d: number,
45
47
  export const book_getRichText: (a: number, b: number, c: number, d: number) => [number, number, number];
46
48
  export const book_getRichTextAt: (a: number, b: number, c: number, d: number) => [number, number, number];
47
49
  export const book_getRowAt: (a: number, b: number, c: number, d: number) => [number, number, number];
50
+ export const book_goalSeek: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: any) => [number, number, number];
48
51
  export const book_hyperlinks: (a: number, b: number) => [number, number, number];
49
52
  export const book_imageData: (a: number, b: number, c: number) => [number, number, number, number];
50
53
  export const book_images: (a: number, b: number) => [number, number, number];
@@ -53,6 +56,7 @@ export const book_insertColumns: (a: number, b: number, c: number, d: number, e:
53
56
  export const book_insertColumnsMany: (a: number, b: number, c: any, d: number, e: number) => [number, number];
54
57
  export const book_insertRows: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
55
58
  export const book_insertRowsMany: (a: number, b: number, c: any, d: number, e: number) => [number, number];
59
+ export const book_invalidCells: (a: number, b: number) => [number, number, number, number];
56
60
  export const book_merge: (a: number, b: number, c: number, d: number) => [number, number];
57
61
  export const book_mergedRanges: (a: number, b: number) => [number, number, number, number];
58
62
  export const book_mergedRangesAt: (a: number, b: number) => [number, number, number];
@@ -77,6 +81,7 @@ export const book_removeColumns: (a: number, b: number, c: number, d: number) =>
77
81
  export const book_removeColumnsMany: (a: number, b: number, c: any) => [number, number];
78
82
  export const book_removeComment: (a: number, b: number, c: number, d: number) => [number, number, number];
79
83
  export const book_removeDefinedName: (a: number, b: number, c: number, d: number) => number;
84
+ export const book_removeDuplicates: (a: number, b: number, c: number, d: number, e: any) => [number, number, number];
80
85
  export const book_removeHyperlink: (a: number, b: number, c: number, d: number) => [number, number, number];
81
86
  export const book_removeRows: (a: number, b: number, c: number, d: number) => [number, number];
82
87
  export const book_removeRowsMany: (a: number, b: number, c: any) => [number, number];
@@ -121,6 +126,7 @@ export const book_sheetVisibility: (a: number, b: number) => [number, number, nu
121
126
  export const book_sortRange: (a: number, b: number, c: number, d: number, e: any, f: any) => [number, number];
122
127
  export const book_sortTable: (a: number, b: number, c: number, d: any) => [number, number];
123
128
  export const book_tables: (a: number, b: number) => [number, number, number];
129
+ export const book_textToColumns: (a: number, b: number, c: number, d: number, e: any) => [number, number, number];
124
130
  export const book_toCsv: (a: number, b: number, c: any) => [number, number, number, number];
125
131
  export const book_toHtml: (a: number, b: number, c: number) => [number, number, number, number];
126
132
  export const book_toOds: (a: number) => [number, number, number, number];
@@ -132,6 +138,7 @@ export const book_unprotectWorkbook: (a: number) => void;
132
138
  export const book_unregisterFunction: (a: number, b: number, c: number) => number;
133
139
  export const book_usedRange: (a: number, b: number) => [number, number];
134
140
  export const book_usedRangeHint: (a: number, b: number) => [number, number, number, number];
141
+ export const book_validationList: (a: number, b: number, c: number, d: number) => [number, number, number, number];
135
142
  export const book_verifySheetPassword: (a: number, b: number, c: number, d: number) => [number, number, number];
136
143
  export const book_workbookProtection: (a: number) => any;
137
144
  export const rust_zstd_wasm_shim_calloc: (a: number, b: number) => number;
package/web/index.d.ts CHANGED
@@ -111,30 +111,32 @@ export declare class SheetRange {
111
111
  * `sheet.setColumnWidth(2, 14).setRowHidden(5, true).getRange("A1:C3")`.
112
112
  */
113
113
  type SheetActionName =
114
- | "clear" | "clearAt" | "copyRange" | "fillDown" | "fillRight" | "fillSeries"
115
- | "freezePanes" | "insertCells" | "insertColumns" | "insertColumnsMany"
116
- | "insertRows" | "insertRowsMany" | "merge" | "moveRange" | "protectSheet"
117
- | "removeCells" | "removeColumns" | "removeColumnsMany" | "removeRows"
118
- | "removeRowsMany" | "set" | "setAt" | "setCellStyle" | "setCellStyleAt"
119
- | "setChartFormat" | "setColumnHidden" | "setColumnWidth" | "setComment"
120
- | "setHyperlink" | "setRange" | "setRangeAt" | "setRangeStyle"
121
- | "setRangeStyles" | "setRangeStylesAt" | "setRichText" | "setRichTextAt"
122
- | "setRowHeight" | "setRowHidden" | "setShapeFormat" | "setSheetVisibility"
123
- | "setShowGridLines" | "setZoom" | "sortRange" | "unprotectSheet";
114
+ | "addDataValidation" | "clear" | "clearAt" | "copyRange" | "fillDown"
115
+ | "fillRight" | "fillSeries" | "freezePanes" | "insertCells" | "insertColumns"
116
+ | "insertColumnsMany" | "insertRows" | "insertRowsMany" | "merge"
117
+ | "moveRange" | "protectSheet" | "removeCells" | "removeColumns"
118
+ | "removeColumnsMany" | "removeRows" | "removeRowsMany" | "set" | "setAt"
119
+ | "setCellStyle" | "setCellStyleAt" | "setChartFormat" | "setColumnHidden"
120
+ | "setColumnWidth" | "setComment" | "setHyperlink" | "setRange" | "setRangeAt"
121
+ | "setRangeStyle" | "setRangeStyles" | "setRangeStylesAt" | "setRichText"
122
+ | "setRichTextAt" | "setRowHeight" | "setRowHidden" | "setShapeFormat"
123
+ | "setSheetVisibility" | "setShowGridLines" | "setZoom" | "sortRange"
124
+ | "unprotectSheet";
124
125
  type SheetQueryName =
125
126
  | "arrayFormulas" | "autoFilter" | "cellBold" | "cellBoldAt" | "cellCount"
126
127
  | "cellIndent" | "cellIndentAt" | "cellStyle" | "cellStyleAt" | "charts"
127
- | "columnLevel" | "columnWidth" | "comments" | "conditionalFormats"
128
- | "dataValidations" | "evaluate" | "get" | "getAt" | "getFormatted"
129
- | "getFormattedAt" | "getFormula" | "getFormulaAt" | "getRange" | "getRangeAt"
130
- | "getRangeStyles" | "getRangeStylesAt" | "getRichText" | "getRichTextAt"
131
- | "getRowAt" | "hyperlinks" | "imageData" | "images" | "mergedRanges"
132
- | "mergedRangesAt" | "pivotTables" | "recalculateCell" | "recalculateCellAt"
133
- | "recalculateFrom" | "recalculateFromAt" | "recalculateFromMany"
134
- | "removeComment" | "removeHyperlink" | "removeTable" | "rowHeight"
128
+ | "checkValidation" | "columnLevel" | "columnWidth" | "comments"
129
+ | "conditionalFormats" | "dataValidations" | "evaluate" | "get" | "getAt"
130
+ | "getFormatted" | "getFormattedAt" | "getFormula" | "getFormulaAt"
131
+ | "getRange" | "getRangeAt" | "getRangeStyles" | "getRangeStylesAt"
132
+ | "getRichText" | "getRichTextAt" | "getRowAt" | "goalSeek" | "hyperlinks"
133
+ | "imageData" | "images" | "invalidCells" | "mergedRanges" | "mergedRangesAt"
134
+ | "pivotTables" | "recalculateCell" | "recalculateCellAt" | "recalculateFrom"
135
+ | "recalculateFromAt" | "recalculateFromMany" | "removeComment"
136
+ | "removeDuplicates" | "removeHyperlink" | "removeTable" | "rowHeight"
135
137
  | "rowHidden" | "rowLevel" | "shapes" | "sheetProtection" | "sheetView"
136
- | "sheetVisibility" | "toCsv" | "toHtml" | "unmerge" | "usedRange"
137
- | "usedRangeHint" | "verifySheetPassword";
138
+ | "sheetVisibility" | "textToColumns" | "toCsv" | "toHtml" | "unmerge"
139
+ | "usedRange" | "usedRangeHint" | "validationList" | "verifySheetPassword";
138
140
  /** Every `Book` method without a sheet is a `Workbook` method, chaining the same way. */
139
141
  type BookActionName =
140
142
  | "moveSheet" | "protectWorkbook" | "registerFunction" | "setDefinedName"
package/web/index.js CHANGED
@@ -13,29 +13,31 @@ export { default } from "./excelerate.js";
13
13
 
14
14
  function build(Book) {
15
15
  const SHEET_ACTIONS = [
16
- "clear", "clearAt", "copyRange", "fillDown", "fillRight", "fillSeries",
17
- "freezePanes", "insertCells", "insertColumns", "insertColumnsMany",
18
- "insertRows", "insertRowsMany", "merge", "moveRange", "protectSheet",
19
- "removeCells", "removeColumns", "removeColumnsMany", "removeRows",
20
- "removeRowsMany", "set", "setAt", "setCellStyle", "setCellStyleAt",
21
- "setChartFormat", "setColumnHidden", "setColumnWidth", "setComment",
22
- "setHyperlink", "setRange", "setRangeAt", "setRangeStyle", "setRangeStyles",
23
- "setRangeStylesAt", "setRichText", "setRichTextAt", "setRowHeight",
24
- "setRowHidden", "setShapeFormat", "setSheetVisibility", "setShowGridLines",
25
- "setZoom", "sortRange", "unprotectSheet",
16
+ "addDataValidation", "clear", "clearAt", "copyRange", "fillDown", "fillRight",
17
+ "fillSeries", "freezePanes", "insertCells", "insertColumns",
18
+ "insertColumnsMany", "insertRows", "insertRowsMany", "merge", "moveRange",
19
+ "protectSheet", "removeCells", "removeColumns", "removeColumnsMany",
20
+ "removeRows", "removeRowsMany", "set", "setAt", "setCellStyle",
21
+ "setCellStyleAt", "setChartFormat", "setColumnHidden", "setColumnWidth",
22
+ "setComment", "setHyperlink", "setRange", "setRangeAt", "setRangeStyle",
23
+ "setRangeStyles", "setRangeStylesAt", "setRichText", "setRichTextAt",
24
+ "setRowHeight", "setRowHidden", "setShapeFormat", "setSheetVisibility",
25
+ "setShowGridLines", "setZoom", "sortRange", "unprotectSheet",
26
26
  ];
27
27
  const SHEET_QUERIES = [
28
28
  "arrayFormulas", "autoFilter", "cellBold", "cellBoldAt", "cellCount",
29
29
  "cellIndent", "cellIndentAt", "cellStyle", "cellStyleAt", "charts",
30
- "columnLevel", "columnWidth", "comments", "conditionalFormats",
31
- "dataValidations", "evaluate", "get", "getAt", "getFormatted", "getFormattedAt",
32
- "getFormula", "getFormulaAt", "getRange", "getRangeAt", "getRangeStyles",
33
- "getRangeStylesAt", "getRichText", "getRichTextAt", "getRowAt", "hyperlinks",
34
- "imageData", "images", "mergedRanges", "mergedRangesAt", "pivotTables",
30
+ "checkValidation", "columnLevel", "columnWidth", "comments",
31
+ "conditionalFormats", "dataValidations", "evaluate", "get", "getAt",
32
+ "getFormatted", "getFormattedAt", "getFormula", "getFormulaAt", "getRange",
33
+ "getRangeAt", "getRangeStyles", "getRangeStylesAt", "getRichText",
34
+ "getRichTextAt", "getRowAt", "goalSeek", "hyperlinks", "imageData", "images",
35
+ "invalidCells", "mergedRanges", "mergedRangesAt", "pivotTables",
35
36
  "recalculateCell", "recalculateCellAt", "recalculateFrom", "recalculateFromAt",
36
- "recalculateFromMany", "removeComment", "removeHyperlink", "removeTable",
37
- "rowHeight", "rowHidden", "rowLevel", "shapes", "sheetProtection", "sheetView",
38
- "sheetVisibility", "toCsv", "toHtml", "unmerge", "usedRange", "usedRangeHint",
37
+ "recalculateFromMany", "removeComment", "removeDuplicates", "removeHyperlink",
38
+ "removeTable", "rowHeight", "rowHidden", "rowLevel", "shapes",
39
+ "sheetProtection", "sheetView", "sheetVisibility", "textToColumns", "toCsv",
40
+ "toHtml", "unmerge", "usedRange", "usedRangeHint", "validationList",
39
41
  "verifySheetPassword",
40
42
  ];
41
43
  const BOOK_ACTIONS = [