/** * The browser half's view of the Host's usage route. * * @module dsh-token-dashboard/client/api */ import type { UsageSnapshot } from '../shared/types.js'; /** Route prefix owned by this plugin's Host half. */ export declare const ROUTE_PREFIX = "/dsh-token-dashboard"; /** A fetch outcome the panel can render without throwing. */ export type StatsResult = { ok: true; snapshot: UsageSnapshot; } | { ok: false; error: string; staleHost?: boolean; }; /** * Read one usage snapshot from the Host. * * The response is always HTTP 200 with a JSON body on success; any other status * is surfaced as a readable message rather than an exception, because a stale * dashboard is a better failure mode than a blank settings page. * * There is no range parameter: the panel reports a profile, so every figure it * shows is all-time. * @param timeZone - IANA zone the Host should bucket days in. * @param sessionId - Session the browser has open, highlighted in the list. * @param signal - Abort signal for a superseded request. * @returns The snapshot, or a message describing why it is unavailable. */ export declare function fetchStats(timeZone: string, sessionId: string | undefined, signal: AbortSignal): Promise; /** * The session id in the page URL, when the shell put one there. * @returns The id, or `undefined` when the shell address carries none. */ export declare function currentSessionId(): string | undefined; /** * The browser's IANA zone, used for day bucketing. * @returns The zone name, or `UTC` when the runtime cannot report one. */ export declare function browserTimeZone(): string;