UNPKG

nestjs-resilience

Version:

A module for improving the reliability and fault-tolerance of your NestJS applications

16 lines (15 loc) 655 B
import { Cache } from 'cache-manager'; import { ResilienceModuleOptions } from './interfaces'; export declare class ResilienceStatesManager { readonly options?: ResilienceModuleOptions; private static readonly PREFIX; private static instance; static getInstance(): ResilienceStatesManager; readonly cache: Cache; constructor(options?: ResilienceModuleOptions); del(key: string): Promise<boolean>; get<T>(key: string): Promise<T>; reset(): Promise<boolean>; set<T>(key: string, value: T, ttl?: number): Promise<T>; wrap<T>(key: string, fn: () => Promise<T>, ttl?: number | ((value: T) => number)): Promise<T>; }