@hypen-space/core 0.4.32 → 0.4.35

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.
Files changed (71) hide show
  1. package/dist/app.d.ts +73 -2
  2. package/dist/app.js +112 -9
  3. package/dist/app.js.map +6 -5
  4. package/dist/components/builtin.js +112 -9
  5. package/dist/components/builtin.js.map +6 -5
  6. package/dist/context.d.ts +8 -0
  7. package/dist/context.js +6 -2
  8. package/dist/context.js.map +3 -3
  9. package/dist/datasource.d.ts +168 -0
  10. package/dist/discovery.js +114 -9
  11. package/dist/discovery.js.map +7 -6
  12. package/dist/disposable.js +6 -2
  13. package/dist/disposable.js.map +2 -2
  14. package/dist/engine.browser.d.ts +15 -0
  15. package/dist/engine.browser.js +19 -2
  16. package/dist/engine.browser.js.map +3 -3
  17. package/dist/engine.d.ts +22 -0
  18. package/dist/engine.js +37 -3
  19. package/dist/engine.js.map +3 -3
  20. package/dist/events.js +6 -2
  21. package/dist/events.js.map +2 -2
  22. package/dist/index.browser.js +295 -179
  23. package/dist/index.browser.js.map +9 -8
  24. package/dist/index.d.ts +3 -1
  25. package/dist/index.js +298 -179
  26. package/dist/index.js.map +10 -9
  27. package/dist/loader.js +6 -2
  28. package/dist/loader.js.map +2 -2
  29. package/dist/logger.js +6 -2
  30. package/dist/logger.js.map +2 -2
  31. package/dist/plugin.js +6 -2
  32. package/dist/plugin.js.map +2 -2
  33. package/dist/remote/client.js +6 -2
  34. package/dist/remote/client.js.map +2 -2
  35. package/dist/remote/index.js +152 -11
  36. package/dist/remote/index.js.map +9 -8
  37. package/dist/remote/server.js +152 -11
  38. package/dist/remote/server.js.map +9 -8
  39. package/dist/renderer.js +6 -2
  40. package/dist/renderer.js.map +2 -2
  41. package/dist/resolver.js +6 -2
  42. package/dist/resolver.js.map +2 -2
  43. package/dist/router.d.ts +9 -0
  44. package/dist/router.js +186 -18
  45. package/dist/router.js.map +6 -5
  46. package/dist/state.js +13 -6
  47. package/dist/state.js.map +3 -3
  48. package/package.json +1 -1
  49. package/src/app.ts +121 -4
  50. package/src/context.ts +10 -2
  51. package/src/datasource.ts +252 -0
  52. package/src/discovery.ts +2 -0
  53. package/src/engine.browser.ts +30 -0
  54. package/src/engine.ts +56 -1
  55. package/src/index.ts +16 -0
  56. package/src/managed-router.ts +3 -0
  57. package/src/remote/server.ts +11 -2
  58. package/src/router.ts +36 -10
  59. package/src/state.ts +10 -3
  60. package/wasm-browser/README.md +10 -10
  61. package/wasm-browser/hypen_engine.d.ts +368 -131
  62. package/wasm-browser/hypen_engine.js +896 -645
  63. package/wasm-browser/hypen_engine_bg.wasm +0 -0
  64. package/wasm-browser/hypen_engine_bg.wasm.d.ts +20 -13
  65. package/wasm-browser/package.json +1 -1
  66. package/wasm-node/README.md +10 -10
  67. package/wasm-node/hypen_engine.d.ts +318 -89
  68. package/wasm-node/hypen_engine.js +832 -613
  69. package/wasm-node/hypen_engine_bg.wasm +0 -0
  70. package/wasm-node/hypen_engine_bg.wasm.d.ts +20 -13
  71. package/wasm-node/package.json +1 -1
