typedoc 0.22.13 → 0.22.16

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.
Files changed (54) hide show
  1. package/README.md +2 -2
  2. package/dist/lib/converter/context.d.ts +2 -0
  3. package/dist/lib/converter/context.js +6 -0
  4. package/dist/lib/converter/converter.js +6 -1
  5. package/dist/lib/converter/factories/signature.d.ts +1 -0
  6. package/dist/lib/converter/factories/signature.js +33 -14
  7. package/dist/lib/converter/plugins/CategoryPlugin.d.ts +10 -4
  8. package/dist/lib/converter/plugins/CategoryPlugin.js +24 -14
  9. package/dist/lib/converter/plugins/CommentPlugin.js +9 -4
  10. package/dist/lib/converter/plugins/GroupPlugin.js +3 -3
  11. package/dist/lib/converter/plugins/PackagePlugin.js +27 -3
  12. package/dist/lib/converter/symbols.js +29 -29
  13. package/dist/lib/converter/types.js +10 -4
  14. package/dist/lib/models/reflections/abstract.d.ts +7 -1
  15. package/dist/lib/models/reflections/abstract.js +20 -1
  16. package/dist/lib/models/reflections/container.d.ts +5 -0
  17. package/dist/lib/models/reflections/container.js +1 -1
  18. package/dist/lib/models/reflections/declaration.d.ts +2 -0
  19. package/dist/lib/models/reflections/declaration.js +2 -2
  20. package/dist/lib/models/reflections/index.d.ts +1 -1
  21. package/dist/lib/models/reflections/index.js +2 -1
  22. package/dist/lib/models/reflections/signature.js +2 -2
  23. package/dist/lib/models/reflections/type-parameter.d.ts +12 -4
  24. package/dist/lib/models/reflections/type-parameter.js +12 -5
  25. package/dist/lib/models/types.d.ts +92 -23
  26. package/dist/lib/models/types.js +327 -78
  27. package/dist/lib/output/plugins/JavascriptIndexPlugin.js +18 -8
  28. package/dist/lib/output/plugins/LegendPlugin.js +1 -1
  29. package/dist/lib/output/plugins/MarkedLinksPlugin.js +1 -1
  30. package/dist/lib/output/renderer.d.ts +16 -0
  31. package/dist/lib/output/themes/default/layouts/default.js +8 -2
  32. package/dist/lib/output/themes/default/partials/header.js +3 -1
  33. package/dist/lib/output/themes/default/partials/member.declaration.js +2 -2
  34. package/dist/lib/output/themes/default/partials/member.signature.body.js +1 -1
  35. package/dist/lib/output/themes/default/partials/type.js +46 -44
  36. package/dist/lib/output/themes/default/partials/typeParameters.js +2 -1
  37. package/dist/lib/output/themes/default/templates/reflection.js +1 -1
  38. package/dist/lib/output/themes/lib.js +3 -1
  39. package/dist/lib/serialization/schema.d.ts +2 -2
  40. package/dist/lib/serialization/serializers/reflections/type-parameter.js +1 -0
  41. package/dist/lib/serialization/serializers/types/inferred.js +3 -0
  42. package/dist/lib/utils/entry-point.d.ts +1 -1
  43. package/dist/lib/utils/entry-point.js +6 -6
  44. package/dist/lib/utils/options/declaration.d.ts +14 -1
  45. package/dist/lib/utils/options/declaration.js +2 -0
  46. package/dist/lib/utils/options/options.js +5 -1
  47. package/dist/lib/utils/options/sources/typedoc.js +49 -5
  48. package/dist/lib/utils/package-manifest.js +1 -1
  49. package/dist/lib/utils/sort.d.ts +1 -1
  50. package/dist/lib/utils/sort.js +10 -9
  51. package/dist/lib/validation/documentation.js +55 -9
  52. package/package.json +16 -16
  53. package/static/main.js +2 -2
  54. package/static/style.css +3 -2
@@ -9,8 +9,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.JavascriptIndexPlugin = void 0;
10
10
  const Path = require("path");
11
11
  const lunr_1 = require("lunr");
12
- const index_1 = require("../../models/reflections/index");
13
- const GroupPlugin_1 = require("../../converter/plugins/GroupPlugin");
12
+ const models_1 = require("../../models");
13
+ const plugins_1 = require("../../converter/plugins");
14
14
  const components_1 = require("../components");
15
15
  const events_1 = require("../events");
