Cartesian Product Typewith Indextype Records = { [S in Union1]: { [R in Union2]: SelectRecord<S, R>; }[Union2]; }[Union1]; Documentation - Mapped TypesGenerating types by re-using an existing type.https://www.typescriptlang.org/docs/handbook/2/mapped-types.html