UNPKG

561 BTypeScriptView Raw
1import { ExecutionContext } from '../../interfaces/features/execution-context.interface';
2/**
3 * Decorator that sets the cache ttl setting the duration for cache expiration.
4 *
5 * For example: `@CacheTTL(5)`
6 *
7 * @param ttl number set the cache expiration time
8 *
9 * @see [Caching](https://docs.nestjs.com/techniques/caching)
10 *
11 * @publicApi
12 */
13declare type CacheTTLFactory = (ctx: ExecutionContext) => Promise<number> | number;
14export declare const CacheTTL: (ttl: number | CacheTTLFactory) => import("../../decorators").CustomDecorator<string>;
15export {};