Skip to content

Enums

.NET enum types are marshalled as TypeScript-style numeric enums including reverse mappings of enum member values to names.

C#
[JSExport]
public enum ExampleEnum
{
    A = 1,
}
JS
const a = ExampleEnum.A; // 1
const nameOfA = ExampleEnum[a]; // 'A'

(Enum members are not auto-camel-cased by the marshaller.)

Released under the MIT license