import type { RpcCallShared } from "./rpc-call-shared"; import type { RpcInputStream } from "./rpc-input-stream"; import type { RpcStatus } from "./rpc-status"; import type { RpcMetadata } from "./rpc-metadata"; import type { MethodInfo } from "./reflection-info"; /** * A client streaming RPC call. This means that the clients sends 0, 1, or * more messages to the server, and the server replies with exactly one * message. */ export declare class ClientStreamingCall implements RpcCallShared { /** * 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; /** * Request messages from the client. */ readonly requests: RpcInputStream; /** * 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; /** * The message the server replied with. */ readonly response: Promise; /** * 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: RpcInputStream, headers: Promise, response: Promise, 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. * Note that it may still be valid to send more request messages. */ then, TResult2 = never>(onfulfilled?: ((value: FinishedClientStreamingCall) => (PromiseLike | TResult1)) | undefined | null, onrejected?: ((reason: any) => (PromiseLike | TResult2)) | undefined | null): Promise; private promiseFinished; } /** * A completed client streaming RPC call. The server will not send any more * messages, but it may still be valid to send request messages. */ export interface FinishedClientStreamingCall { /** * Reflection information about this call. */ readonly method: MethodInfo; /** * Request headers being sent with the request. */ readonly requestHeaders: Readonly; /** * The response headers that the server sent. */ readonly headers: RpcMetadata; /** * The message the server replied with. */ readonly response: O; /** * 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; }