import { type ISeparators } from "@gooddata/sdk-model"; import { type JsonValue } from "../../utils/guards.js"; import { type ITooltipReferenceMaps } from "../registry/adapterTypes.js"; export type TooltipPayload = { title: string; value?: string | number; format?: string; attrId?: string; /** * Attribute element URI. By convention only set by attribute payload * writers (locationName, segment, tooltipText). Used by the custom-tooltip * execution path to build per-feature lookup keys. */ uri?: string; /** * Bucket `localIdentifier` of the underlying attribute. By convention only set by * attribute payload writers (locationName, segment, tooltipText) — the mirror of * {@link TooltipPayload.localId} for measures, and used the same way: as the lookup key * into `ITooltipReferenceMaps.attributes`, which yields the reference keys the value is * published under. * * Separate from {@link TooltipPayload.attrId} because that one is the LDM identifier * saying WHICH attribute a slot holds, and an LDM identifier is unique only within an * object type: a label and a computed attribute may share one, so the identifier alone * cannot say which of the two a value belongs to. A localIdentifier is unique within the * execution. */ attrLocalId?: string; fill?: string; /** * Bucket `localIdentifier` of the underlying measure. By convention only * set by measure payload writers (size, color, items in `measures[]`); * the parser doesn't constrain other slots. Used by the custom-tooltip * resolver as the lookup key into `ITooltipReferenceMaps.measures` to * find the LDM identifier referenced as `{metric/}`. */ localId?: string; }; export declare function getTooltipProperties(properties: GeoJSON.GeoJsonProperties | undefined): Record; export declare function parseTooltipPayload(item: JsonValue): TooltipPayload | undefined; export declare function isTooltipPayloadValid(item: JsonValue): boolean; /** * Drops the later of two attribute payloads that show the same display form, so a label used * both as location/area and as segment-by appears once in the tooltip. * * The identity is the typed reference key of the display form, not the bare LDM identifier: an * LDM identifier is unique only within an object type, so a label and a computed attribute may * share one, and those are two different objects that both belong in the tooltip. The key comes * from the reference maps, looked up by the payload's localIdentifier; a payload the maps cannot * place is treated as a label, which is what it would have resolved as before. * * @internal */ export declare function dedupeAttributePayloads(payloads: Array, referenceMaps: ITooltipReferenceMaps | undefined): Array; export type TooltipFormatConfig = { emptyValue: string; escape: (value: string) => string; }; export declare function buildTooltipItemHtml(title: string, valueHtml: string, escapeTitle: (value: string) => string): string; export declare function formatAttributeHtml(payload: TooltipPayload | undefined, config: TooltipFormatConfig): string | null; export declare function formatMeasureHtml(payload: TooltipPayload | undefined, separators: ISeparators | undefined, config: TooltipFormatConfig): string | null; //# sourceMappingURL=tooltipUtils.d.ts.map