import { loadHnswlib } from 'closevector-hnswlib-wasm'; export * from './lib'; export * from './closeVectorEmbedding' export * from './hnswlibWasm' export * from './loader' export * from './embeddings' export * from './manager' export function isWasmSupport() { return typeof WebAssembly === 'object' && typeof WebAssembly.instantiate === 'function'; } export function isIndexedDBSupport() { return typeof indexedDB === 'object'; } export async function loadHnswlibWasm( options: { debug: boolean; } = { debug: false, } ) { if (!isWasmSupport()) { throw new Error('WebAssembly is not supported'); } if (!isIndexedDBSupport()) { throw new Error('IndexedDB is not supported'); } const lib = await loadHnswlib(); if (options.debug) { lib.EmscriptenFileSystemManager.setDebugLogs(true); } return lib; }