import type { ExecuteQueryByWidgetIdParams, QueryByWidgetIdState } from '@sisense/sdk-ui-preact'; import { type ToRefs } from 'vue'; import type { MaybeRefOrWithRefs } from '../types'; /** * A Vue composable function `useExecuteQueryByWidgetId` for executing queries by widget ID using the Sisense SDK. * It simplifies the process of fetching data related to a specific widget based on provided parameters and manages * the query's loading, success, and error states. This composable integrates with the Sisense application context * to perform queries and handle their results within Vue components. * * **Note:** Widget extensions based on JS scripts and add-ons in Fusion are not supported. * * @param {ExecuteQueryByWidgetIdParams} params - Parameters for executing the query, including widget ID, filters, * and other relevant query options. The `filters` parameter allows for specifying dynamic filters for the query. * * @example * Here's how to use `useExecuteQueryByWidgetId` within a Vue component: * ```vue * * ``` * * This composable returns an object containing reactive state management properties for the query: * - `data`: The result of the query, undefined until the query completes successfully. * - `isLoading`: A boolean indicating if the query is currently loading. * - `isError`: A boolean indicating if an error occurred during the query execution. * - `isSuccess`: A boolean indicating if the query executed successfully. * - `error`: An Error object containing the error details if an error occurred. * - `query`: The query object returned for chart widget, useful for debugging or advanced handling. * - `pivotQuery`: The pivot query object returned for pivot widget, useful for debugging or advanced handling. * * Utilizing this composable allows for declarative and reactive handling of widget-specific queries within Vue applications, * facilitating easier data fetching and state management with the Sisense SDK. * * @group Fusion Assets * @fusionEmbed */ export declare const useExecuteQueryByWidgetId: (params: MaybeRefOrWithRefs) => ToRefs;