/** * One line for `doctor`: what is installed, what is published, and what to run. * * WHY THIS EXISTS AS A SEPARATE STEP FROM THE LOOKUP. A version behind is only * actionable alongside the install method -- `npm install -g` fixes a stale * global and silently does nothing for a stale copy in a project's * `node_modules`. Composing the two here keeps `doctor` from having to know the * rules, and keeps the rules testable without a network. * * AND WHY IT NEVER SAYS "UP TO DATE" WHEN IT DOES NOT KNOW. A check that cannot * reach the registry reports that it could not, because a reassuring line * printed from a failed lookup is worse than no line: it is the reader's * evidence that they looked. */ import { InstallMethod } from './install-method.js'; /** Where a copy stands against what is published. */ export declare enum UpdateState { /** Installed version equals the published one. */ Current = "Current", /** Something newer is published. */ Behind = "Behind", /** Installed version is newer -- a prerelease, or a local build. */ Ahead = "Ahead", /** The lookup did not answer, or a version could not be parsed. */ Unknown = "Unknown" } export interface UpdateReport { readonly state: UpdateState; readonly installed: string; readonly latest: string | null; readonly method: InstallMethod; /** What to run, or null when there is nothing this package should suggest. */ readonly command: string | null; /** Why the state is Unknown, or null. */ readonly refused: string | null; } /** * Ask, compare, and say what to do about it. * * `moduleUrl` defaults to this module's own location, which is the one that * answers the question for a real install; a test passes a path instead. */ export declare function checkForUpdate(options?: { readonly env?: NodeJS.ProcessEnv; readonly fetcher?: typeof fetch; readonly moduleUrl?: string; readonly installed?: string; }): Promise; /** The report as the lines `doctor` prints, without any leading indent. */ export declare function describeUpdate(report: UpdateReport): string[]; //# sourceMappingURL=check.d.ts.map