export { ConsumeHandoffTokenOptions, CreateHandoffRouteHandlerOptions, HandoffFailure, HandoffFailureReason, HandoffResult, HandoffSuccess, HandoffUser, MultiAccountAutoAddError, MultiAccountAutoAddOptions, SwitcherApi, consumeHandoffToken, createHandoffRouteHandler, multiAccountAutoAdd } from './server.js'; import * as react_jsx_runtime from 'react/jsx-runtime'; import '../types-CXDDCs0b.js'; interface HandoffLandingProps { /** Override the splash text. */ splash?: string; /** Where to send the user if the URL is missing required params. Default `/login`. */ loginPath?: string; /** * How long to wait for `` to initialize its * PostMessage client AND complete the iframe handshake before giving up with * `handoff_provider_missing`. * * The provider creates the client in a mount effect (which runs *after* this * child mounts) and the iframe handshake is asynchronous, so HandoffLanding * must poll for readiness rather than bail on first render. Default 8000ms. */ providerReadyTimeoutMs?: number; } /** * The page consumers drop at `app/auth/handoff/landing/page.tsx`: * * ```tsx * 'use client'; * import { HandoffLanding } from '@benbraide/auth-service-nextjs/sharing'; * export default function Page() { return ; } * ``` * * Reads `account_uuid`, `session_token`, `next`, `toast` from the URL (set by * the F2 route handler), waits for the provider's PostMessage client to be * ready (iframe registered + handshake complete), runs `multiAccountAutoAdd`, * then redirects to `${next}?_toast=${toast}` so the arriving page's * `HandoffArrivalToast` can show the banner. * * Requirements on the consumer: * - This page must be rendered inside ``. * - An `` iframe must be mounted somewhere in that tree so the * provider's client has a registered iframe + completed handshake to post to. */ declare function HandoffLanding({ splash, loginPath, providerReadyTimeoutMs, }: HandoffLandingProps): react_jsx_runtime.JSX.Element; interface PrepResultLike { prepId: string; embedUrl: string; expiresAt?: string | null; status: string; } interface PrepEmbedSignedEvent { prepId: string; } interface PrepEmbedFailedEvent { prepId: string; error: string; message?: string; } interface PrepEmbedProps { prepResult: PrepResultLike; onSigned?: (e: PrepEmbedSignedEvent) => void; onFailed?: (e: PrepEmbedFailedEvent) => void; /** Optional CSS height. Defaults to 600px. */ height?: string | number; /** Optional CSS width. Defaults to 100%. */ width?: string | number; /** Override the iframe `title` attr for a11y. Defaults to "Signing surface". */ title?: string; /** Restrict accepted postMessage origins. Defaults to the embed URL's origin. */ expectedOrigin?: string; } /** * Drop-in iframe wrapper for the orchestrator side of Prep–Sign–Promote. * Renders the peer's signing iframe + listens for the prep-signed / * prep-sign-failed messages. * * ```tsx * const prep = await fetch('/api/prepare-portify-agreement').then(r => r.json()); * return promote(prepId)} />; * ``` * * Pair with `Sharing::prepare` on the PHP orchestrator. On `onSigned`, the * orchestrator's flow should: (1) take payment, (2) `Sharing::shareUser` * to create the auth-service share, (3) `Sharing::promote` to flip the * peer's temp record into a permanent record. */ declare function PrepEmbed({ prepResult, onSigned, onFailed, height, width, title, expectedOrigin, }: PrepEmbedProps): react_jsx_runtime.JSX.Element; export { HandoffLanding, type HandoffLandingProps, PrepEmbed, type PrepEmbedFailedEvent, type PrepEmbedProps, type PrepEmbedSignedEvent, type PrepResultLike };