import { HttpErrorResponse } from '@angular/common/http'; import { Router } from '@angular/router'; import { Observable } from 'rxjs'; import { TranslateService } from '@ngx-translate/core'; import { AlertService } from './alert.service'; import * as i0 from "@angular/core"; /** Type of the handleError function returned by HttpErrorHandler.createHandleError */ export type HandleError = (operation?: string, result?: T, show?: boolean) => (error: HttpErrorResponse) => Observable; export type HandleErrorResult = (operation?: string, result?: T, show?: boolean) => (error: HttpErrorResponse) => Observable; /** Handles HttpClient errors */ export declare class HttpErrorHandler { private readonly alert; private readonly translate; private readonly router; constructor(alert: AlertService, translate: TranslateService, router: Router); /** Create curried handleError function that already knows the service name */ createHandleError: (serviceName?: string) => (operation?: string, result?: T, show?: boolean) => (response: HttpErrorResponse) => Observable; createHandleErrorResult: (serviceName?: string) => (operation?: string, result?: T, show?: boolean) => (response: HttpErrorResponse) => Observable; /** * Returns a function that handles Http operation failures. * This error handler lets the app continue to run as if no error occurred. * @param serviceName = name of the data service that attempted the operation * @param operation - name of the operation that failed * @param result - optional value to return as the observable result * @param show - optional value to show error */ handleError(serviceName?: string, operation?: string, result?: T, show?: boolean): (response: HttpErrorResponse) => Observable; /** * Returns a function that handles Http operation failures. * This error handler lets the app continue to run as if no error occurred. * @param serviceName = name of the data service that attempted the operation * @param operation - name of the operation that failed * @param result - optional value to return as the observable result * @param show - optional value to show error */ handleErrorResult(serviceName?: string, operation?: string, result?: T, show?: boolean): (response: HttpErrorResponse) => Observable; private showError; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }