@sheetwrite/wasm 0.3.0 → 0.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheetwrite/wasm",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "description": "Sheetwrite columnar store and data engine (Rust/WASM).",
6
6
  "license": "MIT",
@@ -104,9 +104,9 @@ export class CellStore {
104
104
  getCell(sheet: number, row: number, col: number): CellOut;
105
105
  /**
106
106
  * One bulk read of a rectangular window for the renderer. Returns
107
- * contiguous typed arrays (row-major over `rows x cols`) plus the unique
108
- * strings referenced by the window, so the host paints without crossing
109
- * the boundary per cell.
107
+ * contiguous packed cell data (row-major over `rows x cols`) plus the
108
+ * unique strings referenced by the window, so the host paints without
109
+ * crossing the boundary per cell.
110
110
  */
111
111
  getWindow(sheet: number, row_start: number, row_end: number, cols: Uint32Array): WindowView;
112
112
  /**
@@ -369,39 +369,14 @@ export class WindowView {
369
369
  free(): void;
370
370
  [Symbol.dispose](): void;
371
371
  /**
372
- * Consume and return per-cell conditional-format rule bitmasks; empty
373
- * when the sheet has no rules.
372
+ * Consume the complete fixed-width window payload. The returned
373
+ * `Uint8Array` is copied by wasm-bindgen into JS-owned memory.
374
374
  */
375
- takeCondMatches(): Uint32Array;
375
+ takePacked(): Uint8Array;
376
376
  /**
377
- * Consume and return the per-cell tag array: 0 empty, 1 number, 2 string.
378
- */
379
- takeKinds(): Uint8Array;
380
- /**
381
- * Consume and return per-cell numeric payloads (valid where kind == 1).
382
- */
383
- takeNumbers(): Float64Array;
384
- /**
385
- * Consume and return per-cell GLOBAL string-pool ids; `u32::MAX` means none.
386
- */
387
- takeStringIds(): Uint32Array;
388
- /**
389
- * Consume and return per-cell indices into `strings` (string cells only).
390
- */
391
- takeStringIndex(): Int32Array;
392
- /**
393
- * Consume and return unique strings referenced by this window.
377
+ * Consume formula-error sentinel strings referenced by the packed data.
394
378
  */
395
379
  takeStrings(): string[];
396
- /**
397
- * Consume and return the unique global style-dictionary ids referenced by
398
- * this window, in local-index order; the host maps each to a `CellStyle`.
399
- */
400
- takeStyleDict(): Uint32Array;
401
- /**
402
- * Consume and return per-cell WINDOW-LOCAL style indices into the dict.
403
- */
404
- takeStyleIndex(): Uint32Array;
405
380
  readonly nCols: number;
406
381
  readonly nRows: number;
407
382
  }
