import { HttpRequest, HttpResponse } from '@angular/common/http'; import { Environment } from '../env'; import { MessageService } from './message.service'; import { Cachable, RequestCache } from './request-cache.service'; /** * A service that implements the cachable URL request. */ export declare class CachableUrl implements Cachable { private _env; constructor(_env: Environment); /** * Returns a number greater than zero if the specified request is cachable; * that number represents the maximum cache age in milliseconds. * Return zero if the specified request is NOT cachable. * @param req The outgoing request object to handle. */ isCachable(req: HttpRequest): number; } /** * Represents the request cache entry. */ export interface RequestCacheEntry { /** * Returns the request URL. */ url: string; /** * Returns the request cache. */ response: HttpResponse; /** * Returns the maximum cache age in milliseconds. */ maxAgeInCache: number; /** * Returns the last read of the request URL. */ lastRead: number; } /** * A service that implements the request cache with the different time using `Map` collection. */ export declare class RequestCacheDifferentTimeWithMap implements RequestCache { private _messageService; private _cache; constructor(_messageService: MessageService); get(req: HttpRequest): HttpResponse | undefined; set(req: HttpRequest, maxAgeInCache: number, response: HttpResponse): void; } /** * A provider for the cachable URL request. */ export declare const CACHABLE_URL_PROVIDER: { 'provide': typeof Cachable; 'useClass': typeof CachableUrl; 'multi': boolean; }[]; /** * A provider for the request cache with the different time using `Map` collection. */ export declare const REQUEST_CACHE_DIFFERENT_TIME_WITH_MAP_PROVIDER: { 'provide': typeof RequestCache; 'useClass': typeof RequestCacheDifferentTimeWithMap; 'multi': boolean; }[];