export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; export type AuthMode = 'none' | 'cookie' | 'bearer'; export type RequestOptions = { method?: HttpMethod; body?: B; query?: Record; headers?: Record; auth?: AuthMode; // 'cookie' | 'bearer' | 'none' token?: string; // required if auth === 'bearer' timeoutMs?: number; }; export class HttpError extends Error { constructor( public status: number, public code?: string, public data?: unknown ) { super(`HTTP ${status}${code ? ` ${code}` : ''}`); } }