@wiscale/velesdb-wasm 1.4.1 → 1.6.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/LICENSE +21 -0
- package/README.md +117 -33
- package/package.json +2 -2
- package/velesdb_wasm.d.ts +940 -794
- package/velesdb_wasm.js +1949 -1718
- package/velesdb_wasm_bg.wasm +0 -0
package/velesdb_wasm.d.ts
CHANGED
|
@@ -1,661 +1,790 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* A graph edge representing a relationship between nodes.
|
|
6
|
+
*/
|
|
4
7
|
export class GraphEdge {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
8
|
+
free(): void;
|
|
9
|
+
[Symbol.dispose](): void;
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new graph edge.
|
|
12
|
+
*
|
|
13
|
+
* # Arguments
|
|
14
|
+
*
|
|
15
|
+
* * `id` - Unique identifier for the edge
|
|
16
|
+
* * `source` - Source node ID
|
|
17
|
+
* * `target` - Target node ID
|
|
18
|
+
* * `label` - Relationship type (e.g., "KNOWS", "WROTE")
|
|
19
|
+
*/
|
|
20
|
+
constructor(id: bigint, source: bigint, target: bigint, label: string);
|
|
21
|
+
/**
|
|
22
|
+
* Sets a numeric property on the edge.
|
|
23
|
+
*/
|
|
24
|
+
set_number_property(key: string, value: number): void;
|
|
25
|
+
/**
|
|
26
|
+
* Sets a string property on the edge.
|
|
27
|
+
*/
|
|
28
|
+
set_string_property(key: string, value: string): void;
|
|
29
|
+
/**
|
|
30
|
+
* Converts to JSON for JavaScript interop.
|
|
31
|
+
*/
|
|
32
|
+
to_json(): any;
|
|
33
|
+
/**
|
|
34
|
+
* Returns the edge ID.
|
|
35
|
+
*/
|
|
36
|
+
readonly id: bigint;
|
|
37
|
+
/**
|
|
38
|
+
* Returns the edge label (relationship type).
|
|
39
|
+
*/
|
|
40
|
+
readonly label: string;
|
|
41
|
+
/**
|
|
42
|
+
* Returns the source node ID.
|
|
43
|
+
*/
|
|
44
|
+
readonly source: bigint;
|
|
45
|
+
/**
|
|
46
|
+
* Returns the target node ID.
|
|
47
|
+
*/
|
|
48
|
+
readonly target: bigint;
|
|
46
49
|
}
|
|
47
50
|
|
|
51
|
+
/**
|
|
52
|
+
* A graph node for knowledge graph construction.
|
|
53
|
+
*/
|
|
48
54
|
export class GraphNode {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
55
|
+
free(): void;
|
|
56
|
+
[Symbol.dispose](): void;
|
|
57
|
+
/**
|
|
58
|
+
* Returns true if this node has a vector embedding.
|
|
59
|
+
*/
|
|
60
|
+
has_vector(): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Creates a new graph node.
|
|
63
|
+
*
|
|
64
|
+
* # Arguments
|
|
65
|
+
*
|
|
66
|
+
* * `id` - Unique identifier for the node
|
|
67
|
+
* * `label` - Node type/label (e.g., "Person", "Document")
|
|
68
|
+
*/
|
|
69
|
+
constructor(id: bigint, label: string);
|
|
70
|
+
/**
|
|
71
|
+
* Sets a boolean property on the node.
|
|
72
|
+
*/
|
|
73
|
+
set_bool_property(key: string, value: boolean): void;
|
|
74
|
+
/**
|
|
75
|
+
* Sets a numeric property on the node.
|
|
76
|
+
*/
|
|
77
|
+
set_number_property(key: string, value: number): void;
|
|
78
|
+
/**
|
|
79
|
+
* Sets a string property on the node.
|
|
80
|
+
*/
|
|
81
|
+
set_string_property(key: string, value: string): void;
|
|
82
|
+
/**
|
|
83
|
+
* Sets a vector embedding on the node.
|
|
84
|
+
*/
|
|
85
|
+
set_vector(vector: Float32Array): void;
|
|
86
|
+
/**
|
|
87
|
+
* Converts to JSON for JavaScript interop.
|
|
88
|
+
*/
|
|
89
|
+
to_json(): any;
|
|
90
|
+
/**
|
|
91
|
+
* Returns the node ID.
|
|
92
|
+
*/
|
|
93
|
+
readonly id: bigint;
|
|
94
|
+
/**
|
|
95
|
+
* Returns the node label.
|
|
96
|
+
*/
|
|
97
|
+
readonly label: string;
|
|
92
98
|
}
|
|
93
99
|
|
|
100
|
+
/**
|
|
101
|
+
* `IndexedDB` persistence manager for `GraphStore`.
|
|
102
|
+
*/
|
|
94
103
|
export class GraphPersistence {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
104
|
+
free(): void;
|
|
105
|
+
[Symbol.dispose](): void;
|
|
106
|
+
/**
|
|
107
|
+
* Deletes a saved graph by name.
|
|
108
|
+
*
|
|
109
|
+
* BUG-7 FIX: Also deletes all nodes and edges with the graph prefix.
|
|
110
|
+
*/
|
|
111
|
+
delete_graph(graph_name: string): Promise<void>;
|
|
112
|
+
/**
|
|
113
|
+
* Gets metadata for a saved graph.
|
|
114
|
+
*/
|
|
115
|
+
get_metadata(graph_name: string): Promise<any>;
|
|
116
|
+
/**
|
|
117
|
+
* Initializes the database connection. Must be called before save/load.
|
|
118
|
+
*/
|
|
119
|
+
init(): Promise<void>;
|
|
120
|
+
/**
|
|
121
|
+
* Lists all saved graph names.
|
|
122
|
+
*/
|
|
123
|
+
list_graphs(): Promise<Array<any>>;
|
|
124
|
+
/**
|
|
125
|
+
* Loads a graph from `IndexedDB` by name.
|
|
126
|
+
*
|
|
127
|
+
* BUG-6 FIX: Only loads nodes/edges with keys prefixed by `{graph_name}:`
|
|
128
|
+
*/
|
|
129
|
+
load(graph_name: string): Promise<GraphStore>;
|
|
130
|
+
/**
|
|
131
|
+
* Creates a new `GraphPersistence` instance (call `init()` to open database).
|
|
132
|
+
*/
|
|
133
|
+
constructor();
|
|
134
|
+
/**
|
|
135
|
+
* Saves a graph to `IndexedDB` with the given name.
|
|
136
|
+
*/
|
|
137
|
+
save(graph_name: string, store: GraphStore): Promise<void>;
|
|
129
138
|
}
|
|
130
139
|
|
|
140
|
+
/**
|
|
141
|
+
* In-memory graph store for browser-based knowledge graphs.
|
|
142
|
+
*
|
|
143
|
+
* Stores nodes and edges with bidirectional indexing for efficient traversal.
|
|
144
|
+
*/
|
|
131
145
|
export class GraphStore {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
146
|
+
free(): void;
|
|
147
|
+
[Symbol.dispose](): void;
|
|
148
|
+
/**
|
|
149
|
+
* Adds an edge to the graph.
|
|
150
|
+
*
|
|
151
|
+
* Returns an error if an edge with the same ID already exists.
|
|
152
|
+
*/
|
|
153
|
+
add_edge(edge: GraphEdge): void;
|
|
154
|
+
/**
|
|
155
|
+
* Adds a node to the graph.
|
|
156
|
+
*/
|
|
157
|
+
add_node(node: GraphNode): void;
|
|
158
|
+
/**
|
|
159
|
+
* Performs BFS traversal from a source node.
|
|
160
|
+
*
|
|
161
|
+
* # Arguments
|
|
162
|
+
*
|
|
163
|
+
* * `source_id` - Starting node ID
|
|
164
|
+
* * `max_depth` - Maximum traversal depth
|
|
165
|
+
* * `limit` - Maximum number of results
|
|
166
|
+
*
|
|
167
|
+
* # Returns
|
|
168
|
+
*
|
|
169
|
+
* Array of reachable node IDs with their depths.
|
|
170
|
+
*/
|
|
171
|
+
bfs_traverse(source_id: bigint, max_depth: number, limit: number): any;
|
|
172
|
+
/**
|
|
173
|
+
* Clears all nodes and edges.
|
|
174
|
+
*/
|
|
175
|
+
clear(): void;
|
|
176
|
+
/**
|
|
177
|
+
* Performs DFS traversal from a source node.
|
|
178
|
+
*
|
|
179
|
+
* # Arguments
|
|
180
|
+
*
|
|
181
|
+
* * `source_id` - Starting node ID
|
|
182
|
+
* * `max_depth` - Maximum traversal depth
|
|
183
|
+
* * `limit` - Maximum number of results
|
|
184
|
+
*
|
|
185
|
+
* # Returns
|
|
186
|
+
*
|
|
187
|
+
* Array of reachable node IDs with their depths (depth-first order).
|
|
188
|
+
*/
|
|
189
|
+
dfs_traverse(source_id: bigint, max_depth: number, limit: number): any;
|
|
190
|
+
/**
|
|
191
|
+
* Gets all edge IDs in the graph.
|
|
192
|
+
*/
|
|
193
|
+
get_all_edge_ids(): BigUint64Array;
|
|
194
|
+
/**
|
|
195
|
+
* Gets all node IDs in the graph.
|
|
196
|
+
*/
|
|
197
|
+
get_all_node_ids(): BigUint64Array;
|
|
198
|
+
/**
|
|
199
|
+
* Gets an edge by ID.
|
|
200
|
+
*/
|
|
201
|
+
get_edge(id: bigint): GraphEdge | undefined;
|
|
202
|
+
/**
|
|
203
|
+
* Gets all edges with a specific label.
|
|
204
|
+
*
|
|
205
|
+
* # Arguments
|
|
206
|
+
*
|
|
207
|
+
* * `label` - The relationship type to filter by
|
|
208
|
+
*
|
|
209
|
+
* # Returns
|
|
210
|
+
*
|
|
211
|
+
* Array of edges matching the label.
|
|
212
|
+
*/
|
|
213
|
+
get_edges_by_label(label: string): GraphEdge[];
|
|
214
|
+
/**
|
|
215
|
+
* Gets incoming edges to a node.
|
|
216
|
+
*/
|
|
217
|
+
get_incoming(node_id: bigint): GraphEdge[];
|
|
218
|
+
/**
|
|
219
|
+
* Gets neighbors reachable from a node (1-hop).
|
|
220
|
+
*/
|
|
221
|
+
get_neighbors(node_id: bigint): BigUint64Array;
|
|
222
|
+
/**
|
|
223
|
+
* Gets a node by ID.
|
|
224
|
+
*/
|
|
225
|
+
get_node(id: bigint): GraphNode | undefined;
|
|
226
|
+
/**
|
|
227
|
+
* Gets all nodes with a specific label.
|
|
228
|
+
*
|
|
229
|
+
* # Arguments
|
|
230
|
+
*
|
|
231
|
+
* * `label` - The label to filter by
|
|
232
|
+
*
|
|
233
|
+
* # Returns
|
|
234
|
+
*
|
|
235
|
+
* Array of nodes matching the label.
|
|
236
|
+
*/
|
|
237
|
+
get_nodes_by_label(label: string): GraphNode[];
|
|
238
|
+
/**
|
|
239
|
+
* Gets outgoing edges from a node.
|
|
240
|
+
*/
|
|
241
|
+
get_outgoing(node_id: bigint): GraphEdge[];
|
|
242
|
+
/**
|
|
243
|
+
* Gets outgoing edges filtered by label.
|
|
244
|
+
*/
|
|
245
|
+
get_outgoing_by_label(node_id: bigint, label: string): GraphEdge[];
|
|
246
|
+
/**
|
|
247
|
+
* Checks if an edge exists.
|
|
248
|
+
*/
|
|
249
|
+
has_edge(id: bigint): boolean;
|
|
250
|
+
/**
|
|
251
|
+
* Checks if a node exists.
|
|
252
|
+
*/
|
|
253
|
+
has_node(id: bigint): boolean;
|
|
254
|
+
/**
|
|
255
|
+
* Gets the in-degree (number of incoming edges) of a node.
|
|
256
|
+
*/
|
|
257
|
+
in_degree(node_id: bigint): number;
|
|
258
|
+
/**
|
|
259
|
+
* Creates a new empty graph store.
|
|
260
|
+
*/
|
|
261
|
+
constructor();
|
|
262
|
+
/**
|
|
263
|
+
* Gets the degree (number of outgoing edges) of a node.
|
|
264
|
+
*/
|
|
265
|
+
out_degree(node_id: bigint): number;
|
|
266
|
+
/**
|
|
267
|
+
* Removes an edge by ID.
|
|
268
|
+
*/
|
|
269
|
+
remove_edge(edge_id: bigint): void;
|
|
270
|
+
/**
|
|
271
|
+
* Removes a node and all connected edges.
|
|
272
|
+
*/
|
|
273
|
+
remove_node(node_id: bigint): void;
|
|
274
|
+
/**
|
|
275
|
+
* Returns the number of edges.
|
|
276
|
+
*/
|
|
277
|
+
readonly edge_count: number;
|
|
278
|
+
/**
|
|
279
|
+
* Returns the number of nodes.
|
|
280
|
+
*/
|
|
281
|
+
readonly node_count: number;
|
|
268
282
|
}
|
|
269
283
|
|
|
284
|
+
/**
|
|
285
|
+
* Configuration for Web Worker traversal decisions.
|
|
286
|
+
*/
|
|
270
287
|
export class GraphWorkerConfig {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
288
|
+
free(): void;
|
|
289
|
+
[Symbol.dispose](): void;
|
|
290
|
+
/**
|
|
291
|
+
* Creates a configuration optimized for large graphs.
|
|
292
|
+
*/
|
|
293
|
+
static for_large_graphs(): GraphWorkerConfig;
|
|
294
|
+
/**
|
|
295
|
+
* Creates a configuration optimized for responsive UI.
|
|
296
|
+
*/
|
|
297
|
+
static for_responsive_ui(): GraphWorkerConfig;
|
|
298
|
+
/**
|
|
299
|
+
* Creates a new configuration with default values.
|
|
300
|
+
*/
|
|
301
|
+
constructor();
|
|
302
|
+
/**
|
|
303
|
+
* Minimum depth to trigger worker offload.
|
|
304
|
+
*/
|
|
305
|
+
depth_threshold: number;
|
|
306
|
+
/**
|
|
307
|
+
* Minimum node count to trigger worker offload.
|
|
308
|
+
*/
|
|
309
|
+
node_threshold: number;
|
|
310
|
+
/**
|
|
311
|
+
* Progress callback interval in milliseconds.
|
|
312
|
+
*/
|
|
313
|
+
progress_interval_ms: number;
|
|
314
|
+
/**
|
|
315
|
+
* Whether to use `SharedArrayBuffer` for result transfer (if available).
|
|
316
|
+
*/
|
|
317
|
+
use_shared_buffer: boolean;
|
|
301
318
|
}
|
|
302
319
|
|
|
320
|
+
/**
|
|
321
|
+
* A parsed `VelesQL` statement with introspection methods.
|
|
322
|
+
*/
|
|
303
323
|
export class ParsedQuery {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
324
|
+
private constructor();
|
|
325
|
+
free(): void;
|
|
326
|
+
[Symbol.dispose](): void;
|
|
327
|
+
/**
|
|
328
|
+
* Get the list of selected columns as JSON array.
|
|
329
|
+
*/
|
|
330
|
+
readonly columns: any;
|
|
331
|
+
/**
|
|
332
|
+
* Get the GROUP BY columns as JSON array.
|
|
333
|
+
*/
|
|
334
|
+
readonly groupBy: any;
|
|
335
|
+
/**
|
|
336
|
+
* Check if DISTINCT modifier is present.
|
|
337
|
+
*/
|
|
338
|
+
readonly hasDistinct: boolean;
|
|
339
|
+
/**
|
|
340
|
+
* Check if the query uses FUSION (hybrid search).
|
|
341
|
+
*/
|
|
342
|
+
readonly hasFusion: boolean;
|
|
343
|
+
/**
|
|
344
|
+
* Check if the query has a GROUP BY clause.
|
|
345
|
+
*/
|
|
346
|
+
readonly hasGroupBy: boolean;
|
|
347
|
+
/**
|
|
348
|
+
* Check if the query has JOINs.
|
|
349
|
+
*/
|
|
350
|
+
readonly hasJoins: boolean;
|
|
351
|
+
/**
|
|
352
|
+
* Check if the query has an ORDER BY clause.
|
|
353
|
+
*/
|
|
354
|
+
readonly hasOrderBy: boolean;
|
|
355
|
+
/**
|
|
356
|
+
* Check if the query contains vector search (NEAR clause).
|
|
357
|
+
*/
|
|
358
|
+
readonly hasVectorSearch: boolean;
|
|
359
|
+
/**
|
|
360
|
+
* Check if the query has a WHERE clause.
|
|
361
|
+
*/
|
|
362
|
+
readonly hasWhereClause: boolean;
|
|
363
|
+
/**
|
|
364
|
+
* Check if this is a MATCH (graph) query.
|
|
365
|
+
*/
|
|
366
|
+
readonly isMatch: boolean;
|
|
367
|
+
/**
|
|
368
|
+
* Check if this is a SELECT query.
|
|
369
|
+
*/
|
|
370
|
+
readonly isSelect: boolean;
|
|
371
|
+
/**
|
|
372
|
+
* Check if the query is valid (always true for successfully parsed queries).
|
|
373
|
+
*/
|
|
374
|
+
readonly isValid: boolean;
|
|
375
|
+
/**
|
|
376
|
+
* Get the number of JOIN clauses.
|
|
377
|
+
*/
|
|
378
|
+
readonly joinCount: number;
|
|
379
|
+
/**
|
|
380
|
+
* Get the LIMIT value if present.
|
|
381
|
+
*/
|
|
382
|
+
readonly limit: bigint | undefined;
|
|
383
|
+
/**
|
|
384
|
+
* Check if the MATCH clause has a WHERE condition.
|
|
385
|
+
*/
|
|
386
|
+
readonly matchHasWhere: boolean;
|
|
387
|
+
/**
|
|
388
|
+
* Get the LIMIT from the MATCH RETURN clause.
|
|
389
|
+
*/
|
|
390
|
+
readonly matchLimit: bigint | undefined;
|
|
391
|
+
/**
|
|
392
|
+
* Get the number of node patterns in the MATCH clause.
|
|
393
|
+
*/
|
|
394
|
+
readonly matchNodeCount: number;
|
|
395
|
+
/**
|
|
396
|
+
* Get node labels from the MATCH clause as JSON array of arrays.
|
|
397
|
+
* Each inner array contains the labels for one node pattern.
|
|
398
|
+
*/
|
|
399
|
+
readonly matchNodeLabels: any;
|
|
400
|
+
/**
|
|
401
|
+
* Get the number of relationship patterns in the MATCH clause.
|
|
402
|
+
*/
|
|
403
|
+
readonly matchRelationshipCount: number;
|
|
404
|
+
/**
|
|
405
|
+
* Get relationship types from the MATCH clause as JSON array of arrays.
|
|
406
|
+
* Each inner array contains the types for one relationship pattern.
|
|
407
|
+
*/
|
|
408
|
+
readonly matchRelationshipTypes: any;
|
|
409
|
+
/**
|
|
410
|
+
* Get RETURN items from the MATCH clause as JSON array.
|
|
411
|
+
*/
|
|
412
|
+
readonly matchReturnItems: any;
|
|
413
|
+
/**
|
|
414
|
+
* Get the OFFSET value if present.
|
|
415
|
+
*/
|
|
416
|
+
readonly offset: bigint | undefined;
|
|
417
|
+
/**
|
|
418
|
+
* Get the ORDER BY columns and directions as JSON array.
|
|
419
|
+
*/
|
|
420
|
+
readonly orderBy: any;
|
|
421
|
+
/**
|
|
422
|
+
* Get the table name from the FROM clause.
|
|
423
|
+
*/
|
|
424
|
+
readonly tableName: string | undefined;
|
|
405
425
|
}
|
|
406
426
|
|
|
427
|
+
/**
|
|
428
|
+
* Semantic Memory for AI agents in WASM.
|
|
429
|
+
*
|
|
430
|
+
* Stores knowledge facts as vectors with similarity search.
|
|
431
|
+
*
|
|
432
|
+
* # Example (JavaScript)
|
|
433
|
+
*
|
|
434
|
+
* ```javascript
|
|
435
|
+
* import { SemanticMemory } from 'velesdb-wasm';
|
|
436
|
+
*
|
|
437
|
+
* const memory = new SemanticMemory(384);
|
|
438
|
+
* memory.store(1, "Paris is the capital of France", embedding);
|
|
439
|
+
* const results = memory.query(queryEmbedding, 5);
|
|
440
|
+
* ```
|
|
441
|
+
*/
|
|
407
442
|
export class SemanticMemory {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
443
|
+
free(): void;
|
|
444
|
+
[Symbol.dispose](): void;
|
|
445
|
+
/**
|
|
446
|
+
* Clears all knowledge facts.
|
|
447
|
+
*/
|
|
448
|
+
clear(): void;
|
|
449
|
+
/**
|
|
450
|
+
* Returns the embedding dimension.
|
|
451
|
+
*/
|
|
452
|
+
dimension(): number;
|
|
453
|
+
/**
|
|
454
|
+
* Returns true if no knowledge facts are stored.
|
|
455
|
+
*/
|
|
456
|
+
is_empty(): boolean;
|
|
457
|
+
/**
|
|
458
|
+
* Returns the number of stored knowledge facts.
|
|
459
|
+
*/
|
|
460
|
+
len(): number;
|
|
461
|
+
/**
|
|
462
|
+
* Creates a new `SemanticMemory` with the given embedding dimension.
|
|
463
|
+
*/
|
|
464
|
+
constructor(dimension: number);
|
|
465
|
+
/**
|
|
466
|
+
* Queries semantic memory by similarity search.
|
|
467
|
+
*
|
|
468
|
+
* Returns a JSON array of {id, score, content} objects.
|
|
469
|
+
*/
|
|
470
|
+
query(embedding: Float32Array, top_k: number): any;
|
|
471
|
+
/**
|
|
472
|
+
* Removes a knowledge fact by ID.
|
|
473
|
+
*/
|
|
474
|
+
remove(id: bigint): boolean;
|
|
475
|
+
/**
|
|
476
|
+
* Stores a knowledge fact with its embedding vector.
|
|
477
|
+
*
|
|
478
|
+
* # Arguments
|
|
479
|
+
*
|
|
480
|
+
* * `id` - Unique identifier for this fact
|
|
481
|
+
* * `content` - Text content of the knowledge
|
|
482
|
+
* * `embedding` - Vector representation (`Float32Array`)
|
|
483
|
+
*/
|
|
484
|
+
store(id: bigint, content: string, embedding: Float32Array): void;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* In-memory sparse inverted index for WASM.
|
|
489
|
+
*
|
|
490
|
+
* Uses a `BTreeMap<u32, Vec<(u64, f32)>>` as posting lists.
|
|
491
|
+
*/
|
|
492
|
+
export class SparseIndex {
|
|
493
|
+
free(): void;
|
|
494
|
+
[Symbol.dispose](): void;
|
|
495
|
+
/**
|
|
496
|
+
* Inserts a document with the given sparse vector.
|
|
497
|
+
*
|
|
498
|
+
* `indices` and `values` must have the same length.
|
|
499
|
+
*/
|
|
500
|
+
insert(doc_id: bigint, indices: Uint32Array, values: Float32Array): void;
|
|
501
|
+
/**
|
|
502
|
+
* Creates a new empty sparse index.
|
|
503
|
+
*/
|
|
504
|
+
constructor();
|
|
505
|
+
/**
|
|
506
|
+
* Searches the index with the given sparse query vector.
|
|
507
|
+
*
|
|
508
|
+
* Returns a JSON array of `{doc_id, score}` objects, sorted by score descending.
|
|
509
|
+
*/
|
|
510
|
+
search(query_indices: Uint32Array, query_values: Float32Array, k: number): any;
|
|
511
|
+
/**
|
|
512
|
+
* Returns the number of documents in the index.
|
|
513
|
+
*/
|
|
514
|
+
readonly doc_count: number;
|
|
450
515
|
}
|
|
451
516
|
|
|
452
517
|
/**
|
|
453
518
|
* Storage mode for vector quantization.
|
|
454
519
|
*/
|
|
455
520
|
export enum StorageMode {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
521
|
+
/**
|
|
522
|
+
* Full f32 precision (4 bytes per dimension)
|
|
523
|
+
*/
|
|
524
|
+
Full = 0,
|
|
525
|
+
/**
|
|
526
|
+
* SQ8: 8-bit scalar quantization (1 byte per dimension, 4x compression)
|
|
527
|
+
*/
|
|
528
|
+
SQ8 = 1,
|
|
529
|
+
/**
|
|
530
|
+
* Binary: 1-bit quantization (1 bit per dimension, 32x compression)
|
|
531
|
+
*/
|
|
532
|
+
Binary = 2,
|
|
533
|
+
/**
|
|
534
|
+
* Product Quantization — **WASM limitation**: PQ requires `rayon`/`persistence`
|
|
535
|
+
* which are unavailable in WASM. This variant uses the SQ8 codepath as a
|
|
536
|
+
* fallback. For true PQ, use the native `velesdb-core` crate.
|
|
537
|
+
*/
|
|
538
|
+
ProductQuantization = 3,
|
|
468
539
|
}
|
|
469
540
|
|
|
541
|
+
/**
|
|
542
|
+
* Progress information for long-running traversals.
|
|
543
|
+
*/
|
|
470
544
|
export class TraversalProgress {
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
545
|
+
free(): void;
|
|
546
|
+
[Symbol.dispose](): void;
|
|
547
|
+
/**
|
|
548
|
+
* Creates a new progress report.
|
|
549
|
+
*/
|
|
550
|
+
constructor(visited: number, estimated: number, depth: number);
|
|
551
|
+
/**
|
|
552
|
+
* Converts to JSON for postMessage.
|
|
553
|
+
*/
|
|
554
|
+
to_json(): any;
|
|
555
|
+
/**
|
|
556
|
+
* Current traversal depth.
|
|
557
|
+
*/
|
|
558
|
+
current_depth: number;
|
|
559
|
+
/**
|
|
560
|
+
* Estimated total nodes to visit (heuristic).
|
|
561
|
+
*/
|
|
562
|
+
estimated_total: number;
|
|
563
|
+
/**
|
|
564
|
+
* Whether the traversal was cancelled.
|
|
565
|
+
*/
|
|
566
|
+
is_cancelled: boolean;
|
|
567
|
+
/**
|
|
568
|
+
* Whether the traversal is complete.
|
|
569
|
+
*/
|
|
570
|
+
is_complete: boolean;
|
|
571
|
+
/**
|
|
572
|
+
* Number of nodes visited so far.
|
|
573
|
+
*/
|
|
574
|
+
visited_count: number;
|
|
575
|
+
/**
|
|
576
|
+
* Returns the completion percentage (0-100).
|
|
577
|
+
*/
|
|
578
|
+
readonly percentage: number;
|
|
505
579
|
}
|
|
506
580
|
|
|
581
|
+
/**
|
|
582
|
+
* A vector store for in-memory vector search.
|
|
583
|
+
*
|
|
584
|
+
* # Performance
|
|
585
|
+
*
|
|
586
|
+
* Uses contiguous memory layout for optimal cache locality and fast
|
|
587
|
+
* serialization. Vector data is stored in a single buffer rather than
|
|
588
|
+
* individual Vec allocations.
|
|
589
|
+
*
|
|
590
|
+
* # Storage Modes
|
|
591
|
+
*
|
|
592
|
+
* - `Full`: f32 precision, best recall
|
|
593
|
+
* - `SQ8`: 4x memory reduction, ~1% recall loss
|
|
594
|
+
* - `Binary`: 32x memory reduction, ~5-10% recall loss
|
|
595
|
+
*/
|
|
507
596
|
export class VectorStore {
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
597
|
+
free(): void;
|
|
598
|
+
[Symbol.dispose](): void;
|
|
599
|
+
/**
|
|
600
|
+
* Batch search for multiple vectors. Returns [[[id, score], ...], ...].
|
|
601
|
+
*/
|
|
602
|
+
batch_search(vectors: Float32Array, num_vectors: number, k: number): any;
|
|
603
|
+
/**
|
|
604
|
+
* Clears all vectors from the store.
|
|
605
|
+
*/
|
|
606
|
+
clear(): void;
|
|
607
|
+
/**
|
|
608
|
+
* Deletes `IndexedDB` database.
|
|
609
|
+
*/
|
|
610
|
+
static delete_database(db_name: string): Promise<void>;
|
|
611
|
+
/**
|
|
612
|
+
* Exports to binary format for IndexedDB/localStorage.
|
|
613
|
+
*/
|
|
614
|
+
export_to_bytes(): Uint8Array;
|
|
615
|
+
/**
|
|
616
|
+
* Gets a vector by ID. Returns {id, vector, payload} or null.
|
|
617
|
+
*/
|
|
618
|
+
get(id: bigint): any;
|
|
619
|
+
/**
|
|
620
|
+
* Hybrid search (vector + text). `vector_weight` 0-1 (default 0.5).
|
|
621
|
+
*
|
|
622
|
+
* For `Full` storage mode, this computes per-vector distance and text
|
|
623
|
+
* matching in a single pass. For quantized modes (`SQ8`, `Binary`,
|
|
624
|
+
* `ProductQuantization`), a decomposed approach is used: vector scores
|
|
625
|
+
* are obtained via the quantization-aware `compute_scores` path, text
|
|
626
|
+
* matches are evaluated independently on payloads, and the two result
|
|
627
|
+
* sets are fused with the requested weight. Quantized vector scores are
|
|
628
|
+
* approximate, so recall may differ slightly from `Full` mode.
|
|
629
|
+
*
|
|
630
|
+
* Returns `[{id, score, payload}, ...]` sorted by combined score
|
|
631
|
+
* descending, truncated to `k` results.
|
|
632
|
+
*/
|
|
633
|
+
hybrid_search(query_vector: Float32Array, text_query: string, k: number, vector_weight?: number | null): any;
|
|
634
|
+
/**
|
|
635
|
+
* Imports from binary format.
|
|
636
|
+
*/
|
|
637
|
+
static import_from_bytes(bytes: Uint8Array): VectorStore;
|
|
638
|
+
/**
|
|
639
|
+
* Inserts a vector with the given ID.
|
|
640
|
+
*/
|
|
641
|
+
insert(id: bigint, vector: Float32Array): void;
|
|
642
|
+
/**
|
|
643
|
+
* Batch insert. Input: `[[id, Float32Array], ...]`.
|
|
644
|
+
*/
|
|
645
|
+
insert_batch(batch: any): void;
|
|
646
|
+
/**
|
|
647
|
+
* Inserts a vector with ID and optional JSON payload.
|
|
648
|
+
*/
|
|
649
|
+
insert_with_payload(id: bigint, vector: Float32Array, payload: any): void;
|
|
650
|
+
/**
|
|
651
|
+
* Loads from `IndexedDB`.
|
|
652
|
+
*/
|
|
653
|
+
static load(db_name: string): Promise<VectorStore>;
|
|
654
|
+
/**
|
|
655
|
+
* Returns memory usage estimate in bytes.
|
|
656
|
+
*/
|
|
657
|
+
memory_usage(): number;
|
|
658
|
+
/**
|
|
659
|
+
* Multi-query search with fusion. Strategies: average, maximum, rrf.
|
|
660
|
+
*/
|
|
661
|
+
multi_query_search(vectors: Float32Array, num_vectors: number, k: number, strategy: string, rrf_k?: number | null): any;
|
|
662
|
+
/**
|
|
663
|
+
* Creates a new vector store. Metrics: cosine, euclidean, dot, hamming, jaccard.
|
|
664
|
+
*/
|
|
665
|
+
constructor(dimension: number, metric: string);
|
|
666
|
+
/**
|
|
667
|
+
* Creates a metadata-only store (no vectors, only payloads).
|
|
668
|
+
*/
|
|
669
|
+
static new_metadata_only(): VectorStore;
|
|
670
|
+
/**
|
|
671
|
+
* Creates store with mode: full (4B/dim), sq8 (4x compression), binary (32x).
|
|
672
|
+
*/
|
|
673
|
+
static new_with_mode(dimension: number, metric: string, mode: string): VectorStore;
|
|
674
|
+
/**
|
|
675
|
+
* VelesQL-style query returning multi-model results (EPIC-031 US-009).
|
|
676
|
+
*
|
|
677
|
+
* Returns results in `HybridResult` format with `node_id`, `vector_score`,
|
|
678
|
+
* `graph_score`, `fused_score`, `bindings`, and `column_data`.
|
|
679
|
+
*
|
|
680
|
+
* # Arguments
|
|
681
|
+
* * `query_vector` - Query vector for similarity search
|
|
682
|
+
* * `k` - Number of results to return
|
|
683
|
+
*
|
|
684
|
+
* # Returns
|
|
685
|
+
* Array of `{nodeId, vectorScore, graphScore, fusedScore, bindings, columnData}`
|
|
686
|
+
*/
|
|
687
|
+
query(query_vector: Float32Array, k: number): any;
|
|
688
|
+
/**
|
|
689
|
+
* Removes a vector by ID.
|
|
690
|
+
*/
|
|
691
|
+
remove(id: bigint): boolean;
|
|
692
|
+
/**
|
|
693
|
+
* Pre-allocates memory for additional vectors.
|
|
694
|
+
*/
|
|
695
|
+
reserve(additional: number): void;
|
|
696
|
+
/**
|
|
697
|
+
* Saves to `IndexedDB`.
|
|
698
|
+
*/
|
|
699
|
+
save(db_name: string): Promise<void>;
|
|
700
|
+
/**
|
|
701
|
+
* k-NN search. Returns [[id, score], ...].
|
|
702
|
+
*/
|
|
703
|
+
search(query: Float32Array, k: number): any;
|
|
704
|
+
/**
|
|
705
|
+
* Searches with metadata filtering. Returns [{id, score, payload}].
|
|
706
|
+
*/
|
|
707
|
+
search_with_filter(query: Float32Array, k: number, filter: any): any;
|
|
708
|
+
/**
|
|
709
|
+
* Similarity search with threshold. Operators: >, >=, <, <=, =, !=.
|
|
710
|
+
*/
|
|
711
|
+
similarity_search(query: Float32Array, threshold: number, operator: string, k: number): any;
|
|
712
|
+
/**
|
|
713
|
+
* Inserts a sparse vector into the internal sparse index.
|
|
714
|
+
*
|
|
715
|
+
* Lazily initializes the sparse index on first call.
|
|
716
|
+
*/
|
|
717
|
+
sparse_insert(doc_id: bigint, indices: Uint32Array, values: Float32Array): void;
|
|
718
|
+
/**
|
|
719
|
+
* Searches the internal sparse index.
|
|
720
|
+
*
|
|
721
|
+
* Returns a JSON array of `{doc_id, score}` objects sorted by score descending.
|
|
722
|
+
*/
|
|
723
|
+
sparse_search(indices: Uint32Array, values: Float32Array, k: number): any;
|
|
724
|
+
/**
|
|
725
|
+
* Text search on payload fields (substring matching).
|
|
726
|
+
*/
|
|
727
|
+
text_search(query: string, k: number, field?: string | null): any;
|
|
728
|
+
/**
|
|
729
|
+
* Creates store with pre-allocated capacity.
|
|
730
|
+
*/
|
|
731
|
+
static with_capacity(dimension: number, metric: string, capacity: number): VectorStore;
|
|
732
|
+
/**
|
|
733
|
+
* Returns the vector dimension.
|
|
734
|
+
*/
|
|
735
|
+
readonly dimension: number;
|
|
736
|
+
/**
|
|
737
|
+
* Returns true if the store is empty.
|
|
738
|
+
*/
|
|
739
|
+
readonly is_empty: boolean;
|
|
740
|
+
/**
|
|
741
|
+
* Returns true if this is a metadata-only store.
|
|
742
|
+
*/
|
|
743
|
+
readonly is_metadata_only: boolean;
|
|
744
|
+
/**
|
|
745
|
+
* Returns the number of vectors in the store.
|
|
746
|
+
*/
|
|
747
|
+
readonly len: number;
|
|
748
|
+
/**
|
|
749
|
+
* Returns the storage mode.
|
|
750
|
+
*/
|
|
751
|
+
readonly storage_mode: string;
|
|
640
752
|
}
|
|
641
753
|
|
|
754
|
+
/**
|
|
755
|
+
* `VelesQL` query parser for browser use.
|
|
756
|
+
*
|
|
757
|
+
* # Example (JavaScript)
|
|
758
|
+
*
|
|
759
|
+
* ```javascript
|
|
760
|
+
* import { VelesQL } from 'velesdb-wasm';
|
|
761
|
+
*
|
|
762
|
+
* // Parse a query
|
|
763
|
+
* const parsed = VelesQL.parse("SELECT * FROM docs WHERE category = 'tech' LIMIT 10");
|
|
764
|
+
* console.log(parsed.tableName); // "docs"
|
|
765
|
+
* console.log(parsed.isValid); // true
|
|
766
|
+
*
|
|
767
|
+
* // Validate without parsing
|
|
768
|
+
* const valid = VelesQL.isValid("SELECT * FROM docs"); // true
|
|
769
|
+
* ```
|
|
770
|
+
*/
|
|
642
771
|
export class VelesQL {
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
772
|
+
private constructor();
|
|
773
|
+
free(): void;
|
|
774
|
+
[Symbol.dispose](): void;
|
|
775
|
+
/**
|
|
776
|
+
* Validate a `VelesQL` query without full parsing.
|
|
777
|
+
*
|
|
778
|
+
* This is faster than `parse()` when you only need to check validity.
|
|
779
|
+
*/
|
|
780
|
+
static isValid(query: string): boolean;
|
|
781
|
+
/**
|
|
782
|
+
* Parse a `VelesQL` query string.
|
|
783
|
+
*
|
|
784
|
+
* Returns a `ParsedQuery` object with query introspection methods.
|
|
785
|
+
* Throws an error if the query has syntax errors.
|
|
786
|
+
*/
|
|
787
|
+
static parse(query: string): ParsedQuery;
|
|
659
788
|
}
|
|
660
789
|
|
|
661
790
|
/**
|
|
@@ -665,6 +794,15 @@ export class VelesQL {
|
|
|
665
794
|
*/
|
|
666
795
|
export function estimate_traversal_size(node_count: number, edge_count: number, max_depth: number): number;
|
|
667
796
|
|
|
797
|
+
/**
|
|
798
|
+
* Fuses pre-computed dense and sparse search results using Reciprocal Rank Fusion (RRF).
|
|
799
|
+
*
|
|
800
|
+
* Both `dense_results` and `sparse_results` should be JSON arrays of `[doc_id, score]` pairs.
|
|
801
|
+
* Returns a JSON array of `{doc_id, score}` objects, sorted by fused score descending,
|
|
802
|
+
* truncated to the top `k` entries.
|
|
803
|
+
*/
|
|
804
|
+
export function hybrid_search_fuse(dense_results: any, sparse_results: any, rrf_k: number, k: number): any;
|
|
805
|
+
|
|
668
806
|
/**
|
|
669
807
|
* Determines whether a traversal should be offloaded to a Web Worker.
|
|
670
808
|
*
|
|
@@ -681,185 +819,193 @@ export function should_use_worker(node_count: number, max_depth: number, config?
|
|
|
681
819
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
682
820
|
|
|
683
821
|
export interface InitOutput {
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
822
|
+
readonly memory: WebAssembly.Memory;
|
|
823
|
+
readonly __wbg_get_graphworkerconfig_depth_threshold: (a: number) => number;
|
|
824
|
+
readonly __wbg_get_graphworkerconfig_node_threshold: (a: number) => number;
|
|
825
|
+
readonly __wbg_get_graphworkerconfig_progress_interval_ms: (a: number) => number;
|
|
826
|
+
readonly __wbg_get_graphworkerconfig_use_shared_buffer: (a: number) => number;
|
|
827
|
+
readonly __wbg_get_traversalprogress_is_cancelled: (a: number) => number;
|
|
828
|
+
readonly __wbg_graphedge_free: (a: number, b: number) => void;
|
|
829
|
+
readonly __wbg_graphnode_free: (a: number, b: number) => void;
|
|
830
|
+
readonly __wbg_graphpersistence_free: (a: number, b: number) => void;
|
|
831
|
+
readonly __wbg_graphstore_free: (a: number, b: number) => void;
|
|
832
|
+
readonly __wbg_graphworkerconfig_free: (a: number, b: number) => void;
|
|
833
|
+
readonly __wbg_parsedquery_free: (a: number, b: number) => void;
|
|
834
|
+
readonly __wbg_semanticmemory_free: (a: number, b: number) => void;
|
|
835
|
+
readonly __wbg_set_graphworkerconfig_depth_threshold: (a: number, b: number) => void;
|
|
836
|
+
readonly __wbg_set_graphworkerconfig_node_threshold: (a: number, b: number) => void;
|
|
837
|
+
readonly __wbg_set_graphworkerconfig_progress_interval_ms: (a: number, b: number) => void;
|
|
838
|
+
readonly __wbg_set_graphworkerconfig_use_shared_buffer: (a: number, b: number) => void;
|
|
839
|
+
readonly __wbg_set_traversalprogress_is_cancelled: (a: number, b: number) => void;
|
|
840
|
+
readonly __wbg_sparseindex_free: (a: number, b: number) => void;
|
|
841
|
+
readonly __wbg_vectorstore_free: (a: number, b: number) => void;
|
|
842
|
+
readonly __wbg_velesql_free: (a: number, b: number) => void;
|
|
843
|
+
readonly estimate_traversal_size: (a: number, b: number, c: number) => number;
|
|
844
|
+
readonly graphedge_id: (a: number) => bigint;
|
|
845
|
+
readonly graphedge_label: (a: number, b: number) => void;
|
|
846
|
+
readonly graphedge_new: (a: number, b: bigint, c: bigint, d: bigint, e: number, f: number) => void;
|
|
847
|
+
readonly graphedge_set_number_property: (a: number, b: number, c: number, d: number) => void;
|
|
848
|
+
readonly graphedge_set_string_property: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
849
|
+
readonly graphedge_source: (a: number) => bigint;
|
|
850
|
+
readonly graphedge_target: (a: number) => bigint;
|
|
851
|
+
readonly graphedge_to_json: (a: number, b: number) => void;
|
|
852
|
+
readonly graphnode_has_vector: (a: number) => number;
|
|
853
|
+
readonly graphnode_label: (a: number, b: number) => void;
|
|
854
|
+
readonly graphnode_new: (a: bigint, b: number, c: number) => number;
|
|
855
|
+
readonly graphnode_set_bool_property: (a: number, b: number, c: number, d: number) => void;
|
|
856
|
+
readonly graphnode_set_number_property: (a: number, b: number, c: number, d: number) => void;
|
|
857
|
+
readonly graphnode_set_string_property: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
858
|
+
readonly graphnode_set_vector: (a: number, b: number, c: number) => void;
|
|
859
|
+
readonly graphnode_to_json: (a: number, b: number) => void;
|
|
860
|
+
readonly graphpersistence_delete_graph: (a: number, b: number, c: number) => number;
|
|
861
|
+
readonly graphpersistence_get_metadata: (a: number, b: number, c: number) => number;
|
|
862
|
+
readonly graphpersistence_init: (a: number) => number;
|
|
863
|
+
readonly graphpersistence_list_graphs: (a: number) => number;
|
|
864
|
+
readonly graphpersistence_load: (a: number, b: number, c: number) => number;
|
|
865
|
+
readonly graphpersistence_new: () => number;
|
|
866
|
+
readonly graphpersistence_save: (a: number, b: number, c: number, d: number) => number;
|
|
867
|
+
readonly graphstore_add_edge: (a: number, b: number, c: number) => void;
|
|
868
|
+
readonly graphstore_add_node: (a: number, b: number) => void;
|
|
869
|
+
readonly graphstore_bfs_traverse: (a: number, b: number, c: bigint, d: number, e: number) => void;
|
|
870
|
+
readonly graphstore_clear: (a: number) => void;
|
|
871
|
+
readonly graphstore_dfs_traverse: (a: number, b: number, c: bigint, d: number, e: number) => void;
|
|
872
|
+
readonly graphstore_edge_count: (a: number) => number;
|
|
873
|
+
readonly graphstore_get_all_edge_ids: (a: number, b: number) => void;
|
|
874
|
+
readonly graphstore_get_all_node_ids: (a: number, b: number) => void;
|
|
875
|
+
readonly graphstore_get_edge: (a: number, b: bigint) => number;
|
|
876
|
+
readonly graphstore_get_edges_by_label: (a: number, b: number, c: number, d: number) => void;
|
|
877
|
+
readonly graphstore_get_incoming: (a: number, b: number, c: bigint) => void;
|
|
878
|
+
readonly graphstore_get_neighbors: (a: number, b: number, c: bigint) => void;
|
|
879
|
+
readonly graphstore_get_node: (a: number, b: bigint) => number;
|
|
880
|
+
readonly graphstore_get_nodes_by_label: (a: number, b: number, c: number, d: number) => void;
|
|
881
|
+
readonly graphstore_get_outgoing: (a: number, b: number, c: bigint) => void;
|
|
882
|
+
readonly graphstore_get_outgoing_by_label: (a: number, b: number, c: bigint, d: number, e: number) => void;
|
|
883
|
+
readonly graphstore_has_edge: (a: number, b: bigint) => number;
|
|
884
|
+
readonly graphstore_has_node: (a: number, b: bigint) => number;
|
|
885
|
+
readonly graphstore_in_degree: (a: number, b: bigint) => number;
|
|
886
|
+
readonly graphstore_new: () => number;
|
|
887
|
+
readonly graphstore_node_count: (a: number) => number;
|
|
888
|
+
readonly graphstore_out_degree: (a: number, b: bigint) => number;
|
|
889
|
+
readonly graphstore_remove_edge: (a: number, b: bigint) => void;
|
|
890
|
+
readonly graphstore_remove_node: (a: number, b: bigint) => void;
|
|
891
|
+
readonly graphworkerconfig_for_large_graphs: () => number;
|
|
892
|
+
readonly graphworkerconfig_for_responsive_ui: () => number;
|
|
893
|
+
readonly graphworkerconfig_new: () => number;
|
|
894
|
+
readonly hybrid_search_fuse: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
895
|
+
readonly parsedquery_columns: (a: number) => number;
|
|
896
|
+
readonly parsedquery_groupBy: (a: number) => number;
|
|
897
|
+
readonly parsedquery_hasDistinct: (a: number) => number;
|
|
898
|
+
readonly parsedquery_hasFusion: (a: number) => number;
|
|
899
|
+
readonly parsedquery_hasGroupBy: (a: number) => number;
|
|
900
|
+
readonly parsedquery_hasJoins: (a: number) => number;
|
|
901
|
+
readonly parsedquery_hasOrderBy: (a: number) => number;
|
|
902
|
+
readonly parsedquery_hasVectorSearch: (a: number) => number;
|
|
903
|
+
readonly parsedquery_hasWhereClause: (a: number) => number;
|
|
904
|
+
readonly parsedquery_isMatch: (a: number) => number;
|
|
905
|
+
readonly parsedquery_isSelect: (a: number) => number;
|
|
906
|
+
readonly parsedquery_isValid: (a: number) => number;
|
|
907
|
+
readonly parsedquery_joinCount: (a: number) => number;
|
|
908
|
+
readonly parsedquery_limit: (a: number, b: number) => void;
|
|
909
|
+
readonly parsedquery_matchHasWhere: (a: number) => number;
|
|
910
|
+
readonly parsedquery_matchLimit: (a: number, b: number) => void;
|
|
911
|
+
readonly parsedquery_matchNodeCount: (a: number) => number;
|
|
912
|
+
readonly parsedquery_matchNodeLabels: (a: number) => number;
|
|
913
|
+
readonly parsedquery_matchRelationshipCount: (a: number) => number;
|
|
914
|
+
readonly parsedquery_matchRelationshipTypes: (a: number) => number;
|
|
915
|
+
readonly parsedquery_matchReturnItems: (a: number) => number;
|
|
916
|
+
readonly parsedquery_offset: (a: number, b: number) => void;
|
|
917
|
+
readonly parsedquery_orderBy: (a: number) => number;
|
|
918
|
+
readonly parsedquery_tableName: (a: number, b: number) => void;
|
|
919
|
+
readonly semanticmemory_clear: (a: number) => void;
|
|
920
|
+
readonly semanticmemory_dimension: (a: number) => number;
|
|
921
|
+
readonly semanticmemory_is_empty: (a: number) => number;
|
|
922
|
+
readonly semanticmemory_len: (a: number) => number;
|
|
923
|
+
readonly semanticmemory_new: (a: number, b: number) => void;
|
|
924
|
+
readonly semanticmemory_query: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
925
|
+
readonly semanticmemory_remove: (a: number, b: bigint) => number;
|
|
926
|
+
readonly semanticmemory_store: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number) => void;
|
|
927
|
+
readonly should_use_worker: (a: number, b: number, c: number) => number;
|
|
928
|
+
readonly sparseindex_doc_count: (a: number) => number;
|
|
929
|
+
readonly sparseindex_insert: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number) => void;
|
|
930
|
+
readonly sparseindex_new: () => number;
|
|
931
|
+
readonly sparseindex_search: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
932
|
+
readonly traversalprogress_new: (a: number, b: number, c: number) => number;
|
|
933
|
+
readonly traversalprogress_percentage: (a: number) => number;
|
|
934
|
+
readonly traversalprogress_to_json: (a: number, b: number) => void;
|
|
935
|
+
readonly vectorstore_batch_search: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
936
|
+
readonly vectorstore_clear: (a: number) => void;
|
|
937
|
+
readonly vectorstore_delete_database: (a: number, b: number) => number;
|
|
938
|
+
readonly vectorstore_dimension: (a: number) => number;
|
|
939
|
+
readonly vectorstore_export_to_bytes: (a: number, b: number) => void;
|
|
940
|
+
readonly vectorstore_get: (a: number, b: number, c: bigint) => void;
|
|
941
|
+
readonly vectorstore_hybrid_search: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
942
|
+
readonly vectorstore_import_from_bytes: (a: number, b: number, c: number) => void;
|
|
943
|
+
readonly vectorstore_insert: (a: number, b: number, c: bigint, d: number, e: number) => void;
|
|
944
|
+
readonly vectorstore_insert_batch: (a: number, b: number, c: number) => void;
|
|
945
|
+
readonly vectorstore_insert_with_payload: (a: number, b: number, c: bigint, d: number, e: number, f: number) => void;
|
|
946
|
+
readonly vectorstore_is_empty: (a: number) => number;
|
|
947
|
+
readonly vectorstore_is_metadata_only: (a: number) => number;
|
|
948
|
+
readonly vectorstore_len: (a: number) => number;
|
|
949
|
+
readonly vectorstore_load: (a: number, b: number) => number;
|
|
950
|
+
readonly vectorstore_memory_usage: (a: number) => number;
|
|
951
|
+
readonly vectorstore_multi_query_search: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
952
|
+
readonly vectorstore_new: (a: number, b: number, c: number, d: number) => void;
|
|
953
|
+
readonly vectorstore_new_metadata_only: () => number;
|
|
954
|
+
readonly vectorstore_new_with_mode: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
955
|
+
readonly vectorstore_query: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
956
|
+
readonly vectorstore_remove: (a: number, b: bigint) => number;
|
|
957
|
+
readonly vectorstore_reserve: (a: number, b: number) => void;
|
|
958
|
+
readonly vectorstore_save: (a: number, b: number, c: number) => number;
|
|
959
|
+
readonly vectorstore_search: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
960
|
+
readonly vectorstore_search_with_filter: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
961
|
+
readonly vectorstore_similarity_search: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
962
|
+
readonly vectorstore_sparse_insert: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number) => void;
|
|
963
|
+
readonly vectorstore_sparse_search: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
964
|
+
readonly vectorstore_storage_mode: (a: number, b: number) => void;
|
|
965
|
+
readonly vectorstore_text_search: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
966
|
+
readonly vectorstore_with_capacity: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
967
|
+
readonly velesql_isValid: (a: number, b: number) => number;
|
|
968
|
+
readonly velesql_parse: (a: number, b: number, c: number) => void;
|
|
969
|
+
readonly __wbg_set_traversalprogress_current_depth: (a: number, b: number) => void;
|
|
970
|
+
readonly __wbg_set_traversalprogress_estimated_total: (a: number, b: number) => void;
|
|
971
|
+
readonly __wbg_set_traversalprogress_visited_count: (a: number, b: number) => void;
|
|
972
|
+
readonly __wbg_set_traversalprogress_is_complete: (a: number, b: number) => void;
|
|
973
|
+
readonly __wbg_get_traversalprogress_is_complete: (a: number) => number;
|
|
974
|
+
readonly __wbg_get_traversalprogress_current_depth: (a: number) => number;
|
|
975
|
+
readonly __wbg_get_traversalprogress_estimated_total: (a: number) => number;
|
|
976
|
+
readonly __wbg_get_traversalprogress_visited_count: (a: number) => number;
|
|
977
|
+
readonly graphnode_id: (a: number) => bigint;
|
|
978
|
+
readonly __wbg_traversalprogress_free: (a: number, b: number) => void;
|
|
979
|
+
readonly __wasm_bindgen_func_elem_1318: (a: number, b: number) => void;
|
|
980
|
+
readonly __wasm_bindgen_func_elem_289: (a: number, b: number) => void;
|
|
981
|
+
readonly __wasm_bindgen_func_elem_1319: (a: number, b: number, c: number, d: number) => void;
|
|
982
|
+
readonly __wasm_bindgen_func_elem_1364: (a: number, b: number, c: number, d: number) => void;
|
|
983
|
+
readonly __wasm_bindgen_func_elem_290: (a: number, b: number, c: number) => void;
|
|
984
|
+
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
985
|
+
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
986
|
+
readonly __wbindgen_export3: (a: number) => void;
|
|
987
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
988
|
+
readonly __wbindgen_export4: (a: number, b: number, c: number) => void;
|
|
843
989
|
}
|
|
844
990
|
|
|
845
991
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
846
992
|
|
|
847
993
|
/**
|
|
848
|
-
* Instantiates the given `module`, which can either be bytes or
|
|
849
|
-
* a precompiled `WebAssembly.Module`.
|
|
850
|
-
*
|
|
851
|
-
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
852
|
-
*
|
|
853
|
-
* @returns {InitOutput}
|
|
854
|
-
*/
|
|
994
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
995
|
+
* a precompiled `WebAssembly.Module`.
|
|
996
|
+
*
|
|
997
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
998
|
+
*
|
|
999
|
+
* @returns {InitOutput}
|
|
1000
|
+
*/
|
|
855
1001
|
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
856
1002
|
|
|
857
1003
|
/**
|
|
858
|
-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
859
|
-
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
860
|
-
*
|
|
861
|
-
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
862
|
-
*
|
|
863
|
-
* @returns {Promise<InitOutput>}
|
|
864
|
-
*/
|
|
1004
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
1005
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
1006
|
+
*
|
|
1007
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
1008
|
+
*
|
|
1009
|
+
* @returns {Promise<InitOutput>}
|
|
1010
|
+
*/
|
|
865
1011
|
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|