typedoc 0.25.0 → 0.25.1

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 (81) hide show
  1. package/dist/index.d.ts +2 -2
  2. package/dist/index.js +2 -1
  3. package/dist/lib/application.d.ts +3 -3
  4. package/dist/lib/application.js +440 -359
  5. package/dist/lib/cli.js +6 -3
  6. package/dist/lib/converter/comments/parser.js +5 -11
  7. package/dist/lib/converter/comments/tagName.d.ts +8 -0
  8. package/dist/lib/converter/comments/tagName.js +62 -0
  9. package/dist/lib/converter/context.js +1 -2
  10. package/dist/lib/converter/converter.d.ts +11 -11
  11. package/dist/lib/converter/converter.js +436 -311
  12. package/dist/lib/converter/factories/signature.js +3 -4
  13. package/dist/lib/converter/plugins/CategoryPlugin.d.ts +8 -8
  14. package/dist/lib/converter/plugins/CategoryPlugin.js +293 -200
  15. package/dist/lib/converter/plugins/CommentPlugin.d.ts +8 -5
  16. package/dist/lib/converter/plugins/CommentPlugin.js +433 -305
  17. package/dist/lib/converter/plugins/GroupPlugin.d.ts +3 -3
  18. package/dist/lib/converter/plugins/GroupPlugin.js +215 -145
  19. package/dist/lib/converter/plugins/ImplementsPlugin.js +239 -194
  20. package/dist/lib/converter/plugins/InheritDocPlugin.d.ts +1 -1
  21. package/dist/lib/converter/plugins/InheritDocPlugin.js +201 -138
  22. package/dist/lib/converter/plugins/LinkResolverPlugin.d.ts +1 -1
  23. package/dist/lib/converter/plugins/LinkResolverPlugin.js +110 -44
  24. package/dist/lib/converter/plugins/PackagePlugin.d.ts +6 -4
  25. package/dist/lib/converter/plugins/PackagePlugin.js +191 -96
  26. package/dist/lib/converter/plugins/SourcePlugin.d.ts +6 -6
  27. package/dist/lib/converter/plugins/SourcePlugin.js +234 -146
  28. package/dist/lib/converter/plugins/TypePlugin.js +147 -102
  29. package/dist/lib/converter/symbols.js +1 -1
  30. package/dist/lib/converter/types.js +10 -0
  31. package/dist/lib/converter/utils/repository.js +2 -2
  32. package/dist/lib/models/reflections/ReflectionSymbolId.js +1 -1
  33. package/dist/lib/models/reflections/abstract.d.ts +4 -0
  34. package/dist/lib/models/reflections/abstract.js +14 -2
  35. package/dist/lib/models/reflections/index.d.ts +1 -1
  36. package/dist/lib/output/components.d.ts +1 -0
  37. package/dist/lib/output/components.js +9 -1
  38. package/dist/lib/output/index.d.ts +1 -1
  39. package/dist/lib/output/plugins/AssetsPlugin.d.ts +1 -1
  40. package/dist/lib/output/plugins/AssetsPlugin.js +111 -44
  41. package/dist/lib/output/plugins/JavascriptIndexPlugin.d.ts +2 -1
  42. package/dist/lib/output/plugins/JavascriptIndexPlugin.js +173 -99
  43. package/dist/lib/output/plugins/NavigationPlugin.d.ts +6 -0
  44. package/dist/lib/output/plugins/NavigationPlugin.js +109 -0
  45. package/dist/lib/output/plugins/index.d.ts +2 -1
  46. package/dist/lib/output/plugins/index.js +5 -3
  47. package/dist/lib/output/renderer.d.ts +10 -8
  48. package/dist/lib/output/renderer.js +315 -202
  49. package/dist/lib/output/theme.js +63 -18
  50. package/dist/lib/output/themes/MarkedPlugin.d.ts +4 -4
  51. package/dist/lib/output/themes/MarkedPlugin.js +223 -145
  52. package/dist/lib/output/themes/default/DefaultTheme.d.ts +14 -1
  53. package/dist/lib/output/themes/default/DefaultTheme.js +68 -0
  54. package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +42 -36
  55. package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +15 -1
  56. package/dist/lib/output/themes/default/layouts/default.js +2 -0
  57. package/dist/lib/output/themes/default/partials/header.js +1 -1
  58. package/dist/lib/output/themes/default/partials/icon.d.ts +4 -1
  59. package/dist/lib/output/themes/default/partials/icon.js +40 -35
  60. package/dist/lib/output/themes/default/partials/member.signature.body.js +1 -1
  61. package/dist/lib/output/themes/default/partials/navigation.js +34 -67
  62. package/dist/lib/utils/component.d.ts +1 -1
  63. package/dist/lib/utils/component.js +3 -1
  64. package/dist/lib/utils/entry-point.js +27 -14
  65. package/dist/lib/utils/events.js +1 -1
  66. package/dist/lib/utils/general.js +1 -1
  67. package/dist/lib/utils/index.d.ts +1 -1
  68. package/dist/lib/utils/index.js +2 -1
  69. package/dist/lib/utils/jsx.js +1 -1
  70. package/dist/lib/utils/options/declaration.d.ts +2 -0
  71. package/dist/lib/utils/options/index.d.ts +1 -1
  72. package/dist/lib/utils/options/index.js +2 -1
  73. package/dist/lib/utils/options/options.d.ts +19 -0
  74. package/dist/lib/utils/options/options.js +22 -2
  75. package/dist/lib/utils/options/readers/tsconfig.js +2 -7
  76. package/dist/lib/utils/options/sources/typedoc.js +11 -0
  77. package/dist/lib/utils/perf.d.ts +1 -1
  78. package/dist/lib/utils/perf.js +10 -20
  79. package/package.json +1 -1
  80. package/static/main.js +4 -3
  81. package/static/style.css +7 -3
