import * as _tanstack_react_query_v5 from '@tanstack/react-query'; import { UseQueryOptions, UseSuspenseQueryOptions, UseInfiniteQueryOptions, InfiniteData, UseSuspenseInfiniteQueryOptions, 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; /** * Hooks context. */ declare function getHooksContext(): { fetch?: FetchFn; logging?: boolean; endpoint: string; }; /** * Context provider. */ declare const Provider: react.Provider; /** * 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_v5.UseQueryResult; /** * Creates a react-query suspense 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 useSuspenseQuery hook */ declare function useSuspenseModelQuery(model: string, url: string, args?: unknown, options?: Omit, 'queryKey'> & ExtraQueryOptions, fetch?: FetchFn): _tanstack_react_query_v5.UseSuspenseQueryResult; /** * 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' | 'initialPageParam'>, fetch?: FetchFn): _tanstack_react_query_v5.UseInfiniteQueryResult, TError>; /** * Creates a react-query infinite suspense 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 useSuspenseInfiniteQuery hook */ declare function useSuspenseInfiniteModelQuery(model: string, url: string, args: unknown, options: Omit>, 'queryKey' | 'initialPageParam'>, fetch?: FetchFn): _tanstack_react_query_v5.UseSuspenseInfiniteQueryResult, TError>; /** * Creates a react-query mutation * * @param model The name of the model under mutation. * @param method The HTTP method. * @param url The request URL. * @param modelMeta The model metadata. * @param options The react-query options. * @param fetch The fetch function to use for sending the HTTP request * @param checkReadBack Whether to check for read back errors and return undefined if found. */ declare function useModelMutation(model: string, method: 'POST' | 'PUT' | 'DELETE', url: string, modelMeta: ModelMeta, options?: Omit, 'mutationFn'> & ExtraMutationOptions, fetch?: FetchFn, checkReadBack?: C): _tanstack_react_query_v5.UseMutationResult; export { Provider, RequestHandlerContext, getHooksContext, useInfiniteModelQuery, useModelMutation, useModelQuery, useSuspenseInfiniteModelQuery, useSuspenseModelQuery };