import { createContext } from 'react'; import type { SessionData } from '../api/types'; import type { KnownAccount } from './accounts'; export interface AuthState { loading: boolean; session: SessionData | null; authError: string | null; accounts: KnownAccount[]; login: (handle: string) => Promise; loginWithPassword: (service: string, identifier: string, password: string) => Promise; loginAsTest: () => Promise; logout: () => void; removeAccount: (did: string) => Promise; switchAccount: (did: string) => Promise; addAccount: (handle: string) => Promise; clearError: () => void; } export const AuthContext = createContext(null);