Is it possible to set the structure of an array without knowing the exact number of elements it will contain? How can I achieve this flexibility in defining array configurations? (Check out a playground version here):
type numStrArr = [number, ...string];
let arr: numStrArr = [1, 'hi', 'other string'];
An error is thrown with the message Type expected.
at the spread operator in the code above.
Although there was a proposal addressing this issue, what are the current methods to achieve similar behavior?