import type { ChainTypeEnum, OAuthProvider, ThirdPartyAuthConfiguration } from '@openfort/openfort-js'; import type React from 'react'; import type { Chain } from 'viem'; import type { useConnectCallbackProps } from '../../openfort/connectCallbackTypes.js'; import type { CustomTheme, Languages, Mode, SDKOverrides, Theme } from '../../types.js'; import type { BuyFormState, DebugModeOptions, OpenfortUIOptionsExtended, OpenfortWalletConfig, RouteOptions, SendFormState, SetRouteOptions, SignRequest } from './types.js'; type Connector = { id: string; type?: 'wallet'; } | { id: OAuthProvider; type: 'oauth'; }; /** Look and feel of the modal. Changes only when the host app re-themes it. */ export type ThemeContextValue = { setTheme: React.Dispatch>; mode: Mode; setMode: React.Dispatch>; setCustomTheme: React.Dispatch>; lang: Languages; setLang: React.Dispatch>; }; /** Which screen the modal shows and how it got there. */ export type RoutingContextValue = { chainType: ChainTypeEnum; setChainType: (chainType: ChainTypeEnum) => void; open: boolean; setOpen: (value: boolean) => void; route: RouteOptions; setRoute: (options: SetRouteOptions) => void; onBack: (() => void) | null; setOnBack: React.Dispatch void) | null>>; headerLeftSlot: React.ReactNode | null; setHeaderLeftSlot: React.Dispatch>; previousRoute: RouteOptions | null; setPreviousRoute: () => void; routeHistory: RouteOptions[]; setRouteHistory: React.Dispatch>; connector: Connector; setConnector: React.Dispatch>; resize: number; triggerResize: () => void; }; /** * Draft input that outlives a single screen: the auth flows hand an address or * code between pages, and the send/buy flows build a transfer across several. * Kept apart from routing so a keystroke does not re-render the whole modal. */ export type FormContextValue = { emailInput: string; setEmailInput: React.Dispatch>; phoneInput: string; setPhoneInput: React.Dispatch>; sendForm: SendFormState; setSendForm: React.Dispatch>; buyForm: BuyFormState; setBuyForm: React.Dispatch>; }; /** In-flight request consumed by the signature-confirmation flow. */ export type SignRequestContextValue = { /** In-flight message/typed-data sign request driving the Sign message screen. */ signRequest: SignRequest | null; setSignRequest: React.Dispatch>; }; /** Values fixed by the props passed to OpenfortProvider. */ export type ConfigContextValue = { debugMode: Required; publishableKey: string; uiConfig: OpenfortUIOptionsExtended; walletConfig?: OpenfortWalletConfig; overrides?: SDKOverrides; thirdPartyAuth?: ThirdPartyAuthConfiguration; /** Configured EVM chains (from wagmi bridge or walletConfig.ethereum). Empty when not EVM. */ chains: Chain[]; } & useConnectCallbackProps; export type ContextValue = ThemeContextValue & RoutingContextValue & FormContextValue & SignRequestContextValue & ConfigContextValue; export declare const ThemeStateContext: React.Context; export declare const RoutingContext: React.Context; export declare const FormContext: React.Context; export declare const SignRequestContext: React.Context; export declare const OpenfortContext: React.Context; export {};