@@ -1,152 +1,389 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+
3
4
  /**
4
- * Export patches as JSON string (for debugging)
5
+ * The main Hypen engine interface for JavaScript/WASM runtimes.
6
+ *
7
+ * `WasmEngine` manages the full lifecycle of a Hypen UI: parsing DSL source,
8
+ * maintaining the virtual tree, tracking reactive dependencies, and emitting
9
+ * minimal patches when state changes. It runs in a single-threaded WASM
10
+ * environment (browsers, Node.js, Bun, Deno).
11
+ *
12
+ * # Quick Start
13
+ *
14
+ * ```js
15
+ * import { WasmEngine } from "@hypen-space/core";
16
+ *
17
+ * const engine = new WasmEngine();
18
+ *
19
+ * // 1. Register primitives so the engine doesn't try to resolve them as components
20
+ * engine.registerPrimitive("Text");
21
+ * engine.registerPrimitive("Column");
22
+ *
23
+ * // 2. Receive patches via callback
24
+ * engine.setRenderCallback((patches) => {
25
+ * for (const patch of patches) {
26
+ * applyPatch(patch); // Create, SetProp, Insert, Remove, etc.
27
+ * }
28
+ * });
29
+ *
30
+ * // 3. Optionally set up a module for stateful UI
31
+ * engine.setModule("Counter", ["increment"], ["count"], { count: 0 });
32
+ *
33
+ * // 4. Render DSL source — patches are emitted via the callback
34
+ * engine.renderSource('Column { Text("Count: ${state.count}") }');
35
+ *
36
+ * // 5. Update state — only affected nodes are re-rendered
37
+ * engine.updateState({ count: 1 });
38
+ * ```
39
+ *
40
+ * # Patch Protocol
41
+ *
42
+ * All UI mutations are expressed as [`Patch`] values emitted through the render
43
+ * callback. Patches use camelCase field names for direct JavaScript consumption.
44
+ * See [`Patch`] for the full variant list and field documentation.
45
+ *
46
+ * # Component Resolution
47
+ *
48
+ * Custom components (anything not registered as a primitive) are resolved lazily
49
+ * via the component resolver callback set with [`set_component_resolver`]. The
50
+ * resolver receives `(componentName, contextPath)` and should return
51
+ * `{ source: string, path: string }` or `null`.
52
+ *
53
+ * # Revision Tracking
54
+ *
55
+ * Every render cycle (initial render or state update that produces patches)
56
+ * increments the revision counter. Use [`get_revision`] to detect stale state
57
+ * in async workflows.
5
58
  */
