import { stringIndex, fetchAdapter } from '../types/types.cjs';
import { TJsonApiBody } from 'jsona/lib/JsonaTypes';
import DrupalState from '../DrupalState.cjs';
import 'http';
import 'drupal-jsonapi-params';
import 'zustand/vanilla';

/**
 * Fetch a token from Drupal
 * @param apiUrl the api url for the JON:API endpoint
 * @param tokenFetchBody object containing body parameters for the token request
 * @param fetch fetch compatible function
 * @returns a promise containing the token api response
 */
declare const fetchToken: (apiUrl: string, tokenFetchBody: stringIndex, fetch?: fetchAdapter, onError?: DrupalState['onError']) => Promise<void | TJsonApiBody>;

export { fetchToken as default };
