import { Decorator } from '../../decorator'; import type { PackageCacheNamespace } from './types'; type HashFunction = (...args: T) => string; type NamespaceFunction = (...args: T) => PackageCacheNamespace; type BooleanFunction = (...args: T) => boolean; /** * The cache decorator parameters. */ interface CacheParameters { /** * The cache namespace * Either a string or a hash function that generates a string */ namespace: PackageCacheNamespace | NamespaceFunction; /** * The cache key * Either a string or a hash function that generates a string */ key: string | HashFunction; /** * A function that returns true if a result is cacheable * Used to prevent caching of private, sensitive, results */ cacheable?: BooleanFunction; /** * The TTL (or expiry) of the key in minutes */ ttlMinutes?: number; } /** * caches the result of a decorated method. */ export declare function cache({ namespace, key, cacheable, ttlMinutes, }: CacheParameters): Decorator; export declare function getTtlOverride(namespace: string): number | undefined; export {};