selecto
selecto copied to clipboard
some types are any
some type are any and can be identifier
this one should be MouseEvent
or PointerEvent | MouseEvent
data and datas seem also missing type, we code blind with any :)
edit
for datas , it would be nice if we can get the type. Scenario of usage can be when we want prevent drag on right click, keep select behavior and call a context menue by passing selections.
Solution can be also expose current list if it possible: it seem we need manually check dom elements with class selected, idk if you have any idea to expose a precomputed store of the selected list somewhere? maybe in a weakMap or weakSet of you scare about memleak but with some little perf cost for huge list. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap