import type { AxiosError } from "axios"; import type { UseQueryResult, DefaultError } from "@tanstack/react-query"; import type { FlexibleConciergeConfig } from "../../../types/concierge"; import type { FunctionlessUseQueryOptions } from "../../../types/tanstack-query"; import type { DirectionalConfig, DirectionalResult } from "../../../types/pagination"; import type { DatalessAxiosRequestConfig, ServerData, Methodless, AbortControllerless } from "../../../types/axios"; /** Forces the `GET` request to not have a payload. */ export type UseDirectionalRetrievePayload = void; /** * Represents the error speficically raised by Axios. * * @template E The error. */ export type UseDirectionalRetrieveHTTPError = AxiosError; /** * Represents the exception raised by `queryFn` - either a standard error or an * Axios error. * * @template E The error. */ export type UseDirectionalRetrieveException = DefaultError | UseDirectionalRetrieveHTTPError; /** * `useDirectionalRetrieve` hook configuration. It can be used to perform * directional pagination. Offers `useQuery`, Axios, concierge and Query * Concierge configurations separately. * * @template R The response. * @template P The URL parameters. * @template E The error. */ export type UseDirectionalRetrieveOptions = FlexibleConciergeConfig & { /** `useQuery` configuration without `queryFn`. */ reactQuery: FunctionlessUseQueryOptions, UseDirectionalRetrieveException>; /** Axios configuration with no data, method & signal. */ axios?: AbortControllerless>>; /** Custom pagination configuration. */ rules: DirectionalConfig; }; /** * `useDirectionalRetrieve` hook result. fromServeres TanStack Query's `useQuery` * result. * * @template R The response. * @template E The error. */ export type UseDirectionalRetrieveResult = UseQueryResult, UseDirectionalRetrieveException> & { /** Custom results. */ extra: DirectionalResult; }; /** * `useDirectionalRetrieve` hook factory configuration. It can be used to create * a `useDirectionalRetrieve` wrapper. Offers `useQuery`, Axios and concierge * configurations separately. * * @template R The response. * @template P The URL parameters. * @template E The error. */ export type UseDirectionalRetrieveFactory = Omit, "rules">;