import { createContext } from 'react';
import type { AppUser } from '../types';

export interface AuthContextType {
    appUser: AppUser | null;
    isLoading: boolean;
    isSignedIn: boolean;
    error: string | null;
    isAdmin: () => boolean;
    isUser: () => boolean;
    isGuest: () => boolean;
    isDeveloper: () => boolean;
    canEdit: () => boolean;
    refetchUser: () => Promise<void>;
    signInWithPassword: (password: string) => Promise<boolean>;
}

export const AuthContext = createContext<AuthContextType | undefined>(undefined);
