UNPKG

pastoralist

Version:

A tool to watch over node module resolutions and overrides

28 lines (27 loc) 900 B
import type { CacheDirOptions, DiskCacheOptions } from "../types"; export declare const detectCIEnv: () => boolean; export declare const hashLockfile: (root?: string) => string; export declare const resolveCacheDir: (options?: CacheDirOptions) => string; export declare const pruneBackups: (cacheDir: string, options?: { keep?: number; maxAgeMs?: number; }) => void; export declare class DiskCache<V> { private readonly filePath; private readonly ttl; private readonly version; private readonly maxEntries; private readonly enabled; private data; constructor(namespace: string, options: DiskCacheOptions); private empty; private load; private flush; private isExpired; get(key: string): V | undefined; set(key: string, value: V): void; has(key: string): boolean; delete(key: string): void; clear(): void; prune(): number; }