package/dist/lib/cli.js CHANGED
@@ -31,6 +31,7 @@ const ExitCodes = {
31
31
  ValidationError: 4,
32
32
  OutputError: 5,
33
33
  ExceptionThrown: 6,
34
+ Watching: 7,
34
35
  };
35
36
  const td = __importStar(require("typedoc"));
36
37
  void main();
@@ -46,8 +47,10 @@ async function main() {
46
47
  new td.ArgumentsReader(300),
47
48
  ]);
48
49
  const exitCode = await run(app);
49
- app.logger.verbose(`Full run took ${Date.now() - start}ms`);
50
- process.exit(exitCode);
50
+ if (exitCode !== ExitCodes.Watching) {
51
+ app.logger.verbose(`Full run took ${Date.now() - start}ms`);
52
+ process.exit(exitCode);
53
+ }
51
54
  }
52
55
  catch (error) {
53
56
  console.error("TypeDoc exiting with unexpected error:");
@@ -88,7 +91,7 @@ async function run(app) {
88
91
  await app.generateJson(project, json);
89
92
  }
90
93
  });
91
- return ExitCodes.Ok;
94
+ return ExitCodes.Watching;
92
95
  }
93
96
  const project = await app.convert();
94
97
  if (!project) {
@@ -6,6 +6,7 @@ const models_1 = require("../../models");
6
6
  const utils_1 = require("../../utils");
7
7
  const paths_1 = require("../../utils/paths");
8
8
  const lexer_1 = require("./lexer");
9
+ const tagName_1 = require("./tagName");
9
10
  function makeLookaheadGenerator(gen) {
10
11
  let trackHistory = false;
11
12
  const history = [];
@@ -78,17 +79,10 @@ function postProcessComment(comment, warning) {
78
79
  if (HAS_USER_IDENTIFIER.includes(tag.tag) && tag.content.length) {
79
80
  const first = tag.content[0];
80
81
  if (first.kind === "text") {
81
- let end = first.text.search(/\s/);
82
- if (end === -1)
83
- end = first.text.length;
84
- tag.name = first.text.substring(0, end);
85
- if (tag.name.startsWith("[") && tag.name.endsWith("]")) {
86
- tag.name = tag.name.slice(1, tag.name.indexOf("="));
87
- }
88
- first.text = first.text.substring(end);
89
- const endOfTrivia = first.text.search(/[^\-\s]/);
90
- if (endOfTrivia !== -1) {
91
- first.text = first.text.substring(endOfTrivia);
82
+ const { name, newText } = (0, tagName_1.extractTagName)(first.text);
83
+ tag.name = name;
84
+ if (newText) {
85
+ first.text = newText;
92
86
  }
93
87
  else {
94
88
  // Remove this token, no real text in it.
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Determines the name of the parameter/template/property from the tag content
3
+ * when processing `@param x`
4
+ */
5
+ export declare function extractTagName(text: string): {
6
+ name: string;
7
+ newText: string;
8
+ };
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extractTagName = void 0;
4
+ /**
5
+ * Determines the name of the parameter/template/property from the tag content
6
+ * when processing `@param x`
7
+ */
8
+ function extractTagName(text) {
9
+ let pos = skipWs(text, 0);
10
+ // Extract the "name" part of the comment, this might also include a default
11
+ // value if bracketed.
12
+ let nameStart = pos;
13
+ let bracketDepth = 0;
14
+ let stringChar = "";
15
+ while (pos < text.length && (bracketDepth > 0 || /\S/.test(text[pos]))) {
16
+ if (stringChar) {
17
+ if (text[pos] == stringChar) {
18
+ stringChar = "";
19
+ ++pos;
20
+ }
21
+ else if (text[pos] == "\\") {
22
+ pos += 2;
23
+ }
24
+ else {
25
+ ++pos;
26
+ }
27
+ }
28
+ else {
29
+ if ("\"'`".includes(text[pos])) {
30
+ stringChar = text[pos];
31
+ }
32
+ else if (text[pos] == "[") {
33
+ ++bracketDepth;
34
+ }
35
+ else if (text[pos] == "]") {
36
+ --bracketDepth;
37
+ }
38
+ ++pos;
39
+ }
40
+ }
41
+ let nameEnd = pos;
42
+ if (text[nameStart] === "[") {
43
+ nameStart = skipWs(text, nameStart + 1);
44
+ nameEnd = skipWith(text, nameStart, /[^\s=\]]/);
45
+ }
46
+ // Skip any whitespace & an optional dash before the description
47
+ pos = skipWith(text, pos, /[\s-]/);
48
+ return {
49
+ name: text.substring(nameStart, nameEnd),
50
+ newText: text.substring(pos),
51
+ };
52
+ }
53
+ exports.extractTagName = extractTagName;
54
+ function skipWs(text, pos) {
55
+ return skipWith(text, pos, /\s/);
56
+ }
57
+ function skipWith(text, pos, reg) {
58
+ while (pos < text.length && reg.test(text[pos])) {
59
+ ++pos;
60
+ }
61
+ return pos;
62
+ }
@@ -138,9 +138,8 @@ class Context {
138
138
  this.converter.trigger(converter_events_1.ConverterEvents.CREATE_DECLARATION, this, reflection);
139
139
  }
140
140
  addChild(reflection) {
141
- var _a;
142
141
  if (this.scope instanceof index_1.ContainerReflection) {
143
- (_a = this.scope).children ?? (_a.children = []);
142
+ this.scope.children ??= [];
144
143
  this.scope.children.push(reflection);
145
144
  }
146
145
  }
@@ -15,29 +15,29 @@ import type { DeclarationReference } from "./comments/declarationReference";
15
15
  */
16
16
  export declare class Converter extends ChildableComponent<Application, ConverterComponent> {
17
17
  /** @internal */
18
- externalPattern: string[];
18
+ accessor externalPattern: string[];
19
19
  private externalPatternCache?;
20
20
  private excludeCache?;
21
21
  /** @internal */
22
- excludeExternals: boolean;
22
+ accessor excludeExternals: boolean;
23
23
  /** @internal */
24
- excludeNotDocumented: boolean;
24
+ accessor excludeNotDocumented: boolean;
25
25
  /** @internal */
26
- excludePrivate: boolean;
26
+ accessor excludePrivate: boolean;
27
27
  /** @internal */
28
- excludeProtected: boolean;
28
+ accessor excludeProtected: boolean;
29
29
  /** @internal */
30
- excludeReferences: boolean;
30
+ accessor excludeReferences: boolean;
31
31
  /** @internal */
32
- commentStyle: CommentStyle;
32
+ accessor commentStyle: CommentStyle;
33
33
  /** @internal */
34
- validation: ValidationOptions;
34
+ accessor validation: ValidationOptions;
35
35
  /** @internal */
36
- externalSymbolLinkMappings: Record<string, Record<string, string>>;
36
+ accessor externalSymbolLinkMappings: Record<string, Record<string, string>>;
37
37
  /** @internal */
38
- useTsLinkResolution: boolean;
38
+ accessor useTsLinkResolution: boolean;
39
39
  /** @internal */
40
- preserveLinkText: boolean;
40
+ accessor preserveLinkText: boolean;
41
41
  private _config?;
42
42
  private _externalSymbolResolvers;
43
43
  get config(): CommentParserConfig;