import React, { type ReactNode } from 'react'; import { type ConvertView } from '../domains/convert/view'; import { FunCheckoutStep } from '../modals/CheckoutModal/FunCheckoutStep'; import type { FunkitActiveCheckoutItem } from './FunkitCheckoutContext'; export declare const CONVERT_QUOTE_INPUT_DEBOUNCE_MS = 300; /** How long the success label shows before the screen returns to Convert. */ export declare const CONVERT_SUCCESS_RESET_MS = 2000; /** How long the success label shows before the modal closes, when the host asks for that. */ export declare const CONVERT_SUCCESS_CLOSE_MS = 3000; export interface ConvertContextValue { /** Everything the Convert screens render. */ view: ConvertView; editAmount: (inputValue: string) => void; /** Flips USD and token entry at the live price. */ toggleUnit: () => void; setMax: (maxBaseUnits: bigint) => void; /** Fills a share of the source balance; 100 is Max. */ selectPercent: (percent: number) => void; /** Keys are `convertAssetKey`s. A different source drops the amount. */ pickSource: (sourceKey: string) => void; pickDestination: (destinationKey: string) => void; swapDirection: () => void; /** Converts the quote on screen; the host's callbacks hear the outcome. */ convert: () => void; /** Asks again for whatever failed: a host lookup, else the quote. */ retry: () => void; } export declare function useConvert(): ConvertContextValue; interface ConvertProviderProps { checkoutItem: FunkitActiveCheckoutItem; /** The modal's step: live reads run only on a Convert screen or mid-conversion. */ step: FunCheckoutStep; onClose: () => void; children: ReactNode; } /** * Convert's draft, live reads and submission for the whole checkout modal, so * they outlive the screens: the token screens and a tab switch unmount them. * Without a Convert config it renders its children only. */ export declare function ConvertProvider({ checkoutItem, step, onClose, children, }: ConvertProviderProps): React.JSX.Element; export {};