@arteneo/forge
Version:
18 lines (17 loc) • 1.12 kB
TypeScript
import React from "react";
import { AxiosError, AxiosResponse } from "axios";
import { ButtonProps } from "../../components/Common/Button";
import TranslateVariablesInterface from "../../definitions/TranslateVariablesInterface";
import EndpointType from "../../definitions/EndpointType";
interface ButtonEndpointInterface {
endpoint: EndpointType;
onStart?: (defaultOnStart: () => void, setLoading: React.Dispatch<React.SetStateAction<boolean>>) => void;
onSuccess?: (defaultOnSuccess: () => void, response: AxiosResponse, setLoading: React.Dispatch<React.SetStateAction<boolean>>) => void;
onCatch?: (defaultOnCatch: () => void, error: AxiosError, setLoading: React.Dispatch<React.SetStateAction<boolean>>) => void;
snackbarLabel?: string;
snackbarLabelVariables?: TranslateVariablesInterface;
}
type ButtonEndpointProps = ButtonEndpointInterface & ButtonProps;
declare const ButtonEndpoint: ({ endpoint, onStart, onSuccess, onCatch, snackbarLabel, snackbarLabelVariables, ...props }: ButtonEndpointProps) => React.JSX.Element;
export default ButtonEndpoint;
export { ButtonEndpointProps };