import { ChartType } from '../chart_types' ; import { Spec } from '../specs' ; import { PointerState , PointerStates , SpecList } from './chart_state' ; internal export function getSpecsFromStore < U extends Spec > ( specs , chartType , specType ) { return Object . values ( specs ) . filter ( ( spec ) => spec . chartType === chartType && spec . specType === specType ) as U [ ] ; } internal export function isClicking ( prevClick , lastClick ) { return lastClick && ( ! prevClick || prevClick . time !== lastClick . time ) ; } internal export const getInitialPointerState = ( ) : PointerStates => ( { dragging : false , current : { position : { x : - 1 , y : - 1 } , time : 0 } , down : null , up : null , lastDrag : null , lastClick : null , } ) ;