import type { DatabaseWaitStatusResult } from '@heroku/types/data'; import type { ResourceCtx } from '../../core/extend-resource.js'; import type { ResolvedPgDatabase } from './internal/resolve-pg-database.js'; /** Classic `/client/v11` wait status, including its terminal error indicator. */ export type LegacyDatabaseWaitStatus = DatabaseWaitStatusResult & { 'error?'?: boolean; }; export type WaitForLegacyDatabaseReadyOptions = { /** Fires after each poll, including synthetic statuses for tolerated 404s. */ onPoll?: (event: { addon: ResolvedPgDatabase; status: LegacyDatabaseWaitStatus; }) => void; /** Aborts the in-flight request and any pending poll delay. */ signal?: AbortSignal; /** Polling interval in milliseconds. Defaults to 5000 (5s). */ waitIntervalMs?: number; }; export type LegacyDatabaseWaitResult = { addon: ResolvedPgDatabase; status: LegacyDatabaseWaitStatus; }; export type WaitForLegacyDatabaseReadyResult = { /** Results preserve input/list order; the app-wide form waits sequentially. */ databases: LegacyDatabaseWaitResult[]; }; /** Raised when classic Postgres reports an `error?` wait status. */ export declare class LegacyDatabaseWaitError extends Error { readonly addon: ResolvedPgDatabase; readonly status: LegacyDatabaseWaitStatus; constructor(addon: ResolvedPgDatabase, status: LegacyDatabaseWaitStatus); } /** * Polls the classic Postgres `/client/v11` wait-status endpoint. With an * identity, only that database is resolved and waited on; without one, all * legacy databases visible to the app are waited on sequentially. * * This intentionally has no timeout: classic `pg:wait` waits until ready or * aborted. The default 404 retry budget and interval match the CLI behavior. */ export declare function waitForLegacyDatabaseReady(ctx: Pick, appIdentity: string, addonIdentity?: string, options?: WaitForLegacyDatabaseReadyOptions): Promise; export declare const legacyDatabaseWaitExtensions: import("../../core/extend-resource.js").ResourceExtension<"data", "database", { waitForReadyForApp: (appIdentity: string, addonIdentity?: string, options?: WaitForLegacyDatabaseReadyOptions) => Promise; }>;