import { type CacheDirContext } from "./cacheDir.js";
import { type Logger } from "./loader.js";
export type BrowserAssetName = "chrome" | "firefox" | "chromedriver" | "geckodriver";
/**
 * Map a browser name to the installable asset(s) it needs to drive — the
 * browser binary plus its WebDriver. This is the single source of truth the
 * runtime install paths share (the runTests pre-flight and the runner's
 * on-demand context-gate install both consume it). Safari/webkit ship with
 * macOS, so they have no installable assets; unknown names map to nothing.
 *
 * Only schema-valid driver browser names are mapped. "chromium" is
 * intentionally absent: it isn't in the runner's KNOWN_BROWSERS, so installing
 * Chrome for it wouldn't make the context runnable end-to-end (isSupportedContext
 * and getDriverCapabilities key off the exact name) — mapping it would install
 * assets that then go unused.
 */
export declare function requiredBrowserAssets(name: string | undefined): BrowserAssetName[];
/**
 * The one place browser channel selection lives. Exact buildIds are NOT
 * pinned in source — they are resolved against @puppeteer/browsers at
 * install time so an `install browsers --force` always picks up the
 * channel's current build.
 */
export declare const BROWSER_CHANNELS: {
    readonly chrome: "stable";
    readonly firefox: "latest";
    readonly chromedriver: "stable";
    readonly geckodriver: "latest";
};
export interface EnsureBrowserResult {
    /** Absolute path to the executable (or driver binary). */
    path: string;
    /** Resolved buildId / version string for the installed asset. */
    version: string;
    /** True when the installed buildId is older than the channel's current. */
    outdated: boolean;
}
export interface BrowserDeps {
    logger?: Logger;
    /**
     * Injected `@puppeteer/browsers` namespace for tests. When omitted the
     * helper lazy-loads it via loadHeavyDep.
     */
    browsersModule?: any;
    /** Injected `geckodriver` namespace for tests. */
    geckodriverModule?: any;
    /** Wall-clock for freshness gating — tests inject a fixed time. */
    now?: () => Date;
}
export interface EnsureBrowserOptions {
    ctx?: CacheDirContext;
    deps?: BrowserDeps;
    force?: boolean;
}
/**
 * Install (or refresh) a browser asset into <cacheDir>/browsers.
 *
 * Missing → install latest channel buildId. Present and matches channel →
 * no-op. Present and outdated → warn (with update instructions) and proceed
 * with the installed version. force=true reinstalls and prunes the old
 * buildId from the cache.
 *
 * Concurrent calls for the same (name, cacheDir) share a single
 * in-flight promise so parallel installs can't corrupt each other.
 */
export declare function ensureBrowserInstalled(name: BrowserAssetName, options?: EnsureBrowserOptions): Promise<EnsureBrowserResult>;
/**
 * Read the installed-browsers record without resolving or installing
 * anything. Mirrors @puppeteer/browsers.getInstalledBrowsers() but reads
 * from our cache record rather than rescanning the filesystem.
 */
export declare function getInstalledBrowsers(ctx?: CacheDirContext): Array<{
    name: string;
    installedVersion: string;
    installedAt: string;
    latestKnownVersion?: string;
}>;
//# sourceMappingURL=browsers.d.ts.map