Fix #788: Add typings and compiler support for TypedArrays

True. Should I move `TagSelectable` to another file?