import { HttpResponse } from '@angular/common/http'; import { ResourceBase } from '../resource/resource'; /** * Enum for response object markers. */ export declare enum ResourceCacheItemMarker { CACHED = "__cached_response__", PREPOPULATED = "__prepopulated_response__" } /** * Class definition for items on the cache. An item on the cache needs to hold the actual response from the * HTTP call, the resource used to make the HTTP call and the action options of the method used for * the HTTP call. */ export declare class ResourceCacheItem { protected _response: HttpResponse; protected _resource: ResourceBase; protected _ttl: number; protected _timestamp: number; constructor(_response: HttpResponse, _resource: ResourceBase, _ttl: number); /** * Gets a clone of the HTTP response we got from the HTTP call. * @returns {HttpResponse} */ get response(): HttpResponse; /** * Gets the resource used for the HTTP call. * @returns {ResourceBase} */ get resource(): ResourceBase; /** * Gets the timestamp the cache item was created at. * @returns {number} */ get timestamp(): number; /** * Gets if the cache item is already stale (exceeded its TTL). * @returns {boolean} */ get stale(): boolean; } export declare class PrepopulatedResourceCacheItem extends ResourceCacheItem { /** * Gets a clone of the HTTP response we got from the HTTP call. * @returns {HttpResponse} */ get response(): HttpResponse; } export declare type ResourceCacheItemPromisable = ResourceCacheItem | Promise;