import type { RpcResponse } from "./rpc-types.ts";
type PendingReply = {
    readonly onResponse?: (response: RpcResponse) => void;
    readonly resolve: (response: RpcResponse) => void;
};
/** Responses are never events. Dispatch hooks before resolving, so the next frame sees their effects. */
/**
 * The ids this client wrote without waiting for a reply (`extension_ui_response`, `extension_ui_progress`), counted
 * per id because a draft is sent many times under its dialog's id. The engine answers each, so its reply is consumed
 * here rather than reported as dropped (senpi#5761). Bounded: an engine that never replies cannot grow it.
 */
export declare class UnawaitedReplies {
    private readonly counts;
    private readonly max;
    constructor(max?: number);
    note(id: string): void;
    take(id: string): boolean;
}
export declare function handleRpcReply<T extends PendingReply>(value: unknown, requests: Map<string, T>, admissions: {
    receive(input: unknown): void;
}, unawaited?: UnawaitedReplies): boolean;
export {};
//# sourceMappingURL=rpc-client-replies.d.ts.map