import RoleSelection from "./RoleSelection"; import TokensSelection from "./TokensSelection"; import Frame from "../../data/Frame"; import DragingSelection from "./DragingSelection"; type Selection = null|TokensSelection|RoleSelection|DragingSelection; function isTokenSelected(selection:Selection, tokenIndex:number, frames:Frame[]):boolean { if(selection instanceof TokensSelection) { return selection.beginIndex<=tokenIndex && tokenIndex