import { Server as RpcServer } from '@grpc/grpc-js'; import { Application, Binding, Constructor, Context, ControllerClass, Server as LbServer } from '@loopback/core'; import { ProtoTSGenerator } from './proto-ts-generator'; import { ControllerInstance, GrpcComponentConfig, GrpcSequenceInterface } from './types'; /** * This Class provides a LoopBack Server implementing gRPC * * @export * @class GrpcServer * @extends {Context} * @implements {LbServer} */ export declare class GrpcServer extends Context implements LbServer { protected readonly app: Application; protected readonly config: GrpcComponentConfig; protected server: RpcServer; protected readonly protoTSGenerator: ProtoTSGenerator; protected _listening: boolean; /** * @memberof GrpcServer * Creates an instance of GrpcServer. * * @param app - The application instance (injected via * CoreBindings.APPLICATION_INSTANCE). * @param server - The actual GRPC Server module (injected via * @param options - The configuration options (injected via * */ constructor(app: Application, config: GrpcComponentConfig, server: RpcServer, protoTSGenerator: ProtoTSGenerator); get listening(): boolean; set listening(value: boolean); setupControllers(): void; controller(controllerCtor: ControllerClass): Binding>; /** * Configure a custom sequence class for handling incoming requests. * * @example * ```ts * class MySequence implements SequenceHandler { * constructor( * @inject('send) public send: Send)) { * } * * public async handle({response}: RequestContext) { * send(response, 'hello world'); * } * } * ``` * @param {Constructor} sequenceClass * @returns * * @memberOf GrpcServer */ sequence(sequenceClass: Constructor): Binding; start(): Promise; stop(): Promise; private setupControllerMethod; /** * Set up gRPC call * @param prototype * @param methodName */ private setupGrpcCall; }