Consider the following scenario:
interface Steps {
stepOne?: boolean;
stepTwo?: boolean;
stepThree?: boolean;
}
let steps: Steps = {};
function markStepDone (step: ???) {
steps[step] = true;
}
markStepDone('anything');
Is there a way to restrict the input to only ['stepOne', 'stepTwo', 'stepThree'] for this function and prevent other values like 'anything'?
I attempted using an enum but encountered limitations due to being unable to use it as an index signature...