UNPKG

react-http-fetch

Version:

An http library for React JS built on top of native JS fetch

47 lines (46 loc) 1.23 kB
import { HttpCacheStore } from './http-cache-store'; import { HttpCacheEntry } from './types'; export declare class HttpCacheStorePrefixDecorator implements HttpCacheStore { /** * The label use to prefix any entry identifier. */ private prefix; /** * The label used to separate the prefix and the entry identifier. */ private separator; /** * The http cache store to decorate. */ private store; constructor(store: HttpCacheStore, prefix?: string, separator?: string); /** * Computes the entry identifier by concatenating the store prefix with * the base identifier. */ private getPrefixedIdentifier; /** * @inheritdoc */ get<HttpResponseT>(entryIdentifier: string): HttpCacheEntry<HttpResponseT> | undefined; /** * @inheritdoc */ put<HttpResponseT>(entryIdentifier: string, entry: HttpCacheEntry<HttpResponseT>): () => void; /** * @inheritdoc */ has(entryIdentifier: string): boolean; /** * @inheritdoc */ delete(entryIdentifier: string): void; /** * @inheritdoc */ entries(): HttpCacheEntry<unknown>[]; /** * @inheritdoc */ flush(): void; }