-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.d.ts
51 lines (46 loc) · 1.47 KB
/
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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import {EventEmitter} from "events";
import {ChildProcess} from "child_process";
interface RunnerOptions {
/**
* launch chrome listen on debug port, default will random a free port to use
*/
port?: number,
/**
* chrome executable full path, default will automatic find a path according to your system. If no executable chrome find, a Error('no chrome installations found') will throw
*/
chromePath?: string,
/**
* flags pass to chrome when start chrome, all flags can be find [here](http://peter.sh/experiments/chromium-command-line-switches/)
*/
chromeFlags?: [string],
/**
* open page when chrome start, default is about:blank
*/
startupPage?: string,
/**
* logger to handle log from chrome-runner, interface like console, default use console
*/
shouldRestartChrome?: boolean,
/**
* in ms, monitor chrome is alive interval, default is 500ms
*/
monitorInterval?: number,
/**
* chrome data dir, default will create one in system tmp
*/
chromeDataDir?: string,
}
export class Runner extends EventEmitter {
port: number;
flags: [string];
chromeProcess: ChildProcess;
chromeDataDir: string;
chromeOutFd: number;
chromeErrorFd: number;
pidFd: number;
launch(): Promise<Runner>;
kill(): Promise<void>;
}
export function launch(opts: RunnerOptions): Promise<Runner>;
export function launchWithoutNoise(opts: RunnerOptions): Promise<Runner>;
export function launchWithHeadless(opts: RunnerOptions): Promise<Runner>;