6
- export function patchesToJson(patches: any): string;
59
+ export class WasmEngine {
60
+ free(): void;
61
+ [Symbol.dispose](): void;
62
+ /**
63
+ * Remove all nodes from the instance tree without emitting Remove patches.
64
+ *
65
+ * Use this when tearing down the UI entirely (e.g. navigating away or
66
+ * switching samples). The renderer is responsible for clearing its own
67
+ * DOM/canvas state separately.
68
+ */
69
+ clearTree(): void;
70
+ /**
71
+ * Return a JSON snapshot of the active module's current state.
72
+ *
73
+ * Returns `null` (as a `JsValue`) if no module is set.
74
+ * Useful for debugging and DevTools integration.
75
+ */
76
+ currentState(): any;
77
+ /**
78
+ * Parse a component and return a human-readable debug string.
79
+ *
80
+ * Intended for development tooling only — the output format is not stable.
81
+ */
82
+ debugParseComponent(source: string): string;
83
+ /**
84
+ * Dispatch a named action, invoking the registered handler (if any).
85
+ *
86
+ * Actions are the primary way UI events flow from the renderer back to
87
+ * application logic. In Hypen DSL, buttons reference actions like
88
+ * `Button("@actions.submit")` — the renderer maps clicks to
89
+ * `engine.dispatchAction("submit", payload)`.
90
+ *
91
+ * # Arguments
92
+ * * `name` — Action name (e.g. `"submit"`, `"increment"`)
93
+ * * `payload` — Optional JS value passed to the handler. `null`/`undefined` are treated as no payload.
94
+ *
95
+ * # Errors
96
+ *
97
+ * Returns an error if the payload cannot be deserialized. Does **not** error
98
+ * if no handler is registered (the action is silently dropped).
99
+ */
100
+ dispatchAction(name: string, payload: any): void;
101
+ /**
102
+ * Get the current revision number.
103
+ *
104
+ * Starts at 0 and increments by 1 for each render cycle that produces
105
+ * patches. Useful for cache invalidation and detecting stale async results.
106
+ */
107
+ getRevision(): bigint;
108
+ /**
109
+ * Create a new engine instance with an empty tree and no module.
110
+ *
111
+ * After construction, you typically:
112
+ * 1. Register primitives with [`register_primitive`]
113
+ * 2. Set a render callback with [`set_render_callback`]
114
+ * 3. Optionally set a component resolver with [`set_component_resolver`]
115
+ * 4. Optionally initialize a module with [`set_module`]
116
+ * 5. Render source with [`render_source`]
117
+ */
118
+ constructor();
119
+ /**
120
+ * Register a JavaScript function as the handler for a named action.
121
+ *
122
+ * When [`dispatch_action`] is called with a matching name, the handler
123
+ * receives a serialized [`Action`] object with `{ name, payload }`.
124
+ *
125
+ * Registering a handler for the same name replaces the previous one.
126
+ */
127
+ onAction(action_name: string, handler: Function): void;
128
+ /**
129
+ * Register a handler for data source actions.
130
+ *
131
+ * When [`dispatch_action`] is called with a name like `"spacetime.sendMessage"`
132
+ * and no explicit action handler is registered for that name, the engine checks
133
+ * if the prefix (`"spacetime"`) is a registered data source. If so, it calls
134
+ * this handler with `{ provider, method, payload }`.
135
+ *
136
+ * This enables `@actions.spacetime.sendMessage` in DSL to automatically route
137
+ * to the appropriate data source plugin without manual handler registration.
138
+ */
139
+ onDataSourceAction(handler: Function): void;
140
+ /**
141
+ * Register a primitive element (like Text, Button, etc.) to skip component resolution
142
+ * This prevents unnecessary resolver calls for built-in DOM elements
143
+ */
144
+ registerPrimitive(name: string): void;
145
+ /**
146
+ * Remove a data source context entirely.
147
+ *
148
+ * Drops the provider's state and re-renders bound nodes (they resolve to `null`).
149
+ */
150
+ removeContext(name: string): void;
151
+ /**
152
+ * Render a component into a specific parent node (subtree rendering)
153
+ * This is used for lazy routing where components are rendered on-demand into route containers
154
+ *
155
+ * # Arguments
156
+ * * `source` - The Hypen DSL source to parse and render
157
+ * * `parent_node_id_str` - The serialized node ID string of the parent element
158
+ * * `state_js` - The state to use for rendering (as JsValue)
159
+ */
160
+ renderInto(source: string, parent_node_id_str: string, state_js: any): void;
161
+ /**
162
+ * Render a component source on-demand (for lazy-loaded routes).
163
+ *
164
+ * Equivalent to calling [`render_source`] — the source is parsed as a full
165
+ * document and replaces the current tree.
166
+ */
167
+ renderLazyComponent(source: string): void;
168
+ /**
169
+ * Parse and render Hypen DSL source code, emitting patches via the render callback.
170
+ *
171
+ * Supports full document syntax including `import` statements. Imports are
172
+ * resolved synchronously through the component resolver callback (if set).
173
+ *
174
+ * This performs a **full reconciliation** — the existing tree is diffed against
175
+ * the new IR and minimal patches are emitted. Calling this multiple times with
176
+ * different source replaces the previous UI.
177
+ *
178
+ * # Errors
179
+ *
180
+ * Returns a `JsValue` string error if the source fails to parse.
181
+ */
182
+ renderSource(source: string): void;
183
+ /**
184
+ * Fully reset the engine to its initial empty state.
185
+ *
186
+ * Clears the tree, module, dependencies, scheduler, action handlers,
187
+ * component registry, and resets the revision to 0. The render callback
188
+ * and component resolver are preserved.
189
+ */
190
+ reset(): void;
191
+ /**
192
+ * Set the component resolver callback
193
+ * The resolver receives (componentName, contextPath) and should return
194
+ * { source: string, path: string } or null
195
+ *
196
+ * contextPath is the path of the component that's referencing this component
197
+ * The returned path should be the resolved absolute path to the component file
198
+ */
199
+ setComponentResolver(resolver: Function): void;
200
+ /**
201
+ * Set (or replace) a named data source context.
202
+ *
203
+ * Registers the provider in the dependency graph (if not already known),
204
+ * stores the data, and re-renders every node bound to `$name.*`.
205
+ * Sparse merging (if needed) should happen at the SDK layer before
206
+ * calling this method with the merged object.
207
+ *
208
+ * # Example (JS)
209
+ * ```js
210
+ * engine.setContext("spacetime", {
211
+ * message: [{ id: 1, text: "Hello" }, { id: 2, text: "World" }],
212
+ * user: [{ id: 1, name: "Alice", online: true }]
213
+ * });
214
+ * ```
215
+ */
216
+ setContext(name: string, data_js: any): void;
217
+ /**
218
+ * Initialize (or replace) the active module with the given configuration.
219
+ *
220
+ * A module provides stateful context for `${state.xxx}` bindings in the DSL.
221
+ * Only one module is active at a time — calling this again replaces it.
222
+ *
223
+ * # Arguments
224
+ * * `name` — Module identifier (e.g. `"Counter"`, `"ProfilePage"`)
225
+ * * `actions` — List of action names this module handles
226
+ * * `state_keys` — List of top-level state keys (used for validation)
227
+ * * `initial_state` — The starting state as a JS object
228
+ *
229
+ * # Errors
230
+ *
231
+ * Returns an error if `initial_state` cannot be deserialized as JSON.
232
+ */
233
+ setModule(name: string, actions: string[], state_keys: string[], initial_state: any): void;
234
+ /**
235
+ * Set the callback that receives UI patches after each render cycle.
236
+ *
237
+ * The callback is invoked with a single argument: a JavaScript array of
238
+ * [`Patch`] objects. Each patch describes one atomic DOM operation (Create,
239
+ * SetProp, SetText, Insert, Move, Remove, RemoveProp).
240
+ *
241
+ * The callback is called synchronously during `renderSource()`, `updateState()`,
242
+ * `updateStateSparse()`, and `renderInto()`.
243
+ *
244
+ * # Example (JS)
245
+ * ```js
246
+ * engine.setRenderCallback((patches) => {
247
+ * for (const p of patches) {
248
+ * switch (p.type) {
249
+ * case "create": createElement(p.id, p.elementType, p.props); break;
250
+ * case "setProp": setProperty(p.id, p.name, p.value); break;
251
+ * case "insert": insertChild(p.parentId, p.id, p.beforeId); break;
252
+ * // ...
253
+ * }
254
+ * }
255
+ * });
256
+ * ```
257
+ */
258
+ setRenderCallback(callback: Function): void;
259
+ /**
260
+ * Return the total number of nodes currently in the instance tree.
261
+ *
262
+ * Useful for debugging, performance monitoring, and DevTools.
263
+ */
264
+ treeSize(): number;
265
+ /**
266
+ * Apply a state patch and re-render affected nodes.
267
+ *
268
+ * The `state_patch` is a JavaScript object whose keys are merged into the
269
+ * current module state (deep merge). Only nodes whose bindings reference
270
+ * changed paths are re-rendered, producing minimal patches.
271
+ *
272
+ * # Example (JS)
273
+ * ```js
274
+ * // Updates state.user.name and state.count, re-renders bound nodes
275
+ * engine.updateState({ user: { name: "Bob" }, count: 42 });
276
+ * ```
277
+ *
278
+ * # Errors
279
+ *
280
+ * Returns an error if `state_patch` cannot be deserialized as JSON.
281
+ */
282
+ updateState(state_patch: any): void;
283
+ /**
284
+ * Apply a sparse state update using explicit path-value pairs.
285
+ *
286
+ * More efficient than [`update_state`] for large state objects when only a
287
+ * few deeply-nested paths changed, because it avoids a full deep-merge.
288
+ *
289
+ * # Arguments
290
+ * * `paths_js` — JS array of dot-separated paths that changed (e.g. `["user.name", "count"]`)
291
+ * * `values_js` — JS object mapping each path to its new value (e.g. `{ "user.name": "Bob", "count": 42 }`)
292
+ *
293
+ * # Errors
294
+ *
295
+ * Returns an error if either argument cannot be deserialized.
296
+ */
297
+ updateStateSparse(paths_js: any, values_js: any): void;
298
+ /**
299
+ * Validate that the engine is in a consistent state.
300
+ *
301
+ * Checks that:
302
+ * - All child references point to existing nodes
303
+ * - All parent back-references are correct
304
+ * - The root node (if any) exists in the tree
305
+ *
306
+ * Returns `null` if valid, or a string describing the first inconsistency found.
307
+ * Intended for testing and debugging only — not for production hot paths.
308
+ */
309
+ validate(): any;
310
+ }
311
+
312
+ export function main(): void;
313
+
7
314
  /**
8
- * Parse Hypen DSL and return AST as JSON
315
+ * Parse Hypen DSL source and return the AST as a pretty-printed JSON string.
316
+ *
317
+ * Useful for tooling, syntax highlighting, and debugging the parser output.
9
318
  */
