import { LegacyTokens, OIDCError } from '../../oidc'; type CallbackProps = { /** callback function triggerred when `requestOidcToken` is successful. Use this only when you want to request the legacy tokens yourself, otherwise pass your callback to `onSignInSuccess` prop instead */ onRequestOidcTokenSuccess?: (accessToken: string, state: unknown) => void; /** callback function triggered when the OIDC authentication flow is successful */ onSignInSuccess?: (tokens: LegacyTokens, state: unknown) => void; /** callback function triggered when sign-in encounters an error */ onSignInError?: (error: Error) => void; /** URI to redirect to the callback page. This is where you should pass the callback page URL in your app .e.g. https://app.deriv.com/callback or https://smarttrader.deriv.com/en/callback */ redirectCallbackUri?: string; /** URI to redirect after authentication is completed or failed. Defaults to `config.post_login_redirect_uri` in local storage, and `window.location.origin` if local storage is not set */ postLoginRedirectUri?: string; /** URI to redirect after logout. Defaults to `config.post_logout_redirect_uri` in local storage, and `window.location.origin` if local storage is not set */ postLogoutRedirectUri?: string; /** callback function triggered when return button is clicked in error state */ onClickReturn?: (error: OIDCError) => void; /** renders the custom button for the return button when the error page is shown */ renderReturnButton?: () => React.ReactNode; }; /** * Callback component handles the OAuth callback process and token management * * @component * @param {Object} props - Component props * @param {Function} [props.onSignInSuccess] - Callback for successful sign-in * @param {Function} [props.onSignInError] - Callback for sign-in errors * @param {string} props.callbackRedirectUri - The URI for the callback page * @param {string} [props.postLogoutRedirectUri] - Post-logout redirect URI * @param {Function} [props.onClickReturn] - Callback for return button click * @param {string} [props.errorMessage] - Custom error message * * @returns {JSX.Element} Rendered component * * @example * ```jsx * handleSuccess(tokens)} * onSignInError={(error) => handleError(error)} * /> **/ export declare const Callback: ({ onClickReturn: onClickReturnCallback, onSignInSuccess, onSignInError, onRequestOidcTokenSuccess, redirectCallbackUri, postLoginRedirectUri, postLogoutRedirectUri, renderReturnButton, }: CallbackProps) => import("react/jsx-runtime").JSX.Element; export {};