import { UseUserReturn } from "../../types/hooks.mjs";
//#region src/react/hooks/useUser.d.ts
/**
* The `useUser()` hook provides access to the current user's [`User`](https://clerk.com/docs/reference/objects/user) object, which contains all the data for a single user in your application and provides methods to manage their account. This hook also allows you to check if the user is signed in and if Clerk has loaded.
*
* @unionReturnHeadings
* ["Loading", "Signed out", "Signed in"]
*
* @example
* ### Get the current user
*
* The following example uses the `useUser()` hook to access the [`User`](https://clerk.com/docs/reference/objects/user) object, which contains the current user's data such as their full name. The `isLoaded` and `isSignedIn` properties are used to handle the loading state and to check if the user is signed in, respectively.
*
* ```tsx {{ filename: 'src/Example.tsx' }}
* import { useUser } from '@clerk/react'
*
* export default function Example() {
* const { isSignedIn, user, isLoaded } = useUser()
*
* if (!isLoaded) {
* return
Loading...
* }
*
* if (!isSignedIn) {
* return
Sign in to view this page
* }
*
* return
Hello {user.firstName}!
* }
* ```
*
* @example
* ### Update user data
*
* The following example uses the `useUser()` hook to access the [`User`](https://clerk.com/docs/reference/objects/user) object, which calls the [`update()`](https://clerk.com/docs/reference/objects/user#update) method to update the current user's information.
*
*
*
*
* ```tsx {{ filename: 'src/Home.tsx' }}
* import { useUser } from '@clerk/react'
*
* export default function Home() {
* const { isSignedIn, isLoaded, user } = useUser()
*
* if (!isLoaded) {
* // Handle loading state
* return null
* }
*
* if (!isSignedIn) return null
*
* const updateUser = async () => {
* await user.update({
* firstName: 'John',
* lastName: 'Doe',
* })
* }
*
* return (
* <>
*
*