import { ColdObservable } from 'rxjs'; export interface AjaxConfig { url: string; body?: unknown; headers?: Record; async?: boolean; crossDomain?: boolean; withCredentials?: boolean; method?: string; timeout?: number; responseType?: XMLHttpRequestResponseType; user?: string; password?: string; xsrfCookieName?: string; xsrfHeaderName?: string; queryParams?: unknown; includeDownloadProgress?: boolean; includeUploadProgress?: boolean; createXHR?: () => XMLHttpRequest; } export interface AjaxRequest { url: string; body: unknown; headers: Record; async: boolean; crossDomain: boolean; withCredentials: boolean; method: string; timeout: number; responseType: XMLHttpRequestResponseType; user?: string; password?: string; xsrfCookieName?: string; xsrfHeaderName?: string; queryParams?: unknown; includeDownloadProgress: boolean; includeUploadProgress: boolean; } /** * Creates an `XMLHttpRequest` observable that emits `AjaxResponse` values, * replicating the behavior of the removed `rxjs/ajax` `fromAjax` factory * using the Web Platform Observable (`ColdObservable`) model. * * @param {AjaxConfig} init - The request configuration. * @returns {ColdObservable>} A cold observable that performs the request per subscription. */ export declare function fromXMLHttpRequest(init: AjaxConfig): ColdObservable>; /** * Resolves with the last value emitted by the observable before completion. * * @template T * @param {Subscribable} source$ - The observable to subscribe to. * @returns {Promise} A promise that resolves with the last emitted value. */ export declare function lastValueFrom(source$: Subscribable): Promise; export declare class AjaxResponse { originalEvent: Event; xhr: XMLHttpRequest; request: AjaxRequest; type: string; status: number; responseType: string; responseHeaders: Record; response: T; loaded: number; total: number; constructor(originalEvent: Event, xhr: XMLHttpRequest, request: AjaxRequest, type?: string); } export declare class AjaxError extends Error { name: string; xhr: XMLHttpRequest; request: AjaxRequest; status: number; responseType: string; response: unknown; constructor(message: string, xhr: XMLHttpRequest, request: AjaxRequest); } export declare class AjaxTimeoutError extends AjaxError { constructor(xhr: XMLHttpRequest, request: AjaxRequest); }