import type { MessageStreamEvent } from "#protocol/message.js"; import type { MessageResult } from "#client/types.js"; /** * Internal configuration passed to construct a {@link MessageResponse}. */ interface MessageResponseInput { readonly createStream: () => AsyncGenerator; readonly sessionId: string; } /** * The response from {@link ClientSession.send}. * * Like `fetch()`, the response exposes its session ID as soon as the POST * completes. Collect the event stream via * {@link result} or iterate it with `for await...of`. */ export declare class MessageResponse implements AsyncIterable { #private; /** * Session ID assigned by the server. */ readonly sessionId: string; /** @internal */ constructor(input: MessageResponseInput); /** * Consumes the full event stream and returns the aggregated * {@link MessageResult}. */ result(): Promise>; /** * Yields stream events one at a time. * * Each response can only be consumed once. */ [Symbol.asyncIterator](): AsyncIterator; } export {};