export type HandleKind = "console" | "cdc" | "task" | "snapshot" | "capture" | "stimulus" | "ble"; export interface HandleMeta { kind: HandleKind; device?: string; createdAt: number; lastTouch: number; } /** Why a handle stopped being usable — the model needs to tell "you waited too * long" apart from "you made that id up". */ export type ExpiryReason = "idle" | "max_age" | "evicted"; export type Lookup = { status: "live"; meta: HandleMeta; } | { status: "expired"; kind: HandleKind; reason: ExpiryReason; hint: string; } | { status: "unknown"; }; export declare class HandleRegistry { private readonly now; private map; private dead; constructor(now?: () => number); register(handle: string, meta: { kind: HandleKind; device?: string; }): void; get(handle: string): HandleMeta | undefined; /** The answer `get` cannot give: expired is not the same as never existed. */ lookup(handle: string): Lookup; touch(handle: string): void; drop(handle: string): void; list(): Array; /** Time-based expiry, run whenever the registry is touched — a timer here * would keep the whole process alive for the sake of bookkeeping. */ private sweep; /** Count-capped kinds (snap_*: last 20) drop their oldest on the way in. */ private evictOverflow; private bury; } export declare const handles: HandleRegistry;