Apply a collection of small code cleanups across the repo for consistency and lint-safety. Changes include: - Use strict equality (===) where appropriate (GetEmojiLikes, about page checks). - Replace Array.map used for side effects with Array.forEach (GetMsg). - Rename unused catch parameters to underscore-prefixed names to avoid lint warnings (multiple backend/middleware files). - Replace void with undefined in an actions.call invocation (builtin plugin index). - Remove an unused loadedCount variable when reading .env (napcat-shell). - Rename promise resolver parameter to `resolve` for clarity in tests and keep setTimeout usage (rpc.test.ts). - Strengthen external shims types by changing generic parameter names to _T and update inversify ServiceIdentifier generic param (external-shims.d.ts). - Simplify post-build script imports and comment out an external-type mapping block; fix a regex character class bug (post-build.mjs). - Prefix several unused test stub variables with underscore to indicate intentional unused status (test-dist.ts). - Minor JSX formatting/indentation fixes in password_login component and UI text indentation in system_info. - Misc: SSE/config and plugin config handlers adjusted to consistent catch parameter naming; update mirror/download error catch variable name. These edits are non-functional refactors focused on code style, lint compliance and small robustness/clarity improvements.
34 lines
920 B
TypeScript
34 lines
920 B
TypeScript
import { NapCatCore } from 'napcat-core';
|
|
import { NapCatProtocolAdapter } from '@/napcat-protocol/index';
|
|
|
|
// NapCat Protocol API 基类
|
|
export abstract class NapCatProtocolApiBase {
|
|
protected adapter: NapCatProtocolAdapter;
|
|
protected core: NapCatCore;
|
|
|
|
constructor (adapter: NapCatProtocolAdapter, core: NapCatCore) {
|
|
this.adapter = adapter;
|
|
this.core = core;
|
|
}
|
|
}
|
|
|
|
// 消息 API
|
|
export class NapCatProtocolMsgApi extends NapCatProtocolApiBase {
|
|
// 消息相关 API 方法可以在这里实现
|
|
}
|
|
|
|
// 用户 API
|
|
export class NapCatProtocolUserApi extends NapCatProtocolApiBase {
|
|
// 用户相关 API 方法可以在这里实现
|
|
}
|
|
|
|
// 群组 API
|
|
export class NapCatProtocolGroupApi extends NapCatProtocolApiBase {
|
|
// 群组相关 API 方法可以在这里实现
|
|
}
|
|
|
|
// 好友 API
|
|
export class NapCatProtocolFriendApi extends NapCatProtocolApiBase {
|
|
// 好友相关 API 方法可以在这里实现
|
|
}
|