Compiler JSDoc Modifiers

Since TypeScript does not support decorators on anything but classes, class fields and class methods, you can use the following JSDoc modifiers to apply some customization:

InspectorName

To change the name of an enum member, akin to unity's InspectorNameAttributearrow-up-right:

export enum ModelImporterIndexFormat {
    Auto,
    /** @InspectorName 16 bits **/
    UInt16,
    /** @InspectorName 32 bits **/
    UInt32,
}
circle-exclamation

Flags

To mark an enum as a flag enum, you can use @flags

/** @flags */
export enum ExampleFlags {
    A = 1,
    B = 2,
    C = 4,
    D = 8,
    E = 16,
    // ...
}

Do note that if it doesn't follow powers of 2, it will fall back to an integer enum.

Last updated