UNPKG

6.05 kBTypeScriptView Raw
1export namespace Replies {
2 interface Empty {
3 }
4 interface AssertQueue {
5 queue: string;
6 messageCount: number;
7 consumerCount: number;
8 }
9 interface PurgeQueue {
10 messageCount: number;
11 }
12 interface DeleteQueue {
13 messageCount: number;
14 }
15 interface AssertExchange {
16 exchange: string;
17 }
18 interface Consume {
19 consumerTag: string;
20 }
21}
22
23export namespace Options {
24 interface Connect {
25 /**
26 * The to be used protocol
27 *
28 * Default value: 'amqp'
29 */
30 protocol?: string | undefined;
31 /**
32 * Hostname used for connecting to the server.
33 *
34 * Default value: 'localhost'
35 */
36 hostname?: string | undefined;
37 /**
38 * Port used for connecting to the server.
39 *
40 * Default value: 5672
41 */
42 port?: number | undefined;
43 /**
44 * Username used for authenticating against the server.
45 *
46 * Default value: 'guest'
47 */
48 username?: string | undefined;
49 /**
50 * Password used for authenticating against the server.
51 *
52 * Default value: 'guest'
53 */
54 password?: string | undefined;
55 /**
56 * The desired locale for error messages. RabbitMQ only ever uses en_US
57 *
58 * Default value: 'en_US'
59 */
60 locale?: string | undefined;
61 /**
62 * The size in bytes of the maximum frame allowed over the connection. 0 means
63 * no limit (but since frames have a size field which is an unsigned 32 bit integer, it’s perforce 2^32 - 1).
64 *
65 * Default value: 0x1000 (4kb) - That's the allowed minimum, it will fit many purposes
66 */
67 frameMax?: number | undefined;
68 /**
69 * The period of the connection heartbeat in seconds.
70 *
71 * Default value: 0
72 */
73 heartbeat?: number | undefined;
74 /**
75 * What VHost shall be used.
76 *
77 * Default value: '/'
78 */
79 vhost?: string | undefined;
80 }
81
82 interface AssertQueue {
83 exclusive?: boolean | undefined;
84 durable?: boolean | undefined;
85 autoDelete?: boolean | undefined;
86 arguments?: any;
87 messageTtl?: number | undefined;
88 expires?: number | undefined;
89 deadLetterExchange?: string | undefined;
90 deadLetterRoutingKey?: string | undefined;
91 maxLength?: number | undefined;
92 maxPriority?: number | undefined;
93 }
94 interface DeleteQueue {
95 ifUnused?: boolean | undefined;
96 ifEmpty?: boolean | undefined;
97 }
98 interface AssertExchange {
99 durable?: boolean | undefined;
100 internal?: boolean | undefined;
101 autoDelete?: boolean | undefined;
102 alternateExchange?: string | undefined;
103 arguments?: any;
104 }
105 interface DeleteExchange {
106 ifUnused?: boolean | undefined;
107 }
108 interface Publish {
109 expiration?: string | number | undefined;
110 userId?: string | undefined;
111 CC?: string | string[] | undefined;
112
113 mandatory?: boolean | undefined;
114 persistent?: boolean | undefined;
115 deliveryMode?: boolean | number | undefined;
116 BCC?: string | string[] | undefined;
117
118 contentType?: string | undefined;
119 contentEncoding?: string | undefined;
120 headers?: any;
121 priority?: number | undefined;
122 correlationId?: string | undefined;
123 replyTo?: string | undefined;
124 messageId?: string | undefined;
125 timestamp?: number | undefined;
126 type?: string | undefined;
127 appId?: string | undefined;
128 }
129 interface Consume {
130 consumerTag?: string | undefined;
131 noLocal?: boolean | undefined;
132 noAck?: boolean | undefined;
133 exclusive?: boolean | undefined;
134 priority?: number | undefined;
135 arguments?: any;
136 }
137 interface Get {
138 noAck?: boolean | undefined;
139 }
140}
141
142export interface Message {
143 content: Buffer;
144 fields: MessageFields;
145 properties: MessageProperties;
146}
147
148export interface GetMessage extends Message {
149 fields: GetMessageFields;
150}
151
152export interface ConsumeMessage extends Message {
153 fields: ConsumeMessageFields;
154}
155
156export interface CommonMessageFields {
157 deliveryTag: number;
158 redelivered: boolean;
159 exchange: string;
160 routingKey: string;
161}
162
163export interface MessageFields extends CommonMessageFields {
164 messageCount?: number | undefined;
165 consumerTag?: string | undefined;
166}
167
168export interface GetMessageFields extends CommonMessageFields {
169 messageCount: number;
170}
171
172export interface ConsumeMessageFields extends CommonMessageFields {
173 consumerTag: string;
174}
175
176export interface MessageProperties {
177 contentType: any | undefined;
178 contentEncoding: any | undefined;
179 headers: MessagePropertyHeaders;
180 deliveryMode: any | undefined;
181 priority: any | undefined;
182 correlationId: any | undefined;
183 replyTo: any | undefined;
184 expiration: any | undefined;
185 messageId: any | undefined;
186 timestamp: any | undefined;
187 type: any | undefined;
188 userId: any | undefined;
189 appId: any | undefined;
190 clusterId: any | undefined;
191}
192
193export interface MessagePropertyHeaders {
194 "x-first-death-exchange"?: string | undefined;
195 "x-first-death-queue"?: string | undefined;
196 "x-first-death-reason"?: string | undefined;
197 "x-death"?: XDeath[] | undefined;
198 [key: string]: any;
199}
200
201export interface XDeath {
202 count: number;
203 reason: "rejected" | "expired" | "maxlen";
204 queue: string;
205 time: {
206 "!": "timestamp";
207 value: number;
208 };
209 exchange: string;
210 "original-expiration"?: any;
211 "routing-keys": string[];
212}
213
214export interface ServerProperties {
215 host: string;
216 product: string;
217 version: string;
218 platform: string;
219 copyright?: string | undefined;
220 information: string;
221 [key: string]: string | undefined;
222}