import { HttpClient } from '@angular/common/http'; import { HttpAdapter, HttpRequest, HttpResponse } from '@nauth-toolkit/client'; import * as i0 from "@angular/core"; /** * HTTP adapter for Angular using HttpClient. * * This adapter: * - Uses Angular's HttpClient for all requests * - Works with Angular's HTTP interceptors (including authInterceptor) * - Auto-provided via Angular DI (providedIn: 'root') * - Converts HttpClient responses to HttpResponse format * - Converts HttpErrorResponse to NAuthClientError * * Users don't need to configure this manually - it's automatically * injected when using AuthService in Angular apps. * * @example * ```typescript * // Automatic usage (no manual setup needed) * // AuthService automatically injects AngularHttpAdapter * constructor(private auth: AuthService) {} * ``` */ export declare class AngularHttpAdapter implements HttpAdapter { private readonly http; constructor(http: HttpClient); /** * Safely parse a JSON response body. * * Angular's fetch backend (`withFetch()`) will throw a raw `SyntaxError` if * `responseType: 'json'` is used and the backend returns HTML (common for * proxies, 502 pages, SSR fallbacks, or misrouted requests). * * To avoid crashing consumer apps, we always request as text and then parse * JSON only when the response actually looks like JSON. * * @param bodyText - Raw response body as text * @param contentType - Content-Type header value (if available) * @returns Parsed JSON value (unknown) * @throws {SyntaxError} When body is non-empty but not valid JSON */ private parseJsonBody; /** * Execute HTTP request using Angular's HttpClient. * * @param config - Request configuration * @returns Response with parsed data * @throws NAuthClientError if request fails */ request(config: HttpRequest): Promise>; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }