export declare function fetchLatestNpmVersion(fetchImpl?: typeof fetch, timeoutMs?: number): Promise; export type InstallChannel = "global-npm" | "npx" | "native" | "source" | "unknown"; export declare function detectInstallChannel(env?: NodeJS.ProcessEnv): InstallChannel; export interface UpdatePromptInput { currentVersion: string; interactiveTty: boolean; outputMode: string; ci: boolean; command: string; channel: InstallChannel; } export declare function shouldShowUpdatePrompt(input: UpdatePromptInput): boolean; /** * Maps a raw keypress byte sequence to an update prompt action. * Ctrl+C, Enter, and newline all map to "l" (Later) — they must never kill * the governed process. Only "y"/"Y" maps to "y" (Update now). */ export declare function classifyUpdateKey(key: string): "y" | "l"; /** * Returns [executable, args] for the npm global-update command on this platform. * On Windows, .cmd files cannot be spawned with shell:false — use ComSpec instead. * Exported for unit testing (pure function, no side effects). */ export declare function buildNpmUpdateCommand(env?: NodeJS.ProcessEnv): [string, string[]]; export declare function runNpmUpdate(): { success: boolean; error?: string; }; /** * Shows the startup update prompt. * Returns: * false — prompt not shown (not a newer version, wrong channel, suppressed) * "deferred" — prompt shown, user pressed L/Enter/timeout (original command continues) * "updated" — prompt shown, user pressed Y (update was attempted; do not continue original command) */ export declare function maybeShowUpdatePrompt(currentVersion: string, fetchImpl?: typeof fetch): Promise;