typedoc 0.22.2 → 0.22.6

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 (71) hide show
  1. package/bin/typedoc +23 -20
  2. package/dist/index.d.ts +2 -2
  3. package/dist/index.js +2 -1
  4. package/dist/lib/application.js +25 -11
  5. package/dist/lib/converter/context.d.ts +1 -1
  6. package/dist/lib/converter/convert-expression.js +14 -0
  7. package/dist/lib/converter/factories/comment.js +3 -0
  8. package/dist/lib/converter/plugins/CategoryPlugin.d.ts +2 -2
  9. package/dist/lib/converter/plugins/CommentPlugin.js +86 -25
  10. package/dist/lib/converter/plugins/GitHubPlugin.d.ts +14 -8
  11. package/dist/lib/converter/plugins/GitHubPlugin.js +45 -22
  12. package/dist/lib/converter/plugins/GroupPlugin.d.ts +2 -2
  13. package/dist/lib/converter/plugins/SourcePlugin.js +0 -1
  14. package/dist/lib/converter/plugins/index.d.ts +0 -1
  15. package/dist/lib/converter/plugins/index.js +1 -3
  16. package/dist/lib/converter/symbols.js +20 -22
  17. package/dist/lib/models/ReflectionCategory.d.ts +3 -10
  18. package/dist/lib/models/ReflectionCategory.js +2 -7
  19. package/dist/lib/models/ReflectionGroup.d.ts +4 -10
  20. package/dist/lib/models/ReflectionGroup.js +1 -8
  21. package/dist/lib/models/comments/comment.d.ts +1 -1
  22. package/dist/lib/models/comments/comment.js +1 -1
  23. package/dist/lib/models/sources/directory.d.ts +2 -2
  24. package/dist/lib/models/sources/directory.js +2 -6
  25. package/dist/lib/models/sources/file.d.ts +8 -3
  26. package/dist/lib/models/sources/index.d.ts +1 -0
  27. package/dist/lib/models/sources/index.js +3 -1
  28. package/dist/lib/models/sources/repository.d.ts +4 -0
  29. package/dist/lib/models/sources/repository.js +8 -0
  30. package/dist/lib/output/index.d.ts +1 -1
  31. package/dist/lib/output/index.js +2 -1
  32. package/dist/lib/output/plugins/MarkedLinksPlugin.d.ts +2 -0
  33. package/dist/lib/output/plugins/MarkedLinksPlugin.js +8 -1
  34. package/dist/lib/output/plugins/index.d.ts +1 -1
  35. package/dist/lib/output/renderer.d.ts +2 -0
  36. package/dist/lib/output/renderer.js +19 -1
  37. package/dist/lib/output/themes/MarkedPlugin.d.ts +1 -0
  38. package/dist/lib/output/themes/MarkedPlugin.js +6 -9
  39. package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +25 -25
  40. package/dist/lib/output/themes/default/layouts/default.js +2 -1
  41. package/dist/lib/output/themes/default/partials/member.js +2 -2
  42. package/dist/lib/output/themes/default/partials/members.group.js +2 -3
  43. package/dist/lib/output/themes/default/partials/members.js +1 -2
  44. package/dist/lib/output/themes/lib.d.ts +1 -2
  45. package/dist/lib/output/themes/lib.js +1 -7
  46. package/dist/lib/utils/entry-point.d.ts +1 -0
  47. package/dist/lib/utils/entry-point.js +24 -1
  48. package/dist/lib/utils/general.d.ts +0 -22
  49. package/dist/lib/utils/highlighter.js +8 -10
  50. package/dist/lib/utils/index.d.ts +1 -1
  51. package/dist/lib/utils/jsx.d.ts +8 -35
  52. package/dist/lib/utils/jsx.elements.d.ts +819 -0
  53. package/dist/lib/utils/jsx.elements.js +4 -0
  54. package/dist/lib/utils/jsx.js +7 -6
  55. package/dist/lib/utils/options/declaration.d.ts +43 -8
  56. package/dist/lib/utils/options/declaration.js +39 -1
  57. package/dist/lib/utils/options/index.d.ts +2 -2
  58. package/dist/lib/utils/options/index.js +2 -1
  59. package/dist/lib/utils/options/options.d.ts +4 -99
  60. package/dist/lib/utils/options/options.js +22 -15
  61. package/dist/lib/utils/options/readers/arguments.js +22 -3
  62. package/dist/lib/utils/options/readers/tsconfig.d.ts +5 -0
  63. package/dist/lib/utils/options/readers/tsconfig.js +19 -7
  64. package/dist/lib/utils/options/sources/typedoc.js +50 -26
  65. package/dist/lib/validation/exports.d.ts +1 -1
  66. package/dist/lib/validation/exports.js +53 -20
  67. package/package.json +20 -15
  68. package/static/main.js +1 -1
  69. package/static/style.css +51 -8
  70. package/dist/lib/converter/plugins/DeepCommentPlugin.d.ts +0 -16
  71. package/dist/lib/converter/plugins/DeepCommentPlugin.js +0 -84
