In the provided documentation, it is explained how to achieve this using an interface. However, as I delve deeper into the language, I can't help but wonder why the following approach does not yield the same results?
type TraverseTuple<T extends Array<unknown>> = {
readonly [P in keyof T]: T[P];
}
const test: TraverseTuple<[string, number, string, number]> = ['s', 1, 'o', 2];
test[1] = 0; // This assignment doesn't maintain readonly status !