保存一下

This commit is contained in:
2025-08-26 17:04:31 +08:00
parent 26f68d89bb
commit 89b5e9e0be
9 changed files with 292 additions and 42 deletions

View File

@@ -9,6 +9,7 @@ import type { IEventBuilder } from '@/core/events/IEventBuilder.ts'
import { EventBuilderImpl } from '@/core/events/impl/EventBuilderImpl.ts'
import type { IProcessManage } from '@/core/process/IProcessManage.ts'
import type { IProcess } from '@/core/process/IProcess.ts'
import type { IProcessInfo } from '@/core/process/IProcessInfo.ts'
export default class XSystem {
private static _instance: XSystem = new XSystem()
@@ -40,10 +41,10 @@ export default class XSystem {
// 运行进程
public async run<T extends IProcess = IProcess>(
proc: string | ProcessInfoImpl,
constructor?: new (info: ProcessInfoImpl) => T,
proc: string | IProcessInfo,
constructor?: new (info: IProcessInfo) => T,
): Promise<T> {
let info = typeof proc === 'string' ? this._processManage.findProcessInfoByName(proc) : proc
let info = typeof proc === 'string' ? this._processManage.findProcessInfoByName(proc)! : proc
if (isUndefined(info)) {
throw new Error(`未找到进程信息:${proc}`)
}