import { SERVICE_NAME, type ServiceScope } from "./service-definition.js"; import type { ServiceHost } from "./service-host.js"; import type { ServicePlatform, ServicePlatformState } from "./service-platform.js"; import { type WindowsNativeStatus } from "./windows-native-status.js"; export { parseWindowsNativeStatus, WINDOWS_CONTROL_FRESHNESS_MS, type WindowsNativeStatus, } from "./windows-native-status.js"; export interface WindowsServiceDefinition { schemaVersion: 1; serviceName: typeof SERVICE_NAME; hostExecutable: string; managerExecutable: string; managerArguments: string[]; workingDirectory: string; pipeName: string; } export declare const WINDOWS_HOST_PIPE_NAME = "\\\\.\\pipe\\onebots-gateway-control"; export declare function renderWindowsManagerServiceDefinition(input: unknown): string; export interface WindowsServicePlatformOptions { now?(): number; sleep?(milliseconds: number): Promise; timeoutMs?: number; /** 测试边界;生产始终从受身份校验的定义文件读取。 */ definition?: WindowsServiceDefinition; hostExecutableExists?(file: string): boolean; } export interface WindowsServiceObservation { service: ServicePlatformState; control?: NonNullable; } /** Windows SCM系统服务驱动;真实生命周期仍须由Windows验收作业证明。 */ export declare class WindowsServicePlatform implements ServicePlatform { private readonly host; private readonly expectedDefinitionPath; private readonly now; private readonly sleep; private readonly timeout; private readonly definition; private readonly hostExecutableExists; constructor(host: ServiceHost, scope: ServiceScope, expectedDefinitionPath: string, options?: WindowsServicePlatformOptions); private scm; inspect(): Promise; inspectNative(): Promise; private stable; quiesce(): Promise; reload(enabled: boolean): Promise; /** * 服务定义文件事务已经从previousDefinition切到当前字节后使用。 * 只有SCM仍精确绑定旧命令且处于稳定停态时才允许改写,避免同名服务或并发升级被接管。 */ reloadReplacing(previousDefinition: Buffer, enabled: boolean): Promise; start(expectedInitialState?: ServicePlatformState): Promise; } /** 定义文件已由卸载事务移除、进程树已确认退出后调用;只注销固定SCM身份。 */ export declare function unregisterWindowsManagerService(host: ServiceHost, definition: WindowsServiceDefinition): void; //# sourceMappingURL=service-platform-windows.d.ts.map