typescript set oject key as enum code example Example: typescript object key as enum let layer: Partial<Record<MyEnum, any>>;