typedoc 0.25.13 → 0.26.0-beta.0

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 (207) hide show
  1. package/dist/index.d.ts +3 -2
  2. package/dist/index.js +3 -2
  3. package/dist/lib/application.d.ts +15 -3
  4. package/dist/lib/application.js +65 -23
  5. package/dist/lib/cli.js +1 -1
  6. package/dist/lib/converter/comments/blockLexer.d.ts +1 -1
  7. package/dist/lib/converter/comments/blockLexer.js +1 -2
  8. package/dist/lib/converter/comments/declarationReference.js +8 -8
  9. package/dist/lib/converter/comments/declarationReferenceResolver.d.ts +1 -1
  10. package/dist/lib/converter/comments/declarationReferenceResolver.js +15 -14
  11. package/dist/lib/converter/comments/discovery.d.ts +3 -3
  12. package/dist/lib/converter/comments/discovery.js +21 -19
  13. package/dist/lib/converter/comments/index.d.ts +1 -1
  14. package/dist/lib/converter/comments/index.js +35 -16
  15. package/dist/lib/converter/comments/lineLexer.d.ts +1 -1
  16. package/dist/lib/converter/comments/lineLexer.js +1 -2
  17. package/dist/lib/converter/comments/linkResolver.d.ts +2 -2
  18. package/dist/lib/converter/comments/linkResolver.js +5 -3
  19. package/dist/lib/converter/comments/parser.d.ts +14 -3
  20. package/dist/lib/converter/comments/parser.js +144 -39
  21. package/dist/lib/converter/comments/rawLexer.d.ts +7 -1
  22. package/dist/lib/converter/comments/rawLexer.js +21 -70
  23. package/dist/lib/converter/comments/tagName.js +1 -2
  24. package/dist/lib/converter/context.d.ts +7 -2
  25. package/dist/lib/converter/context.js +7 -2
  26. package/dist/lib/converter/convert-expression.js +2 -3
  27. package/dist/lib/converter/converter.d.ts +8 -3
  28. package/dist/lib/converter/converter.js +16 -13
  29. package/dist/lib/converter/factories/index-signature.d.ts +1 -1
  30. package/dist/lib/converter/factories/index-signature.js +9 -12
  31. package/dist/lib/converter/factories/signature.d.ts +1 -1
  32. package/dist/lib/converter/factories/signature.js +11 -12
  33. package/dist/lib/converter/jsdoc.js +2 -3
  34. package/dist/lib/converter/plugins/CategoryPlugin.d.ts +3 -3
  35. package/dist/lib/converter/plugins/CategoryPlugin.js +22 -15
  36. package/dist/lib/converter/plugins/CommentPlugin.d.ts +1 -1
  37. package/dist/lib/converter/plugins/CommentPlugin.js +58 -67
  38. package/dist/lib/converter/plugins/GroupPlugin.d.ts +4 -4
  39. package/dist/lib/converter/plugins/GroupPlugin.js +52 -18
  40. package/dist/lib/converter/plugins/ImplementsPlugin.js +4 -3
  41. package/dist/lib/converter/plugins/InheritDocPlugin.d.ts +1 -1
  42. package/dist/lib/converter/plugins/InheritDocPlugin.js +5 -6
  43. package/dist/lib/converter/plugins/LinkResolverPlugin.d.ts +2 -2
  44. package/dist/lib/converter/plugins/PackagePlugin.d.ts +0 -2
  45. package/dist/lib/converter/plugins/PackagePlugin.js +8 -30
  46. package/dist/lib/converter/plugins/SourcePlugin.js +2 -2
  47. package/dist/lib/converter/symbols.js +31 -11
  48. package/dist/lib/converter/types.d.ts +1 -1
  49. package/dist/lib/converter/types.js +4 -5
  50. package/dist/lib/converter/utils/nodes.js +3 -4
  51. package/dist/lib/converter/utils/reflections.d.ts +1 -1
  52. package/dist/lib/converter/utils/reflections.js +1 -2
  53. package/dist/lib/converter/utils/repository.js +4 -4
  54. package/dist/lib/converter/utils/symbols.js +1 -2
  55. package/dist/lib/internationalization/index.d.ts +7 -0
  56. package/dist/lib/internationalization/index.js +11 -0
  57. package/dist/lib/internationalization/internationalization.d.ts +92 -0
  58. package/dist/lib/internationalization/internationalization.js +194 -0
  59. package/dist/lib/internationalization/locales/en.cjs +3 -0
  60. package/dist/lib/internationalization/locales/en.d.cts +2 -0
  61. package/dist/lib/internationalization/locales/test.cjs +8 -0
  62. package/dist/lib/internationalization/locales/test.d.cts +5 -0
  63. package/dist/lib/internationalization/translatable.d.ts +297 -0
  64. package/dist/lib/internationalization/translatable.js +322 -0
  65. package/dist/lib/models/ReflectionCategory.d.ts +2 -2
  66. package/dist/lib/models/ReflectionGroup.d.ts +2 -2
  67. package/dist/lib/models/comments/comment.d.ts +17 -3
  68. package/dist/lib/models/comments/comment.js +377 -298
  69. package/dist/lib/models/reflections/ReflectionSymbolId.js +2 -2
  70. package/dist/lib/models/reflections/abstract.d.ts +11 -8
  71. package/dist/lib/models/reflections/abstract.js +17 -11
  72. package/dist/lib/models/reflections/container.d.ts +25 -3
  73. package/dist/lib/models/reflections/container.js +64 -0
  74. package/dist/lib/models/reflections/declaration.d.ts +3 -15
  75. package/dist/lib/models/reflections/declaration.js +16 -21
  76. package/dist/lib/models/reflections/document.d.ts +27 -0
  77. package/dist/lib/models/reflections/document.js +43 -0
  78. package/dist/lib/models/reflections/index.d.ts +4 -3
  79. package/dist/lib/models/reflections/index.js +5 -4
  80. package/dist/lib/models/reflections/kind.d.ts +13 -1
  81. package/dist/lib/models/reflections/kind.js +12 -0
  82. package/dist/lib/models/reflections/parameter.d.ts +1 -1
  83. package/dist/lib/models/reflections/project.d.ts +2 -2
  84. package/dist/lib/models/reflections/project.js +8 -7
  85. package/dist/lib/models/reflections/signature.d.ts +2 -2
  86. package/dist/lib/models/reflections/type-parameter.d.ts +1 -1
  87. package/dist/lib/models/reflections/utils.js +1 -2
  88. package/dist/lib/models/reflections/variant.d.ts +2 -0
  89. package/dist/lib/models/types.d.ts +4 -4
  90. package/dist/lib/models/types.js +3 -3
  91. package/dist/lib/output/events.d.ts +5 -5
  92. package/dist/lib/output/events.js +2 -1
  93. package/dist/lib/output/index.d.ts +1 -1
  94. package/dist/lib/output/index.js +2 -1
  95. package/dist/lib/output/plugins/AssetsPlugin.js +1 -1
  96. package/dist/lib/output/plugins/JavascriptIndexPlugin.d.ts +3 -1
  97. package/dist/lib/output/plugins/JavascriptIndexPlugin.js +28 -8
  98. package/dist/lib/output/plugins/SitemapPlugin.d.ts +1 -1
  99. package/dist/lib/output/plugins/SitemapPlugin.js +24 -13
  100. package/dist/lib/output/renderer.d.ts +1 -1
  101. package/dist/lib/output/renderer.js +5 -7
  102. package/dist/lib/output/themes/MarkedPlugin.d.ts +13 -24
  103. package/dist/lib/output/themes/MarkedPlugin.js +75 -160
  104. package/dist/lib/output/themes/default/DefaultTheme.d.ts +16 -4
  105. package/dist/lib/output/themes/default/DefaultTheme.js +62 -16
  106. package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +44 -44
  107. package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +10 -10
  108. package/dist/lib/output/themes/default/layouts/default.js +1 -1
  109. package/dist/lib/output/themes/default/partials/analytics.js +1 -2
  110. package/dist/lib/output/themes/default/partials/anchor-icon.js +2 -3
  111. package/dist/lib/output/themes/default/partials/comment.d.ts +1 -1
  112. package/dist/lib/output/themes/default/partials/comment.js +3 -4
  113. package/dist/lib/output/themes/default/partials/footer.d.ts +1 -1
  114. package/dist/lib/output/themes/default/partials/footer.js +19 -5
  115. package/dist/lib/output/themes/default/partials/header.d.ts +1 -1
  116. package/dist/lib/output/themes/default/partials/header.js +4 -3
  117. package/dist/lib/output/themes/default/partials/hierarchy.js +3 -4
  118. package/dist/lib/output/themes/default/partials/icon.js +7 -2
  119. package/dist/lib/output/themes/default/partials/index.js +4 -4
  120. package/dist/lib/output/themes/default/partials/member.d.ts +2 -2
  121. package/dist/lib/output/themes/default/partials/member.declaration.js +2 -3
  122. package/dist/lib/output/themes/default/partials/member.js +13 -2
  123. package/dist/lib/output/themes/default/partials/member.reference.d.ts +1 -1
  124. package/dist/lib/output/themes/default/partials/member.reference.js +9 -6
  125. package/dist/lib/output/themes/default/partials/member.signature.body.d.ts +1 -1
  126. package/dist/lib/output/themes/default/partials/member.signature.body.js +4 -4
  127. package/dist/lib/output/themes/default/partials/member.signature.title.d.ts +1 -1
  128. package/dist/lib/output/themes/default/partials/member.signature.title.js +1 -2
  129. package/dist/lib/output/themes/default/partials/member.sources.js +12 -6
  130. package/dist/lib/output/themes/default/partials/members.d.ts +1 -1
  131. package/dist/lib/output/themes/default/partials/members.group.js +1 -2
  132. package/dist/lib/output/themes/default/partials/members.js +1 -2
  133. package/dist/lib/output/themes/default/partials/navigation.d.ts +1 -1
  134. package/dist/lib/output/themes/default/partials/navigation.js +18 -15
  135. package/dist/lib/output/themes/default/partials/parameter.d.ts +1 -1
  136. package/dist/lib/output/themes/default/partials/parameter.js +15 -15
  137. package/dist/lib/output/themes/default/partials/reflectionPreview.js +1 -2
  138. package/dist/lib/output/themes/default/partials/toolbar.js +4 -4
  139. package/dist/lib/output/themes/default/partials/type.d.ts +1 -1
  140. package/dist/lib/output/themes/default/partials/type.js +14 -14
  141. package/dist/lib/output/themes/default/partials/typeAndParent.d.ts +1 -1
  142. package/dist/lib/output/themes/default/partials/typeParameters.js +2 -3
  143. package/dist/lib/output/themes/default/templates/document.d.ts +5 -0
  144. package/dist/lib/output/themes/default/templates/document.js +7 -0
  145. package/dist/lib/output/themes/default/templates/hierarchy.js +1 -2
  146. package/dist/lib/output/themes/default/templates/reflection.d.ts +1 -1
  147. package/dist/lib/output/themes/default/templates/reflection.js +21 -19
  148. package/dist/lib/output/themes/lib.d.ts +1 -1
  149. package/dist/lib/output/themes/lib.js +12 -16
  150. package/dist/lib/serialization/deserializer.d.ts +3 -3
  151. package/dist/lib/serialization/deserializer.js +7 -5
  152. package/dist/lib/serialization/schema.d.ts +10 -3
  153. package/dist/lib/utils/array.js +9 -10
  154. package/dist/lib/utils/component.d.ts +1 -1
  155. package/dist/lib/utils/component.js +2 -2
  156. package/dist/lib/utils/entry-point.d.ts +11 -0
  157. package/dist/lib/utils/entry-point.js +51 -24
  158. package/dist/lib/utils/enum.js +6 -7
  159. package/dist/lib/utils/fs.js +15 -16
  160. package/dist/lib/utils/general.d.ts +4 -3
  161. package/dist/lib/utils/general.js +4 -5
  162. package/dist/lib/utils/highlighter.d.ts +4 -2
  163. package/dist/lib/utils/highlighter.js +41 -40
  164. package/dist/lib/utils/html.js +2 -3
  165. package/dist/lib/utils/index.d.ts +1 -1
  166. package/dist/lib/utils/index.js +1 -2
  167. package/dist/lib/utils/jsx.elements.d.ts +12 -0
  168. package/dist/lib/utils/jsx.js +4 -4
  169. package/dist/lib/utils/loggers.d.ts +13 -7
  170. package/dist/lib/utils/loggers.js +13 -10
  171. package/dist/lib/utils/map.d.ts +1 -1
  172. package/dist/lib/utils/map.js +1 -1
  173. package/dist/lib/utils/options/declaration.d.ts +40 -21
  174. package/dist/lib/utils/options/declaration.js +36 -36
  175. package/dist/lib/utils/options/help.d.ts +2 -1
  176. package/dist/lib/utils/options/help.js +10 -10
  177. package/dist/lib/utils/options/index.d.ts +1 -1
  178. package/dist/lib/utils/options/index.js +1 -2
  179. package/dist/lib/utils/options/options.d.ts +5 -34
  180. package/dist/lib/utils/options/options.js +10 -23
  181. package/dist/lib/utils/options/readers/arguments.js +3 -5
  182. package/dist/lib/utils/options/readers/package-json.js +2 -2
  183. package/dist/lib/utils/options/readers/tsconfig.js +8 -12
  184. package/dist/lib/utils/options/readers/typedoc.js +7 -6
  185. package/dist/lib/utils/options/sources/typedoc.js +187 -178
  186. package/dist/lib/utils/options/tsdoc-defaults.d.ts +1 -1
  187. package/dist/lib/utils/options/tsdoc-defaults.js +2 -0
  188. package/dist/lib/utils/package-manifest.d.ts +1 -1
  189. package/dist/lib/utils/package-manifest.js +9 -11
  190. package/dist/lib/utils/paths.js +4 -5
  191. package/dist/lib/utils/perf.js +3 -4
  192. package/dist/lib/utils/plugins.js +4 -5
  193. package/dist/lib/utils/reflections.d.ts +1 -1
  194. package/dist/lib/utils/reflections.js +2 -3
  195. package/dist/lib/utils/sort.d.ts +3 -2
  196. package/dist/lib/utils/sort.js +37 -6
  197. package/dist/lib/utils/tsconfig.js +3 -4
  198. package/dist/lib/utils/tsutils.js +2 -3
  199. package/dist/lib/utils/validation.js +4 -4
  200. package/dist/lib/validation/documentation.d.ts +1 -1
  201. package/dist/lib/validation/documentation.js +9 -4
  202. package/dist/lib/validation/exports.js +3 -5
  203. package/dist/lib/validation/links.js +2 -3
  204. package/package.json +12 -11
  205. package/static/main.js +4 -4
  206. package/static/style.css +18 -10
  207. package/tsdoc.json +9 -0
