import type { UsageData, WidgetRenderOut, WidgetStats } from '../../lib/contract/types'; /** * dsh-widgets — OpenCode Go usage shared render layer (widget-family shared). * * The five usage widgets (usage-bars / usage-rings / usage-rolling / usage- * weekly / usage-monthly) share the pool-view resolution and the card shapes. * They live here — NOT copied into each unit — so the family stays consistent * and a new usage-style widget imports the same machinery. * * All strings come from the per-widget dictionaries (merged by the registry * generator from each unit's manifest; family-shared keys live in * `src/widgets/_shared/locales.json`), so these factories never hard-code text. */ /** Which key's usage a usage widget should currently show. */ export declare function usageView(stats: WidgetStats): { data: UsageData | null; mode: string; }; /** Cycle descriptor for a pooled usage widget, when more than one view exists. */ export declare function cycleFor(stats: WidgetStats): WidgetRenderOut['cycle']; /** 「总 Key」/「Key N」label for the current view. */ export declare function modeLabel(mode: string): string; /** Read one usage window's percent DEFENSIVELY: any malformed window (missing, * null, non-object, non-numeric percent — e.g. an upstream partial/error * response) yields null, so the multi-window charts degrade to a placeholder * instead of throwing and taking the whole rail down with them. */ export declare function winPct(u: UsageData['usage'] | undefined, key: 'rolling' | 'weekly' | 'monthly'): number | null; /** Single-window percent card (usage-rolling / usage-weekly / usage-monthly). */