typedoc 0.26.0-beta.5 → 0.26.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 (68) hide show
  1. package/dist/index.d.ts +5 -6
  2. package/dist/index.js +1 -2
  3. package/dist/lib/application-events.d.ts +3 -3
  4. package/dist/lib/application.d.ts +9 -4
  5. package/dist/lib/application.js +2 -2
  6. package/dist/lib/converter/comments/parser.js +1 -1
  7. package/dist/lib/converter/components.d.ts +1 -1
  8. package/dist/lib/converter/context.d.ts +0 -10
  9. package/dist/lib/converter/context.js +0 -12
  10. package/dist/lib/converter/converter.d.ts +22 -2
  11. package/dist/lib/converter/converter.js +0 -1
  12. package/dist/lib/converter/factories/index-signature.js +1 -1
  13. package/dist/lib/converter/factories/signature.js +5 -5
  14. package/dist/lib/converter/index.d.ts +1 -1
  15. package/dist/lib/converter/jsdoc.js +1 -1
  16. package/dist/lib/converter/plugins/CategoryPlugin.js +2 -4
  17. package/dist/lib/converter/plugins/CommentPlugin.js +7 -9
  18. package/dist/lib/converter/plugins/GroupPlugin.js +8 -10
  19. package/dist/lib/converter/plugins/ImplementsPlugin.js +4 -4
  20. package/dist/lib/converter/plugins/InheritDocPlugin.js +1 -1
  21. package/dist/lib/converter/plugins/LinkResolverPlugin.js +2 -2
  22. package/dist/lib/converter/plugins/PackagePlugin.js +7 -11
  23. package/dist/lib/converter/plugins/SourcePlugin.js +4 -6
  24. package/dist/lib/converter/plugins/TypePlugin.js +4 -8
  25. package/dist/lib/converter/types.js +6 -6
  26. package/dist/lib/internationalization/locales/jp.cjs +15 -1
  27. package/dist/lib/internationalization/locales/jp.d.cts +15 -1
  28. package/dist/lib/internationalization/locales/zh.cjs +15 -1
  29. package/dist/lib/internationalization/locales/zh.d.cts +15 -1
  30. package/dist/lib/internationalization/translatable.d.ts +2 -1
  31. package/dist/lib/internationalization/translatable.js +3 -1
  32. package/dist/lib/output/components.d.ts +1 -1
  33. package/dist/lib/output/components.js +3 -5
  34. package/dist/lib/output/events.d.ts +6 -13
  35. package/dist/lib/output/events.js +7 -17
  36. package/dist/lib/output/index.d.ts +1 -1
  37. package/dist/lib/output/plugins/AssetsPlugin.d.ts +1 -0
  38. package/dist/lib/output/plugins/AssetsPlugin.js +13 -15
  39. package/dist/lib/output/plugins/IconsPlugin.js +1 -3
  40. package/dist/lib/output/plugins/JavascriptIndexPlugin.d.ts +0 -8
  41. package/dist/lib/output/plugins/JavascriptIndexPlugin.js +4 -18
  42. package/dist/lib/output/plugins/NavigationPlugin.js +2 -5
  43. package/dist/lib/output/plugins/SitemapPlugin.js +3 -3
  44. package/dist/lib/output/renderer.d.ts +11 -4
  45. package/dist/lib/output/renderer.js +11 -21
  46. package/dist/lib/output/themes/MarkedPlugin.js +3 -3
  47. package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +0 -1
  48. package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +0 -2
  49. package/dist/lib/output/themes/default/layouts/default.js +0 -1
  50. package/dist/lib/output/themes/default/partials/comment.js +2 -3
  51. package/dist/lib/output/themes/default/partials/navigation.js +1 -1
  52. package/dist/lib/output/themes/default/templates/hierarchy.js +1 -1
  53. package/dist/lib/serialization/events.d.ts +2 -3
  54. package/dist/lib/serialization/events.js +2 -4
  55. package/dist/lib/serialization/index.d.ts +1 -1
  56. package/dist/lib/serialization/serializer.d.ts +10 -5
  57. package/dist/lib/serialization/serializer.js +6 -6
  58. package/dist/lib/utils/component.d.ts +4 -18
  59. package/dist/lib/utils/component.js +1 -39
  60. package/dist/lib/utils/events.d.ts +18 -113
  61. package/dist/lib/utils/events.js +33 -374
  62. package/dist/lib/utils/index.d.ts +1 -1
  63. package/dist/lib/utils/index.js +1 -2
  64. package/dist/lib/utils/options/declaration.d.ts +0 -1
  65. package/dist/lib/utils/options/sources/typedoc.js +1 -4
  66. package/package.json +3 -2
  67. package/dist/lib/output/themes/default/partials/analytics.d.ts +0 -3
  68. package/dist/lib/output/themes/default/partials/analytics.js +0 -19
