refactor: enhanced type definition for callNormalEvent

类型体操,伟大,无需多言!
This commit is contained in:
Wesley F. Young committed 2024-08-26 12:02:41 +08:00
1 parent 72416f7e17
commit f01eb40520
8 files changed
+193 -150

No files matched your search

+4 -6
View File
@@ -43,15 +43,14 @@ export class NTQQGroupApi {
async getGroups(forced = false) {
type ListenerType = NodeIKernelGroupListener['onGroupListUpdate'];
const [_retData, _updateType, groupList] = await this.core.eventWrapper.CallNormalEvent<(force: boolean) => Promise<any>, ListenerType>
(
const [,, groupList] = await this.core.eventWrapper.callNormalEvent(
'NodeIKernelGroupService/getGroupList',
'NodeIKernelGroupListener/onGroupListUpdate',
1,
5000,
() => true,
forced,
);
);
return groupList;
}
@@ -255,8 +254,7 @@ export class NTQQGroupApi {
}
async getSingleScreenNotifies(num: number) {
const [_retData, _doubt, _seq, notifies] = await this.core.eventWrapper.CallNormalEvent<(arg1: boolean, arg2: string, arg3: number) => Promise<any>, (doubt: boolean, seq: string, notifies: GroupNotify[]) => void>
(
const [,,, notifies] = await this.core.eventWrapper.callNormalEvent(
'NodeIKernelGroupService/getSingleScreenNotifies',
'NodeIKernelGroupListener/onGroupSingleScreenNotifies',
1,
@@ -265,7 +263,7 @@ export class NTQQGroupApi {
false,
'',
num,
);
);
return notifies;
}