|
1 | 1 | /** |
2 | | - * Type Definitions for SendBird Desc SDK v1.0.5 |
| 2 | + * Type Definitions for SendBird Desc SDK v1.0.6 |
3 | 3 | * homepage: https://sendbird.com/ |
4 | 4 | */ |
5 | | -declare const SendBirdDesk: SendBirdDeskStatic; |
6 | 5 | export = SendBirdDesk; |
| 6 | +export as namespace SendBirdDesk; |
7 | 7 |
|
8 | | -interface GroupChannel { |
9 | | - url: String; |
10 | | - name: String; |
11 | | - customType: String; |
12 | | -} |
13 | | -type Callback = (res: Object, error: Error) => void; |
14 | | -type TicketCallback = (ticket: TicketInstance, error: Error) => void; |
15 | | -type TicketArrayCallback = (list: Array<TicketInstance>, error: Error) => void; |
| 8 | +declare const SendBirdDesk: SendBirdDeskStatic; |
16 | 9 |
|
17 | 10 | interface SendBirdDeskStatic { |
18 | 11 | version: String; |
19 | | - Agent: AgentStatic; |
20 | | - Ticket: TicketStatic; |
21 | | - Message: MessageStatic; |
22 | | - Error: SendBirdDeskErrorStatic; |
| 12 | + Agent: SendBirdDesk.AgentStatic; |
| 13 | + Ticket: SendBirdDesk.TicketStatic; |
| 14 | + Message: SendBirdDesk.MessageStatic; |
| 15 | + Error: SendBirdDesk.SendBirdDeskErrorStatic; |
23 | 16 |
|
24 | | - init(SendBird: Object); |
25 | | - authenticate(userId: String, callback: Callback); |
26 | | - authenticate(userId: String, accessToken: String, callback: Callback); |
27 | | - isDeskChannel(channel: GroupChannel): Boolean; |
28 | | - setDebugMode(); |
29 | | -} |
30 | | -interface AgentStatic { |
31 | | - new (json: Object): AgentInstance; |
32 | | -} |
33 | | -interface AgentInstance { |
34 | | - userId: String; |
35 | | - name: String; |
36 | | - profileUrl: String; |
37 | | - fetchFromJSON(json: Object); |
38 | | -} |
39 | | -interface TicketStatic { |
40 | | - Status: TicketStatus; |
41 | | - isStatus(val: String): Boolean; |
42 | | - clearCache(channelUrl: String); |
43 | | - create(title: String, name: String, callback: TicketCallback); |
44 | | - getOpenCount(callback: Callback); |
45 | | - getByChannelUrl(channelUrl: String, callback: TicketCallback); |
46 | | - getOpenedList(offset: Number, callback: TicketArrayCallback); |
47 | | - getClosedList(offset: Number, callback: TicketArrayCallback); |
48 | | - getUrlPreview(url: String, callback: Callback); |
49 | | - confirmEndOfChat(message: Object, confirmYN: String, callback: Callback); |
50 | | - new (json: Object): TicketInstance; |
51 | | -} |
52 | | -type TicketStatus = { |
53 | | - INITIALIZED: String; |
54 | | - UNASSIGNED: String; |
55 | | - ASSIGNED: String; |
56 | | - OPEN: String; |
57 | | - CLOSED: String; |
| 17 | + init(SendBird: Object): void; |
| 18 | + authenticate(userId: String, callback: SendBirdDesk.Callback): void; |
| 19 | + authenticate(userId: String, accessToken: String, callback: SendBirdDesk.Callback): void; |
| 20 | + isDeskChannel(channel: SendBirdDesk.GroupChannel): Boolean; |
| 21 | + setDebugMode(): void; |
58 | 22 | } |
59 | | -interface TicketInstance { |
60 | | - id: String; |
61 | | - title: String; |
62 | | - status: TicketStatus; |
63 | | - info: Object; |
64 | | - agent: AgentInstance; |
65 | | - customer: Object; |
66 | | - channel: Object; |
67 | | - channelUrl: String; |
68 | | - updatedAt: Number; |
69 | | - fetchFromJSON(json: Object); |
70 | | - refresh(callback: TicketCallback); |
71 | | -} |
72 | | -type MessageStatic = { |
73 | | - CustomType: MessageCustomType; |
74 | | - DataType: MessageDataType; |
75 | | - ClosureState : MessageClosureState; |
76 | | -} |
77 | | -type MessageCustomType = { |
78 | | - RICH_MESSAGE: String; |
79 | | - ADMIN_MESSAGE: String; |
80 | | -} |
81 | | -type MessageDataType = { |
82 | | - TICKET_INQUIRE_CLOSURE: String; |
83 | | - TICKET_ASSIGN: String; |
84 | | - TICKET_TRANSFER: String; |
85 | | - TICKET_CLOSE: String; |
86 | | - URL_PREVIEW: String; |
87 | | -} |
88 | | -type MessageClosureState = { |
89 | | - WAITING: String; |
90 | | - CONFIRMED: String; |
91 | | - DECLINED: String; |
| 23 | + |
| 24 | +declare namespace SendBirdDesk { |
| 25 | + interface GroupChannel { |
| 26 | + url: String; |
| 27 | + name: String; |
| 28 | + customType: String; |
| 29 | + } |
| 30 | + type Callback = (res: Object, error: Error) => void; |
| 31 | + type TicketCallback = (ticket: TicketInstance, error: Error) => void; |
| 32 | + type TicketArrayCallback = (list: Array<TicketInstance>, error: Error) => void; |
| 33 | + |
| 34 | + |
| 35 | + interface AgentStatic { |
| 36 | + new (json: Object): AgentInstance; |
| 37 | + } |
| 38 | + interface AgentInstance { |
| 39 | + userId: String; |
| 40 | + name: String; |
| 41 | + profileUrl: String; |
| 42 | + fetchFromJSON(json: Object): void; |
| 43 | + } |
| 44 | + interface TicketStatic { |
| 45 | + Status: TicketStatus; |
| 46 | + isStatus(val: String): Boolean; |
| 47 | + clearCache(channelUrl: String): void; |
| 48 | + create(title: String, name: String, callback: TicketCallback): void; |
| 49 | + create(title: String, name: String, groupKey: String, customField: Object, callback: TicketCallback): void; |
| 50 | + getOpenCount(callback: Callback): void; |
| 51 | + getByChannelUrl(channelUrl: String, callback: TicketCallback): void; |
| 52 | + getOpenedList(offset: Number, callback: TicketArrayCallback): void; |
| 53 | + getOpenedList(offset: Number, customFieldFilter: Object, callback: TicketArrayCallback): void; |
| 54 | + getClosedList(offset: Number, callback: TicketArrayCallback): void; |
| 55 | + getClosedList(offset: Number, customFieldFilter: Object, callback: TicketArrayCallback): void; |
| 56 | + getUrlPreview(url: String, callback: Callback): void; |
| 57 | + confirmEndOfChat(message: Object, confirmYN: String, callback: Callback): void; |
| 58 | + new (json: Object): TicketInstance; |
| 59 | + } |
| 60 | + type TicketStatus = { |
| 61 | + INITIALIZED: String; |
| 62 | + UNASSIGNED: String; |
| 63 | + ASSIGNED: String; |
| 64 | + OPEN: String; |
| 65 | + CLOSED: String; |
| 66 | + } |
| 67 | + interface TicketInstance { |
| 68 | + id: String; |
| 69 | + title: String; |
| 70 | + status: TicketStatus; |
| 71 | + info: Object; |
| 72 | + agent: AgentInstance; |
| 73 | + customer: Object; |
| 74 | + channel: Object; |
| 75 | + channelUrl: String; |
| 76 | + updatedAt: Number; |
| 77 | + fetchFromJSON(json: Object): void; |
| 78 | + refresh(callback: TicketCallback): void; |
| 79 | + reopen(callback: TicketCallback): void; |
| 80 | + } |
| 81 | + type MessageStatic = { |
| 82 | + CustomType: MessageCustomType; |
| 83 | + DataType: MessageDataType; |
| 84 | + ClosureState : MessageClosureState; |
| 85 | + } |
| 86 | + type MessageCustomType = { |
| 87 | + RICH_MESSAGE: String; |
| 88 | + ADMIN_MESSAGE: String; |
| 89 | + } |
| 90 | + type MessageDataType = { |
| 91 | + TICKET_INQUIRE_CLOSURE: String; |
| 92 | + TICKET_ASSIGN: String; |
| 93 | + TICKET_TRANSFER: String; |
| 94 | + TICKET_CLOSE: String; |
| 95 | + URL_PREVIEW: String; |
| 96 | + } |
| 97 | + type MessageClosureState = { |
| 98 | + WAITING: String; |
| 99 | + CONFIRMED: String; |
| 100 | + DECLINED: String; |
| 101 | + } |
| 102 | + interface SendBirdDeskErrorStatic {} |
92 | 103 | } |
93 | | -interface SendBirdDeskErrorStatic {} |
| 104 | + |
0 commit comments