import { ExecutePivotQueryParams, ExecuteQueryParams } from '../../query-execution'; import { WidgetModel } from './widget-model.js'; import { ChartProps, ChartWidgetProps, WidgetProps, PivotTableProps, PivotTableWidgetProps, CustomWidgetProps, TableProps, TableWidgetProps, TextWidgetProps, CommonWidgetProps } from '../../props'; import { JaqlDataSourceForDto } from '@sisense/sdk-data'; import { CompleteThemeSettings } from '../../types.js'; import { WidgetDto } from '../../widget-by-id/types.js'; import { AppSettings } from '../../app/settings/settings.js'; /** * 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 table widget. * * @example * ```tsx * * ``` * * Note: this method is not supported for chart widgets. * Use {@link toChartWidgetProps} instead for getting props for the component. * @internal */ export declare function toTableWidgetProps(widgetModel: WidgetModel): TableWidgetProps; /** * 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 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}. * * @internal */ export declare function toWidgetProps(widgetModel: WidgetModel): WidgetProps; /** * 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?: CompleteThemeSettings, 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 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 * @returns WidgetDto * @internal */ export declare function toWidgetDto(widgetModel: WidgetModel, dataSource?: JaqlDataSourceForDto): WidgetDto; //# sourceMappingURL=widget-model-translator.d.ts.map