import type ApiCaller from '../Contracts/ApiCaller'; import qs from 'qs'; import type { Method, CustomHeaders } from '../Calliope/Concerns/CallsApi'; import type { ApiResponse } from '../Contracts/HandlesApiResponse'; /** * The default ApiCaller implementation used by upfrontjs. * * @link {ApiCaller} */ export default class API implements ApiCaller { /** * Enable indexing object by strings. */ [index: string]: CallableFunction | qs.IStringifyOptions | Record; /** * The settings for the parsing of the get parameters. * * @protected * * @see https://www.npmjs.com/package/qs */ protected readonly getParamEncodingOptions: qs.IStringifyOptions; /** * The implementation of the expected call method. * * @inheritDoc */ call(url: string, method: 'CONNECT' | 'connect' | 'HEAD' | 'head' | 'OPTIONS' | 'options' | 'TRACE' | 'trace', data?: FormData | Record, customHeaders?: CustomHeaders, queryParameters?: Record): Promise; call(url: string, method: Method, data?: FormData | Record, customHeaders?: CustomHeaders, queryParameters?: Record): Promise>; /** * Prepare/compile the ajax call initialisation. * * @param {string} url - The endpoint the request goes to. * @param {Method} method - The method the request uses. * @param {object=} data - The optional data to send with the request. * @param {object=} customHeaders - Custom headers to merge into the request. * @param {object=} queryParameters - The query parameters to append to the url * * @return {object} * * @protected */ protected initConfig(url: string, method: Method, data?: FormData | Record, customHeaders?: CustomHeaders, queryParameters?: Record): Promise<{ url: string; requestInit: RequestInit; }>; } //# sourceMappingURL=API.d.ts.map