import { ICacheBackend } from './types'; export declare type Strategy = 'api_first' | 'cache_first'; export declare type ErrorLevel = 'error' | 'warning'; export interface IDataWithCacheParams { strategy: Strategy; cache: ICacheBackend; objectType: string; objectId: string; apiTimeout?: number; cacheTimeout?: number; cacheExpires?: number; debug?: boolean; getData: () => Promise; onError?: (error: Error, level: ErrorLevel) => void; } export declare class DataWithCache { params: IDataWithCacheParams; onRefreshing?: () => void; onRefreshed?: (data: T) => any; private loading; constructor(params: IDataWithCacheParams); getData(): Promise; private apiFirst; private cacheFirst; private callGetData; private getFromCache; private setCache; private logError; private debug; }