@tanstack/solid-query 5.100.5 → 5.100.6
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/build/_tsup-dts-rollup.d.cts +35 -41
- package/build/_tsup-dts-rollup.d.ts +35 -41
- package/build/dev.d.cts +3 -5
- package/build/dev.d.ts +3 -5
- package/build/index.d.cts +3 -5
- package/build/index.d.ts +3 -5
- package/package.json +2 -2
- package/src/index.ts +3 -3
- package/src/infiniteQueryOptions.ts +3 -15
- package/src/mutationOptions.ts +7 -7
- package/src/queryOptions.ts +3 -3
- package/src/types.ts +6 -6
- package/src/useQueries.ts +2 -2
|
@@ -78,7 +78,6 @@ import { MutationObserverLoadingResult } from '@tanstack/query-core';
|
|
|
78
78
|
import { MutationObserverOptions } from '@tanstack/query-core';
|
|
79
79
|
import { MutationObserverResult } from '@tanstack/query-core';
|
|
80
80
|
import { MutationObserverSuccessResult } from '@tanstack/query-core';
|
|
81
|
-
import { MutationOptions } from '@tanstack/query-core';
|
|
82
81
|
import { MutationScope } from '@tanstack/query-core';
|
|
83
82
|
import { MutationState } from '@tanstack/query-core';
|
|
84
83
|
import { MutationStatus } from '@tanstack/query-core';
|
|
@@ -120,7 +119,6 @@ import { QueryObserverPlaceholderResult } from '@tanstack/query-core';
|
|
|
120
119
|
import { QueryObserverRefetchErrorResult } from '@tanstack/query-core';
|
|
121
120
|
import { QueryObserverResult } from '@tanstack/query-core';
|
|
122
121
|
import { QueryObserverSuccessResult } from '@tanstack/query-core';
|
|
123
|
-
import { QueryOptions } from '@tanstack/query-core';
|
|
124
122
|
import { QueryPersister } from '@tanstack/query-core';
|
|
125
123
|
import { QueryState } from '@tanstack/query-core';
|
|
126
124
|
import { QueryStatus } from '@tanstack/query-core';
|
|
@@ -185,13 +183,13 @@ export { defaultShouldDehydrateQuery }
|
|
|
185
183
|
|
|
186
184
|
export { DefinedInfiniteQueryObserverResult }
|
|
187
185
|
|
|
188
|
-
declare type DefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<
|
|
186
|
+
declare type DefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<InfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & {
|
|
189
187
|
initialData: NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>> | (() => NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>);
|
|
190
188
|
}>;
|
|
191
189
|
export { DefinedInitialDataInfiniteOptions }
|
|
192
190
|
export { DefinedInitialDataInfiniteOptions as DefinedInitialDataInfiniteOptions_alias_1 }
|
|
193
191
|
|
|
194
|
-
declare type DefinedInitialDataOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<
|
|
192
|
+
declare type DefinedInitialDataOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<QueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
|
|
195
193
|
initialData: TQueryFnData | (() => TQueryFnData);
|
|
196
194
|
}>;
|
|
197
195
|
export { DefinedInitialDataOptions }
|
|
@@ -320,6 +318,25 @@ export { InfiniteQueryObserverResult }
|
|
|
320
318
|
|
|
321
319
|
export { InfiniteQueryObserverSuccessResult }
|
|
322
320
|
|
|
321
|
+
declare interface InfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends OmitKeyof<InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, 'queryKey' | 'suspense'> {
|
|
322
|
+
queryKey: TQueryKey;
|
|
323
|
+
/**
|
|
324
|
+
* Only applicable while rendering queries on the server with streaming.
|
|
325
|
+
* Set `deferStream` to `true` to wait for the query to resolve on the server before flushing the stream.
|
|
326
|
+
* This can be useful to avoid sending a loading state to the client before the query has resolved.
|
|
327
|
+
* Defaults to `false`.
|
|
328
|
+
*/
|
|
329
|
+
deferStream?: boolean;
|
|
330
|
+
/**
|
|
331
|
+
* @deprecated The `suspense` option has been deprecated in v5 and will be removed in the next major version.
|
|
332
|
+
* The `data` property on useInfiniteQuery is a SolidJS resource and will automatically suspend when the data is loading.
|
|
333
|
+
* Setting `suspense` to `false` will be a no-op.
|
|
334
|
+
*/
|
|
335
|
+
suspense?: boolean;
|
|
336
|
+
}
|
|
337
|
+
export { InfiniteQueryOptions }
|
|
338
|
+
export { InfiniteQueryOptions as InfiniteQueryOptions_alias_1 }
|
|
339
|
+
|
|
323
340
|
declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: ReturnType<DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>>): ReturnType<DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>> & {
|
|
324
341
|
queryKey: DataTag<TQueryKey, InfiniteData<TQueryFnData>>;
|
|
325
342
|
};
|
|
@@ -394,11 +411,14 @@ export { MutationObserverResult }
|
|
|
394
411
|
|
|
395
412
|
export { MutationObserverSuccessResult }
|
|
396
413
|
|
|
414
|
+
declare interface MutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> extends OmitKeyof<MutationObserverOptions<TData, TError, TVariables, TOnMutateResult>, '_defaulted'> {
|
|
415
|
+
}
|
|
397
416
|
export { MutationOptions }
|
|
417
|
+
export { MutationOptions as MutationOptions_alias_1 }
|
|
398
418
|
|
|
399
|
-
declare function mutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown>(options: WithRequired<
|
|
419
|
+
declare function mutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown>(options: WithRequired<MutationOptions<TData, TError, TVariables, TOnMutateResult>, 'mutationKey'>): WithRequired<MutationOptions<TData, TError, TVariables, TOnMutateResult>, 'mutationKey'>;
|
|
400
420
|
|
|
401
|
-
declare function mutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown>(options: Omit<
|
|
421
|
+
declare function mutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown>(options: Omit<MutationOptions<TData, TError, TVariables, TOnMutateResult>, 'mutationKey'>): Omit<MutationOptions<TData, TError, TVariables, TOnMutateResult>, 'mutationKey'>;
|
|
402
422
|
export { mutationOptions }
|
|
403
423
|
export { mutationOptions as mutationOptions_alias_1 }
|
|
404
424
|
|
|
@@ -550,7 +570,10 @@ export { QueryObserverResult }
|
|
|
550
570
|
|
|
551
571
|
export { QueryObserverSuccessResult }
|
|
552
572
|
|
|
573
|
+
declare interface QueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> extends UseBaseQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey> {
|
|
574
|
+
}
|
|
553
575
|
export { QueryOptions }
|
|
576
|
+
export { QueryOptions as QueryOptions_alias_1 }
|
|
554
577
|
|
|
555
578
|
declare function queryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: ReturnType<UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>>): ReturnType<UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>> & {
|
|
556
579
|
queryKey: DataTag<TQueryKey, TQueryFnData, TError>;
|
|
@@ -590,35 +613,6 @@ export { skipToken }
|
|
|
590
613
|
|
|
591
614
|
declare type SkipTokenForUseQueries = symbol;
|
|
592
615
|
|
|
593
|
-
declare interface SolidInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends OmitKeyof<InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, 'queryKey' | 'suspense'> {
|
|
594
|
-
queryKey: TQueryKey;
|
|
595
|
-
/**
|
|
596
|
-
* Only applicable while rendering queries on the server with streaming.
|
|
597
|
-
* Set `deferStream` to `true` to wait for the query to resolve on the server before flushing the stream.
|
|
598
|
-
* This can be useful to avoid sending a loading state to the client before the query has resolved.
|
|
599
|
-
* Defaults to `false`.
|
|
600
|
-
*/
|
|
601
|
-
deferStream?: boolean;
|
|
602
|
-
/**
|
|
603
|
-
* @deprecated The `suspense` option has been deprecated in v5 and will be removed in the next major version.
|
|
604
|
-
* The `data` property on useInfiniteQuery is a SolidJS resource and will automatically suspend when the data is loading.
|
|
605
|
-
* Setting `suspense` to `false` will be a no-op.
|
|
606
|
-
*/
|
|
607
|
-
suspense?: boolean;
|
|
608
|
-
}
|
|
609
|
-
export { SolidInfiniteQueryOptions }
|
|
610
|
-
export { SolidInfiniteQueryOptions as SolidInfiniteQueryOptions_alias_1 }
|
|
611
|
-
|
|
612
|
-
declare interface SolidMutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> extends OmitKeyof<MutationObserverOptions<TData, TError, TVariables, TOnMutateResult>, '_defaulted'> {
|
|
613
|
-
}
|
|
614
|
-
export { SolidMutationOptions }
|
|
615
|
-
export { SolidMutationOptions as SolidMutationOptions_alias_1 }
|
|
616
|
-
|
|
617
|
-
declare interface SolidQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> extends UseBaseQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey> {
|
|
618
|
-
}
|
|
619
|
-
export { SolidQueryOptions }
|
|
620
|
-
export { SolidQueryOptions as SolidQueryOptions_alias_1 }
|
|
621
|
-
|
|
622
616
|
export { StaleTime }
|
|
623
617
|
|
|
624
618
|
export { StaleTimeFunction }
|
|
@@ -631,13 +625,13 @@ export { timeoutManager }
|
|
|
631
625
|
|
|
632
626
|
export { TimeoutProvider }
|
|
633
627
|
|
|
634
|
-
declare type UndefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<
|
|
628
|
+
declare type UndefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<InfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & {
|
|
635
629
|
initialData?: undefined;
|
|
636
630
|
}>;
|
|
637
631
|
export { UndefinedInitialDataInfiniteOptions }
|
|
638
632
|
export { UndefinedInitialDataInfiniteOptions as UndefinedInitialDataInfiniteOptions_alias_1 }
|
|
639
633
|
|
|
640
|
-
declare type UndefinedInitialDataOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<
|
|
634
|
+
declare type UndefinedInitialDataOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<QueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
|
|
641
635
|
initialData?: undefined;
|
|
642
636
|
}>;
|
|
643
637
|
export { UndefinedInitialDataOptions }
|
|
@@ -690,7 +684,7 @@ declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TData = I
|
|
|
690
684
|
export { useInfiniteQuery }
|
|
691
685
|
export { useInfiniteQuery as useInfiniteQuery_alias_1 }
|
|
692
686
|
|
|
693
|
-
declare type UseInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<
|
|
687
|
+
declare type UseInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<InfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>>;
|
|
694
688
|
export { UseInfiniteQueryOptions as CreateInfiniteQueryOptions }
|
|
695
689
|
export { UseInfiniteQueryOptions }
|
|
696
690
|
export { UseInfiniteQueryOptions as UseInfiniteQueryOptions_alias_1 }
|
|
@@ -728,7 +722,7 @@ declare function useMutation<TData = unknown, TError = DefaultError, TVariables
|
|
|
728
722
|
export { useMutation }
|
|
729
723
|
export { useMutation as useMutation_alias_1 }
|
|
730
724
|
|
|
731
|
-
declare type UseMutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> = Accessor<
|
|
725
|
+
declare type UseMutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> = Accessor<MutationOptions<TData, TError, TVariables, TOnMutateResult>>;
|
|
732
726
|
export { UseMutationOptions as CreateMutationOptions }
|
|
733
727
|
export { UseMutationOptions }
|
|
734
728
|
export { UseMutationOptions as UseMutationOptions_alias_1 }
|
|
@@ -762,12 +756,12 @@ declare const useQueryClient: (queryClient?: QueryClient) => QueryClient;
|
|
|
762
756
|
export { useQueryClient }
|
|
763
757
|
export { useQueryClient as useQueryClient_alias_1 }
|
|
764
758
|
|
|
765
|
-
declare type UseQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<
|
|
759
|
+
declare type UseQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<QueryOptions<TQueryFnData, TError, TData, TQueryKey>>;
|
|
766
760
|
export { UseQueryOptions as CreateQueryOptions }
|
|
767
761
|
export { UseQueryOptions }
|
|
768
762
|
export { UseQueryOptions as UseQueryOptions_alias_1 }
|
|
769
763
|
|
|
770
|
-
declare type UseQueryOptionsForUseQueries<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = OmitKeyof<
|
|
764
|
+
declare type UseQueryOptionsForUseQueries<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = OmitKeyof<QueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'placeholderData' | 'suspense'> & {
|
|
771
765
|
placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction<TQueryFnData>;
|
|
772
766
|
/**
|
|
773
767
|
* @deprecated The `suspense` option has been deprecated in v5 and will be removed in the next major version.
|
|
@@ -78,7 +78,6 @@ import { MutationObserverLoadingResult } from '@tanstack/query-core';
|
|
|
78
78
|
import { MutationObserverOptions } from '@tanstack/query-core';
|
|
79
79
|
import { MutationObserverResult } from '@tanstack/query-core';
|
|
80
80
|
import { MutationObserverSuccessResult } from '@tanstack/query-core';
|
|
81
|
-
import { MutationOptions } from '@tanstack/query-core';
|
|
82
81
|
import { MutationScope } from '@tanstack/query-core';
|
|
83
82
|
import { MutationState } from '@tanstack/query-core';
|
|
84
83
|
import { MutationStatus } from '@tanstack/query-core';
|
|
@@ -120,7 +119,6 @@ import { QueryObserverPlaceholderResult } from '@tanstack/query-core';
|
|
|
120
119
|
import { QueryObserverRefetchErrorResult } from '@tanstack/query-core';
|
|
121
120
|
import { QueryObserverResult } from '@tanstack/query-core';
|
|
122
121
|
import { QueryObserverSuccessResult } from '@tanstack/query-core';
|
|
123
|
-
import { QueryOptions } from '@tanstack/query-core';
|
|
124
122
|
import { QueryPersister } from '@tanstack/query-core';
|
|
125
123
|
import { QueryState } from '@tanstack/query-core';
|
|
126
124
|
import { QueryStatus } from '@tanstack/query-core';
|
|
@@ -185,13 +183,13 @@ export { defaultShouldDehydrateQuery }
|
|
|
185
183
|
|
|
186
184
|
export { DefinedInfiniteQueryObserverResult }
|
|
187
185
|
|
|
188
|
-
declare type DefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<
|
|
186
|
+
declare type DefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<InfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & {
|
|
189
187
|
initialData: NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>> | (() => NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>);
|
|
190
188
|
}>;
|
|
191
189
|
export { DefinedInitialDataInfiniteOptions }
|
|
192
190
|
export { DefinedInitialDataInfiniteOptions as DefinedInitialDataInfiniteOptions_alias_1 }
|
|
193
191
|
|
|
194
|
-
declare type DefinedInitialDataOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<
|
|
192
|
+
declare type DefinedInitialDataOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<QueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
|
|
195
193
|
initialData: TQueryFnData | (() => TQueryFnData);
|
|
196
194
|
}>;
|
|
197
195
|
export { DefinedInitialDataOptions }
|
|
@@ -320,6 +318,25 @@ export { InfiniteQueryObserverResult }
|
|
|
320
318
|
|
|
321
319
|
export { InfiniteQueryObserverSuccessResult }
|
|
322
320
|
|
|
321
|
+
declare interface InfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends OmitKeyof<InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, 'queryKey' | 'suspense'> {
|
|
322
|
+
queryKey: TQueryKey;
|
|
323
|
+
/**
|
|
324
|
+
* Only applicable while rendering queries on the server with streaming.
|
|
325
|
+
* Set `deferStream` to `true` to wait for the query to resolve on the server before flushing the stream.
|
|
326
|
+
* This can be useful to avoid sending a loading state to the client before the query has resolved.
|
|
327
|
+
* Defaults to `false`.
|
|
328
|
+
*/
|
|
329
|
+
deferStream?: boolean;
|
|
330
|
+
/**
|
|
331
|
+
* @deprecated The `suspense` option has been deprecated in v5 and will be removed in the next major version.
|
|
332
|
+
* The `data` property on useInfiniteQuery is a SolidJS resource and will automatically suspend when the data is loading.
|
|
333
|
+
* Setting `suspense` to `false` will be a no-op.
|
|
334
|
+
*/
|
|
335
|
+
suspense?: boolean;
|
|
336
|
+
}
|
|
337
|
+
export { InfiniteQueryOptions }
|
|
338
|
+
export { InfiniteQueryOptions as InfiniteQueryOptions_alias_1 }
|
|
339
|
+
|
|
323
340
|
declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: ReturnType<DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>>): ReturnType<DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>> & {
|
|
324
341
|
queryKey: DataTag<TQueryKey, InfiniteData<TQueryFnData>>;
|
|
325
342
|
};
|
|
@@ -394,11 +411,14 @@ export { MutationObserverResult }
|
|
|
394
411
|
|
|
395
412
|
export { MutationObserverSuccessResult }
|
|
396
413
|
|
|
414
|
+
declare interface MutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> extends OmitKeyof<MutationObserverOptions<TData, TError, TVariables, TOnMutateResult>, '_defaulted'> {
|
|
415
|
+
}
|
|
397
416
|
export { MutationOptions }
|
|
417
|
+
export { MutationOptions as MutationOptions_alias_1 }
|
|
398
418
|
|
|
399
|
-
declare function mutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown>(options: WithRequired<
|
|
419
|
+
declare function mutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown>(options: WithRequired<MutationOptions<TData, TError, TVariables, TOnMutateResult>, 'mutationKey'>): WithRequired<MutationOptions<TData, TError, TVariables, TOnMutateResult>, 'mutationKey'>;
|
|
400
420
|
|
|
401
|
-
declare function mutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown>(options: Omit<
|
|
421
|
+
declare function mutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown>(options: Omit<MutationOptions<TData, TError, TVariables, TOnMutateResult>, 'mutationKey'>): Omit<MutationOptions<TData, TError, TVariables, TOnMutateResult>, 'mutationKey'>;
|
|
402
422
|
export { mutationOptions }
|
|
403
423
|
export { mutationOptions as mutationOptions_alias_1 }
|
|
404
424
|
|
|
@@ -550,7 +570,10 @@ export { QueryObserverResult }
|
|
|
550
570
|
|
|
551
571
|
export { QueryObserverSuccessResult }
|
|
552
572
|
|
|
573
|
+
declare interface QueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> extends UseBaseQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey> {
|
|
574
|
+
}
|
|
553
575
|
export { QueryOptions }
|
|
576
|
+
export { QueryOptions as QueryOptions_alias_1 }
|
|
554
577
|
|
|
555
578
|
declare function queryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: ReturnType<UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>>): ReturnType<UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>> & {
|
|
556
579
|
queryKey: DataTag<TQueryKey, TQueryFnData, TError>;
|
|
@@ -590,35 +613,6 @@ export { skipToken }
|
|
|
590
613
|
|
|
591
614
|
declare type SkipTokenForUseQueries = symbol;
|
|
592
615
|
|
|
593
|
-
declare interface SolidInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends OmitKeyof<InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, 'queryKey' | 'suspense'> {
|
|
594
|
-
queryKey: TQueryKey;
|
|
595
|
-
/**
|
|
596
|
-
* Only applicable while rendering queries on the server with streaming.
|
|
597
|
-
* Set `deferStream` to `true` to wait for the query to resolve on the server before flushing the stream.
|
|
598
|
-
* This can be useful to avoid sending a loading state to the client before the query has resolved.
|
|
599
|
-
* Defaults to `false`.
|
|
600
|
-
*/
|
|
601
|
-
deferStream?: boolean;
|
|
602
|
-
/**
|
|
603
|
-
* @deprecated The `suspense` option has been deprecated in v5 and will be removed in the next major version.
|
|
604
|
-
* The `data` property on useInfiniteQuery is a SolidJS resource and will automatically suspend when the data is loading.
|
|
605
|
-
* Setting `suspense` to `false` will be a no-op.
|
|
606
|
-
*/
|
|
607
|
-
suspense?: boolean;
|
|
608
|
-
}
|
|
609
|
-
export { SolidInfiniteQueryOptions }
|
|
610
|
-
export { SolidInfiniteQueryOptions as SolidInfiniteQueryOptions_alias_1 }
|
|
611
|
-
|
|
612
|
-
declare interface SolidMutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> extends OmitKeyof<MutationObserverOptions<TData, TError, TVariables, TOnMutateResult>, '_defaulted'> {
|
|
613
|
-
}
|
|
614
|
-
export { SolidMutationOptions }
|
|
615
|
-
export { SolidMutationOptions as SolidMutationOptions_alias_1 }
|
|
616
|
-
|
|
617
|
-
declare interface SolidQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> extends UseBaseQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey> {
|
|
618
|
-
}
|
|
619
|
-
export { SolidQueryOptions }
|
|
620
|
-
export { SolidQueryOptions as SolidQueryOptions_alias_1 }
|
|
621
|
-
|
|
622
616
|
export { StaleTime }
|
|
623
617
|
|
|
624
618
|
export { StaleTimeFunction }
|
|
@@ -631,13 +625,13 @@ export { timeoutManager }
|
|
|
631
625
|
|
|
632
626
|
export { TimeoutProvider }
|
|
633
627
|
|
|
634
|
-
declare type UndefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<
|
|
628
|
+
declare type UndefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<InfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & {
|
|
635
629
|
initialData?: undefined;
|
|
636
630
|
}>;
|
|
637
631
|
export { UndefinedInitialDataInfiniteOptions }
|
|
638
632
|
export { UndefinedInitialDataInfiniteOptions as UndefinedInitialDataInfiniteOptions_alias_1 }
|
|
639
633
|
|
|
640
|
-
declare type UndefinedInitialDataOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<
|
|
634
|
+
declare type UndefinedInitialDataOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<QueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
|
|
641
635
|
initialData?: undefined;
|
|
642
636
|
}>;
|
|
643
637
|
export { UndefinedInitialDataOptions }
|
|
@@ -690,7 +684,7 @@ declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TData = I
|
|
|
690
684
|
export { useInfiniteQuery }
|
|
691
685
|
export { useInfiniteQuery as useInfiniteQuery_alias_1 }
|
|
692
686
|
|
|
693
|
-
declare type UseInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<
|
|
687
|
+
declare type UseInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<InfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>>;
|
|
694
688
|
export { UseInfiniteQueryOptions as CreateInfiniteQueryOptions }
|
|
695
689
|
export { UseInfiniteQueryOptions }
|
|
696
690
|
export { UseInfiniteQueryOptions as UseInfiniteQueryOptions_alias_1 }
|
|
@@ -728,7 +722,7 @@ declare function useMutation<TData = unknown, TError = DefaultError, TVariables
|
|
|
728
722
|
export { useMutation }
|
|
729
723
|
export { useMutation as useMutation_alias_1 }
|
|
730
724
|
|
|
731
|
-
declare type UseMutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> = Accessor<
|
|
725
|
+
declare type UseMutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> = Accessor<MutationOptions<TData, TError, TVariables, TOnMutateResult>>;
|
|
732
726
|
export { UseMutationOptions as CreateMutationOptions }
|
|
733
727
|
export { UseMutationOptions }
|
|
734
728
|
export { UseMutationOptions as UseMutationOptions_alias_1 }
|
|
@@ -762,12 +756,12 @@ declare const useQueryClient: (queryClient?: QueryClient) => QueryClient;
|
|
|
762
756
|
export { useQueryClient }
|
|
763
757
|
export { useQueryClient as useQueryClient_alias_1 }
|
|
764
758
|
|
|
765
|
-
declare type UseQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<
|
|
759
|
+
declare type UseQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<QueryOptions<TQueryFnData, TError, TData, TQueryKey>>;
|
|
766
760
|
export { UseQueryOptions as CreateQueryOptions }
|
|
767
761
|
export { UseQueryOptions }
|
|
768
762
|
export { UseQueryOptions as UseQueryOptions_alias_1 }
|
|
769
763
|
|
|
770
|
-
declare type UseQueryOptionsForUseQueries<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = OmitKeyof<
|
|
764
|
+
declare type UseQueryOptionsForUseQueries<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = OmitKeyof<QueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'placeholderData' | 'suspense'> & {
|
|
771
765
|
placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction<TQueryFnData>;
|
|
772
766
|
/**
|
|
773
767
|
* @deprecated The `suspense` option has been deprecated in v5 and will be removed in the next major version.
|
package/build/dev.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { DefinedUseBaseQueryResult } from './_tsup-dts-rollup.cjs';
|
|
2
2
|
export { DefinedUseInfiniteQueryResult } from './_tsup-dts-rollup.cjs';
|
|
3
3
|
export { DefinedUseQueryResult } from './_tsup-dts-rollup.cjs';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
4
|
+
export { InfiniteQueryOptions } from './_tsup-dts-rollup.cjs';
|
|
5
|
+
export { MutationOptions } from './_tsup-dts-rollup.cjs';
|
|
6
|
+
export { QueryOptions } from './_tsup-dts-rollup.cjs';
|
|
7
7
|
export { UseBaseMutationResult } from './_tsup-dts-rollup.cjs';
|
|
8
8
|
export { UseBaseQueryOptions } from './_tsup-dts-rollup.cjs';
|
|
9
9
|
export { UseBaseQueryResult } from './_tsup-dts-rollup.cjs';
|
|
@@ -139,7 +139,6 @@ export { InfiniteData } from './_tsup-dts-rollup.cjs';
|
|
|
139
139
|
export { QueryMeta } from './_tsup-dts-rollup.cjs';
|
|
140
140
|
export { NetworkMode } from './_tsup-dts-rollup.cjs';
|
|
141
141
|
export { NotifyOnChangeProps } from './_tsup-dts-rollup.cjs';
|
|
142
|
-
export { QueryOptions } from './_tsup-dts-rollup.cjs';
|
|
143
142
|
export { InitialPageParam } from './_tsup-dts-rollup.cjs';
|
|
144
143
|
export { InfiniteQueryPageParamsOptions } from './_tsup-dts-rollup.cjs';
|
|
145
144
|
export { ThrowOnError } from './_tsup-dts-rollup.cjs';
|
|
@@ -184,7 +183,6 @@ export { MutationScope } from './_tsup-dts-rollup.cjs';
|
|
|
184
183
|
export { MutationMeta } from './_tsup-dts-rollup.cjs';
|
|
185
184
|
export { MutationFunctionContext } from './_tsup-dts-rollup.cjs';
|
|
186
185
|
export { MutationFunction } from './_tsup-dts-rollup.cjs';
|
|
187
|
-
export { MutationOptions } from './_tsup-dts-rollup.cjs';
|
|
188
186
|
export { MutationObserverOptions } from './_tsup-dts-rollup.cjs';
|
|
189
187
|
export { MutateOptions } from './_tsup-dts-rollup.cjs';
|
|
190
188
|
export { MutateFunction } from './_tsup-dts-rollup.cjs';
|
package/build/dev.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { DefinedUseBaseQueryResult } from './_tsup-dts-rollup.js';
|
|
2
2
|
export { DefinedUseInfiniteQueryResult } from './_tsup-dts-rollup.js';
|
|
3
3
|
export { DefinedUseQueryResult } from './_tsup-dts-rollup.js';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
4
|
+
export { InfiniteQueryOptions } from './_tsup-dts-rollup.js';
|
|
5
|
+
export { MutationOptions } from './_tsup-dts-rollup.js';
|
|
6
|
+
export { QueryOptions } from './_tsup-dts-rollup.js';
|
|
7
7
|
export { UseBaseMutationResult } from './_tsup-dts-rollup.js';
|
|
8
8
|
export { UseBaseQueryOptions } from './_tsup-dts-rollup.js';
|
|
9
9
|
export { UseBaseQueryResult } from './_tsup-dts-rollup.js';
|
|
@@ -139,7 +139,6 @@ export { InfiniteData } from './_tsup-dts-rollup.js';
|
|
|
139
139
|
export { QueryMeta } from './_tsup-dts-rollup.js';
|
|
140
140
|
export { NetworkMode } from './_tsup-dts-rollup.js';
|
|
141
141
|
export { NotifyOnChangeProps } from './_tsup-dts-rollup.js';
|
|
142
|
-
export { QueryOptions } from './_tsup-dts-rollup.js';
|
|
143
142
|
export { InitialPageParam } from './_tsup-dts-rollup.js';
|
|
144
143
|
export { InfiniteQueryPageParamsOptions } from './_tsup-dts-rollup.js';
|
|
145
144
|
export { ThrowOnError } from './_tsup-dts-rollup.js';
|
|
@@ -184,7 +183,6 @@ export { MutationScope } from './_tsup-dts-rollup.js';
|
|
|
184
183
|
export { MutationMeta } from './_tsup-dts-rollup.js';
|
|
185
184
|
export { MutationFunctionContext } from './_tsup-dts-rollup.js';
|
|
186
185
|
export { MutationFunction } from './_tsup-dts-rollup.js';
|
|
187
|
-
export { MutationOptions } from './_tsup-dts-rollup.js';
|
|
188
186
|
export { MutationObserverOptions } from './_tsup-dts-rollup.js';
|
|
189
187
|
export { MutateOptions } from './_tsup-dts-rollup.js';
|
|
190
188
|
export { MutateFunction } from './_tsup-dts-rollup.js';
|
package/build/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { DefinedUseBaseQueryResult } from './_tsup-dts-rollup.cjs';
|
|
2
2
|
export { DefinedUseInfiniteQueryResult } from './_tsup-dts-rollup.cjs';
|
|
3
3
|
export { DefinedUseQueryResult } from './_tsup-dts-rollup.cjs';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
4
|
+
export { InfiniteQueryOptions } from './_tsup-dts-rollup.cjs';
|
|
5
|
+
export { MutationOptions } from './_tsup-dts-rollup.cjs';
|
|
6
|
+
export { QueryOptions } from './_tsup-dts-rollup.cjs';
|
|
7
7
|
export { UseBaseMutationResult } from './_tsup-dts-rollup.cjs';
|
|
8
8
|
export { UseBaseQueryOptions } from './_tsup-dts-rollup.cjs';
|
|
9
9
|
export { UseBaseQueryResult } from './_tsup-dts-rollup.cjs';
|
|
@@ -139,7 +139,6 @@ export { InfiniteData } from './_tsup-dts-rollup.cjs';
|
|
|
139
139
|
export { QueryMeta } from './_tsup-dts-rollup.cjs';
|
|
140
140
|
export { NetworkMode } from './_tsup-dts-rollup.cjs';
|
|
141
141
|
export { NotifyOnChangeProps } from './_tsup-dts-rollup.cjs';
|
|
142
|
-
export { QueryOptions } from './_tsup-dts-rollup.cjs';
|
|
143
142
|
export { InitialPageParam } from './_tsup-dts-rollup.cjs';
|
|
144
143
|
export { InfiniteQueryPageParamsOptions } from './_tsup-dts-rollup.cjs';
|
|
145
144
|
export { ThrowOnError } from './_tsup-dts-rollup.cjs';
|
|
@@ -184,7 +183,6 @@ export { MutationScope } from './_tsup-dts-rollup.cjs';
|
|
|
184
183
|
export { MutationMeta } from './_tsup-dts-rollup.cjs';
|
|
185
184
|
export { MutationFunctionContext } from './_tsup-dts-rollup.cjs';
|
|
186
185
|
export { MutationFunction } from './_tsup-dts-rollup.cjs';
|
|
187
|
-
export { MutationOptions } from './_tsup-dts-rollup.cjs';
|
|
188
186
|
export { MutationObserverOptions } from './_tsup-dts-rollup.cjs';
|
|
189
187
|
export { MutateOptions } from './_tsup-dts-rollup.cjs';
|
|
190
188
|
export { MutateFunction } from './_tsup-dts-rollup.cjs';
|
package/build/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { DefinedUseBaseQueryResult } from './_tsup-dts-rollup.js';
|
|
2
2
|
export { DefinedUseInfiniteQueryResult } from './_tsup-dts-rollup.js';
|
|
3
3
|
export { DefinedUseQueryResult } from './_tsup-dts-rollup.js';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
4
|
+
export { InfiniteQueryOptions } from './_tsup-dts-rollup.js';
|
|
5
|
+
export { MutationOptions } from './_tsup-dts-rollup.js';
|
|
6
|
+
export { QueryOptions } from './_tsup-dts-rollup.js';
|
|
7
7
|
export { UseBaseMutationResult } from './_tsup-dts-rollup.js';
|
|
8
8
|
export { UseBaseQueryOptions } from './_tsup-dts-rollup.js';
|
|
9
9
|
export { UseBaseQueryResult } from './_tsup-dts-rollup.js';
|
|
@@ -139,7 +139,6 @@ export { InfiniteData } from './_tsup-dts-rollup.js';
|
|
|
139
139
|
export { QueryMeta } from './_tsup-dts-rollup.js';
|
|
140
140
|
export { NetworkMode } from './_tsup-dts-rollup.js';
|
|
141
141
|
export { NotifyOnChangeProps } from './_tsup-dts-rollup.js';
|
|
142
|
-
export { QueryOptions } from './_tsup-dts-rollup.js';
|
|
143
142
|
export { InitialPageParam } from './_tsup-dts-rollup.js';
|
|
144
143
|
export { InfiniteQueryPageParamsOptions } from './_tsup-dts-rollup.js';
|
|
145
144
|
export { ThrowOnError } from './_tsup-dts-rollup.js';
|
|
@@ -184,7 +183,6 @@ export { MutationScope } from './_tsup-dts-rollup.js';
|
|
|
184
183
|
export { MutationMeta } from './_tsup-dts-rollup.js';
|
|
185
184
|
export { MutationFunctionContext } from './_tsup-dts-rollup.js';
|
|
186
185
|
export { MutationFunction } from './_tsup-dts-rollup.js';
|
|
187
|
-
export { MutationOptions } from './_tsup-dts-rollup.js';
|
|
188
186
|
export { MutationObserverOptions } from './_tsup-dts-rollup.js';
|
|
189
187
|
export { MutateOptions } from './_tsup-dts-rollup.js';
|
|
190
188
|
export { MutateFunction } from './_tsup-dts-rollup.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/solid-query",
|
|
3
|
-
"version": "5.100.
|
|
3
|
+
"version": "5.100.6",
|
|
4
4
|
"description": "Primitives for managing, caching and syncing asynchronous and remote data in Solid",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"!src/__tests__"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@tanstack/query-core": "5.100.
|
|
49
|
+
"@tanstack/query-core": "5.100.6"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@solidjs/testing-library": "^0.8.10",
|
package/src/index.ts
CHANGED
|
@@ -15,9 +15,9 @@ export type {
|
|
|
15
15
|
DefinedUseBaseQueryResult,
|
|
16
16
|
DefinedUseInfiniteQueryResult,
|
|
17
17
|
DefinedUseQueryResult,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
InfiniteQueryOptions,
|
|
19
|
+
MutationOptions,
|
|
20
|
+
QueryOptions,
|
|
21
21
|
UseBaseMutationResult,
|
|
22
22
|
UseBaseQueryOptions,
|
|
23
23
|
UseBaseQueryResult,
|
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
NonUndefinedGuard,
|
|
6
6
|
QueryKey,
|
|
7
7
|
} from '@tanstack/query-core'
|
|
8
|
-
import type {
|
|
8
|
+
import type { InfiniteQueryOptions } from './types'
|
|
9
9
|
import type { Accessor } from 'solid-js'
|
|
10
10
|
|
|
11
11
|
export type UndefinedInitialDataInfiniteOptions<
|
|
@@ -15,13 +15,7 @@ export type UndefinedInitialDataInfiniteOptions<
|
|
|
15
15
|
TQueryKey extends QueryKey = QueryKey,
|
|
16
16
|
TPageParam = unknown,
|
|
17
17
|
> = Accessor<
|
|
18
|
-
|
|
19
|
-
TQueryFnData,
|
|
20
|
-
TError,
|
|
21
|
-
TData,
|
|
22
|
-
TQueryKey,
|
|
23
|
-
TPageParam
|
|
24
|
-
> & {
|
|
18
|
+
InfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & {
|
|
25
19
|
initialData?: undefined
|
|
26
20
|
}
|
|
27
21
|
>
|
|
@@ -34,13 +28,7 @@ export type DefinedInitialDataInfiniteOptions<
|
|
|
34
28
|
TQueryKey extends QueryKey = QueryKey,
|
|
35
29
|
TPageParam = unknown,
|
|
36
30
|
> = Accessor<
|
|
37
|
-
|
|
38
|
-
TQueryFnData,
|
|
39
|
-
TError,
|
|
40
|
-
TData,
|
|
41
|
-
TQueryKey,
|
|
42
|
-
TPageParam
|
|
43
|
-
> & {
|
|
31
|
+
InfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & {
|
|
44
32
|
initialData:
|
|
45
33
|
| NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>
|
|
46
34
|
| (() => NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>)
|
package/src/mutationOptions.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DefaultError, WithRequired } from '@tanstack/query-core'
|
|
2
|
-
import type {
|
|
2
|
+
import type { MutationOptions } from './types'
|
|
3
3
|
|
|
4
4
|
export function mutationOptions<
|
|
5
5
|
TData = unknown,
|
|
@@ -8,11 +8,11 @@ export function mutationOptions<
|
|
|
8
8
|
TOnMutateResult = unknown,
|
|
9
9
|
>(
|
|
10
10
|
options: WithRequired<
|
|
11
|
-
|
|
11
|
+
MutationOptions<TData, TError, TVariables, TOnMutateResult>,
|
|
12
12
|
'mutationKey'
|
|
13
13
|
>,
|
|
14
14
|
): WithRequired<
|
|
15
|
-
|
|
15
|
+
MutationOptions<TData, TError, TVariables, TOnMutateResult>,
|
|
16
16
|
'mutationKey'
|
|
17
17
|
>
|
|
18
18
|
export function mutationOptions<
|
|
@@ -22,11 +22,11 @@ export function mutationOptions<
|
|
|
22
22
|
TOnMutateResult = unknown,
|
|
23
23
|
>(
|
|
24
24
|
options: Omit<
|
|
25
|
-
|
|
25
|
+
MutationOptions<TData, TError, TVariables, TOnMutateResult>,
|
|
26
26
|
'mutationKey'
|
|
27
27
|
>,
|
|
28
28
|
): Omit<
|
|
29
|
-
|
|
29
|
+
MutationOptions<TData, TError, TVariables, TOnMutateResult>,
|
|
30
30
|
'mutationKey'
|
|
31
31
|
>
|
|
32
32
|
export function mutationOptions<
|
|
@@ -35,7 +35,7 @@ export function mutationOptions<
|
|
|
35
35
|
TVariables = void,
|
|
36
36
|
TOnMutateResult = unknown,
|
|
37
37
|
>(
|
|
38
|
-
options:
|
|
39
|
-
):
|
|
38
|
+
options: MutationOptions<TData, TError, TVariables, TOnMutateResult>,
|
|
39
|
+
): MutationOptions<TData, TError, TVariables, TOnMutateResult> {
|
|
40
40
|
return options
|
|
41
41
|
}
|
package/src/queryOptions.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DataTag, DefaultError, QueryKey } from '@tanstack/query-core'
|
|
2
|
-
import type {
|
|
2
|
+
import type { QueryOptions } from './types'
|
|
3
3
|
import type { Accessor } from 'solid-js'
|
|
4
4
|
|
|
5
5
|
export type UndefinedInitialDataOptions<
|
|
@@ -8,7 +8,7 @@ export type UndefinedInitialDataOptions<
|
|
|
8
8
|
TData = TQueryFnData,
|
|
9
9
|
TQueryKey extends QueryKey = QueryKey,
|
|
10
10
|
> = Accessor<
|
|
11
|
-
|
|
11
|
+
QueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
|
|
12
12
|
initialData?: undefined
|
|
13
13
|
}
|
|
14
14
|
>
|
|
@@ -19,7 +19,7 @@ export type DefinedInitialDataOptions<
|
|
|
19
19
|
TData = TQueryFnData,
|
|
20
20
|
TQueryKey extends QueryKey = QueryKey,
|
|
21
21
|
> = Accessor<
|
|
22
|
-
|
|
22
|
+
QueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
|
|
23
23
|
initialData: TQueryFnData | (() => TQueryFnData)
|
|
24
24
|
}
|
|
25
25
|
>
|
package/src/types.ts
CHANGED
|
@@ -44,7 +44,7 @@ export interface UseBaseQueryOptions<
|
|
|
44
44
|
suspense?: boolean
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
export interface
|
|
47
|
+
export interface QueryOptions<
|
|
48
48
|
TQueryFnData = unknown,
|
|
49
49
|
TError = DefaultError,
|
|
50
50
|
TData = TQueryFnData,
|
|
@@ -62,7 +62,7 @@ export type UseQueryOptions<
|
|
|
62
62
|
TError = DefaultError,
|
|
63
63
|
TData = TQueryFnData,
|
|
64
64
|
TQueryKey extends QueryKey = QueryKey,
|
|
65
|
-
> = Accessor<
|
|
65
|
+
> = Accessor<QueryOptions<TQueryFnData, TError, TData, TQueryKey>>
|
|
66
66
|
|
|
67
67
|
/* --- Create Query and Create Base Query Types --- */
|
|
68
68
|
|
|
@@ -87,7 +87,7 @@ export type DefinedUseQueryResult<
|
|
|
87
87
|
> = DefinedUseBaseQueryResult<TData, TError>
|
|
88
88
|
|
|
89
89
|
/* --- Create Infinite Queries Types --- */
|
|
90
|
-
export interface
|
|
90
|
+
export interface InfiniteQueryOptions<
|
|
91
91
|
TQueryFnData = unknown,
|
|
92
92
|
TError = DefaultError,
|
|
93
93
|
TData = TQueryFnData,
|
|
@@ -126,7 +126,7 @@ export type UseInfiniteQueryOptions<
|
|
|
126
126
|
TQueryKey extends QueryKey = QueryKey,
|
|
127
127
|
TPageParam = unknown,
|
|
128
128
|
> = Accessor<
|
|
129
|
-
|
|
129
|
+
InfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>
|
|
130
130
|
>
|
|
131
131
|
|
|
132
132
|
export type UseInfiniteQueryResult<
|
|
@@ -140,7 +140,7 @@ export type DefinedUseInfiniteQueryResult<
|
|
|
140
140
|
> = DefinedInfiniteQueryObserverResult<TData, TError>
|
|
141
141
|
|
|
142
142
|
/* --- Create Mutation Types --- */
|
|
143
|
-
export interface
|
|
143
|
+
export interface MutationOptions<
|
|
144
144
|
TData = unknown,
|
|
145
145
|
TError = DefaultError,
|
|
146
146
|
TVariables = void,
|
|
@@ -155,7 +155,7 @@ export type UseMutationOptions<
|
|
|
155
155
|
TError = DefaultError,
|
|
156
156
|
TVariables = void,
|
|
157
157
|
TOnMutateResult = unknown,
|
|
158
|
-
> = Accessor<
|
|
158
|
+
> = Accessor<MutationOptions<TData, TError, TVariables, TOnMutateResult>>
|
|
159
159
|
|
|
160
160
|
export type UseMutateFunction<
|
|
161
161
|
TData = unknown,
|
package/src/useQueries.ts
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from 'solid-js'
|
|
14
14
|
import { useQueryClient } from './QueryClientProvider'
|
|
15
15
|
import { useIsRestoring } from './isRestoring'
|
|
16
|
-
import type {
|
|
16
|
+
import type { QueryOptions, UseQueryResult } from './types'
|
|
17
17
|
import type { Accessor } from 'solid-js'
|
|
18
18
|
import type { QueryClient } from './QueryClient'
|
|
19
19
|
import type {
|
|
@@ -36,7 +36,7 @@ type UseQueryOptionsForUseQueries<
|
|
|
36
36
|
TData = TQueryFnData,
|
|
37
37
|
TQueryKey extends QueryKey = QueryKey,
|
|
38
38
|
> = OmitKeyof<
|
|
39
|
-
|
|
39
|
+
QueryOptions<TQueryFnData, TError, TData, TQueryKey>,
|
|
40
40
|
'placeholderData' | 'suspense'
|
|
41
41
|
> & {
|
|
42
42
|
placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction<TQueryFnData>
|