2017-06-30 16:05:55 +00:00
|
|
|
import * as plugins from './smartchok.plugins';
|
|
|
|
export declare type TSmartchokStatus = 'idle' | 'starting' | 'watching';
|
|
|
|
export declare type TFsEvent = 'add' | 'addDir' | 'change' | 'error' | 'unlink' | 'unlinkDir' | 'ready' | 'raw';
|
|
|
|
/**
|
|
|
|
* Smartchok allows easy wathcing of files
|
|
|
|
*/
|
|
|
|
export declare class Smartchok {
|
2018-02-28 23:08:08 +00:00
|
|
|
watchStringmap: plugins.lik.Stringmap;
|
2017-06-30 16:05:55 +00:00
|
|
|
chokidarOptions: plugins.chokidar.WatchOptions;
|
|
|
|
status: TSmartchokStatus;
|
|
|
|
private watcher;
|
|
|
|
private watchingDeferred;
|
|
|
|
private eventObservablemap;
|
|
|
|
/**
|
|
|
|
* constructor of class smartchok
|
|
|
|
*/
|
|
|
|
constructor(watchArrayArg: string[], optionsArg?: plugins.chokidar.WatchOptions);
|
|
|
|
/**
|
|
|
|
* adds files to the list of watched files
|
|
|
|
*/
|
|
|
|
add(pathArrayArg: string[]): void;
|
|
|
|
/**
|
|
|
|
* removes files from the list of watched files
|
|
|
|
*/
|
|
|
|
remove(pathArg: string): void;
|
|
|
|
/**
|
|
|
|
* gets an observable for a certain event
|
|
|
|
*/
|
2018-02-28 23:08:08 +00:00
|
|
|
getObservableFor(fsEvent: TFsEvent): Promise<plugins.smartrx.rxjs.Observable<any>>;
|
2017-06-30 16:05:55 +00:00
|
|
|
/**
|
|
|
|
* starts the watcher
|
|
|
|
* @returns Promise<void>
|
|
|
|
*/
|
2017-06-30 18:32:35 +00:00
|
|
|
start(): Promise<void>;
|
2017-06-30 16:05:55 +00:00
|
|
|
/**
|
|
|
|
* stop the watcher process if watching
|
|
|
|
*/
|
|
|
|
stop(): void;
|
|
|
|
}
|