/**
 * Quota Fetcher for Codex (ChatGPT) Accounts
 *
 * Fetches quota information from ChatGPT backend API.
 * Used for displaying rate limit windows and reset times.
 */
import type { CodexQuotaResult, CodexQuotaWindow, CodexCoreUsageSummary } from './quota-types';
/** Auth data extracted from Codex auth file */
interface CodexAuthData {
    accessToken: string;
    accountId: string;
    isExpired: boolean;
    expiresAt: string | null;
}
/** Raw API response structure */
interface CodexUsageResponse {
    plan_type?: string;
    planType?: string;
    rate_limit?: CodexRateLimitWindow;
    rateLimit?: CodexRateLimitWindow;
    code_review_rate_limit?: CodexRateLimitWindow | null;
    codeReviewRateLimit?: CodexRateLimitWindow | null;
    additional_rate_limits?: CodexAdditionalRateLimit[] | null;
    additionalRateLimits?: CodexAdditionalRateLimit[] | null;
}
/** Rate limit window from API */
interface CodexRateLimitWindow {
    primary_window?: CodexWindowData;
    primaryWindow?: CodexWindowData;
    secondary_window?: CodexWindowData;
    secondaryWindow?: CodexWindowData;
}
/**
 * Additional rate limit entry from API (introduced for features like GPT-5.3 Codex Spark).
 * Each entry surfaces its own primary/secondary windows under a feature-specific limit name.
 */
interface CodexAdditionalRateLimit {
    limit_name?: string;
    limitName?: string;
    metered_feature?: string;
    meteredFeature?: string;
    rate_limit?: CodexRateLimitWindow;
    rateLimit?: CodexRateLimitWindow;
}
/** Individual window data */
interface CodexWindowData {
    used_percent?: number;
    usedPercent?: number;
    reset_after_seconds?: number | null;
    resetAfterSeconds?: number | null;
}
declare function getUnknownCodexWindowLabels(windows: CodexQuotaWindow[]): string[];
/**
 * Build explicit 5h + weekly usage summary from raw Codex windows.
 * Prefers explicit `category`/`cadence` metadata when present.
 * Falls back to label sniffing for legacy cached windows.
 */
export declare function buildCodexCoreUsageSummary(windows: CodexQuotaWindow[]): CodexCoreUsageSummary;
declare function readCodexAuthData(accountId: string): CodexAuthData | null;
/**
 * Build CodexQuotaWindow array from API response
 * Handles both snake_case and camelCase field names
 */
declare function buildCodexQuotaWindows(payload: CodexUsageResponse): CodexQuotaWindow[];
/**
 * Fetch quota for a single Codex account
 *
 * @param accountId - Account identifier (email)
 * @param verbose - Show detailed diagnostics
 * @returns Quota result with windows and percentages
 */
export declare function fetchCodexQuota(accountId: string, verbose?: boolean): Promise<CodexQuotaResult>;
/**
 * Fetch quota for all Codex accounts
 *
 * @param verbose - Show detailed diagnostics
 * @returns Array of account quotas
 */
export declare function fetchAllCodexQuotas(verbose?: boolean): Promise<{
    account: string;
    quota: CodexQuotaResult;
}[]>;
export { readCodexAuthData, buildCodexQuotaWindows, getUnknownCodexWindowLabels };
//# sourceMappingURL=quota-fetcher-codex.d.ts.map