import { IWebBrokerBridgeMessage } from "./IWebBrokerBridgeMessage.js"; export type WebBrokerBridgeSendFn = (message: TReq) => void; /** * Correlates outbound requests with inbound responses by `requestId`. */ export declare class PendingRequestRegistry { private readonly pending; /** * Register a pending request. Returns a promise that resolves when a * response with the matching `requestId` arrives, or rejects if the * caller invokes `reject` for that id. */ register(requestId: string): Promise; /** Resolve a pending request. No-op if `requestId` isn't registered. */ resolve(requestId: string, response: TResp): void; /** Reject a pending request. No-op if `requestId` isn't registered. */ reject(requestId: string, reason: unknown): void; /** True if `requestId` has an in-flight registration. */ has(requestId: string): boolean; /** * Register, then invoke `send` synchronously. If `send` throws, the * pending entry is cleared and the promise rejects with the thrown * error. */ sendAndAwait(message: TReq, send: WebBrokerBridgeSendFn): Promise; } //# sourceMappingURL=PendingRequestRegistry.d.ts.map