export { setConfig, getAvailableApps, getBrowserDiagnostics, getEnvironment, resolveConcurrentRunners, clearAppCache, patchAppCache, verifyAppDrivers, detectInstalledBrowserDrivers }; /** * A candidate browser app plus the driver binary that must be functional for * it to be offered. `driverPath`/`driverName` may be absent when the binary * can't be located cheaply — in that case the app passes through and the * runtime session attempt (plus cross-browser fallback) is the safety net. */ interface AppDriverDescriptor { app: any; driverName?: string; driverPath?: string; } /** * Layer 2 of the driver-resilience strategy: gate each candidate browser on * its driver *executing*, not merely existing on disk. A present-but-broken * driver (e.g. a partially downloaded geckodriver on Windows) is excluded so * the runner never builds a doomed session for it; the default-browser picker * then moves to the next available engine. Drivers without a resolvable path * pass through unchecked. Pure and injectable so it unit-tests without real * binaries. */ declare function verifyAppDrivers(descriptors: AppDriverDescriptor[], { verify, logger, }: { verify: (driverName: string, driverPath: string) => Promise<{ ok: boolean; error?: string; }>; logger?: (msg: string, level?: string) => void; }): Promise; /** * Sets up and validates the configuration object for Doc Detective * @async * @param {Object} config - The configuration object to process * @returns {Promise} The processed and validated configuration object * @throws Will exit process with code 1 if configuration is invalid */ declare function setConfig({ config }: any): Promise; /** * Resolves the concurrentRunners configuration value from various input formats * to a concrete positive integer for the core execution engine. Always returns * an integer >= 1: the CLI/config path is already schema-validated, but API * callers can hand core a pre-resolved config that skipped validation, so an * invalid value (0, NaN, a string, undefined) must not propagate — it would * size the worker pool and the Appium server pool to 0 and hang driver * contexts on an empty pool. * * @param {Object} config - The configuration object * @returns {number} The resolved concurrent runners value (integer >= 1) */ declare function resolveConcurrentRunners(config: any): number; declare function getEnvironment(): any; declare function clearAppCache(config?: any): void; /** * A browser the JIT preflight just installed, described by the paths/versions * `ensureBrowserInstalled` already resolved. Enough to rebuild the same app * descriptor `getAvailableApps` would, without re-scanning the browsers cache. */ interface InstalledBrowserDescriptor { name: string; version?: string; path?: string; driverPath?: string; } /** * Patch the module-level available-apps cache for `config`'s cache dir with the * browsers a JIT preflight just installed, so the *next* `getAvailableApps` * call is a cache HIT and skips a full re-probe (browser scan + driver-presence * + `verifyDriverBinary`) — replacing the previous `clearAppCache` + * lazy-re-probe. * * Correctness: driver *presence* discovery (which appium-*-driver packages are * on disk) did not change across the install — only the browser binary arrived * — so each descriptor is rebuilt from the install results and gated on the * SAME two checks `getAvailableApps` uses: the matching appium-*-driver package * present (presence) AND `verifyDriverBinary` (Layer 2, functional). A browser * that fails either gate is left out — matching `getAvailableApps`, which would * also exclude it — so a later cache hit reports exactly what a fresh probe * would. * * Fail-open: on any error, or when there is nothing to add, we DELETE the cache * entry so the next `getAvailableApps` re-probes from scratch — never a stale * or partial hit. `verify`/`detectDrivers` are injectable for hermetic tests. */ declare function patchAppCache(config: any, installed: InstalledBrowserDescriptor[], deps?: { verify?: (driverName: string, driverPath: string) => Promise<{ ok: boolean; error?: string; }>; detectDrivers?: (config: any) => { chromium: boolean; gecko: boolean; safari: boolean; }; }): Promise; /** * Which managed Appium browser drivers are present on disk, by package name. * * Presence discovery is a filesystem question — the same `resolveHeavyDepPath` * check `getBrowserDiagnostics` (and `ensureRuntimeInstalled`) already use — so * we no longer spawn `node driver list` (~17s by its own comment) to * learn what a package lookup answers instantly. Each key maps to exactly the * driver the old `appium driver list` table-regex recognized: * chromium → appium-chromium-driver (was /chromium.*installed \(npm\)/) * gecko → appium-geckodriver (was /gecko.*installed \(npm\)/) * safari → appium-safari-driver (was /safari.*installed \(npm\)/) * * IMPORTANT: presence (package on disk) is necessary but NOT sufficient. The * functional Layer 2 gate (`verifyDriverBinary`, run inside `verifyAppDrivers`) * still executes each driver's binary before a browser is reported available — * only the *presence-discovery* mechanism changed here, never the functional * check. `isInstalled` is injectable so this maps hermetically in unit tests. */ declare function detectInstalledBrowserDrivers(config: any, isInstalled?: (name: string) => boolean): { chromium: boolean; gecko: boolean; safari: boolean; }; declare function getAvailableApps({ config }: any): Promise; interface BrowserComponent { label: string; installed: boolean; detail?: string; } interface BrowserDiagnostic { name: "chrome" | "firefox" | "safari"; supported: boolean; available: boolean; components: BrowserComponent[]; note?: string; } declare function getBrowserDiagnostics({ config }: any): Promise<{ browsers: BrowserDiagnostic[]; detectionFailed: boolean; }>; //# sourceMappingURL=config.d.ts.map