UNPKG

1.28 kBTypeScriptView Raw
1import { Logger } from '@nestjs/common/services/logger.service';
2import { Client, NatsMsg } from '../external/nats-client.interface';
3import { NatsOptions, PacketId, ReadPacket, WritePacket } from '../interfaces';
4import { ClientProxy } from './client-proxy';
5/**
6 * @publicApi
7 */
8export declare class ClientNats extends ClientProxy {
9 protected readonly options: NatsOptions['options'];
10 protected readonly logger: Logger;
11 protected natsClient: Client;
12 protected clientConnectionPromise: Promise<Client>;
13 constructor(options: NatsOptions['options']);
14 close(): Promise<void>;
15 connect(): Promise<any>;
16 createClient(): Promise<Client>;
17 handleStatusUpdates(client: Client): Promise<void>;
18 createSubscriptionHandler(packet: ReadPacket & PacketId, callback: (packet: WritePacket) => any): (error: unknown | undefined, natsMsg: NatsMsg) => Promise<any>;
19 protected publish(partialPacket: ReadPacket, callback: (packet: WritePacket) => any): () => void;
20 protected dispatchEvent(packet: ReadPacket): Promise<any>;
21 protected initializeSerializer(options: NatsOptions['options']): void;
22 protected initializeDeserializer(options: NatsOptions['options']): void;
23 protected mergeHeaders<THeaders = any>(requestHeaders?: THeaders): any;
24}