import { WasmDB as WasmDB$1 } from '../wasm/reifydb_webassembly';
export { TypeValuePair, Value, decode } from '@reifydb/core';

interface LoginResult {
    token: string;
    identity: string;
}
/**
 * Recursively transforms raw WASM output into decoded Value instances.
 *
 * The WASM engine returns typed values as `{type, value}` pairs.
 * This function walks the result tree and decodes each pair using `@reifydb/core`'s `decode()`.
 */
declare function transform_to_value_instances(result: unknown): unknown;
/**
 * High-level wrapper around the raw WASM database engine.
 *
 * Provides typed methods for admin, command, and query operations,
 * automatically decoding WASM type-value pairs into Value instances.
 */
declare class WasmDB {
    private db;
    constructor(db: WasmDB$1);
    admin(rql: string): unknown;
    admin_with_params(rql: string, params: unknown): unknown;
    command(rql: string): unknown;
    command_with_params(rql: string, params: unknown): unknown;
    query(rql: string): unknown;
    query_with_params(rql: string, params: unknown): unknown;
    login_with_password(identifier: string, password: string): LoginResult;
    login_with_token(token: string): LoginResult;
    logout(): void;
    free(): void;
}
/**
 * Creates a new WasmDB instance by dynamically importing the WASM module.
 *
 * The dynamic import ensures the WASM glue code is not bundled by tsup
 * and is instead resolved by the consumer's bundler (Vite, webpack, etc.).
 *
 * @example
 * ```typescript
 * import { create_wasm_db } from '@reifydb/wasm';
 *
 * const db = await create_wasm_db();
 * db.admin('CREATE NAMESPACE demo');
 * const results = db.query('FROM demo.users');
 * db.free();
 * ```
 */
declare function create_wasm_db(): Promise<WasmDB>;

export { type LoginResult, WasmDB, create_wasm_db, transform_to_value_instances };
