Typescript does not provide a standard method to get the number of enum elements. But given the the implementation of enum reverse mapping, the following works:
Object.keys(ExampleEnum).length / 2;
Note, for string enums you do not divide by two as no reverse mapping properties are generated:
Object.keys(StringEnum).length;
Enums with mixed strings and numeric values can be calculated by:
Object.keys(ExampleEnum).filter(isNaN).length;