import * as _tanstack_svelte_query from '@tanstack/svelte-query'; import { CreateQueryOptions, CreateInfiniteQueryOptions, MutationOptions } from '@tanstack/svelte-query'; import { ModelMeta } from '@zenstackhq/runtime/cross'; import { A as APIContext, F as FetchFn, a as ExtraQueryOptions, E as ExtraMutationOptions } from './common-CXlL7vTW.mjs'; /** * Key for setting and getting the global query context. */ declare const SvelteQueryContextKey = "zenstack-svelte-query-context"; /** * Set context for the generated TanStack Query hooks. */ declare function setHooksContext(context: APIContext): void; /** * Hooks context. */ declare function getHooksContext(): { fetch?: FetchFn; logging?: boolean; endpoint: string; }; /** * Creates a svelte-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 svelte-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_svelte_query.CreateQueryResult; /** * Creates a svelte-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 svelte-query infinite query options object * @param fetch The fetch function to use for sending the HTTP request * @returns useQuery hook */ declare function useInfiniteModelQuery(model: string, url: string, args?: unknown, options?: Omit, 'queryKey'>, fetch?: FetchFn): _tanstack_svelte_query.CreateInfiniteQueryResult; /** * Creates a POST mutation with svelte-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 svelte-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_svelte_query.CreateMutationResult; export { APIContext as RequestHandlerContext, SvelteQueryContextKey, getHooksContext, setHooksContext, useInfiniteModelQuery, useModelMutation, useModelQuery };