@rosperitus/excelerate-reader 0.12.0 → 0.12.3
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 +3 -2
- package/excelerate.d.ts +24 -5
- package/excelerate.js +39 -5
- package/excelerate_bg.wasm +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -56,8 +56,9 @@ book.sheetVisibility(0); // "visible" | "hidden" | "veryHidden"
|
|
|
56
56
|
call takes is the sheet's position in the workbook, and skipping the hidden
|
|
57
57
|
ones would shift it.
|
|
58
58
|
|
|
59
|
-
`usedRangeHint` answers the same question as `usedRange` without walking
|
|
60
|
-
|
|
59
|
+
`usedRangeHint` answers the same question as `usedRange` without ever walking
|
|
60
|
+
the rows (`usedRange` walks them only after a cell in an edge column was
|
|
61
|
+
removed, and the hint may then be wider), and `columnWidth`
|
|
61
62
|
and `rowHeight` come back `undefined` where the sheet leaves them to the
|
|
62
63
|
default.
|
|
63
64
|
|
package/excelerate.d.ts
CHANGED
|
@@ -156,6 +156,14 @@ export interface CellStyle {
|
|
|
156
156
|
textRotation: number;
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
+
/**
|
|
160
|
+
* The styles of a rectangle, as `getRangeStyles` returns them: each distinct
|
|
161
|
+
* style once in `styles`, and `grid` - row by row - pointing into it.
|
|
162
|
+
*/
|
|
163
|
+
export interface RangeStyles {
|
|
164
|
+
styles: CellStyle[];
|
|
165
|
+
grid: number[][];
|
|
166
|
+
}
|
|
159
167
|
|
|
160
168
|
|
|
161
169
|
|
|
@@ -313,6 +321,17 @@ export class Book {
|
|
|
313
321
|
* to take. `getRangeAt(0, 1, 1, 3, 2)` is `A1:B3`.
|
|
314
322
|
*/
|
|
315
323
|
getRangeAt(sheet: number, row: number, column: number, rows: number, columns: number): CellGrid;
|
|
324
|
+
/**
|
|
325
|
+
* The styles of a rectangle in one call: each distinct style once, and a
|
|
326
|
+
* grid of indexes into them. `cellStyle` per cell costs a crossing and a
|
|
327
|
+
* whole style object per cell; a formatted table of ten thousand cells
|
|
328
|
+
* usually has a dozen styles.
|
|
329
|
+
*/
|
|
330
|
+
getRangeStyles(sheet: number, range: string): RangeStyles;
|
|
331
|
+
/**
|
|
332
|
+
* The same by numbers, as `getRangeAt` takes them.
|
|
333
|
+
*/
|
|
334
|
+
getRangeStylesAt(sheet: number, row: number, column: number, rows: number, columns: number): RangeStyles;
|
|
316
335
|
/**
|
|
317
336
|
* A whole row in one crossing of the boundary: values, displayed text,
|
|
318
337
|
* bold and indent, plus whether the row is hidden.
|
|
@@ -460,12 +479,12 @@ export class Book {
|
|
|
460
479
|
*/
|
|
461
480
|
usedRange(sheet: number): string | undefined;
|
|
462
481
|
/**
|
|
463
|
-
* The used range of a sheet as `"A1:D20"
|
|
464
|
-
*
|
|
482
|
+
* The used range of a sheet as `"A1:D20"` without walking the rows;
|
|
483
|
+
* `undefined` for an empty sheet.
|
|
465
484
|
*
|
|
466
|
-
*
|
|
467
|
-
* `usedRange`
|
|
468
|
-
*
|
|
485
|
+
* Rows are exact, columns an upper bound: removing a cell never narrows
|
|
486
|
+
* them. `usedRange` answers the same until a cell in an edge column is
|
|
487
|
+
* removed, and walks the rows after that to give the exact rectangle.
|
|
469
488
|
*/
|
|
470
489
|
usedRangeHint(sheet: number): string | undefined;
|
|
471
490
|
/**
|
package/excelerate.js
CHANGED
|
@@ -469,6 +469,40 @@ class Book {
|
|
|
469
469
|
}
|
|
470
470
|
return takeFromExternrefTable0(ret[0]);
|
|
471
471
|
}
|
|
472
|
+
/**
|
|
473
|
+
* The styles of a rectangle in one call: each distinct style once, and a
|
|
474
|
+
* grid of indexes into them. `cellStyle` per cell costs a crossing and a
|
|
475
|
+
* whole style object per cell; a formatted table of ten thousand cells
|
|
476
|
+
* usually has a dozen styles.
|
|
477
|
+
* @param {number} sheet
|
|
478
|
+
* @param {string} range
|
|
479
|
+
* @returns {RangeStyles}
|
|
480
|
+
*/
|
|
481
|
+
getRangeStyles(sheet, range) {
|
|
482
|
+
const ptr0 = passStringToWasm0(range, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
483
|
+
const len0 = WASM_VECTOR_LEN;
|
|
484
|
+
const ret = wasm.book_getRangeStyles(this.__wbg_ptr, sheet, ptr0, len0);
|
|
485
|
+
if (ret[2]) {
|
|
486
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
487
|
+
}
|
|
488
|
+
return takeFromExternrefTable0(ret[0]);
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* The same by numbers, as `getRangeAt` takes them.
|
|
492
|
+
* @param {number} sheet
|
|
493
|
+
* @param {number} row
|
|
494
|
+
* @param {number} column
|
|
495
|
+
* @param {number} rows
|
|
496
|
+
* @param {number} columns
|
|
497
|
+
* @returns {RangeStyles}
|
|
498
|
+
*/
|
|
499
|
+
getRangeStylesAt(sheet, row, column, rows, columns) {
|
|
500
|
+
const ret = wasm.book_getRangeStylesAt(this.__wbg_ptr, sheet, row, column, rows, columns);
|
|
501
|
+
if (ret[2]) {
|
|
502
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
503
|
+
}
|
|
504
|
+
return takeFromExternrefTable0(ret[0]);
|
|
505
|
+
}
|
|
472
506
|
/**
|
|
473
507
|
* A whole row in one crossing of the boundary: values, displayed text,
|
|
474
508
|
* bold and indent, plus whether the row is hidden.
|
|
@@ -864,12 +898,12 @@ class Book {
|
|
|
864
898
|
return v1;
|
|
865
899
|
}
|
|
866
900
|
/**
|
|
867
|
-
* The used range of a sheet as `"A1:D20"
|
|
868
|
-
*
|
|
901
|
+
* The used range of a sheet as `"A1:D20"` without walking the rows;
|
|
902
|
+
* `undefined` for an empty sheet.
|
|
869
903
|
*
|
|
870
|
-
*
|
|
871
|
-
* `usedRange`
|
|
872
|
-
*
|
|
904
|
+
* Rows are exact, columns an upper bound: removing a cell never narrows
|
|
905
|
+
* them. `usedRange` answers the same until a cell in an edge column is
|
|
906
|
+
* removed, and walks the rows after that to give the exact rectangle.
|
|
873
907
|
* @param {number} sheet
|
|
874
908
|
* @returns {string | undefined}
|
|
875
909
|
*/
|
package/excelerate_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rosperitus/excelerate-reader",
|
|
3
3
|
"description": "Read spreadsheets in the browser or Node: xlsx, xls, ods, csv, html, SYLK, Gnumeric and SpreadsheetML, with cell styles. Reading only.",
|
|
4
|
-
"version": "0.12.
|
|
4
|
+
"version": "0.12.3",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|