10
319
  export function parseToJson(source: string): string;
11
- export function main(): void;
320
+
12
321
  /**
13
- * WASM-exported engine instance for JavaScript runtimes
14
- * Uses Rc<RefCell<>> instead of Send+Sync for WASM single-threaded environment
322
+ * Serialize a patches array to a pretty-printed JSON string.
323
+ *
324
+ * Intended for debugging and logging — not for production use.
325
+ * Accepts a JS array of patch objects and returns formatted JSON.
15
326
  */
16
- export class WasmEngine {
17
- free(): void;
18
- [Symbol.dispose](): void;
19
- /**
20
- * Create a new engine instance
21
- */
22
- constructor();
23
- /**
24
- * Parse and render Hypen DSL source code
25
- * Supports documents with import statements - imports are resolved via the component resolver
26
- */
27
- renderSource(source: string): void;
28
- /**
29
- * Set the render callback that receives patches
30
- */
31
- setRenderCallback(callback: Function): void;
32
- /**
33
- * Set the component resolver callback
34
- * The resolver receives (componentName, contextPath) and should return
35
- * { source: string, path: string } or null
36
- *
37
- * contextPath is the path of the component that's referencing this component
38
- * The returned path should be the resolved absolute path to the component file
39
- */
40
- setComponentResolver(resolver: Function): void;
41
- /**
42
- * Register a primitive element (like Text, Button, etc.) to skip component resolution
43
- * This prevents unnecessary resolver calls for built-in DOM elements
44
- */
45
- registerPrimitive(name: string): void;
46
- /**
47
- * Render a component source (for lazy loading routes)
48
- * This allows rendering a component on-demand
49
- */
50
- renderLazyComponent(source: string): void;
51
- /**
52
- * Render a component into a specific parent node (subtree rendering)
53
- * This is used for lazy routing where components are rendered on-demand into route containers
54
- *
55
- * # Arguments
56
- * * `source` - The Hypen DSL source to parse and render
57
- * * `parent_node_id_str` - The serialized node ID string of the parent element
58
- * * `state_js` - The state to use for rendering (as JsValue)
59
- */
60
- renderInto(source: string, parent_node_id_str: string, state_js: any): void;
61
- /**
62
- * Update state from JavaScript
63
- */
64
- updateState(state_patch: any): void;
65
- /**
66
- * Update state using sparse path-value pairs
67
- * More efficient than updateState for large state objects when only a few paths changed
68
- *
69
- * # Arguments
70
- * * `paths_js` - Array of changed paths (e.g., ["user.name", "count"])
71
- * * `values_js` - Object mapping paths to their new values (e.g., { "user.name": "Bob", "count": 42 })
72
- */
73
- updateStateSparse(paths_js: any, values_js: any): void;
74
- /**
75
- * Dispatch an action
76
- */
77
- dispatchAction(name: string, payload: any): void;
78
- /**
79
- * Register an action handler
80
- */
81
- onAction(action_name: string, handler: Function): void;
82
- /**
83
- * Clear the engine tree (useful when switching samples)
84
- */
85
- clearTree(): void;
86
- /**
87
- * Debug method to inspect parsed components
88
- */
89
- debugParseComponent(source: string): string;
90
- /**
91
- * Initialize a module
92
- */
93
- setModule(name: string, actions: string[], state_keys: string[], initial_state: any): void;
94
- /**
95
- * Get the current revision number
96
- */
97
- getRevision(): bigint;
98
- }
327
+ export function patchesToJson(patches: any): string;
99
328
 
