import { z } from "zod"; import type { ProviderUsage, ProviderUsageBalance, ProviderUsageTone, ProviderUsageWindow } from "../../server/messages.js"; import type { ProviderApiFetch } from "./provider.js"; export declare const ApiNumberSchema: z.ZodCoercedNumber; export declare const ApiNullableNumberSchema: z.ZodPreprocess>>; export declare const ApiOptionalStringSchema: z.ZodPreprocess>>; export declare function fetchProviderApi(fetchApi: ProviderApiFetch, input: RequestInfo | URL, init?: RequestInit): Promise; export declare function unavailableUsage(provider: { providerId: string; displayName: string; error?: string | null; }): ProviderUsage; export declare function windowFromUsedPct(input: { id: string; label: string; utilizationPct: number | null | undefined; resetsAt?: string | null; tone?: ProviderUsageWindow["tone"]; }): ProviderUsageWindow; /** * The tone scale for anything measured against a known limit, windows and balances alike. * * Thresholds match `deriveTone` in the app's provider-usage/tone.ts, which is what the * client falls back to when a window arrives without a tone. Healthy is "ok" rather than * "default" because that is what every provider setting a tone has always sent, and it is * what the bars render today below their thresholds. */ export declare function toneFromUsedPct(usedPct: number | null | undefined): ProviderUsageTone; /** * Tone for a balance with no known limit, where a percentage cannot be computed and the * only signal is whether anything is left. Prefer `toneFromUsedPct` when a limit exists: * this one stays "ok" until the balance is completely spent. */ export declare function balanceToneFromRemaining(remaining: number | null | undefined): ProviderUsageBalance["tone"]; /** Percentage of a limit consumed, or null when either side is unknown. */ export declare function usedPctOf(used: number | null | undefined, limit: number | null | undefined): number | null; export declare function toIsoStringOrNull(timestampMs: number): string | null; //# sourceMappingURL=usage.d.ts.map