/* tslint:disable */
/* eslint-disable */

/**
 * JavaScript-compatible error wrapper
 */
export class JsError {
    private constructor();
    free(): void;
    [Symbol.dispose](): void;
    /**
     * Get the error message
     */
    readonly message: string;
}

/**
 * Result of a successful login, returned to JavaScript.
 */
export class LoginResult {
    private constructor();
    free(): void;
    [Symbol.dispose](): void;
    readonly identity: string;
    readonly token: string;
}

export class WasmDB {
    free(): void;
    [Symbol.dispose](): void;
    /**
     * Execute an admin operation (DDL + DML + Query) and return results
     *
     * Admin operations include CREATE, ALTER, INSERT, UPDATE, DELETE, etc.
     *
     * # Example
     *
     * ```javascript
     * await db.admin("CREATE NAMESPACE demo");
     * await db.admin(`
     *   CREATE TABLE demo.users {
     *     id: int4,
     *     name: utf8
     *   }
     * `);
     * ```
     */
    admin(rql: string): any;
    /**
     * Execute an admin operation and return Display-formatted text output
     */
    adminText(rql: string): string;
    /**
     * Execute admin with JSON parameters
     */
    adminWithParams(rql: string, params_js: any): any;
    /**
     * Execute a command (DML) and return results
     *
     * Commands include INSERT, UPDATE, DELETE, etc.
     * For DDL operations (CREATE, ALTER), use `admin()` instead.
     */
    command(rql: string): any;
    /**
     * Execute a command and return Display-formatted text output
     */
    commandText(rql: string): string;
    /**
     * Execute command with JSON parameters
     */
    commandWithParams(rql: string, params_js: any): any;
    /**
     * Authenticate with a password and return a session token.
     */
    loginWithPassword(identifier: string, password: string): LoginResult;
    /**
     * Authenticate with a token credential and return a session token.
     */
    loginWithToken(token: string): LoginResult;
    /**
     * Logout and revoke the current session token.
     */
    logout(): void;
    /**
     * Create a new in-memory ReifyDB engine
     *
     * # Example
     *
     * ```javascript
     * import init, { WasmDB } from './pkg/reifydb_engine_wasm.js';
     *
     * await init();
     * const db = new WasmDB();
     * ```
     */
    constructor();
    /**
     * Execute a query and return results as JavaScript objects
     *
     * # Example
     *
     * ```javascript
     * const results = await db.query(`
     *   FROM [{ name: "Alice", age: 30 }]
     *   FILTER age > 25
     * `);
     * console.log(results); // [{ name: "Alice", age: 30 }]
     * ```
     */
    query(rql: string): any;
    /**
     * Execute a query and return Display-formatted text output
     */
    queryText(rql: string): string;
    /**
     * Execute query with JSON parameters
     *
     * # Example
     *
     * ```javascript
     * const results = await db.queryWithParams(
     *   "FROM users FILTER age > $min_age",
     *   { min_age: 25 }
     * );
     * ```
     */
    queryWithParams(rql: string, params_js: any): any;
}

/**
 * Decode RBCF binary to JSON frames.
 */
export function decode_rbcf(bytes: Uint8Array): string;

/**
 * Encode JSON frames to RBCF binary with an optional forced encoding.
 */
export function encode_rbcf(frames_json: string, forced_encoding?: string | null): Uint8Array;
