import { HttpException } from '../core/http-exception.js'; import type { VovkFetcher, VovkFetcherOptions } from '../types/client.js'; import type { VovkHandlerSchema } from '../types/core.js'; import type { VovkValidateOnClient } from '../types/validation.js'; export type { HttpException, VovkFetcher, VovkFetcherOptions, VovkHandlerSchema, VovkValidateOnClient }; type CreateFetcherOnSuccess = (respData: unknown, options: VovkFetcherOptions, info: { response: Response; init: RequestInit; schema: VovkHandlerSchema; }) => void | Promise; type CreateFetcherOnError = (error: HttpException, options: VovkFetcherOptions, info: { response: Response | null; init: RequestInit | null; respData: unknown | null; schema: VovkHandlerSchema; }) => void | Promise; type CreatedFetcher = VovkFetcher> & { onSuccess(cb: CreateFetcherOnSuccess): () => void; onError(cb: CreateFetcherOnError): () => void; }; /** * Creates a customizable fetcher function for client requests. * @see https://vovk.dev/imports */ export declare function createFetcher({ prepareRequestInit, transformResponse, onSuccess: onSuccessInit, onError: onErrorInit, }?: { prepareRequestInit?: (init: RequestInit, options: VovkFetcherOptions) => RequestInit | Promise; transformResponse?: (respData: unknown, options: VovkFetcherOptions, info: { response: Response; init: RequestInit; schema: VovkHandlerSchema; }) => unknown | Promise; onSuccess?: CreateFetcherOnSuccess; onError?: CreateFetcherOnError; }): CreatedFetcher; /** * Default fetcher implementation for client requests. * @see https://vovk.dev/imports */ export declare const fetcher: CreatedFetcher;