export function initDuckDB(duckdbDist: any, options?: {}): Promise; /** * Create a DuckDBClient from a pre-initialized AsyncDuckDB instance. * * The caller is responsible for: * 1. Creating the DuckDB worker, logger, and AsyncDuckDB instance * 2. Calling db.instantiate() with the WASM module * 3. Passing the db instance here * * This adapter will handle connection creation and extension loading. * * @param {object} db - An AsyncDuckDB instance from duckdb-wasm-opfs-tempdir * @param {object} [options] * @param {string} [options.tempDirectory] - OPFS temp directory path (e.g., 'opfs://tmpdir_xxx') * @param {number} [options.memoryLimitMB] - DuckDB memory limit in MB * @param {Worker} [options._worker] - Internal: worker reference for terminate() * @returns {DuckDBClient} */ export function createDuckDBClient(db: object, options?: { tempDirectory?: string; memoryLimitMB?: number; _worker?: Worker; }): DuckDBClient; export type DuckDBClient = { /** * Execute a SQL query and return a result with .toArray(). */ query: (sql: string) => Promise<{ toArray: () => any[]; }>; /** * Initialize the client (extensions, settings). Idempotent. */ init: () => Promise; /** * Kill the DuckDB worker. After this, init() can reinitialize. */ terminate: () => void; /** * The underlying DuckDB connection (for direct access when needed). */ conn: object; /** * The underlying DuckDB database instance. */ db: object; };