-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.d.ts
33 lines (32 loc) · 825 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
declare class FixedSizeMap<K, V> {
private map;
private keys;
private currIndex;
/**
* The max number of keys this cache can hold
* @param {number} size
*/
constructor(size: number);
/**
* Adds a key and pairs it with a value
* If this is already at maximum occupation, this will remove the oldest element.
*/
add(key: K, value: V): void;
/**
* Checks if this cache contains a key
*/
contains(key: K): boolean;
/**
* Retrieves a value from this cache corresponding to the specified key
*/
get(key: K): V | undefined;
/**
* Removed the key value entry from this cache corresponding to the specified key
*/
remove(key: K): void;
/**
* Clears this cache
*/
clear(): void;
}
export = FixedSizeMap;