Add enum handling methods for TypeScript

Fixed #150