import { ExecuteQueryParams, ExecuteQueryResult } from '../../types'; /** * React hook that executes a data query. * * This approach, which offers an alternative to the {@link ExecuteQuery} component, is similar to React Query's `useQuery` hook. * * @example * Execute a query to retrieve revenue per country per year from the Sample ECommerce data model, sorted by revenue and year, and display the data in a table. * * ```tsx * import { Table, useExecuteQuery } from '@sisense/sdk-ui'; * import { measureFactory, Sort } from '@sisense/sdk-data'; * import * as DM from './sample-ecommerce'; * * const CodeExample = () => { * const { data } = useExecuteQuery({ * dataSource: DM.DataSource, * dimensions: [DM.Commerce.Date.Years.sort(Sort.Descending), DM.Country.Country], * measures: [measureFactory.count(DM.Commerce.Revenue, 'Revenue').sort(Sort.Descending)], * }); * * return ( * <> * {data && ( *
*
* See also: [Take Control of Your Data Visualizations](https://www.sisense.com/blog/take-control-of-your-data-visualizations/),
* a blog post with examples of using the hook to fetch data to display in third-party charts.
*
* @returns Query state that contains the status of the query execution, the result data, or the error if any occurred
* @group Queries
*/
export declare const useExecuteQuery: (params: ExecuteQueryParams) => ExecuteQueryResult;
/**
* {@link useExecuteQuery} without tracking to be used inside other hooks or components in Compose SDK.
*
* @param params - Parameters of the query
* @internal
*/
export declare function useExecuteQueryInternal(params: ExecuteQueryParams): ExecuteQueryResult;