100
329
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
101
330
 
102
331
  export interface InitOutput {
103
- readonly memory: WebAssembly.Memory;
104
- readonly __wbg_wasmengine_free: (a: number, b: number) => void;
105
- readonly wasmengine_new: () => number;
106
- readonly wasmengine_setRenderCallback: (a: number, b: any) => void;
107
- readonly wasmengine_setComponentResolver: (a: number, b: any) => void;
108
- readonly wasmengine_registerPrimitive: (a: number, b: number, c: number) => void;
109
- readonly wasmengine_renderLazyComponent: (a: number, b: number, c: number) => [number, number];
110
- readonly wasmengine_renderInto: (a: number, b: number, c: number, d: number, e: number, f: any) => [number, number];
111
- readonly wasmengine_updateState: (a: number, b: any) => [number, number];
112
- readonly wasmengine_updateStateSparse: (a: number, b: any, c: any) => [number, number];
113
- readonly wasmengine_dispatchAction: (a: number, b: number, c: number, d: any) => [number, number];
114
- readonly wasmengine_onAction: (a: number, b: number, c: number, d: any) => void;
115
- readonly wasmengine_clearTree: (a: number) => void;
116
- readonly wasmengine_debugParseComponent: (a: number, b: number, c: number) => [number, number, number, number];
117
- readonly wasmengine_setModule: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: any) => [number, number];
118
- readonly wasmengine_getRevision: (a: number) => bigint;
119
- readonly patchesToJson: (a: any) => [number, number, number, number];
120
- readonly parseToJson: (a: number, b: number) => [number, number, number, number];
121
- readonly main: () => void;
122
- readonly wasmengine_renderSource: (a: number, b: number, c: number) => [number, number];
123
- readonly __wbindgen_malloc: (a: number, b: number) => number;
124
- readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
125
- readonly __wbindgen_exn_store: (a: number) => void;
126
- readonly __externref_table_alloc: () => number;
127
- readonly __wbindgen_export_4: WebAssembly.Table;
128
- readonly __externref_table_dealloc: (a: number) => void;
129
- readonly __wbindgen_free: (a: number, b: number, c: number) => void;
130
- readonly __wbindgen_start: () => void;
332
+ readonly memory: WebAssembly.Memory;
333
+ readonly __wbg_wasmengine_free: (a: number, b: number) => void;
334
+ readonly main: () => void;
335
+ readonly parseToJson: (a: number, b: number) => [number, number, number, number];
336
+ readonly patchesToJson: (a: any) => [number, number, number, number];
337
+ readonly wasmengine_clearTree: (a: number) => void;
338
+ readonly wasmengine_currentState: (a: number) => any;
339
+ readonly wasmengine_debugParseComponent: (a: number, b: number, c: number) => [number, number, number, number];
340
+ readonly wasmengine_dispatchAction: (a: number, b: number, c: number, d: any) => [number, number];
341
+ readonly wasmengine_getRevision: (a: number) => bigint;
342
+ readonly wasmengine_new: () => number;
343
+ readonly wasmengine_onAction: (a: number, b: number, c: number, d: any) => void;
344
+ readonly wasmengine_onDataSourceAction: (a: number, b: any) => void;
345
+ readonly wasmengine_registerPrimitive: (a: number, b: number, c: number) => void;
346
+ readonly wasmengine_removeContext: (a: number, b: number, c: number) => void;
347
+ readonly wasmengine_renderInto: (a: number, b: number, c: number, d: number, e: number, f: any) => [number, number];
348
+ readonly wasmengine_renderLazyComponent: (a: number, b: number, c: number) => [number, number];
349
+ readonly wasmengine_reset: (a: number) => void;
350
+ readonly wasmengine_setComponentResolver: (a: number, b: any) => void;
351
+ readonly wasmengine_setContext: (a: number, b: number, c: number, d: any) => [number, number];
352
+ readonly wasmengine_setModule: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: any) => [number, number];
353
+ readonly wasmengine_setRenderCallback: (a: number, b: any) => void;
354
+ readonly wasmengine_treeSize: (a: number) => number;
355
+ readonly wasmengine_updateState: (a: number, b: any) => [number, number];
356
+ readonly wasmengine_updateStateSparse: (a: number, b: any, c: any) => [number, number];
357
+ readonly wasmengine_validate: (a: number) => any;
358
+ readonly wasmengine_renderSource: (a: number, b: number, c: number) => [number, number];
359
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
360
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
361
+ readonly __wbindgen_exn_store: (a: number) => void;
362
+ readonly __externref_table_alloc: () => number;
363
+ readonly __wbindgen_externrefs: WebAssembly.Table;
364
+ readonly __externref_table_dealloc: (a: number) => void;
365
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
366
+ readonly __wbindgen_start: () => void;
131
367
  }
132
368
 
133
369
  export type SyncInitInput = BufferSource | WebAssembly.Module;
370
+
134
371
  /**
135
- * Instantiates the given `module`, which can either be bytes or
136
- * a precompiled `WebAssembly.Module`.
137
- *
138
- * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
139
- *
140
- * @returns {InitOutput}
141
- */
372
+ * Instantiates the given `module`, which can either be bytes or
373
+ * a precompiled `WebAssembly.Module`.
374
+ *
375
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
376
+ *
377
+ * @returns {InitOutput}
378
+ */
142
379
  export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
143
380
 
144
381
  /**
145
- * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
146
- * for everything else, calls `WebAssembly.instantiate` directly.
147
- *
148
- * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
149
- *
150
- * @returns {Promise<InitOutput>}
151
- */
382
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
383
+ * for everything else, calls `WebAssembly.instantiate` directly.
384
+ *
385
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
386
+ *
387
+ * @returns {Promise<InitOutput>}
388
+ */
152
389
  export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;