style: 强类型大法

This commit is contained in:
手瓜一十雪
2025-02-02 23:22:21 +08:00
parent ac193cc94a
commit 15854c605b
191 changed files with 923 additions and 806 deletions

View File

@@ -24,7 +24,7 @@ import path from 'node:path';
import fs from 'node:fs';
import { hostname, systemName, systemVersion } from '@/common/system';
import { NTEventWrapper } from '@/common/event';
import { GroupMember, KickedOffLineInfo, SelfInfo, SelfStatusInfo } from '@/core/types';
import { KickedOffLineInfo, SelfInfo, SelfStatusInfo } from '@/core/types';
import { NapCatConfigLoader } from '@/core/helper/config';
import os from 'node:os';
import { NodeIKernelMsgListener, NodeIKernelProfileListener } from '@/core/listeners';
@@ -58,7 +58,7 @@ export function loadQQWrapper(QQVersion: string): WrapperNodeApi {
if (!fs.existsSync(wrapperNodePath)) {
wrapperNodePath = path.join(path.dirname(process.execPath), `./resources/app/versions/${QQVersion}/wrapper.node`);
}
const nativemodule: any = { exports: {} };
const nativemodule: { exports: WrapperNodeApi } = { exports: {} as WrapperNodeApi };
process.dlopen(nativemodule, wrapperNodePath);
return nativemodule.exports;
}