zsa-react-query
Advanced tools
+6
-4
@@ -9,3 +9,3 @@ import * as _tanstack_react_query from '@tanstack/react-query'; | ||
| declare const createServerActionsKeyFactory: <const TKeys extends string[], const TFactory extends ServerActionsKeyFactory<TKeys>>(factory: TFactory) => TFactory; | ||
| declare const setupServerActionHooks: <const TFactory extends Readonly<ServerActionsKeyFactory<string[]>> | undefined>(args: { | ||
| declare const setupServerActionHooks: <const TQueryFactory extends Readonly<ServerActionsKeyFactory<string[]>> | undefined, const TMutationFactory extends Readonly<ServerActionsKeyFactory<string[]>> | undefined>(args: { | ||
| hooks: { | ||
@@ -16,5 +16,6 @@ useQuery: typeof _tanstack_react_query.useQuery; | ||
| }; | ||
| queryKeyFactory?: TFactory; | ||
| queryKeyFactory?: TQueryFactory; | ||
| mutationKeyFactory?: TMutationFactory; | ||
| }) => { | ||
| useServerActionInfiniteQuery: <TPageParam extends unknown, THandler extends TAnyZodSafeFunctionHandler, TInitialData extends inferServerActionReturnData<THandler> | (() => inferServerActionReturnData<THandler>) | undefined>(action: THandler, options: Omit<_tanstack_react_query.UseInfiniteQueryOptions<inferServerActionReturnData<THandler>, inferServerActionError<THandler>, InfiniteData<inferServerActionReturnData<THandler>, unknown>, inferServerActionReturnData<THandler>, TFactory extends undefined ? readonly unknown[] : Readonly<ReturnType<Exclude<TFactory, undefined>[keyof Exclude<TFactory, undefined>]>>, TPageParam>, "initialData" | "getNextPageParam"> & { | ||
| useServerActionInfiniteQuery: <TPageParam extends unknown, THandler extends TAnyZodSafeFunctionHandler, TInitialData extends inferServerActionReturnData<THandler> | (() => inferServerActionReturnData<THandler>) | undefined>(action: THandler, options: Omit<_tanstack_react_query.UseInfiniteQueryOptions<inferServerActionReturnData<THandler>, inferServerActionError<THandler>, InfiniteData<inferServerActionReturnData<THandler>, unknown>, inferServerActionReturnData<THandler>, TQueryFactory extends undefined ? readonly unknown[] : Readonly<ReturnType<Exclude<TQueryFactory, undefined>[keyof Exclude<TQueryFactory, undefined>]>>, TPageParam>, "initialData" | "getNextPageParam"> & { | ||
| input: (args: { | ||
@@ -26,3 +27,3 @@ pageParam: TPageParam; | ||
| }, queryClient?: _tanstack_react_query.QueryClient | undefined) => _tanstack_react_query.UseInfiniteQueryResult<InfiniteData<inferServerActionReturnData<THandler>, unknown>, inferServerActionError<THandler>>; | ||
| useServerActionQuery: <THandler_1 extends TAnyZodSafeFunctionHandler, TInitialData_1 extends inferServerActionReturnData<THandler_1> | (() => inferServerActionReturnData<THandler_1>) | undefined>(action: THandler_1, options: Omit<_tanstack_react_query.UseQueryOptions<inferServerActionReturnData<THandler_1>, inferServerActionError<THandler_1>, inferServerActionReturnData<THandler_1>, TFactory extends undefined ? readonly unknown[] : Readonly<ReturnType<Exclude<TFactory, undefined>[keyof Exclude<TFactory, undefined>]>>>, "queryFn" | "initialData"> & { | ||
| useServerActionQuery: <THandler_1 extends TAnyZodSafeFunctionHandler, TInitialData_1 extends inferServerActionReturnData<THandler_1> | (() => inferServerActionReturnData<THandler_1>) | undefined>(action: THandler_1, options: Omit<_tanstack_react_query.UseQueryOptions<inferServerActionReturnData<THandler_1>, inferServerActionError<THandler_1>, inferServerActionReturnData<THandler_1>, TQueryFactory extends undefined ? readonly unknown[] : Readonly<ReturnType<Exclude<TQueryFactory, undefined>[keyof Exclude<TQueryFactory, undefined>]>>>, "queryFn" | "initialData"> & { | ||
| input: inferServerActionInput<THandler_1>; | ||
@@ -33,2 +34,3 @@ initialData?: TInitialData_1 | undefined; | ||
| returnError?: TReturnError | undefined; | ||
| mutationKey?: (TMutationFactory extends undefined ? readonly unknown[] : Readonly<ReturnType<Exclude<TMutationFactory, undefined>[keyof Exclude<TMutationFactory, undefined>]>>) | undefined; | ||
| }) | undefined, queryClient?: _tanstack_react_query.QueryClient | undefined) => _tanstack_react_query.UseMutationResult<TReturnError extends false ? inferServerActionReturnData<THandler_2> : Awaited<ReturnType<THandler_2>>, inferServerActionError<THandler_2>, inferServerActionInput<THandler_2>, unknown>; | ||
@@ -35,0 +37,0 @@ }; |
+6
-4
@@ -9,3 +9,3 @@ import * as _tanstack_react_query from '@tanstack/react-query'; | ||
| declare const createServerActionsKeyFactory: <const TKeys extends string[], const TFactory extends ServerActionsKeyFactory<TKeys>>(factory: TFactory) => TFactory; | ||
| declare const setupServerActionHooks: <const TFactory extends Readonly<ServerActionsKeyFactory<string[]>> | undefined>(args: { | ||
| declare const setupServerActionHooks: <const TQueryFactory extends Readonly<ServerActionsKeyFactory<string[]>> | undefined, const TMutationFactory extends Readonly<ServerActionsKeyFactory<string[]>> | undefined>(args: { | ||
| hooks: { | ||
@@ -16,5 +16,6 @@ useQuery: typeof _tanstack_react_query.useQuery; | ||
| }; | ||
| queryKeyFactory?: TFactory; | ||
| queryKeyFactory?: TQueryFactory; | ||
| mutationKeyFactory?: TMutationFactory; | ||
| }) => { | ||
| useServerActionInfiniteQuery: <TPageParam extends unknown, THandler extends TAnyZodSafeFunctionHandler, TInitialData extends inferServerActionReturnData<THandler> | (() => inferServerActionReturnData<THandler>) | undefined>(action: THandler, options: Omit<_tanstack_react_query.UseInfiniteQueryOptions<inferServerActionReturnData<THandler>, inferServerActionError<THandler>, InfiniteData<inferServerActionReturnData<THandler>, unknown>, inferServerActionReturnData<THandler>, TFactory extends undefined ? readonly unknown[] : Readonly<ReturnType<Exclude<TFactory, undefined>[keyof Exclude<TFactory, undefined>]>>, TPageParam>, "initialData" | "getNextPageParam"> & { | ||
| useServerActionInfiniteQuery: <TPageParam extends unknown, THandler extends TAnyZodSafeFunctionHandler, TInitialData extends inferServerActionReturnData<THandler> | (() => inferServerActionReturnData<THandler>) | undefined>(action: THandler, options: Omit<_tanstack_react_query.UseInfiniteQueryOptions<inferServerActionReturnData<THandler>, inferServerActionError<THandler>, InfiniteData<inferServerActionReturnData<THandler>, unknown>, inferServerActionReturnData<THandler>, TQueryFactory extends undefined ? readonly unknown[] : Readonly<ReturnType<Exclude<TQueryFactory, undefined>[keyof Exclude<TQueryFactory, undefined>]>>, TPageParam>, "initialData" | "getNextPageParam"> & { | ||
| input: (args: { | ||
@@ -26,3 +27,3 @@ pageParam: TPageParam; | ||
| }, queryClient?: _tanstack_react_query.QueryClient | undefined) => _tanstack_react_query.UseInfiniteQueryResult<InfiniteData<inferServerActionReturnData<THandler>, unknown>, inferServerActionError<THandler>>; | ||
| useServerActionQuery: <THandler_1 extends TAnyZodSafeFunctionHandler, TInitialData_1 extends inferServerActionReturnData<THandler_1> | (() => inferServerActionReturnData<THandler_1>) | undefined>(action: THandler_1, options: Omit<_tanstack_react_query.UseQueryOptions<inferServerActionReturnData<THandler_1>, inferServerActionError<THandler_1>, inferServerActionReturnData<THandler_1>, TFactory extends undefined ? readonly unknown[] : Readonly<ReturnType<Exclude<TFactory, undefined>[keyof Exclude<TFactory, undefined>]>>>, "queryFn" | "initialData"> & { | ||
| useServerActionQuery: <THandler_1 extends TAnyZodSafeFunctionHandler, TInitialData_1 extends inferServerActionReturnData<THandler_1> | (() => inferServerActionReturnData<THandler_1>) | undefined>(action: THandler_1, options: Omit<_tanstack_react_query.UseQueryOptions<inferServerActionReturnData<THandler_1>, inferServerActionError<THandler_1>, inferServerActionReturnData<THandler_1>, TQueryFactory extends undefined ? readonly unknown[] : Readonly<ReturnType<Exclude<TQueryFactory, undefined>[keyof Exclude<TQueryFactory, undefined>]>>>, "queryFn" | "initialData"> & { | ||
| input: inferServerActionInput<THandler_1>; | ||
@@ -33,2 +34,3 @@ initialData?: TInitialData_1 | undefined; | ||
| returnError?: TReturnError | undefined; | ||
| mutationKey?: (TMutationFactory extends undefined ? readonly unknown[] : Readonly<ReturnType<Exclude<TMutationFactory, undefined>[keyof Exclude<TMutationFactory, undefined>]>>) | undefined; | ||
| }) | undefined, queryClient?: _tanstack_react_query.QueryClient | undefined) => _tanstack_react_query.UseMutationResult<TReturnError extends false ? inferServerActionReturnData<THandler_2> : Awaited<ReturnType<THandler_2>>, inferServerActionError<THandler_2>, inferServerActionInput<THandler_2>, unknown>; | ||
@@ -35,0 +37,0 @@ }; |
+1
-1
| { | ||
| "name": "zsa-react-query", | ||
| "version": "0.2.0", | ||
| "version": "0.2.1", | ||
| "publishConfig": { | ||
@@ -5,0 +5,0 @@ "access": "public" |
15544
4.98%215
0.94%