import type { RpcCallShared } from "./rpc-call-shared"; import type { RpcStatus } from "./rpc-status"; import type { MethodInfo } from "./reflection-info"; import type { RpcMetadata } from "./rpc-metadata"; /** * A unary RPC call. Unary means there is exactly one input message and * exactly one output message unless an error occurred. */ export declare class UnaryCall 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 an * error status code. */ readonly headers: Promise; /** * The message the server replied with. * * If the server does not send a message, this promise will reject with a * `RpcError`. */ 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: RpcMetadata, request: I, headers: Promise, response: Promise, status: Promise, trailers: Promise); /** * If you are only interested in the final outcome of this call, * you can await it to receive a `FinishedUnaryCall`. */ then, TResult2 = never>(onfulfilled?: ((value: FinishedUnaryCall) => (PromiseLike | TResult1)) | undefined | null, onrejected?: ((reason: any) => (PromiseLike | TResult2)) | undefined | null): Promise; private promiseFinished; } /** * A completed unary RPC call. This will only exists if the RPC was * successful. */ export interface FinishedUnaryCall { /** * Reflection information about this call. */ readonly method: MethodInfo; /** * Request headers being sent with the request. */ readonly requestHeaders: Readonly; /** * The request message that has been sent. */ readonly request: 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; }