Update type declarations and remove ts-ignore comments

Added 'types' field to package.json and updated tsconfig.json to include .d.ts files for better type support in napcat-pty. Removed unnecessary @ts-ignore comments from terminal_manager.ts to improve code clarity.
This commit is contained in:
手瓜一十雪
2025-11-14 15:00:40 +08:00
parent fe0914fc03
commit a703bbfef7
3 changed files with 4 additions and 4 deletions

View File

@@ -4,7 +4,6 @@ import { AuthHelper } from '../helper/SignToken';
import { LogWrapper } from 'napcat-common/src/log';
import { WebSocket, WebSocketServer } from 'ws';
import os from 'os';
// @ts-ignore
import { IPty, spawn as ptySpawn } from 'napcat-pty';
import { randomUUID } from 'crypto';
@@ -136,7 +135,6 @@ class TerminalManager {
isClosing: false,
buffer: '', // 初始化终端内容缓存
};
// @ts-ignore
pty.onData((data: any) => {
// 追加数据到 buffer
instance.buffer += data;
@@ -147,7 +145,6 @@ class TerminalManager {
}
});
});
// @ts-ignore
pty.onExit(() => {
this.closeTerminal(id);
});