import type { CacheDependency } from '../interfaces/cache-dependency.interface'; /** * File-based cache dependency * * This dependency monitors file modification time. When the file is modified, * the cache becomes invalid. * * Useful for configuration files, templates, or other file-based resources. * * @example * ```typescript * // Cache template, invalidate when template file changes * @Cacheable({ * key: (name) => `template:${name}`, * dependencies: [ * new FileDependency((name) => `./templates/${name}.html`) * ] * }) * async getTemplate(name: string) { } * * // Cache config, invalidate when config file changes * @Cacheable({ * key: 'app:config', * dependencies: [ * new FileDependency('./config/app.json') * ] * }) * async getConfig() { } * ``` */ export declare class FileDependency implements CacheDependency { private readonly filePath; constructor(filePath: string | ((...args: any[]) => string)); getKey(): string; getData(): Promise<{ path: string; mtime: number; size: number; }>; isChanged(oldData: { path: string; mtime: number; size: number; } | null): Promise; /** * Resolve the file path (handle dynamic paths) */ private resolveFilePath; }