@tanstack/angular-query 5.0.0 → 5.108.1

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.
@@ -16,7 +16,7 @@ const typescript_1 = __importDefault(require("typescript"));
16
16
  // The published schematic contains literal values and does not read package.json.
17
17
  const PACKAGE_NAME = '@tanstack/angular-query';
18
18
  const DEVTOOLS_PACKAGE_NAME = '@tanstack/angular-query-devtools';
19
- const DEVTOOLS_PACKAGE_VERSION = '5.0.0';
19
+ const DEVTOOLS_PACKAGE_VERSION = '5.108.1';
20
20
  function hasPackageDependency(tree, name) {
21
21
  const packageJsonPath = tree.exists('/package.json')
22
22
  ? '/package.json'
package/types.d.ts CHANGED
@@ -4,8 +4,15 @@ import { InfiniteQueryResultFields, MutationResultFields, QueryResultFields } fr
4
4
  import { MapToSignals } from './utils/signal-proxy.js';
5
5
  type SignalFunction<T extends () => any> = T & Signal<ReturnType<T>>;
6
6
  /**
7
- * Options accepted by `injectQuery`, with cache data projected through an optional `select`.
8
- * Angular owns result notifications and exposes errors through signals rather than error boundaries.
7
+ * The options accepted by `injectQuery`, with cache data projected through an optional `select`. Same as
8
+ * {@link QueryObserverOptions} from `@tanstack/query-core`, minus `notifyOnChangeProps`, `suspense`, and
9
+ * `throwOnError`: Angular owns result notifications and exposes errors through signals rather than error
10
+ * boundaries.
11
+ * @template TQueryFnData - The type your `queryFn` resolves to.
12
+ * @template TError - The type of errors your `queryFn` may throw.
13
+ * @template TData - The type `data` ends up as after `select` runs. Defaults to `TQueryFnData` when no
14
+ * `select` is used.
15
+ * @template TQueryKey - The type of your `queryKey`.
9
16
  */
10
17
  export type CreateQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = OmitKeyof<QueryObserverOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>, 'notifyOnChangeProps' | 'suspense' | 'throwOnError'>;
11
18
  type CreateStatusBasedQueryResult<TStatus extends QueryObserverResult['status'], TData = unknown, TError = DefaultError> = Extract<QueryObserverResult<TData, TError>, {
@@ -21,7 +28,13 @@ type CreateStatusBasedDefinedInfiniteQueryResult<TStatus extends DefinedInfinite
21
28
  status: TStatus;
22
29
  }>;
23
30
  /**
24
- * Signal-backed guards that narrow a query result and its data and error fields by status.
31
+ * Signal-backed guards that narrow a query result and its data and error fields by status: the
32
+ * `isSuccess`/`isError`/`isPending` methods on a query result. Unlike `react-query`'s derived booleans, each
33
+ * is a `Signal` you call to read its current boolean value reactively, and the call is also a type guard —
34
+ * `if (query.isSuccess())` — so that `query.data` narrows away `undefined` inside the branch, the same way
35
+ * `status` narrowing works on the plain object `react-query` returns.
36
+ * @template TData - The type `data` ends up as after `select` runs.
37
+ * @template TError - The type of errors your `queryFn` may throw.
25
38
  */
26
39
  export interface BaseQueryNarrowing<TData = unknown, TError = DefaultError> {
27
40
  /**
@@ -89,7 +102,17 @@ export interface DefinedInfiniteQueryNarrowing<TData = unknown, TError = Default
89
102
  isPending: SignalFunction<(this: DefinedCreateInfiniteQueryResult<TData, TError>) => this is never>;
90
103
  }
91
104
  /**
92
- * Options accepted by `injectInfiniteQuery`, including page parameters and pagination callbacks.
105
+ * The options accepted by `injectInfiniteQuery`, including page parameters and pagination callbacks. Same as
106
+ * {@link InfiniteQueryObserverOptions} from `@tanstack/query-core` — for the infinite-query-specific options
107
+ * (`getNextPageParam`, `initialPageParam`, etc.) — minus `notifyOnChangeProps`, `suspense`, and
108
+ * `throwOnError`, like {@link CreateQueryOptions}.
109
+ * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.
110
+ * @template TError - The type of errors your `queryFn` may throw.
111
+ * @template TData - The type `data` ends up as after `select` runs. Defaults to `TQueryFnData` here, though
112
+ * `injectInfiniteQuery` itself defaults it to `InfiniteData<TQueryFnData>` — the shape `data` actually has
113
+ * when no `select` is used.
114
+ * @template TQueryKey - The type of your `queryKey`.
115
+ * @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.
93
116
  */
94
117
  export interface CreateInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends OmitKeyof<InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, 'notifyOnChangeProps' | 'suspense' | 'throwOnError'> {
95
118
  }
@@ -189,7 +212,15 @@ type CreateStatusBasedMutationResult<TStatus extends CreateBaseMutationResult['s
189
212
  status: TStatus;
190
213
  }>;
191
214
  /**
192
- * Signal-backed guards that narrow mutation data, errors, and variables by the current status.
215
+ * Signal-backed guards that narrow mutation data, errors, and variables by the current status: the
216
+ * `isSuccess`/`isError`/`isPending`/`isIdle` methods on a mutation result. Each is a `Signal` you call to
217
+ * read its current boolean value reactively, and the call is also a type guard — `if (mutation.isSuccess())`
218
+ * — so that `mutation.data` narrows away `undefined` inside the branch.
219
+ * @template TData - The type your mutation function resolves to.
220
+ * @template TError - The type of errors your mutation function may throw.
221
+ * @template TVariables - The type of the variable passed to `mutate`/`mutateAsync`.
222
+ * @template TOnMutateResult - The type returned by `onMutate`, passed to `onSuccess`/`onError`/`onSettled` as
223
+ * their `onMutateResult` parameter — useful for optimistic-update rollback data.
193
224
  */
194
225
  export interface BaseMutationNarrowing<TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown> {
195
226
  /**