chore: 移除无用代码

This commit is contained in:
手瓜一十雪
2024-08-26 00:38:19 +08:00
parent d157c53444
commit db63018a82
4 changed files with 7 additions and 19 deletions

View File

@@ -95,21 +95,10 @@ export class LegacyNTEventWrapper {
async callNoListenerEvent<EventType extends (...args: any[]) => Promise<any> | any>(
EventName = '',
timeout: number = 3000,
...args: Parameters<EventType>
) {
return new Promise<Awaited<ReturnType<EventType>>>(async (resolve, reject) => {
const EventFunc = this.createEventFunction<EventType>(EventName);
let complete = false;
setTimeout(() => {
if (!complete) {
reject(new Error('NTEvent EventName:' + EventName + ' timeout'));
}
}, timeout);
const retData = await EventFunc!(...args);
complete = true;
resolve(retData);
});
): Promise<Awaited<ReturnType<EventType>>> {
const EventFunc = this.createEventFunction<EventType>(EventName);
return EventFunc!(...args)
}
async RegisterListen<ListenerType extends (...args: any[]) => void>(