import axios from 'axios'; /** The published npm package name. */ export declare const PACKAGE_NAME = "hub-launch"; export interface UpdateInfo { current: string; latest: string; isNewer: boolean; } /** * Default cache file inside the existing machine-level `~/.hublaunch/` dir. The * standalone binary keeps its own: its latest version comes from the mirror's * GitHub Releases, not npm. */ export declare function defaultCachePath(): string; /** * Is `latest` (a release from the registry) newer than `current`? * * Comparison is by numeric major/minor/patch; prerelease tags are ignored for * ordering. The one special case: when the numeric parts are equal and * `current` is a prerelease but `latest` is not, the release is newer (so an * `-rc.N` build is told to upgrade to the matching stable). A prerelease * `current` therefore never reports itself as newer than, or equal to, a * same-version release. */ export declare function isNewerVersion(latest: string, current: string): boolean; /** The one-line, end-of-command notice shown when a newer CLI exists. */ export declare function formatUpdateNotice(info: UpdateInfo): string; /** * Whether the background update check is allowed to run. Disabled by the * `HULA_NO_UPDATE_CHECK=1` env var (CI), by `updateCheck: false` in the global * settings, or when stdout is not a TTY (so piped/parsed output is never * touched). A forced check (`hula update --check`) bypasses this. */ export declare function isUpdateCheckEnabled(): boolean; /** * Resolve whether a newer `hub-launch` is published (on npm, or for the * standalone binary on the mirror's GitHub Releases). Returns `null` when the * check is disabled or when the registry can't be reached — `null` means "say * nothing". A non-null result always carries `isNewer` so callers decide * whether to print the notice. * * - Uses `~/.hublaunch/update-check.json` as a 24 h cache (unless `force`). * - On any network error returns `null` and leaves the cache untouched. * - `force: true` ignores the enable gate and the cache (used by * `hula update --check`, an explicit user request). */ export declare function checkForUpdate(opts: { currentVersion: string; now?: Date; fetch?: typeof axios.get; cachePath?: string; force?: boolean; }): Promise; /** Park the in-flight background update check for {@link flushUpdateNotice}. */ export declare function setPendingUpdateCheck(promise: Promise | null): void; /** Reset for tests. */ export declare function __resetUpdateCheckState(): void; /** * Print the end-of-command update notice, or run the opt-in auto-update. * * Called once, after the command's own output. If the background check has not * resolved yet it is abandoned (the cache it writes serves the next run) so a * slow registry never delays the prompt. When `autoUpdate` is on and stdout is * a TTY, the update is applied now (after the command, never during) and * reported; if that fails, the plain notice is printed instead. */ export declare function flushUpdateNotice(): Promise; //# sourceMappingURL=update-check.d.ts.map