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
The support for #1675 works only for .ts files, but not for .d.ts files (not even those generated from the supported syntax). Could the suport for "as const" object enums be extended for enum-object declarations?
See the #1675 for full context.
Turns out I could do one better. So long as the property types are string literals, TypeDoc will recognize @enum on variables now :) Don't even need readonly since the type being a string literal makes the property effectively readonly
I have played around with this a bit recently again, and it seems we are missing per-element jsdoc in all but the standard enum case (at latest version). I am gonna open a follow-up issue once I have time to summarize it.
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
as const enum
enum-like objects
union of literals
Problem
The support for #1675 works only for .ts files, but not for .d.ts files (not even those generated from the supported syntax). Could the suport for "as const" object enums be extended for enum-object declarations?
See the #1675 for full context.
eg. in addition to
there would be also support to detect the following as an enum too:
(This is especially needed when typedoc is executed after pre-processing the .ts APIs by e.g. tsc / api-extractor to .d.ts)
There is even a "convenience variant" for cases when this is manually written:
but that might be more annoying to detect.
The text was updated successfully, but these errors were encountered: