UNPKG

@obliczeniowo/elementary

Version:
27 lines (26 loc) 830 B
import { CacheItem } from '../public-api'; export interface CacheOptions<Res = any, Ext = any> { /** * collect - collecting response body as table, maxSize parameter controls max size of table * reload - force to reload cache (send request) */ type?: 'collect' | 'reload'; /** * Work with type='collect' */ maxSize?: number; data?: any; name?: string; external?: Ext; withCacheItem?: boolean; /** list of keys to clear */ clear?: string[]; /** list of keys to retrigger */ retrigger?: string[]; convert?: (data: Res) => any; reloadOn?: (data: CacheItem<Res, Ext>) => boolean; } export declare class CacheModel<Res = any, Ext = any> { options?: CacheOptions<Res, Ext> | undefined; constructor(options?: CacheOptions<Res, Ext> | undefined); }