-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
64 lines (52 loc) · 1.43 KB
/
types.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import { Cog, CogLoaderOptions } from '@cisl/cog-loader';
import { Message, Options } from 'amqplib';
import { RedisOptions } from 'ioredis';
export { RedisOptions } from 'ioredis';
export interface MongoOptions {
host: string;
port: number;
db: string;
user?: string;
pass?: string;
}
// eslint-disable-next-line
export interface IoOptions extends CogLoaderOptions {}
export interface IoCog extends Cog {
mq?: boolean | RabbitOptions;
rabbit?: boolean | RabbitOptions;
mongo?: boolean | MongoOptions;
redis?: boolean | RedisOptions;
store?: boolean | RedisOptions;
[key: string]: unknown;
}
export type RabbitContentType = Buffer | string | number | unknown;
export interface RabbitMessage extends Omit<Message, 'content'> {
content: RabbitContentType;
}
interface RabbitBaseOnOptions {
contentType?: string;
}
export interface RabbitOnTopicOptions extends RabbitBaseOnOptions {
exchange?: string;
}
export interface RabbitOnRpcOptions extends RabbitBaseOnOptions {
/** set whether RPC queue is exclusive. Defaults to true. */
exclusive?: boolean;
}
export type RabbitOnQueueOptions = RabbitBaseOnOptions & Options.AssertQueue;
export interface RabbitOptions {
url?: string;
port?: number;
hostname?: string;
username?: string;
password?: string;
exchange?: string;
vhost?: string;
prefix?: string;
ssl?: boolean;
tls?: boolean;
cert?: string;
key?: string;
ca?: string;
passphrase?: string;
}