import { createContext } from 'react'
import { AuthToken, User } from '../api'
import { IUser } from '@/api/resources/User'

export interface AuthContextValue {
  user: User.User | null
  token: AuthToken
  logout: () => void
  signUp: (token: AuthToken, user: User.User, newUser?: IUser, isAnonymous?: boolean) => AuthToken
}

export const AuthContext = createContext<AuthContextValue>({} as AuthContextValue)