@@ -169,8 +169,11 @@ function convertTypeAlias(context, symbol, exportSymbol) {
169
169
  if (ts.isTypeAliasDeclaration(declaration)) {
170
170
  const reflection = context.createDeclarationReflection(models_1.ReflectionKind.TypeAlias, symbol, exportSymbol);
171
171
  reflection.type = context.converter.convertType(context.withScope(reflection), declaration.type);
172
- reflection.typeParameters = (_b = declaration.typeParameters) === null || _b === void 0 ? void 0 : _b.map((param) => createTypeParamReflection(param, context.withScope(reflection)));
173
172
  context.finalizeDeclarationReflection(reflection, symbol, exportSymbol);
173
+ // Do this after finalization so that the CommentPlugin can get @typeParam tags
174
+ // from the parent comment. Ugly, but works for now. Should be cleaned up with TSDoc
175
+ // support.
176
+ reflection.typeParameters = (_b = declaration.typeParameters) === null || _b === void 0 ? void 0 : _b.map((param) => createTypeParamReflection(param, context.withScope(reflection)));
174
177
  }
175
178
  else if (ts.isJSDocTypedefTag(declaration) ||
176
179
  ts.isJSDocEnumTag(declaration)) {
@@ -320,7 +323,8 @@ function convertProperty(context, symbol, exportSymbol) {
320
323
  }
321
324
  // Special case: We pretend properties are methods if they look like methods.
322
325
  // This happens with mixins / weird inheritance.
323
- if (declarations.every((decl) => ts.isMethodSignature(decl) || ts.isMethodDeclaration(decl))) {
326
+ if (declarations.length &&
327
+ declarations.every((decl) => ts.isMethodSignature(decl) || ts.isMethodDeclaration(decl))) {
324
328
  return convertFunctionOrMethod(context, symbol, exportSymbol);
325
329
  }
326
330
  if (declarations.length === 1) {
@@ -432,7 +436,7 @@ function convertVariable(context, symbol, exportSymbol) {
432
436
  const declaration = (_a = symbol.getDeclarations()) === null || _a === void 0 ? void 0 : _a[0];
433
437
  assert(declaration);
434
438
  const type = context.checker.getTypeOfSymbolAtLocation(symbol, declaration);
435
- if (isEnumLiteral(declaration) &&
439
+ if (isEnumLike(context.checker, type, declaration) &&
436
440
  symbol.getJsDocTags().some((tag) => tag.name === "enum")) {
437
441
  return convertVariableAsEnum(context, symbol, exportSymbol);
438
442
  }
@@ -450,33 +454,27 @@ function convertVariable(context, symbol, exportSymbol) {
450
454
  reflection.defaultValue = (0, convert_expression_1.convertDefaultValue)(declaration);
451
455
  context.finalizeDeclarationReflection(reflection, symbol, exportSymbol);
452
456
  }
453
- function isEnumLiteral(declaration) {
454
- if (!(0, enum_1.hasAllFlags)(declaration.parent.flags, ts.NodeFlags.Const) ||
455
- !declaration.initializer ||
456
- !ts.isAsExpression(declaration.initializer) ||
457
- declaration.initializer.type.getText() !== "const") {
458
- // Not an as-const expression
457
+ function isEnumLike(checker, type, location) {
458
+ if (!(0, enum_1.hasAllFlags)(type.flags, ts.TypeFlags.Object)) {
459
459
  return false;
460
460
  }
461
- const body = declaration.initializer.expression;
462
- if (!ts.isObjectLiteralExpression(body)) {
463
- return false;
464
- }
465
- return body.properties.every((prop) => ts.isPropertyAssignment(prop) &&
466
- ts.isStringLiteral(prop.initializer));
461
+ return type.getProperties().every((prop) => {
462
+ const propType = checker.getTypeOfSymbolAtLocation(prop, location);
463
+ return propType.isStringLiteral();
464
+ });
467
465
  }
468
466
  function convertVariableAsEnum(context, symbol, exportSymbol) {
469
467
  const reflection = context.createDeclarationReflection(models_1.ReflectionKind.Enum, symbol, exportSymbol);
470
468
  context.finalizeDeclarationReflection(reflection, symbol, exportSymbol);
471
469
  const rc = context.withScope(reflection);
472
470
  const declaration = symbol.declarations[0];
473
- const init = declaration.initializer
474
- .expression;
475
- for (const prop of init.properties) {
476
- const childSymbol = context.checker.getSymbolAtLocation(prop.name);
477
- const reflection = rc.createDeclarationReflection(models_1.ReflectionKind.EnumMember, childSymbol, void 0);
478
- reflection.defaultValue = prop.initializer.text;
479
- rc.finalizeDeclarationReflection(reflection, childSymbol, void 0);
471
+ const type = context.checker.getTypeAtLocation(declaration);
472
+ for (const prop of type.getProperties()) {
473
+ const reflection = rc.createDeclarationReflection(models_1.ReflectionKind.EnumMember, prop, void 0);
474
+ const propType = context.checker.getTypeOfSymbolAtLocation(prop, declaration);
475
+ assert(propType.isStringLiteral());
476
+ reflection.defaultValue = JSON.stringify(propType.value);
477
+ rc.finalizeDeclarationReflection(reflection, prop, void 0);
480
478
  }
481
479
  // Skip converting the type alias, if there is one
482
480
  return ts.SymbolFlags.TypeAlias;
@@ -1,4 +1,4 @@
1
- import type { Reflection } from "./reflections/abstract";
1
+ import type { DeclarationReflection } from ".";
2
2
  /**
3
3
  * A category of reflections.
4
4
  *
@@ -14,14 +14,7 @@ export declare class ReflectionCategory {
14
14
  /**
15
15
  * All reflections of this category.
16
16
  */
17
- children: Reflection[];
18
- /**
19
- * Do all children of this category have a separate document?
20
- *
21
- * A bound representation of the ´ReflectionCategory.getAllChildrenHaveOwnDocument´
22
- * that can be used within templates.
23
- */
24
- allChildrenHaveOwnDocument: Function;
17
+ children: DeclarationReflection[];
25
18
  /**
26
19
  * Create a new ReflectionCategory instance.
27
20
  *
@@ -31,5 +24,5 @@ export declare class ReflectionCategory {
31
24
  /**
32
25
  * Do all children of this category have a separate document?
33
26
  */
34
- private getAllChildrenHaveOwnDocument;
27
+ allChildrenHaveOwnDocument(): boolean;
35
28
  }
@@ -20,17 +20,12 @@ class ReflectionCategory {
20
20
  */
21
21
  this.children = [];
22
22
  this.title = title;
23
- this.allChildrenHaveOwnDocument = () => this.getAllChildrenHaveOwnDocument();
24
23
  }
25
24
  /**
26
25
  * Do all children of this category have a separate document?
27
26
  */
28
- getAllChildrenHaveOwnDocument() {
29
- let onlyOwnDocuments = true;
30
- this.children.forEach((child) => {
31
- onlyOwnDocuments = onlyOwnDocuments && !!child.hasOwnDocument;
32
- });
33
- return onlyOwnDocuments;
27
+ allChildrenHaveOwnDocument() {
28
+ return this.children.every((child) => child.hasOwnDocument);
34
29
  }
35
30
  }
36
31
  exports.ReflectionCategory = ReflectionCategory;
@@ -1,5 +1,6 @@
1
- import type { Reflection, ReflectionKind } from "./reflections/abstract";
1
+ import type { ReflectionKind } from "./reflections/abstract";
2
2
  import type { ReflectionCategory } from "./ReflectionCategory";
3
+ import type { DeclarationReflection } from ".";
3
4
  /**
4
5
  * A group of reflections. All reflections in a group are of the same kind.
5
6
  *
@@ -19,19 +20,12 @@ export declare class ReflectionGroup {
19
20
  /**
20
21
  * All reflections of this group.
21
22
  */
22
- children: Reflection[];
23
+ children: DeclarationReflection[];
23
24
  /**
24
25
  * A list of generated css classes that should be applied to representations of this
25
26
  * group in the generated markup.
26
27
  */
27
28
  cssClasses?: string;
28
- /**
29
- * Do all children of this group have a separate document?
30
- *
31
- * A bound representation of the ´ReflectionGroup.getAllChildrenHaveOwnDocument´
32
- * that can be used within templates.
33
- */
34
- allChildrenHaveOwnDocument: () => boolean;
35
29
  /**
36
30
  * Are all children inherited members?
37
31
  */
@@ -62,5 +56,5 @@ export declare class ReflectionGroup {
62
56
  /**
63
57
  * Do all children of this group have a separate document?
64
58
  */
65
- private getAllChildrenHaveOwnDocument;
59
+ allChildrenHaveOwnDocument(): boolean;
66
60
  }
@@ -20,20 +20,13 @@ class ReflectionGroup {
20
20
  * All reflections of this group.
21
21
  */
22
22
  this.children = [];
23
- /**
24
- * Do all children of this group have a separate document?
25
- *
26
- * A bound representation of the ´ReflectionGroup.getAllChildrenHaveOwnDocument´
27
- * that can be used within templates.
28
- */
29
- this.allChildrenHaveOwnDocument = () => this.getAllChildrenHaveOwnDocument();
30
23
  this.title = title;
31
24
  this.kind = kind;
32
25
  }
33
26
  /**
34
27
  * Do all children of this group have a separate document?
35
28
  */
36
- getAllChildrenHaveOwnDocument() {
29
+ allChildrenHaveOwnDocument() {
37
30
  return this.children.every((child) => child.hasOwnDocument);
38
31
  }
39
32
  }
@@ -51,7 +51,7 @@ export declare class Comment {
51
51
  */
52
52
  getTag(tagName: string, paramName?: string): CommentTag | undefined;
53
53
  /**
54
- * Removes all tags with the given tag name from teh comment.
54
+ * Removes all tags with the given tag name from the comment.
55
55
  * @param tagName
56
56
  */
57
57
  removeTags(tagName: string): void;
@@ -55,7 +55,7 @@ class Comment {
55
55
  });
56
56
  }
57
57
  /**
58
- * Removes all tags with the given tag name from teh comment.
58
+ * Removes all tags with the given tag name from the comment.
59
59
  * @param tagName
60
60
  */
61
61
  removeTags(tagName) {
@@ -1,6 +1,6 @@
1
- import type { Reflection } from "../reflections/abstract";
2
1
  import type { ReflectionGroup } from "../ReflectionGroup";
3
2
  import type { SourceFile } from "./file";
3
+ import type { DeclarationReflection } from "..";
4
4
  /**
5
5
  * Exposes information about a directory containing source files.
6
6
  *
@@ -56,5 +56,5 @@ export declare class SourceDirectory {
56
56
  * @returns An aggregated list of all {@link DeclarationReflection} defined in the
57
57
  * files of this directory.
58
58
  */
59
- getAllReflections(): Reflection[];
59
+ getAllReflections(): DeclarationReflection[];
60
60
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SourceDirectory = void 0;
4
+ const array_1 = require("../../utils/array");
4
5
  /**
5
6
  * Exposes information about a directory containing source files.
6
7
  *
@@ -53,12 +54,7 @@ class SourceDirectory {
53
54
  * files of this directory.
54
55
  */
55
56
  getAllReflections() {
56
- const reflections = [];
57
- this.files.forEach((file) => {
58
- reflections.push(...file.reflections);
59
- });
60
- // reflections.sort(Factories.GroupHandler.sortCallback);
61
- return reflections;
57
+ return (0, array_1.flatMap)(this.files, (file) => file.reflections);
62
58
  }
63
59
  }
64
60
  exports.SourceDirectory = SourceDirectory;
@@ -1,6 +1,7 @@
1
- import type { Reflection } from "../reflections/abstract";
2
1
  import type { ReflectionGroup } from "../ReflectionGroup";
3
2
  import type { SourceDirectory } from "./directory";
3
+ import type { RepositoryType } from "./repository";
4
+ import type { DeclarationReflection } from "..";
4
5
  /**
5
6
  * Represents references of reflections to their defining source files.
6
7
  *
@@ -50,9 +51,13 @@ export declare class SourceFile {
50
51
  */
51
52
  name: string;
52
53
  /**
53
- * A url pointing to a page displaying the contents of this file.
54
+ * A URL pointing to a page displaying the contents of this file.
54
55
  */
55
56
  url?: string;
57
+ /**
58
+ * The type of repository where this file is hosted.
59
+ */
60
+ repositoryType?: RepositoryType;
56
61
  /**
57
62
  * The representation of the parent directory of this source file.
58
63
  */
@@ -60,7 +65,7 @@ export declare class SourceFile {
60
65
  /**
61
66
  * A list of all reflections that are declared in this file.
62
67
  */
63
- reflections: Reflection[];
68
+ reflections: DeclarationReflection[];
64
69
  /**
65
70
  * A grouped list of the reflections declared in this file.
66
71
  */
@@ -1,3 +1,4 @@
1
1
  export { SourceDirectory } from "./directory";
2
2
  export { SourceFile } from "./file";
3
3
  export type { SourceReference } from "./file";
4
+ export { RepositoryType } from "./repository";
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SourceFile = exports.SourceDirectory = void 0;
3
+ exports.RepositoryType = exports.SourceFile = exports.SourceDirectory = void 0;
4
4
  var directory_1 = require("./directory");
5
5
  Object.defineProperty(exports, "SourceDirectory", { enumerable: true, get: function () { return directory_1.SourceDirectory; } });
6
6
  var file_1 = require("./file");
7
7
  Object.defineProperty(exports, "SourceFile", { enumerable: true, get: function () { return file_1.SourceFile; } });
8
+ var repository_1 = require("./repository");
9
+ Object.defineProperty(exports, "RepositoryType", { enumerable: true, get: function () { return repository_1.RepositoryType; } });
@@ -0,0 +1,4 @@
1
+ export declare enum RepositoryType {
2
+ GitHub = "github",
3
+ Bitbucket = "bitbucket"
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RepositoryType = void 0;
4
+ var RepositoryType;
5
+ (function (RepositoryType) {
6
+ RepositoryType["GitHub"] = "github";
7
+ RepositoryType["Bitbucket"] = "bitbucket";
8
+ })(RepositoryType = exports.RepositoryType || (exports.RepositoryType = {}));
@@ -1,4 +1,4 @@
1
- export { PageEvent, RendererEvent } from "./events";
1
+ export { PageEvent, RendererEvent, MarkdownEvent } from "./events";
2
2
  export { UrlMapping } from "./models/UrlMapping";
3
3
  export type { RenderTemplate } from "./models/UrlMapping";
4
4
  export { Renderer } from "./renderer";
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DefaultThemeRenderContext = exports.DefaultTheme = exports.Theme = exports.Renderer = exports.UrlMapping = exports.RendererEvent = exports.PageEvent = void 0;
3
+ exports.DefaultThemeRenderContext = exports.DefaultTheme = exports.Theme = exports.Renderer = exports.UrlMapping = exports.MarkdownEvent = exports.RendererEvent = exports.PageEvent = void 0;
4
4
  var events_1 = require("./events");
5
5
  Object.defineProperty(exports, "PageEvent", { enumerable: true, get: function () { return events_1.PageEvent; } });
6
6
  Object.defineProperty(exports, "RendererEvent", { enumerable: true, get: function () { return events_1.RendererEvent; } });
7
+ Object.defineProperty(exports, "MarkdownEvent", { enumerable: true, get: function () { return events_1.MarkdownEvent; } });
7
8
  var UrlMapping_1 = require("./models/UrlMapping");
8
9
  Object.defineProperty(exports, "UrlMapping", { enumerable: true, get: function () { return UrlMapping_1.UrlMapping; } });
9
10
  var renderer_1 = require("./renderer");
@@ -1,5 +1,6 @@
1
1
  import { ContextAwareRendererComponent } from "../components";
2
2
  import { MarkdownEvent, RendererEvent } from "../events";
3
+ import { ValidationOptions } from "../../utils";
3
4
  /**
4
5
  * A plugin that builds links in markdown texts.
5
6
  */
@@ -13,6 +14,7 @@ export declare class MarkedLinksPlugin extends ContextAwareRendererComponent {
13
14
  */
14
15
  private inlineTag;
15
16
  listInvalidSymbolLinks: boolean;
17
+ validation: ValidationOptions;
16
18
  private warnings;
17
19
  /**
18
20
  * Create a new MarkedLinksPlugin instance.
@@ -126,7 +126,11 @@ let MarkedLinksPlugin = MarkedLinksPlugin_1 = class MarkedLinksPlugin extends co
126
126
  * Triggered when {@link Renderer} is finished
127
127
  */
128
128
  onEndRenderer(_event) {
129
- if (this.listInvalidSymbolLinks && this.warnings.length > 0) {
129
+ const enabled = this.listInvalidSymbolLinks || this.validation.invalidLink;
130
+ if (this.listInvalidSymbolLinks) {
131
+ this.application.logger.warn("listInvalidSymbolLinks is deprecated and will be removed in 0.23, set validation.invalidLink instead.");
132
+ }
133
+ if (enabled && this.warnings.length > 0) {
130
134
  this.application.logger.warn("\n[MarkedLinksPlugin]: Found invalid symbol reference(s) in JSDocs, " +
131
135
  "they will not render as links in the generated documentation." +
132
136
  "\n " +
@@ -165,6 +169,9 @@ let MarkedLinksPlugin = MarkedLinksPlugin_1 = class MarkedLinksPlugin extends co
165
169
  __decorate([
166
170
  (0, utils_1.BindOption)("listInvalidSymbolLinks")
167
171
  ], MarkedLinksPlugin.prototype, "listInvalidSymbolLinks", void 0);
172
+ __decorate([
173
+ (0, utils_1.BindOption)("validation")
174
+ ], MarkedLinksPlugin.prototype, "validation", void 0);
168
175
  MarkedLinksPlugin = MarkedLinksPlugin_1 = __decorate([
169
176
  (0, components_1.Component)({ name: "marked-links" })
170
177
  ], MarkedLinksPlugin);
@@ -1,5 +1,5 @@
1
1
  export { AssetsPlugin } from "./AssetsPlugin";
2
2
  export { JavascriptIndexPlugin } from "./JavascriptIndexPlugin";
3
3
  export { MarkedLinksPlugin } from "./MarkedLinksPlugin";
4
- export { MarkedPlugin as MarkedPlugin } from "../themes/MarkedPlugin";
4
+ export { MarkedPlugin } from "../themes/MarkedPlugin";
5
5
  export { LegendPlugin } from "./LegendPlugin";
@@ -65,6 +65,8 @@ export declare class Renderer extends ChildableComponent<Application, RendererCo
65
65
  /** @internal */
66
66
  gaSite: string;
67
67
  /** @internal */
68
+ githubPages: boolean;
69
+ /** @internal */
68
70
  hideGenerator: boolean;
69
71
  /** @internal */
70
72
  lightTheme: ShikiTheme;
@@ -8,6 +8,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.Renderer = void 0;
10
10
  const fs = require("fs");
11
+ const path = require("path");
11
12
  const events_1 = require("./events");
12
13
  const fs_1 = require("../utils/fs");
13
14
  const DefaultTheme_1 = require("./themes/default/DefaultTheme");
@@ -123,7 +124,9 @@ let Renderer = class Renderer extends component_1.ChildableComponent {
123
124
  * @param outputDirectory The path of the directory the documentation should be rendered to.
124
125
  */
125
126
  async render(project, outputDirectory) {
127
+ const start = Date.now();
126
128
  await (0, highlighter_1.loadHighlighter)(this.lightTheme, this.darkTheme);
129
+ this.application.logger.verbose(`Renderer: Loading highlighter took ${Date.now() - start}ms`);
127
130
  if (!this.prepareTheme() ||
128
131
  !(await this.prepareOutputDirectory(outputDirectory))) {
129
132
  return;
@@ -213,9 +216,21 @@ let Renderer = class Renderer extends component_1.ChildableComponent {
213
216
  fs.mkdirSync(directory, { recursive: true });
214
217
  }
215
218
  catch (error) {
216
- this.application.logger.error(`Could not create output directory ${directory}`);
219
+ this.application.logger.error(`Could not create output directory ${directory}.`);
217
220
  return false;
218
221
  }
222
+ if (this.githubPages) {
223
+ try {
224
+ const text = "TypeDoc added this file to prevent GitHub Pages from " +
225
+ "using Jekyll. You can turn off this behavior by setting " +
226
+ "the `githubPages` option to false.";
227
+ fs.writeFileSync(path.join(directory, ".nojekyll"), text);
228
+ }
229
+ catch (error) {
230
+ this.application.logger.warn("Could not create .nojekyll file.");
231
+ return false;
232
+ }
233
+ }
219
234
  return true;
220
235
  }
221
236
  };
@@ -239,6 +254,9 @@ __decorate([
239
254
  __decorate([
240
255
  (0, utils_1.BindOption)("gaSite")
241
256
  ], Renderer.prototype, "gaSite", void 0);
257
+ __decorate([
258
+ (0, utils_1.BindOption)("githubPages")
259
+ ], Renderer.prototype, "githubPages", void 0);
242
260
  __decorate([
243
261
  (0, utils_1.BindOption)("hideGenerator")
244
262
  ], Renderer.prototype, "hideGenerator", void 0);
@@ -3,6 +3,7 @@ import { RendererEvent, MarkdownEvent } from "../events";
3
3
  import type { Theme } from "shiki";
4
4
  /**
5
5
  * Implements markdown and relativeURL helpers for templates.
6
+ * @internal
6
7
  */
7
8
  export declare class MarkedPlugin extends ContextAwareRendererComponent {
8
9
  includeSource: string;
@@ -25,6 +25,7 @@ customMarkedRenderer.heading = (text, level, _, slugger) => {
25
25
  };
26
26
  /**
27
27
  * Implements markdown and relativeURL helpers for templates.
28
+ * @internal
28
29
  */
29
30
  let MarkedPlugin = class MarkedPlugin extends components_1.ContextAwareRendererComponent {
30
31
  constructor() {
@@ -146,15 +147,11 @@ output file :
146
147
  createMarkedOptions() {
147
148
  var _a, _b, _c, _d;
148
149
  const markedOptions = ((_a = this.application.options.getValue("markedOptions")) !== null && _a !== void 0 ? _a : {});
149
- if (typeof markedOptions === "object" &&
150
- !Array.isArray(markedOptions)) {
151
- // Set some default values if they are not specified via the TypeDoc option
152
- (_b = markedOptions.highlight) !== null && _b !== void 0 ? _b : (markedOptions.highlight = (text, lang) => this.getHighlighted(text, lang));
153
- (_c = markedOptions.renderer) !== null && _c !== void 0 ? _c : (markedOptions.renderer = customMarkedRenderer);
154
- (_d = markedOptions.mangle) !== null && _d !== void 0 ? _d : (markedOptions.mangle = false); // See https://github.com/TypeStrong/typedoc/issues/1395
155
- return markedOptions;
156
- }
157
- throw new Error("The value provided via the 'markedOptions' option must be a non-array object.");
150
+ // Set some default values if they are not specified via the TypeDoc option
151
+ (_b = markedOptions.highlight) !== null && _b !== void 0 ? _b : (markedOptions.highlight = (text, lang) => this.getHighlighted(text, lang));
152
+ (_c = markedOptions.renderer) !== null && _c !== void 0 ? _c : (markedOptions.renderer = customMarkedRenderer);
153
+ (_d = markedOptions.mangle) !== null && _d !== void 0 ? _d : (markedOptions.mangle = false); // See https://github.com/TypeStrong/typedoc/issues/1395
154
+ return markedOptions;
158
155
  }
159
156
  /**
160
157
  * Triggered when {@link MarkedPlugin} parses a markdown string.
@@ -11,34 +11,34 @@ export declare class DefaultThemeRenderContext {
11
11
  urlTo: (reflection: Reflection) => string | undefined;
12
12
  markdown: (md: string | undefined) => string;
13
13
  attemptExternalResolution: (symbol: ts.Symbol | undefined) => string | undefined;
14
- reflectionTemplate: (props: import("../..").PageEvent<import("../../../models").ContainerReflection>) => import("../../../utils/jsx").Element;
15
- indexTemplate: (props: import("../..").PageEvent<import("../../../models").ProjectReflection>) => import("../../../utils/jsx").Element;
16
- defaultLayout: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx").Element;
17
- analytics: () => import("../../../utils/jsx").Element | undefined;
18
- breadcrumb: (props: Reflection) => import("../../../utils/jsx").Element | undefined;
19
- comment: (props: Reflection) => import("../../../utils/jsx").Element | undefined;
20
- footer: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx").Element;
21
- header: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx").Element;
22
- hierarchy: (props: import("../../../models").DeclarationHierarchy) => import("../../../utils/jsx").Element;
23
- index: (props: import("../../../models").ContainerReflection) => import("../../../utils/jsx").Element | undefined;
24
- member: (props: import("../../../models").DeclarationReflection) => import("../../../utils/jsx").Element;
25
- memberDeclaration: (props: import("../../../models").DeclarationReflection) => import("../../../utils/jsx").Element;
26
- memberGetterSetter: (props: import("../../../models").DeclarationReflection) => import("../../../utils/jsx").Element;
27
- memberReference: (props: import("../../../models").ReferenceReflection) => import("../../../utils/jsx").Element;
14
+ reflectionTemplate: (props: import("../..").PageEvent<import("../../../models").ContainerReflection>) => import("../../../utils/jsx.elements").JsxElement;
15
+ indexTemplate: (props: import("../..").PageEvent<import("../../../models").ProjectReflection>) => import("../../../utils/jsx.elements").JsxElement;
16
+ defaultLayout: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
17
+ analytics: () => import("../../../utils/jsx.elements").JsxElement | undefined;
18
+ breadcrumb: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
19
+ comment: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
20
+ footer: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
21
+ header: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
22
+ hierarchy: (props: import("../../../models").DeclarationHierarchy) => import("../../../utils/jsx.elements").JsxElement;
23
+ index: (props: import("../../../models").ContainerReflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
24
+ member: (props: import("../../../models").DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
25
+ memberDeclaration: (props: import("../../../models").DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
26
+ memberGetterSetter: (props: import("../../../models").DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
27
+ memberReference: (props: import("../../../models").ReferenceReflection) => import("../../../utils/jsx.elements").JsxElement;
28
28
  memberSignatureBody: (r_0: import("../../../models").SignatureReflection, r_1?: {
29
29
  hideSources?: boolean | undefined;
30
- } | undefined) => import("../../../utils/jsx").Element;
30
+ } | undefined) => import("../../../utils/jsx.elements").JsxElement;
31
31
  memberSignatureTitle: (r_0: import("../../../models").SignatureReflection, r_1?: {
32
32
  hideName?: boolean | undefined;
33
33
  arrowStyle?: boolean | undefined;
34
- } | undefined) => import("../../../utils/jsx").Element;
35
- memberSignatures: (props: import("../../../models").DeclarationReflection) => import("../../../utils/jsx").Element;
36
- memberSources: (props: import("../../../models").DeclarationReflection | import("../../../models").SignatureReflection) => import("../../../utils/jsx").Element;
37
- members: (props: import("../../../models").ContainerReflection) => import("../../../utils/jsx").Element;
38
- membersGroup: (group: import("../../../models").ReflectionGroup) => import("../../../utils/jsx").Element;
39
- navigation: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx").Element;
40
- parameter: (props: import("../../../models").DeclarationReflection) => import("../../../utils/jsx").Element;
41
- type: (type: import("../../../models").Type | undefined) => import("../../../utils/jsx").Element;
42
- typeAndParent: (props: import("../../../models").Type) => import("../../../utils/jsx").Element;
43
- typeParameters: (typeParameters: import("../../../models").TypeParameterReflection[]) => import("../../../utils/jsx").Element;
34
+ } | undefined) => import("../../../utils/jsx.elements").JsxElement;
35
+ memberSignatures: (props: import("../../../models").DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
36
+ memberSources: (props: import("../../../models").DeclarationReflection | import("../../../models").SignatureReflection) => import("../../../utils/jsx.elements").JsxElement;
37
+ members: (props: import("../../../models").ContainerReflection) => import("../../../utils/jsx.elements").JsxElement;
38
+ membersGroup: (group: import("../../../models").ReflectionGroup) => import("../../../utils/jsx.elements").JsxElement;
39
+ navigation: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
40
+ parameter: (props: import("../../../models").DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
41
+ type: (type: import("../../../models").Type | undefined) => import("../../../utils/jsx.elements").JsxElement;
42
+ typeAndParent: (props: import("../../../models").Type) => import("../../../utils/jsx.elements").JsxElement;
43
+ typeParameters: (typeParameters: import("../../../models").TypeParameterReflection[]) => import("../../../utils/jsx.elements").JsxElement;
44
44
  }
@@ -5,7 +5,7 @@ const utils_1 = require("../../../../utils");
5
5
  const defaultLayout = (context, props) => (utils_1.JSX.createElement("html", { class: "default no-js" },
6
6
  utils_1.JSX.createElement("head", null,
7
7
  utils_1.JSX.createElement("meta", { charSet: "utf-8" }),
8
- utils_1.JSX.createElement("meta", { "http-equiv": "X-UA-Compatible", content: "IE=edge" }),
8
+ utils_1.JSX.createElement("meta", { "http-equiv": "x-ua-compatible", content: "IE=edge" }),
9
9
  utils_1.JSX.createElement("title", null, props.model.name === props.project.name ? (props.project.name) : (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
10
10
  props.model.name,
11
11
  " | ",
@@ -17,6 +17,7 @@ const defaultLayout = (context, props) => (utils_1.JSX.createElement("html", { c
17
17
  context.options.getValue("customCss") && (utils_1.JSX.createElement("link", { rel: "stylesheet", href: context.relativeURL("assets/custom.css") })),
18
18
  utils_1.JSX.createElement("script", { async: true, src: context.relativeURL("assets/search.js"), id: "search-script" })),
19
19
  utils_1.JSX.createElement("body", null,
20
+ utils_1.JSX.createElement("script", null, "document.body.classList.add(localStorage.getItem(\"tsd-theme\") || \"os\")"),
20
21
  context.header(props),
21
22
  utils_1.JSX.createElement("div", { class: "container container-main" },
22
23
  utils_1.JSX.createElement("div", { class: "row" },
@@ -7,7 +7,7 @@ const models_1 = require("../../../../models");
7
7
  const member = (context, props) => {
8
8
  var _a;
9
9
  return (utils_1.JSX.createElement("section", { class: "tsd-panel tsd-member " + props.cssClasses },
10
- utils_1.JSX.createElement("a", { name: props.anchor, class: "tsd-anchor" }),
10
+ utils_1.JSX.createElement("a", { id: props.anchor, class: "tsd-anchor" }),
11
11
  !!props.name && (utils_1.JSX.createElement("h3", null,
12
12
  (0, lib_1.renderFlags)(props.flags),
13
13
  (0, lib_1.wbr)(props.name))),
@@ -18,6 +18,6 @@ const member = (context, props) => {
18
18
  : props instanceof models_1.ReferenceReflection
19
19
  ? context.memberReference(props)
20
20
  : context.memberDeclaration(props), (_a = props.groups) === null || _a === void 0 ? void 0 :
21
- _a.map((item) => item.children.map((item) => !item.hasOwnDocument && context.member((0, lib_1.assertIsDeclarationReflection)(item))))));
21
+ _a.map((item) => item.children.map((item) => !item.hasOwnDocument && context.member(item)))));
22
22
  };
23
23
  exports.member = member;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.membersGroup = void 0;
4
- const lib_1 = require("../../lib");
5
4
  const utils_1 = require("../../../../utils");
6
5
  function membersGroup(context, group) {
7
6
  if (group.categories) {
@@ -11,10 +10,10 @@ function membersGroup(context, group) {
11
10
  item.title,
12
11
  " "),
13
12
  group.title),
14
- item.children.map((item) => !item.hasOwnDocument && context.member((0, lib_1.assertIsDeclarationReflection)(item))))))));
13
+ item.children.map((item) => !item.hasOwnDocument && context.member(item)))))));
15
14
  }
16
15
  return (utils_1.JSX.createElement("section", { class: "tsd-panel-group tsd-member-group " + group.cssClasses },
17
16
  utils_1.JSX.createElement("h2", null, group.title),
18
- group.children.map((item) => !item.hasOwnDocument && context.member((0, lib_1.assertIsDeclarationReflection)(item)))));
17
+ group.children.map((item) => !item.hasOwnDocument && context.member(item))));
19
18
  }
20
19
  exports.membersGroup = membersGroup;
@@ -1,14 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.members = void 0;
4
- const lib_1 = require("../../lib");
5
4
  const utils_1 = require("../../../../utils");
6
5
  function members(context, props) {
7
6
  var _a;
8
7
  if (props.categories && props.categories.length) {
9
8
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null, props.categories.map((item) => !item.allChildrenHaveOwnDocument() && (utils_1.JSX.createElement("section", { class: "tsd-panel-group tsd-member-group " + props.cssClasses },
10
9
  utils_1.JSX.createElement("h2", null, item.title),
11
- item.children.map((item) => !item.hasOwnDocument && context.member((0, lib_1.assertIsDeclarationReflection)(item))))))));
10
+ item.children.map((item) => !item.hasOwnDocument && context.member(item)))))));
12
11
  }
13
12
  return utils_1.JSX.createElement(utils_1.JSX.Fragment, null, (_a = props.groups) === null || _a === void 0 ? void 0 : _a.map((item) => !item.allChildrenHaveOwnDocument() && context.membersGroup(item)));
14
13
  }