import type { KeetaAnchorQueueStorageDriver, KeetaAnchorQueueStorageDriverConstructor, KeetaAnchorQueueRequest, KeetaAnchorQueueRequestID, KeetaAnchorQueueEntry, KeetaAnchorQueueEntryExtra, KeetaAnchorQueueEntryAncillaryData, KeetaAnchorQueueStatus, KeetaAnchorQueueFilter } from '../index.ts';
import type { JSONSerializable } from '../../utils/json.js';
import type * as pg from 'pg';
type KeetaAnchorQueueStorageDriverPostgresOptions = {
    /**
     * Function that returns a Postgres connection pool.
     */
    pool: () => Promise<pg.Pool>;
    /**
     * The prefix to use for the database tables. Defaults to 'queue',
     * resulting in table names 'queue_entries', 'queue_idempotent_keys',
     * and `queue_schema_version`.
     */
    tablePrefix?: string | undefined;
};
export default class KeetaAnchorQueueStorageDriverPostgres<QueueRequest extends JSONSerializable = JSONSerializable, QueueResult extends JSONSerializable = JSONSerializable> implements KeetaAnchorQueueStorageDriver<QueueRequest, QueueResult> {
    private readonly logger;
    private poolInternal;
    private tablePrefix;
    private tableNameEntries;
    private tableNameSchemaVersion;
    private tableNameIdempotentKeys;
    private dbInitializationPromise;
    private serializationRetryCount;
    private debugForceIndexScan;
    readonly name = "KeetaAnchorQueueStorageDriverPostgres";
    readonly id: string;
    readonly path: string[];
    private readonly pathStr;
    private toctouDelay;
    constructor(options: NonNullable<ConstructorParameters<KeetaAnchorQueueStorageDriverConstructor<QueueRequest, QueueResult>>[0]> & KeetaAnchorQueueStorageDriverPostgresOptions);
    private initializeDBConnection;
    private methodLogger;
    private runWithRetry;
    private newDBConnection;
    private dbTransaction;
    add(request: KeetaAnchorQueueRequest<QueueRequest>, info?: KeetaAnchorQueueEntryExtra): Promise<KeetaAnchorQueueRequestID>;
    setStatus(id: KeetaAnchorQueueRequestID, status: KeetaAnchorQueueStatus, ancillary?: KeetaAnchorQueueEntryAncillaryData<QueueResult>): Promise<void>;
    get(id: KeetaAnchorQueueRequestID): Promise<KeetaAnchorQueueEntry<QueueRequest, QueueResult> | null>;
    query(filter?: KeetaAnchorQueueFilter): Promise<KeetaAnchorQueueEntry<QueueRequest, QueueResult>[]>;
    partition(path: string): Promise<KeetaAnchorQueueStorageDriver<QueueRequest, QueueResult>>;
    destroy(): Promise<void>;
    [Symbol.asyncDispose](): Promise<void>;
}
export {};
//# sourceMappingURL=queue_postgres.d.ts.map