type MyArray<T> = [data: T[] , count: number ]; // doesn't work
On the client side, I want to use MyArray type to map data from an API and to be able to call its 'data' or the 'count' property. The API delivers the data in an array, at index 0 the array has the data and at index 1 it has a number.
type MyArray<T> = [T[], number], and the other istype MyData<T> = {data: T[], count: number}. I don't think it makes sense to express that as a single type... you really want a function that takes aMyArray<T>and returns aMyData<T>.