@cute-dw/core
Version:
This TypeScript library is the main part of a more powerfull package designed for the fast WEB software development. The cornerstone of the library is the **DataStore** class, which might be useful when you need a full control of the data, but do not need
25 lines (24 loc) • 1.13 kB
TypeScript
import { HttpClient, HttpErrorResponse } from "@angular/common/http";
import { Observable, ObservableInput } from "rxjs";
import * as i0 from "@angular/core";
export type HttpRetryOptions = {
count: number;
delay: number;
};
/**
* Wrapper class for Angular's HttpClient class
*/
export declare class HttpService {
private _http;
constructor(_http: HttpClient);
/** Internal `HttpClient` object */
get httpClient(): HttpClient;
/** Default error handler function */
handleError: (err: HttpErrorResponse, caught: Observable<any>) => ObservableInput<any>;
get<T = any>(url: string, options?: Object, retries?: HttpRetryOptions): Observable<T>;
delete<T = any>(url: string, options?: Object, retries?: HttpRetryOptions): Observable<T>;
post<T = any>(url: string, body: any, options?: Object, retries?: HttpRetryOptions): Observable<T>;
put<T = any>(url: string, body: any, options?: Object, retries?: HttpRetryOptions): Observable<T>;
static ɵfac: i0.ɵɵFactoryDeclaration<HttpService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<HttpService>;
}