Skip to main content

Module: @ts-rest/react-query

Type Aliases​

DataResponse​

Ƭ DataResponse<TAppRoute>: ClientInferResponses<TAppRoute, SuccessfulHttpStatusCode, "force">

Type parameters​

NameType
TAppRouteextends AppRoute

Defined in​

lib/types.ts:21


ErrorResponse​

Ƭ ErrorResponse<TAppRoute>: ClientInferResponses<TAppRoute, ErrorHttpStatusCode, "ignore">

Type parameters​

NameType
TAppRouteextends AppRoute

Defined in​

lib/types.ts:28


InitClientReturn​

Ƭ InitClientReturn<T, TClientArgs>: { [TKey in keyof T]: T[TKey] extends AppRoute ? Without<AppRouteFunctions<T[TKey], TClientArgs>, never> : T[TKey] extends AppRouter ? InitClientReturn<T[TKey], TClientArgs> : never }

Type parameters​

NameType
Textends AppRouter
TClientArgsextends ClientArgs

Defined in​

lib/react-query.ts:152


UseInfiniteQueryOptions​

Ƭ UseInfiniteQueryOptions<TAppRoute, TData>: TanStackUseInfiniteQueryOptions<DataResponse<TAppRoute>, ErrorResponse<TAppRoute>, TData>

Type parameters​

NameType
TAppRouteextends AppRoute
TDataDataResponse<TAppRoute>

Defined in​

lib/types.ts:48


UseInfiniteQueryResult​

Ƭ UseInfiniteQueryResult<TAppRoute, TData>: TanStackUseInfiniteQueryResult<TData, ErrorResponse<TAppRoute>>

Type parameters​

NameType
TAppRouteextends AppRoute
TDataDataResponse<TAppRoute>

Defined in​

lib/types.ts:57


UseMutationOptions​

Ƭ UseMutationOptions<TAppRoute, TClientArgsOrClient>: TanStackUseMutationOptions<DataResponse<TAppRoute>, ErrorResponse<TAppRoute>, TClientArgsOrClient extends ClientArgs ? PartialClientInferRequest<TAppRoute, TClientArgsOrClient> : TClientArgsOrClient extends InitClientReturn<any, any> ? PartialClientInferRequest<TAppRoute, InferClientArgs<TClientArgsOrClient>> : never, unknown>

Type parameters​

NameType
TAppRouteextends AppRoute
TClientArgsOrClientextends ClientArgs | InitClientReturn<any, any>

Defined in​

lib/types.ts:67


UseMutationResult​

Ƭ UseMutationResult<TAppRoute, TClientArgsOrClient>: TanStackUseMutationResult<DataResponse<TAppRoute>, ErrorResponse<TAppRoute>, TClientArgsOrClient extends ClientArgs ? PartialClientInferRequest<TAppRoute, TClientArgsOrClient> : TClientArgsOrClient extends InitClientReturn<any, any> ? PartialClientInferRequest<TAppRoute, InferClientArgs<TClientArgsOrClient>> : never, unknown>

Type parameters​

NameType
TAppRouteextends AppRoute
TClientArgsOrClientextends ClientArgs | InitClientReturn<any, any>

Defined in​

lib/types.ts:81


UseQueryOptions​

Ƭ UseQueryOptions<TAppRoute, TData>: TanStackUseQueryOptions<DataResponse<TAppRoute>, ErrorResponse<TAppRoute>, TData>

Type parameters​

NameType
TAppRouteextends AppRoute
TDataDataResponse<TAppRoute>

Defined in​

lib/types.ts:34


UseQueryResult​

Ƭ UseQueryResult<TAppRoute, TData>: TanStackUseQueryResult<TData, ErrorResponse<TAppRoute>>

Type parameters​

NameType
TAppRouteextends AppRoute
TDataDataResponse<TAppRoute>

Defined in​

lib/types.ts:43

Functions​

initQueryClient​

â–¸ initQueryClient<T, TClientArgs>(router, clientArgs): InitClientReturn<T, TClientArgs>

Type parameters​

NameType
Textends AppRouter
TClientArgsextends ClientArgs

Parameters​

NameType
routerT
clientArgsTClientArgs

Returns​

InitClientReturn<T, TClientArgs>

Defined in​

lib/react-query.ts:165


useTsRestQueryClient​

â–¸ useTsRestQueryClient<T, TClientArgs>(client): InitUseTsRestQueryClientReturn<T, TClientArgs>

Type parameters​

NameType
Textends AppRouter
TClientArgsextends ClientArgs

Parameters​

NameType
clientInitClientReturn<T, TClientArgs>

Returns​

InitUseTsRestQueryClientReturn<T, TClientArgs>

Defined in​

lib/react-query.ts:325