cdk-insights
Version:
AWS CDK security and cost analysis tool with AI-powered insights
38 lines (37 loc) • 892 B
TypeScript
export type CacheOptions = {
ttl?: number;
maxSize?: number;
};
export type CacheEntry<T> = {
value: T;
timestamp: number;
ttl: number;
fileHashes?: Record<string, string>;
authContext?: string;
};
export type Cache<T> = {
get(key: string): T | undefined;
set(key: string, value: T, ttl?: number): void;
clear(): void;
size(): number;
has(cacheKey: string): boolean;
};
export type FileBasedCacheEntry<T> = {
value: T;
timestamp: number;
ttl: number;
fileHashes: Record<string, FileModificationInfo>;
authContext: string;
resourceHash: string;
};
export type FileModificationInfo = {
filePath: string;
lastModified: number;
hash: string;
};
export type CacheKeyComponents = {
resourceId: string;
authContext: string;
resourceHash: string;
fileHashes: Record<string, FileModificationInfo>;
};