import React__default from 'react'; /** * The minimal session surface the wrapper needs — the registry-typed * createElement every session exposes. */ interface SessionLike> { createElement(type: T | { type: T; }, options: Registry[T][0]): unknown; } interface WithFallbackPropsBase { className?: string; style?: React__default.CSSProperties; onReady?: () => void; fallback?: React__default.ReactNode; } interface WithFallbackPropsRequired extends WithFallbackPropsBase { options: TOptions; } interface WithFallbackPropsOptional extends WithFallbackPropsBase { options?: TOptions; } type WithFallbackComponent = { (props: TRequired extends true ? WithFallbackPropsRequired : WithFallbackPropsOptional): React__default.ReactNode; displayName: string; type: string; }; /** * Builds a namespace-specific `withFallback` from that namespace's session * hook. The returned helper creates a React component that wraps an embedded * element with fallback support. * * @example * ```tsx * // src/wallet/with-fallback.tsx * export const withFallback = createWithFallback(useWalletSession); * * // src/wallet/elements/deposit.tsx — options type inferred from the element type * export const DepositElement = withFallback({ * displayName: "DepositElement", * type: "deposit-element", * } as const); * ``` */ declare function createWithFallback>(useSession: () => SessionLike | null): (Component: { displayName: string; type: T; }) => WithFallbackComponent; export { type WithFallbackPropsOptional, type WithFallbackPropsRequired, createWithFallback };