import type { RpcCallShared } from "./rpc-call-shared"; import type { RpcOutputStream } from "./rpc-output-stream"; import type { RpcStatus } from "./rpc-status"; import type { MethodInfo } from "./reflection-info"; import type { RpcMetadata } from "./rpc-metadata"; /** * A server streaming RPC call. The client provides exactly one input message * but the server may respond with 0, 1, or more messages. */ export declare class ServerStreamingCall implements RpcCallShared, PromiseLike> { /** * Reflection information about this call. */ readonly method: MethodInfo; /** * Request headers being sent with the request. * * Request headers are provided in the `meta` property of the * `RpcOptions` passed to a call. */ readonly requestHeaders: Readonly; /** * The request message being sent. */ readonly request: Readonly; /** * The response headers that the server sent. * * This promise will reject with a `RpcError` when the server sends a * error status code. */ readonly headers: Promise; /** * Response messages from the server. * This is an AsyncIterable that can be iterated with `await for .. of`. */ readonly responses: RpcOutputStream; /** * The response status the server replied with. * * This promise will resolve when the server has finished the request * successfully. * * If the server replies with an error status, this promise will * reject with a `RpcError`. */ readonly status: Promise; /** * The trailers the server attached to the response. * * This promise will resolve when the server has finished the request * successfully. * * If the server replies with an error status, this promise will * reject with a `RpcError`. */ readonly trailers: Promise; constructor(method: MethodInfo, requestHeaders: Readonly, request: Readonly, headers: Promise, response: RpcOutputStream, status: Promise, trailers: Promise); /** * Instead of awaiting the response status and trailers, you can * just as well await this call itself to receive the server outcome. * You should first setup some listeners to the `request` to * see the actual messages the server replied with. */ then, TResult2 = never>(onfulfilled?: ((value: FinishedServerStreamingCall) => (PromiseLike | TResult1)) | undefined | null, onrejected?: ((reason: any) => (PromiseLike | TResult2)) | undefined | null): Promise; private promiseFinished; } /** * A completed server streaming RPC call. The server will not send any more * messages. */ export interface FinishedServerStreamingCall { /** * Reflection information about this call. */ readonly method: MethodInfo; /** * Request headers being sent with the request. */ readonly requestHeaders: Readonly; /** * The request message being sent. */ readonly request: Readonly; /** * The response headers that the server sent. */ readonly headers: RpcMetadata; /** * The response status the server replied with. * The status code will always be OK. */ readonly status: RpcStatus; /** * The trailers the server attached to the response. */ readonly trailers: RpcMetadata; }