/**
 * GitHub Rate Limiter
 *
 * Shared token-bucket rate limiter for multi-repo GitHub sync.
 * Queries `gh api rate_limit`, tracks cumulative usage, and gates
 * sync operations when approaching API limits.
 *
 * @module github-rate-limiter
 */
export interface RateLimitStatus {
    /** Remaining requests in current window */
    remaining: number;
    /** Total limit per window */
    limit: number;
    /** When the rate limit resets */
    resetAt: Date;
    /** Percentage of limit used (0-100) */
    percentUsed: number;
}
interface CanProceedResult {
    allowed: boolean;
    waitMs?: number;
    reason?: string;
}
export declare class GitHubRateLimiter {
    private token?;
    private totalUsed;
    private knownLimit;
    constructor(token?: string);
    /**
     * Query current GitHub API rate limit via `gh api rate_limit`.
     */
    checkRateLimit(): Promise<RateLimitStatus>;
    /**
     * Estimate how many API calls a sync operation will require.
     */
    estimateApiCalls(specCount: number, userStoryCount: number): number;
    /**
     * Check whether a sync operation can proceed given the current rate limit.
     */
    canProceed(estimatedCalls: number): Promise<CanProceedResult>;
    /**
     * Record API calls made during a sync operation.
     */
    recordUsage(calls: number): void;
    /**
     * Get the percentage of the known limit used by this limiter instance.
     */
    getUsagePercent(): number;
    private getEnv;
}
export {};
//# sourceMappingURL=github-rate-limiter.d.ts.map