import type { ChainNamespace } from '@reown/appkit-common-react-native'; import type { AppKit } from '../AppKit'; /** * Interface representing the return value of the useAppKit hook */ interface UseAppKitReturn { /** Function to open the AppKit modal with optional view configuration */ open: AppKit['open']; /** Function to close the AppKit modal */ close: AppKit['close']; /** Function to disconnect the wallet, optionally scoped to a specific namespace */ disconnect: (namespace?: ChainNamespace) => void; /** Function to switch to a different network */ switchNetwork: AppKit['switchNetwork']; } /** * Hook to access core AppKit functionality for controlling the modal * * @remarks * This hook provides access to the main AppKit instance methods for opening/closing * the modal, disconnecting wallets, and switching networks. All functions are memoized * and properly bound to ensure stable references across renders. * * @returns {UseAppKitReturn} An object containing: * - `open`: Opens the AppKit modal, optionally with a specific view * - `close`: Closes the AppKit modal * - `disconnect`: Disconnects the current wallet connection (optionally for a specific namespace) * - `switchNetwork`: Switches to a different blockchain network * * @throws {Error} If used outside of an AppKitProvider * @throws {Error} If AppKit instance is not available in context * * @example * ```tsx * function MyComponent() { * const { open, close, disconnect, switchNetwork } = useAppKit(); * * return ( * *