UNPKG

@gdwc/drupal-state

Version:

A simple data store to manage application state sourced from Drupal's JSON:API.

18 lines (15 loc) 701 B
import { stringIndex, fetchAdapter } from '../types/types.js'; import { TJsonApiBody } from 'jsona/lib/JsonaTypes'; import DrupalState from '../DrupalState.js'; 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 };