import { ExecutePivotQueryParams, PivotQueryState } from '../../types'; /** * React hook that executes a data query for a pivot table. * This approach is similar to React Query's `useQuery` hook. * * @example * Execute a pivot query on the Sample ECommerce data model and display the results in a table. * * ```tsx * import { Table, useExecutePivotQuery, ExecutePivotQueryParams } from '@sisense/sdk-ui'; * import { measureFactory, Sort } from '@sisense/sdk-data'; * import * as DM from './sample-ecommerce'; * * const CodeExample = () => { * const pivotQueryProps: ExecutePivotQueryParams = { * dataSource: DM.DataSource, * rows: [ * { attribute: DM.Commerce.Date.Years.sort(Sort.None), includeSubTotals: true }, * { attribute: DM.Commerce.Condition, includeSubTotals: false }, * ], * values: [measureFactory.count(DM.Commerce.Revenue, 'Revenue').sort(Sort.Descending)], * grandTotals: { rows: true }, * }; * * const { data: pivotData, isLoading } = useExecutePivotQuery(pivotQueryProps); * * return ( * <> * {isLoading &&
Loading...
} * {pivotData && ( * * )} * * ); * }; * * export default CodeExample; * ``` * * * * @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 useExecutePivotQuery: (params: ExecutePivotQueryParams) => PivotQueryState; /** * {@link useExecutePivotQuery} without tracking to be used inside other hooks or components in Compose SDK. * * @param params - Parameters of the query * @internal */ export declare function useExecutePivotQueryInternal(params: ExecutePivotQueryParams): PivotQueryState; /** * Checks if the query parameters have changed by deep comparison. * * @param params - New query parameters */ export declare function usePivotQueryParamsChanged(params: ExecutePivotQueryParams): boolean;