You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeDoc already supports enum-like objects with string literal values via #1675 and #1740. However, enum-like objects with numeric literal values are not supported. For the following code example:
// index.d.ts/** * This enumeration defines some values. * * @enum */exportdeclareconstSomeStringLiteralEnum: {/** * This is the auto property. */readonlyAUTO: "auto";/** * This is the manual property. */readonlyMANUAL: "manual";};/** * This enumeration also defines some values. * * @enum */exportdeclareconstSomeNumericLiteralEnum: {/** * This is the auto property. */readonlyAUTO: 0;/** * This is the manual property. */readonlyMANUAL: 1;};
TypeDoc will document SomeStringLiteralEnum as an enum and SomeNumericLiteralEnum as a variable:
Suggested Solution
Support enum-like objects with numeric literal values in the same way as those with string literal values. I think it would only require some minor changes in src/lib/converter/symbols.ts.
The text was updated successfully, but these errors were encountered:
If this is something we'd like to support in TypeDoc, I'd be happy to contribute this feature - I've already done some tinkering in the source code. :)
TypeDoc already supports enum-like objects with string literal values
via TypeStrong#1675 and TypeStrong#1740. Enum-like objects with numeric literal values
should also be supported, as they are a popular choice for developers
wishing to avoid use of TypeScript enums.
This PR adds support for such objects. Tests and a new example have
been added to cover this type of object.
ResolvesTypeStrong#1918.
Search terms
enum, enum-like object
Problem
TypeDoc already supports enum-like objects with string literal values via #1675 and #1740. However, enum-like objects with numeric literal values are not supported. For the following code example:
TypeDoc will document
SomeStringLiteralEnum
as an enum andSomeNumericLiteralEnum
as a variable:Suggested Solution
Support enum-like objects with numeric literal values in the same way as those with string literal values. I think it would only require some minor changes in
src/lib/converter/symbols.ts
.The text was updated successfully, but these errors were encountered: