export interface ApiError {
  message: string;
  code?: string;
  details?: unknown;
  status: number;
}

export interface ApiRequestOptions extends RequestInit {
  skipErrorHandling?: boolean;
  skipRetry?: boolean;
  cache?: RequestCache;
  cacheTTL?: number; // in milliseconds
  retryCount?: number;
  retryDelay?: number; // in milliseconds
}

export interface ApiResponse<T = unknown> {
  data: T;
  status: number;
  headers: Headers;
}

export type RequestInterceptor = (config: RequestInit) => RequestInit | Promise<RequestInit>;
export type ResponseInterceptor = (response: Response) => Response | Promise<Response>;
export type ErrorInterceptor = (error: ApiError) => ApiError | Promise<ApiError>;

