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 propType.isStringLiteral() || propType.isNumberLiteral();
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
- assert(propType.isStringLiteral() || propType.isNumberLiteral());
481
- reflection.defaultValue = JSON.stringify(propType.value);
482
- reflection.type = new models_1.LiteralType(propType.value);
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
- const kindBoost = kindBoosts[(_c = kinds[reflection.kind]) !== null && _c !== void 0 ? _c : ""];
64
- if (kindBoost != undefined) {
65
- boost *= kindBoost;
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "typedoc",
3
3
  "description": "Create api documentation for TypeScript projects.",
4
- "version": "0.22.17",
4
+ "version": "0.22.18",
5
5
  "homepage": "https://typedoc.org",
6
6
  "main": "./dist/index.js",
7
7
  "exports": "./dist/index.js",