Preserve const enums in typescriptServices.js

Fixes #1104.