1 |
|
2 |
|
3 | import { Logger } from '@nestjs/common/services/logger.service';
|
4 | import { EventEmitter } from 'events';
|
5 | import { Observable, ReplaySubject } from 'rxjs';
|
6 | import { RmqUrl } from '../external/rmq-url.interface';
|
7 | import { ReadPacket, RmqOptions, WritePacket } from '../interfaces';
|
8 | import { ClientProxy } from './client-proxy';
|
9 | type Channel = any;
|
10 | type ChannelWrapper = any;
|
11 | type AmqpConnectionManager = any;
|
12 |
|
13 |
|
14 |
|
15 | export declare class ClientRMQ extends ClientProxy {
|
16 | protected readonly options: RmqOptions['options'];
|
17 | protected readonly logger: Logger;
|
18 | protected connection$: ReplaySubject<any>;
|
19 | protected connection: Promise<any>;
|
20 | protected client: AmqpConnectionManager;
|
21 | protected channel: ChannelWrapper;
|
22 | protected urls: string[] | RmqUrl[];
|
23 | protected queue: string;
|
24 | protected queueOptions: Record<string, any>;
|
25 | protected responseEmitter: EventEmitter;
|
26 | protected replyQueue: string;
|
27 | protected persistent: boolean;
|
28 | protected noAssert: boolean;
|
29 | constructor(options: RmqOptions['options']);
|
30 | close(): void;
|
31 | connect(): Promise<any>;
|
32 | createChannel(): Promise<void>;
|
33 | createClient(): AmqpConnectionManager;
|
34 | mergeDisconnectEvent<T = any>(instance: any, source$: Observable<T>): Observable<T>;
|
35 | convertConnectionToPromise(): Promise<any>;
|
36 | setupChannel(channel: Channel, resolve: Function): Promise<void>;
|
37 | consumeChannel(channel: Channel): Promise<void>;
|
38 | handleError(client: AmqpConnectionManager): void;
|
39 | handleDisconnectError(client: AmqpConnectionManager): void;
|
40 | handleMessage(packet: unknown, callback: (packet: WritePacket) => any): any;
|
41 | handleMessage(packet: unknown, options: Record<string, unknown>, callback: (packet: WritePacket) => any): any;
|
42 | protected publish(message: ReadPacket, callback: (packet: WritePacket) => any): () => void;
|
43 | protected dispatchEvent(packet: ReadPacket): Promise<any>;
|
44 | protected initializeSerializer(options: RmqOptions['options']): void;
|
45 | protected mergeHeaders(requestHeaders?: Record<string, string>): Record<string, string> | undefined;
|
46 | protected parseMessageContent(content: Buffer): any;
|
47 | }
|
48 | export {};
|