UNPKG

1.02 kBTypeScriptView Raw
1import { Transport } from '../enums';
2import { Client } from '../external/nats-client.interface';
3import { CustomTransportStrategy } from '../interfaces';
4import { NatsOptions } from '../interfaces/microservice-configuration.interface';
5import { Server } from './server';
6export declare class ServerNats extends Server implements CustomTransportStrategy {
7 private readonly options;
8 readonly transportId = Transport.NATS;
9 private readonly url;
10 private natsClient;
11 constructor(options: NatsOptions['options']);
12 listen(callback: () => void): void;
13 start(callback?: () => void): void;
14 bindEvents(client: Client): void;
15 close(): void;
16 createNatsClient(): Client;
17 getMessageHandler(channel: string, client: Client): Function;
18 handleMessage(channel: string, rawMessage: any, client: Client, replyTo: string, callerSubject: string): Promise<any>;
19 getPublisher(publisher: Client, replyTo: string, id: string): (response: any) => void;
20 handleError(stream: any): void;
21}