tswatch/dist_ts/tswatch.classes.watcher.d.ts

36 lines
835 B
TypeScript
Raw Permalink Normal View History

2020-05-22 07:25:34 +00:00
export declare type TCommandFunction = () => Promise<void>;
export interface IWatcherConstructorOptions {
filePathToWatch: string;
commandToExecute: string | TCommandFunction;
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>;
}