import { DefaultError, QueryKey, OmitKeyof, QueryObserverOptions, InfiniteQueryObserverOptions, DefinedInfiniteQueryObserverResult, QueryObserverResult, InfiniteQueryObserverResult, Override, MutationObserverResult, MutateFunction, DefinedQueryObserverResult, NonUndefinedGuard, QueryFunction, InitialDataFunction, SkipToken, DataTag, MutationObserverOptions, InfiniteData, QueryFilters, MutationFilters, MutationState, Mutation, QueriesPlaceholderDataFunction, ThrowOnError, QueryClient } from '@tanstack/query-core'; export * from '@tanstack/query-core'; import { Signal, Injector, Provider, InjectOptions, InjectionToken } from '@angular/core'; import { DevtoolsButtonPosition, DevtoolsPosition, DevtoolsErrorType } from '@tanstack/query-devtools'; type MapToSignals = { [K in keyof T]: T[K] extends Function ? T[K] : Signal; }; /** * @public */ interface CreateBaseQueryOptions extends QueryObserverOptions { } /** * @public */ interface CreateQueryOptions extends OmitKeyof, 'suspense'> { } /** * @public */ type CreateStatusBasedQueryResult = Extract, { status: TStatus; }>; /** * @public */ interface BaseQueryNarrowing { isSuccess: (this: CreateBaseQueryResult) => this is CreateBaseQueryResult>; isError: (this: CreateBaseQueryResult) => this is CreateBaseQueryResult>; isPending: (this: CreateBaseQueryResult) => this is CreateBaseQueryResult>; } /** * @public */ interface CreateInfiniteQueryOptions extends OmitKeyof, 'suspense'> { } /** * @public */ type CreateBaseQueryResult> = BaseQueryNarrowing & MapToSignals>; /** * @public */ type CreateQueryResult = CreateBaseQueryResult; /** * @public */ type DefinedCreateQueryResult> = BaseQueryNarrowing & MapToSignals>; /** * @public */ type CreateInfiniteQueryResult = BaseQueryNarrowing & MapToSignals>; /** * @public */ type DefinedCreateInfiniteQueryResult> = MapToSignals; /** * @public */ type CreateMutateFunction = (...args: Parameters>) => void; /** * @public */ type CreateMutateAsyncFunction = MutateFunction; /** * @public */ type CreateBaseMutationResult = Override, { mutate: CreateMutateFunction; }> & { mutateAsync: CreateMutateAsyncFunction; }; /** * @public */ type CreateStatusBasedMutationResult = Extract, { status: TStatus; }>; type SignalFunction any> = T & Signal>; /** * @public */ interface BaseMutationNarrowing { isSuccess: SignalFunction<(this: CreateMutationResult) => this is CreateMutationResult>>; isError: SignalFunction<(this: CreateMutationResult) => this is CreateMutationResult>>; isPending: SignalFunction<(this: CreateMutationResult) => this is CreateMutationResult>>; isIdle: SignalFunction<(this: CreateMutationResult) => this is CreateMutationResult>>; } /** * @public */ type CreateMutationResult> = BaseMutationNarrowing & MapToSignals>; type UndefinedInitialDataOptions = CreateQueryOptions & { initialData?: undefined | InitialDataFunction> | NonUndefinedGuard; }; type UnusedSkipTokenOptions = OmitKeyof, 'queryFn'> & { queryFn?: Exclude['queryFn'], SkipToken | undefined>; }; type DefinedInitialDataOptions = Omit, 'queryFn'> & { initialData: NonUndefinedGuard | (() => NonUndefinedGuard); queryFn?: QueryFunction; }; /** * Allows to share and re-use query options in a type-safe way. * * The `queryKey` will be tagged with the type from `queryFn`. * * **Example** * * ```ts * const { queryKey } = queryOptions({ * queryKey: ['key'], * queryFn: () => Promise.resolve(5), * // ^? Promise * }) * * const queryClient = new QueryClient() * const data = queryClient.getQueryData(queryKey) * // ^? number | undefined * ``` * @param options - The query options to tag with the type from `queryFn`. * @returns The tagged query options. * @public */ declare function queryOptions(options: DefinedInitialDataOptions): DefinedInitialDataOptions & { queryKey: DataTag; }; /** * Allows to share and re-use query options in a type-safe way. * * The `queryKey` will be tagged with the type from `queryFn`. * * **Example** * * ```ts * const { queryKey } = queryOptions({ * queryKey: ['key'], * queryFn: () => Promise.resolve(5), * // ^? Promise * }) * * const queryClient = new QueryClient() * const data = queryClient.getQueryData(queryKey) * // ^? number | undefined * ``` * @param options - The query options to tag with the type from `queryFn`. * @returns The tagged query options. * @public */ declare function queryOptions(options: UnusedSkipTokenOptions): UnusedSkipTokenOptions & { queryKey: DataTag; }; /** * Allows to share and re-use query options in a type-safe way. * * The `queryKey` will be tagged with the type from `queryFn`. * * **Example** * * ```ts * const { queryKey } = queryOptions({ * queryKey: ['key'], * queryFn: () => Promise.resolve(5), * // ^? Promise * }) * * const queryClient = new QueryClient() * const data = queryClient.getQueryData(queryKey) * // ^? number | undefined * ``` * @param options - The query options to tag with the type from `queryFn`. * @returns The tagged query options. * @public */ declare function queryOptions(options: UndefinedInitialDataOptions): UndefinedInitialDataOptions & { queryKey: DataTag; }; /** * Allows to share and re-use mutation options in a type-safe way. * * **Example** * * ```ts * export class QueriesService { * private http = inject(HttpClient); * * updatePost(id: number) { * return mutationOptions({ * mutationFn: (post: Post) => Promise.resolve(post), * mutationKey: ["updatePost", id], * onSuccess: (newPost) => { * // ^? newPost: Post * this.queryClient.setQueryData(["posts", id], newPost); * }, * }); * } * } * * queries = inject(QueriesService) * idSignal = new Signal(0); * mutation = injectMutation(() => this.queries.updatePost(this.idSignal())) * * mutation.mutate({ title: 'New Title' }) * ``` * @param options - The mutation options. * @returns Mutation options. * @public */ declare function mutationOptions(options: MutationObserverOptions): CreateMutationOptions; /** * @public */ interface CreateMutationOptions extends OmitKeyof, '_defaulted'> { } type UndefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = CreateInfiniteQueryOptions & { initialData?: undefined | NonUndefinedGuard> | InitialDataFunction>>; }; type UnusedSkipTokenInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = OmitKeyof, 'queryFn'> & { queryFn?: Exclude['queryFn'], SkipToken | undefined>; }; type DefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = CreateInfiniteQueryOptions & { initialData: NonUndefinedGuard> | (() => NonUndefinedGuard>) | undefined; }; /** * Allows to share and re-use infinite query options in a type-safe way. * * The `queryKey` will be tagged with the type from `queryFn`. * @param options - The infinite query options to tag with the type from `queryFn`. * @returns The tagged infinite query options. * @public */ declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions): DefinedInitialDataInfiniteOptions & { queryKey: DataTag, TError>; }; /** * Allows to share and re-use infinite query options in a type-safe way. * * The `queryKey` will be tagged with the type from `queryFn`. * @param options - The infinite query options to tag with the type from `queryFn`. * @returns The tagged infinite query options. * @public */ declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UnusedSkipTokenInfiniteOptions): UnusedSkipTokenInfiniteOptions & { queryKey: DataTag, TError>; }; /** * Allows to share and re-use infinite query options in a type-safe way. * * The `queryKey` will be tagged with the type from `queryFn`. * @param options - The infinite query options to tag with the type from `queryFn`. * @returns The tagged infinite query options. * @public */ declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions): UndefinedInitialDataInfiniteOptions & { queryKey: DataTag, TError>; }; interface InjectInfiniteQueryOptions { /** * The `Injector` in which to create the infinite query. * * If this is not provided, the current injection context will be used instead (via `inject`). */ injector?: Injector; } /** * Injects an infinite query: a declarative dependency on an asynchronous source of data that is tied to a unique key. * Infinite queries can additively "load more" data onto an existing set of data or "infinite scroll" * @param injectInfiniteQueryFn - A function that returns infinite query options. * @param options - Additional configuration. * @returns The infinite query result. * @public */ declare function injectInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(injectInfiniteQueryFn: () => DefinedInitialDataInfiniteOptions, options?: InjectInfiniteQueryOptions): DefinedCreateInfiniteQueryResult; /** * Injects an infinite query: a declarative dependency on an asynchronous source of data that is tied to a unique key. * Infinite queries can additively "load more" data onto an existing set of data or "infinite scroll" * @param injectInfiniteQueryFn - A function that returns infinite query options. * @param options - Additional configuration. * @returns The infinite query result. * @public */ declare function injectInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(injectInfiniteQueryFn: () => UndefinedInitialDataInfiniteOptions, options?: InjectInfiniteQueryOptions): CreateInfiniteQueryResult; /** * Injects an infinite query: a declarative dependency on an asynchronous source of data that is tied to a unique key. * Infinite queries can additively "load more" data onto an existing set of data or "infinite scroll" * @param injectInfiniteQueryFn - A function that returns infinite query options. * @param options - Additional configuration. * @returns The infinite query result. * @public */ declare function injectInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(injectInfiniteQueryFn: () => CreateInfiniteQueryOptions, options?: InjectInfiniteQueryOptions): CreateInfiniteQueryResult; interface InjectIsFetchingOptions { /** * The `Injector` in which to create the isFetching signal. * * If this is not provided, the current injection context will be used instead (via `inject`). */ injector?: Injector; } /** * Injects a signal that tracks the number of queries that your application is loading or * fetching in the background. * * Can be used for app-wide loading indicators * @param filters - The filters to apply to the query. * @param options - Additional configuration * @returns signal with number of loading or fetching queries. * @public */ declare function injectIsFetching(filters?: QueryFilters, options?: InjectIsFetchingOptions): Signal; interface InjectIsMutatingOptions { /** * The `Injector` in which to create the isMutating signal. * * If this is not provided, the current injection context will be used instead (via `inject`). */ injector?: Injector; } /** * Injects a signal that tracks the number of mutations that your application is fetching. * * Can be used for app-wide loading indicators * @param filters - The filters to apply to the query. * @param options - Additional configuration * @returns signal with number of fetching mutations. * @public */ declare function injectIsMutating(filters?: MutationFilters, options?: InjectIsMutatingOptions): Signal; /** * The `Injector` in which to create the isRestoring signal. * * If this is not provided, the current injection context will be used instead (via `inject`). */ interface InjectIsRestoringOptions { injector?: Injector; } /** * Injects a signal that tracks whether a restore is currently in progress. {@link injectQuery} and friends also check this internally to avoid race conditions between the restore and initializing queries. * @param options - Options for injectIsRestoring. * @returns signal with boolean that indicates whether a restore is in progress. * @public */ declare function injectIsRestoring(options?: InjectIsRestoringOptions): Signal; /** * Used by TanStack Query Angular persist client plugin to provide the signal that tracks the restore state * @param isRestoring - a readonly signal that returns a boolean * @returns Provider for the `isRestoring` signal * @public */ declare function provideIsRestoring(isRestoring: Signal): Provider; interface InjectMutationOptions { /** * The `Injector` in which to create the mutation. * * If this is not provided, the current injection context will be used instead (via `inject`). */ injector?: Injector; } /** * Injects a mutation: an imperative function that can be invoked which typically performs server side effects. * * Unlike queries, mutations are not run automatically. * @param injectMutationFn - A function that returns mutation options. * @param options - Additional configuration * @returns The mutation. * @public */ declare function injectMutation(injectMutationFn: () => CreateMutationOptions, options?: InjectMutationOptions): CreateMutationResult; type MutationStateOptions = { filters?: MutationFilters; select?: (mutation: Mutation) => TResult; }; /** * @public */ interface InjectMutationStateOptions { /** * The `Injector` in which to create the mutation state signal. * * If this is not provided, the current injection context will be used instead (via `inject`). */ injector?: Injector; } /** * Injects a signal that tracks the state of all mutations. * @param injectMutationStateFn - A function that returns mutation state options. * @param options - The Angular injector to use. * @returns The signal that tracks the state of all mutations. * @public */ declare function injectMutationState(injectMutationStateFn?: () => MutationStateOptions, options?: InjectMutationStateOptions): Signal>; type QueryObserverOptionsForCreateQueries = OmitKeyof, 'placeholderData'> & { placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction; }; type MAXIMUM_DEPTH = 20; type SkipTokenForUseQueries = symbol; type GetOptions = T extends { queryFnData: infer TQueryFnData; error?: infer TError; data: infer TData; } ? QueryObserverOptionsForCreateQueries : T extends { queryFnData: infer TQueryFnData; error?: infer TError; } ? QueryObserverOptionsForCreateQueries : T extends { data: infer TData; error?: infer TError; } ? QueryObserverOptionsForCreateQueries : T extends [infer TQueryFnData, infer TError, infer TData] ? QueryObserverOptionsForCreateQueries : T extends [infer TQueryFnData, infer TError] ? QueryObserverOptionsForCreateQueries : T extends [infer TQueryFnData] ? QueryObserverOptionsForCreateQueries : T extends { queryFn?: QueryFunction | SkipTokenForUseQueries; select: (data: any) => infer TData; throwOnError?: ThrowOnError; } ? QueryObserverOptionsForCreateQueries : QueryObserverOptionsForCreateQueries; type GetResults = T extends { queryFnData: any; error?: infer TError; data: infer TData; } ? QueryObserverResult : T extends { queryFnData: infer TQueryFnData; error?: infer TError; } ? QueryObserverResult : T extends { data: infer TData; error?: infer TError; } ? QueryObserverResult : T extends [any, infer TError, infer TData] ? QueryObserverResult : T extends [infer TQueryFnData, infer TError] ? QueryObserverResult : T extends [infer TQueryFnData] ? QueryObserverResult : T extends { queryFn?: QueryFunction | SkipTokenForUseQueries; select: (data: any) => infer TData; throwOnError?: ThrowOnError; } ? QueryObserverResult : QueryObserverResult; /** * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param * @public */ type QueriesOptions, TResult extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResult, GetOptions] : T extends [infer Head, ...infer Tail] ? QueriesOptions<[ ...Tail ], [ ...TResult, GetOptions ], [ ...TDepth, 1 ]> : ReadonlyArray extends T ? T : T extends Array> ? Array> : Array; /** * QueriesResults reducer recursively maps type param to results * @public */ type QueriesResults, TResult extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResult, GetResults] : T extends [infer Head, ...infer Tail] ? QueriesResults<[ ...Tail ], [ ...TResult, GetResults ], [ ...TDepth, 1 ]> : T extends Array> ? Array> : Array; /** * @param root0 * @param root0.queries * @param root0.combine * @param injector * @param injector * @public */ declare function injectQueries, TCombinedResult = QueriesResults>({ queries, ...options }: { queries: Signal<[...QueriesOptions]>; combine?: (result: QueriesResults) => TCombinedResult; }, injector?: Injector): Signal; interface InjectQueryOptions { /** * The `Injector` in which to create the query. * * If this is not provided, the current injection context will be used instead (via `inject`). */ injector?: Injector; } /** * Injects a query: a declarative dependency on an asynchronous source of data that is tied to a unique key. * * **Basic example** * ```ts * class ServiceOrComponent { * query = injectQuery(() => ({ * queryKey: ['repoData'], * queryFn: () => * this.#http.get('https://api.github.com/repos/tanstack/query'), * })) * } * ``` * * Similar to `computed` from Angular, the function passed to `injectQuery` will be run in the reactive context. * In the example below, the query will be automatically enabled and executed when the filter signal changes * to a truthy value. When the filter signal changes back to a falsy value, the query will be disabled. * * **Reactive example** * ```ts * class ServiceOrComponent { * filter = signal('') * * todosQuery = injectQuery(() => ({ * queryKey: ['todos', this.filter()], * queryFn: () => fetchTodos(this.filter()), * // Signals can be combined with expressions * enabled: !!this.filter(), * })) * } * ``` * @param injectQueryFn - A function that returns query options. * @param options - Additional configuration * @returns The query result. * @public * @see https://tanstack.com/query/latest/docs/framework/angular/guides/queries */ declare function injectQuery(injectQueryFn: () => DefinedInitialDataOptions, options?: InjectQueryOptions): DefinedCreateQueryResult; /** * Injects a query: a declarative dependency on an asynchronous source of data that is tied to a unique key. * * **Basic example** * ```ts * class ServiceOrComponent { * query = injectQuery(() => ({ * queryKey: ['repoData'], * queryFn: () => * this.#http.get('https://api.github.com/repos/tanstack/query'), * })) * } * ``` * * Similar to `computed` from Angular, the function passed to `injectQuery` will be run in the reactive context. * In the example below, the query will be automatically enabled and executed when the filter signal changes * to a truthy value. When the filter signal changes back to a falsy value, the query will be disabled. * * **Reactive example** * ```ts * class ServiceOrComponent { * filter = signal('') * * todosQuery = injectQuery(() => ({ * queryKey: ['todos', this.filter()], * queryFn: () => fetchTodos(this.filter()), * // Signals can be combined with expressions * enabled: !!this.filter(), * })) * } * ``` * @param injectQueryFn - A function that returns query options. * @param options - Additional configuration * @returns The query result. * @public * @see https://tanstack.com/query/latest/docs/framework/angular/guides/queries */ declare function injectQuery(injectQueryFn: () => UndefinedInitialDataOptions, options?: InjectQueryOptions): CreateQueryResult; /** * Injects a query: a declarative dependency on an asynchronous source of data that is tied to a unique key. * * **Basic example** * ```ts * class ServiceOrComponent { * query = injectQuery(() => ({ * queryKey: ['repoData'], * queryFn: () => * this.#http.get('https://api.github.com/repos/tanstack/query'), * })) * } * ``` * * Similar to `computed` from Angular, the function passed to `injectQuery` will be run in the reactive context. * In the example below, the query will be automatically enabled and executed when the filter signal changes * to a truthy value. When the filter signal changes back to a falsy value, the query will be disabled. * * **Reactive example** * ```ts * class ServiceOrComponent { * filter = signal('') * * todosQuery = injectQuery(() => ({ * queryKey: ['todos', this.filter()], * queryFn: () => fetchTodos(this.filter()), * // Signals can be combined with expressions * enabled: !!this.filter(), * })) * } * ``` * @param injectQueryFn - A function that returns query options. * @param options - Additional configuration * @returns The query result. * @public * @see https://tanstack.com/query/latest/docs/framework/angular/guides/queries */ declare function injectQuery(injectQueryFn: () => CreateQueryOptions, options?: InjectQueryOptions): CreateQueryResult; /** * Injects a `QueryClient` instance and allows passing a custom injector. * @param injectOptions - Type of the options argument to inject and optionally a custom injector. * @returns The `QueryClient` instance. * @public * @deprecated Use `inject(QueryClient)` instead. * If you need to get a `QueryClient` from a custom injector, use `injector.get(QueryClient)`. * * * **Example** * ```ts * const queryClient = injectQueryClient(); * ``` */ declare function injectQueryClient(injectOptions?: InjectOptions & { injector?: Injector; }): QueryClient; /** * Usually {@link provideTanStackQuery} is used once to set up TanStack Query and the * {@link https://tanstack.com/query/latest/docs/reference/QueryClient|QueryClient} * for the entire application. Internally it calls `provideQueryClient`. * You can use `provideQueryClient` to provide a different `QueryClient` instance for a part * of the application or for unit testing purposes. * @param queryClient - A `QueryClient` instance, or an `InjectionToken` which provides a `QueryClient`. * @returns a provider object that can be used to provide the `QueryClient` instance. */ declare function provideQueryClient(queryClient: QueryClient | InjectionToken): Provider; /** * Sets up providers necessary to enable TanStack Query functionality for Angular applications. * * Allows to configure a `QueryClient` and optional features such as developer tools. * * **Example - standalone** * * ```ts * import { * provideTanStackQuery, * QueryClient, * } from '@tanstack/angular-query-experimental' * * bootstrapApplication(AppComponent, { * providers: [provideTanStackQuery(new QueryClient())], * }) * ``` * * **Example - NgModule-based** * * ```ts * import { * provideTanStackQuery, * QueryClient, * } from '@tanstack/angular-query-experimental' * * @NgModule({ * declarations: [AppComponent], * imports: [BrowserModule], * providers: [provideTanStackQuery(new QueryClient())], * bootstrap: [AppComponent], * }) * export class AppModule {} * ``` * * You can also enable optional developer tools by adding `withDevtools`. By * default the tools will then be loaded when your app is in development mode. * ```ts * import { * provideTanStackQuery, * withDevtools * QueryClient, * } from '@tanstack/angular-query-experimental' * * bootstrapApplication(AppComponent, * { * providers: [ * provideTanStackQuery(new QueryClient(), withDevtools()) * ] * } * ) * ``` * * **Example: using an InjectionToken** * * ```ts * export const MY_QUERY_CLIENT = new InjectionToken('', { * factory: () => new QueryClient(), * }) * * // In a lazy loaded route or lazy loaded component's providers array: * providers: [provideTanStackQuery(MY_QUERY_CLIENT)] * ``` * @param queryClient - A `QueryClient` instance, or an `InjectionToken` which provides a `QueryClient`. * @param features - Optional features to configure additional Query functionality. * @returns A set of providers to set up TanStack Query. * @see https://tanstack.com/query/v5/docs/framework/angular/quick-start * @see withDevtools */ declare function provideTanStackQuery(queryClient: QueryClient | InjectionToken, ...features: Array): Array; /** * Helper type to represent a Query feature. */ interface QueryFeature { ɵkind: TFeatureKind; ɵproviders: Array; } /** * Helper function to create an object that represents a Query feature. * @param kind - * @param providers - * @returns A Query feature. */ declare function queryFeature(kind: TFeatureKind, providers: Array): QueryFeature; /** * A type alias that represents a feature which enables developer tools. * The type is used to describe the return value of the `withDevtools` function. * @public * @see {@link withDevtools} */ type DeveloperToolsFeature = QueryFeature<'DeveloperTools'>; /** * A type alias that represents a feature which enables persistence. * The type is used to describe the return value of the `withPersistQueryClient` function. * @public */ type PersistQueryClientFeature = QueryFeature<'PersistQueryClient'>; /** * Options for configuring the TanStack Query devtools. * @public */ interface DevtoolsOptions { /** * Set this true if you want the devtools to default to being open */ initialIsOpen?: boolean; /** * The position of the TanStack logo to open and close the devtools panel. * `top-left` | `top-right` | `bottom-left` | `bottom-right` | `relative` * Defaults to `bottom-right`. */ buttonPosition?: DevtoolsButtonPosition; /** * The position of the TanStack Query devtools panel. * `top` | `bottom` | `left` | `right` * Defaults to `bottom`. */ position?: DevtoolsPosition; /** * Custom instance of QueryClient */ client?: QueryClient; /** * Use this so you can define custom errors that can be shown in the devtools. */ errorTypes?: Array; /** * Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles. */ styleNonce?: string; /** * Use this so you can attach the devtool's styles to a specific element in the DOM. */ shadowDOMTarget?: ShadowRoot; /** * Whether the developer tools should load. * - `auto`- (Default) Lazily loads devtools when in development mode. Skips loading in production mode. * - `true`- Always load the devtools, regardless of the environment. * - `false`- Never load the devtools, regardless of the environment. * * You can use `true` and `false` to override loading developer tools from an environment file. * For example, a test environment might run in production mode but you may want to load developer tools. * * Additionally, you can use a signal in the callback to dynamically load the devtools based on a condition. For example, * a signal created from a RxJS observable that listens for a keyboard shortcut. * * **Example** * ```ts * withDevtools(() => ({ * initialIsOpen: true, * loadDevtools: inject(ExampleService).loadDevtools() * })) * ``` */ loadDevtools?: 'auto' | boolean; } /** * Enables developer tools. * * **Example** * * ```ts * export const appConfig: ApplicationConfig = { * providers: [ * provideTanStackQuery(new QueryClient(), withDevtools()) * ] * } * ``` * By default the devtools will be loaded when Angular runs in development mode and rendered in ``. * * If you need more control over when devtools are loaded, you can use the `loadDevtools` option. This is particularly useful if you want to load devtools based on environment configurations. For instance, you might have a test environment running in production mode but still require devtools to be available. * * If you need more control over where devtools are rendered, consider `injectDevtoolsPanel`. This allows rendering devtools inside your own devtools for example. * @param withDevtoolsFn - A function that returns `DevtoolsOptions`. * @returns A set of providers for use with `provideTanStackQuery`. * @public * @see {@link provideTanStackQuery} * @see {@link DevtoolsOptions} */ declare function withDevtools(withDevtoolsFn?: () => DevtoolsOptions): DeveloperToolsFeature; /** * A type alias that represents all Query features available for use with `provideTanStackQuery`. * Features can be enabled by adding special functions to the `provideTanStackQuery` call. * See documentation for each symbol to find corresponding function name. See also `provideTanStackQuery` * documentation on how to use those functions. * @public * @see {@link provideTanStackQuery} */ type QueryFeatures = DeveloperToolsFeature | PersistQueryClientFeature; declare const queryFeatures: readonly ["DeveloperTools", "PersistQueryClient"]; type QueryFeatureKind = (typeof queryFeatures)[number]; export { type BaseMutationNarrowing, type BaseQueryNarrowing, type CreateBaseMutationResult, type CreateBaseQueryOptions, type CreateBaseQueryResult, type CreateInfiniteQueryOptions, type CreateInfiniteQueryResult, type CreateMutateAsyncFunction, type CreateMutateFunction, type CreateMutationOptions, type CreateMutationResult, type CreateQueryOptions, type CreateQueryResult, type DefinedCreateInfiniteQueryResult, type DefinedCreateQueryResult, type DefinedInitialDataInfiniteOptions, type DefinedInitialDataOptions, type DeveloperToolsFeature, type DevtoolsOptions, type InjectInfiniteQueryOptions, type InjectIsFetchingOptions, type InjectIsMutatingOptions, type InjectMutationOptions, type InjectMutationStateOptions, type InjectQueryOptions, type PersistQueryClientFeature, type QueriesOptions, type QueriesResults, type QueryFeature, type QueryFeatureKind, type QueryFeatures, type UndefinedInitialDataInfiniteOptions, type UndefinedInitialDataOptions, type UnusedSkipTokenInfiniteOptions, type UnusedSkipTokenOptions, infiniteQueryOptions, injectInfiniteQuery, injectIsFetching, injectIsMutating, injectIsRestoring, injectMutation, injectMutationState, injectQueries, injectQuery, injectQueryClient, mutationOptions, provideIsRestoring, provideQueryClient, provideTanStackQuery, queryFeature, queryFeatures, queryOptions, withDevtools };