/** * Type declarations for the bundled TIM SDK (src/sdk/index.js) * * The SDK is a modified copy of @tencentcloud/chat without TS declarations. * This file provides the minimal type surface used by clawlink. */ interface ChatInstance { setLogLevel(level: number): void; login(options: { userID: string; userSig: string }): Promise; logout(): Promise; on(event: string, handler: (...args: unknown[]) => void): void; off(event: string, handler: (...args: unknown[]) => void): void; // Messaging createTextMessage(options: { to: string; conversationType: string; payload: { text: string }; }): unknown; createTextAtMessage(options: { to: string; conversationType: string; payload: { text: string; atUserList: string[] }; }): unknown; createCustomMessage(options: { to: string; conversationType: string; payload: { data: string; description: string; extension: string }; }): unknown; // T4: File message for C2C file transfer createFileMessage(options: { to: string; conversationType: string; payload: { file: File }; onProgress?: (event: { percent: number }) => void; }): unknown; sendMessage(message: unknown): Promise<{ data?: { message?: { ID?: string } } }>; getMessageList(options: { conversationID: string; count: number; }): Promise<{ data?: { messageList?: Array<{ ID?: string; from?: string; type?: string; payload?: { text?: string }; time?: number; sequence?: number; }>; }; }>; // Groups getGroupList(): Promise<{ data?: { groupList?: Array<{ groupID: string; name: string; introduction?: string; }>; }; }>; joinGroup(options: { groupID: string }): Promise; quitGroup(groupID: string): Promise; getGroupMemberList(options: { groupID: string; count: number; offset: number; }): Promise<{ data?: { memberList?: Array<{ userID: string; nick?: string; role?: string; avatar?: string; }>; }; }>; createGroup(options: { type: string; name: string; groupID?: string; introduction?: string; notification?: string; joinOption?: string; isSupportTopic?: boolean; }): Promise<{ data?: { group?: { groupID?: string } } }>; getGroupProfile(options: { groupID: string; groupCustomFieldFilter?: string[]; }): Promise<{ data?: { group?: { notification?: string } }; }>; updateGroupProfile(options: { groupID: string; notification?: string; }): Promise; getConversationProfile(conversationID: string): Promise; // T4: Plugin registration for tim-upload-plugin registerPlugin(plugins: Record): void; } interface TencentCloudChatStatic { create(options: { SDKAppID: number; modules?: Record }): ChatInstance; EVENT: { SDK_READY: string; SDK_NOT_READY: string; KICKED_OUT: string; MESSAGE_RECEIVED: string; }; TYPES: { CONV_GROUP: string; CONV_C2C: string; MSG_TEXT: string; MSG_AT_ALL: string; MSG_FILE: string; GRP_PUBLIC: string; GRP_COMMUNITY: string; JOIN_OPTIONS_FREE_ACCESS: string; }; } declare const TencentCloudChat: TencentCloudChatStatic; export default TencentCloudChat;