chore: NTAPI

This commit is contained in:
手瓜一十雪
2024-08-09 13:33:58 +08:00
parent 1db27ab0e3
commit 9ef3edabce
11 changed files with 319 additions and 229 deletions

View File

@@ -3,21 +3,21 @@
import { NTEventDispatch } from '@/common/utils/EventTask';
import { GeneralCallResult, NTQQFileApi, NTQQUserApi, napCatCore } from '@/core';
export class NTQQSystemApi {
static async hasOtherRunningQQProcess() {
async hasOtherRunningQQProcess() {
return napCatCore.util.hasOtherRunningQQProcess();
}
static async ORCImage(filePath: string) {
async ORCImage(filePath: string) {
return napCatCore.session.getNodeMiscService().wantWinScreenOCR(filePath);
}
static async translateEnWordToZn(words: string[]) {
async translateEnWordToZn(words: string[]) {
return napCatCore.session.getRichMediaService().translateEnWordToZn(words);
}
//调用会超时 没灯用 (好像是通知listener的) onLineDev
static async getOnlineDev() {
async getOnlineDev() {
return napCatCore.session.getMsgService().getOnLineDev();
}
//1-2-162b9b42-65b9-4405-a8ed-2e256ec8aa50
static async getArkJsonCollection(cid: string) {
async getArkJsonCollection(cid: string) {
let ret = await NTEventDispatch.CallNoListenerEvent
<(cid: string) => Promise<GeneralCallResult & { arkJson: string }>>(
'NodeIKernelCollectionService/collectionArkShare',
@@ -26,7 +26,7 @@ export class NTQQSystemApi {
);
return ret;
}
static async BootMiniApp(appfile: string, params: string) {
async BootMiniApp(appfile: string, params: string) {
await napCatCore.session.getNodeMiscService().setMiniAppVersion('2.16.4');
let c = await napCatCore.session.getNodeMiscService().getMiniAppPath();