xypriss-security
Version:
Advanced High-Performance Security Framework. Military-grade encryption, post-quantum resilience, and fortified data structures.
64 lines • 1.95 kB
TypeScript
import { CacheStats, MemoryCacheEntry } from "./types/cache.type";
import { FastLRUConfig, UltraMemoryCacheEntry } from "./types/UFSIMC.type";
declare class LRUNode<T = MemoryCacheEntry | UltraMemoryCacheEntry> {
key: string;
entry: T | null;
prev: LRUNode<T> | null;
next: LRUNode<T> | null;
accessCount: number;
createdAt: number;
lastAccessed: number;
constructor(key: string, entry: T | null);
updateAccess(): void;
}
export declare class FastLRU<T = MemoryCacheEntry | UltraMemoryCacheEntry> {
private readonly capacity;
private readonly ttl?;
private readonly enableStats;
private readonly onEvict?;
private size;
private head;
private tail;
private map;
private stats;
private cleanupTimer?;
constructor(config: FastLRUConfig | number);
get(key: string): T | undefined;
put(key: string, entry: T): T | null;
has(key: string): boolean;
peek(key: string): T | undefined;
delete(key: string): boolean;
clear(): void;
keys(): IterableIterator<string>;
values(): IterableIterator<T>;
entries(): IterableIterator<[string, T]>;
getKeys(): string[];
getKeysInOrder(): string[];
getNode(key: string): {
entry: T;
key: string;
} | null;
getLRUEntries(count: number): Array<{
key: string;
entry: T;
lastAccessed: number;
}>;
getSize(): number;
getCapacity(): number;
getStats(): CacheStats;
getMemoryUsage(): {
approximate: boolean;
bytes: number;
};
destroy(): void;
private addToHead;
private removeNode;
private moveToHead;
private removeTail;
private isExpired;
private setupTTLCleanup;
}
export declare function createFastLRU<T = MemoryCacheEntry | UltraMemoryCacheEntry>(config: FastLRUConfig): FastLRU<T>;
export type { FastLRUConfig, CacheStats };
export { LRUNode };
//# sourceMappingURL=FastLRU.d.ts.map