import * as _angular_common_http from '@angular/common/http'; import { HttpRequest, HttpContext, HttpResponse, HttpEvent } from '@angular/common/http'; import { Observable } from 'rxjs'; import * as i0 from '@angular/core'; import { makeEnvironmentProviders } from '@angular/core'; declare class CacheBucket extends Set { } interface HttpCacheConfig { strategy: 'implicit' | 'explicit'; mode: 'stateManagement' | 'cache'; ttl: number; responseSerializer?: (value: any) => any; } declare function withConfig(config: Partial): i0.EnvironmentProviders; type CacheStorageStrategy = 'memory' | 'localStorage' | 'sessionStorage'; type CacheContextKey = string | number; interface ContextOptions { cache?: boolean; ttl?: number; key?: CacheContextKey | ((request: HttpRequest) => CacheContextKey); bucket?: CacheBucket; version?: string; clearCachePredicate?(previousRequest: HttpRequest | undefined, currentRequest: HttpRequest, key: string): boolean; context?: HttpContext; mode?: HttpCacheConfig['mode']; returnSource?: Observable>; storage?: CacheStorageStrategy; } declare function withCache(options?: ContextOptions): HttpContext; declare abstract class KeySerializer { abstract serialize(request: HttpRequest, context: ContextOptions): string; } declare class DefaultKeySerializer extends KeySerializer { serialize(request: HttpRequest, context: ContextOptions): string; } declare class RequestsQueue extends Map>> { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class RequestsCache extends Map> { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare abstract class HttpCacheVersions extends Map { } declare class HttpCacheManager { private config; private queue; private guard; private requests; private injector; private _getCacheServices; validate(key: string, strategy?: CacheStorageStrategy): boolean; get(key: string, strategy?: CacheStorageStrategy): HttpResponse; has(key: string, strategy?: CacheStorageStrategy): boolean; set(key: string, body: HttpResponse | any, { ttl, bucket, strategy }?: { ttl?: number; bucket?: CacheBucket; strategy?: CacheStorageStrategy; }): void; delete(key: string | CacheBucket, { deleteRequests, deleteVersions, strategy }?: { deleteVersions?: boolean; deleteRequests?: boolean; strategy?: CacheStorageStrategy; }): void; /** * If a strategy is provided, will clear the cache for that specific storage strategy. * Defaults to clear all storages. * @param strategy - The storage strategy to clear (memory or localStorage). */ clear(strategy?: CacheStorageStrategy): void; _getQueue(): RequestsQueue; _getRequests(): RequestsCache; _getVersions(strategy?: CacheStorageStrategy): HttpCacheVersions; _isCacheable(canActivate: boolean, cache: boolean): boolean; _set(key: string, response: HttpResponse | boolean, ttl: number, strategy?: CacheStorageStrategy): void; _canActivate(request: HttpRequest): boolean; _resolveResponse(event: HttpResponse): HttpResponse; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare abstract class HttpCacheGuard { abstract canActivate(request: HttpRequest): boolean; } declare class DefaultHttpCacheGuard implements HttpCacheGuard { canActivate(request: HttpRequest): boolean; } declare abstract class TTLManager extends Map { abstract isValid(key: string): boolean; } declare class DefaultTTLManager extends TTLManager { private config; isValid(key: string): boolean; set(key: string, ttl: number): this; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare function withHttpCacheInterceptor(): _angular_common_http.HttpInterceptorFn; declare function provideHttpCache(...extensions: Array>): ReturnType; declare function provideHttpCache(config: Partial, ...extensions: Array>): ReturnType; /** * @deprecated This provider is no longer needed. Please update your configuration to use `withLocalStorage()` instead. */ declare function provideHttpCacheLocalStorageStrategy(): i0.EnvironmentProviders; declare function withLocalStorage(): i0.EnvironmentProviders; declare function withSessionStorage(): i0.EnvironmentProviders; declare function requestDataChanged(previousRequest: HttpRequest | undefined, currentRequest: HttpRequest): boolean; declare abstract class HttpCacheStorage extends Map | boolean> { } export { CacheBucket, DefaultHttpCacheGuard, DefaultKeySerializer, DefaultTTLManager, HttpCacheGuard, HttpCacheManager, HttpCacheStorage, KeySerializer, TTLManager, provideHttpCache, provideHttpCacheLocalStorageStrategy, requestDataChanged, withCache, withConfig, withHttpCacheInterceptor, withLocalStorage, withSessionStorage };