UNPKG

1.48 kBTypeScriptView Raw
1import { WatchOptions } from "chokidar";
2import { WatchTaskError } from "./watch.errors";
3import { CrossbowInput } from "./index";
4import { Tasks } from "./task.resolve";
5import { SequenceItem } from "./task.sequence.factories";
6import { Runner } from "./task.runner";
7import { CommandTrigger } from "./command.run";
8import { TaskCollection } from "./task.resolve";
9export declare const defaultWatchOptions: CBWatchOptions;
10export interface CBWatchOptions extends WatchOptions {
11 throttle: number;
12 debounce: number;
13 delay: number;
14 block: boolean;
15}
16export interface WatchTask {
17 before: string[];
18 options: CBWatchOptions;
19 watchers: Watcher[];
20 name: string;
21 errors: WatchTaskError[];
22 patterns?: string[];
23 tasks?: string[];
24}
25export interface Watcher {
26 patterns: string[];
27 tasks: TaskCollection;
28 options: any;
29 watcherUID: string;
30 _tasks?: Tasks;
31 _sequence?: SequenceItem[];
32 _runner?: Runner;
33 parent?: string;
34}
35export interface WatchTasks {
36 valid: WatchTask[];
37 invalid: WatchTask[];
38 all: WatchTask[];
39}
40export declare function resolveWatchTasks(taskNames: string[], trigger: CommandTrigger): WatchTasks;
41/**
42 * The goal of this function is to produce a flat array containing tasks as strings
43 * this allows us to feed that into the task resolution stuff
44 */
45export declare function resolveBeforeTasks(beforeFlagsFromCliOrConfig: string[], input: CrossbowInput, watchTasks: WatchTask[]): string[];