import { ILogger } from '@powersync/common';
import { AsyncDatabaseConnection, OnTableChangeCallback, ProxiedQueryResult } from '../../db/adapters/AsyncDatabaseConnection';
import { ResolvedWebSQLOpenOptions } from '../../db/adapters/web-sql-flags';
/**
 * Keeps track of open DB connections and the clients which
 * are using it.
 */
export type SharedDBWorkerConnection = {
    clientIds: Set<number>;
    db: AsyncDatabaseConnection;
};
export type SharedWASQLiteConnectionOptions = {
    dbMap: Map<string, SharedDBWorkerConnection>;
    dbFilename: string;
    clientId: number;
    logger: ILogger;
};
export declare class SharedWASQLiteConnection implements AsyncDatabaseConnection {
    protected options: SharedWASQLiteConnectionOptions;
    protected isClosing: boolean;
    protected activeHoldId: string | null;
    constructor(options: SharedWASQLiteConnectionOptions);
    protected get logger(): ILogger;
    protected get dbEntry(): SharedDBWorkerConnection;
    protected get connection(): AsyncDatabaseConnection<ResolvedWebSQLOpenOptions>;
    protected get clientIds(): Set<number>;
    init(): Promise<void>;
    markHold(): Promise<string>;
    releaseHold(id: string): Promise<void>;
    isAutoCommit(): Promise<boolean>;
    /**
     * Handles closing of a shared connection.
     * The connection is only closed if there are no active clients using it.
     */
    close(): Promise<void>;
    protected withClosing<T>(action: () => Promise<T>): Promise<T>;
    execute(sql: string, params?: any[]): Promise<ProxiedQueryResult>;
    executeRaw(sql: string, params?: any[]): Promise<any[][]>;
    executeBatch(sql: string, params?: any[] | undefined): Promise<ProxiedQueryResult>;
    registerOnTableChange(callback: OnTableChangeCallback): Promise<() => void>;
    getConfig(): Promise<ResolvedWebSQLOpenOptions>;
}
