UNPKG

@vscode/js-debug-browsers

Version:

Browser launch and discovery logic used in VS Code's JavaScript Debugger

53 lines (52 loc) 1.48 kB
/// <reference types="node" /> import execa from 'execa'; import { promises as fs } from 'fs'; /** * Quality (i.e. release channel) of discovered binary. */ export declare const enum Quality { Canary = "canary", Stable = "stable", Beta = "beta", Dev = "dev", Custom = "custom" } /** * All known qualities. */ export declare const allQualities: ReadonlySet<Quality>; /** * Gets whether given string is a known Quality. */ export declare const isQuality: (input: string) => input is Quality; /** * Discovered browser binary. */ export interface IExecutable { path: string; quality: Quality; } export interface IBrowserFinder { /** * Finds the first browser on the platform where the predicate matches. * May return early. */ findWhere(predicate: (exe: IExecutable) => boolean): Promise<IExecutable | undefined>; /** * Finds all browser executables available on the current platform. */ findAll(): Promise<IExecutable[]>; } export declare type BrowserFinderCtor = new (env?: NodeJS.ProcessEnv, _fs?: typeof fs, _execa?: typeof execa) => IBrowserFinder; /** * Chrome finder class for the current platform. */ export declare const ChromeBrowserFinder: BrowserFinderCtor; /** * Edge finder class for the current platform. */ export declare const EdgeBrowserFinder: BrowserFinderCtor; /** * Firefox finder class for the current platform. */ export declare const FirefoxBrowserFinder: BrowserFinderCtor;