import { state } from '../signals-api';
import type { Signal } from '../signals-api';
/**
 * Reactive fetch with loading/error states. Returns Signal-shaped state.
 */
export declare function useFetch<T = unknown>(url: string | (() => string), options?: FetchOptions<T>): FetchRef<T>;
/**
 * Generic async data fetcher. Same Signal shape as `useFetch`.
 */
export declare function useAsyncData<T>(fetcher: () => Promise<T>, options?: {
    immediate?: boolean
    transform?: (data: T) => T
    initialData?: T | null
    key?: string
    cacheTime?: number
  }): FetchRef<T>;
/**
 * POST request helper. Returns the fetch state plus an execute(body) helper.
 */
export declare function usePost<T = unknown, B = unknown>(url: string, options?: Omit<FetchOptions<T>, 'method' | 'body'>): {
    execute: (body?: B) => Promise<T | null>
    state: FetchRef<T>
  };
/** Clear fetch cache (one key or all). */
export declare function clearFetchCache(key?: string): void;
/** Prefetch data into cache. */
export declare function prefetch<T>(url: string, options?: FetchOptions<T>): Promise<void>;
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
  initialData?: T | null
}
/** Signal-shaped fetch result. Matches the runtime's `useFetch` return. */
export declare interface FetchRef<T> {
  data: Signal<T | null>
  loading: Signal<boolean>
  error: Signal<Error | null>
  status: Signal<number | null>
  statusText: Signal<string | null>
  refetch: () => Promise<void>
  execute: () => Promise<void>
  abort: () => void
}
