/** * Update notifier - the automatic, throttled "is a newer ptv available?" * check that runs after a normal command and nudges the user to update. * * Design goals: * - Never disrupt the actual command: every failure here is swallowed. * - Don't hammer the npm registry: a real network check runs at most once * per day; in between, a cached result is reused. * - Stay quiet when there is no human to nudge (non-TTY) or when asked * to be quiet. */ /** How long a registry check result stays fresh: once per day. */ export declare const CHECK_INTERVAL_MS: number; /** Where the throttling cache lives. */ export declare const CACHE_FILE: string; export interface UpdateCache { /** Epoch milliseconds of the last successful registry check. */ checkedAt: number; /** Latest version string seen at that check. */ latest: string; } /** Read the throttling cache. Returns null if missing or unreadable. */ export declare function readCache(file?: string): UpdateCache | null; /** Write the throttling cache. Best-effort: failures are ignored. */ export declare function writeCache(cache: UpdateCache, file?: string): void; /** Whether a fresh network check is due, given the cache and current time. */ export declare function isCheckDue(cache: UpdateCache | null, now: number, intervalMs?: number): boolean; export interface NotifyOptions { /** Suppress the nudge entirely (mirrors the CLI --quiet flag). */ quiet: boolean; } /** * Automatic update nudge. Runs *before* the main command so the user can * update first; on a "yes" answer we install, then re-exec ptv with the * same arguments so the trace runs on the new version transparently. * Silent and non-fatal on any error. */ export declare function notifyAndMaybeUpdate(options: NotifyOptions): Promise; //# sourceMappingURL=update-notifier.d.ts.map