import type { QuotaAxis, QuotaPeriod } from "./dashboard-contract.js"; export type { QuotaAxis, QuotaPeriod }; export interface QuotaObservation { axis: QuotaAxis; period: QuotaPeriod; limit: number; remaining: number; resetsAt: number | null; observedAt: number; basis: "provider-stated"; } /** Options are deliberately small so observations can be deterministic in tests. */ export interface QuotaObservationOptions { observedAt?: number; } export type QuotaHeaders = Headers | Readonly>; export declare function bucketKey(axis: QuotaAxis, period: QuotaPeriod): string; /** * Extracts all complete, explicitly attributed limit/remaining pairs from response headers. * Header names are case-insensitive; supported forms put `limit`, `remaining`, and optionally * `reset` alongside `requests` or `tokens`, with an optional `minute`, `day`, or `month` token. * This covers both `x-ratelimit-limit-requests-day` and * `anthropic-ratelimit-requests-limit`-style names. */ export declare function extractQuotaObservations(headers: QuotaHeaders, options?: QuotaObservationOptions): QuotaObservation[]; /** Merge observations by their typed identity; later sets replace only matching tuples. */ export declare function mergeQuotaObservations(...sets: readonly (readonly QuotaObservation[])[]): QuotaObservation[]; /** Render-time derivation. The ratio is intentionally absent from QuotaObservation itself. */ export declare function headroomPercent(observation: QuotaObservation): number;