import * as protobuf from 'protobufjs'; import * as grpc from '@grpc/grpc-js'; /** * gRPC client. * * @public */ export interface GrpcClient extends grpc.Client { [methodName: string]: Function; } /** * gRPC client creator for a service. * * @public */ export interface GrpcClientCreator { /** * Create a new client for service. * * @param address - the address for the service, or undefined if client is for another component in this Kalix Service * @param credentials - the credentials for the connection * @returns a new gRPC client for the service */ createClient(address?: string, credentials?: grpc.ChannelCredentials): GrpcClient; } /** * gRPC client lookup, using fully qualified name for service. * * @public */ export interface GrpcClientLookup { [index: string]: GrpcClientLookup | GrpcClientCreator; } /** @public */ export declare class GrpcUtil { /** * Iterate through a (resolved) protobufjs reflection object to find services. */ static getServiceNames(obj: protobuf.ReflectionObject, parentName?: string): Array; /** * Add default headers/metadata to all request methods */ static addHeadersToAllRequests(client: any, metadataWithHeaders: grpc.Metadata): void; /** * add async versions of unary request methods, suffixed with the given suffix */ static promisifyClient(client: any, suffix?: string): any; }