import { DateComponent } from '../component/DateComponent' ; import { Hit } from './hit' ; export abstract class Interaction { component : DateComponent < any > ; isHitComboAllowed : ( ( hit0 : Hit , hit1 : Hit ) => boolean ) | null ; constructor ( settings ) { this . component = settings . component ; this . isHitComboAllowed = settings . isHitComboAllowed || null ; } destroy ( ) { } } export type InteractionClass = { new ( settings ) : Interaction ; } ; export interface InteractionSettingsInput { el : HTMLElement ; useEventCenter ? : boolean ; isHitComboAllowed ? : ( hit0 : Hit , hit1 : Hit ) => boolean ; } export interface InteractionSettings { component : DateComponent < any > ; el : HTMLElement ; useEventCenter : boolean ; isHitComboAllowed : ( ( hit0 : Hit , hit1 : Hit ) => boolean ) | null ; } export type InteractionSettingsStore = { [ componenUid ] : InteractionSettings ; } ; export function parseInteractionSettings ( component , input ) { return { component , el : input . el , useEventCenter : input . useEventCenter != null ? input . useEventCenter : true , isHitComboAllowed : input . isHitComboAllowed || null , } ; } export function interactionSettingsToStore ( settings ) { return { [ settings . component . uid ] : settings , } ; } export const interactionSettingsStore = { } ;