import type { EventLoopDelay } from './event-loop'; export declare const POOL_TIMEOUT_CODE = "DB_POOL_ACQUIRE_TIMEOUT"; export interface PoolState { used: number; free: number; pendingAcquires: number; pendingCreates: number; min?: number; max?: number; } export interface PoolTimeoutDetails { code: typeof POOL_TIMEOUT_CODE; /** How long this caller waited before knex gave up. */ waitedMs: number; /** The timeout knex applied: the smaller of acquireConnectionTimeout and pool.acquireTimeoutMillis. */ acquireTimeoutMs?: number; /** As configured, when set. */ acquireConnectionTimeout?: number; poolAcquireTimeoutMillis?: number; /** Pool counts at the moment of the timeout. */ pool?: PoolState; /** tarn's message: the error of a failed connection attempt, or "operation timed out for an unknown reason". */ poolReason?: string; eventLoopDelay?: EventLoopDelay; phase?: string; hostname: string; pid: number; } export interface TarnPoolLike { min?: number; max?: number; acquireTimeoutMillis?: number; numUsed(): number; numFree(): number; numPendingAcquires(): number; numPendingCreates(): number; } export interface KnexClientLike { config?: { acquireConnectionTimeout?: unknown; pool?: { acquireTimeoutMillis?: unknown; }; }; /** A tarn pool, or knex's wrapper around a native driver pool, which has no counters. */ pool?: Partial | null; } export interface CollectInput { waitedMs: number; cause: unknown; eventLoopDelay?: EventLoopDelay; phase?: string; hostname: string; pid: number; } export declare const readPoolState: (pool: Partial | null | undefined) => PoolState | undefined; export declare const collectPoolTimeoutDetails: (client: KnexClientLike, input: CollectInput) => PoolTimeoutDetails; //# sourceMappingURL=details.d.ts.map