UNPKG

@obliczeniowo/elementary

Version:
48 lines (47 loc) 1.89 kB
import { HttpClient, HttpContext, HttpHeaders, HttpParams } from '@angular/common/http'; import { Observable } from 'rxjs'; import { CacheOptions } from '../models/cache.model'; import { CacheItem } from './cache.service'; import * as i0 from "@angular/core"; export interface HttpClientOptions { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>; }; responseType?: 'json'; reportProgress?: boolean; withCredentials?: boolean; cache?: CacheOptions; } export declare class HttpCacheService { http: HttpClient; constructor(http: HttpClient); request<R>(method: string, url: string, options?: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>; }; responseType?: 'json'; reportProgress?: boolean; withCredentials?: boolean; cache?: CacheOptions; }): Observable<R>; get<R>(url: string, options?: HttpClientOptions): Observable<R>; patch<R>(url: string, body: any, options?: HttpClientOptions): Observable<R>; post<R>(url: string, body: any, options?: HttpClientOptions): Observable<R>; put<R>(url: string, body: any, options?: HttpClientOptions): Observable<R>; delete<R>(url: string, options?: HttpClientOptions): Observable<R>; retrigger(cacheItem: CacheItem<any> | undefined): void; static ɵfac: i0.ɵɵFactoryDeclaration<HttpCacheService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<HttpCacheService>; }