@@ -32,7 +32,7 @@ import type * as M from "../models";
32
32
  * Describes the mapping from Model types to the corresponding JSON output type.
33
33
  */
34
34
  export type ModelToObject<T> = T extends Array<infer U> ? _ModelToObject<U>[] : _ModelToObject<T>;
35
- type _ModelToObject<T> = T extends Primitive ? T : Required<T> extends Required<M.ReflectionGroup> ? ReflectionGroup : Required<T> extends Required<M.ReflectionCategory> ? ReflectionCategory : T extends M.SignatureReflection ? SignatureReflection : T extends M.ParameterReflection ? ParameterReflection : T extends M.DeclarationReflection ? DeclarationReflection : T extends M.TypeParameterReflection ? TypeParameterReflection : T extends M.ProjectReflection ? ProjectReflection : T extends M.ContainerReflection ? ContainerReflection : T extends M.ReferenceReflection ? ReferenceReflection : T extends M.Reflection ? Reflection : T extends M.SomeType ? TypeKindMap[T["type"]] : T extends M.Type ? SomeType : T extends M.Comment ? Comment : T extends M.CommentTag ? CommentTag : T extends M.CommentDisplayPart ? CommentDisplayPart : T extends M.SourceReference ? SourceReference : never;
35
+ type _ModelToObject<T> = T extends Primitive ? T : Required<T> extends Required<M.ReflectionGroup> ? ReflectionGroup : Required<T> extends Required<M.ReflectionCategory> ? ReflectionCategory : T extends M.SignatureReflection ? SignatureReflection : T extends M.ParameterReflection ? ParameterReflection : T extends M.DeclarationReflection ? DeclarationReflection : T extends M.DocumentReflection ? DocumentReflection : T extends M.TypeParameterReflection ? TypeParameterReflection : T extends M.ProjectReflection ? ProjectReflection : T extends M.ContainerReflection ? ContainerReflection : T extends M.ReferenceReflection ? ReferenceReflection : T extends M.Reflection ? Reflection : T extends M.SomeType ? TypeKindMap[T["type"]] : T extends M.Type ? SomeType : T extends M.Comment ? Comment : T extends M.CommentTag ? CommentTag : T extends M.CommentDisplayPart ? CommentDisplayPart : T extends M.SourceReference ? SourceReference : never;
36
36
  type Primitive = string | number | undefined | null | boolean;
