import { type HttpPort } from '../platform/http.js'; import { type UsageCache, type UsagePayload } from './usage-cache.js'; interface FetchResult { ok: true; payload: UsagePayload; } interface FetchRateLimited { ok: false; rateLimited: true; retryAfterSec: number; } interface FetchError { ok: false; rateLimited: false; error: string; } type FetchUsageOutcome = FetchResult | FetchRateLimited | FetchError; /** * Fetch the subscription usage directly. Caller is responsible for caching — * see fetchUsageCached() for the cache-aware version. The HTTP call goes * through an injected `HttpPort` (defaults to the global fetch); tests inject * a fake via `deps.http`. */ export declare function fetchUsage(accessToken: string, deps?: { http?: HttpPort; }): Promise; /** * Cache-aware variant. Returns the cached payload if fresh, otherwise fetches. * Honors any retry-after still in effect from a previous 429. * * `account` is the email associated with the access token, recorded in the * cache so consumers can tell whether the snapshot still belongs to the * currently-active account (different accounts = independent quotas). */ export declare function fetchUsageCached(accountsDirPath: string, accessToken: string, opts?: { force?: boolean; account?: string; }): Promise; export {};