export interface BinDetectDeps { platform: NodeJS.Platform; env: NodeJS.ProcessEnv; homedir: () => string; /** Existence probe (stat). Injected so tests can fake a filesystem. */ fileExists: (p: string) => boolean; /** List a directory's immediate children. Returns [] on any error/missing dir. */ listDir: (p: string) => string[]; /** * OS-native name resolver: shells `where ` (win32) / `which ` * (unix) and returns the raw stdout, or null on any failure / not-found. * Injected so tests can simulate `where gimp-3` → a WindowsApps alias path * without a real Windows box. The default impl only actually shells out when * the requested platform matches the real host (so cross-platform-simulated * unit tests stay hermetic and never touch the host PATH). */ runWhich: (name: string, platform: NodeJS.Platform) => string | null; } export declare function defaultBinDetectDeps(): BinDetectDeps; /** * Resolve a bare launcher name against PATH, plus a few well-known install * dirs that are frequently missing from a GUI-launched process's PATH * (~/.local/bin everywhere; %LOCALAPPDATA%\Programs and %APPDATA%\npm on win). * Returns the absolute path of the first match, or null. * * Order: fast manual PATH/extra-dir parse first (cheap, no spawn), then the * authoritative OS-native `where`/`which` resolver as a fallback — the latter * is what catches PATHEXT edge cases and Windows execution-alias reparse stubs * that fileExists cannot stat. */ export declare function detectBinOnPath(bin: string, deps?: Partial): string | null; export type AppSource = 'path' | 'program-files' | 'app-bundle' | 'flatpak' | 'snap' | 'known-dir' | 'store'; export interface DetectAppResult { installed: boolean; path: string | null; source: AppSource | null; } /** * Detect a known creative app across PATH + platform default install locations. * Never throws; never spawns the app. */ export declare function detectApp(app: 'blender' | 'gimp', deps?: Partial): DetectAppResult;