import { QueryKey, UseInfiniteQueryOptions, UseMutationOptions, UseQueryOptions } from '@tanstack/react-query';
import { NiceAxiosError } from '@/shared/@types/error';

export type QueryOptions<
  TQueryFnData = unknown,
  TError = NiceAxiosError,
  TData = TQueryFnData,
  TQueryKey extends QueryKey = QueryKey,
> = Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'queryKey' | 'queryFn' | 'initialData'>;

export type MutationOptions<TVariables = unknown, TError = NiceAxiosError, TData = void, TContext = unknown> = Omit<
  UseMutationOptions<TData, TError, TVariables, TContext>,
  'mutationKey' | 'mutationFn'
>;

export type InfiniteQueryOptions<
  TQueryFnData = unknown,
  TError = NiceAxiosError,
  TData = TQueryFnData,
  TQueryKey extends QueryKey = QueryKey,
  TPageParam = unknown,
> = Omit<
  UseInfiniteQueryOptions<
    TQueryFnData, 
    TError, 
    TData, 
    TQueryKey, 
    TPageParam
  >,
  'queryKey' | 'queryFn' | 'initialData' | 'getNextPageParam' | 'initialPageParam'
>;
