type QueryResult<T> = {
    data: T | null;
    error: {
        message: string;
        code?: string;
        /** Originating SQLite error code (e.g. SQLITE_BUSY) when retries were exhausted. */
        sqlite_code?: string;
        /** Originating SQLite errno when retries were exhausted. */
        sqlite_errno?: number;
    } | null;
    count?: number;
};
/**
 * Clear the cached data key. Call after key rotation or for testing.
 */
export declare function clearCachedDataKey(): void;
export declare function isRecoverableSqliteConnectionError(error: unknown): boolean;
/**
 * Returns true for transient lock/busy errors that warrant a retry with backoff.
 * better-sqlite3 surfaces these as SQLITE_BUSY or SQLITE_LOCKED error codes, or
 * via error messages that include "database is locked" / "database table is locked".
 */
export declare function isSqliteLockError(error: unknown): boolean;
declare class LocalQueryBuilder {
    private table;
    private operation;
    private selectColumns;
    private filters;
    private filterValues;
    private orderBy;
    private limitValue;
    private offsetValue;
    private insertPayload;
    private updatePayload;
    private upsertPayload;
    private countExact;
    private countHead;
    private expectSingle;
    private allowNullSingle;
    private orConditions;
    constructor(table: string);
    select(columns?: string, options?: {
        count?: "exact";
        head?: boolean;
    }): this;
    insert(payload: Record<string, unknown> | Record<string, unknown>[]): this;
    update(payload: Record<string, unknown>): this;
    upsert(payload: Record<string, unknown> | Record<string, unknown>[], _options?: {
        onConflict?: string;
    }): this;
    delete(): this;
    eq(column: string, value: unknown): this;
    /** Postgrest-compatible NULL check: .is(column, null) => column IS NULL */
    is(column: string, value: null): this;
    in(column: string, values: unknown[]): this;
    not(column: string, operator: string, value: unknown): this;
    ilike(column: string, pattern: string): this;
    gte(column: string, value: unknown): this;
    gt(column: string, value: unknown): this;
    lte(column: string, value: unknown): this;
    lt(column: string, value: unknown): this;
    order(column: string, options?: {
        ascending?: boolean;
    }): this;
    range(from: number, to: number): this;
    limit(limit: number): this;
    single(): this;
    maybeSingle(): this;
    or(conditions: string): this;
    execute(): Promise<QueryResult<any>>;
    then<TResult1 = QueryResult<any>, TResult2 = never>(onfulfilled?: ((value: QueryResult<any>) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
}
declare class LocalStorageBucket {
    private bucket;
    constructor(bucket: string);
    private resolvePath;
    upload(objectPath: string, data: Buffer, options?: {
        upsert?: boolean;
        contentType?: string;
    }): Promise<QueryResult<null>>;
    download(objectPath: string): Promise<QueryResult<{
        arrayBuffer: () => Promise<ArrayBuffer>;
    }>>;
    createSignedUrl(objectPath: string, _expiresIn: number): Promise<QueryResult<{
        signedUrl: string;
    }>>;
}
declare class LocalStorageClient {
    from(bucket: string): LocalStorageBucket;
}
declare class LocalAuthAdmin {
    getUserById(userId: string): Promise<QueryResult<{
        user: {
            id: string;
            email?: string | null;
        } | null;
    }>>;
    createUser(payload: {
        id?: string;
        email?: string;
        email_confirm?: boolean;
    }): Promise<QueryResult<{
        user: {
            id: string;
            email?: string | null;
        };
    }>>;
    listUsers(): Promise<QueryResult<{
        users: Array<{
            id: string;
            email?: string | null;
        }>;
    }>>;
    generateLink(payload: {
        type: string;
        email: string;
        options?: {
            redirectTo?: string;
        };
    }): Promise<QueryResult<{
        properties: {
            action_link: string;
        };
    }>>;
}
declare class LocalAuthClient {
    admin: LocalAuthAdmin;
    refreshSession(_opts: {
        refresh_token: string;
    }): Promise<QueryResult<{
        session: null;
    }>>;
    getUser(token: string): Promise<QueryResult<{
        user: {
            id: string;
            email?: string | null;
        };
    }>>;
}
export declare class LocalDbClient {
    storage: LocalStorageClient;
    auth: LocalAuthClient;
    from(table: string): LocalQueryBuilder;
}
export declare function createLocalDbClient(): LocalDbClient;
export {};
//# sourceMappingURL=local_db_adapter.d.ts.map