/** * Location where the narrative is displayed in the widget. * * - `above`: displayed above the widget * - `below`: displayed below the widget * - `alone`: displayed alone, without any other widget content * * @default 'above' */ export type WidgetNarrativeDisplayLocation = 'above' | 'below' | 'alone'; /** * Narrative configuration options for widgets. * * Set on a chart or pivot widget via {@link WidgetConfig}. */ export type WidgetNarrativeConfig = { /** * Verbosity for narrative generation. * * @default low */ verbosity?: 'low' | 'high'; /** * Whether to include trend and forecast in the narrative. * * When `true`, any trend and forecast companion measures present on the widget are included in the narrative request. * * When `false`, they are not included in the narrative request. * * @default true */ includeTrendAndForecast?: boolean; /** * Whether the narrative is enabled for the widget. * * When `true`, narrative is enabled for the widget. * * When `false`, narrative is disabled for the widget and will not be generated. * * @default false */ enabled?: boolean; /** * Location where the narrative is displayed in the widget. See {@link WidgetNarrativeDisplayLocation} for more details. * * @default 'above' */ displayLocation?: WidgetNarrativeDisplayLocation; /** * Whether the narrative auto-shows on load without user interaction. * * When `true`, narrative is requested and displayed as soon as the widget loads. * * When `false`, narrative is requested and displayed only after user interaction. * * @default true (for backwards compatibility with older narrative settings in Fusion widgets) */ autoShow?: boolean; /** * Settings for interactive AI feedback icons. */ feedback?: { /** * Whether the interactive AI feedback icons are enabled. * * When `true`, the interactive AI feedback icons are shown. * * When `false`, the interactive AI feedback icons are not shown. * * @default false */ enabled?: boolean; }; /** * Maximum fraction of the content area height the narrative area may occupy. * * The content area is the space below the widget header — i.e. the area previously occupied * by the chart alone. `heightFraction = 0.5` therefore means the narrative receives half the space that * was available to the chart. * * Accepts a value in the range `0`–`1`. * - `undefined` (default): narrative takes whatever vertical space it needs; the chart fills the rest. * - `0.3`: narrative is capped at 30 % of the content area; the chart always receives the remaining 70 %. * * Practical guidelines: * - Values above `~0.8` leave very little room for the chart. * - Values below `~0.1` may clip the collapsed narrative text (~46 px). * - Has no effect when {@link WidgetNarrativeConfig.displayLocation | displayLocation} is `'alone'` * (the chart is already hidden in that mode). */ heightFraction?: number; }; /** * {@link WidgetNarrativeConfig} with all optional fields filled using {@link getCompleteWidgetNarrativeConfig}. */ export type CompleteWidgetNarrativeConfig = { enabled: boolean; verbosity: 'low' | 'high'; displayLocation: WidgetNarrativeDisplayLocation; autoShow: boolean; includeTrendAndForecast: boolean; feedback: { enabled: boolean; }; /** Resolved from {@link WidgetNarrativeConfig.heightFraction}. `undefined` means no constraint. */ heightFraction: number | undefined; }; /** * Returns {@link WidgetNarrativeConfig} with defaults applied for runtime. * * @param narrative - Optional narrative configuration to apply defaults to * @returns Complete narrative configuration with defaults applied */ export declare function getCompleteWidgetNarrativeConfig(narrative?: WidgetNarrativeConfig): CompleteWidgetNarrativeConfig;