-
-
Notifications
You must be signed in to change notification settings - Fork 750
Description
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
/** @enum /
export const EntryPointStrategy = {
/*
* abcd
*/
Resolve: "resolve",
} as const;
there would be also support to detect the following as an enum too:
/** @enum /
export ( declare ) const EntryPointStrategy: {
/*
* abcd
*/
readonly Resolve: "resolve",
};
(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:
/** @enum /
export const EntryPointStrategy: Readonly<{
/*
* abcd
*/
Resolve: "resolve",
}>;
but that might be more annoying to detect.