/**
 * LRU cache wrapper for ContributorResolver.
 *
 * Caches contributor permission lookups to prevent redundant API calls.
 * Uses a 15-minute TTL and 10,000 max entries.
 */
import type { ContributorResolver, ContributorInfo } from '@kici-dev/engine';
/**
 * Caches ContributorResolver results in an LRU cache.
 *
 * Cache key format: `{provider}:{repoFullName}:{username}`
 * TTL: 15 minutes (configurable for testing).
 */
export declare class ContributorCache {
    private readonly cache;
    constructor(options?: {
        ttlMs?: number;
        maxEntries?: number;
    });
    /**
     * Build the cache key from provider, repo, and username.
     */
    private buildKey;
    /**
     * Resolve contributor info, using cache when available.
     *
     * @param provider - Provider identifier (e.g. 'github')
     * @param repoFullName - Full repo identifier (e.g. 'owner/repo')
     * @param username - Contributor username
     * @param resolver - ContributorResolver to call on cache miss
     * @param credentials - Provider credentials for API calls
     * @returns Cached or freshly resolved ContributorInfo
     */
    resolve(provider: string, repoFullName: string, username: string, resolver: ContributorResolver, credentials: unknown): Promise<ContributorInfo>;
    /**
     * Explicitly invalidate a cached entry.
     *
     * @returns 1 if an entry was present and deleted, 0 otherwise. Symmetric
     * with the bulk invalidators so callers can accumulate a total.
     */
    invalidate(provider: string, repoFullName: string, username: string): number;
    /**
     * Invalidate every cached entry for a specific repository.
     *
     * Scans the LRU (bounded to `maxEntries`) and deletes entries whose key
     * prefix matches `{provider}:{repoFullName}:`. Used when a webhook event
     * signals a repo-wide permission change (e.g. GitHub `team.added_to_repository`
     * / `team.removed_from_repository`) where every contributor's effective
     * permission on that repo may have shifted.
     *
     * @returns Number of entries deleted.
     */
    invalidateByRepo(provider: string, repoFullName: string): number;
    /**
     * Invalidate every cached entry for a user across all repositories in an org.
     *
     * Scans the LRU and deletes entries whose key matches
     * `{provider}:{orgLogin}/*:{username}`. Used when a webhook event signals
     * that a user's membership in an org changed (e.g. GitHub `organization`,
     * `membership` events), since any repo under that org could now return a
     * different permission for the user.
     *
     * @returns Number of entries deleted.
     */
    invalidateByUserInOrg(provider: string, orgLogin: string, username: string): number;
    /**
     * Clear all cached entries. Useful for testing.
     */
    clear(): void;
    /**
     * Get the current number of cached entries.
     */
    get size(): number;
}
//# sourceMappingURL=contributor-cache.d.ts.map