From f1b137f2e1e8e160cd01e432af7ad19d431c5a55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Mon, 26 Aug 2024 01:07:01 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E7=A7=BB=E9=99=A4=E8=80=81=E6=97=A7?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/adapters/NodeIGlobalAdapter.ts | 25 +------------------------ src/shell/napcat.ts | 6 +++--- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/src/core/adapters/NodeIGlobalAdapter.ts b/src/core/adapters/NodeIGlobalAdapter.ts index 5103faf9..6b5ccb83 100644 --- a/src/core/adapters/NodeIGlobalAdapter.ts +++ b/src/core/adapters/NodeIGlobalAdapter.ts @@ -1,27 +1,4 @@ -interface IGlobalAdapter { - onLog(...args: unknown[]): void; - - onGetSrvCalTime(...args: unknown[]): void; - - onShowErrUITips(...args: unknown[]): void; - - fixPicImgType(...args: unknown[]): void; - - getAppSetting(...args: unknown[]): void; - - onInstallFinished(...args: unknown[]): void; - - onUpdateGeneralFlag(...args: unknown[]): void; - - onGetOfflineMsg(...args: unknown[]): void; -} - -export interface NodeIGlobalAdapter extends IGlobalAdapter { - // eslint-disable-next-line @typescript-eslint/no-misused-new - new(adapter: IGlobalAdapter): NodeIGlobalAdapter; -} - -export class GlobalAdapter implements IGlobalAdapter { +export class NodeIGlobalAdapter { onLog(...args: unknown[]) { } diff --git a/src/shell/napcat.ts b/src/shell/napcat.ts index 8abb9089..8747ab5a 100644 --- a/src/shell/napcat.ts +++ b/src/shell/napcat.ts @@ -2,7 +2,7 @@ import type { SelfInfo } from '@/core/entities'; import { LogWrapper } from '@/common/utils/log'; import { LoginListener, NodeIKernelSessionListener } from '@/core/listeners'; -import { NodeIDispatcherAdapter, GlobalAdapter, NodeIDependsAdapter } from '@/core/adapters'; +import { NodeIDispatcherAdapter, NodeIDependsAdapter, NodeIGlobalAdapter } from '@/core/adapters'; import { NapCatPathWrapper } from '@/common/framework/napcat'; import { InstanceContext, @@ -70,7 +70,7 @@ export async function NCoreInitShell() { }, thumb_config: { maxSide: 324, minSide: 48, longLimit: 6, density: 2 }, }, - new GlobalAdapter() as any, + new NodeIGlobalAdapter(), ); loginService.initConfig({ machineId: '', @@ -190,7 +190,7 @@ export async function NCoreInitShell() { logger.log(`可用于快速登录的 QQ:\n${historyLoginList .map((u, index) => `${index + 1}. ${u.uin} ${u.nickName}`) .join('\n') - }`); + }`); } loginService.getQRCodePicture(); }