The result should instead be a tuple, but IDK how well tuple size inference would work in a case like that.
type Tuple<T, K> = [T, K | null];
...JavaScript would allow you to extend that list during runtime (unless you freeze it)
type Tuple<T, K> = [T, K] const Tuple<T, K> = (x: T, y: K): Tuple<T, K> => { const tup = [x, y]; Object.freeze(tup); return tup; };
The result should instead be a tuple, but IDK how well tuple size inference would work in a case like that.