import type { UsageAllowanceStatus, WorkspaceUsageResponse } from "@opengeni/sdk/usage-allowances"; import type { AllowanceScope } from "./allowance-copy.js"; /** One ceiling as a person reads it: how much of it is used, and when it resets. */ export type UsageReading = { scope: AllowanceScope; /** Used share of the ceiling. Can exceed 1 after post-call overshoot. */ fraction: number; status: UsageAllowanceStatus; resetsAt: string | null; /** USD micros. Only shown when a host opts in with `formatAmount`. */ used: number; limit: number; remaining: number; }; /** * What a member can still do: `unlimited` when no ceiling applies, otherwise * the state of whichever ceiling stops them first (`binding`). */ export type UsageSummary = { state: "unlimited" | "ok" | "warning" | "exhausted"; /** The ceiling a person would ask to raise; null when unlimited. */ binding: UsageReading | null; /** Their own ceiling, when one applies. */ member: UsageReading | null; /** The shared workspace pool, when one is set. */ workspace: UsageReading | null; }; /** * Fold a usage response (normally `/usage/me`) into what to tell one member. * The server's `status` decides warning/exhausted (it applies the configured * thresholds); when both ceilings apply, the one with less room left binds. */ export declare function summarizeUsage(usage: WorkspaceUsageResponse, subjectId?: string | undefined): UsageSummary; /** A whole-number percentage for display: "<1" for a sliver, never "0" for some use. */ export declare function usagePercentLabel(fraction: number): string;