From 27a6ddb55403de3ee0532778ce1910cbe262ad61 Mon Sep 17 00:00:00 2001 From: linyuchen Date: Thu, 26 Oct 2023 00:19:10 +0800 Subject: [PATCH] fix getGroupsList, getFriendsList --- src/global.d.ts | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/global.d.ts b/src/global.d.ts index a510f1a..670717a 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -28,13 +28,28 @@ interface MessageElement{ } } +declare type User = { + avatarUrl: string; + bio: string; // 签名 + nickName: string; + uid: string; // 加密的字符串 + uin: string; // QQ号 +} + +declare type Group = { + uid: string; // 群号 + name: string; +} + declare var LLAPI: { on(event: "new-messages", callback: (data: MessageElement[]) => void): void; - getAccountInfo(): { + getAccountInfo(): Promise<{ uid: string // qq uin: string // 一串加密的字符串 - } - getUserInfo(uid: string):{nickName: string}; + }> + + // uid是一串加密的字符串, 收到群消息的时候,可以用此函数获取群成员的qq号 + getUserInfo(uid: string): Promise; sendMessage(peer: Peer, message: { type: "text", @@ -44,10 +59,6 @@ declare var LLAPI: { file: string, } ): void - getGroupList(forced: boolean): { - - }[] - getFriendList(forced: boolean): { - - }[] + getGroupsList(forced: boolean): Promise + getFriendsList(forced: boolean): Promise };