Indeed, that is what I did at first but couldn't get the code through the typescript compiler.  Probably just a silly mistake.

FWIW; 

data_type=0, all types that fit in a single TypedArray
data_type=1, int64 split over 2 TypedArrays
data_type=2, complex32+complex64 split over 2 TypedArrays