UNPKG

603 BTypeScriptView Raw
1import type { ESLintSettings } from "./types";
2
3export type CacheKey = unknown;
4export type CacheObject = {
5 result: unknown;
6 lastSeen: ReturnType<typeof process.hrtime>;
7};
8
9declare class ModuleCache {
10 map: Map<CacheKey, CacheObject>;
11
12 constructor(map?: Map<CacheKey, CacheObject>);
13
14 get<T>(cacheKey: CacheKey, settings: ESLintSettings): T | undefined;
15
16 set<T>(cacheKey: CacheKey, result: T): T;
17
18 static getSettings(settings: ESLintSettings): { lifetime: number } & Omit<ESLintSettings['import/cache'], 'lifetime'>;
19}
20export default ModuleCache;
21
22export type { ModuleCache }