/// <reference types="react" />
import { BigNumberish } from 'ethers';
import { JsonRpcProvider } from '@ethersproject/providers';
import { TokenInfo } from '@uniswap/token-lists';
export { TokenInfo } from '@uniswap/token-lists';
import { Provider } from '@web3-react/types';
export { Provider as Eip1193Provider } from '@web3-react/types';
import { ErrorInfo } from 'react';
export { Provider as EthersProvider } from '@ethersproject/abstract-provider';

interface FeeOptions {
    convenienceFee?: number;
    convenienceFeeRecipient?: string | string | {
        [chainId: number]: string;
    };
}

interface ICall {
    _to: string;
    _value: BigNumberish;
    _calldata: string;
}

interface SwapProps extends FeeOptions {
    onConnectWallet?: () => void;
    destinationChainId?: number;
    outputTokenAddress?: string;
    price: number;
    calls: ICall[];
    title?: string;
    isERC20Mode: boolean;
}

/**
 * List of all the networks supported by the Uniswap Interface
 */
declare enum SupportedChainId {
    MAINNET = 1,
    ROPSTEN = 3,
    RINKEBY = 4,
    GOERLI = 5,
    KOVAN = 42,
    ARBITRUM_ONE = 42161,
    ARBITRUM_RINKEBY = 421611,
    OPTIMISM = 10,
    OPTIMISTIC_KOVAN = 69,
    POLYGON = 137,
    POLYGON_MUMBAI = 80001,
    AVALANCHE = 43114,
    SOLANA = 12345
}

declare const SUPPORTED_LOCALES: string[];
declare type SupportedLocale = typeof SUPPORTED_LOCALES[number] | 'pseudo';

declare type ErrorHandler = (error: Error, info: ErrorInfo) => void;

declare type AllWidgetProps = {
    locale?: SupportedLocale;
    provider?: Provider | JsonRpcProvider;
    width?: string | number;
    dialog?: HTMLElement | null;
    className?: string;
    onError?: ErrorHandler;
    jsonRpcEndpoints: Partial<Record<SupportedChainId, string>>;
    destinationChainId?: SupportedChainId;
    tokenList?: TokenInfo[];
    darkMode?: boolean;
};
declare type WidgetProps = AllWidgetProps;

declare type DefaultAddress = string | {
    [chainId: number]: string | 'NATIVE';
} | 'NATIVE';
interface TokenDefaults {
    outputTokenAddress?: DefaultAddress;
    price?: number | string;
    destinationChainId?: number;
    isERC20Mode?: boolean;
}

interface Colors {
    accent: string;
    container: string;
    module: string;
    interactive: string;
    outline: string;
    dialog: string;
    primary: string;
    onAccent: string;
    secondary: string;
    hint: string;
    onInteractive: string;
    active: string;
    success: string;
    warning: string;
    error: string;
    currentColor: 'currentColor';
    borderColor: string;
    bgBoardColor: string;
    bgBoardColor2: string;
    blurSize: string;
    borderRadius: string;
    gradientBG: string;
    cardTransparency1: string;
    cardTransparency2: string;
    networkSelector: string;
}
interface Attributes {
    borderRadius: boolean | number | string;
    fontFamily: string | {
        font: string;
        variable: string;
    };
    fontFamilyCode: string;
    tokenColorExtraction: boolean;
}
interface Theme extends Partial<Attributes>, Partial<Omit<Colors, 'borderRadius'>> {
}

declare const lightTheme: Colors;
declare const darkTheme: Colors;

declare type BrydgeWidgetProps = SwapProps & WidgetProps;
declare function BrydgeWidget(props: BrydgeWidgetProps): JSX.Element;

export { BrydgeWidget, BrydgeWidgetProps, DefaultAddress, ErrorHandler, FeeOptions, ICall, SUPPORTED_LOCALES, SupportedLocale, Theme, TokenDefaults, darkTheme, lightTheme };
