import * as React from "react";
import { TwoStepEthTransaction } from "@joincivil/core";
import { EthSignedMessage, EthAddress, TxHash } from "@joincivil/typescript-types";
import { ICivilContext } from "./context";
import { Subscription } from "rxjs";
export interface TransactionButtonState {
    name: string;
    error: string;
    step: number;
    disableButton: boolean;
    currentAccount?: EthAddress;
    ethereumUpdates?: Subscription;
}
export interface TransactionButtonModalFlowState {
    modalOpen?: boolean;
    isPreTransactionModalOpen?: boolean;
    isWaitingTransactionModalOpen?: boolean;
    metaMaskRejectionModal?: boolean;
    metaMaskErrorModal?: boolean;
    completeModalOpen?: boolean;
    startTransaction?(): any;
    cancelTransaction?(): any;
}
export interface Transaction {
    progressEventName?: string;
    transaction(): Promise<TwoStepEthTransaction<any> | EthSignedMessage | void>;
    preTransaction?(): any;
    requireBeforeTransaction?(): Promise<any>;
    postTransaction?(result: any, txHash?: TxHash): any;
    handleTransactionError?(err: any, txHash?: TxHash): any;
    handleTransactionHash?(txhash?: TxHash): void;
    onTransactionError?(err: any, txHash?: TxHash): any;
}
export interface TransactionButtonProps {
    transactions: Transaction[];
    disabled?: boolean;
    Button?: React.FunctionComponent<TransactionButtonInnerProps>;
    preExecuteTransactions?(): any;
    postExecuteTransactions?(): any;
    onMobileClick?(): any;
}
export declare enum progressModalStates {
    IN_PROGRESS = "IN_PROGRESS",
    SUCCESS = "SUCCESS",
    ERROR = "ERROR"
}
export interface TransactionButtonModalContentComponentsProps {
    [index: string]: JSX.Element | undefined;
    [progressModalStates.IN_PROGRESS]?: JSX.Element | undefined;
    [progressModalStates.SUCCESS]?: JSX.Element | undefined;
    [progressModalStates.ERROR]?: JSX.Element | undefined;
}
export interface TransactionButtonModalProps {
    modalComponent?: JSX.Element;
    modalContentComponents?: TransactionButtonModalContentComponentsProps;
}
export interface TransitionButtonModalState {
    isProgressModalVisible: boolean;
    progressModalState?: string;
}
export interface TransactionButtonInnerProps {
    disabled?: boolean;
    step?: number;
    children?: React.ReactNode | React.ReactNode[];
    onClick(event?: any): void;
}
export declare const PrimaryTransactionButton: React.FunctionComponent<TransactionButtonInnerProps>;
export declare const InvertedTransactionButton: React.FunctionComponent<TransactionButtonInnerProps>;
export declare const DarkTransactionButton: React.FunctionComponent<TransactionButtonInnerProps>;
export declare class TransactionButtonNoModal extends React.Component<TransactionButtonProps, TransactionButtonState> {
    static contextType: any;
    context: ICivilContext;
    constructor(props: TransactionButtonProps);
    componentDidUpdate(prevProps: TransactionButtonProps): void;
    render(): JSX.Element;
    private onClick;
    private executeTransactions;
}
export declare class TransactionButton extends React.Component<TransactionButtonProps & TransactionButtonModalProps, TransitionButtonModalState> {
    constructor(props: TransactionButtonProps & TransactionButtonModalProps);
    render(): JSX.Element;
    private extendTransactionsHandlers;
    private getProgressModalEl;
    private showProgressModalSuccess;
    private showProgressModalError;
    private showProgressModal;
    private hideProgressModal;
}
export declare class TransactionDarkButton extends React.Component<TransactionButtonProps & TransactionButtonModalProps, TransitionButtonModalState> {
    render(): JSX.Element;
}
export declare class TransactionInvertedButton extends React.Component<TransactionButtonProps & TransactionButtonModalProps, TransitionButtonModalState> {
    render(): JSX.Element;
}
