grpc-js-reflection-client
Version:
Package use Grpc reflection api to download grpc proto descriptor. Now you don't have to add proto file to each package. Simple direct download proto package from example microservice without any files.
17 lines (16 loc) • 723 B
TypeScript
import { ChannelCredentials, GrpcObject } from "@grpc/grpc-js";
import { Options } from "@grpc/proto-loader";
type DescriptorServiceHelperOptionsByProtoFileName = {
proto_filename: string;
};
type DescriptorServiceHelperOptionsByProtoSymbol = {
proto_symbol: string;
};
type DescriptorServiceHelperOptionsSelector = DescriptorServiceHelperOptionsByProtoFileName | DescriptorServiceHelperOptionsByProtoSymbol;
export type DescriptorServiceHelperOptions = {
host: string;
credentials: ChannelCredentials;
protoLoaderOptions?: Options;
} & DescriptorServiceHelperOptionsSelector;
export declare const packageObjectHelper: <T = GrpcObject>(options: DescriptorServiceHelperOptions) => Promise<T>;
export {};