import type { ControlledSignal } from './interaction-signal.js'; import type { ChartKey, ChartMark, ChartPoint, ChartSelectionController, ChartSelectionSource, ChartValue } from './types.js'; export type KeyedSelectionChange = { type: 'select'; value: TKey; point: ChartPoint; source: ChartSelectionSource; } | { type: 'clear'; value: null; point: null; source: ChartSelectionSource; }; export interface KeyedSelectionKeyContext { readonly point: ChartPoint; } export interface KeyedSelectionOptions { selected: ControlledSignal>; /** Return null or undefined when a point is not selectable. */ key: (datum: TDatum, context: KeyedSelectionKeyContext) => TKey | null | undefined; } export interface KeyedSelection extends ChartSelectionController { readonly selected: ControlledSignal>; readonly key: KeyedSelectionOptions['key']; readonly matches: (point: ChartPoint) => boolean; } export declare function keyedSelection(options: KeyedSelectionOptions): KeyedSelection; /** Paints one ordinary mark only for the selected semantic key. */ export declare function whenSelected(mark: ChartMark, selection: KeyedSelection): ChartMark;