The goal is to create a completely type safe generic class such as a Table Class below which would allow to create a Table instance whose field types are given as type parameters (or any other possible means).
let userTable = new Table<number, string, string>(
columnNames: ["id", "name", "address"],
fields: [
[0, "John", "225 Main"],
[1, "Sam", "330 E Park"]
]);
let billsTable = new Table<number, Date, Date>(
columnNames: ["custId", "invoiceDate", "dueDate", "balance"],
fields: [ [1, new Date(), new Date()] ]);
The question is, with full type safety in focus, how would you define or implement such a generic type structure which could have unknown number of type parameters?