import { type IExecutionFactory, type IPreparedExecution } from "@gooddata/sdk-backend-spi"; import { type IExecutionDefinition } from "@gooddata/sdk-model"; import { type ICustomTooltipConfig } from "./types.js"; /** * Maps used by `buildLookupTable` to interpret the execution result. * * @internal */ export interface ITooltipExecutionMeta { /** value localId → count localId, for "Multiple items" detection. */ labelCountMap: Record; /** tooltip metric localId → LDM measure identifier. */ measureIdMap: Record; /** label value localId → LDM label identifier. */ labelIdMap: Record; } /** * Prepared tooltip execution paired with the meta needed to interpret its result. * Carry them together — meta from one call mis-interprets results from another. * * @internal */ export interface ITooltipExecutionBundle { execution: IPreparedExecution; meta: ITooltipExecutionMeta; } /** * A tooltip execution plan: one batched execution for all external references, * plus per-reference bundles used as an isolation fallback. When the batch * rejects (e.g. a single invalid reference 400s the whole AFM), the consumer * re-runs the per-reference bundles so one bad reference can't suppress the * rest. Both Highcharts and geo fan out this way. `perRef` is a thunk: the * bundles are built lazily, only when the batch fails, so the success path * pays nothing for it. * * @internal */ export interface ITooltipExecution { batch: ITooltipExecutionBundle; perRef: () => readonly ITooltipExecutionBundle[]; } /** * @internal */ export interface IBuildTooltipExecutionOptions { /** * LocalIdentifiers from `definition.attributes` to use as the row dimension, * in the desired order. Omit to use all attributes in definition order * (Highcharts default). Geo passes an explicit list to drop position attrs. */ slicingAttributeLocalIds?: readonly string[]; } /** * Returns `null` when the content has no references or all references are * already in the chart (resolvable from drill data without a secondary call). * Otherwise returns the batched execution plus per-reference bundles for the * fan-out fallback (see {@link ITooltipExecution}). * * @internal */ export declare function buildTooltipExecution(executionFactory: IExecutionFactory, chartDefinition: IExecutionDefinition, tooltipContent: string, options?: IBuildTooltipExecutionOptions): ITooltipExecution | null; /** * Variant of {@link buildTooltipExecution} gated by the customTooltip config: this is the * canonical "should a tooltip execution exist at all" check (enabled + non-empty string * content), so call sites don't re-implement it. Returns `undefined` when the tooltip is * off, has no usable content, or {@link buildTooltipExecution} itself yields nothing. * * @internal */ export declare function buildTooltipExecutionFromConfig(executionFactory: IExecutionFactory, chartDefinition: IExecutionDefinition, customTooltip: ICustomTooltipConfig | undefined, options?: IBuildTooltipExecutionOptions): ITooltipExecution | undefined; //# sourceMappingURL=tooltipExecution.d.ts.map