How to create enum like type in TypeScript?

后端 未结 6 1107
南旧
南旧 2020-12-08 09:07

I\'m working on a definitions file for the Google maps API for TypeScript.

And I need to define an enum like type eg. google.maps.Animation which contai

6条回答
  •  醉酒成梦
    2020-12-08 09:27

    TypeScript 0.9+ has a specification for enums:

    enum AnimationType {
        BOUNCE,
        DROP,
    }
    

    The final comma is optional.

提交回复
热议问题