export declare const DEFAULT_UNREAD_S = 120; /** The interval in ms, or null when the org turned lead-watch (and so this watch) off. `unread_s` is seconds, fractions allowed. */ export declare function unreadIntervalMs(run: { lead_watch?: false | { unread_s?: number; }; }): number | null; export type NoticeDelivery = 'delivered' | 'pending' | 'exhausted'; export interface UnreadDecider { role: string; /** Who to tell, or undefined when nobody above it is running (nothing is sent, nothing is counted). */ lead?: string; notice: NoticeDelivery; /** Failed delivery attempts of its notice. */ failures: number; /** Where its clock runs from: the later of publish and delivery, never before the watch started. */ since: number; /** It read the version or decided on it. */ done: boolean; } export interface UnreadVersion { doc: string; version: number; type: string; producer: string; /** Still pending: not superseded, not accepted, not rejected. */ open: boolean; deciders: UnreadDecider[]; } export type UnreadCause = 'notice-gave-up' | 'not-read'; export interface UnreadNotice { /** The episode: one per version and lead. */ key: string; lead: string; doc: string; version: number; type: string; producer: string; /** The decision makers that have not read it. */ unread: string[]; cause: UnreadCause; /** 1 for the first notice of the episode. */ n: number; ageMs: number; text: string; } export declare class UnreadWatch { private readonly intervalMs; private episodes; constructor(intervalMs: number); /** A notice already sent (the bus history of a resumed run): the cap and the gap carry over. */ seed(key: string, n: number, lastAt: number): void; /** * `waiting`: a decision gate, approval or blocking question is pending (the lead-watch rule): nothing is sent * and no clock is reset. An episode ends, silently, when its version is superseded or decided or every * decision maker has read it, and it is forgotten. */ tick(versions: UnreadVersion[], now: number, waiting: boolean): UnreadNotice[]; } //# sourceMappingURL=unread-watch.d.ts.map