export interface RecoverableGlobalInstallOptions { packageRoot: string; npmPrefix: string; commandName: string; install: () => void | Promise; verify: () => void | Promise; verifyRollback?: () => void | Promise; platform?: NodeJS.Platform; } export interface RecoverableGlobalInstallResult { cleanupWarning?: string; } export declare class GlobalInstallError extends Error { readonly restored: boolean; readonly recoveryDirectory?: string; constructor(message: string, options: { cause: unknown; restored: boolean; recoveryDirectory?: string; }); } /** * Protect an npm-owned global package update with a local backup. npm still * performs the real installation so its package metadata and shims remain * standard. If npm or post-install verification fails, the previous package * directory and command shims are restored before returning. */ export declare function runRecoverableGlobalInstall(options: RecoverableGlobalInstallOptions): Promise; export declare function resolveGlobalCommandPaths(npmPrefix: string, commandName: string, platform?: NodeJS.Platform): string[]; export declare function resolvePrimaryGlobalCommand(npmPrefix: string, commandName: string, platform?: NodeJS.Platform): string; export declare function resolveGlobalPackageLockPath(packageRoot: string, platform?: NodeJS.Platform): string;