typedoc 0.22.17 → 0.22.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -465,9 +465,12 @@ function isEnumLike(checker, type, location) {
|
|
|
465
465
|
}
|
|
466
466
|
return type.getProperties().every((prop) => {
|
|
467
467
|
const propType = checker.getTypeOfSymbolAtLocation(prop, location);
|
|
468
|
-
return
|
|
468
|
+
return isValidEnumProperty(propType);
|
|
469
469
|
});
|
|
470
470
|
}
|
|
471
|
+
function isValidEnumProperty(type) {
|
|
472
|
+
return (0, enum_1.hasAnyFlag)(type.flags, ts.TypeFlags.NumberLike | ts.TypeFlags.StringLike);
|
|
473
|
+
}
|
|
471
474
|
function convertVariableAsEnum(context, symbol, exportSymbol) {
|
|
472
475
|
const reflection = context.createDeclarationReflection(models_1.ReflectionKind.Enum, symbol, exportSymbol);
|
|
473
476
|
context.finalizeDeclarationReflection(reflection, symbol, exportSymbol);
|
|
@@ -477,9 +480,10 @@ function convertVariableAsEnum(context, symbol, exportSymbol) {
|
|
|
477
480
|
for (const prop of type.getProperties()) {
|
|
478
481
|
const reflection = rc.createDeclarationReflection(models_1.ReflectionKind.EnumMember, prop, void 0);
|
|
479
482
|
const propType = context.checker.getTypeOfSymbolAtLocation(prop, declaration);
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
+
reflection.type = context.converter.convertType(context, propType);
|
|
484
|
+
if (propType.isStringLiteral() || propType.isNumberLiteral()) {
|
|
485
|
+
reflection.defaultValue = JSON.stringify(propType.value);
|
|
486
|
+
}
|
|
483
487
|
rc.finalizeDeclarationReflection(reflection, prop, void 0);
|
|
484
488
|
}
|
|
485
489
|
// Skip converting the type alias, if there is one
|
|
@@ -60,10 +60,10 @@ let JavascriptIndexPlugin = class JavascriptIndexPlugin extends components_1.Ren
|
|
|
60
60
|
}
|
|
61
61
|
if (!kinds[reflection.kind]) {
|
|
62
62
|
kinds[reflection.kind] = plugins_1.GroupPlugin.getKindSingular(reflection.kind);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
}
|
|
64
|
+
const kindBoost = kindBoosts[(_c = kinds[reflection.kind]) !== null && _c !== void 0 ? _c : ""];
|
|
65
|
+
if (kindBoost != undefined) {
|
|
66
|
+
boost *= kindBoost;
|
|
67
67
|
}
|
|
68
68
|
const row = {
|
|
69
69
|
id: rows.length,
|
package/package.json
CHANGED