import * as http from 'http';
import { ServerResponse } from 'http';
import { fetchAdapter } from '../types/types.cjs';
import DrupalState from '../DrupalState.cjs';
import 'jsona/lib/JsonaTypes';
import 'drupal-jsonapi-params';
import 'zustand/vanilla';

/**
 * fetch data from a JSON:API endpoint
 * @param apiUrl the api url for the JSON:API endpoint
 * @param requestInit fetch initialization object
 * @param onError custom error handler defaults to throw error
 * @param res response object
 * @param fetch fetch compatible function
 * @returns a promise containing the data for the JSON:API response
 */
declare const fetchJsonapiEndpoint: (apiUrl: string, requestInit?: {}, onError?: DrupalState['onError'], res?: boolean | ServerResponse<http.IncomingMessage> | undefined, fetch?: fetchAdapter) => Promise<void | Response>;

export { fetchJsonapiEndpoint as default };
