/** * dsh-widgets — the ONE live-stats assembly. * * Both the rail and the preview surfaces must render a widget from the SAME * record, because "the preview shows what the card will show" is a promise the * market and 组件配置 make to the user: the cards are reviewed there INSTEAD of * being installed on a rail in use. So the bridge snapshot → `WidgetStats` fold * lives here once, and the rail no longer assembles it inline (it did, at * rail-view.tsx:319-330, before the preview surfaces could read it). * * The fold is exactly what the rail used to do: * 1. the collector's session stats, with the heatmap day map FALLING BACK to the * persisted log only when live stats carry no heatmap fields (first paint * before the collector's effect runs) — never overriding live values; * 2. the payload slices the collector keeps in the bridge (usage / pool / * Command Code / hardware / GitHub) plus their error codes; * 3. the pooled views the usage cards cycle through (`total` first); * 4. the instance's own saved config LAST, so a config-driven card * (peak-pricing's windows, the heatmap's timezone, 会话概览's metrics) renders * the instance's real settings rather than the defaults. */ import type { WidgetStats } from '../lib/contract/types'; import type { BridgeSnapshot } from './bridge'; import type { Prefs } from './prefs'; /** * Fold one bridge snapshot into the stats record a widget instance renders from. * * @param snap - the live bridge snapshot. * @param prefs - the live prefs (heatmap fallback config + this instance's config). * @param key - the instance key (`widget@size`), for `cardConfigs` lookup. * @param armedAction - the rail's armed-action id (transient UI state; previews pass null). * @returns the exact record the rail passes to `Widget.render`. */ export declare function buildLiveStats(snap: BridgeSnapshot, prefs: Prefs, key: string, armedAction?: string | null): WidgetStats;