UNPKG

@vscode/js-debug-browsers

Version:

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

42 lines (41 loc) 1.6 kB
/// <reference types="node" /> import { IExecutable, Quality } from './index'; import { promises as fsPromises } from 'fs'; /** * Returns whether the user can access the given file path. */ export declare function canAccess({ access }: typeof fsPromises, file: string | undefined | null): Promise<boolean>; /** * Escape regex special characters from the string. */ export declare function escapeRegexSpecialChars(str: string, except?: string): string; /** * Gets the configured Chrome path, if any. */ export declare function preferredChromePath(fs: typeof fsPromises, env: NodeJS.ProcessEnv): Promise<string | undefined>; /** * Gets the configured Firefox path, if any. */ export declare function preferredFirefoxPath(fs: typeof fsPromises, env: NodeJS.ProcessEnv): Promise<string | undefined>; /** * Gets the configured Edge path, if any. */ export declare function preferredEdgePath(fs: typeof fsPromises, env: NodeJS.ProcessEnv): Promise<string | undefined>; export interface IPriority { regex: RegExp; weight: number; quality: Quality; } /** * Sorts the set of installations, */ export declare function sort(installations: Iterable<string>, priorities: IPriority[]): IExecutable[]; /** * Finds binaries for Windows platforms by looking for the given path * suffixes in each of the local app data and program files directories * on the machine, returning complete absolute paths that match. */ export declare function findWindowsCandidates(env: NodeJS.ProcessEnv, fs: typeof fsPromises, suffixes: { name: string; type: Quality; }[]): Promise<IExecutable[]>;