import { GrpcObject } from '@grpc/grpc-js'; import { GrpcComponentConfig } from './types'; /** * GRPC TypeScript generator. * This class will iterate over a directory generating * corresponding typescript files from proto files. * Required for `@grpc` configuration and strict development. */ export declare class ProtoTSGenerator { protected readonly config: GrpcComponentConfig; /** * proto instances directory loaded during * boot time and later being used by implemented grpc * controllers. */ private protos; /** * @param - config */ constructor(config?: GrpcComponentConfig); /** * This method will find and load all protos * contained within the project directory. Saving in memory * instances for those found protos for later usage. * * @returns {void} * @memberof GrpcGenerator */ execute(): void; /** * This method will return a proto instance * from the proto list directory, previously loaded during * boot time. * * @param name * */ getProto(name: string): GrpcObject | undefined | null; /** * This method receive a proto file path and * load that proto using the official grpc library. * * @param {string} protoPath * @returns {GrpcObject} * @memberof GrpcGenerator */ loadProto(protoPath: string): GrpcObject; /** * This method will getProtoPaths a directory look ahead and * typescript files generations from found proto files. * * @returns {string[]} * @memberof GrpcGenerator */ getProtoPaths(): string[]; /** * This method will generate a typescript * file representing the provided proto file by calling * google's proto compiler and using * protoc-ts plugin. * * @private * @param {string} proto * @returns {Buffer} * @memberof GrpcGenerator */ private generate; }