export declare enum Type { KERNEL_DRIVER = 1, FILE_SYSTEM_DRIVER = 2, ADAPTER = 4, RECOGNIZER_DRIVER = 8, WIN32_OWN_PROCESS = 16, WIN32_SHARE_PROCESS = 32, INTERACTIVE_PROCESS = 256 } export declare enum State { STOPPED = 1, START_PENDING = 2, STOP_PENDING = 3, RUNNING = 4, CONTINUE_PENDING = 5, PAUSE_PENDING = 6, PAUSED = 7 } export declare enum ControlsAccepted { STOP = 1, PAUSE_CONTINUE = 2, SHUTDOWN = 4, PARAMCHANGE = 8, NETBINDCHANGE = 16, HARDWAREPROFILECHANGE = 32, POWEREVENT = 64, SESSIONCHANGE = 128, PRESHUTDOWN = 256, TIMECHANGE = 512, TRIGGEREVENT = 1024 } export declare enum StartType { BOOT_START = 0, SYSTEM_START = 1, AUTO_START = 2, DEMAND_START = 3, DISABLED = 4 } export declare enum ErrorControl { IGNORE = 0, NORMAL = 1, SEVERE = 2, CRITICAL = 3 } export declare enum ServiceFlags { RUNS_IN_SYSTEM_PROCESS = 1 } export declare enum TypeFilter { KERNEL_DRIVER = 1, FILE_SYSTEM_DRIVER = 2, ADAPTER = 4, RECOGNIZER_DRIVER = 8, WIN32_OWN_PROCESS = 16, WIN32_SHARE_PROCESS = 32, INTERACTIVE_PROCESS = 256, DRIVER = 11, WIN32 = 48, ALL = 319 } export declare enum StateFilter { ACTIVE = 1, INACTIVE = 2, ALL = 3 } export interface ServiceConfigBase { serviceType: Type[]; startType: StartType; errorControl: ErrorControl; dependencies: string[]; binaryPathName?: string; loadOrderGroup?: number; serviceStartName?: string; displayName?: string; description?: string; } export interface ServiceConfigDisplay extends ServiceConfigBase { tagId: number; } export interface ServiceConfigCreateOptions extends Partial { binaryPathName: string; password?: string; } export interface ServiceConfigChangeOptions extends Partial { password?: string; } export interface ServiceStatus { serviceType: Type[]; state: State; controlsAccepted: ControlsAccepted[]; exitCode: number; checkPoint: number; waitHint: number; processId: number; serviceFlags: ServiceFlags[]; } /** List names of registered services * * @param type Filter for service type (@see TypeFilter) * @param state Filter for service state (@see StateFilter) */ export declare function names(typeFilter?: TypeFilter | TypeFilter[], stateFilter?: StateFilter): string[]; /** Enumerate registered services * * @param options.type Filter for service type (@see Type) * @param options.state Filter for service state (@see State) */ export type EnumerateResult = { [index: string]: ServiceStatus & { displayName?: string; }; }; export declare function enumerate(typeFilter?: TypeFilter | TypeFilter[], stateFilter?: StateFilter): EnumerateResult; /** Retrieve service configuration * @param name Name of service */ export declare function config(name: string): ServiceConfigDisplay; /** Retrieve service status * @param name Name of service */ export declare function status(name: string): ServiceStatus; /** Start service * @param name Name of service */ export declare function start(name: string): Promise; /** Stop service * @param name Name of service */ export declare function stop(name: string): Promise; /** Enable service * @param name Name of service to enable * @param startType Desired start type for service */ export declare function enable(name: string, startType?: StartType): any; /** Disable service * @param name Name of service to disable */ export declare function disable(name: string): void; /** Create new service * @param name Name of new service * @param config Configuration of service */ export declare function create(name: string, config: ServiceConfigCreateOptions): any; /** Change existing service * @param name Name of service to change * @param config Configuration of service */ export declare function change(name: string, config: ServiceConfigChangeOptions): any; /** Remove service * @param name Name of service to remove */ export declare function remove(name: string): void; /** Register with Windows Service Control Manager * @param name Name of service to remove * @param ignoreError Ignore errors */ export declare function run(name: string, ignoreError?: boolean, initCallback?: (...args: any[]) => any, stopCallback?: () => any): Promise;