import { CategoryKey } from '../../common/category' ; import { SeriesIdentifier } from '../../common/series_id' ; internal export const ON_LEGEND_ITEM_OVER = 'ON_LEGEND_ITEM_OVER' ; internal export const ON_LEGEND_ITEM_OUT = 'ON_LEGEND_ITEM_OUT' ; internal export const ON_TOGGLE_DESELECT_SERIES = 'ON_TOGGLE_DESELECT_SERIES' ; public export type LegendPathElement = { index : number ; value : CategoryKey ; } ; public export type LegendPath = LegendPathElement [ ] ; interface LegendItemOverAction { type : typeof ON_LEGEND_ITEM_OVER ; legendPath : LegendPath ; } interface LegendItemOutAction { type : typeof ON_LEGEND_ITEM_OUT ; } internal export interface ToggleDeselectSeriesAction { type : typeof ON_TOGGLE_DESELECT_SERIES ; legendItemIds : SeriesIdentifier [ ] ; negate : boolean ; } internal export function onLegendItemOverAction ( legendPath ) { return { type : ON_LEGEND_ITEM_OVER , legendPath } ; } internal export function onLegendItemOutAction ( ) { return { type : ON_LEGEND_ITEM_OUT } ; } internal export function onToggleDeselectSeriesAction ( legendItemIds , negate = false ) { return { type : ON_TOGGLE_DESELECT_SERIES , legendItemIds , negate } ; } internal export type LegendActions = LegendItemOverAction | LegendItemOutAction | ToggleDeselectSeriesAction ;