-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.d.ts
58 lines (58 loc) · 1.82 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
48
49
50
51
52
53
54
55
56
57
58
import { AbstractClient, Credential, ClientProfile } from './common';
export interface SendMessageResponse {
code: number;
message: string;
requestId: string;
msgId: string;
}
export interface ReceiveMessageResponse {
code: number;
message: string;
requestId: string;
msgBody?: string;
msgId?: string;
receiptHandle?: string;
enqueueTime?: number;
firstDequeueTime?: number;
nextVisibleTime?: number;
dequeueCount?: number;
clientRequestId?: number;
}
export interface DeleteMessageResponse {
code: number;
message: string;
requestId: string;
}
export interface CreateQueueResponse {
code: number;
message: string;
requestId: string;
queueId: string;
}
export interface DeleteQueueResponse {
code: number;
message: string;
requestId: string;
}
export declare class CMQ {
credential: Credential;
region: string;
apiVersion: string;
endpoint: string;
profile: ClientProfile;
client: AbstractClient;
/**
* 实例化client对象
* @param {string} endpoint 接入点域名
* @param {string} version 产品版本
* @param {Credential} credential 认证信息实例
* @param {string} region 产品地域
* @param {ClientProfile} profile 可选配置实例
*/
constructor(endpoint: string, version: string, credential: Credential, region: string, profile?: ClientProfile);
sendMessage(queueName: string, msgBody: string): Promise<SendMessageResponse>;
receiveMessage(queueName: string, pollingWaitSeconds: number): Promise<ReceiveMessageResponse>;
deleteMessage(queueName: string, receiptHandle: string): Promise<DeleteMessageResponse>;
createQueue(queueName: string, pollingWaitSeconds: number): Promise<CreateQueueResponse>;
deleteQueue(queueName: string): Promise<DeleteQueueResponse>;
}