1export interface LaunchBrowserInstance {
2  close: () => Promise<void>;
3}
4
5/**
6 * Supported browser types
7 */
8export enum LaunchBrowserTypes {
9  CHROME,
10  EDGE,
11}
12
13/**
14 * Internal browser implementation constraints
15 */
16export interface LaunchBrowserImpl {
17  /**
18   * Return whether the given `browserType` is supported
19   */
20  isSupportedBrowser: (browserType: LaunchBrowserTypes) => Promise<boolean>;
21
22  /**
23   * Create temp directory for browser profile
24   *
25   * @param baseDirName The base directory name for the created directory
26   */
27  createTempBrowserDir: (baseDirName: string) => Promise<string>;
28
29  /**
30   * Launch the browser
31   */
32  launchAsync: (browserType: LaunchBrowserTypes, args: string[]) => Promise<LaunchBrowserInstance>;
33
34  /**
35   * Close current browser instance
36   */
37  close: () => Promise<void>;
38}
39