2020-05-22 07:25:34 +00:00
|
|
|
export interface IWatcherConstructorOptions {
|
|
|
|
filePathToWatch: string;
|
2022-03-18 15:36:13 +00:00
|
|
|
commandToExecute?: string;
|
|
|
|
functionToCall?: () => Promise<any>;
|
2020-05-22 07:25:34 +00:00
|
|
|
timeout?: number;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* A watcher keeps track of one child execution
|
|
|
|
*/
|
|
|
|
export declare class Watcher {
|
|
|
|
/**
|
|
|
|
* used to execute shell commands
|
|
|
|
*/
|
|
|
|
private smartshellInstance;
|
|
|
|
private currentExecution;
|
|
|
|
private smartchokWatcher;
|
|
|
|
private options;
|
|
|
|
constructor(optionsArg: IWatcherConstructorOptions);
|
|
|
|
/**
|
|
|
|
* start the file
|
|
|
|
*/
|
|
|
|
start(): Promise<void>;
|
|
|
|
/**
|
|
|
|
* updates the current execution
|
|
|
|
*/
|
|
|
|
private updateCurrentExecution;
|
|
|
|
/**
|
|
|
|
* this method sets up a clean exit strategy
|
|
|
|
*/
|
|
|
|
private setupCleanup;
|
|
|
|
/**
|
|
|
|
* stops the watcher
|
|
|
|
*/
|
|
|
|
stop(): Promise<void>;
|
|
|
|
}
|