import type { CachePutOptions } from '../interfaces'; /** * @CachePut decorator - Update cache with method result * * This decorator always executes the method and updates the cache with the result. * Unlike @Cacheable which skips method execution if cache exists, @CachePut * always runs the method and updates cache afterwards. * * Useful for update operations where you want to refresh the cache. * * @param options - Cache put options * * @example * ```typescript * class UserService { * @CachePut({ * key: (id) => `user:${id}`, * ttl: 300_000 * }) * async updateUser(id: string, data: UpdateUserDto) { * await this.repo.update(id, data); * return await this.repo.findOne({ where: { id } }); * } * * // Conditional cache update * @CachePut({ * key: (id) => `user:${id}`, * condition: (id, data) => data.important === true * }) * async updateUserProfile(id: string, data: any) { * return await this.repo.update(id, data); * } * } * ``` */ export declare function CachePut(options?: CachePutOptions): MethodDecorator;