-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.d.ts
46 lines (46 loc) · 1012 Bytes
/
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
declare module "delibee" {
interface DelibeeOption {
timeout?: number;
locale?: string;
}
interface DeliveryCompanyType {
[key: string]: string;
}
interface InvoiceHistory {
dateTime: number;
dateString: string;
location: string;
tel: string;
remark: string;
statusCode: number;
statusText: string;
}
interface Invoice {
deliveryCompany: {
code: string;
name: string;
};
invoiceNumber: string;
senderName: string;
senderAddr: string;
receiverName: string;
receiverAddr: string;
statusCode: number;
statusText: string;
history: InvoiceHistory[];
}
interface TrackingResult {
success: boolean;
invoice?: Invoice;
message?: string;
}
interface Delibee {
company: () => Promise<DeliveryCompanyType>;
tracking: (
companyCode: string,
invoiceNumber: string
) => Promise<TrackingResult>;
}
const delibee: (options?: DelibeeOption) => Delibee;
export = delibee;
}