import React from 'react'; import type { AmountUnit } from './AmountUnitToggle/useAmountUnitToggle'; import type { TokenSwapToken } from './TokenSelectButton/TokenSelectButton'; import { type TokenSwapDepositState } from './TokenSwapCard/TokenSwapCard'; export type { TokenSwapToken }; interface TokenSwapAmounts { /** Omit when there's no token to show (e.g. nothing held). */ token?: TokenSwapToken; onTokenClick?: () => void; usdAmount: number | undefined; tokenAmount: number | undefined; /** The user's holding of `token`, in token units. */ tokenBalance?: number; } export type TokenSwapFrom = TokenSwapAmounts & TokenSwapDepositState & { /** What the user typed, in `unit`. */ inputValue: string; onInputChange: (next: string) => void; /** Omit to hide the percentage presets (e.g. nothing to take a share of); 100 is Max. */ onPercentSelect?: (percent: number) => void; }; export interface TokenSwapTo extends TokenSwapAmounts { /** Shows a skeleton in place of the amount while the quote loads. */ isLoading?: boolean; /** A press on the read-only amount shakes its row and calls this, e.g. to point to From. */ onAmountClick?: () => void; } export interface TokenSwapWidgetProps { from: TokenSwapFrom; to: TokenSwapTo; /** Unit the amounts are entered and shown in. */ unit: AmountUnit; /** Omit to hide the unit switch (e.g. price unknown). */ onToggleUnit?: () => void; /** Omit to show the swap icon as decoration only. */ onSwapDirection?: () => void; isSwapDirectionDisabled?: boolean; /** Keeps the layout but makes every control inert, e.g. while converting. */ isDisabled?: boolean; } /** * From card, swap-direction button, To card. Layout and callbacks only; the * caller owns amounts, quotes and token selection. */ export declare function TokenSwapWidget({ from, to, unit, onToggleUnit, onSwapDirection, isSwapDirectionDisabled, isDisabled, }: TokenSwapWidgetProps): React.JSX.Element; /** The swap icon as decoration only, for a widget that can't swap. */ export declare function SwapDirectionIcon(): React.JSX.Element;