import type { CacheableOptions } from '../interfaces'; /** * Check if current environment is development or test * In these environments, missing cache service should throw explicit errors */ declare function isDevOrTestEnv(): boolean; /** * Set global CacheService instance * Called by CacheModule during initialization */ export declare function setCacheService(cacheService: any): void; /** * Get global CacheService instance */ export declare function getCacheService(): any; /** * Export for testing purposes * @internal */ export { isDevOrTestEnv }; /** * @Cacheable decorator - Cache method results * * This decorator automatically caches the return value of a method. * On subsequent calls with the same arguments, the cached value is returned. * * @param options - Cacheable options * * @example * ```typescript * class UserService { * @Cacheable({ * key: (id) => `user:${id}`, * ttl: 300_000, // 5 minutes * layers: [CacheLayer.MEMORY, CacheLayer.REDIS] * }) * async getUserById(id: string) { * return await this.repo.findOne({ where: { id } }); * } * * // With dependencies * @Cacheable({ * key: (id) => `user:${id}:profile`, * dependencies: [ * new DbDependency('SELECT updated_at FROM users WHERE id = ?', (id) => [id]) * ] * }) * async getUserProfile(id: string) { * return await this.fetchProfile(id); * } * } * ``` */ export declare function Cacheable(options?: CacheableOptions): MethodDecorator;