mirror of
https://github.com/arthur-pbty/portfolio2023.git
synced 2026-06-03 23:36:21 +02:00
15 lines
314 B
TypeScript
15 lines
314 B
TypeScript
declare interface Options {
|
|
max?: number;
|
|
maxAge?: number;
|
|
stale?: boolean;
|
|
}
|
|
|
|
declare class Cache<K, V> extends Map<K, V> {
|
|
constructor(options?: Options | number);
|
|
get(key: K, refresh?: boolean): V | undefined;
|
|
peek(key: K): V | undefined;
|
|
set(key: K, value: V, maxAge?: number): this;
|
|
}
|
|
|
|
export = Cache;
|