@kaushverse/rabbitmq-core 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +13 -17
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -6,33 +6,20 @@ interface RabbitTLSOptions {
|
|
|
6
6
|
servername?: string;
|
|
7
7
|
rejectUnauthorized?: boolean;
|
|
8
8
|
}
|
|
9
|
-
interface RabbitConnectionOptions$1 {
|
|
10
|
-
url: string;
|
|
11
|
-
tls?: RabbitTLSOptions;
|
|
12
|
-
socketOptions?: Options.Connect;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
9
|
interface RabbitConnectionOptions {
|
|
16
10
|
url: string;
|
|
17
11
|
tls?: RabbitTLSOptions;
|
|
12
|
+
socketOptions?: Options.Connect;
|
|
18
13
|
}
|
|
19
|
-
|
|
20
|
-
declare function connectRabbitMQ(options: RabbitConnectionOptions): Promise<Channel>;
|
|
21
|
-
declare function getChannel(): Channel;
|
|
22
|
-
declare function closeRabbitMQ(): Promise<void>;
|
|
23
|
-
declare function isRabbitConnected(): boolean;
|
|
24
|
-
|
|
14
|
+
type ExchangeType = "direct" | "topic" | "fanout" | "headers";
|
|
25
15
|
interface ConsumeOptions {
|
|
26
16
|
queue: string;
|
|
27
17
|
exchange: string;
|
|
28
|
-
type:
|
|
18
|
+
type: ExchangeType;
|
|
29
19
|
routingKey?: string;
|
|
30
20
|
prefetch?: number;
|
|
31
21
|
noAck?: boolean;
|
|
32
22
|
}
|
|
33
|
-
declare function consumeMessage(options: ConsumeOptions, handler: (data: any, raw: ConsumeMessage) => Promise<void> | void): Promise<void>;
|
|
34
|
-
|
|
35
|
-
type ExchangeType = "direct" | "topic" | "fanout" | "headers";
|
|
36
23
|
interface PublishOptions {
|
|
37
24
|
exchange: string;
|
|
38
25
|
type: ExchangeType;
|
|
@@ -40,6 +27,15 @@ interface PublishOptions {
|
|
|
40
27
|
message: Buffer | string | object;
|
|
41
28
|
headers?: Record<string, any>;
|
|
42
29
|
}
|
|
30
|
+
|
|
31
|
+
declare const rabbitEvents: EventEmitter<[never]>;
|
|
32
|
+
declare function connectRabbitMQ(options: RabbitConnectionOptions): Promise<Channel>;
|
|
33
|
+
declare function getChannel(): Channel;
|
|
34
|
+
declare function closeRabbitMQ(): Promise<void>;
|
|
35
|
+
declare function isRabbitConnected(): boolean;
|
|
36
|
+
|
|
37
|
+
declare function consumeMessage(options: ConsumeOptions, handler: (data: any, raw: ConsumeMessage) => Promise<void> | void): Promise<void>;
|
|
38
|
+
|
|
43
39
|
declare function publishMessage({ exchange, type, routingKey, message, headers, }: PublishOptions): Promise<void>;
|
|
44
40
|
|
|
45
|
-
export { type
|
|
41
|
+
export { type ConsumeOptions, type ExchangeType, type PublishOptions, type RabbitConnectionOptions, type RabbitTLSOptions, closeRabbitMQ, connectRabbitMQ, consumeMessage, getChannel, isRabbitConnected, publishMessage, rabbitEvents };
|