watcher.d.ts
1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/// <reference types="node" />
import chokidar from 'chokidar';
import { EventEmitter } from 'events';
import { TsGenerator, TsHelperConfig, default as TsHelper } from './';
export interface BaseWatchItem {
ref?: string;
directory: string;
generator?: string;
enabled?: boolean;
ignore?: string | string[];
trigger?: Array<'add' | 'unlink' | 'change'>;
pattern?: string | string[];
watch?: boolean;
execAtInit?: boolean;
}
export interface WatchItem extends PlainObject, BaseWatchItem {
}
interface WatcherOptions extends WatchItem {
name: string;
}
export default class Watcher extends EventEmitter {
helper: TsHelper;
ref: string;
name: string;
dir: string;
options: WatcherOptions;
pattern: string[];
dtsDir: string;
config: TsHelperConfig;
generator: TsGenerator;
fsWatcher?: chokidar.FSWatcher;
throttleTick: any;
throttleStack: string[];
constructor(helper: TsHelper);
init(options: WatcherOptions): void;
destroy(): void;
watch(): void;
execute(file?: string): any;
private onChange;
}
export {};
//# sourceMappingURL=watcher.d.ts.map