Answers for "typescript object key as enum"

0

typescript object key as enum

let layer: Partial<Record<MyEnum, any>>;
Posted by: Guest on May-25-2021
0

typescript object key enum

// Since 2018, there is an easier way in Typescript, 
//without using keyof typeof:

let layer: { [key in MyEnum]: any}

// To not have to include all keys:

let layer: { [key in MyEnum]?: an
Posted by: Guest on June-30-2021

Code answers related to "typescript object key as enum"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language