import type { AnyMessageSchema } from "./types.js";
export declare class RequestTracker {
    private limit;
    private pending;
    constructor(limit: number);
    /**
     * Registers a pending request.
     * Throws StateError if limit exceeded.
     */
    register(correlationId: string, expectedType: string, schema: AnyMessageSchema, timeoutMs: number, onFlush: () => void, signal?: AbortSignal): Promise<unknown>;
    /**
     * Handles inbound message with correlationId.
     * Four-way dispatch:
     * 1. Type matches → resolve with validated message
     * 2. Type is ERROR → reject with ServerError
     * 3. Type mismatches (non-error) → reject with ValidationError
     * 4. Validation fails → reject with ValidationError
     */
    handleReply(msg: unknown, safeParse: (schema: AnyMessageSchema, data: unknown) => {
        success: boolean;
        data?: unknown;
        error?: unknown;
    }): void;
    /**
     * Rejects all pending requests (on disconnect).
     */
    rejectAll(): void;
    get size(): number;
}
//# sourceMappingURL=requests.d.ts.map