import { WidgetProps } from '../../../domains/widgets/components/widget/types'; import { JumpToDashboardConfig } from './jtd/jtd-types.js'; import { JumpToDashboardConfigForPivot } from './use-jtd.js'; /** * Hook to add Jump To Dashboard (JTD) functionality to individual Widget components. * * Jump To Dashboard (JTD) allows users to navigate from one dashboard to another when interacting with widgets, * such as clicking on chart data points or using context menus. This hook is particularly useful when rendering * Widget components directly (not through a Dashboard component), but you still want JTD navigation functionality. * * For widgets that are part of a dashboard, consider using `applyJtdConfig` or `applyJtdConfigs` instead, * as they apply JTD configuration at the dashboard level rather than individual widget level. * * Note: dashboard-only 'includeDashboardFilters' is not supported and would just be ignored, since we do not have a dashboard in the current context. * * This hook enhances the provided widget props with JTD navigation capabilities, including: * - Click and right-click event handlers for navigation * - Hyperlink styling for actionable pivot cells (when applicable) * - JTD icon display in widget headers * * @example * Basic JTD configuration with right-click navigation. * ```typescript * import { useJtdWidget } from '@sisense/sdk-ui'; * * const jtdConfig: JumpToDashboardConfig = { * targets: [{ id: 'dashboard-1', caption: 'Sales Dashboard' }], * interaction: { * triggerMethod: 'rightclick', * captionPrefix: 'Jump to' * } * }; * * const MyComponent = () => { * const widgetWithJtd = useJtdWidget(myWidgetProps, jtdConfig); * * return ; * }; * ``` * * @example * JTD configuration with multiple targets and custom styling. * ```typescript * const jtdConfig: JumpToDashboardConfig = { * enabled: true, * targets: [ * { id: 'sales-dashboard', caption: 'Sales Analysis' }, * { id: 'marketing-dashboard', caption: 'Marketing Insights' } * ], * interaction: { * triggerMethod: 'click', * captionPrefix: 'Navigate to', * showIcon: true * }, * filtering: { * mergeWithTargetFilters: true, * includeWidgetFilters: true * } * }; * * const widgetWithJtd = useJtdWidget(chartProps, jtdConfig); * ``` * * @returns Enhanced widget props with JTD navigation capabilities, menu combination, and styling applied * * @group Dashboards */ export declare const useJtdWidget: (widgetProps: WidgetProps | null, config: JumpToDashboardConfig | JumpToDashboardConfigForPivot) => WidgetProps | null;