UNPKG

mastercache

Version:

Multi-tier cache module for Node.js. Redis, Upstash, CloudfareKV, File, in-memory and others drivers

59 lines (56 loc) 1.47 kB
import { Duration } from './types/helpers.cjs'; import { E as Emitter } from '../events-BJQnbTp3.cjs'; import { GracePeriodOptions, FactoryTimeoutOptions, RawMasterCacheOptions } from './types/options/options.cjs'; import { Logger } from 'typescript-log'; import './types/bus.cjs'; import '@boringnode/bus/types/main'; /** * The default options to use throughout the library * * Some of them can be override on a per-cache basis * or on a per-operation basis */ declare class MasterCacheOptions { #private; /** * The default TTL for all caches * * @default 30m */ ttl: Duration; /** * Default prefix for all caches */ prefix: string; /** * The grace period options */ gracePeriod: GracePeriodOptions; /** * Default early expiration percentage */ earlyExpiration: number; /** * Whether to suppress L2 cache errors */ suppressL2Errors: boolean; /** * The soft and hard timeouts for the factories */ timeouts?: FactoryTimeoutOptions; /** * The logger used throughout the library */ logger: Logger; /** * The emitter used throughout the library */ emitter: Emitter; /** * Max time to wait for the lock to be acquired */ lockTimeout?: Duration; constructor(options: RawMasterCacheOptions); cloneWith(options: RawMasterCacheOptions): MasterCacheOptions; } export { MasterCacheOptions };