UNPKG

1.48 kBTypeScriptView Raw
1import { Logger } from '@nestjs/common/services/logger.service';
2import { Observable } from 'rxjs';
3import { ClientGrpc, GrpcOptions } from '../interfaces';
4import { ClientProxy } from './client-proxy';
5/**
6 * @publicApi
7 */
8export declare class ClientGrpcProxy extends ClientProxy implements ClientGrpc {
9 protected readonly options: GrpcOptions['options'];
10 protected readonly logger: Logger;
11 protected readonly clients: Map<string, any>;
12 protected readonly url: string;
13 protected grpcClients: any[];
14 constructor(options: GrpcOptions['options']);
15 getService<T extends {}>(name: string): T;
16 getClientByServiceName<T = unknown>(name: string): T;
17 createClientByServiceName(name: string): any;
18 getKeepaliveOptions(): {};
19 createServiceMethod(client: any, methodName: string): (...args: unknown[]) => Observable<unknown>;
20 createStreamServiceMethod(client: unknown, methodName: string): (...args: any[]) => Observable<any>;
21 createUnaryServiceMethod(client: any, methodName: string): (...args: any[]) => Observable<any>;
22 createClients(): any[];
23 loadProto(): any;
24 lookupPackage(root: any, packageName: string): any;
25 close(): void;
26 connect(): Promise<any>;
27 send<TResult = any, TInput = any>(pattern: any, data: TInput): Observable<TResult>;
28 protected getClient(name: string): any;
29 protected publish(packet: any, callback: (packet: any) => any): any;
30 protected dispatchEvent(packet: any): Promise<any>;
31}