/**
 * Represents an authenticated user.
 */
export interface User {
  id: string;
  email?: string;
  name?: string;
  roles?: string[];
  scopes?: string[];
  metadata?: Record<string, unknown>;
}

/**
 * Authentication state.
 */
export interface AuthState {
  /** The authenticated user, or null if not authenticated */
  user: User | null;
  /** Whether authentication state is being loaded */
  isLoading: boolean;
  /** Whether the user is authenticated */
  isAuthenticated: boolean;
  /** Any authentication error */
  error: Error | null;
}

/**
 * Login credentials for username/password authentication.
 */
export interface LoginCredentials {
  email: string;
  password: string;
}

/**
 * Token response from the authentication API.
 */
export interface TokenResponse {
  access_token: string;
  refresh_token?: string;
  token_type: string;
  expires_in: number;
}
