Interface describing the public API of the gRPC Client class, used to provide better version-to-version type compatibility between gRPC releases. Application code should use a concrete gRPC Client instance.

interface GrpcClient {
    close(): void;
    getChannel(): Channel;
    makeBidiStreamRequest<RequestType, ResponseType>(
        method: string,
        serialize: (value: RequestType) => Buffer<ArrayBufferLike>,
        deserialize: (value: Buffer<ArrayBufferLike>) => ResponseType,
        metadata: Metadata,
        options?: CallOptions,
    ): ClientDuplexStream<RequestType, ResponseType>;
    makeBidiStreamRequest<RequestType, ResponseType>(
        method: string,
        serialize: (value: RequestType) => Buffer<ArrayBufferLike>,
        deserialize: (value: Buffer<ArrayBufferLike>) => ResponseType,
        options?: CallOptions,
    ): ClientDuplexStream<RequestType, ResponseType>;
    makeClientStreamRequest<RequestType, ResponseType>(
        method: string,
        serialize: (value: RequestType) => Buffer<ArrayBufferLike>,
        deserialize: (value: Buffer<ArrayBufferLike>) => ResponseType,
        metadata: Metadata,
        options: CallOptions,
        callback: UnaryCallback<ResponseType>,
    ): ClientWritableStream<RequestType>;
    makeClientStreamRequest<RequestType, ResponseType>(
        method: string,
        serialize: (value: RequestType) => Buffer<ArrayBufferLike>,
        deserialize: (value: Buffer<ArrayBufferLike>) => ResponseType,
        metadata: Metadata | CallOptions,
        callback: UnaryCallback<ResponseType>,
    ): ClientWritableStream<RequestType>;
    makeClientStreamRequest<RequestType, ResponseType>(
        method: string,
        serialize: (value: RequestType) => Buffer<ArrayBufferLike>,
        deserialize: (value: Buffer<ArrayBufferLike>) => ResponseType,
        callback: UnaryCallback<ResponseType>,
    ): ClientWritableStream<RequestType>;
    makeServerStreamRequest<RequestType, ResponseType>(
        method: string,
        serialize: (value: RequestType) => Buffer<ArrayBufferLike>,
        deserialize: (value: Buffer<ArrayBufferLike>) => ResponseType,
        argument: RequestType,
        metadata: Metadata,
        options?: CallOptions,
    ): ClientReadableStream<ResponseType>;
    makeServerStreamRequest<RequestType, ResponseType>(
        method: string,
        serialize: (value: RequestType) => Buffer<ArrayBufferLike>,
        deserialize: (value: Buffer<ArrayBufferLike>) => ResponseType,
        argument: RequestType,
        options?: CallOptions,
    ): ClientReadableStream<ResponseType>;
    makeUnaryRequest<RequestType, ResponseType>(
        method: string,
        serialize: (value: RequestType) => Buffer<ArrayBufferLike>,
        deserialize: (value: Buffer<ArrayBufferLike>) => ResponseType,
        argument: RequestType,
        metadata: Metadata,
        options: CallOptions,
        callback: UnaryCallback<ResponseType>,
    ): SurfaceCall;
    makeUnaryRequest<RequestType, ResponseType>(
        method: string,
        serialize: (value: RequestType) => Buffer<ArrayBufferLike>,
        deserialize: (value: Buffer<ArrayBufferLike>) => ResponseType,
        argument: RequestType,
        metadata: Metadata | CallOptions,
        callback: UnaryCallback<ResponseType>,
    ): SurfaceCall;
    makeUnaryRequest<RequestType, ResponseType>(
        method: string,
        serialize: (value: RequestType) => Buffer<ArrayBufferLike>,
        deserialize: (value: Buffer<ArrayBufferLike>) => ResponseType,
        argument: RequestType,
        callback: UnaryCallback<ResponseType>,
    ): SurfaceCall;
    waitForReady(deadline: Deadline, callback: (error?: Error) => void): void;
}

Methods

  • Parameters

    • deadline: Deadline
    • callback: (error?: Error) => void

    Returns void