import * as react_jsx_runtime from 'react/jsx-runtime'; import { ReactNode, ButtonHTMLAttributes } from 'react'; import { c as SessionState, U as UserInfo } from './types-D6m4Hact.js'; export { P as Page, a as PromptOption, S as Session } from './types-D6m4Hact.js'; interface SignInOptions { returnTo?: string; loginPath?: string; /** * OIDC `prompt` parameter for this sign-in call. * Overrides the global `isSSOEnabled` setting for this navigation. * Use `PromptOption.Login` or `PromptOption.None` for type-safe values. */ prompt?: string; } interface AuthgearProviderProps { children: ReactNode; /** Path to the userinfo API route. Defaults to "/api/auth/userinfo". */ userInfoPath?: string; /** Path to the login route. Defaults to "/api/auth/login". */ loginPath?: string; /** Path to the logout route. Defaults to "/api/auth/logout". */ logoutPath?: string; /** Path to the open-page route handler. Defaults to "/api/auth/open". */ openPagePath?: string; } declare function AuthgearProvider({ children, userInfoPath, loginPath, logoutPath, openPagePath, }: AuthgearProviderProps): react_jsx_runtime.JSX.Element; interface SignInButtonProps extends ButtonHTMLAttributes { signInOptions?: SignInOptions; } declare function SignInButton({ signInOptions, children, ...props }: SignInButtonProps): react_jsx_runtime.JSX.Element; type SignOutButtonProps = ButtonHTMLAttributes; declare function SignOutButton({ children, ...props }: SignOutButtonProps): react_jsx_runtime.JSX.Element; type UserSettingsButtonProps = ButtonHTMLAttributes; /** * A button that opens Authgear's account settings page in a new tab * for the currently authenticated user. Requires `AuthgearProvider` as an ancestor. * * Uses `GET /api/auth/open?page=/settings` under the hood — no Server Action needed. */ declare function UserSettingsButton({ children, ...props }: UserSettingsButtonProps): react_jsx_runtime.JSX.Element; interface UseAuthgearReturn { /** Current session state */ state: SessionState; /** Current user info, null if not authenticated */ user: UserInfo | null; /** Whether the initial session check has completed */ isLoaded: boolean; /** Whether the user is currently authenticated */ isAuthenticated: boolean; /** Navigate to the sign-in page */ signIn: (options?: SignInOptions) => void; /** Navigate to the sign-out endpoint */ signOut: () => void; /** Open an Authgear page (e.g. Page.Settings) in a new tab */ openPage: (path: string) => void; } declare function useAuthgear(): UseAuthgearReturn; /** Returns the current user info, or null if not authenticated. */ declare function useUser(): UserInfo | null; export { AuthgearProvider, type AuthgearProviderProps, SessionState, SignInButton, type SignInButtonProps, type SignInOptions, SignOutButton, type SignOutButtonProps, type UseAuthgearReturn, UserInfo, UserSettingsButton, type UserSettingsButtonProps, useAuthgear, useUser };