import * as _tanstack_react_query from '@tanstack/react-query'; import { UseQueryOptions, UseInfiniteQueryOptions, UseMutationOptions } from '@tanstack/react-query'; import * as react from 'react'; import { ModelMeta } from '@zenstackhq/runtime/cross'; import { A as APIContext, F as FetchFn, a as ExtraQueryOptions, E as ExtraMutationOptions } from './common-CXlL7vTW.mjs'; /** * Context for configuring react hooks. */ declare const RequestHandlerContext: react.Context; /** * Context provider. */ declare const Provider: react.Provider; /** * Hooks context. */ declare function getHooksContext(): { fetch?: FetchFn; logging?: boolean; endpoint: string; }; /** * Creates a react-query query. * * @param model The name of the model under query. * @param url The request URL. * @param args The request args object, URL-encoded and appended as "?q=" parameter * @param options The react-query options object * @param fetch The fetch function to use for sending the HTTP request * @returns useQuery hook */ declare function useModelQuery(model: string, url: string, args?: unknown, options?: Omit, 'queryKey'> & ExtraQueryOptions, fetch?: FetchFn): _tanstack_react_query.UseQueryResult; /** * Creates a react-query infinite query. * * @param model The name of the model under query. * @param url The request URL. * @param args The initial request args object, URL-encoded and appended as "?q=" parameter * @param options The react-query infinite query options object * @param fetch The fetch function to use for sending the HTTP request * @returns useInfiniteQuery hook */ declare function useInfiniteModelQuery(model: string, url: string, args?: unknown, options?: Omit, 'queryKey'>, fetch?: FetchFn): _tanstack_react_query.UseInfiniteQueryResult; /** * Creates a mutation with react-query. * * @param model The name of the model under mutation. * @param method The HTTP method. * @param modelMeta The model metadata. * @param url The request URL. * @param options The react-query options. * @param checkReadBack Whether to check for read back errors and return undefined if found. * @returns useMutation hooks */ declare function useModelMutation(model: string, method: 'POST' | 'PUT' | 'DELETE', url: string, modelMeta: ModelMeta, options?: Omit, 'mutationFn'> & ExtraMutationOptions, fetch?: FetchFn, checkReadBack?: C): _tanstack_react_query.UseMutationResult; export { Provider, RequestHandlerContext, getHooksContext, useInfiniteModelQuery, useModelMutation, useModelQuery };