mira-app-server
Version:
Mira Server - standalone server application using mira-app-core
33 lines • 1.51 kB
TypeScript
export interface AutoStartOptions {
httpPort: number;
wsPort: number;
dataPath?: string;
}
/** 注册并立即通过系统机制启动;返回注册文件/任务标识 */
export declare function enableAutoStart(opts: AutoStartOptions): string;
/** 取消开机自启并停止系统托管的实例 */
export declare function disableAutoStart(): void;
/** 停止系统托管的实例(保留注册,幂等:对未运行的实例也返回成功) */
export declare function stopAutoStart(): void;
/** 重启系统托管的实例 */
export declare function restartAutoStart(): void;
export interface AutoStartStatus {
platform: string;
/** 是否已注册自启 */
registered: boolean;
/** 注册文件 / 任务标识(未注册时为预期位置) */
configFile: string;
/** 注册时记录的 node 路径(解析自配置文件) */
nodePath: string | null;
/** 该 node 路径当前是否仍存在 */
nodePathValid: boolean;
/** 是否为易变路径(nvm / homebrew Cellar 等随版本变化) */
nodePathVolatile: boolean;
/** 系统托管实例是否在运行(无法探测时为 null) */
running: boolean | null;
}
/** 判断 node 路径是否易变(nvm / homebrew Cellar 等版本相关目录) */
export declare function isVolatileNodePath(p: string): boolean;
/** 查询当前开机自启注册状态与 node 路径健康度 */
export declare function statusAutoStart(): AutoStartStatus;
//# sourceMappingURL=autostart.d.ts.map