@gabliam/cache
Version:
cache plugin for gabliam
38 lines (37 loc) • 1.05 kB
TypeScript
import { CacheOptions } from './cache-options';
export interface CacheEvictOptions extends CacheOptions {
/**
* Indicates whether a cache-wide eviction needs to be performed rather then just an entry eviction (based on the key).
*/
allEntries?: boolean;
/**
* Indicate whether the eviction should occur before the method executes.
*/
beforeInvocation?: boolean;
}
/**
* Type of the `CacheEvict` decorator / constructor function.
*/
export interface CacheEvictDecorator {
/**
* Decorator that marks a method triggers a cache evict operation.
*
* @usageNotes
*
* ```typescript
* @Service()
* class SampleController {
* @CacheEvict('test')
* saveToDatabase(entity: any) {
* }
* }
* ```
*
*/
(value?: string | string[] | CacheEvictOptions): MethodDecorator;
/**
* see the `@CacheEvict` decorator.
*/
new (value?: string | string[] | CacheEvictOptions): any;
}
export declare const CacheEvict: CacheEvictDecorator;