import { BreezeConfig } from '../config/config.js'; import type { AjaxAdapter, AjaxConfig, AjaxRequestInterceptor, BreezeFetch } from '../config/interface-registry.js'; import type { HttpResponse } from '../manager/entity-manager.js'; /** The transport used when none is supplied. Wrapped so that `fetch` keeps its receiver, which some environments require. */ export declare const defaultFetch: BreezeFetch; /** Breeze's description of one request, without the callbacks. */ export type HttpRequestConfig = Omit; /** The outcome of one request. Failures are values, not rejections. */ export interface HttpOutcome { succeeded: boolean; httpResponse: HttpResponse; } /** Turns Breeze's description of a request into the arguments for a fetch call. */ export declare function toFetchArgs(request: HttpRequestConfig): { url: string; init: RequestInit; }; /** * Sends one request and resolves with its outcome. Never rejects: a transport failure is * reported with status 0, and a body that cannot be read with the real HTTP status. */ export declare function sendFetch(fetchFn: BreezeFetch, url: string, init: RequestInit, request: HttpRequestConfig): Promise; /** * Ajax adapter using the fetch API. * * @deprecated Breeze 3 needs no ajax adapter: requests go through `config.fetch`, set with * `configureBreeze({ fetch })`. This class is kept so that 2.x startup code - `register()`, * `configureBreeze({ ajax: AjaxFetchAdapter })`, `config.initializeAdapterInstance('ajax', * 'fetch')` - and code using `defaultSettings` or `requestInterceptor` keeps working. It is * not scheduled for removal. */ export declare class AjaxFetchAdapter implements AjaxAdapter { static adapterName: string; name: string; defaultSettings: { headers?: { [name: string]: string; }; }; requestInterceptor?: AjaxRequestInterceptor; /** The function used to make the request. Defaults to `globalThis.fetch`. */ fetchFn: BreezeFetch; constructor(fetchFn?: BreezeFetch); /** * @param breezeConfig - defaults to the global breeze config * @param fetchFn - the transport this adapter uses. Defaults to `globalThis.fetch`. */ static register(breezeConfig?: BreezeConfig, fetchFn?: BreezeFetch): AjaxFetchAdapter; initialize(): void; ajax(ajaxConfig: AjaxConfig): void; }