claude-flow
Version:
Enterprise-grade AI agent orchestration with ruv-swarm integration (Alpha Release)
54 lines (53 loc) • 1.61 kB
TypeScript
export declare namespace Touch {
const None: 0;
const First: 1;
const AsOld: 1;
const Last: 2;
const AsNew: 2;
}
export type Touch = 0 | 1 | 2;
export declare class LinkedMap<K, V> implements Map<K, V> {
readonly [Symbol.toStringTag] = "LinkedMap";
private _map;
private _head;
private _tail;
private _size;
private _state;
constructor();
constructor(): void;
constructor(): boolean;
get size(): number;
get first(): V | undefined;
get last(): V | undefined;
constructor(key: K): boolean;
constructor(key: K, touch?: Touch): V | undefined;
constructor(key: K, value: V, touch?: Touch): this;
constructor(key: K): boolean;
constructor(key: K): V | undefined;
constructor(): V | undefined;
constructor(callbackfn: (value: V, key: K, map: LinkedMap<K, V>) => void, thisArg?: any): void;
constructor(): IterableIterator<K>;
constructor(): IterableIterator<V>;
constructor(): IterableIterator<[K, V]>;
[Symbol.iterator](): IterableIterator<[K, V]>;
protected trimOld(newSize: number): void;
private addItemFirst;
private addItemLast;
private removeItem;
private touch;
constructor(): [K, V][];
constructor(data: [K, V][]): void;
}
export declare class LRUCache<K, V> extends LinkedMap<K, V> {
private _limit;
private _ratio;
constructor(limit: number, ratio?: number);
get limit(): number;
set limit(limit: number);
get ratio(): number;
set ratio(ratio: number);
constructor(key: K, touch?: Touch): V | undefined;
constructor(key: K): V | undefined;
constructor(key: K, value: V): this;
private checkTrim;
}