|
| 1 | +/** |
| 2 | + * Type Definitions for SendBird Desc SDK v1.0.1 |
| 3 | + * homepage: https://sendbird.com/ |
| 4 | + */ |
| 5 | +declare const SendBirdDesk: SendBirdDeskStatic; |
| 6 | +export = SendBirdDesk; |
| 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; |
| 16 | + |
| 17 | +interface SendBirdDeskStatic { |
| 18 | + version: String; |
| 19 | + Agent: AgentStatic; |
| 20 | + Ticket: TicketStatic; |
| 21 | + Message: MessageStatic; |
| 22 | + Error: SendBirdDeskErrorStatic; |
| 23 | + |
| 24 | + init(); |
| 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; |
| 58 | +} |
| 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; |
| 92 | +} |
| 93 | +interface SendBirdDeskErrorStatic {} |
0 commit comments