import type { JaqlDataSourceForDto } from '@sisense/sdk-data'; import type { JumpToDashboardConfig, JumpToDashboardConfigForPivot } from '../../../../domains/dashboarding/hooks/jtd/jtd-types.js'; import type { ExecutePivotQueryParams, ExecuteQueryParams } from '../../../../domains/query-execution/index.js'; import type { ChartWidgetProps } from '../../../../domains/widgets/components/chart-widget/types'; import type { CommonWidgetProps } from '../../../../domains/widgets/components/common-widget/types'; import type { CustomWidgetProps } from '../../../../domains/widgets/components/custom-widget/types'; import type { FilterWidgetProps } from '../../../../domains/widgets/components/filter-widget/types'; import type { NarrativeWidgetProps } from '../../../../domains/widgets/components/narrative-widget/types'; import type { PivotTableWidgetProps } from '../../../../domains/widgets/components/pivot-table-widget/types'; import type { TextWidgetProps } from '../../../../domains/widgets/components/text-widget/types'; import type { WidgetDto } from '../../../../domains/widgets/components/widget-by-id/types.js'; import type { WidgetProps } from '../../../../domains/widgets/components/widget/types'; import type { AppSettings } from '../../../../infra/app/settings/settings.js'; import type { ChartProps, PivotTableProps, TableProps } from '../../../../props'; import type { CompleteThemeSettingsInternal } from '../../../../types.js'; import type { WidgetModel } from '../widget-model'; /** * Translates a {@link WidgetModel} to the parameters for executing a query for the widget. * * @example * ```tsx * const {data, isLoading, isError} = useExecuteQuery(widgetModelTranslator.toExecuteQueryParams(widgetModel)); * ``` * * Note: this method is not supported for getting pivot query. * Use {@link toExecutePivotQueryParams} instead for getting query parameters for the pivot widget. */ export declare function toExecuteQueryParams(widgetModel: WidgetModel): ExecuteQueryParams; /** * Translates a {@link WidgetModel} to the parameters for executing a query for the pivot widget. * * @example * ```tsx * const {data, isLoading, isError} = useExecutePivotQuery(widgetModelTranslator.toExecutePivotQueryParams(widgetModel)); * ``` * * Note: this method is supported only for getting pivot query. * Use {@link toExecuteQueryParams} instead for getting query parameters for non-pivot widgets. */ export declare function toExecutePivotQueryParams(widgetModel: WidgetModel): ExecutePivotQueryParams; /** * Translates a {@link WidgetModel} to the props for rendering a chart. * * @example * ```tsx * * ``` * * Note: this method is not supported for pivot widgets. * Use {@link toPivotTableProps} instead for getting props for the component. */ export declare function toChartProps(widgetModel: WidgetModel): ChartProps; /** * Translates a {@link WidgetModel} to the props for rendering a table. * * @example * ```tsx * * ``` * * Note: this method is not supported for chart and pivot widgets. * Use {@link toChartProps} instead for getting props for the component. * Use {@link toPivotTableProps} instead for getting props for the component. */ export declare function toTableProps(widgetModel: WidgetModel): TableProps; /** * Translates a {@link WidgetModel} to the props for rendering a pivot table. * * @example * ```tsx * * ``` * * Note: this method is not supported for chart or table widgets. * Use {@link toChartProps} instead for getting props for the component. * Use {@link toTableProps} instead for getting props for the
component. */ export declare function toPivotTableProps(widgetModel: WidgetModel): PivotTableProps; /** * Translates a {@link WidgetModel} to the props for rendering a chart widget. * * @example * ```tsx * * ``` * * Note: this method is not supported for pivot widgets. */ export declare function toChartWidgetProps(widgetModel: WidgetModel): ChartWidgetProps; /** * Translates a {@link WidgetModel} to the props for rendering a pivot table widget. * * @example * ```tsx * * ``` * * Note: this method is not supported for chart or table widgets. * Use {@link toChartWidgetProps} instead for getting props for the component. */ export declare function toPivotTableWidgetProps(widgetModel: WidgetModel): PivotTableWidgetProps; /** * Translates a {@link WidgetModel} to the props for rendering a text widget. * * @example * ```tsx * * ``` * * Note: this method is not supported for chart or pivot widgets. * Use {@link toChartWidgetProps} instead for getting props for the component. * Use {@link toPivotTableWidgetProps} instead for getting props for the component. */ export declare function toTextWidgetProps(widgetModel: WidgetModel): TextWidgetProps; /** * Translates a {@link WidgetModel} to the props for rendering the dashboard narrative widget. * * @param widgetModel - Widget model of a `narrative` widget. * @returns Dashboard narrative widget props. * @throws If the widget model is not a `narrative` widget. * @internal */ export declare function toNarrativeWidgetProps(widgetModel: WidgetModel): NarrativeWidgetProps; /** * Translates a {@link WidgetModel} to the props for rendering a custom widget. * * @internal */ export declare function toCustomWidgetProps(widgetModel: WidgetModel): CustomWidgetProps; /** * Translates {@link WidgetModel} to {@link CommonWidgetProps}. * * @internal */ export declare function toCommonWidgetProps(widgetModel: WidgetModel): CommonWidgetProps; /** * Translates {@link WidgetModel} to {@link WidgetProps}. * * @example * ```tsx * * ``` */ export declare function toWidgetProps(widgetModel: WidgetModel): WidgetProps; /** * Returns Jump to Dashboard configuration for a {@link WidgetModel} that was built from * Fusion via {@link fromWidgetDto}. * * @param widgetModel - The {@link WidgetModel} built from Fusion via {@link fromWidgetDto};. * * @returns `JumpToDashboardConfig`, `JumpToDashboardConfigForPivot`, or `null` when the model is not * Fusion-sourced, or the widget has no versioned JTD. * * @example * ```tsx * const widgetProps = widgetModelTranslator.toWidgetProps(widgetModel); * const jtdConfig = widgetModelTranslator.toJtdConfig(widgetModel); * // When jtdConfig is non-null, pass widgetProps and jtdConfig to useJtdWidget; otherwise render the widget with widgetProps alone. * ``` * * @sisenseInternal * @alpha */ export declare function toJtdConfig(widgetModel: WidgetModel): JumpToDashboardConfig | JumpToDashboardConfigForPivot | null; /** * Creates a {@link WidgetModel} from a widget DTO. * * @param widgetDto - The widget DTO to be converted to a widget model. * @param themeSettings - The theme settings to be used for the widget model. * @param appSettings - The application settings to be used for the widget model. * @returns The widget model. * @internal */ export declare function fromWidgetDto(widgetDto: WidgetDto, themeSettings?: CompleteThemeSettingsInternal, appSettings?: AppSettings): WidgetModel; /** * Creates a {@link WidgetModel} from a {@link ChartWidgetProps}. * * @param chartWidgetProps - The ChartWidgetProps to be converted to a widget model. * @returns WidgetModel. * @internal */ export declare function fromChartWidgetProps(chartWidgetProps: ChartWidgetProps): WidgetModel; /** * Creates a {@link WidgetModel} from a {@link PivotTableWidgetProps}. * * @param pivotTableWidgetProps - The PivotTableWidgetProps to be converted to a widget model. * @returns WidgetModel. * @internal */ export declare function fromPivotTableWidgetProps(pivotTableWidgetProps: PivotTableWidgetProps): WidgetModel; /** * Creates a {@link WidgetModel} from a {@link TextWidgetProps}. * * @param textWidgetProps - The TextWidgetProps to be converted to a widget model. * @returns WidgetModel. * @internal */ export declare function fromTextWidgetProps(textWidgetProps: TextWidgetProps): WidgetModel; /** * Creates a {@link WidgetModel} from a {@link NarrativeWidgetProps}. * * @param narrativeWidgetProps - The NarrativeWidgetProps to be converted to a widget model. * @returns WidgetModel. * @internal */ export declare function fromNarrativeWidgetProps(narrativeWidgetProps: NarrativeWidgetProps): WidgetModel; /** * Creates a {@link WidgetModel} from a {@link FilterWidgetProps} — the inverse of * {@link toFilterWidgetProps}. * * The widget's own dimension filters become the model `filters` (the DTO `filters` panel); * `parentFilters` is used only when `dimensionFilters` is not set. The control styling moves from * `styleOptions.control` to `filterWidgetData`, leaving the container style in `styleOptions`. * Runtime-only props (`filter`, `onChange`, `excludedDateLevels`, …) are not part of the model. * * @param filterWidgetProps - The FilterWidgetProps to be converted to a widget model. * @returns WidgetModel. * @internal */ export declare function fromFilterWidgetProps(filterWidgetProps: FilterWidgetProps): WidgetModel; /** * Creates a {@link WidgetModel} from a {@link CustomWidgetProps}. * * @param customWidgetProps - The CustomWidgetProps to be converted to a widget model. * @returns WidgetModel. * @internal */ export declare function fromCustomWidgetProps(customWidgetProps: CustomWidgetProps): WidgetModel; /** * Creates a {@link WidgetModel} from a {@link WidgetProps}. * * @param widgetProps - The WidgetProps to be converted to a widget model. * @returns WidgetModel. * @internal */ export declare function fromWidgetProps(widgetProps: WidgetProps): WidgetModel; /** * Translates a {@link WidgetModel} to {@link WidgetDto}. * * @param widgetModel - The WidgetModel to be converted to a widgetDto. * @param dataSource - The full datasource details. * @param themeSettings - The theme settings to be used for the widget design. * @param appSettings - The application settings to be used for the widget design. * @returns WidgetDto. * * @sisenseInternal */ export declare function toWidgetDto(widgetModel: WidgetModel, dataSource?: JaqlDataSourceForDto, themeSettings?: CompleteThemeSettingsInternal, appSettings?: AppSettings): WidgetDto;