import type { EnvironmentName } from '../config/environments.js'; import { type UnreadMessagesCache } from './notice.js'; export declare function messagesCachePath(baseDir?: string): string; /** * The last recorded answer, or null if there is none to trust. * * Missing, unreadable and malformed all collapse to null on purpose: the caller's next move is * identical in every case — say nothing now, refresh in the background. */ export declare function readUnreadMessagesCache(baseDir?: string): UnreadMessagesCache | null; export declare function writeUnreadMessagesCache(cache: UnreadMessagesCache, baseDir?: string): void; /** * The line bin.ts prints before a command runs — read from the cache, never the network. * * A cache belonging to a DIFFERENT environment answers a different question and is ignored: * a dev broadcast must not nudge a prod session, or the other way round. The same rule * `pendingUpdateNotice` applies to dist-tags. */ export declare function pendingMessagesNotice(environment: EnvironmentName | undefined, baseDir?: string, now?: number): string | null; /** * Refresh the cache if it is stale. Fire-and-forget: callers must not await this for its value. * * A cache about a different environment is refreshed immediately however recent it is — * switching environments must not leave the nudge mute for the rest of its interval. * * On failure the result is still written, with `unread: null`, so an offline machine backs off * for the interval instead of asking on every command. That is why the failure marker is null * rather than 0: zero would be a claim ("you have nothing unread"), null is an admission. */ export declare function refreshUnreadMessagesInBackground(environment: EnvironmentName, apiUrl: string, accessToken: string, now?: number, baseDir?: string, fetchImpl?: typeof globalThis.fetch): Promise;