|
| 1 | +/* tslint:disable */ |
| 2 | +/* eslint-disable */ |
| 3 | + |
| 4 | +/** |
| 5 | + * In-memory Cortex engine for browser use. |
| 6 | + */ |
| 7 | +export class CortexWasm { |
| 8 | + free(): void; |
| 9 | + [Symbol.dispose](): void; |
| 10 | + /** |
| 11 | + * Add a fact (subject-predicate-object). |
| 12 | + */ |
| 13 | + add_fact(subject: string, predicate: string, object: string, confidence: number): void; |
| 14 | + /** |
| 15 | + * Get memory count. |
| 16 | + */ |
| 17 | + count(): number; |
| 18 | + /** |
| 19 | + * Get all beliefs as JSON. |
| 20 | + */ |
| 21 | + get_beliefs(): string; |
| 22 | + /** |
| 23 | + * Ingest a memory. Returns the memory ID. |
| 24 | + */ |
| 25 | + ingest(text: string, channel: string): string; |
| 26 | + /** |
| 27 | + * Create a new in-memory Cortex instance. |
| 28 | + */ |
| 29 | + constructor(); |
| 30 | + /** |
| 31 | + * Observe evidence for a belief. Returns new probability. |
| 32 | + */ |
| 33 | + observe_belief(key: string, supports: boolean, strength: number): number; |
| 34 | + /** |
| 35 | + * Query facts by entity. Returns JSON array. |
| 36 | + */ |
| 37 | + query_facts(entity: string): string; |
| 38 | + /** |
| 39 | + * Search memories by query. Returns JSON array of results. |
| 40 | + */ |
| 41 | + search(query: string, limit: number): string; |
| 42 | + /** |
| 43 | + * Get stats as JSON. |
| 44 | + */ |
| 45 | + stats(): string; |
| 46 | +} |
| 47 | + |
| 48 | +export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; |
| 49 | + |
| 50 | +export interface InitOutput { |
| 51 | + readonly memory: WebAssembly.Memory; |
| 52 | + readonly __wbg_cortexwasm_free: (a: number, b: number) => void; |
| 53 | + readonly cortexwasm_add_fact: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void; |
| 54 | + readonly cortexwasm_count: (a: number) => number; |
| 55 | + readonly cortexwasm_get_beliefs: (a: number, b: number) => void; |
| 56 | + readonly cortexwasm_ingest: (a: number, b: number, c: number, d: number, e: number, f: number) => void; |
| 57 | + readonly cortexwasm_new: () => number; |
| 58 | + readonly cortexwasm_observe_belief: (a: number, b: number, c: number, d: number, e: number) => number; |
| 59 | + readonly cortexwasm_query_facts: (a: number, b: number, c: number, d: number) => void; |
| 60 | + readonly cortexwasm_search: (a: number, b: number, c: number, d: number, e: number) => void; |
| 61 | + readonly cortexwasm_stats: (a: number, b: number) => void; |
| 62 | + readonly __wbindgen_export: (a: number) => void; |
| 63 | + readonly __wbindgen_export2: (a: number, b: number) => number; |
| 64 | + readonly __wbindgen_export3: (a: number, b: number, c: number, d: number) => number; |
| 65 | + readonly __wbindgen_add_to_stack_pointer: (a: number) => number; |
| 66 | + readonly __wbindgen_export4: (a: number, b: number, c: number) => void; |
| 67 | +} |
| 68 | + |
| 69 | +export type SyncInitInput = BufferSource | WebAssembly.Module; |
| 70 | + |
| 71 | +/** |
| 72 | + * Instantiates the given `module`, which can either be bytes or |
| 73 | + * a precompiled `WebAssembly.Module`. |
| 74 | + * |
| 75 | + * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated. |
| 76 | + * |
| 77 | + * @returns {InitOutput} |
| 78 | + */ |
| 79 | +export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput; |
| 80 | + |
| 81 | +/** |
| 82 | + * If `module_or_path` is {RequestInfo} or {URL}, makes a request and |
| 83 | + * for everything else, calls `WebAssembly.instantiate` directly. |
| 84 | + * |
| 85 | + * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated. |
| 86 | + * |
| 87 | + * @returns {Promise<InitOutput>} |
| 88 | + */ |
| 89 | +export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>; |
0 commit comments