37
37
  type ToSerialized<T> = T extends Primitive ? T : T extends bigint ? {
38
38
  value: string;
@@ -62,6 +62,10 @@ export type SomeReflection = {
62
62
  [K in keyof M.ReflectionVariant]: ModelToObject<M.ReflectionVariant[K]>;
63
63
  }[keyof M.ReflectionVariant];
64
64
  /** @category Reflections */
65
+ export interface DocumentReflection extends Omit<Reflection, "variant">, S<M.DocumentReflection, "variant" | "content" | "relevanceBoost"> {
66
+ frontmatter: Record<string, unknown>;
67
+ }
68
+ /** @category Reflections */
65
69
  export interface ReferenceReflection extends Omit<DeclarationReflection, "variant">, S<M.ReferenceReflection, "variant"> {
66
70
  /**
67
71
  * -1 if the reference refers to a symbol that does not exist in the documentation.
@@ -78,7 +82,9 @@ export interface ParameterReflection extends Omit<Reflection, "variant">, S<M.Pa
78
82
  variant: "param";
79
83
  }
80
84
  /** @category Reflections */
81
- export interface DeclarationReflection extends Omit<ContainerReflection, "variant">, S<M.DeclarationReflection, "variant" | "packageVersion" | "sources" | "relevanceBoost" | "type" | "signatures" | "indexSignature" | "defaultValue" | "overwrites" | "inheritedFrom" | "implementationOf" | "extendedTypes" | "extendedBy" | "implementedTypes" | "implementedBy" | "getSignature" | "setSignature" | "typeParameters" | "readme"> {
85
+ export interface DeclarationReflection extends Omit<ContainerReflection, "variant">, S<M.DeclarationReflection, "variant" | "packageVersion" | "sources" | "relevanceBoost" | "type" | "signatures" | "indexSignatures" | "defaultValue" | "overwrites" | "inheritedFrom" | "implementationOf" | "extendedTypes" | "extendedBy" | "implementedTypes" | "implementedBy" | "getSignature" | "setSignature" | "typeParameters" | "readme"> {
86
+ /** @deprecated moved to {@link indexSignatures} with 0.26. */
87
+ indexSignature?: SignatureReflection;
82
88
  }
83
89
  /** @category Reflections */
84
90
  export interface TypeParameterReflection extends Omit<Reflection, "variant">, S<M.TypeParameterReflection, "variant" | "type" | "default" | "varianceModifier"> {
@@ -88,7 +94,8 @@ export interface ProjectReflection extends Omit<ContainerReflection, "variant">,
88
94
  symbolIdMap: Record<number, ReflectionSymbolId>;
89
95
  }
90
96
  /** @category Reflections */
91
- export interface ContainerReflection extends Reflection, S<M.ContainerReflection, "children" | "groups" | "categories"> {
97
+ export interface ContainerReflection extends Reflection, S<M.ContainerReflection, "children" | "documents" | "groups" | "categories"> {
98
+ childrenIncludingDocuments?: number[];
92
99
  }
93
100
  /** @category Reflections */
94
101
  export interface Reflection extends S<M.Reflection, "id" | "variant" | "name" | "kind" | "comment"> {
@@ -1,6 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.filterMap = exports.zip = exports.partition = exports.unique = exports.removeIf = exports.removeIfPresent = exports.binaryFindPartition = exports.insertOrderSorted = exports.insertPrioritySorted = void 0;
3
+ exports.insertPrioritySorted = insertPrioritySorted;
4
+ exports.insertOrderSorted = insertOrderSorted;
5
+ exports.binaryFindPartition = binaryFindPartition;
6
+ exports.removeIfPresent = removeIfPresent;
7
+ exports.removeIf = removeIf;
8
+ exports.unique = unique;
9
+ exports.partition = partition;
10
+ exports.zip = zip;
11
+ exports.filterMap = filterMap;
4
12
  /**
5
13
  * Inserts an item into an array sorted by priority. If two items have the same priority,
6
14
  * the item will be inserted later will be placed earlier in the array.
@@ -12,7 +20,6 @@ function insertPrioritySorted(arr, item) {
12
20
  arr.splice(index === -1 ? arr.length : index, 0, item);
13
21
  return arr;
14
22
  }
15
- exports.insertPrioritySorted = insertPrioritySorted;
16
23
  /**
17
24
  * Inserts an item into an array sorted by order. If two items have the same order,
18
25
  * the item inserted later will be placed later in the array.
@@ -25,7 +32,6 @@ function insertOrderSorted(arr, item) {
25
32
  arr.splice(index === -1 ? arr.length : index, 0, item);
26
33
  return arr;
27
34
  }
28
- exports.insertOrderSorted = insertOrderSorted;
29
35
  /**
30
36
  * Performs a binary search of a given array, returning the index of the first item
31
37
  * for which `partition` returns true. Returns the -1 if there are no items in `arr`
@@ -49,7 +55,6 @@ function binaryFindPartition(arr, partition) {
49
55
  }
50
56
  return partition(arr[low]) ? low : -1;
51
57
  }
52
- exports.binaryFindPartition = binaryFindPartition;
53
58
  /**
54
59
  * Removes an item from the array if the array exists and the item is included
55
60
  * within it.
@@ -65,7 +70,6 @@ function removeIfPresent(arr, item) {
65
70
  arr.splice(index, 1);
66
71
  }
67
72
  }
68
- exports.removeIfPresent = removeIfPresent;
69
73
  /**
70
74
  * Remove items in an array which match a predicate.
71
75
  * @param arr
@@ -79,7 +83,6 @@ function removeIf(arr, predicate) {
79
83
  }
80
84
  }
81
85
  }
82
- exports.removeIf = removeIf;
83
86
  /**
84
87
  * Filters out duplicate values from the given iterable.
85
88
  * @param arr
@@ -87,7 +90,6 @@ exports.removeIf = removeIf;
87
90
  function unique(arr) {
88
91
  return Array.from(new Set(arr));
89
92
  }
90
- exports.unique = unique;
91
93
  function partition(iter, predicate) {
92
94
  const left = [];
93
95
  const right = [];
@@ -101,7 +103,6 @@ function partition(iter, predicate) {
101
103
  }
102
104
  return [left, right];
103
105
  }
104
- exports.partition = partition;
105
106
  function* zip(...args) {
106
107
  const iterators = args.map((x) => x[Symbol.iterator]());
107
108
  while (true) {
@@ -112,7 +113,6 @@ function* zip(...args) {
112
113
  yield next.map((v) => v.value);
113
114
  }
114
115
  }
115
- exports.zip = zip;
116
116
  function filterMap(iter, fn) {
117
117
  const result = [];
118
118
  for (const item of iter) {
@@ -123,4 +123,3 @@ function filterMap(iter, fn) {
123
123
  }
124
124
  return result;
125
125
  }
126
- exports.filterMap = filterMap;
@@ -1,5 +1,5 @@
1
1
  import type { Application } from "../application";
2
- import { EventDispatcher, Event, EventMap } from "./events";
2
+ import { EventDispatcher, Event, type EventMap } from "./events";
3
3
  /**
4
4
  * Exposes a reference to the root Application component.
5
5
  */
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ChildableComponent = exports.AbstractComponent = exports.ComponentEvent = exports.Component = void 0;
3
+ exports.ChildableComponent = exports.AbstractComponent = exports.ComponentEvent = void 0;
4
+ exports.Component = Component;
4
5
  const events_1 = require("./events");
5
6
  const childMappings = [];
6
7
  /**
@@ -43,7 +44,6 @@ function Component(options) {
43
44
  }
44
45
  };
45
46
  }
46
- exports.Component = Component;
47
47
  class ComponentEvent extends events_1.Event {
48
48
  constructor(name, owner, component) {
49
49
  super(name);
@@ -34,7 +34,18 @@ export interface DocumentationEntryPoint {
34
34
  sourceFile: ts.SourceFile;
35
35
  version?: string;
36
36
  }
37
+ export interface DocumentEntryPoint {
38
+ displayName: string;
39
+ path: string;
40
+ }
37
41
  export declare function getEntryPoints(logger: Logger, options: Options): DocumentationEntryPoint[] | undefined;
42
+ /**
43
+ * Document entry points are markdown documents that the user has requested we include in the project with
44
+ * an option rather than a `@document` tag.
45
+ *
46
+ * @returns A list of `.md` files to include in the documentation as documents.
47
+ */
48
+ export declare function getDocumentEntryPoints(logger: Logger, options: Options): DocumentEntryPoint[];
38
49
  export declare function getWatchEntryPoints(logger: Logger, options: Options, program: ts.Program): DocumentationEntryPoint[] | undefined;
39
50
  export declare function getPackageDirectories(logger: Logger, options: Options, packageGlobPaths: string[]): string[];
40
51
  export declare function getExpandedEntryPointsForPaths(logger: Logger, inputFiles: string[], options: Options, programs?: ts.Program[]): DocumentationEntryPoint[];
@@ -26,7 +26,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.getExpandedEntryPointsForPaths = exports.getPackageDirectories = exports.getWatchEntryPoints = exports.getEntryPoints = exports.EntryPointStrategy = void 0;
29
+ exports.EntryPointStrategy = void 0;
30
+ exports.getEntryPoints = getEntryPoints;
31
+ exports.getDocumentEntryPoints = getDocumentEntryPoints;
32
+ exports.getWatchEntryPoints = getWatchEntryPoints;
33
+ exports.getPackageDirectories = getPackageDirectories;
34
+ exports.getExpandedEntryPointsForPaths = getExpandedEntryPointsForPaths;
30
35
  const path_1 = require("path");
31
36
  const typescript_1 = __importDefault(require("typescript"));
32
37
  const FS = __importStar(require("fs"));
@@ -61,7 +66,7 @@ exports.EntryPointStrategy = {
61
66
  };
62
67
  function getEntryPoints(logger, options) {
63
68
  if (!options.isSet("entryPoints")) {
64
- logger.warn("No entry points were provided, this is likely a misconfiguration.");
69
+ logger.warn(logger.i18n.no_entry_points_provided());
65
70
  return [];
66
71
  }
67
72
  const entryPoints = options.getValue("entryPoints");
@@ -88,12 +93,35 @@ function getEntryPoints(logger, options) {
88
93
  (0, general_1.assertNever)(strategy);
89
94
  }
90
95
  if (result && result.length === 0) {
91
- logger.error("Unable to find any entry points. See previous warnings.");
96
+ logger.error(logger.i18n.unable_to_find_any_entry_points());
92
97
  return;
93
98
  }
94
99
  return result;
95
100
  }
96
- exports.getEntryPoints = getEntryPoints;
101
+ /**
102
+ * Document entry points are markdown documents that the user has requested we include in the project with
103
+ * an option rather than a `@document` tag.
104
+ *
105
+ * @returns A list of `.md` files to include in the documentation as documents.
106
+ */
107
+ function getDocumentEntryPoints(logger, options) {
108
+ const docGlobs = options.getValue("projectDocuments");
109
+ if (docGlobs.length === 0) {
110
+ return [];
111
+ }
112
+ const docPaths = expandGlobs(docGlobs, [], logger);
113
+ // We might want to expand this in the future, there are quite a lot of extensions
114
+ // that have at some point or another been used for markdown: https://superuser.com/a/285878
115
+ const supportedFileRegex = /\.(md|markdown)$/;
116
+ const expanded = expandInputFiles(logger, docPaths, options, supportedFileRegex);
117
+ const baseDir = options.getValue("basePath") || (0, fs_1.deriveRootDir)(expanded);
118
+ return expanded.map((path) => {
119
+ return {
120
+ displayName: (0, path_1.relative)(baseDir, path).replace(/\.[^.]+$/, ""),
121
+ path,
122
+ };
123
+ });
124
+ }
97
125
  function getWatchEntryPoints(logger, options, program) {
98
126
  let result;
99
127
  const entryPoints = options.getValue("entryPoints");
@@ -107,21 +135,20 @@ function getWatchEntryPoints(logger, options, program) {
107
135
  result = getExpandedEntryPointsForPaths(logger, expandGlobs(entryPoints, exclude, logger), options, [program]);
108
136
  break;
109
137
  case exports.EntryPointStrategy.Packages:
110
- logger.error("Watch mode does not support 'packages' style entry points.");
138
+ logger.error(logger.i18n.watch_does_not_support_packages_mode());
111
139
  break;
112
140
  case exports.EntryPointStrategy.Merge:
113
- logger.error("Watch mode does not support 'merge' style entry points.");
141
+ logger.error(logger.i18n.watch_does_not_support_merge_mode());
114
142
  break;
115
143
  default:
116
144
  (0, general_1.assertNever)(strategy);
117
145
  }
118
146
  if (result && result.length === 0) {
119
- logger.error("Unable to find any entry points.");
147
+ logger.error(logger.i18n.unable_to_find_any_entry_points());
120
148
  return;
121
149
  }
122
150
  return result;
123
151
  }
124
- exports.getWatchEntryPoints = getWatchEntryPoints;
125
152
  function getPackageDirectories(logger, options, packageGlobPaths) {
126
153
  const exclude = (0, paths_1.createMinimatch)(options.getValue("exclude"));
127
154
  const rootDir = (0, fs_1.deriveRootDir)(packageGlobPaths);
@@ -129,7 +156,6 @@ function getPackageDirectories(logger, options, packageGlobPaths) {
129
156
  // This expands them to leave only leaf packages
130
157
  return (0, package_manifest_1.expandPackages)(logger, rootDir, packageGlobPaths, exclude);
131
158
  }
132
- exports.getPackageDirectories = getPackageDirectories;
133
159
  function getModuleName(fileName, baseDir) {
134
160
  return (0, paths_1.normalizePath)((0, path_1.relative)(baseDir, fileName)).replace(/(\/index)?(\.d)?\.([cm][tj]s|[tj]sx?)$/, "");
135
161
  }
@@ -140,6 +166,7 @@ function getModuleName(fileName, baseDir) {
140
166
  function getEntryPointsForPaths(logger, inputFiles, options, programs = getEntryPrograms(inputFiles, logger, options)) {
141
167
  const baseDir = options.getValue("basePath") || (0, fs_1.deriveRootDir)(inputFiles);
142
168
  const entryPoints = [];
169
+ let expandSuggestion = true;
143
170
  entryLoop: for (const fileOrDir of inputFiles.map(paths_1.normalizePath)) {
144
171
  const toCheck = [fileOrDir];
145
172
  if (!/\.([cm][tj]s|[tj]sx?)$/.test(fileOrDir)) {
@@ -158,17 +185,21 @@ function getEntryPointsForPaths(logger, inputFiles, options, programs = getEntry
158
185
  }
159
186
  }
160
187
  }
161
- const suggestion = (0, fs_1.isDir)(fileOrDir)
162
- ? " If you wanted to include files inside this directory, set --entryPointStrategy to expand or specify a glob."
163
- : "";
164
- logger.warn(`The entry point ${(0, paths_1.nicePath)(fileOrDir)} is not referenced by the 'files' or 'include' option in your tsconfig.${suggestion}`);
188
+ logger.warn(logger.i18n.entry_point_0_not_in_program((0, paths_1.nicePath)(fileOrDir)));
189
+ if (expandSuggestion && (0, fs_1.isDir)(fileOrDir)) {
190
+ expandSuggestion = false;
191
+ logger.info(logger.i18n.use_expand_or_glob_for_files_in_dir());
192
+ }
165
193
  }
166
194
  return entryPoints;
167
195
  }
168
196
  function getExpandedEntryPointsForPaths(logger, inputFiles, options, programs = getEntryPrograms(inputFiles, logger, options)) {
169
- return getEntryPointsForPaths(logger, expandInputFiles(logger, inputFiles, options), options, programs);
197
+ const compilerOptions = options.getCompilerOptions();
198
+ const supportedFileRegex = compilerOptions.allowJs || compilerOptions.checkJs
199
+ ? /\.([cm][tj]s|[tj]sx?)$/
200
+ : /\.([cm]ts|tsx?)$/;
201
+ return getEntryPointsForPaths(logger, expandInputFiles(logger, inputFiles, options, supportedFileRegex), options, programs);
170
202
  }
171
- exports.getExpandedEntryPointsForPaths = getExpandedEntryPointsForPaths;
172
203
  function expandGlobs(inputFiles, exclude, logger) {
173
204
  const excludePatterns = (0, paths_1.createMinimatch)(exclude);
174
205
  const base = (0, fs_1.deriveRootDir)(inputFiles);
@@ -179,10 +210,10 @@ function expandGlobs(inputFiles, exclude, logger) {
179
210
  });
180
211
  const filtered = result.filter((file) => file === entry || !(0, paths_1.matchesAny)(excludePatterns, file));
181
212
  if (result.length === 0) {
182
- logger.warn(`The entrypoint glob ${(0, paths_1.nicePath)(entry)} did not match any files.`);
213
+ logger.warn(logger.i18n.glob_0_did_not_match_any_files((0, paths_1.nicePath)(entry)));
183
214
  }
184
215
  else if (filtered.length === 0) {
185
- logger.warn(`The entrypoint glob ${(0, paths_1.nicePath)(entry)} did not match any files after applying exclude patterns.`);
216
+ logger.warn(logger.i18n.entry_point_0_did_not_match_any_files_after_exclude((0, paths_1.nicePath)(entry)));
186
217
  }
187
218
  else {
188
219
  logger.verbose(`Expanded ${(0, paths_1.nicePath)(entry)} to:\n\t${filtered
@@ -234,13 +265,9 @@ function getEntryPrograms(inputFiles, logger, options) {
234
265
  * @param inputFiles The list of files that should be expanded.
235
266
  * @returns The list of input files with expanded directories.
236
267
  */
237
- function expandInputFiles(logger, entryPoints, options) {
268
+ function expandInputFiles(logger, entryPoints, options, supportedFile) {
238
269
  const files = [];
239
270
  const exclude = (0, paths_1.createMinimatch)(options.getValue("exclude"));
240
- const compilerOptions = options.getCompilerOptions();
241
- const supportedFileRegex = compilerOptions.allowJs || compilerOptions.checkJs
242
- ? /\.([cm][tj]s|[tj]sx?)$/
243
- : /\.([cm]ts|tsx?)$/;
244
271
  function add(file, entryPoint) {
245
272
  let stats;
246
273
  try {
@@ -259,7 +286,7 @@ function expandInputFiles(logger, entryPoints, options) {
259
286
  add((0, path_1.join)(file, next), false);
260
287
  });
261
288
  }
262
- else if (supportedFileRegex.test(file)) {
289
+ else if (supportedFile.test(file)) {
263
290
  if (!entryPoint && (0, paths_1.matchesAny)(exclude, file)) {
264
291
  return;
265
292
  }
@@ -269,7 +296,7 @@ function expandInputFiles(logger, entryPoints, options) {
269
296
  entryPoints.forEach((file) => {
270
297
  const resolved = (0, path_1.resolve)(file);
271
298
  if (!FS.existsSync(resolved)) {
272
- logger.warn(`Provided entry point ${file} does not exist and will not be included in the docs.`);
299
+ logger.warn(logger.i18n.entry_point_0_did_not_exist(file));
273
300
  return;
274
301
  }
275
302
  add(resolved, true);
@@ -1,6 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getEnumKeys = exports.debugFlags = exports.hasAnyFlag = exports.hasAllFlags = exports.removeFlag = exports.getEnumFlags = void 0;
3
+ exports.getEnumFlags = getEnumFlags;
4
+ exports.removeFlag = removeFlag;
5
+ exports.hasAllFlags = hasAllFlags;
6
+ exports.hasAnyFlag = hasAnyFlag;
7
+ exports.debugFlags = debugFlags;
8
+ exports.getEnumKeys = getEnumKeys;
4
9
  function getEnumFlags(flags) {
5
10
  const result = [];
6
11
  for (let i = 1; i <= flags; i <<= 1) {
@@ -10,27 +15,21 @@ function getEnumFlags(flags) {
10
15
  }
11
16
  return result;
12
17
  }
13
- exports.getEnumFlags = getEnumFlags;
14
18
  // T & {} reduces inference priority
15
19
  function removeFlag(flag, remove) {
16
20
  return (flag & ~remove);
17
21
  }
18
- exports.removeFlag = removeFlag;
19
22
  function hasAllFlags(flags, check) {
20
23
  return (flags & check) === check;
21
24
  }
22
- exports.hasAllFlags = hasAllFlags;
23
25
  function hasAnyFlag(flags, check) {
24
26
  return (flags & check) !== 0;
25
27
  }
26
- exports.hasAnyFlag = hasAnyFlag;
27
28
  function debugFlags(Enum, flags) {
28
29
  return getEnumKeys(Enum).filter((key) => (Enum[key] & flags) === Enum[key]);
29
30
  }
30
- exports.debugFlags = debugFlags;
31
31
  // Note: String enums are not handled.
32
32
  function getEnumKeys(Enum) {
33
33
  const E = Enum;
34
34
  return Object.keys(E).filter((k) => E[E[k]] === k);
35
35
  }
36
- exports.getEnumKeys = getEnumKeys;
@@ -23,7 +23,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.findPackageForPath = exports.discoverPackageJson = exports.discoverInParentDirExactMatch = exports.discoverInParentDir = exports.hasTsExtension = exports.glob = exports.copySync = exports.copy = exports.writeFile = exports.writeFileSync = exports.readFile = exports.getCommonDirectory = exports.deriveRootDir = exports.isDir = exports.isFile = void 0;
26
+ exports.isFile = isFile;
27
+ exports.isDir = isDir;
28
+ exports.deriveRootDir = deriveRootDir;
29
+ exports.getCommonDirectory = getCommonDirectory;
30
+ exports.readFile = readFile;
31
+ exports.writeFileSync = writeFileSync;
32
+ exports.writeFile = writeFile;
33
+ exports.copy = copy;
34
+ exports.copySync = copySync;
35
+ exports.glob = glob;
36
+ exports.hasTsExtension = hasTsExtension;
37
+ exports.discoverInParentDir = discoverInParentDir;
38
+ exports.discoverInParentDirExactMatch = discoverInParentDirExactMatch;
39
+ exports.discoverPackageJson = discoverPackageJson;
40
+ exports.findPackageForPath = findPackageForPath;
27
41
  const fs = __importStar(require("fs"));
28
42
  const fs_1 = require("fs");
29
43
  const minimatch_1 = require("minimatch");
@@ -39,7 +53,6 @@ function isFile(file) {
39
53
  return false;
40
54
  }
41
55
  }
42
- exports.isFile = isFile;
43
56
  function isDir(path) {
44
57
  try {
45
58
  return fs.statSync(path).isDirectory();
@@ -48,7 +61,6 @@ function isDir(path) {
48
61
  return false;
49
62
  }
50
63
  }
51
- exports.isDir = isDir;
52
64
  function deriveRootDir(globPaths) {
53
65
  const normalized = globPaths.map(paths_1.normalizePath);
54
66
  const globs = (0, paths_1.createMinimatch)(normalized);
@@ -64,7 +76,6 @@ function deriveRootDir(globPaths) {
64
76
  }));
65
77
  return getCommonDirectory(rootPaths);
66
78
  }
67
- exports.deriveRootDir = deriveRootDir;
68
79
  /**
69
80
  * Get the longest directory path common to all files.
70
81
  */
@@ -83,7 +94,6 @@ function getCommonDirectory(files) {
83
94
  }
84
95
  return roots[0].slice(0, i).join("/");
85
96
  }
86
- exports.getCommonDirectory = getCommonDirectory;
87
97
  /**
88
98
  * Load the given file and return its contents.
89
99
  *
@@ -117,7 +127,6 @@ function readFile(file) {
117
127
  }
118
128
  return buffer.toString("utf8", 0);
119
129
  }
120
- exports.readFile = readFile;
121
130
  /**
122
131
  * Write a file to disc.
123
132
  *
@@ -130,7 +139,6 @@ function writeFileSync(fileName, data) {
130
139
  fs.mkdirSync((0, path_1.dirname)((0, paths_1.normalizePath)(fileName)), { recursive: true });
131
140
  fs.writeFileSync((0, paths_1.normalizePath)(fileName), data);
132
141
  }
133
- exports.writeFileSync = writeFileSync;
134
142
  /**
135
143
  * Write a file to disc.
136
144
  *
@@ -145,7 +153,6 @@ async function writeFile(fileName, data) {
145
153
  });
146
154
  await fs_1.promises.writeFile((0, paths_1.normalizePath)(fileName), data);
147
155
  }
148
- exports.writeFile = writeFile;
149
156
  /**
150
157
  * Copy a file or directory recursively.
151
158
  */
@@ -163,7 +170,6 @@ async function copy(src, dest) {
163
170
  // Do nothing for FIFO, special devices.
164
171
  }
165
172
  }
166
- exports.copy = copy;
167
173
  function copySync(src, dest) {
168
174
  const stat = fs.statSync(src);
169
175
  if (stat.isDirectory()) {
@@ -178,7 +184,6 @@ function copySync(src, dest) {
178
184
  // Do nothing for FIFO, special devices.
179
185
  }
180
186
  }
181
- exports.copySync = copySync;
182
187
  /**
183
188
  * Simpler version of `glob.sync` that only covers our use cases, always ignoring node_modules.
184
189
  */
@@ -269,11 +274,9 @@ function glob(pattern, root, options = {}) {
269
274
  }
270
275
  return result;
271
276
  }
272
- exports.glob = glob;
273
277
  function hasTsExtension(path) {
274
278
  return /\.[cm]?ts$|\.tsx$/.test(path);
275
279
  }
276
- exports.hasTsExtension = hasTsExtension;
277
280
  function discoverInParentDir(name, dir, read) {
278
281
  if (!isDir(dir))
279
282
  return;
@@ -295,7 +298,6 @@ function discoverInParentDir(name, dir, read) {
295
298
  dir = (0, path_1.resolve)((0, path_1.join)(dir, ".."));
296
299
  }
297
300
  }
298
- exports.discoverInParentDir = discoverInParentDir;
299
301
  function discoverInParentDirExactMatch(name, dir, read) {
300
302
  if (!isDir(dir))
301
303
  return;
@@ -313,7 +315,6 @@ function discoverInParentDirExactMatch(name, dir, read) {
313
315
  dir = (0, path_1.resolve)((0, path_1.join)(dir, ".."));
314
316
  }
315
317
  }
316
- exports.discoverInParentDirExactMatch = discoverInParentDirExactMatch;
317
318
  function discoverPackageJson(dir) {
318
319
  return discoverInParentDirExactMatch("package.json", dir, (content) => {
319
320
  const pkg = JSON.parse(content);
@@ -322,7 +323,6 @@ function discoverPackageJson(dir) {
322
323
  }
323
324
  });
324
325
  }
325
- exports.discoverPackageJson = discoverPackageJson;
326
326
  // dir -> package name according to package.json in this or some parent dir
327
327
  const packageCache = new Map();
328
328
  function findPackageForPath(sourcePath) {
@@ -337,4 +337,3 @@ function findPackageForPath(sourcePath) {
337
337
  return packageJson.content.name;
338
338
  }
339
339
  }
340
- exports.findPackageForPath = findPackageForPath;
@@ -6,7 +6,7 @@
6
6
  */
7
7
  type InternalOnly = false;
8
8
  /**
9
- * Helper type to convert `T` to `F` if strict mode is on.
9
+ * Helper type to convert `T` to `F` if compiling TypeDoc with stricter types.
10
10
  *
11
11
  * Can be used in overloads to map a parameter type to `never`. For example, the
12
12
  * following function will work with any string argument, but to improve the type safety
@@ -19,13 +19,14 @@ type InternalOnly = false;
19
19
  *
20
20
  * ```ts
21
21
  * function over(flag: 'a' | 'b'): string
22
- * function over(flag: IfStrict<string, never>): string
22
+ * // deprecated
23
+ * function over(flag: IfInternal<never, string>): string
23
24
  * function over(flag: string): string { return flag }
24
25
  * ```
25
26
  */
26
27
  export type IfInternal<T, F> = InternalOnly extends true ? T : F;
27
28
  /**
28
- * Helper type to convert `T` to `never` if strict mode is on.
29
+ * Helper type to convert `T` to `never` if compiling TypeDoc with stricter types.
29
30
  *
30
31
  * See {@link IfInternal} for the rationale.
31
32
  */
@@ -23,7 +23,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.getLoadedPaths = exports.hasBeenLoadedMultipleTimes = exports.NonEnumerable = exports.assertNever = void 0;
26
+ exports.assertNever = assertNever;
27
+ exports.NonEnumerable = NonEnumerable;
28
+ exports.hasBeenLoadedMultipleTimes = hasBeenLoadedMultipleTimes;
29
+ exports.getLoadedPaths = getLoadedPaths;
27
30
  const path_1 = require("path");
28
31
  const Util = __importStar(require("util"));
29
32
  /**
@@ -32,7 +35,6 @@ const Util = __importStar(require("util"));
32
35
  function assertNever(x) {
33
36
  throw new Error(`Expected handling to cover all possible cases, but it didn't cover: ${Util.inspect(x)}`);
34
37
  }
35
- exports.assertNever = assertNever;
36
38
  function NonEnumerable(_cls, context) {
37
39
  context.addInitializer(function () {
38
40
  Object.defineProperty(this, context.name, {
@@ -42,7 +44,6 @@ function NonEnumerable(_cls, context) {
42
44
  });
43
45
  });
44
46
  }
45
- exports.NonEnumerable = NonEnumerable;
46
47
  /**
47
48
  * This is a hack to make it possible to detect and warn about installation setups
48
49
  * which result in TypeDoc being installed multiple times. If TypeDoc has been loaded
@@ -58,8 +59,6 @@ g[pathSymbol].push((0, path_1.dirname)((0, path_1.dirname)((0, path_1.dirname)(_
58
59
  function hasBeenLoadedMultipleTimes() {
59
60
  return g[loadSymbol] !== 1;
60
61
  }
61
- exports.hasBeenLoadedMultipleTimes = hasBeenLoadedMultipleTimes;
62
62
  function getLoadedPaths() {
63
63
  return g[pathSymbol] || [];
64
64
  }
65
- exports.getLoadedPaths = getLoadedPaths;
@@ -1,6 +1,8 @@
1
- import { Theme } from "shiki";
2
- export declare function loadHighlighter(lightTheme: Theme, darkTheme: Theme): Promise<void>;
1
+ import type { BundledTheme } from "shiki" with { "resolution-mode": "import" };
2
+ export declare function loadShikiMetadata(): Promise<void>;
3
+ export declare function loadHighlighter(lightTheme: BundledTheme, darkTheme: BundledTheme): Promise<void>;
3
4
  export declare function isSupportedLanguage(lang: string): boolean;
4
5
  export declare function getSupportedLanguages(): string[];
6
+ export declare function getSupportedThemes(): string[];
5
7
  export declare function highlight(code: string, lang: string): string;
6
8
  export declare function getStyles(): string;