Map array to an interface
Say I have an array that looks like this: const options = [ { name: 'foo', type: 'boolean' }, { name: 'bar', type: 'string' }, { name: 'bar', // should be baz not bar type: 'number' } ] I am looking to use this array as an interface which would look something like this: export interface Opts { foo: boolean, bar: string, baz: number } so that would probably have to be something like: export type Opts = manipulate(typeof options); where manipulate is some magical TS feature I hope to discover. I believe this is a good place to start: https://blog.mariusschulz.com/2017/01/20/typescript-2-1-mapped