export type PoolConnectionMetrics = { total: number; idle: number; nonIdleOrConnecting: number; waiting: number; }; export type PoolMetrics = Readonly>; export type PoolSocketHandles = { active: ReadonlySet; owned: ReadonlySet; }; export declare function pendingPoolSocketEpisode(options: { initial: ForkLeakHandshakeSnapshot; probe: ForkLeakHandshakeSnapshot; current: ForkLeakHandshakeSnapshot; initialPool: PoolConnectionCounts; currentPool: PoolConnectionCounts; ownedHandlesObserved: ReadonlySet; previousHandle: object | null; }): { handle: object | null; inFlight: boolean; }; export type ForkLeakHandshakeSnapshot = { connectWraps: number; tcpSockets: number; resources: readonly string[]; tcpSocketHandles: ReadonlySet; poolMetrics: PoolMetrics | null; }; /** * Records one fork-leak checkpoint from a handshake settlement. It counts the resources of the * coalesced snapshot, or of the detector snapshot otherwise, and passes them to `record` (for * example a fork leak detector's `record`) with the test file name. Returns what `record` returns. */ export declare function recordForkLeakCheckpoint(record: (counts: ReadonlyMap, testFile: string) => T[], settlement: { snapshot: ForkLeakHandshakeSnapshot; detectorSnapshot: ForkLeakHandshakeSnapshot; coalesced: boolean; }, testFile: string): T[]; export type PoolConnectionCounts = { total: number; idle: number; nonIdleOrConnecting: number; waiting: number; }; export declare function handshakeSnapshot(resources: readonly string[], tcpSocketHandles: ReadonlySet, poolMetrics: PoolMetrics | null): ForkLeakHandshakeSnapshot; export declare function poolConnectionCounts(metrics: PoolMetrics): PoolConnectionCounts; export declare function samePoolCounts(previous: PoolConnectionCounts, current: PoolConnectionCounts): boolean; export declare function handshakeSettled(previous: ForkLeakHandshakeSnapshot, current: ForkLeakHandshakeSnapshot): boolean; export declare function rawDetectorCheckpoint(options: { current: ForkLeakHandshakeSnapshot; ownedHandlesObserved: ReadonlySet; unownedGrowthSnapshots: ReadonlyMap; }): ForkLeakHandshakeSnapshot;