/**
 * Database
 *
 * Unified high-level API for both local and sync databases.
 * Constructor determines whether to use local-only or sync mode based on config.
 */
import { Statement } from './Statement';
import type { Row, RunResult, BindParams, DatabaseOpts, SyncStats } from './types';
/**
 * Database class - works for both local-only and sync databases
 *
 * All database operations are async to properly handle IO requirements:
 * - For local databases: async allows yielding to JS event loop
 * - For sync databases: async required for network operations
 * - For partial sync: async required to load missing pages on-demand
 */
export declare class Database {
    private _opts;
    private _nativeDb;
    private _nativeSyncDb;
    private _connection;
    private _isSync;
    private _connected;
    private _closed;
    private _execLock;
    private _extraIo?;
    private _ioContext?;
    /**
     * Create a new database (doesn't connect yet - call connect())
     *
     * @param opts - Database options
     */
    constructor(opts: DatabaseOpts);
    /**
     * Connect to the database (matches JavaScript bindings)
     * For local databases: opens immediately
     * For sync databases: bootstraps if needed
     */
    connect(): Promise<void>;
    /**
     * Initialize local-only database
     */
    private initLocalDatabase;
    /**
     * Initialize sync database
     */
    private initSyncDatabase;
    /**
     * Prepare a SQL statement
     *
     * @param sql - SQL statement to prepare
     * @returns Prepared statement
     */
    prepare(sql: string): Statement;
    /**
     * Execute SQL without returning results (for DDL, multi-statement SQL)
     *
     * @param sql - SQL to execute
     */
    exec(sql: string): Promise<void>;
    /**
     * Execute statement and return result info
     *
     * @param sql - SQL statement
     * @param params - Bind parameters
     * @returns Run result with changes and lastInsertRowid
     */
    run(sql: string, ...params: BindParams[]): Promise<RunResult>;
    /**
     * Execute query and return first row
     *
     * @param sql - SQL query
     * @param params - Bind parameters
     * @returns First row or undefined
     */
    get(sql: string, ...params: BindParams[]): Promise<Row | undefined>;
    /**
     * Execute query and return all rows
     *
     * @param sql - SQL query
     * @param params - Bind parameters
     * @returns All rows
     */
    all(sql: string, ...params: BindParams[]): Promise<Row[]>;
    /**
     * Execute function within a transaction
     *
     * @param fn - Function to execute
     * @returns Function result
     */
    transaction<T>(fn: () => T | Promise<T>): Promise<T>;
    /**
     * Push local changes to remote (sync databases only)
     */
    push(): Promise<void>;
    /**
     * Pull remote changes and apply locally (sync databases only)
     *
     * @returns true if changes were applied, false if no changes
     */
    pull(): Promise<boolean>;
    /**
     * Get sync statistics (sync databases only)
     *
     * @returns Sync stats
     */
    stats(): Promise<SyncStats>;
    /**
     * Checkpoint database (sync databases only)
     */
    checkpoint(): Promise<void>;
    /**
     * Close the database
     */
    close(): void;
    /**
     * Get database path
     */
    get path(): string;
    /**
     * Check if database is a sync database
     */
    get isSync(): boolean;
    /**
     * Check if database is open
     */
    get open(): boolean;
    /**
     * Check if in transaction
     */
    get inTransaction(): boolean;
    /**
     * Get last insert rowid
     */
    get lastInsertRowid(): number;
    /**
     * Check if open and throw if not
     */
    private checkOpen;
}
//# sourceMappingURL=Database.d.ts.map