16
16
  const utils_1 = require("../../utils");
@@ -33,6 +33,7 @@ let JavascriptIndexPlugin = class JavascriptIndexPlugin extends components_1.Ren
33
33
  * @param event An event object describing the current render operation.
34
34
  */
35
35
  onRendererBegin(event) {
36
+ var _a, _b, _c;
36
37
  if (!(this.owner.theme instanceof DefaultTheme_1.DefaultTheme)) {
37
38
  return;
38
39
  }
@@ -41,8 +42,9 @@ let JavascriptIndexPlugin = class JavascriptIndexPlugin extends components_1.Ren
41
42
  }
42
43
  const rows = [];
43
44
  const kinds = {};
44
- for (const reflection of event.project.getReflectionsByKind(index_1.ReflectionKind.All)) {
45
- if (!(reflection instanceof index_1.DeclarationReflection)) {
45
+ const kindBoosts = (_a = this.application.options.getValue("searchGroupBoosts")) !== null && _a !== void 0 ? _a : {};
46
+ for (const reflection of event.project.getReflectionsByKind(models_1.ReflectionKind.All)) {
47
+ if (!(reflection instanceof models_1.DeclarationReflection)) {
46
48
  continue;
47
49
  }
48
50
  if (!reflection.url ||
@@ -52,9 +54,17 @@ let JavascriptIndexPlugin = class JavascriptIndexPlugin extends components_1.Ren
52
54
  continue;
53
55
  }
54
56
  let parent = reflection.parent;
55
- if (parent instanceof index_1.ProjectReflection) {
57
+ let boost = (_b = reflection.relevanceBoost) !== null && _b !== void 0 ? _b : 1;
58
+ if (parent instanceof models_1.ProjectReflection) {
56
59
  parent = undefined;
57
60
  }
61
+ if (!kinds[reflection.kind]) {
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
+ }
67
+ }
58
68
  const row = {
59
69
  id: rows.length,
60
70
  kind: reflection.kind,
@@ -62,12 +72,12 @@ let JavascriptIndexPlugin = class JavascriptIndexPlugin extends components_1.Ren
62
72
  url: reflection.url,
63
73
  classes: reflection.cssClasses,
64
74
  };
75
+ if (boost !== 1) {
76
+ row.boost = boost;
77
+ }
65
78
  if (parent) {
66
79
  row.parent = parent.getFullName();
67
80
  }
68
- if (!kinds[reflection.kind]) {
69
- kinds[reflection.kind] = GroupPlugin_1.GroupPlugin.getKindSingular(reflection.kind);
70
- }
71
81
  rows.push(row);
72
82
  }
73
83
  const builder = new lunr_1.Builder();
@@ -30,7 +30,7 @@ const completeLegend = [
30
30
  ],
31
31
  [
32
32
  { name: "Enumeration", classes: ["tsd-kind-enum"] },
33
- { name: "Enumeration member", classes: ["tsd-kind-enum-member"] },
33
+ { name: "Enumeration Member", classes: ["tsd-kind-enum-member"] },
34
34
  {
35
35
  name: "Property",
36
36
  classes: ["tsd-kind-property", "tsd-parent-kind-enum"],
@@ -104,7 +104,7 @@ let MarkedLinksPlugin = MarkedLinksPlugin_1 = class MarkedLinksPlugin extends co
104
104
  }
105
105
  else {
106
106
  const fullName = (this.reflection ||
107
- this.project).getFullName();
107
+ this.project).getFriendlyFullName();
108
108
  this.warnings.push(`In ${fullName}: ${original}`);
109
109
  return original;
110
110
  }
@@ -29,6 +29,22 @@ export interface RendererHooks {
29
29
  * Applied immediately before the closing `</body>` tag.
30
30
  */
31
31
  "body.end": [DefaultThemeRenderContext];
32
+ /**
33
+ * Applied immediately before the main template.
34
+ */
35
+ "content.begin": [DefaultThemeRenderContext];
36
+ /**
37
+ * Applied immediately after the main template.
38
+ */
39
+ "content.end": [DefaultThemeRenderContext];
40
+ /**
41
+ * Applied immediately before calling `context.navigation`.
42
+ */
43
+ "navigation.begin": [DefaultThemeRenderContext];
44
+ /**
45
+ * Applied immediately after calling `context.navigation`.
46
+ */
47
+ "navigation.end": [DefaultThemeRenderContext];
32
48
  }
33
49
  /**
34
50
  * The renderer processes a {@link ProjectReflection} using a {@link Theme} instance and writes
@@ -24,8 +24,14 @@ const defaultLayout = (context, props) => (utils_1.JSX.createElement("html", { c
24
24
  context.header(props),
25
25
  utils_1.JSX.createElement("div", { class: "container container-main" },
26
26
  utils_1.JSX.createElement("div", { class: "row" },
27
- utils_1.JSX.createElement("div", { class: "col-8 col-content" }, props.template(props)),
28
- utils_1.JSX.createElement("div", { class: "col-4 col-menu menu-sticky-wrap menu-highlight" }, context.navigation(props)))),
27
+ utils_1.JSX.createElement("div", { class: "col-8 col-content" },
28
+ context.hook("content.begin"),
29
+ props.template(props),
30
+ context.hook("content.end")),
31
+ utils_1.JSX.createElement("div", { class: "col-4 col-menu menu-sticky-wrap menu-highlight" },
32
+ context.hook("navigation.begin"),
33
+ context.navigation(props),
34
+ context.hook("navigation.end")))),
29
35
  context.footer(props),
30
36
  utils_1.JSX.createElement("div", { class: "overlay" }),
31
37
  utils_1.JSX.createElement("script", { src: context.relativeURL("assets/main.js") }),
@@ -43,6 +43,8 @@ const header = (context, props) => {
43
43
  (0, lib_1.hasTypeParameters)(props.model) && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
44
44
  "<",
45
45
  (0, lib_1.join)(", ", props.model.typeParameters, (item) => item.name),
46
- ">")))))));
46
+ ">")),
47
+ " ",
48
+ (0, lib_1.renderFlags)(props.model.flags))))));
47
49
  };
48
50
  exports.header = header;
@@ -14,14 +14,14 @@ const memberDeclaration = (context, props) => (utils_1.JSX.createElement(utils_1
14
14
  ":"),
15
15
  " ",
16
16
  context.type(props.type))),
17
- !!props.defaultValue && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
17
+ !!props.defaultValue && props.kind !== models_1.ReflectionKind.EnumMember && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
18
18
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" },
19
19
  " = ",
20
20
  props.defaultValue)))),
21
21
  context.memberSources(props),
22
22
  context.comment(props),
23
23
  !!props.typeParameters && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
24
- utils_1.JSX.createElement("h4", { class: "tsd-type-parameters-title" }, "Type parameters"),
24
+ utils_1.JSX.createElement("h4", { class: "tsd-type-parameters-title" }, "Type Parameters"),
25
25
  context.typeParameters(props.typeParameters))),
26
26
  props.type instanceof models_1.ReflectionType && (utils_1.JSX.createElement("div", { class: "tsd-type-declaration" },
27
27
  utils_1.JSX.createElement("h4", null, "Type declaration"),
@@ -10,7 +10,7 @@ const memberSignatureBody = (context, props, { hideSources = false } = {}) => {
10
10
  !hideSources && context.memberSources(props),
11
11
  context.comment(props),
12
12
  !!props.typeParameters && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
13
- utils_1.JSX.createElement("h4", { class: "tsd-type-parameters-title" }, "Type parameters"),
13
+ utils_1.JSX.createElement("h4", { class: "tsd-type-parameters-title" }, "Type Parameters"),
14
14
  context.typeParameters(props.typeParameters))),
15
15
  props.parameters && props.parameters.length > 0 && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
16
16
  utils_1.JSX.createElement("h4", { class: "tsd-parameters-title" }, "Parameters"),
@@ -59,23 +59,21 @@ function renderUniquePath(context, reflection) {
59
59
  const typeRenderers = {
60
60
  array(context, type) {
61
61
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
62
- renderType(context, type.elementType, { needsParens: true }),
62
+ renderType(context, type.elementType, models_1.TypeContext.arrayElement),
63
63
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "[]")));
64
64
  },
65
- conditional(context, type, { needsParens }) {
65
+ conditional(context, type) {
66
66
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
67
- needsParens && utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "("),
68
- renderType(context, type.checkType, { needsParens: true }),
67
+ renderType(context, type.checkType, models_1.TypeContext.conditionalCheck),
69
68
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, " extends "),
70
- renderType(context, type.extendsType),
69
+ renderType(context, type.extendsType, models_1.TypeContext.conditionalExtends),
71
70
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, " ? "),
72
- renderType(context, type.trueType),
71
+ renderType(context, type.trueType, models_1.TypeContext.conditionalTrue),
73
72
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, " : "),
74
- renderType(context, type.falseType),
75
- needsParens && utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, ")")));
73
+ renderType(context, type.falseType, models_1.TypeContext.conditionalFalse)));
76
74
  },
77
75
  indexedAccess(context, type) {
78
- let indexType = renderType(context, type.indexType);
76
+ let indexType = renderType(context, type.indexType, models_1.TypeContext.indexedIndex);
79
77
  if (type.objectType instanceof models_1.ReferenceType &&
80
78
  type.objectType.reflection &&
81
79
  type.indexType instanceof models_1.LiteralType &&
@@ -86,22 +84,22 @@ const typeRenderers = {
86
84
  }
87
85
  }
88
86
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
89
- renderType(context, type.objectType),
87
+ renderType(context, type.objectType, models_1.TypeContext.indexedObject),
90
88
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "["),
91
89
  indexType,
92
90
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "]")));
93
91
  },
94
- inferred(_context, type) {
92
+ inferred(context, type) {
95
93
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
96
94
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "infer "),
97
95
  " ",
98
- type.name));
96
+ type.name,
97
+ type.constraint && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
98
+ utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, " extends "),
99
+ renderType(context, type.constraint, models_1.TypeContext.inferredConstraint)))));
99
100
  },
100
- intersection(context, type, { needsParens }) {
101
- return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
102
- needsParens && utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "("),
103
- (0, lib_1.join)(utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, " & "), type.types, (item) => renderType(context, item, { needsParens: true })),
104
- needsParens && utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, ")")));
101
+ intersection(context, type) {
102
+ return (0, lib_1.join)(utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, " & "), type.types, (item) => renderType(context, item, models_1.TypeContext.intersectionElement));
105
103
  },
106
104
  intrinsic(_context, type) {
107
105
  return utils_1.JSX.createElement("span", { class: "tsd-signature-type" }, type.name);
@@ -119,9 +117,9 @@ const typeRenderers = {
119
117
  children.push(utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "-readonly "));
120
118
  break;
121
119
  }
122
- children.push(utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "[ "), utils_1.JSX.createElement("span", { class: "tsd-signature-type" }, type.parameter), utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, " in "), renderType(context, type.parameterType));
120
+ children.push(utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "[ "), utils_1.JSX.createElement("span", { class: "tsd-signature-type" }, type.parameter), utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, " in "), renderType(context, type.parameterType, models_1.TypeContext.mappedParameter));
123
121
  if (type.nameType) {
124
- children.push(utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, " as "), renderType(context, type.nameType));
122
+ children.push(utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, " as "), renderType(context, type.nameType, models_1.TypeContext.mappedName));
125
123
  }
126
124
  children.push(utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "]"));
127
125
  switch (type.optionalModifier) {
@@ -134,7 +132,7 @@ const typeRenderers = {
134
132
  default:
135
133
  children.push(utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, ": "));
136
134
  }
137
- children.push(renderType(context, type.templateType));
135
+ children.push(renderType(context, type.templateType, models_1.TypeContext.mappedTemplate));
138
136
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
139
137
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "{"),
140
138
  " ",
@@ -146,11 +144,11 @@ const typeRenderers = {
146
144
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
147
145
  type.name,
148
146
  type.isOptional ? (utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "?: ")) : (utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, ": ")),
149
- renderType(context, type.element)));
147
+ renderType(context, type.element, models_1.TypeContext.tupleElement)));
150
148
  },
151
149
  optional(context, type) {
152
150
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
153
- renderType(context, type.elementType),
151
+ renderType(context, type.elementType, models_1.TypeContext.optionalElement),
154
152
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "?")));
155
153
  },
156
154
  predicate(context, type) {
@@ -159,12 +157,12 @@ const typeRenderers = {
159
157
  utils_1.JSX.createElement("span", { class: "tsd-signature-type" }, type.name),
160
158
  !!type.targetType && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
161
159
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, " is "),
162
- renderType(context, type.targetType)))));
160
+ renderType(context, type.targetType, models_1.TypeContext.predicateTarget)))));
163
161
  },
164
162
  query(context, type) {
165
163
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
166
164
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "typeof "),
167
- renderType(context, type.queryType)));
165
+ renderType(context, type.queryType, models_1.TypeContext.queryTypeTarget)));
168
166
  },
169
167
  reference(context, type) {
170
168
  var _a;
@@ -192,12 +190,12 @@ const typeRenderers = {
192
190
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
193
191
  name,
194
192
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "<"),
195
- (0, lib_1.join)(utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, ", "), type.typeArguments, (item) => renderType(context, item)),
193
+ (0, lib_1.join)(utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, ", "), type.typeArguments, (item) => renderType(context, item, models_1.TypeContext.referenceTypeArgument)),
196
194
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, ">")));
197
195
  }
198
196
  return name;
199
197
  },
200
- reflection(context, type, { needsParens }) {
198
+ reflection(context, type) {
201
199
  var _a;
202
200
  if (type.declaration.children) {
203
201
  // Object literal
@@ -209,14 +207,14 @@ const typeRenderers = {
209
207
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
210
208
  item.name,
211
209
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, ": "),
212
- renderType(context, item.getSignature.type)));
210
+ renderType(context, item.getSignature.type, models_1.TypeContext.none)));
213
211
  }
214
212
  if (item.getSignature) {
215
213
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
216
214
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "get "),
217
215
  item.name,
218
216
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "(): "),
219
- renderType(context, item.getSignature.type)));
217
+ renderType(context, item.getSignature.type, models_1.TypeContext.none)));
220
218
  }
221
219
  if (item.setSignature) {
222
220
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
@@ -226,24 +224,24 @@ const typeRenderers = {
226
224
  _a.map((item) => (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
227
225
  item.name,
228
226
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, ": "),
229
- renderType(context, item.type)))),
227
+ renderType(context, item.type, models_1.TypeContext.none)))),
230
228
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, ")")));
231
229
  }
232
230
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
233
231
  item.name,
234
232
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, item.flags.isOptional ? "?: " : ": "),
235
- renderType(context, item.type)));
233
+ renderType(context, item.type, models_1.TypeContext.none)));
236
234
  }),
237
235
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, " }")));
238
236
  }
239
237
  if (((_a = type.declaration.signatures) === null || _a === void 0 ? void 0 : _a.length) === 1) {
240
238
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
241
- needsParens && utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "("),
239
+ utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "("),
242
240
  context.memberSignatureTitle(type.declaration.signatures[0], {
243
241
  hideName: true,
244
242
  arrowStyle: true,
245
243
  }),
246
- needsParens && utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, ")")));
244
+ utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, ")")));
247
245
  }
248
246
  if (type.declaration.signatures) {
249
247
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
@@ -258,7 +256,7 @@ const typeRenderers = {
258
256
  rest(context, type) {
259
257
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
260
258
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "..."),
261
- renderType(context, type.elementType)));
259
+ renderType(context, type.elementType, models_1.TypeContext.restElement)));
262
260
  },
263
261
  "template-literal"(context, type) {
264
262
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
@@ -266,7 +264,7 @@ const typeRenderers = {
266
264
  type.head && utils_1.JSX.createElement("span", { class: "tsd-signature-type" }, type.head),
267
265
  type.tail.map((item) => (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
268
266
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "${"),
269
- renderType(context, item[0]),
267
+ renderType(context, item[0], models_1.TypeContext.templateLiteralElement),
270
268
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "}"),
271
269
  item[1] && utils_1.JSX.createElement("span", { class: "tsd-signature-type" }, item[1])))),
272
270
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "`")));
@@ -274,7 +272,7 @@ const typeRenderers = {
274
272
  tuple(context, type) {
275
273
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
276
274
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "["),
277
- (0, lib_1.join)(utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, ", "), type.elements, (item) => renderType(context, item)),
275
+ (0, lib_1.join)(utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, ", "), type.elements, (item) => renderType(context, item, models_1.TypeContext.tupleElement)),
278
276
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "]")));
279
277
  },
280
278
  typeOperator(context, type) {
@@ -282,26 +280,30 @@ const typeRenderers = {
282
280
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" },
283
281
  type.operator,
284
282
  " "),
285
- renderType(context, type.target)));
283
+ renderType(context, type.target, models_1.TypeContext.typeOperatorTarget)));
286
284
  },
287
- union(context, type, { needsParens }) {
288
- return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
289
- !!needsParens && utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "("),
290
- (0, lib_1.join)(utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, " | "), type.types, (item) => renderType(context, item, { needsParens: true })),
291
- !!needsParens && utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, ")")));
285
+ union(context, type) {
286
+ return (0, lib_1.join)(utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, " | "), type.types, (item) => renderType(context, item, models_1.TypeContext.unionElement));
292
287
  },
293
288
  unknown(_context, type) {
294
289
  return utils_1.JSX.createElement(utils_1.JSX.Fragment, null, type.name);
295
290
  },
296
291
  };
297
- function renderType(context, type, options) {
292
+ function renderType(context, type, where) {
298
293
  if (!type) {
299
294
  return utils_1.JSX.createElement("span", { class: "tsd-signature-type" }, "any");
300
295
  }
301
296
  const renderFn = typeRenderers[type.type];
302
- return renderFn(context, type, options !== null && options !== void 0 ? options : {});
297
+ const rendered = renderFn(context, type);
298
+ if (type.needsParenthesis(where)) {
299
+ return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
300
+ utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "("),
301
+ rendered,
302
+ utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, ")")));
303
+ }
304
+ return rendered;
303
305
  }
304
306
  function type(context, type) {
305
- return renderType(context, type, {});
307
+ return renderType(context, type, models_1.TypeContext.none);
306
308
  }
307
309
  exports.type = type;
@@ -5,9 +5,10 @@ const utils_1 = require("../../../../utils");
5
5
  function typeParameters(context, typeParameters) {
6
6
  return (utils_1.JSX.createElement("ul", { class: "tsd-type-parameters" }, typeParameters === null || typeParameters === void 0 ? void 0 : typeParameters.map((item) => (utils_1.JSX.createElement("li", null,
7
7
  utils_1.JSX.createElement("h4", null,
8
+ item.varianceModifier ? `${item.varianceModifier} ` : "",
8
9
  item.name,
9
10
  !!item.type && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
10
- utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, ": "),
11
+ utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, " extends "),
11
12
  context.type(item.type))),
12
13
  !!item.default && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
13
14
  " = ",
@@ -9,7 +9,7 @@ const reflectionTemplate = (context, props) => {
9
9
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
10
10
  props.model.hasComment() && utils_1.JSX.createElement("section", { class: "tsd-panel tsd-comment" }, context.comment(props.model)),
11
11
  (0, lib_1.hasTypeParameters)(props.model) && (utils_1.JSX.createElement("section", { class: "tsd-panel tsd-type-parameters" },
12
- utils_1.JSX.createElement("h3", null, "Type parameters"),
12
+ utils_1.JSX.createElement("h3", null, "Type Parameters"),
13
13
  context.typeParameters(props.model.typeParameters))),
14
14
  props.model instanceof models_1.DeclarationReflection && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
15
15
  !!props.model.typeHierarchy && (utils_1.JSX.createElement("section", { class: "tsd-panel tsd-hierarchy" },
@@ -67,7 +67,9 @@ exports.hasTypeParameters = hasTypeParameters;
67
67
  function renderTypeParametersSignature(typeParameters) {
68
68
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null, !!typeParameters && typeParameters.length > 0 && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
69
69
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "<"),
70
- join(utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, ", "), typeParameters, (item) => (utils_1.JSX.createElement("span", { class: "tsd-signature-type", "data-tsd-kind": item.kindString }, item.name))),
70
+ join(utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, ", "), typeParameters, (item) => (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
71
+ item.varianceModifier ? `${item.varianceModifier} ` : "",
72
+ utils_1.JSX.createElement("span", { class: "tsd-signature-type", "data-tsd-kind": item.kindString }, item.name)))),
71
73
  utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, ">")))));
72
74
  }
73
75
  exports.renderTypeParametersSignature = renderTypeParametersSignature;
@@ -71,7 +71,7 @@ export interface DeclarationReflection extends ContainerReflection, S<M.Declarat
71
71
  getSignature?: [ModelToObject<M.DeclarationReflection["getSignature"]>];
72
72
  setSignature?: [ModelToObject<M.DeclarationReflection["setSignature"]>];
73
73
  }
74
- export interface TypeParameterReflection extends Reflection, S<M.TypeParameterReflection, "type" | "default"> {
74
+ export interface TypeParameterReflection extends Reflection, S<M.TypeParameterReflection, "type" | "default" | "varianceModifier"> {
75
75
  }
76
76
  export interface ProjectReflection extends ContainerReflection {
77
77
  }
@@ -113,7 +113,7 @@ export interface ConditionalType extends Type, S<M.ConditionalType, "type" | "ch
113
113
  }
114
114
  export interface IndexedAccessType extends Type, S<M.IndexedAccessType, "type" | "indexType" | "objectType"> {
115
115
  }
116
- export interface InferredType extends Type, S<M.InferredType, "type" | "name"> {
116
+ export interface InferredType extends Type, S<M.InferredType, "type" | "name" | "constraint"> {
117
117
  }
118
118
  export interface IntersectionType extends Type, S<M.IntersectionType, "type" | "types"> {
119
119
  }
@@ -12,6 +12,7 @@ class TypeParameterReflectionSerializer extends components_1.ReflectionSerialize
12
12
  ...obj,
13
13
  type: this.owner.toObject(typeParameter.type),
14
14
  default: this.owner.toObject(typeParameter.default),
15
+ varianceModifier: typeParameter.varianceModifier,
15
16
  };
16
17
  }
17
18
  }
@@ -11,6 +11,9 @@ class InferredTypeSerializer extends components_1.TypeSerializerComponent {
11
11
  return {
12
12
  ...obj,
13
13
  name: inferred.name,
14
+ constraint: inferred.constraint
15
+ ? this.owner.toObject(inferred.constraint)
16
+ : undefined,
14
17
  };
15
18
  }
16
19
  }
@@ -8,7 +8,7 @@ import type { Options } from "./options";
8
8
  export declare const EntryPointStrategy: {
9
9
  /**
10
10
  * The default behavior in v0.22+, expects all provided entry points as being part of a single program.
11
- * Any directories included in the entry point list will result in `dir/index.[tj]sx?` being used.
11
+ * Any directories included in the entry point list will result in `dir/index.([cm][tj]s|[tj]sx?)` being used.
12
12
  */
13
13
  readonly Resolve: "resolve";
14
14
  /**
@@ -14,7 +14,7 @@ const fs_1 = require("./fs");
14
14
  exports.EntryPointStrategy = {
15
15
  /**
16
16
  * The default behavior in v0.22+, expects all provided entry points as being part of a single program.
17
- * Any directories included in the entry point list will result in `dir/index.[tj]sx?` being used.
17
+ * Any directories included in the entry point list will result in `dir/index.([cm][tj]s|[tj]sx?)` being used.
18
18
  */
19
19
  Resolve: "resolve",
20
20
  /**
@@ -73,7 +73,7 @@ function getWatchEntryPoints(logger, options, program) {
73
73
  }
74
74
  exports.getWatchEntryPoints = getWatchEntryPoints;
75
75
  function getModuleName(fileName, baseDir) {
76
- return (0, fs_1.normalizePath)((0, path_1.relative)(baseDir, fileName)).replace(/(\/index)?(\.d)?\.[tj]sx?$/, "");
76
+ return (0, fs_1.normalizePath)((0, path_1.relative)(baseDir, fileName)).replace(/(\/index)?(\.d)?\.([cm][tj]s|[tj]sx?)$/, "");
77
77
  }
78
78
  /**
79
79
  * Converts a list of file-oriented paths in to DocumentationEntryPoints for conversion.
@@ -84,8 +84,8 @@ function getEntryPointsForPaths(logger, inputFiles, options, programs = getEntry
84
84
  const entryPoints = [];
85
85
  entryLoop: for (const fileOrDir of inputFiles.map(fs_1.normalizePath)) {
86
86
  const toCheck = [fileOrDir];
87
- if (!/\.[tj]sx?/.test(fileOrDir)) {
88
- toCheck.push(`${fileOrDir}/index.ts`, `${fileOrDir}/index.tsx`, `${fileOrDir}/index.js`, `${fileOrDir}/index.jsx`);
87
+ if (!/\.([cm][tj]s|[tj]sx?)$/.test(fileOrDir)) {
88
+ toCheck.push(`${fileOrDir}/index.ts`, `${fileOrDir}/index.cts`, `${fileOrDir}/index.mts`, `${fileOrDir}/index.tsx`, `${fileOrDir}/index.js`, `${fileOrDir}/index.cjs`, `${fileOrDir}/index.mjs`, `${fileOrDir}/index.jsx`);
89
89
  }
90
90
  for (const program of programs) {
91
91
  for (const check of toCheck) {
@@ -147,8 +147,8 @@ function expandInputFiles(logger, entryPoints, options) {
147
147
  const exclude = (0, paths_1.createMinimatch)(options.getValue("exclude"));
148
148
  const compilerOptions = options.getCompilerOptions();
149
149
  const supportedFileRegex = compilerOptions.allowJs || compilerOptions.checkJs
150
- ? /\.[tj]sx?$/
151
- : /\.tsx?$/;
150
+ ? /\.([cm][tj]s|[tj]sx?)$/
151
+ : /\.([cm]ts|tsx?)$/;
152
152
  function add(file, entryPoint) {
153
153
  let stats;
154
154
  try {
@@ -2,7 +2,7 @@ import type { Theme as ShikiTheme } from "shiki";
2
2
  import type { LogLevel } from "../loggers";
3
3
  import type { SortStrategy } from "../sort";
4
4
  import type { EntryPointStrategy } from "../entry-point";
5
- import type { ReflectionKind } from "../../models/reflections/kind";
5
+ import { ReflectionKind } from "../../models/reflections/kind";
6
6
  export declare const EmitStrategy: {
7
7
  readonly true: true;
8
8
  readonly false: false;
@@ -28,6 +28,15 @@ export declare type TypeDocOptions = {
28
28
  export declare type TypeDocOptionValues = {
29
29
  [K in keyof TypeDocOptionMap]: unknown extends TypeDocOptionMap[K] ? unknown : TypeDocOptionMap[K] extends string | string[] | number | boolean | Record<string, boolean> ? TypeDocOptionMap[K] : TypeDocOptionMap[K][keyof TypeDocOptionMap[K]];
30
30
  };
31
+ declare const Kinds: (string | number)[];
32
+ export interface SearchConfig {
33
+ searchGroupBoosts?: {
34
+ [key: typeof Kinds[number]]: number;
35
+ };
36
+ searchCategoryBoosts?: {
37
+ [key: string]: number;
38
+ };
39
+ }
31
40
  /**
32
41
  * Describes all TypeDoc options. Used internally to provide better types when fetching options.
33
42
  * External consumers should likely use {@link TypeDocOptions} instead.
@@ -78,9 +87,12 @@ export interface TypeDocOptionMap {
78
87
  version: boolean;
79
88
  showConfig: boolean;
80
89
  plugin: string[];
90
+ searchCategoryBoosts: unknown;
91
+ searchGroupBoosts: unknown;
81
92
  logger: unknown;
82
93
  logLevel: typeof LogLevel;
83
94
  markedOptions: unknown;
95
+ compilerOptions: unknown;
84
96
  treatWarningsAsErrors: boolean;
85
97
  intentionallyNotExported: string[];
86
98
  /** @deprecated use validation.invalidLink */
@@ -275,3 +287,4 @@ export declare type DeclarationOptionToOptionType<T extends DeclarationOption> =
275
287
  */
276
288
  export declare function convert(value: unknown, option: DeclarationOption, configPath: string): unknown;
277
289
  export declare function getDefaultValue(option: DeclarationOption): unknown;
290
+ export {};
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getDefaultValue = exports.convert = exports.ParameterType = exports.ParameterHint = exports.EmitStrategy = void 0;
4
4
  const path_1 = require("path");
5
+ const kind_1 = require("../../models/reflections/kind");
5
6
  exports.EmitStrategy = {
6
7
  true: true,
7
8
  false: false,
@@ -9,6 +10,7 @@ exports.EmitStrategy = {
9
10
  docs: "docs",
10
11
  none: "none", // Emit nothing, just convert and run validation
11
12
  };
13
+ const Kinds = Object.values(kind_1.ReflectionKind);
12
14
  var ParameterHint;
13
15
  (function (ParameterHint) {
14
16
  ParameterHint[ParameterHint["File"] = 0] = "File";
@@ -168,7 +168,7 @@ class Options {
168
168
  }
169
169
  setValue(name, value, configPath) {
170
170
  if (this.isFrozen()) {
171
- throw new Error("Tried to modify an option value after options have been sealed.");
171
+ throw new Error("Tried to modify an option value after options have been frozen.");
172
172
  }
173
173
  const declaration = this.getDeclaration(name);
174
174
  if (!declaration) {
@@ -191,7 +191,11 @@ class Options {
191
191
  }
192
192
  /** @internal */
193
193
  fixCompilerOptions(options) {
194
+ const overrides = this.getValue("compilerOptions");
194
195
  const result = { ...options };
196
+ if (overrides) {
197
+ Object.assign(result, overrides);
198
+ }
195
199
  if (this.getValue("emit") !== "both" &&
196
200
  this.getValue("emit") !== true) {
197
201
  result.noEmit = true;