import type { CacheDependency } from '../interfaces/cache-dependency.interface'; /** * Callback-based cache dependency * * This dependency uses a callback function to determine if cache is still valid. * When the callback's return value changes, the cache becomes invalid. * * @example * ```typescript * // Cache config, invalidate when version changes * @Cacheable({ * key: 'app:config', * dependencies: [ * new CallbackDependency(() => ConfigService.get('app.version')) * ] * }) * async getConfig() { } * * // Cache based on feature flag * @Cacheable({ * key: 'features', * dependencies: [ * new CallbackDependency(() => FeatureService.getHash()) * ] * }) * async getFeatures() { } * ``` */ export declare class CallbackDependency implements CacheDependency { private readonly callback; private readonly name?; constructor(callback: () => Promise | any, name?: string); getKey(): string; getData(): Promise; isChanged(oldData: any): Promise; /** * Deep equality check for primitive values, objects, and arrays */ private isEqual; /** * Simple hash code generation for strings */ private hashCode; }