@@ -62,6 +62,9 @@ module.exports = (0, translatable_1.buildIncompleteTranslation)({
62
62
  signature_0_has_unused_param_with_name_1: "签名 {0} 有一个名为“{1}”的 @param,但未被使用",
63
63
  declaration_reference_in_inheritdoc_for_0_not_fully_parsed: "@inheritDoc 中对 {0} 的声明引用未完全解析,可能会解析不正确",
64
64
  failed_to_find_0_to_inherit_comment_from_in_1: "在 {1} 的评论中找不到要继承的评论“{0}”",
65
+ failed_to_resolve_link_to_0_in_comment_for_1_may_have_meant_2: `无法解析 {1} 的注释中指向"{0}"的链接。您可能想要"{2}"`,
66
+ failed_to_resolve_link_to_0_in_readme_for_1: `无法解析 {1} 的自述文件中指向"{0}"的链接`,
67
+ failed_to_resolve_link_to_0_in_readme_for_1_may_have_meant_2: `无法解析 {1} 的自述文件中指向"{0}"的链接。您可能想要"{2}"`,
65
68
  reflection_0_tried_to_copy_comment_from_1_but_source_had_no_comment: "{0} 尝试使用 @inheritDoc 从 {1} 复制注释,但源没有相关注释",
66
69
  inheritdoc_circular_inheritance_chain_0: "@inheritDoc 指定循环继承链:{0}",
67
70
  provided_readme_at_0_could_not_be_read: "提供的 README 路径无法读取 {0}",
@@ -156,7 +159,6 @@ module.exports = (0, translatable_1.buildIncompleteTranslation)({
156
159
  help_githubPages: "生成 .nojekyll 文件以防止 GitHub Pages 中出现 404 错误。默认为“true”",
157
160
  help_hostedBaseUrl: "指定用于在我们的输出文件夹和规范链接中生成 sitemap.xml 的基本 URL。如果未指定,则不会生成站点地图",
158
161
  help_useHostedBaseUrlForAbsoluteLinks: "如果设置,TypeDoc 将使用 hostingBaseUrl 选项生成到您网站页面的绝对链接",
159
- help_gaID: "设置 Google Analytics 跟踪 ID 并激活跟踪代码",
160
162
  help_hideGenerator: "不要打印页面末尾的 TypeDoc 链接",
161
163
  help_customFooterHtml: "TypeDoc 链接后的自定义页脚",
162
164
  help_customFooterHtmlDisableWrapper: "如果设置,则禁用 customFooterHtml 的包装元素",
@@ -275,6 +277,13 @@ module.exports = (0, translatable_1.buildIncompleteTranslation)({
275
277
  flag_private: "私有",
276
278
  flag_external: "外部",
277
279
  flag_inherited: "继承",
280
+ flag_public: "公开",
281
+ flag_static: "静态",
282
+ flag_optional: "可选",
283
+ flag_rest: "动态参数",
284
+ flag_abstract: "抽象",
285
+ flag_const: "常量",
286
+ flag_readonly: "只读",
278
287
  theme_implements: "实现",
279
288
  theme_indexable: "可索引",
280
289
  theme_type_declaration: "类型声明",
@@ -305,4 +314,9 @@ module.exports = (0, translatable_1.buildIncompleteTranslation)({
305
314
  tag_see: "参阅",
306
315
  tag_group: "所属分组",
307
316
  tag_example: "示例",
317
+ theme_copy: "复制",
318
+ theme_copied: "已复制!",
319
+ theme_normally_hidden: "由于您的过滤器设置,该成员已被隐藏。",
320
+ theme_class_hierarchy_title: "类继承图表",
321
+ theme_loading: "加载中……",
308
322
  });
@@ -60,6 +60,9 @@ declare const _default: {
60
60
  signature_0_has_unused_param_with_name_1: "签名 {0} 有一个名为“{1}”的 @param,但未被使用";
61
61
  declaration_reference_in_inheritdoc_for_0_not_fully_parsed: "@inheritDoc 中对 {0} 的声明引用未完全解析,可能会解析不正确";
62
62
  failed_to_find_0_to_inherit_comment_from_in_1: "在 {1} 的评论中找不到要继承的评论“{0}”";
63
+ failed_to_resolve_link_to_0_in_comment_for_1_may_have_meant_2: "无法解析 {1} 的注释中指向\"{0}\"的链接。您可能想要\"{2}\"";
64
+ failed_to_resolve_link_to_0_in_readme_for_1: "无法解析 {1} 的自述文件中指向\"{0}\"的链接";
65
+ failed_to_resolve_link_to_0_in_readme_for_1_may_have_meant_2: "无法解析 {1} 的自述文件中指向\"{0}\"的链接。您可能想要\"{2}\"";
63
66
  reflection_0_tried_to_copy_comment_from_1_but_source_had_no_comment: "{0} 尝试使用 @inheritDoc 从 {1} 复制注释,但源没有相关注释";
64
67
  inheritdoc_circular_inheritance_chain_0: "@inheritDoc 指定循环继承链:{0}";
65
68
  provided_readme_at_0_could_not_be_read: "提供的 README 路径无法读取 {0}";
@@ -154,7 +157,6 @@ declare const _default: {
154
157
  help_githubPages: string;
155
158
  help_hostedBaseUrl: string;
156
159
  help_useHostedBaseUrlForAbsoluteLinks: string;
157
- help_gaID: string;
158
160
  help_hideGenerator: string;
159
161
  help_customFooterHtml: string;
160
162
  help_customFooterHtmlDisableWrapper: string;
@@ -273,6 +275,13 @@ declare const _default: {
273
275
  flag_private: string;
274
276
  flag_external: string;
275
277
  flag_inherited: string;
278
+ flag_public: string;
279
+ flag_static: string;
280
+ flag_optional: string;
281
+ flag_rest: string;
282
+ flag_abstract: string;
283
+ flag_const: string;
284
+ flag_readonly: string;
276
285
  theme_implements: string;
277
286
  theme_indexable: string;
278
287
  theme_type_declaration: string;
@@ -303,5 +312,10 @@ declare const _default: {
303
312
  tag_see: string;
304
313
  tag_group: string;
305
314
  tag_example: string;
315
+ theme_copy: string;
316
+ theme_copied: string;
317
+ theme_normally_hidden: string;
318
+ theme_class_hierarchy_title: string;
319
+ theme_loading: string;
306
320
  };
307
321
  export = _default;
@@ -160,7 +160,6 @@ export declare const translatable: {
160
160
  readonly help_githubPages: "Generate a .nojekyll file to prevent 404 errors in GitHub Pages. Defaults to `true`";
161
161
  readonly help_hostedBaseUrl: "Specify a base URL to be used in generating a sitemap.xml in our output folder and canonical links. If not specified, no sitemap will be generated";
162
162
  readonly help_useHostedBaseUrlForAbsoluteLinks: "If set, TypeDoc will produce absolute links to pages on your site using the hostedBaseUrl option";
163
- readonly help_gaID: "Set the Google Analytics tracking ID and activate tracking code";
164
163
  readonly help_hideGenerator: "Do not print the TypeDoc link at the end of the page";
165
164
  readonly help_customFooterHtml: "Custom footer after the TypeDoc link";
166
165
  readonly help_customFooterHtmlDisableWrapper: "If set, disables the wrapper element for customFooterHtml";
@@ -301,8 +300,10 @@ export declare const translatable: {
301
300
  readonly theme_re_exports: "Re-exports";
302
301
  readonly theme_renames_and_re_exports: "Renames and re-exports";
303
302
  readonly theme_generated_using_typedoc: "Generated using TypeDoc";
303
+ readonly theme_class_hierarchy_title: "Class Hierarchy";
304
304
  readonly theme_preparing_search_index: "Preparing search index...";
305
305
  readonly theme_search_index_not_available: "The search index is not available";
306
+ readonly theme_loading: "Loading...";
306
307
  readonly theme_settings: "Settings";
307
308
  readonly theme_member_visibility: "Member Visibility";
308
309
  readonly theme_theme: "Theme";
@@ -178,7 +178,6 @@ exports.translatable = {
178
178
  help_githubPages: "Generate a .nojekyll file to prevent 404 errors in GitHub Pages. Defaults to `true`",
179
179
  help_hostedBaseUrl: "Specify a base URL to be used in generating a sitemap.xml in our output folder and canonical links. If not specified, no sitemap will be generated",
180
180
  help_useHostedBaseUrlForAbsoluteLinks: "If set, TypeDoc will produce absolute links to pages on your site using the hostedBaseUrl option",
181
- help_gaID: "Set the Google Analytics tracking ID and activate tracking code",
182
181
  help_hideGenerator: "Do not print the TypeDoc link at the end of the page",
183
182
  help_customFooterHtml: "Custom footer after the TypeDoc link",
184
183
  help_customFooterHtmlDisableWrapper: "If set, disables the wrapper element for customFooterHtml",
@@ -329,9 +328,12 @@ exports.translatable = {
329
328
  theme_re_exports: "Re-exports",
330
329
  theme_renames_and_re_exports: "Renames and re-exports",
331
330
  theme_generated_using_typedoc: "Generated using TypeDoc", // If this includes "TypeDoc", theme will insert a link at that location.
331
+ theme_class_hierarchy_title: "Class Hierarchy",
332
332
  // Search
333
333
  theme_preparing_search_index: "Preparing search index...",
334
334
  theme_search_index_not_available: "The search index is not available",
335
+ // Left nav bar
336
+ theme_loading: "Loading...",
335
337
  // Right nav bar
336
338
  theme_settings: "Settings",
337
339
  theme_member_visibility: "Member Visibility",
@@ -3,7 +3,7 @@ import type { ProjectReflection, Reflection } from "../models/reflections/index"
3
3
  import type { Renderer } from "./renderer";
4
4
  import { RendererEvent, PageEvent } from "./events";
5
5
  export { Component };
6
- export declare abstract class RendererComponent extends AbstractComponent<Renderer> {
6
+ export declare abstract class RendererComponent extends AbstractComponent<Renderer, {}> {
7
7
  }
8
8
  /**
9
9
  * A plugin for the renderer that reads the current render context.
@@ -115,11 +115,9 @@ let ContextAwareRendererComponent = (() => {
115
115
  * @param renderer The renderer this plugin should be attached to.
116
116
  */
117
117
  initialize() {
118
- this.listenTo(this.owner, {
119
- [events_1.RendererEvent.BEGIN]: this.onBeginRenderer,
120
- [events_1.PageEvent.BEGIN]: this.onBeginPage,
121
- [events_1.RendererEvent.END]: () => this.absoluteToRelativePathMap.clear(),
122
- });
118
+ this.owner.on(events_1.RendererEvent.BEGIN, this.onBeginRenderer.bind(this));
119
+ this.owner.on(events_1.PageEvent.BEGIN, this.onBeginPage.bind(this));
120
+ this.owner.on(events_1.RendererEvent.END, () => this.absoluteToRelativePathMap.clear());
123
121
  }
124
122
  /**
125
123
  * Transform the given absolute path into a relative path.
@@ -1,4 +1,3 @@
1
- import { Event } from "../utils/events";
2
1
  import type { ProjectReflection } from "../models/reflections/project";
3
2
  import type { RenderTemplate, UrlMapping } from "./models/UrlMapping";
4
3
  import type { DeclarationReflection, DocumentReflection, Reflection, ReflectionKind } from "../models";
@@ -9,7 +8,7 @@ import type { DeclarationReflection, DocumentReflection, Reflection, ReflectionK
9
8
  * @see {@link Renderer.EVENT_BEGIN}
10
9
  * @see {@link Renderer.EVENT_END}
11
10
  */
12
- export declare class RendererEvent extends Event {
11
+ export declare class RendererEvent {
13
12
  /**
14
13
  * The project the renderer is currently processing.
15
14
  */
@@ -34,7 +33,7 @@ export declare class RendererEvent extends Event {
34
33
  * @event
35
34
  */
36
35
  static readonly END = "endRender";
37
- constructor(name: string, outputDirectory: string, project: ProjectReflection);
36
+ constructor(outputDirectory: string, project: ProjectReflection);
38
37
  /**
39
38
  * Create an {@link PageEvent} event based on this event and the given url mapping.
40
39
  *
@@ -101,9 +100,8 @@ export declare class PageEvent<out Model = unknown> extends Event {
101
100
  * An event emitted when markdown is being parsed. Allows other plugins to manipulate the result.
102
101
  *
103
102
  * @see {@link MarkdownEvent.PARSE}
104
- * @see {@link MarkdownEvent.INCLUDE}
105
103
  */
106
- export declare class MarkdownEvent extends Event {
104
+ export declare class MarkdownEvent {
107
105
  /**
108
106
  * The unparsed original text.
109
107
  */
@@ -121,17 +119,12 @@ export declare class MarkdownEvent extends Event {
121
119
  * @event
122
120
  */
123
121
  static readonly PARSE = "parseMarkdown";
124
- /**
125
- * Triggered on the renderer when this plugin includes a markdown file through a markdown include tag.
126
- * @event
127
- */
128
- static readonly INCLUDE = "includeMarkdown";
129
- constructor(name: string, page: PageEvent, originalText: string, parsedText: string);
122
+ constructor(page: PageEvent, originalText: string, parsedText: string);
130
123
  }
131
124
  /**
132
125
  * An event emitted when the search index is being prepared.
133
126
  */
134
- export declare class IndexEvent extends Event {
127
+ export declare class IndexEvent {
135
128
  /**
136
129
  * Triggered on the renderer when the search index is being prepared.
137
130
  * @event
@@ -168,5 +161,5 @@ export declare class IndexEvent extends Event {
168
161
  * Remove a search result by index.
169
162
  */
170
163
  removeResult(index: number): void;
171
- constructor(name: string, searchResults: Array<DeclarationReflection | DocumentReflection>);
164
+ constructor(searchResults: Array<DeclarationReflection | DocumentReflection>);
172
165
  }
@@ -25,7 +25,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.IndexEvent = exports.MarkdownEvent = exports.PageEvent = exports.RendererEvent = void 0;
27
27
  const Path = __importStar(require("path"));
28
- const events_1 = require("../utils/events");
29
28
  /**
30
29
  * An event emitted by the {@link Renderer} class at the very beginning and
31
30
  * ending of the entire rendering process.
@@ -33,9 +32,8 @@ const events_1 = require("../utils/events");
33
32
  * @see {@link Renderer.EVENT_BEGIN}
34
33
  * @see {@link Renderer.EVENT_END}
35
34
  */
36
- class RendererEvent extends events_1.Event {
37
- constructor(name, outputDirectory, project) {
38
- super(name);
35
+ class RendererEvent {
36
+ constructor(outputDirectory, project) {
39
37
  this.outputDirectory = outputDirectory;
40
38
  this.project = project;
41
39
  }
@@ -72,7 +70,7 @@ RendererEvent.END = "endRender";
72
70
  * @see {@link Renderer.EVENT_BEGIN_PAGE}
73
71
  * @see {@link Renderer.EVENT_END_PAGE}
74
72
  */
75
- class PageEvent extends events_1.Event {
73
+ class PageEvent extends Event {
76
74
  constructor(name, model) {
77
75
  super(name);
78
76
  /**
@@ -98,11 +96,9 @@ PageEvent.END = "endPage";
98
96
  * An event emitted when markdown is being parsed. Allows other plugins to manipulate the result.
99
97
  *
100
98
  * @see {@link MarkdownEvent.PARSE}
101
- * @see {@link MarkdownEvent.INCLUDE}
102
99
  */
103
- class MarkdownEvent extends events_1.Event {
104
- constructor(name, page, originalText, parsedText) {
105
- super(name);
100
+ class MarkdownEvent {
101
+ constructor(page, originalText, parsedText) {
106
102
  this.page = page;
107
103
  this.originalText = originalText;
108
104
  this.parsedText = parsedText;
@@ -114,15 +110,10 @@ exports.MarkdownEvent = MarkdownEvent;
114
110
  * @event
115
111
  */
116
112
  MarkdownEvent.PARSE = "parseMarkdown";
117
- /**
118
- * Triggered on the renderer when this plugin includes a markdown file through a markdown include tag.
119
- * @event
120
- */
121
- MarkdownEvent.INCLUDE = "includeMarkdown";
122
113
  /**
123
114
  * An event emitted when the search index is being prepared.
124
115
  */
125
- class IndexEvent extends events_1.Event {
116
+ class IndexEvent {
126
117
  /**
127
118
  * Remove a search result by index.
128
119
  */
@@ -130,8 +121,7 @@ class IndexEvent extends events_1.Event {
130
121
  this.searchResults.splice(index, 1);
131
122
  this.searchFields.splice(index, 1);
132
123
  }
133
- constructor(name, searchResults) {
134
- super(name);
124
+ constructor(searchResults) {
135
125
  /**
136
126
  * Weights for the fields defined in `searchFields`. The default will weight
137
127
  * `name` as 10x more important than comment and document content.
@@ -1,7 +1,7 @@
1
1
  export { PageEvent, RendererEvent, MarkdownEvent, IndexEvent } from "./events";
2
2
  export { UrlMapping } from "./models/UrlMapping";
3
3
  export type { RenderTemplate } from "./models/UrlMapping";
4
- export { Renderer } from "./renderer";
4
+ export { Renderer, type RendererEvents } from "./renderer";
5
5
  export type { RendererHooks } from "./renderer";
6
6
  export { Theme } from "./theme";
7
7
  export { DefaultTheme, Slugger, type NavigationElement, } from "./themes/default/DefaultTheme";
@@ -15,6 +15,7 @@ export declare class AssetsPlugin extends RendererComponent {
15
15
  * Create a new AssetsPlugin instance.
16
16
  */
17
17
  initialize(): void;
18
+ private onRenderBegin;
18
19
  /**
19
20
  * Triggered before the renderer starts rendering a project.
20
21
  *
@@ -87,21 +87,19 @@ let AssetsPlugin = (() => {
87
87
  * Create a new AssetsPlugin instance.
88
88
  */
89
89
  initialize() {
90
- this.listenTo(this.owner, {
91
- [events_1.RendererEvent.END]: this.onRenderEnd,
92
- [events_1.RendererEvent.BEGIN]: (event) => {
93
- const dest = (0, path_1.join)(event.outputDirectory, "assets");
94
- if (this.customCss) {
95
- if ((0, fs_2.existsSync)(this.customCss)) {
96
- (0, fs_1.copySync)(this.customCss, (0, path_1.join)(dest, "custom.css"));
97
- }
98
- else {
99
- this.application.logger.error(this.application.i18n.custom_css_file_0_does_not_exist(this.customCss));
100
- event.preventDefault();
101
- }
102
- }
103
- },
104
- });
90
+ this.owner.on(events_1.RendererEvent.BEGIN, this.onRenderBegin.bind(this));
91
+ this.owner.on(events_1.RendererEvent.END, this.onRenderEnd.bind(this));
92
+ }
93
+ onRenderBegin(event) {
94
+ const dest = (0, path_1.join)(event.outputDirectory, "assets");
95
+ if (this.customCss) {
96
+ if ((0, fs_2.existsSync)(this.customCss)) {
97
+ (0, fs_1.copySync)(this.customCss, (0, path_1.join)(dest, "custom.css"));
98
+ }
99
+ else {
100
+ this.application.logger.error(this.application.i18n.custom_css_file_0_does_not_exist(this.customCss));
101
+ }
102
+ }
105
103
  }
106
104
  /**
107
105
  * Triggered before the renderer starts rendering a project.
@@ -77,9 +77,7 @@ let IconsPlugin = (() => {
77
77
  let _classSuper = components_1.RendererComponent;
78
78
  var IconsPlugin = _classThis = class extends _classSuper {
79
79
  initialize() {
80
- this.listenTo(this.owner, {
81
- [events_1.RendererEvent.BEGIN]: this.onBeginRender,
82
- });
80
+ this.owner.on(events_1.RendererEvent.BEGIN, this.onBeginRender.bind(this));
83
81
  }
84
82
  onBeginRender(_event) {
85
83
  if (this.owner.theme instanceof DefaultTheme_1.DefaultTheme) {
@@ -7,15 +7,7 @@ import { RendererComponent } from "../components";
7
7
  export declare class JavascriptIndexPlugin extends RendererComponent {
8
8
  private accessor searchComments;
9
9
  private accessor searchDocuments;
10
- /**
11
- * Create a new JavascriptIndexPlugin instance.
12
- */
13
10
  initialize(): void;
14
- /**
15
- * Triggered after a document has been rendered, just before it is written to disc.
16
- *
17
- * @param event An event object describing the current render operation.
18
- */
19
11
  private onRendererBegin;
20
12
  private buildSearchIndex;
21
13
  private getCommentSearchText;
@@ -106,24 +106,13 @@ let JavascriptIndexPlugin = (() => {
106
106
  set searchComments(value) { __classPrivateFieldSet(this, _JavascriptIndexPlugin_searchComments_accessor_storage, value, "f"); }
107
107
  get searchDocuments() { return __classPrivateFieldGet(this, _JavascriptIndexPlugin_searchDocuments_accessor_storage, "f"); }
108
108
  set searchDocuments(value) { __classPrivateFieldSet(this, _JavascriptIndexPlugin_searchDocuments_accessor_storage, value, "f"); }
109
- /**
110
- * Create a new JavascriptIndexPlugin instance.
111
- */
112
109
  initialize() {
113
- this.listenTo(this.owner, events_1.RendererEvent.BEGIN, this.onRendererBegin);
110
+ this.owner.on(events_1.RendererEvent.BEGIN, this.onRendererBegin.bind(this));
114
111
  }
115
- /**
116
- * Triggered after a document has been rendered, just before it is written to disc.
117
- *
118
- * @param event An event object describing the current render operation.
119
- */
120
- onRendererBegin(event) {
112
+ onRendererBegin(_event) {
121
113
  if (!(this.owner.theme instanceof DefaultTheme_1.DefaultTheme)) {
122
114
  return;
123
115
  }
124
- if (event.isDefaultPrevented()) {
125
- return;
126
- }
127
116
  this.owner.preRenderAsyncJobs.push((event) => this.buildSearchIndex(event));
128
117
  }
129
118
  async buildSearchIndex(event) {
@@ -136,11 +125,8 @@ let JavascriptIndexPlugin = (() => {
136
125
  refl.name &&
137
126
  !refl.flags.isExternal);
138
127
  });
139
- const indexEvent = new events_1.IndexEvent(events_1.IndexEvent.PREPARE_INDEX, initialSearchResults);
140
- this.owner.trigger(indexEvent);
141
- if (indexEvent.isDefaultPrevented()) {
142
- return;
143
- }
128
+ const indexEvent = new events_1.IndexEvent(initialSearchResults);
129
+ this.owner.trigger(events_1.IndexEvent.PREPARE_INDEX, indexEvent);
144
130
  const builder = new lunr_1.Builder();
145
131
  builder.pipeline.add(lunr_1.trimmer);
146
132
  builder.ref("id");
@@ -78,15 +78,12 @@ let NavigationPlugin = (() => {
78
78
  let _classSuper = components_1.RendererComponent;
79
79
  var NavigationPlugin = _classThis = class extends _classSuper {
80
80
  initialize() {
81
- this.listenTo(this.owner, events_1.RendererEvent.BEGIN, this.onRendererBegin);
81
+ this.owner.on(events_1.RendererEvent.BEGIN, this.onRendererBegin.bind(this));
82
82
  }
83
- onRendererBegin(event) {
83
+ onRendererBegin(_event) {
84
84
  if (!(this.owner.theme instanceof DefaultTheme_1.DefaultTheme)) {
85
85
  return;
86
86
  }
87
- if (event.isDefaultPrevented()) {
88
- return;
89
- }
90
87
  this.owner.preRenderAsyncJobs.push((event) => this.buildNavigationIndex(event));
91
88
  }
92
89
  async buildNavigationIndex(event) {
@@ -61,13 +61,13 @@ let SitemapPlugin = (() => {
61
61
  return !url || url.endsWith("/") ? url : url + "/";
62
62
  }
63
63
  initialize() {
64
- this.listenTo(this.owner, events_1.RendererEvent.BEGIN, this.onRendererBegin);
64
+ this.owner.on(events_1.RendererEvent.BEGIN, this.onRendererBegin.bind(this));
65
65
  }
66
- onRendererBegin(event) {
66
+ onRendererBegin(_event) {
67
67
  if (!(this.owner.theme instanceof DefaultTheme_1.DefaultTheme)) {
68
68
  return;
69
69
  }
70
- if (event.isDefaultPrevented() || !this.hostedBaseUrl) {
70
+ if (!this.hostedBaseUrl) {
71
71
  return;
72
72
  }
73
73
  this.owner.hooks.on("head.begin", (context) => {
@@ -1,6 +1,6 @@
1
1
  import type { Application } from "../application";
2
2
  import type { Theme } from "./theme";
3
- import { RendererEvent } from "./events";
3
+ import { RendererEvent, PageEvent, IndexEvent, type MarkdownEvent } from "./events";
4
4
  import type { ProjectReflection } from "../models/reflections/project";
5
5
  import { RendererComponent } from "./components";
6
6
  import { ChildableComponent } from "../utils/component";
@@ -77,6 +77,14 @@ export interface RendererHooks {
77
77
  */
78
78
  "comment.afterTags": [DefaultThemeRenderContext, Comment, Reflection];
79
79
  }
80
+ export interface RendererEvents {
81
+ beginRender: [RendererEvent];
82
+ beginPage: [PageEvent<Reflection>];
83
+ endPage: [PageEvent<Reflection>];
84
+ endRender: [RendererEvent];
85
+ parseMarkdown: [MarkdownEvent];
86
+ prepareIndex: [IndexEvent];
87
+ }
80
88
  /**
81
89
  * The renderer processes a {@link ProjectReflection} using a {@link Theme} instance and writes
82
90
  * the emitted html documents to a output directory. You can specify which theme should be used
@@ -88,8 +96,7 @@ export interface RendererHooks {
88
96
  *
89
97
  * * {@link Renderer.EVENT_BEGIN}<br>
90
98
  * Triggered before the renderer starts rendering a project. The listener receives
91
- * an instance of {@link RendererEvent}. By calling {@link RendererEvent.preventDefault} the entire
92
- * render process can be canceled.
99
+ * an instance of {@link RendererEvent}.
93
100
  *
94
101
  * * {@link Renderer.EVENT_BEGIN_PAGE}<br>
95
102
  * Triggered before a document will be rendered. The listener receives an instance of
@@ -111,7 +118,7 @@ export interface RendererHooks {
111
118
  *
112
119
  * @document ../../../internal-docs/custom-themes.md
113
120
  */
114
- export declare class Renderer extends ChildableComponent<Application, RendererComponent> {
121
+ export declare class Renderer extends ChildableComponent<Application, RendererComponent, RendererEvents> {
115
122
  private themes;
116
123
  /** @event */
117
124
  static readonly EVENT_BEGIN_PAGE = "beginPage";
@@ -104,8 +104,7 @@ const jsx_1 = require("../utils/jsx");
104
104
  *
105
105
  * * {@link Renderer.EVENT_BEGIN}<br>
106
106
  * Triggered before the renderer starts rendering a project. The listener receives
107
- * an instance of {@link RendererEvent}. By calling {@link RendererEvent.preventDefault} the entire
108
- * render process can be canceled.
107
+ * an instance of {@link RendererEvent}.
109
108
  *
110
109
  * * {@link Renderer.EVENT_BEGIN_PAGE}<br>
111
110
  * Triggered before a document will be rendered. The listener receives an instance of
@@ -254,20 +253,18 @@ let Renderer = (() => {
254
253
  !(await this.prepareOutputDirectory(outputDirectory))) {
255
254
  return;
256
255
  }
257
- const output = new events_1.RendererEvent(events_1.RendererEvent.BEGIN, outputDirectory, project);
256
+ const output = new events_1.RendererEvent(outputDirectory, project);
258
257
  output.urls = this.theme.getUrls(project);
259
- this.trigger(output);
258
+ this.trigger(events_1.RendererEvent.BEGIN, output);
260
259
  await this.runPreRenderJobs(output);
261
- if (!output.isDefaultPrevented()) {
262
- this.application.logger.verbose(`There are ${output.urls.length} pages to write.`);
263
- output.urls.forEach((mapping) => {
264
- this.renderDocument(...output.createPageEvent(mapping));
265
- (0, type_1.validateStateIsClean)(mapping.url);
266
- });
267
- await Promise.all(this.postRenderAsyncJobs.map((job) => job(output)));
268
- this.postRenderAsyncJobs = [];
269
- this.trigger(events_1.RendererEvent.END, output);
270
- }
260
+ this.application.logger.verbose(`There are ${output.urls.length} pages to write.`);
261
+ output.urls.forEach((mapping) => {
262
+ this.renderDocument(...output.createPageEvent(mapping));
263
+ (0, type_1.validateStateIsClean)(mapping.url);
264
+ });
265
+ await Promise.all(this.postRenderAsyncJobs.map((job) => job(output)));
266
+ this.postRenderAsyncJobs = [];
267
+ this.trigger(events_1.RendererEvent.END, output);
271
268
  this.theme = void 0;
272
269
  this.hooks.restoreMomento(momento);
273
270
  }
@@ -292,10 +289,6 @@ let Renderer = (() => {
292
289
  renderDocument(template, page) {
293
290
  const momento = this.hooks.saveMomento();
294
291
  this.trigger(events_1.PageEvent.BEGIN, page);
295
- if (page.isDefaultPrevented()) {
296
- this.hooks.restoreMomento(momento);
297
- return false;
298
- }
299
292
  if (page.model instanceof models_1.Reflection) {
300
293
  page.contents = this.theme.render(page, template);
301
294
  }
@@ -304,9 +297,6 @@ let Renderer = (() => {
304
297
  }
305
298
  this.trigger(events_1.PageEvent.END, page);
306
299
  this.hooks.restoreMomento(momento);
307
- if (page.isDefaultPrevented()) {
308
- return false;
309
- }
310
300
  try {
311
301
  (0, fs_1.writeFileSync)(page.filename, page.contents);
312
302
  }
@@ -115,7 +115,7 @@ let MarkedPlugin = (() => {
115
115
  */
116
116
  initialize() {
117
117
  super.initialize();
118
- this.listenTo(this.owner, events_1.MarkdownEvent.PARSE, this.onParseMarkdown);
118
+ this.owner.on(events_1.MarkdownEvent.PARSE, this.onParseMarkdown.bind(this));
119
119
  }
120
120
  /**
121
121
  * Highlight the syntax of the given text using HighlightJS.
@@ -149,8 +149,8 @@ let MarkedPlugin = (() => {
149
149
  markdown = this.displayPartsToMarkdown(page, context, markdown);
150
150
  }
151
151
  this.renderContext = context;
152
- const event = new events_1.MarkdownEvent(events_1.MarkdownEvent.PARSE, page, markdown, markdown);
153
- this.owner.trigger(event);
152
+ const event = new events_1.MarkdownEvent(page, markdown, markdown);
153
+ this.owner.trigger(events_1.MarkdownEvent.PARSE, event);
154
154
  this.renderContext = null;
155
155
  return event.parsedText;
156
156
  }
@@ -40,7 +40,6 @@ export declare class DefaultThemeRenderContext {
40
40
  * by their type declaration, which is already rendered by {@link DefaultThemeRenderContext.memberDeclaration}
41
41
  */
42
42
  reflectionPreview: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
43
- analytics: () => import("../../../utils/jsx.elements").JsxElement | undefined;
44
43
  breadcrumb: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
45
44
  commentSummary: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
46
45
  commentTags: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DefaultThemeRenderContext = void 0;
4
4
  const default_1 = require("./layouts/default");
5
5
  const partials_1 = require("./partials");
6
- const analytics_1 = require("./partials/analytics");
7
6
  const breadcrumb_1 = require("./partials/breadcrumb");
8
7
  const comment_1 = require("./partials/comment");
9
8
  const footer_1 = require("./partials/footer");
@@ -71,7 +70,6 @@ class DefaultThemeRenderContext {
71
70
  * by their type declaration, which is already rendered by {@link DefaultThemeRenderContext.memberDeclaration}
72
71
  */
73
72
  this.reflectionPreview = bind(reflectionPreview_1.reflectionPreview, this);
74
- this.analytics = bind(analytics_1.analytics, this);
75
73
  this.breadcrumb = bind(breadcrumb_1.breadcrumb, this);
76
74
  this.commentSummary = bind(comment_1.commentSummary, this);
77
75
  this.commentTags = bind(comment_1.commentTags, this);
@@ -45,6 +45,5 @@ const defaultLayout = (context, template, props) => (utils_1.JSX.createElement("
45
45
  context.hook("sidebar.end", context)))),
46
46
  context.footer(),
47
47
  utils_1.JSX.createElement("div", { class: "overlay" }),
48
- context.analytics(),
49
48
  context.hook("body.end", context))));
50
49
  exports.defaultLayout = defaultLayout;
@@ -6,6 +6,7 @@ exports.reflectionFlags = reflectionFlags;
6
6
  const utils_1 = require("../../../../utils");
7
7
  const models_1 = require("../../../../models");
8
8
  const anchor_icon_1 = require("./anchor-icon");
9
+ const lib_1 = require("../../lib");
9
10
  // Note: Comment modifiers are handled in `renderFlags`
10
11
  function commentSummary({ markdown }, props) {
11
12
  if (!props.comment?.summary.some((part) => part.text))
@@ -47,7 +48,5 @@ function reflectionFlags(context, props) {
47
48
  }
48
49
  }
49
50
  }
50
- return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null, allFlags.map((item) => (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
51
- utils_1.JSX.createElement("code", { class: "tsd-tag ts-flag" + item }, item),
52
- " ")))));
51
+ return (0, lib_1.join)(" ", allFlags, (item) => utils_1.JSX.createElement("code", { class: "tsd-tag" }, item));
53
52
  }
@@ -78,7 +78,7 @@ const navigation = function navigation(context, props) {
78
78
  context.icons[models_1.ReflectionKind.Project](),
79
79
  utils_1.JSX.createElement("span", null, (0, lib_1.getDisplayName)(props.project))),
80
80
  utils_1.JSX.createElement("ul", { class: "tsd-small-nested-navigation", id: "tsd-nav-container", "data-base": context.relativeURL("./") },
81
- utils_1.JSX.createElement("li", null, "Loading..."))));
81
+ utils_1.JSX.createElement("li", null, context.i18n.theme_loading()))));
82
82
  };
83
83
  exports.navigation = navigation;
84
84
  function pageSidebar(context, props) {
@@ -25,6 +25,6 @@ function fullHierarchy(context, root, seen = new Set()) {
25
25
  }
26
26
  function hierarchyTemplate(context, props) {
27
27
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
28
- utils_1.JSX.createElement("h2", null, "Class Hierarchy"),
28
+ utils_1.JSX.createElement("h2", null, context.i18n.theme_class_hierarchy_title()),
29
29
  (0, lib_1.getHierarchyRoots)(props.project).map((root) => (utils_1.JSX.createElement("ul", { class: "tsd-full-hierarchy" }, fullHierarchy(context, root))))));
30
30
  }