forked from lukeed/watchlist
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.d.ts
22 lines (17 loc) · 936 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import type { BaseEncodingOptions } from 'fs';
import type { ExecOptions } from 'child_process';
type Arrayable<T> = T[] | T;
type Promisable<T> = Promise<T> | T;
export interface Options {
cwd: string;
clear: boolean;
ignore: Arrayable<RegExp | string>;
eager: boolean;
}
export type Handler = () => Promisable<any>;
export function watch(dirs: string[], handler: Handler, opts?: Partial<Options>): Promise<void>;
export function run(command: string, options: { encoding: 'buffer' | null } & ExecOptions): Promise<void>;
export function run(command: string, options: { encoding: BufferEncoding } & ExecOptions): Promise<void>;
export function run(command: string, options: { encoding: BufferEncoding } & ExecOptions): Promise<void>;
export function run(command: string, options: ExecOptions): Promise<void>;
export function run(command: string, options: (BaseEncodingOptions & ExecOptions) | undefined | null): Promise<void>;