@rowsncolumns/rnc-yrs-store 0.30.0 → 0.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rnc_yrs_store.d.ts +13 -0
- package/dist/rnc_yrs_store.js +36 -0
- package/dist/rnc_yrs_store_bg.wasm +0 -0
- package/package.json +1 -1
package/dist/rnc_yrs_store.d.ts
CHANGED
|
@@ -330,6 +330,18 @@ export class SpreadsheetEngine {
|
|
|
330
330
|
* sheet registry is non-empty and contains no `sheetId: 1`. Returns `true` when pruned.
|
|
331
331
|
*/
|
|
332
332
|
pruneDanglingDefaultSeed(): boolean;
|
|
333
|
+
/**
|
|
334
|
+
* The record another replica holds under an `rncCells` key, as it reads on this engine's
|
|
335
|
+
* rows and columns: JSON `{sheetId, row, col, cell: {ue, ev, fv, ..} | null, derived}`,
|
|
336
|
+
* or `{"status":"gone"}` when a row or column of the key was deleted here.
|
|
337
|
+
* `foreign` is the other replica's whole state (`encodeStateAsUpdate`); a diff throws.
|
|
338
|
+
* Read-only: this engine's document is not changed. `cell` is `null` when the replica
|
|
339
|
+
* holds no typed record under the key (nothing typed, or cleared); `derived` says
|
|
340
|
+
* the engine wrote the record (a result, a formula's rewrite), not a person. The formula
|
|
341
|
+
* is rendered on this engine's lines and names; the result is the replica's own. Throws on
|
|
342
|
+
* a document that is not stable-ids.
|
|
343
|
+
*/
|
|
344
|
+
readForeignCell(foreign: Uint8Array, key: string): string;
|
|
333
345
|
/**
|
|
334
346
|
* Whether read-only mode is on (`setReadOnly`).
|
|
335
347
|
*/
|
|
@@ -770,6 +782,7 @@ export interface InitOutput {
|
|
|
770
782
|
readonly convertToStableIds: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
771
783
|
readonly spreadsheetengine_columnIds: (a: number, b: number) => [number, number];
|
|
772
784
|
readonly spreadsheetengine_parseStableCellKey: (a: number, b: number, c: number) => [number, number];
|
|
785
|
+
readonly spreadsheetengine_readForeignCell: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
773
786
|
readonly spreadsheetengine_rowIds: (a: number, b: number) => [number, number];
|
|
774
787
|
readonly spreadsheetengine_stableCellKey: (a: number, b: number, c: number, d: number) => [number, number];
|
|
775
788
|
readonly spreadsheetengine_anchorRange: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
package/dist/rnc_yrs_store.js
CHANGED
|
@@ -1076,6 +1076,42 @@ export class SpreadsheetEngine {
|
|
|
1076
1076
|
const ret = wasm.spreadsheetengine_pruneDanglingDefaultSeed(this.__wbg_ptr);
|
|
1077
1077
|
return ret !== 0;
|
|
1078
1078
|
}
|
|
1079
|
+
/**
|
|
1080
|
+
* The record another replica holds under an `rncCells` key, as it reads on this engine's
|
|
1081
|
+
* rows and columns: JSON `{sheetId, row, col, cell: {ue, ev, fv, ..} | null, derived}`,
|
|
1082
|
+
* or `{"status":"gone"}` when a row or column of the key was deleted here.
|
|
1083
|
+
* `foreign` is the other replica's whole state (`encodeStateAsUpdate`); a diff throws.
|
|
1084
|
+
* Read-only: this engine's document is not changed. `cell` is `null` when the replica
|
|
1085
|
+
* holds no typed record under the key (nothing typed, or cleared); `derived` says
|
|
1086
|
+
* the engine wrote the record (a result, a formula's rewrite), not a person. The formula
|
|
1087
|
+
* is rendered on this engine's lines and names; the result is the replica's own. Throws on
|
|
1088
|
+
* a document that is not stable-ids.
|
|
1089
|
+
* @param {Uint8Array} foreign
|
|
1090
|
+
* @param {string} key
|
|
1091
|
+
* @returns {string}
|
|
1092
|
+
*/
|
|
1093
|
+
readForeignCell(foreign, key) {
|
|
1094
|
+
let deferred4_0;
|
|
1095
|
+
let deferred4_1;
|
|
1096
|
+
try {
|
|
1097
|
+
const ptr0 = passArray8ToWasm0(foreign, wasm.__wbindgen_malloc);
|
|
1098
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1099
|
+
const ptr1 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1100
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1101
|
+
const ret = wasm.spreadsheetengine_readForeignCell(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1102
|
+
var ptr3 = ret[0];
|
|
1103
|
+
var len3 = ret[1];
|
|
1104
|
+
if (ret[3]) {
|
|
1105
|
+
ptr3 = 0; len3 = 0;
|
|
1106
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1107
|
+
}
|
|
1108
|
+
deferred4_0 = ptr3;
|
|
1109
|
+
deferred4_1 = len3;
|
|
1110
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1111
|
+
} finally {
|
|
1112
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1079
1115
|
/**
|
|
1080
1116
|
* Whether read-only mode is on (`setReadOnly`).
|
|
1081
1117
|
* @returns {boolean}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rowsncolumns/rnc-yrs-store",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.1",
|
|
4
4
|
"author": "Vinay M",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"description": "Document-backed Rust→WASM spreadsheet calc engine (yrs/CRDT, canonical sheetDataV3). Ships the `SpreadsheetEngine` (a `Store<YrsStore>`): applyCommand / undo / redo / canUndo + the Yjs collaboration surface (applyUpdate / takePendingUpdates / loadFromUpdate / stateAsUpdate) the Keryx update-pump binds to. This is the 1,000,000-row engine the demo-app ships today — previously vendored, now a versioned package. The PREBUILT wasm is included (consumers need NO Rust/wasm toolchain); the glue's default init REQUIRES an explicit `module_or_path` — pass the URL of the served `rnc_yrs_store_bg.wasm` (webpack/Turbopack statically resolve a bundled `new URL`, which would 404 from this package, so the inline-default branch is intentionally a throw).",
|