-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.d.ts
47 lines (42 loc) · 1.6 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { Channel, ConfirmChannel, Connection } from 'amqplib-as-promised/lib';
import { FastifyPluginAsync } from 'fastify';
declare namespace fastifyAmqpAsync {
type FastifyAmqpAsyncConnection = Connection;
type FastifyAmqpAsyncChannel = Channel;
type FastifyAmqpAsyncConfirmChannel = ConfirmChannel;
interface FastifyAmqpAsyncOptions {
/**
* AMQP connection string
* @default 'amqp://guest:guest@localhost:5672'
*/
connectionString?: string;
/**
* Spawn a confirm channel (awaiting publisher confirmations) exposed via FastifyInstance.amqp.confirmChannel
* @default true
*/
useConfirmChannel?: boolean;
/**
* Spawn a regular channel (fire-and-forget) exposed via FastifyInstance.amqp.channel
* @default false
*/
useRegularChannel?: boolean;
/**
* Ignore the default onClose handler which closes the connection
* If set to true, you have to manage closing the connection yourself
* (i.e. after waiting for all in-flight messages to be delivered)
* @default false
*/
ignoreOnClose?: boolean;
}
}
declare module 'fastify' {
interface FastifyInstance {
amqp: {
connection: fastifyAmqpAsync.FastifyAmqpAsyncConnection;
channel: fastifyAmqpAsync.FastifyAmqpAsyncChannel;
confirmChannel: fastifyAmqpAsync.FastifyAmqpAsyncConfirmChannel;
};
}
}
declare const fastifyAmqpAsync: FastifyPluginAsync<fastifyAmqpAsync.FastifyAmqpAsyncOptions>;
export default fastifyAmqpAsync;