import * as _tanstack_svelte_query_v5 from '@tanstack/svelte-query'; import { StoreOrVal, CreateQueryOptions, CreateInfiniteQueryOptions, InfiniteData, 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?: StoreOrVal, 'queryKey'>> & ExtraQueryOptions, fetch?: FetchFn): _tanstack_svelte_query_v5.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 * @returns useQuery hook */ declare function useInfiniteModelQuery(model: string, url: string, args: unknown, options: StoreOrVal>, 'queryKey' | 'initialPageParam'>>, fetch?: FetchFn): _tanstack_svelte_query_v5.CreateInfiniteQueryResult, TError>; /** * 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. * @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_v5.CreateMutationResult; export { APIContext as RequestHandlerContext, SvelteQueryContextKey, getHooksContext, setHooksContext, useInfiniteModelQuery, useModelMutation, useModelQuery };