import { AppApiInfo } from 'fastapi-rtk/api-types'; import { Adapters } from '../adapters/types'; import { SigninCredentials } from './types'; /** * Sign in a user using the provided credentials. * * @param adapters - Platform adapters used to dispatch the request and drive the active auth transport. * @param baseUrl - The base URL of the authentication endpoint. * @param credentials - The user's sign in credentials. * @returns Resolves when the user is signed in. * @throws {Error} Throws an error if the sign in fails. */ export declare function authSignin(adapters: Adapters, baseUrl: string, credentials: SigninCredentials): Promise; /** * Sign out the current user. * * @param adapters - Platform adapters used to dispatch the request and drive the active auth transport. * @param baseUrl - The base URL of the authentication endpoint. * @returns Resolves when the user is logged out. * @throws {Error} Throws an error if the sign out fails. */ export declare function authSignout(adapters: Adapters, baseUrl: string): Promise; /** * Resets the user's password by requesting a reset token and then using it to set a new password. * * @param adapters - Platform adapters used to dispatch the request. * @param baseUrl - The base URL of the API. * @param newPassword - The new password to set. * @param param - An object containing the user's email. * @throws Will throw an error if the reset-token request or the password reset fails. * @returns A promise that resolves when the password has been reset. */ export declare function authResetPassword(adapters: Adapters, baseUrl: string, newPassword: string, { email }: { email: string; }): Promise; /** * Initiates an OAuth sign-in process with the specified provider. * * @param adapters - Platform adapters; the popup/redirect flow itself runs through `adapters.oauthOpener`. * @param baseUrl - The base URL of the authentication server. * @param provider - The OAuth provider to use for sign-in (e.g., 'google', 'facebook'). * @param popup - Whether to use a popup window for the sign-in process. * @param afterSigninPopup - Optional callback function to be called after the popup is closed, or after the sign-in * completes when the opener hands back the redirect URL. * @returns Resolves once the popup has been opened (or, non-popup, the redirect has been issued); when the opener * hands back the URL the provider redirected to, resolves once `authOAuthCallback` has completed the sign-in. * @throws {Error} Throws an error if the backend rejects the handed-back callback. */ export declare function authOAuthSignin(adapters: Adapters, baseUrl: string, provider: string, popup: boolean, afterSigninPopup?: () => void): Promise; /** * Completes an OAuth sign-in on the page the provider redirected back to, by forwarding its query * (`code`, `state`) to the backend callback and persisting the returned login through the auth transport. * * @param adapters - Platform adapters used to dispatch the request and drive the active auth transport. * @param baseUrl - The base URL of the authentication server. * @param provider - The OAuth provider the sign-in was started with (e.g., 'google'). * @param callbackQuery - The query string the provider redirected back with, with or without the leading `?`. * @returns Resolves when the user is signed in. * @throws {Error} Throws an error if the backend rejects the callback. */ export declare function authOAuthCallback(adapters: Adapters, baseUrl: string, provider: string, callbackQuery: string): Promise; /** * Fetches authentication information for the user. * * @param adapters - Platform adapters used to dispatch the request. * @param baseUrl - The base URL of the API. * @param signal - An AbortSignal to allow aborting the fetch request. * @returns The authentication information of the user. * @throws {Error} If the fetch request fails or the response is not ok. */ export declare function authInfo(adapters: Adapters, baseUrl: string, signal?: AbortSignal): Promise;