typescript generics extends enum