import { CACHE_MANAGER , CacheManagerOptions , Inject , Injectable } from '@nestjs/common' ; export interface ICacheManager { store ? : any ; get < T > ( key ) : Promise < T > ; set < T > ( key , value , options ? ) : Promise < T > ; del ( key ) : Promise < void > ; } @ Injectable ( ) export class CacheService { private cache ! : ICacheManager ; constructor ( @ Inject ( CACHE_MANAGER ) cache ) { this . cache = cache ; } get < T > ( key ) { return this . cache . get ( key ) ; } set < T > ( key , value , options ? ) { return this . cache . set ( key , value , options ) ; } del ( key ) { return this . cache . del ( key ) ; } }