/* tslint:disable */ /* eslint-disable */ export class WasmSearchEngine { free(): void; [Symbol.dispose](): void; /** * Add vectors to an existing index. * `flat` is a contiguous array of vectors, each of length `dims`. */ add_vectors(flat: Float32Array, dims: number): void; /** * Build a new index from a flat f32 array of vectors. * `flat` is a contiguous array of vectors, each of length `dims`. */ static from_vectors(flat: Float32Array, dims: number, m: number, ef_construction: number, ef_search: number): WasmSearchEngine; /** * Number of vectors in the index. */ len(): number; /** * Load a pre-built index from serialized bytes. */ constructor(bytes: Uint8Array); /** * Search for the `top_k` nearest neighbors of a query vector. * Returns JSON: `[[node_id, distance], ...]` */ search(query: Float32Array, top_k: number): string; /** * Export the index as bytes for later loading. */ to_bytes(): Uint8Array; } export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; export interface InitOutput { readonly memory: WebAssembly.Memory; readonly __wbg_wasmsearchengine_free: (a: number, b: number) => void; readonly wasmsearchengine_add_vectors: (a: number, b: number, c: number, d: number) => void; readonly wasmsearchengine_from_vectors: (a: number, b: number, c: number, d: number, e: number, f: number) => number; readonly wasmsearchengine_len: (a: number) => number; readonly wasmsearchengine_new: (a: number, b: number) => number; readonly wasmsearchengine_search: (a: number, b: number, c: number, d: number, e: number) => void; readonly wasmsearchengine_to_bytes: (a: number, b: number) => void; readonly __wbindgen_export: (a: number) => void; readonly __wbindgen_export2: (a: number, b: number) => number; readonly __wbindgen_add_to_stack_pointer: (a: number) => number; readonly __wbindgen_export3: (a: number, b: number, c: number) => void; } export type SyncInitInput = BufferSource | WebAssembly.Module; /** * Instantiates the given `module`, which can either be bytes or * a precompiled `WebAssembly.Module`. * * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated. * * @returns {InitOutput} */ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput; /** * If `module_or_path` is {RequestInfo} or {URL}, makes a request and * for everything else, calls `WebAssembly.instantiate` directly. * * @param {{ module_or_path: InitInput | Promise }} module_or_path - Passing `InitInput` directly is deprecated. * * @returns {Promise} */ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise } | InitInput | Promise): Promise;