apple-dev-mcp
Version:
Complete Apple development guidance: Human Interface Guidelines (design) + Technical Documentation for iOS, macOS, watchOS, tvOS, and visionOS
75 lines • 1.9 kB
TypeScript
/**
* Content caching layer with TTL and graceful degradation
*/
import NodeCache from 'node-cache';
import type { CacheEntry } from './types.js';
export declare class HIGCache {
private cache;
private defaultTTL;
constructor(defaultTTL?: number);
/**
* Set a cache entry with custom TTL
*/
set<T>(key: string, data: T, ttl?: number): boolean;
/**
* Get a cache entry
*/
get<T>(key: string): T | null;
/**
* Get a cache entry with metadata
*/
getWithMetadata<T>(key: string): CacheEntry<T> | null;
/**
* Check if a key exists and is not expired
*/
has(key: string): boolean;
/**
* Delete a cache entry
*/
delete(key: string): number;
/**
* Clear all cache entries
*/
clear(): void;
/**
* Get cache statistics
*/
getStats(): NodeCache.Stats;
/**
* Get all keys in cache
*/
getKeys(): string[];
/**
* Check if cached data is stale (expired but available for graceful degradation)
*/
isStale<T>(key: string): boolean;
/**
* Get stale data for graceful degradation
* Returns data even if expired, useful when fresh data fetch fails
*/
getStale<T>(key: string): T | null;
/**
* Set cache entry that persists longer for graceful degradation
*/
setWithGracefulDegradation<T>(key: string, data: T, normalTTL?: number, gracefulTTL?: number): boolean;
/**
* Get data with graceful degradation fallback
*/
getWithGracefulFallback<T>(key: string): {
data: T | null;
isStale: boolean;
};
/**
* Preload cache with critical data
*/
preload<T>(entries: Array<{
key: string;
data: T;
ttl?: number;
}>): void;
/**
* Clean up cache resources
*/
destroy(): void;
}
//# sourceMappingURL=cache.d.ts.map