@truecalc/workbook 2.0.1 → 3.1.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,5 +1,16 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Result of [`translate_formula`]: either the rewritten `formula` text or an
|
|
5
|
+
* `error` message (mutually exclusive). Mirrors the `TranslateResult` shape
|
|
6
|
+
* exposed by the calc-only `@truecalc/core` WASM binding so both packages
|
|
7
|
+
* present the same reference-translation surface.
|
|
8
|
+
*/
|
|
9
|
+
export interface TranslateResult {
|
|
10
|
+
formula?: string;
|
|
11
|
+
error?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
3
14
|
|
|
4
15
|
/**
|
|
5
16
|
* A spreadsheet workbook exposed to JavaScript.
|
|
@@ -72,6 +83,22 @@ export class JsWorkbook {
|
|
|
72
83
|
toJSON(): string;
|
|
73
84
|
}
|
|
74
85
|
|
|
86
|
+
/**
|
|
87
|
+
* Shift every relative cell/range reference in `formula` by `(dRow, dCol)` —
|
|
88
|
+
* the fill / copy-paste reference-adjustment transform — using the engine's
|
|
89
|
+
* authoritative parser instead of a re-implemented tokenizer.
|
|
90
|
+
*
|
|
91
|
+
* `$`-absolute axes stay fixed; range endpoints and cross-sheet refs adjust
|
|
92
|
+
* while the sheet name is preserved; references inside string literals and
|
|
93
|
+
* function names are never rewritten; a name bound by `LET`/`LAMBDA` is left
|
|
94
|
+
* untouched. An axis that shifts out of the grid becomes a literal `#REF!`
|
|
95
|
+
* for that corner.
|
|
96
|
+
*
|
|
97
|
+
* Sheets flavor only (Excel grid bounds are a follow-up); a parse error is
|
|
98
|
+
* surfaced in the `error` field.
|
|
99
|
+
*/
|
|
100
|
+
export function translateFormula(formula: string, d_row: number, d_col: number): TranslateResult;
|
|
101
|
+
|
|
75
102
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
76
103
|
|
|
77
104
|
export interface InitOutput {
|
|
@@ -87,9 +114,10 @@ export interface InitOutput {
|
|
|
87
114
|
readonly jsworkbook_resolved: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
88
115
|
readonly jsworkbook_set: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
89
116
|
readonly jsworkbook_toJSON: (a: number, b: number) => void;
|
|
90
|
-
readonly
|
|
117
|
+
readonly translateFormula: (a: number, b: number, c: number, d: number) => number;
|
|
91
118
|
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
92
119
|
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
120
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
93
121
|
readonly __wbindgen_export3: (a: number, b: number, c: number) => void;
|
|
94
122
|
}
|
|
95
123
|
|
|
@@ -264,6 +264,31 @@ export class JsWorkbook {
|
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
266
|
if (Symbol.dispose) JsWorkbook.prototype[Symbol.dispose] = JsWorkbook.prototype.free;
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Shift every relative cell/range reference in `formula` by `(dRow, dCol)` —
|
|
270
|
+
* the fill / copy-paste reference-adjustment transform — using the engine's
|
|
271
|
+
* authoritative parser instead of a re-implemented tokenizer.
|
|
272
|
+
*
|
|
273
|
+
* `$`-absolute axes stay fixed; range endpoints and cross-sheet refs adjust
|
|
274
|
+
* while the sheet name is preserved; references inside string literals and
|
|
275
|
+
* function names are never rewritten; a name bound by `LET`/`LAMBDA` is left
|
|
276
|
+
* untouched. An axis that shifts out of the grid becomes a literal `#REF!`
|
|
277
|
+
* for that corner.
|
|
278
|
+
*
|
|
279
|
+
* Sheets flavor only (Excel grid bounds are a follow-up); a parse error is
|
|
280
|
+
* surfaced in the `error` field.
|
|
281
|
+
* @param {string} formula
|
|
282
|
+
* @param {number} d_row
|
|
283
|
+
* @param {number} d_col
|
|
284
|
+
* @returns {TranslateResult}
|
|
285
|
+
*/
|
|
286
|
+
export function translateFormula(formula, d_row, d_col) {
|
|
287
|
+
const ptr0 = passStringToWasm0(formula, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
288
|
+
const len0 = WASM_VECTOR_LEN;
|
|
289
|
+
const ret = wasm.translateFormula(ptr0, len0, d_row, d_col);
|
|
290
|
+
return takeObject(ret);
|
|
291
|
+
}
|
|
267
292
|
function __wbg_get_imports() {
|
|
268
293
|
const import0 = {
|
|
269
294
|
__proto__: null,
|
|
@@ -271,14 +296,35 @@ function __wbg_get_imports() {
|
|
|
271
296
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
272
297
|
return addHeapObject(ret);
|
|
273
298
|
},
|
|
299
|
+
__wbg_String_8564e559799eccda: function(arg0, arg1) {
|
|
300
|
+
const ret = String(getObject(arg1));
|
|
301
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
302
|
+
const len1 = WASM_VECTOR_LEN;
|
|
303
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
304
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
305
|
+
},
|
|
274
306
|
__wbg___wbindgen_throw_6b64449b9b9ed33c: function(arg0, arg1) {
|
|
275
307
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
276
308
|
},
|
|
309
|
+
__wbg_new_aa8d0fa9762c29bd: function() {
|
|
310
|
+
const ret = new Object();
|
|
311
|
+
return addHeapObject(ret);
|
|
312
|
+
},
|
|
313
|
+
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
314
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
315
|
+
},
|
|
277
316
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
278
317
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
279
318
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
280
319
|
return addHeapObject(ret);
|
|
281
320
|
},
|
|
321
|
+
__wbindgen_object_clone_ref: function(arg0) {
|
|
322
|
+
const ret = getObject(arg0);
|
|
323
|
+
return addHeapObject(ret);
|
|
324
|
+
},
|
|
325
|
+
__wbindgen_object_drop_ref: function(arg0) {
|
|
326
|
+
takeObject(arg0);
|
|
327
|
+
},
|
|
282
328
|
};
|
|
283
329
|
return {
|
|
284
330
|
__proto__: null,
|
|
Binary file
|