-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
101 lines (88 loc) · 2.57 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
declare namespace __NSP__ {
/**
* The method options
*/
type Options = {[index: string]: any};
export interface decomposeAddressResponse {
name: string;
address: string;
}
/**
* @description Delivery proxy
*/
export interface Delivery {
send(options: Options): Promise<any>;
sendTemplate(options: Options): Promise<any>;
sendCalendar(options: Options): Promise<any>;
taskInfo(options: Options): Promise<any>;
}
/**
* @description Template proxy
*/
export interface Template {
batchQuery(options: Options): Promise<any>;
query(options: Options): Promise<any>;
add(options: Options): Promise<any>;
delete(options: Options): Promise<any>;
update(options: Options): Promise<any>;
}
/**
* @description Address list proxy
*/
export interface AddressList {
// list
batchQueryAddress(options: Options): Promise<any>;
addAddress(options: Options): Promise<any>;
deleteAddress(options: Options): Promise<any>;
updateAddress(options: Options): Promise<any>;
// members
batchQueryMember(options: Options): Promise<any>;
queryMember(options: Options): Promise<any>;
addMember(options: Options): Promise<any>;
updateMember(options: Options): Promise<any>;
deleteMember(options: Options): Promise<any>;
}
/**
* @description Email label proxy
*/
export interface EmailLabel {
add(optionds: Options): Promise<any>;
batchQuery(optionds: Options): Promise<any>;
delete(optionds: Options): Promise<any>;
getLabel(optionds: Options): Promise<any>;
update(optionds: Options): Promise<any>;
}
/**
* @description SendCloud options
*/
export interface SendCouldStaticOptions {
apiUser: string;
apiKey: string;
timeout?: number;
host?: string;
endpoint?: string;
protocol?: string;
port?: number;
retry?: number;
proxy?: object;
}
/**
* @description The main class SendCloud
*/
export class SendCloud {
/* Getters of proxy */
public delivery: Proxy<Delivery>;
public template: Proxy<Template>;
public addressList: Proxy<AddressList>;
public emailLabel: Proxy<EmailLabel>;
/**
* @constructor
* @param {SendCouldStaticOptions} opts - an option object
*/
constructor(opts: SendCouldStaticOptions): SendCloud {};
}
export function decomposeAddress(address: string): decomposeAddressResponse;
export function addressParser(addresses: string | string[], tag: string): string;
export function createClient(options: SendCouldStaticOptions): SendCloud;
}
export = __NSP__;