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