query.service.d.ts 1.3 KB

12345678910111213141516171819202122
  1. import { QueryClient, QueryKey, QueryObserver, QueryObserverOptions, QueryObserverResult, MutationObserver, MutationObserverOptions, MutationObserverResult } from '@tanstack/query-core';
  2. export declare class QueryService {
  3. private queryClient;
  4. constructor(queryClient?: QueryClient);
  5. subscribeQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>({ options, listener, }: {
  6. options: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>;
  7. listener: (result: QueryObserverResult<TData>) => void;
  8. }): {
  9. result: QueryObserverResult<TData, TError>;
  10. unsubscribe: () => void;
  11. queryObserver: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>;
  12. };
  13. subscribeMutation<TData = unknown, TError = unknown, TVariables = void, TContext = unknown>({ options, listener, }: {
  14. options: MutationObserverOptions<TData, TError, TVariables, TContext>;
  15. listener: (result: MutationObserverResult<TData, TError, TVariables, TContext>) => void;
  16. }): {
  17. result: MutationObserverResult<TData, TError, TVariables, TContext>;
  18. unsubscribe: () => void;
  19. mutationObserver: MutationObserver<TData, TError, TVariables, TContext>;
  20. };
  21. }
  22. //# sourceMappingURL=query.service.d.ts.map