I know that an enum
in Typescript compiles down to an object for runtime. I wanted to merge two enums enum EnumOne { ... }; enum EnumTwo { ... }
with Object.assign(). That works.
In doing so, Typescript tells me, that the product of that is typeof EnumOne & typeof EnumTwo
. So far, so good.
Now, Typescript also lets me know that “EnumOne
is not assignable to typeof EnumOne
”, which sounds reasonable, but it makes me wonder, what actually does typeof EnumOne
mean? What is that? I cannot get the Typescript compiler to give me any meaningful information on it.