import type { Address } from '@solana/kit'; import type { EventEmitter } from './events.js'; export interface QuicConnection { /** Opaque handle; actual creation lives in quic-sender.ts. */ destroy(reason?: string): Promise; /** Whether the underlying connection is still usable. */ isOpen(): boolean; } export interface PoolEntry { readonly identity: Address; readonly addr: string; readonly conn: QuicConnection; readonly streamSlots: AsyncSemaphore; refcount: number; lastUse: number; state: 'open' | 'draining' | 'closed'; } export interface OpenConnArgs { identity: Address; addr: string; maxStreams: number; } export interface QuicPoolOptions { /** Injected by quic-sender — the pool doesn't know how to build a QUICClient. */ openConn: (args: OpenConnArgs) => Promise; maxStreamsFor: (identity: Address) => number; poolCap?: number; emit: EventEmitter; signal: AbortSignal; /** Read current upcoming leaders to drive aggressive eviction. */ getUpcomingIdentities: () => ReadonlySet
; /** Returns true if this identity is quarantined (e.g. cert-pin-mismatch). */ isQuarantined?: (identity: Address) => boolean; } export declare class QuicPool { #private; constructor(opts: QuicPoolOptions); /** F13: number of open entries in the pool. No new Set allocations. */ get size(): number; acquire(identity: Address, addr: string): Promise; release(entry: PoolEntry): void; } /** * F10: Async semaphore with FIFO wait queue. * tryAcquire() preserves reject-fast behavior; acquire() waits in queue. */ export declare class AsyncSemaphore { #private; constructor(initial: number, maxWaiters?: number); tryAcquire(): boolean; acquire(signal?: AbortSignal): Promise; release(): void; get available(): number; /** F10: number of callers waiting in queue. */ get waiting(): number; } //# sourceMappingURL=quic-pool.d.ts.map