import { WatchSource, Ref, DeepReadonly, ToRefs } from 'vue'; import { LiveResultContext, LiveResultUpdate } from '../../../client/model/model.js'; /** * Main reactive query method for Vue applications. It can be * used in tandem with {@link makeElectricDependencyInjector} * which injects an {@link ElectricClient} into the component * tree in order to be able to form live queries. * * The provided query will not update reactively, so if you want * the query itself to respond to changes make sure to use the * form that takes a Ref or live query getter as an argument * * @param runQuery - a static live query. * @param runQueryDependencies - Optional list of dependencies that * will cause the query to rerun * * @example Using a simple live query. The table will depend on your application * ```ts * const { results } = useLiveQuery(db.items.liveMany({})) * ``` */ declare function useLiveQuery(runQuery: LiveResultContext, runQueryDependencies?: WatchSource[]): ToRefs>>; /** * Main reactive query method for Vue applications. It can be * used in tandem with {@link makeElectricDependencyInjector} * which injects an {@link ElectricClient} into the component * tree in order to be able to form live queries. * * You can provide a reference to or getter for a live query, and * the query results will update with the query reactively. * * Providing a list of dependencies will cause the query to rerun * reactively only based on those dependencies, and not on the * query itself. * * @param runQueryRef - a reference to or getter for a live query * @param runQueryDependencies - Optional list of dependencies that * will cause the query to rerun - if provided, the the reactivity * of the query reference itself will not cause it to rerun * * @example Using a simple live query with a dependency. The table will depend on your application * ```ts * const limit = ref(5) * const { results } = useLiveQuery(() => db.items.liveMany({ take: limit })) * ``` */ declare function useLiveQuery(runQueryRef: Ref> | (() => LiveResultContext), runQueryDependencies?: WatchSource[]): ToRefs>>; export default useLiveQuery;