import * as i0 from '@angular/core';
import { Injectable } from '@angular/core';
import { retry, timer, catchError, throwError } from 'rxjs';

class GlobalHttpErrorHandlerInterceptor {
    intercept(request, next) {
        const countNumber = 2;
        const retryCountNumber = 100;
        return next.handle(request).pipe(retry({
            count: countNumber,
            delay: (_, retryCount) => timer(retryCount * retryCountNumber),
        }), catchError((error) => {
            return throwError(error);
        }));
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GlobalHttpErrorHandlerInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GlobalHttpErrorHandlerInterceptor }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GlobalHttpErrorHandlerInterceptor, decorators: [{
            type: Injectable
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { GlobalHttpErrorHandlerInterceptor };
//# sourceMappingURL=testlocallibrary-shared-kernel-services-global-http-error-handler.mjs.map
