import { CompilableQuery } from '@powersync/common';
import { AdditionalOptions, DifferentialHookOptions } from '../watched/watch-types.js';
import { ReadonlySuspenseQueryResult, SuspenseQueryResult } from './SuspenseQueryResult.js';
/**
* A hook to access the results of a watched query that suspends until the initial result has loaded.
* @example
* export const ContentComponent = () => {
* // The lists array here will be a new Array reference whenever a change to the
* // lists table is made.
* const { data: lists } = useSuspenseQuery('SELECT * from lists');
*
* return
* {lists.map((l) => (
* {JSON.stringify(l)}
* ))}
* ;
* }
*
* export const DisplayComponent = () => {
* return (
* Loading content...}>
*
*
* );
* }
*
* export const DiffContentComponent = () => {
* // A differential query will emit results when a change to the result set occurs.
* // The internal array object references are maintained for unchanged rows.
* // The returned lists array is read only when a `rowComparator` is provided.
* const { data: lists } = useSuspenseQuery('SELECT * from lists', [], {
* rowComparator: {
* keyBy: (item) => item.id,
* compareBy: (item) => JSON.stringify(item)
* }
* });
* return
* {lists.map((l) => (
* {JSON.stringify(l)}
* ))}
* ;
* }
*
* export const DisplayComponent = () => {
* return (
* Loading content...}>
*
*
* );
* }
*/
export declare function useSuspenseQuery(query: string | CompilableQuery, parameters?: any[], options?: AdditionalOptions): SuspenseQueryResult;
export declare function useSuspenseQuery(query: string | CompilableQuery, paramerers?: any[], options?: DifferentialHookOptions): ReadonlySuspenseQueryResult;