import type { UsageAllowancePeriod, WorkspaceUsageResponse } from "@opengeni/sdk/usage-allowances"; import { type UsageClientLike } from "../hooks/use-usage.js"; import { type AllowanceLabels } from "../usage/allowance-copy.js"; import { type UsageSummary } from "../usage/summary.js"; import { type OpenGeniText } from "../messages/runtime.js"; export type UsageMeterLabels = AllowanceLabels & { /** Heading for the member's own ceiling. */ title: string; /** Heading when only the shared workspace pool applies. */ workspaceTitle: string; /** "38% left" — `percent` is preformatted ("38", "<1"). */ left: (percent: string) => string; /** "62% used". */ used: (percent: string) => string; limitReached: string; /** Status chip beside a hero meter that is close to its limit. */ nearLimit: string; /** "$13.00 left" for a hero meter with amounts. */ amountLeft: (amount: string) => string; /** No ceiling applies to this member. */ unlimited: string; loading: string; error: string; retry: string; /** "$31.00 of $50.00 used" when the host passes `formatAmount`. */ amounts: (used: string, limit: string) => string; /** The shared pool, under a member's own meter: "Workspace: 9% left". */ workspaceLine: (value: string) => string; }; export declare const DEFAULT_USAGE_METER_LABELS: (t: OpenGeniText) => UsageMeterLabels; export type UsageMeterBaseProps = { /** "left" (default) reads like a battery; "used" reads like spend. */ measure?: "left" | "used" | undefined; /** * Opt in to amounts. Receives USD micros; return your own unit ("$31.00", * "3.1 credits", "1.5× plan"). Without it the meter shows only shares. */ formatAmount?: ((micros: number) => string) | undefined; labels?: Partial | undefined; /** * `compact` is one line for menus and headers; `hero` leads a page with the * amount (or share) left in large type. An empty `labels.title` hides the * heading when the page already names it. */ density?: "default" | "compact" | "hero" | undefined; /** Show the shared pool under the member's own meter when it is the tighter one. Default true. */ showWorkspace?: boolean | undefined; className?: string | undefined; }; export type UsageMeterProps = UsageMeterBaseProps & { /** * A usage response you already loaded (for example from `useUsage`). * Omit it to let the meter read `/usage/me` itself. */ usage?: WorkspaceUsageResponse | null | undefined; client?: UsageClientLike | undefined; workspaceId?: string | undefined; period?: UsageAllowancePeriod | undefined; /** Re-read when this changes (see `useUsage`). */ refreshKey?: unknown; }; /** * The signed-in member's own usage: how much of their limit is left and when * it resets. Shares only by default; hosts opt in to amounts. */ export declare function UsageMeter({ usage, client, workspaceId, period, refreshKey, ...view }: UsageMeterProps): import("react").JSX.Element; export type UsageMeterViewProps = UsageMeterBaseProps & { summary: UsageSummary | null; loading?: boolean | undefined; error?: Error | null | undefined; onRetry?: (() => void) | undefined; }; /** Presentational meter for a summary you computed (`summarizeUsage`). */ export declare function UsageMeterView({ summary, loading, error, onRetry, measure, formatAmount, labels: overrides, density, showWorkspace, className, }: UsageMeterViewProps): import("react").JSX.Element;