/** * Fusion widget identity helpers. The DTO type ↔ widget type ↔ chart type mappings are projections * of the descriptor table in `domains/widgets/widget-identity`; add or change a built-in widget type there. */ import type { ChartSubtype } from '../../../../domains/visualizations/core/chart-options-processor/subtype-to-design-options.js'; import type { WidgetModel } from '../../../../domains/widgets/widget-model'; import type { WidgetTypeInternal } from '../../../../domains/widgets/widget-model/types.js'; import type { ChartProps, PivotTableProps } from '../../../../props'; import type { ChartType, CustomWidgetEventProps } from '../../../../types.js'; import type { ChartWidgetProps } from '../chart-widget/types'; import type { CommonWidgetProps } from '../common-widget/types'; import type { CustomWidgetProps } from '../custom-widget/types'; import type { FilterWidgetProps } from '../filter-widget/types'; import type { NarrativeWidgetProps } from '../narrative-widget/types'; import type { PivotTableWidgetProps } from '../pivot-table-widget/types'; import type { TextWidgetProps } from '../text-widget/types'; import type { WidgetProps, WidgetType, WithCommonWidgetProps } from '../widget/types'; import type { CsdkPluginWidgetType, FusionPluginWidgetType, FusionWidgetType, Panel, PanelItem, TextWidgetDtoStyle, WidgetStyle, WidgetSubtype } from './types.js'; export { mergeFilters, getFilterRelationsFromJaql, convertFilterRelationsModelToJaql, getFilterCompareId, } from '@sisense/sdk-data'; /** * Returns `true` when a panel item's jaql represents a measure — either a base-measure * aggregation (`jaql.agg`) or a calculated measure (`jaql.formula`). Mirrors Fusion's * `isMeasure` dimension helper so CSDK code can evaluate the same "is measure?" checks * Fusion's widget manifests rely on. * * @param item - The panel item. * @returns `true` when the panel item is a measure. * @internal */ export declare function isMeasurePanelItem(item: PanelItem): boolean; /** * Returns the chart type of a Fusion widget DTO type, read from the built-in widget descriptor table. * * @param fusionWidgetType - The Fusion widget DTO type. * @returns The chart type, or `undefined` for non-chart and unknown Fusion types. * @internal */ export declare function getChartType(fusionWidgetType: FusionWidgetType): ChartType | undefined; /** * Returns the canonical Fusion widget DTO type of a chart type, read from the built-in widget * descriptor table. * * Chart types without a Fusion DTO type (`streamgraph`, `arearange`) yield `undefined`. * * @param chartType - The chart type. * @returns The canonical Fusion widget DTO type. * @internal */ export declare function getFusionWidgetTypeFromChartType(chartType: ChartType): FusionWidgetType; /** * Returns the Fusion widget DTO type of a widget, read from the built-in widget descriptor table. * * @param widgetType - The widget type. * @param chartType - The chart type, required when `widgetType` is `'chart'`. * @param customWidgetType - The custom widget type, used when `widgetType` is `'custom'`. * @returns The Fusion widget DTO type. * @internal */ export declare function getFusionWidgetType(widgetType: WidgetType, chartType?: ChartType, customWidgetType?: string): FusionWidgetType; /** * Returns the widget type of a Fusion widget DTO type, read from the built-in widget descriptor table. * * Fusion types the table does not know are read as `'chart'`. * * @param fusionWidgetType - The Fusion widget DTO type. * @returns The widget type. * @internal */ export declare function getWidgetType(fusionWidgetType: FusionWidgetType): WidgetType; /** * Returns the chart subtype of a Fusion widget subtype. * * @param widgetSubtype - The Fusion widget subtype. * @returns The chart subtype, or `undefined` when the subtype has no chart equivalent. * @internal */ export declare function getChartSubtype(widgetSubtype: WidgetSubtype): ChartSubtype | undefined; /** * Checks whether a Fusion widget DTO type maps to a built-in widget type (canonical types and aliases). * * @param fusionWidgetType - The Fusion widget DTO type. * @returns `true` when the descriptor table knows the type. * @internal */ export declare function isSupportedWidgetType(fusionWidgetType: string): fusionWidgetType is FusionWidgetType; /** * Check if the given fusion widget type is a supported plugin widget (in DTO format). * * @param fusionWidgetType - The fusion widget type from DTO. * @returns True if it's a supported plugin widget. * @internal */ export declare function isSupportedPluginFusionWidget(fusionWidgetType: string): boolean; /** * Check if the given CSDK widget type is a supported plugin widget (in CSDK format). * * @param csdkWidgetType - The CSDK custom widget type. * @returns True if it's a supported plugin widget. * @internal */ export declare function isSupportedPluginCsdkWidget(csdkWidgetType: string): boolean; /** * Map a Fusion plugin widget type (DTO) to CSDK plugin widget type. * * @param fusionType - The Fusion plugin widget type from DTO. * @returns The corresponding CSDK plugin widget type. * @internal */ export declare function fusionPluginWidgetTypeToCsdk(fusionType: FusionPluginWidgetType): CsdkPluginWidgetType; /** * Map a CSDK plugin widget type to Fusion plugin widget type (DTO). * * @param csdkType - The CSDK plugin widget type. * @returns The corresponding Fusion plugin widget type for DTO. * @internal */ export declare function csdkPluginWidgetTypeToFusion(csdkType: CsdkPluginWidgetType): FusionPluginWidgetType; /** * Checks whether a Fusion widget DTO type is a table widget (`tablewidget` or `tablewidgetagg`). * * @param fusionWidgetType - The Fusion widget DTO type. * @returns `true` for table widget types. * @internal */ export declare function isTableFusionWidget(fusionWidgetType: FusionWidgetType): boolean; /** * Checks whether a widget model is a table chart widget. * * @param widgetModel - The widget model. * @returns `true` for chart widgets with the `table` chart type. * @internal */ export declare function isTableWidgetModel(widgetModel: WidgetModel): boolean; /** * Checks whether a Fusion widget DTO type is a pivot table widget (`pivot2` or `pivot`). * * @param fusionWidgetType - The Fusion widget DTO type. * @returns `true` for pivot table widget types. * @internal */ export declare function isPivotTableFusionWidget(fusionWidgetType: FusionWidgetType): boolean; /** * Checks whether a widget type is the pivot table widget. * * @param widgetType - The widget type. * @returns `true` for `pivot`. * @internal */ export declare function isPivotWidget(widgetType: WidgetType): boolean; /** * Checks whether a Fusion widget DTO type is the text widget. * * @param fusionWidgetType - The Fusion widget DTO type. * @returns `true` for `richtexteditor`. * @internal */ export declare function isTextFusionWidget(fusionWidgetType: FusionWidgetType): boolean; /** * Checks whether a widget type is the text widget. * * @param widgetType - The widget type. * @returns `true` for `text`. * @internal */ export declare function isTextWidget(widgetType: WidgetType): boolean; /** * Checks whether a Fusion widget type is the dashboard narrative widget. * @param fusionWidgetType - The Fusion widget type. * @returns `true` for `dashboardnarrative`. * @internal */ export declare function isNarrativeFusionWidget(fusionWidgetType: FusionWidgetType): boolean; /** * Checks whether a widget type is the dashboard narrative widget. * @param widgetType - The widget type. * @returns `true` for `narrative`. * @internal */ export declare function isNarrativeWidget(widgetType: WidgetType): boolean; /** * Checks whether a widget type is the filter widget. * @param widgetType - The widget type. * @returns `true` for `filter`. * @internal */ export declare function isFilterWidget(widgetType: WidgetType): boolean; /** * Type guard for the style of a text widget DTO. * * @param widgetStyle - The widget DTO style. * @returns Whether the style carries text widget HTML content. * @internal */ export declare function isTextWidgetDtoStyle(widgetStyle: WidgetStyle): widgetStyle is TextWidgetDtoStyle; /** * Checks whether a Fusion widget DTO type is the generic custom widget type. * * @param fusionWidgetType - The Fusion widget DTO type. * @returns `true` for `custom`. * @internal */ export declare function isCustomWidgetFusionWidget(fusionWidgetType: FusionWidgetType): boolean; /** * Checks whether a widget type is the custom widget. * * @param widgetType - The widget type. * @returns `true` for `custom`. * @internal */ export declare function isCustomWidget(widgetType: WidgetType): boolean; /** * Checks whether a Fusion widget DTO type is read as a chart: any type that is not filter, pivot, * text or narrative, including unknown types. * * @param fusionWidgetType - The Fusion widget DTO type. * @returns `true` for chart and unknown widget types. * @internal */ export declare function isChartFusionWidget(fusionWidgetType: FusionWidgetType): boolean; /** * Checks whether a Fusion widget DTO type is a known chart in the Fusion `chart/*` family * (for example `chart/line` or `chart/pie`). * * @param fusionWidgetType - The Fusion widget DTO type. * @returns `true` for known `chart/*` widget types. * @internal */ export declare function isChartTypeFusionWidget(fusionWidgetType: FusionWidgetType): boolean; /** * Checks whether a Fusion widget DTO type is the pie chart. * * @param fusionWidgetType - The Fusion widget DTO type. * @returns `true` for `chart/pie`. * @internal */ export declare function isPieChartFusionWidget(fusionWidgetType: FusionWidgetType): boolean; /** * Checks whether a Fusion widget DTO type is the indicator chart. * * @param fusionWidgetType - The Fusion widget DTO type. * @returns `true` for `indicator`. * @internal */ export declare function isIndicatorFusionWidget(fusionWidgetType: FusionWidgetType): boolean; /** * Checks whether a widget type is the chart widget. * * @param widgetType - The widget type. * @returns `true` for `chart`. * @internal */ export declare function isChartWidget(widgetType: WidgetType): boolean; /** * Type guard for checking if the widget props is for a text widget. * * @param widgetProps - The widget props to check. * @returns Whether the widget props is for a text widget. * @internal */ export declare function isTextWidgetProps(widgetProps: CommonWidgetProps): widgetProps is WithCommonWidgetProps; /** * Type guard for checking if the widget props is for the dashboard narrative widget. * @param widgetProps - The widget props to check. * @returns Whether the widget props is for the dashboard narrative widget. * @internal */ export declare function isNarrativeWidgetProps(widgetProps: CommonWidgetProps): widgetProps is WithCommonWidgetProps; /** * Type guard for checking if the widget props is for a pivot table widget. * * @param widgetProps - The widget props to check. * @returns Whether the widget props is for a pivot table widget. * * @sisenseInternal */ export declare function isPivotTableWidgetProps(widgetProps: CommonWidgetProps): widgetProps is WithCommonWidgetProps; /** * Type guard for checking if the widget props is for a custom widget. * * @param widgetProps - The widget props to check. * @returns Whether the widget props is for a custom widget. * @internal * @sisenseInternal */ export declare function isCustomWidgetProps(widgetProps: CommonWidgetProps): widgetProps is WithCommonWidgetProps; /** * Checks whether the widget props belong to a filter widget. * * @param widgetProps - The widget props to check. * @returns Whether the widget props belong to a filter widget. * @internal */ export declare function isFilterWidgetProps(widgetProps: CommonWidgetProps): widgetProps is WithCommonWidgetProps; /** * Type guard for checking if the widget props is for a chart widget. * * @param widgetProps - The widget props to check. * @returns Whether the widget props is for a chart widget. * @sisenseInternal */ export declare function isChartWidgetProps(widgetProps: CommonWidgetProps): widgetProps is WithCommonWidgetProps; /** * Returns the internal widget type of widget props: the chart type for chart widgets, the widget * type otherwise. * * @param widgetProps - The widget props. * @returns The internal widget type. * @internal */ export declare function getInternalWidgetType(widgetProps: CommonWidgetProps): WidgetTypeInternal; /** * Registers new "onDataPointClick" handler for the Widget component. * * @param widgetProps - The widget props to extend in place. * @param handler - The handler combined with the existing one. * @internal */ export declare function registerDataPointClickHandler(widgetProps: WidgetProps, handler: NonNullable): void; /** * Registers new "onDataPointContextMenu" handler for the Widget component. * * @param widgetProps - The widget props to extend in place. * @param handler - The handler combined with the existing one. * @internal */ export declare function registerDataPointContextMenuHandler(widgetProps: WidgetProps, handler: NonNullable): void; /** * Registers new "onDataPointsSelected" handler for the Widget component. * * @param widgetProps - The widget props to extend in place. * @param handler - The handler combined with the existing one. * @internal */ export declare function registerDataPointsSelectedHandler(widgetProps: WidgetProps, handler: NonNullable): void; /** * Returns the enabled items of a widget DTO panel. * * @param panels - The widget DTO panels. * @param panelName - The name of the panel to read. * @returns The panel items that are not disabled; empty when the panel is missing. * @internal */ export declare function getEnabledPanelItems(panels: Panel[], panelName: string): PanelItem[]; /** * Returns the root of a panel item chain, following `parent` links. * * @param item - The panel item. * @returns The root panel item. * @internal */ export declare function getRootPanelItem(item: PanelItem): PanelItem;