UNPKG

ngx-pwa

Version:

Provides functionality around the progressive web app functionality in angular. Most notably the an approach to cache POST, UPDATE and DELETE requests.

19 lines (18 loc) 936 B
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'; import { Observable } from 'rxjs'; import { NgxPwaOfflineService } from './offline.service'; import * as i0 from "@angular/core"; /** * An interceptor that caches any POST, UPDATE or DELETE requests when the user is offline. */ export declare class OfflineRequestInterceptor<OfflineServiceType extends NgxPwaOfflineService> implements HttpInterceptor { private readonly offlineService; constructor(offlineService: OfflineServiceType); intercept<T>(req: HttpRequest<T>, next: HttpHandler): Observable<HttpEvent<T>>; private getRequestMetadata; private requestShouldBeCached; private requestMethodIsPostPatchOrDelete; private urlShouldNotBeCached; static ɵfac: i0.ɵɵFactoryDeclaration<OfflineRequestInterceptor<any>, never>; static ɵprov: i0.ɵɵInjectableDeclaration<OfflineRequestInterceptor<any>>; }