Union type from array in TypeScript

How to turn a JavaScript array into a TypeScript union type