import type { SchemaType } from '@dream2023/data-mapping'; import type { AxiosRequestConfig } from 'axios'; import type { Key } from 'react'; export declare type AxiosType = (options: any) => Promise; export declare type ErrorNotifyType = undefined | ((msg?: string, error?: ErrorData, params?: any) => void); export declare type SuccessNotifyType = undefined | ((msg?: string, data?: any, params?: any) => void); export interface SuperAxiosRequestConfig extends AxiosRequestConfig { response?: SchemaType; replaceData?: boolean; data?: Record | SchemaType; params?: Record | SchemaType; } export declare type ApiFunction = (data: Record, params: Record, contextData: Record) => any; export declare type ApiType = string | SuperAxiosRequestConfig | ApiFunction; export interface RequestMessage { success?: string; error?: string; } export declare type ErrorData = Error & { message?: string; errors?: Record; }; export declare type ErrorCallback = (e: ErrorData, params?: any) => void; export declare type SuccessCallback = (data?: any, params?: any) => void; export interface AxiosContextProps { axios?: AxiosType; errorNotify?: ErrorNotifyType; successNotify?: SuccessNotifyType; }