UNPKG

angular-odata

Version:

Client side OData typescript library for Angular

36 lines (35 loc) 1.06 kB
import { ODataRequest, ODataResponse } from '../resources'; import { ODataCache } from './cache'; export declare class ODataInStorageCache extends ODataCache { name: string; storage: Storage; constructor({ name, storage, timeout, }: { timeout?: number; name: string; storage?: Storage; }); /** * Store the cache in the storage */ store(): void; /** * Restore the cache from the storage */ restore(): void; /** * Flush the cache and clean the storage */ flush(): void; /** * Store the response in the cache * @param req The request with the resource to store the response * @param res The response to store in the cache */ putResponse(req: ODataRequest<any>, res: ODataResponse<any>): void; /** * Restore the response from the cache * @param req The request with the resource to get the response * @returns The response from the cache */ getResponse(req: ODataRequest<any>): ODataResponse<any> | undefined; }