import { type AsyncReturnType } from 'type-fest'; import { type TimeDescriptor } from '@sindresorhus/to-milliseconds'; import { type CacheValue } from './cached-value.js'; import { type CacheKey } from './legacy.js'; export default class CachedFunction Promise), ScopedValue extends AsyncReturnType, Arguments extends Parameters> { #private; name: string; readonly options: { updater: Updater; maxAge?: TimeDescriptor; staleWhileRevalidate?: TimeDescriptor; cacheKey?: CacheKey; shouldRevalidate?: (cachedValue: ScopedValue) => boolean; }; readonly maxAge: TimeDescriptor; readonly staleWhileRevalidate: TimeDescriptor; get: Updater; constructor(name: string, options: { updater: Updater; maxAge?: TimeDescriptor; staleWhileRevalidate?: TimeDescriptor; cacheKey?: CacheKey; shouldRevalidate?: (cachedValue: ScopedValue) => boolean; }); getCached(...arguments_: Arguments): Promise; applyOverride(arguments_: Arguments, value: ScopedValue): Promise; getFresh(...arguments_: Arguments): Promise; delete(...arguments_: Arguments): Promise; isCached(...arguments_: Arguments): Promise; }