import { type FormOfPaymentType } from '@funkit/api-base'; import type { SwappedTransport } from '../interfaces/swappedTransport'; import type { SwappedTheme } from '../utils/swapped'; import type { FunLogger } from '../utils/funLogger'; export interface UseSwappedSessionOptions { /** Platform transport (web iframe / RN WebView) implementing the contract. */ transport: SwappedTransport; /** Pre-resolved theme payload sent to the embed once it's ready. */ swappedTheme: SwappedTheme; /** * The core `FunLogger`. Web and RN both inject the same class with their own * `LogTransport` (Datadog browser-logs / Datadog RN), so the class itself is * the shared type — no separate interface needed. */ logger: FunLogger; } export interface SwappedSession { /** The embed finished its initial load. Fires once; survives method switches. */ isSwappedReady: boolean; /** Whether the embed surface should be visible / interactive. */ isActive: boolean; /** Activate for a payment method and tell the embed which method to show. */ activate: (fopType: FormOfPaymentType) => void; /** Hide the embed surface (does not reset readiness). */ deactivate: () => void; /** Tear the session back down to its initial state. */ reset: () => void; /** Ask the embed to focus its amount input. */ focusAmountInput: () => void; } /** * Platform-agnostic Swapped embed state machine, shared by web (iframe) and * React Native (WebView). Owns readiness + active state and the typed message * sends; the platform supplies the transport and the pre-built theme. * * Extracted from `@funkit/connect`'s `SwappedProvider`, which is now a thin * wrapper around this. */ export declare function useSwappedSession({ transport, swappedTheme, logger, }: UseSwappedSessionOptions): SwappedSession; //# sourceMappingURL=useSwappedSession.d.ts.map