/** Parameters extracted from the OAuth callback URL. */
export interface OAuthCallbackParams {
    /** The authorization code returned by the OAuth provider. */
    readonly code: string;
    /** The opaque state token used to correlate the callback with the originating request. */
    readonly state: string;
}
/** Props for {@link OAuthCallbackHandler}. */
export interface OAuthCallbackHandlerProps {
    /**
     * Fallback callback invoked when the page was opened as a regular
     * navigation (no `window.opener`), meaning the popup `postMessage`
     * path cannot be used.
     *
     * Receives the extracted `code` and `state` so the host application
     * can complete the OAuth flow via its own routing logic.
     *
     * When omitted and `window.opener` is unavailable, the component
     * renders an instructional message asking the user to close the tab.
     */
    readonly onFallback?: (params: OAuthCallbackParams) => void;
    /** Additional CSS classes for the root container. */
    readonly className?: string;
}
/**
 * Lightweight component for OAuth callback pages.
 *
 * Render this component at the URL configured as your OAuth redirect
 * URI (`STIGMER_OAUTH_REDIRECT_URI`). It extracts the `code` and
 * `state` query parameters from the current URL, posts them back to
 * the opener window via `window.postMessage`, and closes the popup.
 *
 * The component handles three scenarios:
 * 1. **Popup with opener** (primary): posts the message and closes.
 * 2. **No opener, `onFallback` provided**: calls the fallback with
 *    the extracted parameters so the host app can handle them.
 * 3. **No opener, no fallback**: shows a message asking the user to
 *    return to the main window.
 *
 * Platform builders create a route in their application that renders
 * this component:
 *
 * @example
 * ```tsx
 * // app/auth/oauth/callback/page.tsx (Next.js)
 * import { OAuthCallbackHandler } from "@stigmer/react";
 *
 * export default function OAuthCallbackPage() {
 *   return <OAuthCallbackHandler />;
 * }
 * ```
 */
export declare function OAuthCallbackHandler({ onFallback, className, }: OAuthCallbackHandlerProps): import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=OAuthCallbackHandler.d.ts.map