@openapi-qraft/tanstack-query-react-types 2.0.0-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/cjs/index.cjs +3 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperation.d.ts +98 -0
- package/dist/types/service-operation/ServiceOperation.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationCancelQueries.d.ts +9 -0
- package/dist/types/service-operation/ServiceOperationCancelQueries.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationFetchInfiniteQuery.d.ts +9 -0
- package/dist/types/service-operation/ServiceOperationFetchInfiniteQuery.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationFetchQuery.d.ts +9 -0
- package/dist/types/service-operation/ServiceOperationFetchQuery.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationGetInfiniteQueryData.d.ts +8 -0
- package/dist/types/service-operation/ServiceOperationGetInfiniteQueryData.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationGetQueriesData.d.ts +15 -0
- package/dist/types/service-operation/ServiceOperationGetQueriesData.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationGetQueryData.d.ts +8 -0
- package/dist/types/service-operation/ServiceOperationGetQueryData.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationGetQueryState.d.ts +10 -0
- package/dist/types/service-operation/ServiceOperationGetQueryState.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationInvalidateQueries.d.ts +9 -0
- package/dist/types/service-operation/ServiceOperationInvalidateQueries.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationIsFetchingQueries.d.ts +8 -0
- package/dist/types/service-operation/ServiceOperationIsFetchingQueries.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationIsMutatingQueries.d.ts +8 -0
- package/dist/types/service-operation/ServiceOperationIsMutatingQueries.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationMutationFn.d.ts +8 -0
- package/dist/types/service-operation/ServiceOperationMutationFn.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationQueryFn.d.ts +12 -0
- package/dist/types/service-operation/ServiceOperationQueryFn.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationRefetchQueries.d.ts +9 -0
- package/dist/types/service-operation/ServiceOperationRefetchQueries.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationRemoveQueries.d.ts +8 -0
- package/dist/types/service-operation/ServiceOperationRemoveQueries.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationResetQueries.d.ts +9 -0
- package/dist/types/service-operation/ServiceOperationResetQueries.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationSetInfiniteQueryData.d.ts +9 -0
- package/dist/types/service-operation/ServiceOperationSetInfiniteQueryData.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationSetQueriesData.d.ts +9 -0
- package/dist/types/service-operation/ServiceOperationSetQueriesData.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationSetQueryData.d.ts +9 -0
- package/dist/types/service-operation/ServiceOperationSetQueryData.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationUseInfiniteQuery.d.ts +12 -0
- package/dist/types/service-operation/ServiceOperationUseInfiniteQuery.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationUseIsFetchingQueries.d.ts +8 -0
- package/dist/types/service-operation/ServiceOperationUseIsFetchingQueries.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationUseIsMutating.d.ts +8 -0
- package/dist/types/service-operation/ServiceOperationUseIsMutating.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationUseMutation.d.ts +11 -0
- package/dist/types/service-operation/ServiceOperationUseMutation.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationUseMutationState.d.ts +12 -0
- package/dist/types/service-operation/ServiceOperationUseMutationState.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationUseQueries.d.ts +12 -0
- package/dist/types/service-operation/ServiceOperationUseQueries.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationUseQuery.d.ts +11 -0
- package/dist/types/service-operation/ServiceOperationUseQuery.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationUseSuspenseInfiniteQuery.d.ts +10 -0
- package/dist/types/service-operation/ServiceOperationUseSuspenseInfiniteQuery.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationUseSuspenseQueries.d.ts +12 -0
- package/dist/types/service-operation/ServiceOperationUseSuspenseQueries.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationUseSuspenseQuery.d.ts +9 -0
- package/dist/types/service-operation/ServiceOperationUseSuspenseQuery.d.ts.map +1 -0
- package/dist/types/service-operation/index.d.ts +30 -0
- package/dist/types/service-operation/index.d.ts.map +1 -0
- package/dist/types/shared/AreAllOptional.d.ts +4 -0
- package/dist/types/shared/AreAllOptional.d.ts.map +1 -0
- package/dist/types/shared/FetchInfiniteQueryOptions.d.ts +54 -0
- package/dist/types/shared/FetchInfiniteQueryOptions.d.ts.map +1 -0
- package/dist/types/shared/InvalidateQueryFilters.d.ts +9 -0
- package/dist/types/shared/InvalidateQueryFilters.d.ts.map +1 -0
- package/dist/types/shared/MutationFilters.d.ts +52 -0
- package/dist/types/shared/MutationFilters.d.ts.map +1 -0
- package/dist/types/shared/OperationInfiniteData.d.ts +4 -0
- package/dist/types/shared/OperationInfiniteData.d.ts.map +1 -0
- package/dist/types/shared/PartialParameters.d.ts +13 -0
- package/dist/types/shared/PartialParameters.d.ts.map +1 -0
- package/dist/types/shared/QueryFilters.d.ts +123 -0
- package/dist/types/shared/QueryFilters.d.ts.map +1 -0
- package/dist/types/shared/RequestFn.d.ts +92 -0
- package/dist/types/shared/RequestFn.d.ts.map +1 -0
- package/dist/types/shared/ServiceOperationFetchQueryOptions.d.ts +50 -0
- package/dist/types/shared/ServiceOperationFetchQueryOptions.d.ts.map +1 -0
- package/dist/types/shared/ServiceOperationKey.d.ts +16 -0
- package/dist/types/shared/ServiceOperationKey.d.ts.map +1 -0
- package/dist/types/shared/ServiceOperationMutation.d.ts +23 -0
- package/dist/types/shared/ServiceOperationMutation.d.ts.map +1 -0
- package/dist/types/shared/ServiceOperationQuery.d.ts +25 -0
- package/dist/types/shared/ServiceOperationQuery.d.ts.map +1 -0
- package/dist/types/shared/UseQueryOptionsForUseQueries.d.ts +16 -0
- package/dist/types/shared/UseQueryOptionsForUseQueries.d.ts.map +1 -0
- package/dist/types/shared/UseQueryOptionsForUseSuspenseQuery.d.ts +13 -0
- package/dist/types/shared/UseQueryOptionsForUseSuspenseQuery.d.ts.map +1 -0
- package/dist/types/shared/WithOptional.d.ts +2 -0
- package/dist/types/shared/WithOptional.d.ts.map +1 -0
- package/dist/types/shared/index.d.ts +16 -0
- package/dist/types/shared/index.d.ts.map +1 -0
- package/package.json +48 -0
- package/src/index.ts +2 -0
- package/src/service-operation/ServiceOperation.ts +170 -0
- package/src/service-operation/ServiceOperationCancelQueries.ts +31 -0
- package/src/service-operation/ServiceOperationFetchInfiniteQuery.ts +73 -0
- package/src/service-operation/ServiceOperationFetchQuery.ts +43 -0
- package/src/service-operation/ServiceOperationGetInfiniteQueryData.ts +17 -0
- package/src/service-operation/ServiceOperationGetQueriesData.ts +47 -0
- package/src/service-operation/ServiceOperationGetQueryData.ts +16 -0
- package/src/service-operation/ServiceOperationGetQueryState.ts +28 -0
- package/src/service-operation/ServiceOperationInvalidateQueries.ts +20 -0
- package/src/service-operation/ServiceOperationIsFetchingQueries.ts +29 -0
- package/src/service-operation/ServiceOperationIsMutatingQueries.ts +31 -0
- package/src/service-operation/ServiceOperationMutationFn.ts +20 -0
- package/src/service-operation/ServiceOperationQueryFn.ts +32 -0
- package/src/service-operation/ServiceOperationRefetchQueries.ts +31 -0
- package/src/service-operation/ServiceOperationRemoveQueries.ts +29 -0
- package/src/service-operation/ServiceOperationResetQueries.ts +31 -0
- package/src/service-operation/ServiceOperationSetInfiniteQueryData.ts +20 -0
- package/src/service-operation/ServiceOperationSetQueriesData.ts +35 -0
- package/src/service-operation/ServiceOperationSetQueryData.ts +17 -0
- package/src/service-operation/ServiceOperationUseInfiniteQuery.ts +76 -0
- package/src/service-operation/ServiceOperationUseIsFetchingQueries.ts +29 -0
- package/src/service-operation/ServiceOperationUseIsMutating.ts +31 -0
- package/src/service-operation/ServiceOperationUseMutation.ts +51 -0
- package/src/service-operation/ServiceOperationUseMutationState.ts +49 -0
- package/src/service-operation/ServiceOperationUseQueries.ts +21 -0
- package/src/service-operation/ServiceOperationUseQuery.ts +51 -0
- package/src/service-operation/ServiceOperationUseSuspenseInfiniteQuery.ts +45 -0
- package/src/service-operation/ServiceOperationUseSuspenseQueries.ts +26 -0
- package/src/service-operation/ServiceOperationUseSuspenseQuery.ts +30 -0
- package/src/service-operation/index.ts +29 -0
- package/src/shared/AreAllOptional.ts +8 -0
- package/src/shared/FetchInfiniteQueryOptions.ts +109 -0
- package/src/shared/InvalidateQueryFilters.ts +19 -0
- package/src/shared/MutationFilters.ts +93 -0
- package/src/shared/OperationInfiniteData.ts +7 -0
- package/src/shared/PartialParameters.ts +12 -0
- package/src/shared/QueryFilters.ts +226 -0
- package/src/shared/RequestFn.ts +129 -0
- package/src/shared/ServiceOperationFetchQueryOptions.ts +84 -0
- package/src/shared/ServiceOperationKey.ts +20 -0
- package/src/shared/ServiceOperationMutation.ts +32 -0
- package/src/shared/ServiceOperationQuery.ts +40 -0
- package/src/shared/UseQueryOptionsForUseQueries.ts +35 -0
- package/src/shared/UseQueryOptionsForUseSuspenseQuery.ts +28 -0
- package/src/shared/WithOptional.ts +2 -0
- package/src/shared/index.ts +15 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AreAllOptional,
|
|
3
|
+
QueryFnOptionsByParameters,
|
|
4
|
+
QueryFnOptionsByQueryKey,
|
|
5
|
+
RequestFnResponse,
|
|
6
|
+
} from '@openapi-qraft/tanstack-query-react-types';
|
|
7
|
+
|
|
8
|
+
export interface ServiceOperationQueryFn<
|
|
9
|
+
TSchema extends { url: string; method: string },
|
|
10
|
+
TQueryFnData,
|
|
11
|
+
TParams,
|
|
12
|
+
TError,
|
|
13
|
+
> {
|
|
14
|
+
<
|
|
15
|
+
TMeta extends Record<string, any>,
|
|
16
|
+
TSignal extends AbortSignal = AbortSignal,
|
|
17
|
+
>(
|
|
18
|
+
options:
|
|
19
|
+
| QueryFnOptionsByQueryKey<TSchema, TParams, TMeta, TSignal>
|
|
20
|
+
| (AreAllOptional<TParams> extends true
|
|
21
|
+
? QueryFnOptionsByParameters<TParams, TMeta, TSignal> | void
|
|
22
|
+
: QueryFnOptionsByParameters<TParams, TMeta, TSignal>),
|
|
23
|
+
client?: (
|
|
24
|
+
schema: TSchema,
|
|
25
|
+
options: {
|
|
26
|
+
parameters: TParams;
|
|
27
|
+
signal?: TSignal;
|
|
28
|
+
meta?: TMeta;
|
|
29
|
+
}
|
|
30
|
+
) => Promise<RequestFnResponse<TQueryFnData, TError>>
|
|
31
|
+
): Promise<RequestFnResponse<TQueryFnData, TError>>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
QueryFiltersByParameters,
|
|
3
|
+
QueryFiltersByQueryKey,
|
|
4
|
+
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
+
import type { RefetchOptions } from '@tanstack/query-core';
|
|
6
|
+
|
|
7
|
+
export interface ServiceOperationRefetchQueries<
|
|
8
|
+
TSchema extends { url: string; method: string },
|
|
9
|
+
TQueryFnData,
|
|
10
|
+
TParams,
|
|
11
|
+
TError,
|
|
12
|
+
> {
|
|
13
|
+
refetchQueries<TInfinite extends boolean = false>(
|
|
14
|
+
filters?:
|
|
15
|
+
| QueryFiltersByParameters<
|
|
16
|
+
TSchema,
|
|
17
|
+
TQueryFnData,
|
|
18
|
+
TInfinite,
|
|
19
|
+
TParams,
|
|
20
|
+
TError
|
|
21
|
+
>
|
|
22
|
+
| QueryFiltersByQueryKey<
|
|
23
|
+
TSchema,
|
|
24
|
+
TQueryFnData,
|
|
25
|
+
TInfinite,
|
|
26
|
+
TParams,
|
|
27
|
+
TError
|
|
28
|
+
>,
|
|
29
|
+
options?: RefetchOptions
|
|
30
|
+
): Promise<void>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
QueryFiltersByParameters,
|
|
3
|
+
QueryFiltersByQueryKey,
|
|
4
|
+
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
+
|
|
6
|
+
export interface ServiceOperationRemoveQueries<
|
|
7
|
+
TSchema extends { url: string; method: string },
|
|
8
|
+
TQueryFnData,
|
|
9
|
+
TParams,
|
|
10
|
+
TError,
|
|
11
|
+
> {
|
|
12
|
+
removeQueries<TInfinite extends boolean = false>(
|
|
13
|
+
filters?:
|
|
14
|
+
| QueryFiltersByParameters<
|
|
15
|
+
TSchema,
|
|
16
|
+
TQueryFnData,
|
|
17
|
+
TInfinite,
|
|
18
|
+
TParams,
|
|
19
|
+
TError
|
|
20
|
+
>
|
|
21
|
+
| QueryFiltersByQueryKey<
|
|
22
|
+
TSchema,
|
|
23
|
+
TQueryFnData,
|
|
24
|
+
TInfinite,
|
|
25
|
+
TParams,
|
|
26
|
+
TError
|
|
27
|
+
>
|
|
28
|
+
): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
QueryFiltersByParameters,
|
|
3
|
+
QueryFiltersByQueryKey,
|
|
4
|
+
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
+
import type { ResetOptions } from '@tanstack/query-core';
|
|
6
|
+
|
|
7
|
+
export interface ServiceOperationResetQueries<
|
|
8
|
+
TSchema extends { url: string; method: string },
|
|
9
|
+
TQueryFnData,
|
|
10
|
+
TParams,
|
|
11
|
+
TError,
|
|
12
|
+
> {
|
|
13
|
+
resetQueries<TInfinite extends boolean = false>(
|
|
14
|
+
filters?:
|
|
15
|
+
| QueryFiltersByParameters<
|
|
16
|
+
TSchema,
|
|
17
|
+
TQueryFnData,
|
|
18
|
+
TInfinite,
|
|
19
|
+
TParams,
|
|
20
|
+
TError
|
|
21
|
+
>
|
|
22
|
+
| QueryFiltersByQueryKey<
|
|
23
|
+
TSchema,
|
|
24
|
+
TQueryFnData,
|
|
25
|
+
TInfinite,
|
|
26
|
+
TParams,
|
|
27
|
+
TError
|
|
28
|
+
>,
|
|
29
|
+
options?: ResetOptions
|
|
30
|
+
): Promise<void>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
OperationInfiniteData,
|
|
3
|
+
ServiceOperationInfiniteQueryKey,
|
|
4
|
+
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
+
import type { NoInfer, SetDataOptions, Updater } from '@tanstack/query-core';
|
|
6
|
+
|
|
7
|
+
export interface ServiceOperationSetInfiniteQueryData<
|
|
8
|
+
TSchema extends { url: string; method: string },
|
|
9
|
+
TQueryFnData,
|
|
10
|
+
TParams = {},
|
|
11
|
+
> {
|
|
12
|
+
setInfiniteQueryData(
|
|
13
|
+
parameters: TParams | ServiceOperationInfiniteQueryKey<TSchema, TParams>,
|
|
14
|
+
updater: Updater<
|
|
15
|
+
NoInfer<OperationInfiniteData<TQueryFnData, TParams>> | undefined,
|
|
16
|
+
NoInfer<OperationInfiniteData<TQueryFnData, TParams>> | undefined
|
|
17
|
+
>,
|
|
18
|
+
options?: SetDataOptions
|
|
19
|
+
): OperationInfiniteData<TQueryFnData, TParams> | undefined;
|
|
20
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
QueryFiltersByParameters,
|
|
3
|
+
QueryFiltersByQueryKey,
|
|
4
|
+
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
+
import type { NoInfer, SetDataOptions, Updater } from '@tanstack/query-core';
|
|
6
|
+
|
|
7
|
+
export interface ServiceOperationSetQueriesData<
|
|
8
|
+
TSchema extends { url: string; method: string },
|
|
9
|
+
TQueryFnData,
|
|
10
|
+
TParams,
|
|
11
|
+
TError,
|
|
12
|
+
> {
|
|
13
|
+
setQueriesData<TInfinite extends boolean = false>(
|
|
14
|
+
filters:
|
|
15
|
+
| QueryFiltersByParameters<
|
|
16
|
+
TSchema,
|
|
17
|
+
TQueryFnData,
|
|
18
|
+
TInfinite,
|
|
19
|
+
TParams,
|
|
20
|
+
TError
|
|
21
|
+
>
|
|
22
|
+
| QueryFiltersByQueryKey<
|
|
23
|
+
TSchema,
|
|
24
|
+
TQueryFnData,
|
|
25
|
+
TInfinite,
|
|
26
|
+
TParams,
|
|
27
|
+
TError
|
|
28
|
+
>,
|
|
29
|
+
updater: Updater<
|
|
30
|
+
NoInfer<TQueryFnData> | undefined,
|
|
31
|
+
NoInfer<TQueryFnData> | undefined
|
|
32
|
+
>,
|
|
33
|
+
options?: SetDataOptions
|
|
34
|
+
): Array<TQueryFnData | undefined>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ServiceOperationQueryKey } from '@openapi-qraft/tanstack-query-react-types';
|
|
2
|
+
import type { NoInfer, SetDataOptions, Updater } from '@tanstack/query-core';
|
|
3
|
+
|
|
4
|
+
export interface ServiceOperationSetQueryData<
|
|
5
|
+
TSchema extends { url: string; method: string },
|
|
6
|
+
TQueryFnData,
|
|
7
|
+
TParams = {},
|
|
8
|
+
> {
|
|
9
|
+
setQueryData(
|
|
10
|
+
parameters: TParams | ServiceOperationQueryKey<TSchema, TParams>,
|
|
11
|
+
updater: Updater<
|
|
12
|
+
NoInfer<TQueryFnData> | undefined,
|
|
13
|
+
NoInfer<TQueryFnData> | undefined
|
|
14
|
+
>,
|
|
15
|
+
options?: SetDataOptions
|
|
16
|
+
): TQueryFnData | undefined;
|
|
17
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AreAllOptional,
|
|
3
|
+
OperationInfiniteData,
|
|
4
|
+
PartialParameters,
|
|
5
|
+
ServiceOperationInfiniteQueryKey,
|
|
6
|
+
} from '@openapi-qraft/tanstack-query-react-types';
|
|
7
|
+
import type { InfiniteQueryPageParamsOptions } from '@tanstack/query-core';
|
|
8
|
+
import type {
|
|
9
|
+
DefinedInitialDataInfiniteOptions,
|
|
10
|
+
DefinedUseInfiniteQueryResult,
|
|
11
|
+
UndefinedInitialDataInfiniteOptions,
|
|
12
|
+
UseInfiniteQueryResult,
|
|
13
|
+
} from '@tanstack/react-query';
|
|
14
|
+
|
|
15
|
+
export interface ServiceOperationUseInfiniteQuery<
|
|
16
|
+
TSchema extends { url: string; method: string },
|
|
17
|
+
TQueryFnData,
|
|
18
|
+
TParams,
|
|
19
|
+
TError,
|
|
20
|
+
> {
|
|
21
|
+
getInfiniteQueryKey(
|
|
22
|
+
parameters: AreAllOptional<TParams> extends true ? TParams | void : TParams
|
|
23
|
+
): ServiceOperationInfiniteQueryKey<TSchema, TParams>;
|
|
24
|
+
|
|
25
|
+
useInfiniteQuery<TPageParam extends TParams, TData = TQueryFnData>(
|
|
26
|
+
parameters:
|
|
27
|
+
| ServiceOperationInfiniteQueryKey<TSchema, TParams>
|
|
28
|
+
| (AreAllOptional<TParams> extends true ? TParams | void : TParams),
|
|
29
|
+
options: Omit<
|
|
30
|
+
UndefinedInitialDataInfiniteOptions<
|
|
31
|
+
TQueryFnData,
|
|
32
|
+
TError,
|
|
33
|
+
OperationInfiniteData<TData, TParams>,
|
|
34
|
+
ServiceOperationInfiniteQueryKey<TSchema, TParams>,
|
|
35
|
+
PartialParameters<TPageParam>
|
|
36
|
+
>,
|
|
37
|
+
| 'queryKey'
|
|
38
|
+
| 'getPreviousPageParam'
|
|
39
|
+
| 'getNextPageParam'
|
|
40
|
+
| 'initialPageParam'
|
|
41
|
+
> &
|
|
42
|
+
InfiniteQueryPageParamsOptions<
|
|
43
|
+
TQueryFnData,
|
|
44
|
+
PartialParameters<TPageParam>
|
|
45
|
+
>
|
|
46
|
+
): UseInfiniteQueryResult<
|
|
47
|
+
OperationInfiniteData<TData, TParams>,
|
|
48
|
+
TError | Error
|
|
49
|
+
>;
|
|
50
|
+
|
|
51
|
+
useInfiniteQuery<TPageParam extends TParams, TData = TQueryFnData>(
|
|
52
|
+
parameters:
|
|
53
|
+
| ServiceOperationInfiniteQueryKey<TSchema, TParams>
|
|
54
|
+
| (AreAllOptional<TParams> extends true ? TParams | void : TParams),
|
|
55
|
+
options: Omit<
|
|
56
|
+
DefinedInitialDataInfiniteOptions<
|
|
57
|
+
TQueryFnData,
|
|
58
|
+
TError,
|
|
59
|
+
OperationInfiniteData<TData, TParams>,
|
|
60
|
+
ServiceOperationInfiniteQueryKey<TSchema, TParams>,
|
|
61
|
+
PartialParameters<TPageParam>
|
|
62
|
+
>,
|
|
63
|
+
| 'queryKey'
|
|
64
|
+
| 'getPreviousPageParam'
|
|
65
|
+
| 'getNextPageParam'
|
|
66
|
+
| 'initialPageParam'
|
|
67
|
+
> &
|
|
68
|
+
InfiniteQueryPageParamsOptions<
|
|
69
|
+
TQueryFnData,
|
|
70
|
+
PartialParameters<TPageParam>
|
|
71
|
+
>
|
|
72
|
+
): DefinedUseInfiniteQueryResult<
|
|
73
|
+
OperationInfiniteData<TData, TParams>,
|
|
74
|
+
TError | Error
|
|
75
|
+
>;
|
|
76
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
QueryFiltersByParameters,
|
|
3
|
+
QueryFiltersByQueryKey,
|
|
4
|
+
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
+
|
|
6
|
+
export interface ServiceOperationUseIsFetchingQueries<
|
|
7
|
+
TSchema extends { url: string; method: string },
|
|
8
|
+
TQueryFnData,
|
|
9
|
+
TParams,
|
|
10
|
+
TError,
|
|
11
|
+
> {
|
|
12
|
+
useIsFetching<TInfinite extends boolean = false>(
|
|
13
|
+
filters?:
|
|
14
|
+
| QueryFiltersByParameters<
|
|
15
|
+
TSchema,
|
|
16
|
+
TQueryFnData,
|
|
17
|
+
TInfinite,
|
|
18
|
+
TParams,
|
|
19
|
+
TError
|
|
20
|
+
>
|
|
21
|
+
| QueryFiltersByQueryKey<
|
|
22
|
+
TSchema,
|
|
23
|
+
TQueryFnData,
|
|
24
|
+
TInfinite,
|
|
25
|
+
TParams,
|
|
26
|
+
TError
|
|
27
|
+
>
|
|
28
|
+
): number;
|
|
29
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
MutationFiltersByMutationKey,
|
|
3
|
+
MutationFiltersByParameters,
|
|
4
|
+
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
+
|
|
6
|
+
export interface ServiceOperationUseIsMutating<
|
|
7
|
+
TSchema extends { url: string; method: string },
|
|
8
|
+
TBody,
|
|
9
|
+
TMutationData,
|
|
10
|
+
TParams,
|
|
11
|
+
TError,
|
|
12
|
+
> {
|
|
13
|
+
useIsMutating<TContext = unknown>(
|
|
14
|
+
filters?:
|
|
15
|
+
| MutationFiltersByParameters<
|
|
16
|
+
TBody,
|
|
17
|
+
TMutationData,
|
|
18
|
+
TParams,
|
|
19
|
+
TError,
|
|
20
|
+
TContext
|
|
21
|
+
>
|
|
22
|
+
| MutationFiltersByMutationKey<
|
|
23
|
+
TSchema,
|
|
24
|
+
TBody,
|
|
25
|
+
TMutationData,
|
|
26
|
+
TParams,
|
|
27
|
+
TError,
|
|
28
|
+
TContext
|
|
29
|
+
>
|
|
30
|
+
): number;
|
|
31
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AreAllOptional,
|
|
3
|
+
MutationVariables,
|
|
4
|
+
ServiceOperationMutationKey,
|
|
5
|
+
ServiceOperationUseMutationOptions,
|
|
6
|
+
} from '@openapi-qraft/tanstack-query-react-types';
|
|
7
|
+
import type { UseMutationResult } from '@tanstack/react-query';
|
|
8
|
+
|
|
9
|
+
export interface ServiceOperationUseMutation<
|
|
10
|
+
TSchema extends { url: string; method: string },
|
|
11
|
+
TBody,
|
|
12
|
+
TMutationData,
|
|
13
|
+
TParams,
|
|
14
|
+
TError,
|
|
15
|
+
> {
|
|
16
|
+
getMutationKey(
|
|
17
|
+
parameters: TParams | void
|
|
18
|
+
): ServiceOperationMutationKey<TSchema, TParams>;
|
|
19
|
+
|
|
20
|
+
useMutation<TVariables extends TBody, TContext = unknown>(
|
|
21
|
+
parameters: TParams,
|
|
22
|
+
options?: ServiceOperationUseMutationOptions<
|
|
23
|
+
TSchema,
|
|
24
|
+
TMutationData,
|
|
25
|
+
TParams,
|
|
26
|
+
TVariables,
|
|
27
|
+
TError,
|
|
28
|
+
TContext
|
|
29
|
+
>
|
|
30
|
+
): UseMutationResult<
|
|
31
|
+
TMutationData,
|
|
32
|
+
TError | Error,
|
|
33
|
+
AreAllOptional<TVariables> extends true ? TVariables | void : TVariables,
|
|
34
|
+
TContext
|
|
35
|
+
>;
|
|
36
|
+
|
|
37
|
+
useMutation<
|
|
38
|
+
TVariables extends MutationVariables<TBody, TParams>,
|
|
39
|
+
TContext = unknown,
|
|
40
|
+
>(
|
|
41
|
+
parameters: void,
|
|
42
|
+
options?: ServiceOperationUseMutationOptions<
|
|
43
|
+
TSchema,
|
|
44
|
+
TMutationData,
|
|
45
|
+
TParams,
|
|
46
|
+
TVariables,
|
|
47
|
+
TError,
|
|
48
|
+
TContext
|
|
49
|
+
>
|
|
50
|
+
): UseMutationResult<TMutationData, TError | Error, TVariables, TContext>;
|
|
51
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
MutationFiltersByMutationKey,
|
|
3
|
+
MutationFiltersByParameters,
|
|
4
|
+
MutationVariables,
|
|
5
|
+
} from '@openapi-qraft/tanstack-query-react-types';
|
|
6
|
+
import type { Mutation, MutationState } from '@tanstack/query-core';
|
|
7
|
+
|
|
8
|
+
export interface ServiceOperationUseMutationState<
|
|
9
|
+
TSchema extends { url: string; method: string },
|
|
10
|
+
TBody,
|
|
11
|
+
TMutationData,
|
|
12
|
+
TParams,
|
|
13
|
+
TError,
|
|
14
|
+
> {
|
|
15
|
+
useMutationState<
|
|
16
|
+
TContext = unknown,
|
|
17
|
+
TResult = MutationState<
|
|
18
|
+
TMutationData,
|
|
19
|
+
TError,
|
|
20
|
+
MutationVariables<TBody, TParams>,
|
|
21
|
+
TContext
|
|
22
|
+
>,
|
|
23
|
+
>(options?: {
|
|
24
|
+
filters?:
|
|
25
|
+
| MutationFiltersByParameters<
|
|
26
|
+
TBody,
|
|
27
|
+
TMutationData,
|
|
28
|
+
TParams,
|
|
29
|
+
TError,
|
|
30
|
+
TContext
|
|
31
|
+
>
|
|
32
|
+
| MutationFiltersByMutationKey<
|
|
33
|
+
TSchema,
|
|
34
|
+
TBody,
|
|
35
|
+
TMutationData,
|
|
36
|
+
TParams,
|
|
37
|
+
TError,
|
|
38
|
+
TContext
|
|
39
|
+
>;
|
|
40
|
+
select?: (
|
|
41
|
+
mutation: Mutation<
|
|
42
|
+
TMutationData,
|
|
43
|
+
TError,
|
|
44
|
+
MutationVariables<TBody, TParams>,
|
|
45
|
+
TContext
|
|
46
|
+
>
|
|
47
|
+
) => TResult;
|
|
48
|
+
}): Array<TResult>;
|
|
49
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { UseQueryOptionsForUseQueries } from '@openapi-qraft/tanstack-query-react-types';
|
|
2
|
+
import type { UseQueryResult } from '@tanstack/react-query';
|
|
3
|
+
|
|
4
|
+
export interface ServiceOperationUseQueries<
|
|
5
|
+
TSchema extends { url: string; method: string },
|
|
6
|
+
TQueryFnData,
|
|
7
|
+
TParams,
|
|
8
|
+
TError,
|
|
9
|
+
> {
|
|
10
|
+
useQueries<
|
|
11
|
+
T extends Array<
|
|
12
|
+
UseQueryOptionsForUseQueries<TSchema, TParams, TQueryFnData, TError>
|
|
13
|
+
>,
|
|
14
|
+
TCombinedResult = Array<UseQueryResult<TQueryFnData, TError>>,
|
|
15
|
+
>(options: {
|
|
16
|
+
queries: T;
|
|
17
|
+
combine?: (
|
|
18
|
+
results: Array<UseQueryResult<TQueryFnData, TError>>
|
|
19
|
+
) => TCombinedResult;
|
|
20
|
+
}): TCombinedResult;
|
|
21
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AreAllOptional,
|
|
3
|
+
ServiceOperationQueryKey,
|
|
4
|
+
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
+
import type {
|
|
6
|
+
DefinedInitialDataOptions,
|
|
7
|
+
DefinedUseQueryResult,
|
|
8
|
+
UndefinedInitialDataOptions,
|
|
9
|
+
UseQueryResult,
|
|
10
|
+
} from '@tanstack/react-query';
|
|
11
|
+
|
|
12
|
+
export interface ServiceOperationUseQuery<
|
|
13
|
+
TSchema extends { url: string; method: string },
|
|
14
|
+
TQueryFnData,
|
|
15
|
+
TParams,
|
|
16
|
+
TError,
|
|
17
|
+
> {
|
|
18
|
+
getQueryKey(
|
|
19
|
+
parameters: AreAllOptional<TParams> extends true ? TParams | void : TParams
|
|
20
|
+
): ServiceOperationQueryKey<TSchema, TParams>;
|
|
21
|
+
|
|
22
|
+
useQuery<TData = TQueryFnData>(
|
|
23
|
+
parameters:
|
|
24
|
+
| ServiceOperationQueryKey<TSchema, TParams>
|
|
25
|
+
| (AreAllOptional<TParams> extends true ? TParams | void : TParams),
|
|
26
|
+
options?: Omit<
|
|
27
|
+
UndefinedInitialDataOptions<
|
|
28
|
+
TQueryFnData,
|
|
29
|
+
TError,
|
|
30
|
+
TData,
|
|
31
|
+
ServiceOperationQueryKey<TSchema, TParams>
|
|
32
|
+
>,
|
|
33
|
+
'queryKey'
|
|
34
|
+
>
|
|
35
|
+
): UseQueryResult<TData, TError | Error>;
|
|
36
|
+
|
|
37
|
+
useQuery<TData = TQueryFnData>(
|
|
38
|
+
parameters:
|
|
39
|
+
| ServiceOperationQueryKey<TSchema, TParams>
|
|
40
|
+
| (AreAllOptional<TParams> extends true ? TParams | void : TParams),
|
|
41
|
+
options: Omit<
|
|
42
|
+
DefinedInitialDataOptions<
|
|
43
|
+
TQueryFnData,
|
|
44
|
+
TError,
|
|
45
|
+
TData,
|
|
46
|
+
ServiceOperationQueryKey<TSchema, TParams>
|
|
47
|
+
>,
|
|
48
|
+
'queryKey'
|
|
49
|
+
>
|
|
50
|
+
): DefinedUseQueryResult<TData, TError | Error>;
|
|
51
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AreAllOptional,
|
|
3
|
+
OperationInfiniteData,
|
|
4
|
+
PartialParameters,
|
|
5
|
+
ServiceOperationInfiniteQueryKey,
|
|
6
|
+
} from '@openapi-qraft/tanstack-query-react-types';
|
|
7
|
+
import type { InfiniteQueryPageParamsOptions } from '@tanstack/query-core';
|
|
8
|
+
import type {
|
|
9
|
+
UseSuspenseInfiniteQueryOptions,
|
|
10
|
+
UseSuspenseInfiniteQueryResult,
|
|
11
|
+
} from '@tanstack/react-query';
|
|
12
|
+
|
|
13
|
+
export interface ServiceOperationUseSuspenseInfiniteQuery<
|
|
14
|
+
TSchema extends { url: string; method: string },
|
|
15
|
+
TQueryFnData,
|
|
16
|
+
TParams,
|
|
17
|
+
TError,
|
|
18
|
+
> {
|
|
19
|
+
useSuspenseInfiniteQuery<TPageParam extends TParams, TData = TQueryFnData>(
|
|
20
|
+
parameters:
|
|
21
|
+
| ServiceOperationInfiniteQueryKey<TSchema, TParams>
|
|
22
|
+
| (AreAllOptional<TParams> extends true ? TParams | void : TParams),
|
|
23
|
+
options: Omit<
|
|
24
|
+
UseSuspenseInfiniteQueryOptions<
|
|
25
|
+
TQueryFnData,
|
|
26
|
+
TError,
|
|
27
|
+
OperationInfiniteData<TData, TParams>,
|
|
28
|
+
TQueryFnData,
|
|
29
|
+
ServiceOperationInfiniteQueryKey<TSchema, TParams>,
|
|
30
|
+
PartialParameters<TPageParam>
|
|
31
|
+
>,
|
|
32
|
+
| 'queryKey'
|
|
33
|
+
| 'getPreviousPageParam'
|
|
34
|
+
| 'getNextPageParam'
|
|
35
|
+
| 'initialPageParam'
|
|
36
|
+
> &
|
|
37
|
+
InfiniteQueryPageParamsOptions<
|
|
38
|
+
TQueryFnData,
|
|
39
|
+
PartialParameters<TPageParam>
|
|
40
|
+
>
|
|
41
|
+
): UseSuspenseInfiniteQueryResult<
|
|
42
|
+
OperationInfiniteData<TData, TParams>,
|
|
43
|
+
TError | Error
|
|
44
|
+
>;
|
|
45
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
UseQueryOptionsForUseSuspenseQuery,
|
|
3
|
+
WithOptional,
|
|
4
|
+
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
+
import type { UseSuspenseQueryResult } from '@tanstack/react-query';
|
|
6
|
+
|
|
7
|
+
export interface ServiceOperationUseSuspenseQueries<
|
|
8
|
+
TSchema extends { url: string; method: string },
|
|
9
|
+
TQueryFnData,
|
|
10
|
+
TParams,
|
|
11
|
+
TError,
|
|
12
|
+
> {
|
|
13
|
+
useSuspenseQueries<
|
|
14
|
+
T extends Array<
|
|
15
|
+
UseQueryOptionsForUseSuspenseQuery<TSchema, TParams, TQueryFnData, TError>
|
|
16
|
+
>,
|
|
17
|
+
TCombinedResult = Array<UseSuspenseQueryResult<TQueryFnData, TError>>,
|
|
18
|
+
>(options: {
|
|
19
|
+
queries: T;
|
|
20
|
+
combine?: (
|
|
21
|
+
results: Array<
|
|
22
|
+
WithOptional<UseSuspenseQueryResult<TQueryFnData, TError>, 'data'>
|
|
23
|
+
>
|
|
24
|
+
) => TCombinedResult;
|
|
25
|
+
}): TCombinedResult;
|
|
26
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AreAllOptional,
|
|
3
|
+
ServiceOperationQueryKey,
|
|
4
|
+
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
+
import type {
|
|
6
|
+
UseSuspenseQueryOptions,
|
|
7
|
+
UseSuspenseQueryResult,
|
|
8
|
+
} from '@tanstack/react-query';
|
|
9
|
+
|
|
10
|
+
export interface ServiceOperationUseSuspenseQuery<
|
|
11
|
+
TSchema extends { url: string; method: string },
|
|
12
|
+
TQueryFnData,
|
|
13
|
+
TParams,
|
|
14
|
+
TError,
|
|
15
|
+
> {
|
|
16
|
+
useSuspenseQuery<TData = TQueryFnData>(
|
|
17
|
+
parameters:
|
|
18
|
+
| ServiceOperationQueryKey<TSchema, TParams>
|
|
19
|
+
| (AreAllOptional<TParams> extends true ? TParams | void : TParams),
|
|
20
|
+
options?: Omit<
|
|
21
|
+
UseSuspenseQueryOptions<
|
|
22
|
+
TQueryFnData,
|
|
23
|
+
TError,
|
|
24
|
+
TData,
|
|
25
|
+
ServiceOperationQueryKey<TSchema, TParams>
|
|
26
|
+
>,
|
|
27
|
+
'queryKey'
|
|
28
|
+
>
|
|
29
|
+
): UseSuspenseQueryResult<TData, TError | Error>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type * from './ServiceOperation.js';
|
|
2
|
+
export type * from './ServiceOperationCancelQueries.js';
|
|
3
|
+
export type * from './ServiceOperationFetchInfiniteQuery.js';
|
|
4
|
+
export type * from './ServiceOperationFetchQuery.js';
|
|
5
|
+
export type * from './ServiceOperationGetInfiniteQueryData.js';
|
|
6
|
+
export type * from './ServiceOperationGetQueriesData.js';
|
|
7
|
+
export type * from './ServiceOperationGetQueryData.js';
|
|
8
|
+
export type * from './ServiceOperationGetQueryState.js';
|
|
9
|
+
export type * from './ServiceOperationInvalidateQueries.js';
|
|
10
|
+
export type * from './ServiceOperationIsFetchingQueries.js';
|
|
11
|
+
export type * from './ServiceOperationIsMutatingQueries.js';
|
|
12
|
+
export type * from './ServiceOperationMutationFn.js';
|
|
13
|
+
export type * from './ServiceOperationQueryFn.js';
|
|
14
|
+
export type * from './ServiceOperationRefetchQueries.js';
|
|
15
|
+
export type * from './ServiceOperationRemoveQueries.js';
|
|
16
|
+
export type * from './ServiceOperationResetQueries.js';
|
|
17
|
+
export type * from './ServiceOperationSetInfiniteQueryData.js';
|
|
18
|
+
export type * from './ServiceOperationSetQueriesData.js';
|
|
19
|
+
export type * from './ServiceOperationSetQueryData.js';
|
|
20
|
+
export type * from './ServiceOperationUseInfiniteQuery.js';
|
|
21
|
+
export type * from './ServiceOperationUseIsFetchingQueries.js';
|
|
22
|
+
export type * from './ServiceOperationUseIsMutating.js';
|
|
23
|
+
export type * from './ServiceOperationUseMutation.js';
|
|
24
|
+
export type * from './ServiceOperationUseMutationState.js';
|
|
25
|
+
export type * from './ServiceOperationUseQueries.js';
|
|
26
|
+
export type * from './ServiceOperationUseQuery.js';
|
|
27
|
+
export type * from './ServiceOperationUseSuspenseInfiniteQuery.js';
|
|
28
|
+
export type * from './ServiceOperationUseSuspenseQueries.js';
|
|
29
|
+
export type * from './ServiceOperationUseSuspenseQuery.js';
|