@@ -527,15 +502,9 @@ export interface InitOutput {
527
502
  readonly sourcesnapshot_referenceTargets: (a: number) => [number, number];
528
503
  readonly sourcesnapshot_spillDerived: (a: number) => [number, number];
529
504
  readonly windowview_nCols: (a: number) => number;
530
- readonly windowview_nRows: (a: number) => number;
531
- readonly windowview_takeCondMatches: (a: number) => [number, number];
532
- readonly windowview_takeStringIds: (a: number) => [number, number];
533
- readonly windowview_takeStringIndex: (a: number) => [number, number];
534
505
  readonly windowview_takeStrings: (a: number) => [number, number];
535
- readonly windowview_takeStyleDict: (a: number) => [number, number];
536
- readonly windowview_takeStyleIndex: (a: number) => [number, number];
537
- readonly windowview_takeKinds: (a: number) => [number, number];
538
- readonly windowview_takeNumbers: (a: number) => [number, number];
506
+ readonly windowview_takePacked: (a: number) => [number, number];
507
+ readonly windowview_nRows: (a: number) => number;
539
508
  readonly __wbindgen_malloc: (a: number, b: number) => number;
540
509
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
541
510
  readonly __wbindgen_externrefs: WebAssembly.Table;
@@ -403,9 +403,9 @@ export class CellStore {
403
403
  }
404
404
  /**
405
405
  * One bulk read of a rectangular window for the renderer. Returns
406
- * contiguous typed arrays (row-major over `rows x cols`) plus the unique
407
- * strings referenced by the window, so the host paints without crossing
408
- * the boundary per cell.
406
+ * contiguous packed cell data (row-major over `rows x cols`) plus the
407
+ * unique strings referenced by the window, so the host paints without
408
+ * crossing the boundary per cell.
409
409
  * @param {number} sheet
410
410
  * @param {number} row_start
411
411
  * @param {number} row_end
@@ -1486,58 +1486,18 @@ export class WindowView {
1486
1486
  return ret >>> 0;
1487
1487
  }
1488
1488
  /**
1489
- * Consume and return per-cell conditional-format rule bitmasks; empty
1490
- * when the sheet has no rules.
1491
- * @returns {Uint32Array}
1492
- */
1493
- takeCondMatches() {
1494
- const ret = wasm.windowview_takeCondMatches(this.__wbg_ptr);
1495
- var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
1496
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1497
- return v1;
1498
- }
1499
- /**
1500
- * Consume and return the per-cell tag array: 0 empty, 1 number, 2 string.
1489
+ * Consume the complete fixed-width window payload. The returned
1490
+ * `Uint8Array` is copied by wasm-bindgen into JS-owned memory.
1501
1491
  * @returns {Uint8Array}
1502
1492
  */
1503
- takeKinds() {
1504
- const ret = wasm.windowview_takeKinds(this.__wbg_ptr);
1493
+ takePacked() {
1494
+ const ret = wasm.windowview_takePacked(this.__wbg_ptr);
1505
1495
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1506
1496
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1507
1497
  return v1;
1508
1498
  }
1509
1499
  /**
1510
- * Consume and return per-cell numeric payloads (valid where kind == 1).
1511
- * @returns {Float64Array}
1512
- */
1513
- takeNumbers() {
1514
- const ret = wasm.windowview_takeNumbers(this.__wbg_ptr);
1515
- var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
1516
- wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
1517
- return v1;
1518
- }
1519
- /**
1520
- * Consume and return per-cell GLOBAL string-pool ids; `u32::MAX` means none.
1521
- * @returns {Uint32Array}
1522
- */
1523
- takeStringIds() {
1524
- const ret = wasm.windowview_takeStringIds(this.__wbg_ptr);
1525
- var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
1526
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1527
- return v1;
1528
- }
1529
- /**
1530
- * Consume and return per-cell indices into `strings` (string cells only).
1531
- * @returns {Int32Array}
1532
- */
1533
- takeStringIndex() {
1534
- const ret = wasm.windowview_takeStringIndex(this.__wbg_ptr);
1535
- var v1 = getArrayI32FromWasm0(ret[0], ret[1]).slice();
1536
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1537
- return v1;
1538
- }
1539
- /**
1540
- * Consume and return unique strings referenced by this window.
1500
+ * Consume formula-error sentinel strings referenced by the packed data.
1541
1501
  * @returns {string[]}
1542
1502
  */
1543
1503
  takeStrings() {
@@ -1546,27 +1506,6 @@ export class WindowView {
1546
1506
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1547
1507
  return v1;
1548
1508
  }
1549
- /**
1550
- * Consume and return the unique global style-dictionary ids referenced by
1551
- * this window, in local-index order; the host maps each to a `CellStyle`.
1552
- * @returns {Uint32Array}
1553
- */
1554
- takeStyleDict() {
1555
- const ret = wasm.windowview_takeStyleDict(this.__wbg_ptr);
1556
- var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
1557
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1558
- return v1;
1559
- }
1560
- /**
1561
- * Consume and return per-cell WINDOW-LOCAL style indices into the dict.
1562
- * @returns {Uint32Array}
1563
- */
1564
- takeStyleIndex() {
1565
- const ret = wasm.windowview_takeStyleIndex(this.__wbg_ptr);
1566
- var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
1567
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1568
- return v1;
1569
- }
1570
1509
  }
1571
1510
  if (Symbol.dispose) WindowView.prototype[Symbol.dispose] = WindowView.prototype.free;
1572
1511
  function __wbg_get_imports() {
@@ -1640,11 +1579,6 @@ function getArrayF64FromWasm0(ptr, len) {
1640
1579
  return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
1641
1580
  }
1642
1581
 
1643
- function getArrayI32FromWasm0(ptr, len) {
1644
- ptr = ptr >>> 0;
1645
- return getInt32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
1646
- }
1647
-
1648
1582
  function getArrayJsValueFromWasm0(ptr, len) {
1649
1583
  ptr = ptr >>> 0;
1650
1584
  const mem = getDataViewMemory0();
@@ -1682,14 +1616,6 @@ function getFloat64ArrayMemory0() {
1682
1616
  return cachedFloat64ArrayMemory0;
1683
1617
  }
1684
1618
 
1685
- let cachedInt32ArrayMemory0 = null;
1686
- function getInt32ArrayMemory0() {
1687
- if (cachedInt32ArrayMemory0 === null || cachedInt32ArrayMemory0.byteLength === 0) {
1688
- cachedInt32ArrayMemory0 = new Int32Array(wasm.memory.buffer);
1689
- }
1690
- return cachedInt32ArrayMemory0;
1691
- }
1692
-
1693
1619
  function getStringFromWasm0(ptr, len) {
1694
1620
  return decodeText(ptr >>> 0, len);
1695
1621
  }
@@ -1818,7 +1744,6 @@ function __wbg_finalize_init(instance, module) {
1818
1744
  wasmModule = module;
1819
1745
  cachedDataViewMemory0 = null;
1820
1746
  cachedFloat64ArrayMemory0 = null;
1821
- cachedInt32ArrayMemory0 = null;
1822
1747
  cachedUint32ArrayMemory0 = null;
1823
1748
  cachedUint8ArrayMemory0 = null;
1824
1749
  wasm.__wbindgen_start();
Binary file
@@ -118,15 +118,9 @@ export const sourcesnapshot_referenceOffsets: (a: number) => [number, number];
118
118
  export const sourcesnapshot_referenceTargets: (a: number) => [number, number];
119
119
  export const sourcesnapshot_spillDerived: (a: number) => [number, number];
120
120
  export const windowview_nCols: (a: number) => number;
121
- export const windowview_nRows: (a: number) => number;
122
- export const windowview_takeCondMatches: (a: number) => [number, number];
123
- export const windowview_takeStringIds: (a: number) => [number, number];
124
- export const windowview_takeStringIndex: (a: number) => [number, number];
125
121
  export const windowview_takeStrings: (a: number) => [number, number];
126
- export const windowview_takeStyleDict: (a: number) => [number, number];
127
- export const windowview_takeStyleIndex: (a: number) => [number, number];
128
- export const windowview_takeKinds: (a: number) => [number, number];
129
- export const windowview_takeNumbers: (a: number) => [number, number];
122
+ export const windowview_takePacked: (a: number) => [number, number];
123
+ export const windowview_nRows: (a: number) => number;
130
124
  export const __wbindgen_malloc: (a: number, b: number) => number;
131
125
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
132
126
  export const __wbindgen_externrefs: WebAssembly.Table;