import { type UpdateCheckCache } from '../update/notice.js'; /** What the banner needs to write its sentence, or null when there is nothing to say. */ export interface CliUpdateState { current: string; latest: string; } /** * How often the cache file is re-read. * * Not about the network — the refresh below has its own, much longer interval — but about not * stat-ing and parsing a file 7200 times an hour to answer a question whose answer changes at most * a few times a day. */ export declare const CLI_UPDATE_READ_INTERVAL_MS = 30000; export interface CliUpdateReaderDeps { version: () => string; readCache: () => UpdateCheckCache | null; /** Fire-and-forget; self-throttles on the cache's own staleness rule. */ refresh: (version: string) => void; now: () => number; } export declare const defaultCliUpdateReaderDeps: CliUpdateReaderDeps; /** * A memoised "is this CLI behind?", safe to call from a route handler on every poll. * * The refresh is triggered from here rather than on a timer of its own, because a `dev` session is * exactly the case bin.ts's one-shot refresh does not cover: it checks once at startup and the * process then runs for hours, so without this a session started before a release would never * learn of it. `refreshUpdateCacheInBackground` already declines to do anything until its own * interval has passed, so calling it here every thirty seconds costs a cache read, not a request. */ export declare function createCliUpdateReader(deps?: CliUpdateReaderDeps): () => CliUpdateState | null;