@arteneo/forge
Version:
16 lines (15 loc) • 1.13 kB
TypeScript
import React from "react";
import { AxiosError, AxiosResponse } from "axios";
import { ButtonProps } from "../../components/Common/Button";
import EndpointType from "../../definitions/EndpointType";
interface ButtonMultiEndpointInterface {
endpoints: EndpointType[];
onStart?: (defaultOnStart: () => void, setLoading: React.Dispatch<React.SetStateAction<boolean>>) => void;
onFinish?: (defaultOnFinish: () => void, setLoading: React.Dispatch<React.SetStateAction<boolean>>, cancelled: boolean) => void;
onSuccess?: (defaultOnSuccess: () => void, key: number, response: AxiosResponse, setLoading: React.Dispatch<React.SetStateAction<boolean>>) => void;
onCatch?: (defaultOnCatch: () => void, key: number, error: AxiosError, setLoading: React.Dispatch<React.SetStateAction<boolean>>, cancelled: boolean) => void;
}
type ButtonMultiEndpointProps = ButtonMultiEndpointInterface & ButtonProps;
declare const ButtonMultiEndpoint: ({ endpoints, onStart, onFinish, onSuccess, onCatch, ...props }: ButtonMultiEndpointProps) => React.JSX.Element;
export default ButtonMultiEndpoint;
export { ButtonMultiEndpointProps };