Is there a way to enforce the keys of an interface to be used from an array of strings:
E.g. If we have the following array:
const myArray = ['key1', 'key2'];
I would like to create a new interface called MyInterface that would force all myArray entries to be the keys of an object:
const myObj: MyInterface = {
'key1': true,
'key2': false,
}