/** * The notices the HUD's rail shows, edited without a release. * * The slides used to be compiled into the SDK, so changing a sentence meant shipping a version. The * daemon now fetches a small JSON file from our own site, keeps the entries that apply to this * machine, and pushes them to the HUD in the impact snapshot. The page never fetches it: the HUD runs * inside somebody else's app, whose Content-Security-Policy may forbid the request. * * Everything here is pure. Fetching and caching live in the daemon; the clock arrives as an argument. */ import { z } from 'zod'; /** Where the daemon reads the notices from. Overridable for self-hosting and tests. */ export declare const HUD_NOTICES_URL = "https://reticle.sh/hud/notices.v1.json"; export declare const NOTICES_FILE_VERSION = 1; /** What the HUD renders. Only display fields: the audience rules never leave the daemon. */ export declare const HudNoticeSchema: z.ZodObject<{ id: z.ZodString; kicker: z.ZodOptional; title: z.ZodString; detail: z.ZodOptional; cta: z.ZodOptional; }, "strip", z.ZodTypeAny, { label: string; url: string; }, { label: string; url: string; }>>; }, "strip", z.ZodTypeAny, { id: string; title: string; detail?: string | undefined; kicker?: string | undefined; cta?: { label: string; url: string; } | undefined; }, { id: string; title: string; detail?: string | undefined; kicker?: string | undefined; cta?: { label: string; url: string; } | undefined; }>; export type HudNotice = z.infer; /** One entry in the file: a notice plus who sees it and when. */ export declare const HudNoticeEntrySchema: z.ZodObject<{ id: z.ZodString; kicker: z.ZodOptional; title: z.ZodString; detail: z.ZodOptional; cta: z.ZodOptional; }, "strip", z.ZodTypeAny, { label: string; url: string; }, { label: string; url: string; }>>; } & { audience: z.ZodOptional; entitled: z.ZodOptional; }, "strip", z.ZodTypeAny, { signedIn?: boolean | undefined; entitled?: boolean | undefined; }, { signedIn?: boolean | undefined; entitled?: boolean | undefined; }>>; /** ISO dates. Shown from `from` (inclusive) until `until` (exclusive). */ from: z.ZodOptional; until: z.ZodOptional; /** Oldest SDK that can show it, e.g. "x.y.z". */ minSdk: z.ZodOptional; /** Higher shows first. */ weight: z.ZodOptional; }, "strip", z.ZodTypeAny, { id: string; title: string; from?: string | undefined; detail?: string | undefined; until?: string | undefined; kicker?: string | undefined; cta?: { label: string; url: string; } | undefined; audience?: { signedIn?: boolean | undefined; entitled?: boolean | undefined; } | undefined; minSdk?: string | undefined; weight?: number | undefined; }, { id: string; title: string; from?: string | undefined; detail?: string | undefined; until?: string | undefined; kicker?: string | undefined; cta?: { label: string; url: string; } | undefined; audience?: { signedIn?: boolean | undefined; entitled?: boolean | undefined; } | undefined; minSdk?: string | undefined; weight?: number | undefined; }>; export type HudNoticeEntry = z.infer; /** * The entries in a notices file this SDK understands. An unknown version or shape answers nothing, * and a bad entry is dropped on its own, so one typo cannot take the whole rail down. */ export declare function parseHudNotices(file: unknown): HudNoticeEntry[]; /** What is known about this machine when choosing. `undefined` means "not heard yet". */ export interface NoticeContext { signedIn: boolean | undefined; entitled: boolean | undefined; sdkVersion: string; now: number; } /** The notices this machine should see now, heaviest first, display fields only. */ export declare function selectNotices(entries: readonly HudNoticeEntry[], ctx: NoticeContext): HudNotice[];