UNPKG

1.53 kBPlain TextView Raw
1/* tslint:disable:no-empty */
2import { MessageOptions, Thread, Session, User } from 'libfb'
3
4export default class FakeClient {
5 async login (username: string, password: string) {}
6
7 getSession () { return { tokens: {}, deviceId: {} } as Session }
8
9 async sendAttachmentFile (threadId: string, attachmentPath: string, extension?: string) {}
10 async sendMessage (threadId: string, message: string, options?: MessageOptions): Promise<{
11 succeeded: boolean,
12 errStr?: string
13 }> {
14 return { succeeded: true }
15 }
16 async getAttachmentURL (mid: string, aid: string): Promise<string> { return '' }
17 async getStickerURL (stickerID: number): Promise<string> { return '' }
18 async getThreadList (count: number): Promise<Thread[]> { return [] }
19 async getThreadInfo (threadID: string): Promise<Thread> {
20 return {
21 isGroup: true,
22 id: threadID,
23 name: threadID,
24 participants: [],
25 image: '',
26 unreadCount: 0,
27 canReply: true,
28 cannotReplyReason: '',
29 isArchived: false,
30 color: '#000000',
31 emoji: '',
32 nicknames: null
33 }
34 }
35 async getUserInfo (userID: string): Promise<User> {
36 return {
37 id: userID,
38 name: 'Firstname Lastname',
39 type: 'User',
40 canMessage: true,
41 emailAddresses: undefined,
42 isBlocked: false,
43 isMessengerUser: true,
44 isPage: false,
45 profilePicLarge: '',
46 profilePicMedium: '',
47 profilePicSmall: ''
48 }
49 }
50 on (event: string, callback: any) {}
51
52 constructor (data?: any) {}
53}