import React from 'react'; import { UseAuthCallbackOptions } from '../hooks/useAuthCallback'; export interface AuthCallbackProps extends UseAuthCallbackOptions { /** * Component to render while processing the callback. * @default null */ loadingComponent?: React.ReactNode; /** * Component to render when authentication fails. * Receives the error as a prop. */ errorComponent?: React.ComponentType<{ error: Error; }> | React.ReactNode; /** * Component to render when authentication succeeds. * Receives the returnUrl as a prop. */ successComponent?: React.ComponentType<{ returnUrl: string | null; }> | React.ReactNode; /** * Children to render when this is not a callback page. */ children?: React.ReactNode; } /** * Component for handling OAuth callback pages in hybrid mode. * * Drop this component into your callback route and it handles everything: * - Detecting if this is a callback page * - Processing the authorization code * - Exchanging tokens with your backend * - Calling onSuccess/onError callbacks * * @example * ```tsx * // Simple usage with navigation * function OAuthCallbackPage() { * const navigate = useNavigate(); * * return ( * navigate(returnUrl || '/')} * onError={(error) => console.error(error)} * loadingComponent={} * errorComponent={({ error }) => {error.message}} * /> * ); * } * * // Or in routes directly * window.location.assign(url || '/')} * loadingComponent={} * /> * } /> * ``` */ export declare function AuthCallback({ loadingComponent, errorComponent, successComponent, children, ...options }: AuthCallbackProps): React.ReactNode; /** * Simple callback page that auto-redirects on success. * Use this when you just want the callback handled with minimal UI. * * @example * ```tsx * } * /> * } /> * ``` */ export declare function SimpleAuthCallback({ defaultRedirect, loginPage, loadingComponent, errorComponent, }: { /** URL to redirect to if no returnUrl is available */ defaultRedirect?: string; /** URL to redirect to if verifier is missing (page refreshed) */ loginPage?: string; /** Component to show while processing */ loadingComponent?: React.ReactNode; /** Component to show on error */ errorComponent?: React.ComponentType<{ error: Error; }> | React.ReactNode; }): React.ReactNode; //# sourceMappingURL=AuthCallback.d.ts.map