@quarb/wasm 0.12.1 → 0.14.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": "@quarb/wasm",
3
- "version": "0.12.1",
3
+ "version": "0.14.0",
4
4
  "description": "Quarb \u2014 the arboreal query engine \u2014 compiled to WebAssembly, with TypeScript types. One-shot queries over JSON, YAML, TOML, CSV, XML, HTML, and Markdown, plus the quai session engine (multi-source mounts, joins, &N history, kaiv, SQLite) \u2014 entirely client-side.",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/quai_wasm.d.ts CHANGED
@@ -19,6 +19,16 @@ export class QuaiSession {
19
19
  * one-document constructor does.
20
20
  */
21
21
  static mount(sources_json: string, now_millis: number): QuaiSession;
22
+ /**
23
+ * [`mount`], enriched by a `--model` file (`model_text`): the
24
+ * session runs every line against the derived structure the
25
+ * model declares over the mounted sources — value containers,
26
+ * references, and pair edges. The model's own `mount` statements
27
+ * are ignored here (the sources come from the caller, not from
28
+ * disk the wasm cannot read); its `node`/`ref`/`edge`/`def`
29
+ * statements apply.
30
+ */
31
+ static mountWithModel(sources_json: string, model_text: string, now_millis: number): QuaiSession;
22
32
  /**
23
33
  * Open a session over `input` parsed as `format` (json, yaml,
24
34
  * toml, csv, tsv, xml, html, markdown). `now_millis` pins the
@@ -80,6 +90,7 @@ export interface InitOutput {
80
90
  readonly quaisession_history: (a: number) => [number, number];
81
91
  readonly quaisession_line: (a: number) => number;
82
92
  readonly quaisession_mount: (a: number, b: number, c: number) => [number, number, number];
93
+ readonly quaisession_mountWithModel: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
83
94
  readonly quaisession_new: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
84
95
  readonly quaisession_reset: (a: number) => void;
85
96
  readonly quaisession_restore: (a: number, b: number, c: number) => void;
package/quai_wasm.js CHANGED
@@ -63,6 +63,30 @@ export class QuaiSession {
63
63
  }
64
64
  return QuaiSession.__wrap(ret[0]);
65
65
  }
66
+ /**
67
+ * [`mount`], enriched by a `--model` file (`model_text`): the
68
+ * session runs every line against the derived structure the
69
+ * model declares over the mounted sources — value containers,
70
+ * references, and pair edges. The model's own `mount` statements
71
+ * are ignored here (the sources come from the caller, not from
72
+ * disk the wasm cannot read); its `node`/`ref`/`edge`/`def`
73
+ * statements apply.
74
+ * @param {string} sources_json
75
+ * @param {string} model_text
76
+ * @param {number} now_millis
77
+ * @returns {QuaiSession}
78
+ */
79
+ static mountWithModel(sources_json, model_text, now_millis) {
80
+ const ptr0 = passStringToWasm0(sources_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
81
+ const len0 = WASM_VECTOR_LEN;
82
+ const ptr1 = passStringToWasm0(model_text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
83
+ const len1 = WASM_VECTOR_LEN;
84
+ const ret = wasm.quaisession_mountWithModel(ptr0, len0, ptr1, len1, now_millis);
85
+ if (ret[2]) {
86
+ throw takeFromExternrefTable0(ret[1]);
87
+ }
88
+ return QuaiSession.__wrap(ret[0]);
89
+ }
66
90
  /**
67
91
  * Open a session over `input` parsed as `format` (json, yaml,
68
92
  * toml, csv, tsv, xml, html, markdown). `now_millis` pins the
package/quai_wasm_bg.wasm CHANGED
Binary file
Binary file