-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtypes.d.ts
61 lines (48 loc) · 1.6 KB
/
types.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
52
53
54
55
56
57
58
59
60
61
import { ChildProcess } from 'child_process';
import * as stream from "stream";
declare namespace Launcher {
export function detect(callback: (browsers: Browser[]) => void): void;
interface LaunchOptions {
browser: string;
version?: string;
proxy?: string;
options?: string[];
skipDefaults?: boolean;
detached?: boolean;
noProxy?: string | string[];
headless?: boolean;
prefs?: { [key: string]: any };
profile?: string | null;
}
function Launch(
uri: string,
options: string | LaunchOptions,
callback: (error: Error | null, instance: Launcher.BrowserInstance) => void
): void;
export type Launch = typeof Launch;
namespace Launch {
export const browsers: Launcher.Browser[];
}
export function update(callback: (error: Error | null, config: object) => void): void;
export function update(configFile: string, callback: (error: Error | null, config: object) => void): void;
export interface Browser {
name: string;
version: string;
type: string;
command: string;
profile: string | boolean;
}
export interface BrowserInstance {
command: string;
args: string[];
image: string;
processName: string;
pid: number;
process: ChildProcess;
stderr: stream.Readable;
stdout: stream.Readable;
stop(): void;
}
}
declare function Launcher(configPath: string, callback: (error: Error | null, launch: typeof Launcher.Launch) => void): void;
export = Launcher;