/**
 * useFetch - Reactive data fetching with loading/error states
 *
 * Provides a streamlined API for fetching data with automatic state management.
 *
 * @example
 * ```ts
 * // Basic fetch
 * const { data, loading, error, refresh } = useFetch('/api/users')
 *
 * // With options
 * const { data } = useFetch('/api/users', {
 *   method: 'POST',
 *   body: { name: 'John' },
 *   immediate: false, // Don't fetch immediately
 * })
 *
 * // Async data with transform
 * const { data } = useAsyncData(
 *   () => fetch('/api/users').then(r => r.json()),
 *   { transform: (data) => data.users }
 * )
 * ```
 */
export declare interface FetchOptions<T = unknown> extends Omit<RequestInit, 'body'> {
  body?: BodyInit | Record<string, unknown> | null
  baseURL?: string
  query?: Record<string, string | number | boolean | undefined>
  immediate?: boolean
  transform?: (data: unknown) => T
  parseResponse?: (response: Response) => Promise<unknown>
  timeout?: number
  retry?: number
  retryDelay?: number
  key?: string
  cacheTime?: number
  refetchOnFocus?: boolean
  refetchInterval?: number
  default?: T
}
export declare interface FetchState<T> {
  data: T | null
  loading: boolean
  error: Error | null
  status: number | null
  statusText: string | null
}
export declare interface FetchRef<T> {
  get: () => FetchState<T>
  subscribe: (fn: (state: FetchState<T>) => void) => () => void
  refresh: () => Promise<void>
  execute: () => Promise<void>
  abort: () => void
  isLoading: () => boolean
}
