import type { CacheEvictOptions } from '../interfaces'; /** * @CacheEvict decorator - Evict/invalidate cache entries * * This decorator automatically removes cache entries when a method is executed. * Useful for invalidating cache after update/delete operations. * * @param options - Cache evict options * * @example * ```typescript * class UserService { * // Evict single cache entry * @CacheEvict({ * keys: [(id) => `user:${id}`] * }) * async deleteUser(id: string) { * await this.repo.delete(id); * } * * // Evict multiple entries with patterns * @CacheEvict({ * patterns: ['user:*', 'users:list:*'] * }) * async updateAllUsers() { * await this.repo.update({}, { status: 'active' }); * } * * // Invalidate by tags * @CacheEvict({ * tags: ['user-list', 'user-data'] * }) * async createUser(data: CreateUserDto) { * return await this.repo.save(data); * } * * // Conditional eviction * @CacheEvict({ * keys: [(id) => `user:${id}`], * condition: (id, result) => result.success * }) * async updateUser(id: string, data: any) { * const result = await this.repo.update(id, data); * return { success: result.affected > 0 }; * } * } * ``` */ export declare function CacheEvict(options?: CacheEvictOptions): MethodDecorator;