/** * Content freshness detection utilities for external links. * * @file Detects potentially stale external content even when links are valid */ /** Configuration for content freshness detection. */ export interface FreshnessConfig { /** Enable freshness detection */ enabled: boolean; /** Default staleness threshold in milliseconds */ defaultThreshold: number; /** Domain-specific thresholds */ domainThresholds: Record; /** Patterns that indicate stale or moved content */ stalePatterns: string[]; /** Cache directory for content tracking */ cacheDir: string; /** Whether to perform content change detection */ detectContentChanges: boolean; } /** Information about content freshness. */ export interface ContentFreshnessInfo { /** URL being checked */ url: string; /** Whether content is considered fresh */ isFresh: boolean; /** Last modified date if available */ lastModified?: Date; /** Age of content in milliseconds */ ageMs?: number; /** Staleness threshold that was applied */ thresholdMs: number; /** Detected stale patterns in content */ stalePatterns: string[]; /** Content hash for change detection */ contentHash?: string; /** Previous content hash if available */ previousContentHash?: string; /** Whether content has significantly changed */ hasContentChanged?: boolean; /** Warning message if content appears stale */ warning?: string; /** Suggestion for addressing staleness */ suggestion?: string; } /** HTTP response information needed for freshness detection. */ export interface ResponseInfo { /** Response status code */ status: number; /** Response headers */ headers: Record; /** Response body content */ content: string; /** Final URL after redirects */ finalUrl: string; } export declare class ContentFreshnessDetector { private config; private cacheFile; constructor(config?: Partial); /** Check if freshness detection is enabled. */ isEnabled(): boolean; /** Analyze content freshness for a given URL response. */ analyzeContentFreshness(url: string, response: ResponseInfo): Promise; /** Extract domain from URL. */ private extractDomain; /** Parse Last-Modified header. */ private parseLastModified; /** Detect stale patterns in content. */ private detectStalePatterns; /** Calculate content hash for change detection. */ private calculateContentHash; /** Format age in human-readable format. */ private formatAge; /** Get cached content information. */ private getCachedContent; /** Update cached content information. */ private updateCachedContent; /** Clear the content freshness cache. */ clearCache(): Promise; /** Get cache statistics. */ getCacheStats(): Promise<{ totalEntries: number; oldestEntry?: Date; newestEntry?: Date; }>; } /** Default freshness configuration. */ export declare const DEFAULT_FRESHNESS_CONFIG: FreshnessConfig; //# sourceMappingURL=content-freshness.d.ts.map