import { AuthConfig, DeepPartial } from '@better-auth-ui/core'; import { QueryClient } from '@tanstack/react-query'; import { PropsWithChildren, ReactNode } from 'react'; import { AuthClient } from '../../lib/auth-client'; declare module "@better-auth-ui/core" { interface AuthConfig { /** * The auth client to use for the authentication context. * @remarks `AuthClient` */ authClient: AuthClient; } /** Widen `AdditionalField.label` to `ReactNode` in the React package. */ interface AdditionalFieldRegister { label: ReactNode; } } export type AuthProviderProps = PropsWithChildren> & { authClient: TAuthClient; navigate: (options: { to: string; replace?: boolean; }) => void; /** TanStack QueryClient to use for your application's queries */ queryClient?: QueryClient; }; /** * Provides merged authentication configuration and a resolved React Query client to descendant components. * * The component merges the provided auth config with the library defaults, updates `redirectTo` from the * current URL when the app is hydrated, wires a QueryClient (prop, context, or fallback) and installs an * error handler that surfaces query errors via the configured toast. It then supplies the merged config * via AuthContext and wraps children with QueryClientProvider. * * @returns The children wrapped with AuthContext.Provider and QueryClientProvider configured for auth. */ export declare function AuthProvider({ children, queryClient, ...config }: AuthProviderProps): import("react").JSX.Element; /** * Accesses the current authentication configuration from AuthContext. * * UI packages widen the plugin type globally via the `Register` interface * (see module augmentation in `@better-auth-ui/heroui`), so callers don't * need to pass a generic. * * @returns The merged authentication configuration provided by AuthProvider. * @throws If no AuthProvider is present in the component tree. */ export declare function useAuth(): AuthConfig;