UNPKG

1.33 kBTypeScriptView Raw
1import { BuildContext, ChangedFile } from './util/interfaces';
2export declare function watch(context?: BuildContext, configFile?: string): Promise<void>;
3export declare function prepareWatcher(context: BuildContext, watcher: Watcher): void;
4export declare function buildUpdate(event: string, filePath: string, context: BuildContext): Promise<void>;
5export declare function queueWatchUpdatesForBuild(event: string, filePath: string, context: BuildContext): Promise<void>;
6export declare let buildUpdatePromise: Promise<any>;
7export declare let queuedChangedFileMap: Map<string, ChangedFile>;
8export declare function queueOrRunBuildUpdate(changedFiles: ChangedFile[], context: BuildContext): Promise<any>;
9export declare function copyUpdate(event: string, filePath: string, context: BuildContext): Promise<void>;
10export declare function runBuildUpdate(context: BuildContext, changedFiles: ChangedFile[]): ChangedFile[];
11export interface WatchConfig {
12 [index: string]: Watcher;
13}
14export interface Watcher {
15 paths?: string[] | string;
16 options?: {
17 ignored?: string | string[] | Function;
18 ignoreInitial?: boolean;
19 followSymlinks?: boolean;
20 cwd?: string;
21 };
22 eventName?: string;
23 callback?: {
24 (event: string, filePath: string, context: BuildContext): Promise<any>;
25 };
26}