UNPKG

ng-http-caching

Version:

Cache for HTTP requests in Angular application.

28 lines (27 loc) 1.3 kB
import { NgHttpCachingStorageInterface } from './ng-http-caching-storage.interface'; import { NgHttpCachingEntry } from '../ng-http-caching.service'; import { HttpRequest, HttpResponse } from '@angular/common/http'; export interface NgHttpCachingStorageEntry { url: string; response: string; request: string; addedTime: number; version: string; } export declare const serializeRequest: (req: HttpRequest<any>) => string; export declare const serializeResponse: (res: HttpResponse<any>) => string; export declare const deserializeRequest: <T = any>(req: string) => HttpRequest<T>; export declare const deserializeResponse: <T = any>(res: string) => HttpResponse<T>; export declare class NgHttpCachingBrowserStorage implements NgHttpCachingStorageInterface { private storage; constructor(storage: Storage); get size(): number; clear(): void; delete(key: string): boolean; forEach(callbackfn: (value: NgHttpCachingEntry, key: string) => void): void; get(key: string): Readonly<NgHttpCachingEntry> | undefined; has(key: string): boolean; set(key: string, value: NgHttpCachingEntry): void; protected serialize(value: NgHttpCachingEntry): NgHttpCachingStorageEntry; protected deserialize(value: NgHttpCachingStorageEntry): NgHttpCachingEntry; }