How to use TypeScript enum value as function parameter

I've used enums in several places in TypeScript lately and also starting to like them. However, using the values of an enum as an in parameter in a function is not as straight forward as you might think. You have to add an extra "valueof" type to use the value.

const enum Operators {
  Add,
  Subtract,
  Multiply,
}

type Operator = typeof Operators[keyof typeof Operators];

const fn = (operator: Operator) => {
  //...
};