import { DbLease, DbLeaseHolder, DbLeaseOwner, SqliteConnectionPool } from "./SqlitePooledTypes";
import { SqliteLibrary } from "./SqliteLibrary";
/**
 * A single write connection to the database.
 */
export declare class SqliteWriteConnection implements SqliteConnectionPool, DbLeaseOwner {
    private readonly sqliteLibray;
    private readonly options;
    private writeConnectionPromise;
    /**
     * Should the connection be re-created after it has been released
     */
    private isConnectionValid;
    private isReleased;
    /**
     * Mutex to control access to the write connection.
     */
    private readonly writeConnectionMutex;
    private dbLease;
    constructor(sqliteLibray: SqliteLibrary, options: {
        acquireTimeout: number;
        destroyTimeout: number;
    });
    connect(): Promise<void>;
    close(): Promise<void>;
    runExclusive<T>(dbLeaseHolder: DbLeaseHolder, callback: (dbLease: DbLease) => Promise<T>): Promise<T>;
    leaseConnection(dbLeaseHolder: DbLeaseHolder): Promise<DbLease>;
    invalidateConnection(leasedDbConnection: DbLease): void;
    releaseConnection(leasedDbConnection: DbLease): Promise<void>;
    private createAndGetConnection;
    private createConnection;
    private assertNotReleased;
}
