/** * @fileoverview SWR integration for the API client */ import { type Key, type SWRConfiguration, type SWRResponse } from 'swr'; import type { ApiErrorResponse, RequestConfig, SpringBootResponse } from './types'; /** * Main SWR hook that automatically inherits auth config * @template ResponseData - Type of the expected response data * @template ErrorData - Type of the error response (defaults to ApiErrorResponse) */ export declare function useApiSWR(endpoint: Key, config?: RequestConfig & SWRConfiguration): SWRResponse; /** * Paginated SWR hook that inherits auth config * @template ItemType - Type of items in the paginated response * @template ResponseType - Type of the full response (defaults to SpringBootResponse) */ export declare function usePaginatedApiSWR>(endpoint: Key, config?: RequestConfig & SWRConfiguration): SWRResponse; /** * Mutation hook that inherits auth config * @template ResponseData - Type of the expected response data */ export declare function useApiMutation(): { post: (endpoint: string, data?: unknown, config?: RequestConfig) => Promise; put: (endpoint: string, data?: unknown, config?: RequestConfig) => Promise; patch: (endpoint: string, data?: unknown, config?: RequestConfig) => Promise; delete: (endpoint: string, config?: RequestConfig) => Promise; }; /** * Combined SWR and mutation hook * @template ResponseData - Type of the expected response data */ export declare function useApiSWRWithMutation(endpoint: Key, config?: RequestConfig & SWRConfiguration): { mutate: { post: (endpoint: string, data?: unknown, config?: RequestConfig) => Promise; put: (endpoint: string, data?: unknown, config?: RequestConfig) => Promise; patch: (endpoint: string, data?: unknown, config?: RequestConfig) => Promise; delete: (endpoint: string, config?: RequestConfig) => Promise; }; refresh: () => Promise; data: ResponseData | undefined; error: ApiErrorResponse | undefined; isValidating: boolean; isLoading: boolean; };