/**
 * GitHub Portfolio Indexer - Fetches and indexes user's GitHub portfolio for fast searching
 *
 * Features:
 * - Singleton pattern for efficient resource usage
 * - Smart caching with TTL and invalidation after user actions
 * - GraphQL/REST API integration for efficient fetching
 * - Rate limiting and authentication handling
 * - Fallback strategy for resilient operation
 * - Performance optimized for 1000+ portfolio elements
 */
import { PortfolioRepoManager } from './PortfolioRepoManager.js';
import { ElementType } from './types.js';
export interface GitHubIndexEntry {
    path: string;
    name: string;
    description?: string;
    version?: string;
    author?: string;
    elementType: ElementType;
    sha: string;
    htmlUrl: string;
    downloadUrl: string;
    lastModified: Date;
    size: number;
}
export interface GitHubPortfolioIndex {
    username: string;
    repository: string;
    lastUpdated: Date;
    elements: Map<ElementType, GitHubIndexEntry[]>;
    totalElements: number;
    sha: string;
    rateLimitInfo?: {
        remaining: number;
        resetTime: Date;
    };
}
export interface GitHubFetchOptions {
    force?: boolean;
    maxElements?: number;
    elementTypes?: ElementType[];
    useGraphQL?: boolean;
}
export declare class GitHubPortfolioIndexer {
    private cache;
    private lastFetch;
    private readonly ttl;
    private recentUserAction;
    private actionTimestamp;
    private readonly actionGracePeriod;
    private portfolioRepoManager;
    private apiCache;
    private rateLimitTracker;
    private readonly graphQLFeatureEnabled;
    constructor(portfolioRepoManager?: PortfolioRepoManager);
    /**
     * Main method to get GitHub portfolio index
     */
    getIndex(force?: boolean): Promise<GitHubPortfolioIndex>;
    /**
     * Invalidate cache after user actions
     */
    invalidateAfterAction(action: string): void;
    /**
     * Clear all cached data
     */
    clearCache(): void;
    /**
     * Get cache statistics
     */
    getCacheStats(): {
        hasCachedData: boolean;
        lastFetch: Date | null;
        isStale: boolean;
        recentUserAction: boolean;
        totalElements: number;
    };
    /**
     * Fetch fresh data from GitHub
     */
    private fetchFresh;
    /**
     * Fetch repository content from GitHub API
     */
    private fetchRepositoryContent;
    /**
     * Fetch using GraphQL for better performance
     * TODO: Implement GraphQL endpoint for portfolio operations
     */
    private fetchWithGraphQL;
    /**
     * Fetch using REST API with pagination
     */
    private fetchWithREST;
    /**
     * Fetch content for a specific element type
     */
    private fetchElementTypeContent;
    /**
     * Create GitHub index entry from API response
     */
    private createGitHubIndexEntry;
    /**
     * Parse metadata from file content (frontmatter)
     */
    private parseMetadataFromContent;
    /**
     * Get GitHub username from authenticated token
     */
    private getGitHubUsername;
    /**
     * Check if cache is valid
     */
    private isCacheValid;
    /**
     * Determine if we should fetch fresh data
     */
    private shouldFetchFresh;
    /**
     * Create empty index when no portfolio exists
     */
    private createEmptyIndex;
    dispose(): void;
}
//# sourceMappingURL=GitHubPortfolioIndexer.d.ts.map