typedoc 0.24.6 → 0.24.8
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.
- package/dist/lib/application.d.ts +9 -0
- package/dist/lib/application.js +20 -8
- package/dist/lib/converter/comments/blockLexer.js +1 -1
- package/dist/lib/converter/comments/lexer.js +1 -1
- package/dist/lib/converter/comments/lineLexer.js +1 -1
- package/dist/lib/converter/comments/rawLexer.js +1 -1
- package/dist/lib/converter/converter.js +2 -3
- package/dist/lib/converter/plugins/CategoryPlugin.d.ts +1 -0
- package/dist/lib/converter/plugins/CategoryPlugin.js +17 -22
- package/dist/lib/converter/plugins/CommentPlugin.js +8 -5
- package/dist/lib/converter/plugins/GroupPlugin.js +2 -3
- package/dist/lib/converter/plugins/ImplementsPlugin.js +2 -3
- package/dist/lib/converter/plugins/InheritDocPlugin.js +2 -3
- package/dist/lib/converter/plugins/LinkResolverPlugin.js +2 -3
- package/dist/lib/converter/plugins/PackagePlugin.js +4 -4
- package/dist/lib/converter/plugins/SourcePlugin.js +2 -3
- package/dist/lib/converter/plugins/TypePlugin.js +2 -3
- package/dist/lib/models/reflections/abstract.js +3 -3
- package/dist/lib/models/reflections/declaration.js +1 -1
- package/dist/lib/models/reflections/kind.js +2 -2
- package/dist/lib/output/events.d.ts +6 -0
- package/dist/lib/output/events.js +10 -4
- package/dist/lib/output/plugins/AssetsPlugin.js +2 -3
- package/dist/lib/output/plugins/JavascriptIndexPlugin.js +2 -3
- package/dist/lib/output/renderer.d.ts +2 -0
- package/dist/lib/output/renderer.js +7 -3
- package/dist/lib/output/theme.js +2 -3
- package/dist/lib/output/themes/MarkedPlugin.js +5 -4
- package/dist/lib/output/themes/default/DefaultTheme.js +1 -1
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +3 -0
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +3 -0
- package/dist/lib/output/themes/default/partials/comment.d.ts +2 -0
- package/dist/lib/output/themes/default/partials/comment.js +20 -2
- package/dist/lib/output/themes/default/partials/icon.js +8 -9
- package/dist/lib/output/themes/default/partials/index.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/index.js +0 -6
- package/dist/lib/output/themes/default/partials/member.declaration.d.ts +2 -2
- package/dist/lib/output/themes/default/partials/member.declaration.js +34 -21
- package/dist/lib/output/themes/default/partials/member.signature.body.js +4 -2
- package/dist/lib/output/themes/default/partials/navigation.js +2 -2
- package/dist/lib/output/themes/default/partials/parameter.js +8 -4
- package/dist/lib/output/themes/default/partials/typeParameters.js +2 -1
- package/dist/lib/output/themes/default/templates/reflection.js +9 -2
- package/dist/lib/serialization/serializer.js +1 -1
- package/dist/lib/utils/component.d.ts +1 -1
- package/dist/lib/utils/component.js +1 -1
- package/dist/lib/utils/entry-point.d.ts +1 -1
- package/dist/lib/utils/entry-point.js +7 -2
- package/dist/lib/utils/jsx.d.ts +3 -0
- package/dist/lib/utils/jsx.js +7 -2
- package/dist/lib/utils/loggers.js +1 -1
- package/dist/lib/utils/options/declaration.d.ts +1 -0
- package/dist/lib/utils/options/declaration.js +2 -2
- package/dist/lib/utils/options/options.d.ts +5 -1
- package/dist/lib/utils/options/options.js +2 -1
- package/dist/lib/utils/options/sources/typedoc.js +1 -0
- package/package.json +3 -3
- package/static/main.js +1 -1
- package/static/style.css +6 -4
package/dist/lib/output/theme.js
CHANGED
|
@@ -17,7 +17,7 @@ const component_1 = require("../utils/component");
|
|
|
17
17
|
* and templates to use. Additionally themes can subscribe to the events emitted by
|
|
18
18
|
* {@link Renderer} to control and manipulate the output process.
|
|
19
19
|
*/
|
|
20
|
-
let Theme = class Theme extends components_1.RendererComponent {
|
|
20
|
+
let Theme = exports.Theme = class Theme extends components_1.RendererComponent {
|
|
21
21
|
/**
|
|
22
22
|
* Create a new BaseTheme instance.
|
|
23
23
|
*
|
|
@@ -27,7 +27,6 @@ let Theme = class Theme extends components_1.RendererComponent {
|
|
|
27
27
|
super(renderer);
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
Theme = __decorate([
|
|
30
|
+
exports.Theme = Theme = __decorate([
|
|
31
31
|
(0, component_1.Component)({ name: "theme", internal: true })
|
|
32
32
|
], Theme);
|
|
33
|
-
exports.Theme = Theme;
|
|
@@ -42,7 +42,7 @@ const html_1 = require("../../utils/html");
|
|
|
42
42
|
* Implements markdown and relativeURL helpers for templates.
|
|
43
43
|
* @internal
|
|
44
44
|
*/
|
|
45
|
-
let MarkedPlugin = class MarkedPlugin extends components_1.ContextAwareRendererComponent {
|
|
45
|
+
let MarkedPlugin = exports.MarkedPlugin = class MarkedPlugin extends components_1.ContextAwareRendererComponent {
|
|
46
46
|
constructor() {
|
|
47
47
|
super(...arguments);
|
|
48
48
|
/**
|
|
@@ -96,7 +96,9 @@ output file :
|
|
|
96
96
|
path = Path.join(this.includes, path.trim());
|
|
97
97
|
if ((0, utils_1.isFile)(path)) {
|
|
98
98
|
const contents = (0, utils_1.readFile)(path);
|
|
99
|
-
|
|
99
|
+
const event = new events_1.MarkdownEvent(events_1.MarkdownEvent.INCLUDE, page, contents, contents);
|
|
100
|
+
this.owner.trigger(event);
|
|
101
|
+
return event.parsedText;
|
|
100
102
|
}
|
|
101
103
|
else {
|
|
102
104
|
this.application.logger.warn("Could not find file to include: " + path);
|
|
@@ -199,10 +201,9 @@ __decorate([
|
|
|
199
201
|
__decorate([
|
|
200
202
|
(0, utils_1.BindOption)("darkHighlightTheme")
|
|
201
203
|
], MarkedPlugin.prototype, "darkTheme", void 0);
|
|
202
|
-
MarkedPlugin = __decorate([
|
|
204
|
+
exports.MarkedPlugin = MarkedPlugin = __decorate([
|
|
203
205
|
(0, components_1.Component)({ name: "marked" })
|
|
204
206
|
], MarkedPlugin);
|
|
205
|
-
exports.MarkedPlugin = MarkedPlugin;
|
|
206
207
|
// Basically a copy/paste of Marked's code, with the addition of the button
|
|
207
208
|
// https://github.com/markedjs/marked/blob/v4.3.0/src/Renderer.js#L15-L39
|
|
208
209
|
function renderCode(code, infostring, escaped) {
|
|
@@ -190,8 +190,8 @@ class DefaultTheme extends theme_1.Theme {
|
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
DefaultTheme.URL_PREFIX = /^(http|ftp)s?:\/\//;
|
|
194
193
|
exports.DefaultTheme = DefaultTheme;
|
|
194
|
+
DefaultTheme.URL_PREFIX = /^(http|ftp)s?:\/\//;
|
|
195
195
|
function hasReadme(readme) {
|
|
196
196
|
return !readme.endsWith("none");
|
|
197
197
|
}
|
|
@@ -25,7 +25,10 @@ export declare class DefaultThemeRenderContext {
|
|
|
25
25
|
defaultLayout: (template: import("../..").RenderTemplate<PageEvent<Reflection>>, props: PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
26
26
|
analytics: () => import("../../../utils/jsx.elements").JsxElement | undefined;
|
|
27
27
|
breadcrumb: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
|
|
28
|
+
/** @deprecated will be removed in 0.25 */
|
|
28
29
|
comment: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
|
|
30
|
+
commentSummary: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
|
|
31
|
+
commentTags: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
|
|
29
32
|
footer: () => import("../../../utils/jsx.elements").JsxElement | undefined;
|
|
30
33
|
header: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
31
34
|
hierarchy: (props: import("../../../models").DeclarationHierarchy | undefined) => import("../../../utils/jsx.elements").JsxElement | undefined;
|
|
@@ -69,7 +69,10 @@ class DefaultThemeRenderContext {
|
|
|
69
69
|
this.defaultLayout = bind(default_1.defaultLayout, this);
|
|
70
70
|
this.analytics = bind(analytics_1.analytics, this);
|
|
71
71
|
this.breadcrumb = bind(breadcrumb_1.breadcrumb, this);
|
|
72
|
+
/** @deprecated will be removed in 0.25 */
|
|
72
73
|
this.comment = bind(comment_1.comment, this);
|
|
74
|
+
this.commentSummary = bind(comment_1.commentSummary, this);
|
|
75
|
+
this.commentTags = bind(comment_1.commentTags, this);
|
|
73
76
|
this.footer = bind(footer_1.footer, this);
|
|
74
77
|
this.header = bind(header_1.header, this);
|
|
75
78
|
this.hierarchy = bind(hierarchy_1.hierarchy, this);
|
|
@@ -2,3 +2,5 @@ import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
|
|
|
2
2
|
import { JSX } from "../../../../utils";
|
|
3
3
|
import { Reflection } from "../../../../models";
|
|
4
4
|
export declare function comment({ markdown }: DefaultThemeRenderContext, props: Reflection): JSX.Element | undefined;
|
|
5
|
+
export declare function commentSummary({ markdown }: DefaultThemeRenderContext, props: Reflection): JSX.Element | undefined;
|
|
6
|
+
export declare function commentTags({ markdown }: DefaultThemeRenderContext, props: Reflection): JSX.Element | undefined;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.comment = void 0;
|
|
3
|
+
exports.commentTags = exports.commentSummary = exports.comment = void 0;
|
|
4
4
|
const utils_1 = require("../../../../utils");
|
|
5
5
|
const models_1 = require("../../../../models");
|
|
6
6
|
const lib_1 = require("../../lib");
|
|
7
|
+
// Note: Comment modifiers are handled in `renderFlags`
|
|
7
8
|
function comment({ markdown }, props) {
|
|
8
9
|
if (!props.comment?.hasVisibleComponent())
|
|
9
10
|
return;
|
|
10
|
-
// Note: Comment modifiers are handled in `renderFlags`
|
|
11
11
|
const tags = props.kindOf(models_1.ReflectionKind.SomeSignature)
|
|
12
12
|
? props.comment.blockTags.filter((tag) => tag.tag !== "@returns")
|
|
13
13
|
: props.comment.blockTags;
|
|
@@ -18,3 +18,21 @@ function comment({ markdown }, props) {
|
|
|
18
18
|
utils_1.JSX.createElement(utils_1.Raw, { html: markdown(item.content) }))))));
|
|
19
19
|
}
|
|
20
20
|
exports.comment = comment;
|
|
21
|
+
function commentSummary({ markdown }, props) {
|
|
22
|
+
if (!props.comment?.summary.some((part) => part.text))
|
|
23
|
+
return;
|
|
24
|
+
return (utils_1.JSX.createElement("div", { class: "tsd-comment tsd-typography" },
|
|
25
|
+
utils_1.JSX.createElement(utils_1.Raw, { html: markdown(props.comment.summary) })));
|
|
26
|
+
}
|
|
27
|
+
exports.commentSummary = commentSummary;
|
|
28
|
+
function commentTags({ markdown }, props) {
|
|
29
|
+
if (!props.comment)
|
|
30
|
+
return;
|
|
31
|
+
const tags = props.kindOf(models_1.ReflectionKind.SomeSignature)
|
|
32
|
+
? props.comment.blockTags.filter((tag) => tag.tag !== "@returns")
|
|
33
|
+
: props.comment.blockTags;
|
|
34
|
+
return (utils_1.JSX.createElement("div", { class: "tsd-comment tsd-typography" }, tags.map((item) => (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
35
|
+
utils_1.JSX.createElement("h4", null, (0, lib_1.camelToTitleCase)(item.tag.substring(1))),
|
|
36
|
+
utils_1.JSX.createElement(utils_1.Raw, { html: markdown(item.content) }))))));
|
|
37
|
+
}
|
|
38
|
+
exports.commentTags = commentTags;
|
|
@@ -21,9 +21,9 @@ function cachedPart(key, svgPart) {
|
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
const kindIcon = (kind, letterPath, color, circular = false) => (utils_1.JSX.createElement("svg", { class: "tsd-kind-icon",
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
const kindIcon = (kind, letterPath, color, circular = false) => (utils_1.JSX.createElement("svg", { class: "tsd-kind-icon", viewBox: "0 0 24 24" }, cachedPart(`${kind}`, utils_1.JSX.createElement("g", null,
|
|
25
|
+
utils_1.JSX.createElement("rect", { fill: "var(--color-icon-background)", stroke: color, "stroke-width": "1.5", x: "1", y: "1", width: "22", height: "22", rx: circular ? "12" : "6" }),
|
|
26
|
+
letterPath))));
|
|
27
27
|
exports.icons = {
|
|
28
28
|
[models_1.ReflectionKind.Accessor]: () => kindIcon(models_1.ReflectionKind.Accessor, utils_1.JSX.createElement("path", { d: "M8.85 16L11.13 7.24H12.582L14.85 16H13.758L13.182 13.672H10.53L9.954 16H8.85ZM10.746 12.76H12.954L12.282 10.06C12.154 9.548 12.054 9.12 11.982 8.776C11.91 8.432 11.866 8.208 11.85 8.104C11.834 8.208 11.79 8.432 11.718 8.776C11.646 9.12 11.546 9.544 11.418 10.048L10.746 12.76Z", fill: "var(--color-text)" }), "#FF4D4D", true),
|
|
29
29
|
[models_1.ReflectionKind.CallSignature]() {
|
|
@@ -74,8 +74,7 @@ exports.icons = {
|
|
|
74
74
|
return this[models_1.ReflectionKind.TypeAlias]();
|
|
75
75
|
},
|
|
76
76
|
[models_1.ReflectionKind.Variable]: () => kindIcon(models_1.ReflectionKind.Variable, utils_1.JSX.createElement("path", { d: "M11.106 16L8.85 7.24H9.966L11.454 13.192C11.558 13.608 11.646 13.996 11.718 14.356C11.79 14.708 11.842 14.976 11.874 15.16C11.906 14.976 11.954 14.708 12.018 14.356C12.09 13.996 12.178 13.608 12.282 13.192L13.758 7.24H14.85L12.582 16H11.106Z", fill: "var(--color-text)" }), "var(--color-ts-variable)"),
|
|
77
|
-
chevronDown: () => (utils_1.JSX.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none" },
|
|
78
|
-
utils_1.JSX.createElement("path", { d: "M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z", fill: "var(--color-text)" }))),
|
|
77
|
+
chevronDown: () => (utils_1.JSX.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none" }, cachedPart("chevronDown", utils_1.JSX.createElement("path", { d: "M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z", fill: "var(--color-text)" })))),
|
|
79
78
|
chevronSmall: () => (utils_1.JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
|
|
80
79
|
utils_1.JSX.createElement("path", { d: "M1.5 5.50969L8 11.6609L14.5 5.50969L12.5466 3.66086L8 7.96494L3.45341 3.66086L1.5 5.50969Z", fill: "var(--color-text)" }))),
|
|
81
80
|
checkbox: () => (utils_1.JSX.createElement("svg", { width: "32", height: "32", viewBox: "0 0 32 32", "aria-hidden": "true" },
|
|
@@ -84,8 +83,8 @@ exports.icons = {
|
|
|
84
83
|
menu: () => (utils_1.JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, ["3", "7", "11"].map((y) => (utils_1.JSX.createElement("rect", { x: "1", y: y, width: "14", height: "2", fill: "var(--color-text)" }))))),
|
|
85
84
|
search: () => (utils_1.JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
|
|
86
85
|
utils_1.JSX.createElement("path", { d: "M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z", fill: "var(--color-text)" }))),
|
|
87
|
-
anchor: () => (utils_1.JSX.createElement("svg", {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
anchor: () => (utils_1.JSX.createElement("svg", { viewBox: "0 0 24 24" }, cachedPart("anchor", utils_1.JSX.createElement("g", { "stroke-width": "2", stroke: "currentColor", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round" },
|
|
87
|
+
utils_1.JSX.createElement("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
|
|
88
|
+
utils_1.JSX.createElement("path", { d: "M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5" }),
|
|
89
|
+
utils_1.JSX.createElement("path", { d: "M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5" }))))),
|
|
91
90
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
|
|
2
2
|
import { JSX } from "../../../../utils";
|
|
3
|
-
import { ContainerReflection } from "../../../../models";
|
|
3
|
+
import type { ContainerReflection } from "../../../../models";
|
|
4
4
|
export declare function index(context: DefaultThemeRenderContext, props: ContainerReflection): JSX.Element;
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.index = void 0;
|
|
4
4
|
const lib_1 = require("../../lib");
|
|
5
5
|
const utils_1 = require("../../../../utils");
|
|
6
|
-
const models_1 = require("../../../../models");
|
|
7
6
|
function renderCategory({ urlTo, icons, getReflectionClasses }, item, prependName = "") {
|
|
8
7
|
return (utils_1.JSX.createElement("section", { class: "tsd-index-section" },
|
|
9
8
|
utils_1.JSX.createElement("h3", { class: "tsd-index-heading" }, prependName ? `${prependName} - ${item.title}` : item.title),
|
|
@@ -38,11 +37,6 @@ function index(context, props) {
|
|
|
38
37
|
content));
|
|
39
38
|
}
|
|
40
39
|
return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
41
|
-
props instanceof models_1.DeclarationReflection &&
|
|
42
|
-
props.kind === models_1.ReflectionKind.Module &&
|
|
43
|
-
props.readme?.length !== 0 && (utils_1.JSX.createElement("section", { class: "tsd-panel-group" },
|
|
44
|
-
utils_1.JSX.createElement("section", { class: "tsd-panel tsd-typography" },
|
|
45
|
-
utils_1.JSX.createElement(utils_1.Raw, { html: context.markdown(props.readme || []) })))),
|
|
46
40
|
utils_1.JSX.createElement("section", { class: "tsd-panel-group tsd-index-group" },
|
|
47
41
|
utils_1.JSX.createElement("section", { class: "tsd-panel tsd-index-panel" }, content))));
|
|
48
42
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DeclarationReflection } from "../../../../models";
|
|
1
|
+
import type { DeclarationReflection } from "../../../../models";
|
|
2
2
|
import { JSX } from "../../../../utils";
|
|
3
3
|
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
|
|
4
|
-
export declare
|
|
4
|
+
export declare function memberDeclaration(context: DefaultThemeRenderContext, props: DeclarationReflection): JSX.Element;
|
|
@@ -1,27 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.memberDeclaration = void 0;
|
|
4
|
-
const models_1 = require("../../../../models");
|
|
5
4
|
const utils_1 = require("../../../../utils");
|
|
6
5
|
const lib_1 = require("../../lib");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
utils_1.JSX.createElement("
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
utils_1.JSX.createElement(
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
6
|
+
function memberDeclaration(context, props) {
|
|
7
|
+
function renderTypeDeclaration(type) {
|
|
8
|
+
return (utils_1.JSX.createElement("div", { class: "tsd-type-declaration" },
|
|
9
|
+
utils_1.JSX.createElement("h4", null, "Type declaration"),
|
|
10
|
+
context.parameter(type.declaration)));
|
|
11
|
+
}
|
|
12
|
+
const visitor = { reflection: renderTypeDeclaration };
|
|
13
|
+
return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
14
|
+
utils_1.JSX.createElement("div", { class: "tsd-signature" },
|
|
15
|
+
utils_1.JSX.createElement("span", { class: (0, lib_1.getKindClass)(props) }, (0, lib_1.wbr)(props.name)),
|
|
16
|
+
(0, lib_1.renderTypeParametersSignature)(context, props.typeParameters),
|
|
17
|
+
props.type && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
18
|
+
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" },
|
|
19
|
+
!!props.flags.isOptional && "?",
|
|
20
|
+
":"),
|
|
21
|
+
" ",
|
|
22
|
+
context.type(props.type))),
|
|
23
|
+
!!props.defaultValue && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
24
|
+
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" },
|
|
25
|
+
" = ",
|
|
26
|
+
props.defaultValue)))),
|
|
27
|
+
context.commentSummary(props),
|
|
28
|
+
(0, lib_1.hasTypeParameters)(props) && context.typeParameters(props.typeParameters),
|
|
29
|
+
props.type?.visit({
|
|
30
|
+
reflection: renderTypeDeclaration,
|
|
31
|
+
array: (arr) => arr.elementType.visit(visitor),
|
|
32
|
+
intersection: (int) => int.types.map((t) => t.visit(visitor)),
|
|
33
|
+
union: (union) => union.types.map((t) => t.visit(visitor)),
|
|
34
|
+
reference: (ref) => ref.typeArguments?.map((t) => t.visit(visitor)),
|
|
35
|
+
tuple: (ref) => ref.elements.map((t) => t.visit(visitor)),
|
|
36
|
+
}),
|
|
37
|
+
context.commentTags(props),
|
|
38
|
+
context.memberSources(props)));
|
|
39
|
+
}
|
|
27
40
|
exports.memberDeclaration = memberDeclaration;
|
|
@@ -8,7 +8,7 @@ function memberSignatureBody(context, props, { hideSources = false } = {}) {
|
|
|
8
8
|
const returnsTag = props.comment?.getTag("@returns");
|
|
9
9
|
return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
10
10
|
(0, lib_1.renderFlags)(props.flags, props.comment),
|
|
11
|
-
context.
|
|
11
|
+
context.commentSummary(props),
|
|
12
12
|
(0, lib_1.hasTypeParameters)(props) && context.typeParameters(props.typeParameters),
|
|
13
13
|
props.parameters && props.parameters.length > 0 && (utils_1.JSX.createElement("div", { class: "tsd-parameters" },
|
|
14
14
|
utils_1.JSX.createElement("h4", { class: "tsd-parameters-title" }, "Parameters"),
|
|
@@ -22,7 +22,8 @@ function memberSignatureBody(context, props, { hideSources = false } = {}) {
|
|
|
22
22
|
item.defaultValue != null && (utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" },
|
|
23
23
|
" = ",
|
|
24
24
|
item.defaultValue))),
|
|
25
|
-
context.
|
|
25
|
+
context.commentSummary(item),
|
|
26
|
+
context.commentTags(item),
|
|
26
27
|
item.type instanceof models_1.ReflectionType && context.parameter(item.type.declaration))))))),
|
|
27
28
|
props.type && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
28
29
|
utils_1.JSX.createElement("h4", { class: "tsd-returns-title" },
|
|
@@ -30,6 +31,7 @@ function memberSignatureBody(context, props, { hideSources = false } = {}) {
|
|
|
30
31
|
context.type(props.type)),
|
|
31
32
|
returnsTag && utils_1.JSX.createElement(utils_1.Raw, { html: context.markdown(returnsTag.content) }),
|
|
32
33
|
props.type instanceof models_1.ReflectionType && context.parameter(props.type.declaration))),
|
|
34
|
+
context.commentTags(props),
|
|
33
35
|
!hideSources && context.memberSources(props)));
|
|
34
36
|
}
|
|
35
37
|
exports.memberSignatureBody = memberSignatureBody;
|
|
@@ -91,9 +91,9 @@ function navigation(context, props) {
|
|
|
91
91
|
createNavElement(props.project),
|
|
92
92
|
utils_1.JSX.createElement("ul", { class: "tsd-small-nested-navigation" }, getNavigationElements(props.project, opts).map((c) => (utils_1.JSX.createElement("li", null, links(c, [])))))));
|
|
93
93
|
function links(mod, parents) {
|
|
94
|
-
const nameClasses = (0, lib_1.classNames)({ deprecated: mod instanceof models_1.Reflection && mod.isDeprecated() },
|
|
94
|
+
const nameClasses = (0, lib_1.classNames)({ deprecated: mod instanceof models_1.Reflection && mod.isDeprecated() }, mod instanceof models_1.DeclarationReflection ? context.getReflectionClasses(mod) : void 0);
|
|
95
95
|
const children = getNavigationElements(mod, opts);
|
|
96
|
-
if (!children.length) {
|
|
96
|
+
if (!children.length || (!opts.fullTree && mod instanceof models_1.Reflection && !inPath(mod))) {
|
|
97
97
|
return createNavElement(mod, nameClasses);
|
|
98
98
|
}
|
|
99
99
|
return (utils_1.JSX.createElement("details", { class: (0, lib_1.classNames)({ "tsd-index-accordion": true }, nameClasses), open: mod instanceof models_1.Reflection && inPath(mod), "data-key": mod instanceof models_1.Reflection ? mod.getFullName() : [...parents, mod.title].join("$") },
|
|
@@ -25,7 +25,8 @@ const parameter = (context, props) => (utils_1.JSX.createElement(utils_1.JSX.Fra
|
|
|
25
25
|
context.type(item.type)))),
|
|
26
26
|
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "]: "),
|
|
27
27
|
context.type(props.indexSignature.type)),
|
|
28
|
-
context.
|
|
28
|
+
context.commentSummary(props.indexSignature),
|
|
29
|
+
context.commentTags(props.indexSignature),
|
|
29
30
|
props.indexSignature.type instanceof models_1.ReflectionType &&
|
|
30
31
|
context.parameter(props.indexSignature.type.declaration)))),
|
|
31
32
|
props.children?.map((item) => (utils_1.JSX.createElement(utils_1.JSX.Fragment, null, item.signatures ? (utils_1.JSX.createElement("li", { class: "tsd-parameter" },
|
|
@@ -46,7 +47,8 @@ const parameter = (context, props) => (utils_1.JSX.createElement(utils_1.JSX.Fra
|
|
|
46
47
|
!!item.flags.isOptional && "?",
|
|
47
48
|
": "),
|
|
48
49
|
context.type(item.type)),
|
|
49
|
-
context.
|
|
50
|
+
context.commentSummary(item),
|
|
51
|
+
context.commentTags(item),
|
|
50
52
|
!!item.children && context.parameter(item),
|
|
51
53
|
item.type instanceof models_1.ReflectionType && context.parameter(item.type.declaration)))) : (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
52
54
|
item.getSignature && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
@@ -57,7 +59,8 @@ const parameter = (context, props) => (utils_1.JSX.createElement(utils_1.JSX.Fra
|
|
|
57
59
|
utils_1.JSX.createElement("span", { class: (0, lib_1.getKindClass)(item) }, (0, lib_1.wbr)(item.name)),
|
|
58
60
|
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "(): "),
|
|
59
61
|
context.type(item.getSignature.type)),
|
|
60
|
-
context.
|
|
62
|
+
context.commentSummary(item.getSignature),
|
|
63
|
+
context.commentTags(item.getSignature)))),
|
|
61
64
|
item.setSignature && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
62
65
|
utils_1.JSX.createElement("li", { class: "tsd-parameter" },
|
|
63
66
|
utils_1.JSX.createElement("h5", null,
|
|
@@ -71,5 +74,6 @@ const parameter = (context, props) => (utils_1.JSX.createElement(utils_1.JSX.Fra
|
|
|
71
74
|
context.type(item.type)))),
|
|
72
75
|
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "): "),
|
|
73
76
|
context.type(item.setSignature.type)),
|
|
74
|
-
context.
|
|
77
|
+
context.commentSummary(item.setSignature),
|
|
78
|
+
context.commentTags(item.setSignature))))))))))));
|
|
75
79
|
exports.parameter = parameter;
|
|
@@ -17,6 +17,7 @@ function typeParameters(context, typeParameters) {
|
|
|
17
17
|
!!item.default && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
18
18
|
" = ",
|
|
19
19
|
context.type(item.default)))),
|
|
20
|
-
context.
|
|
20
|
+
context.commentSummary(item),
|
|
21
|
+
context.commentTags(item))))))));
|
|
21
22
|
}
|
|
22
23
|
exports.typeParameters = typeParameters;
|
|
@@ -10,7 +10,13 @@ function reflectionTemplate(context, props) {
|
|
|
10
10
|
return context.memberDeclaration(props.model);
|
|
11
11
|
}
|
|
12
12
|
return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
13
|
-
props.model.hasComment() && (utils_1.JSX.createElement("section", { class: "tsd-panel tsd-comment" },
|
|
13
|
+
props.model.hasComment() && (utils_1.JSX.createElement("section", { class: "tsd-panel tsd-comment" },
|
|
14
|
+
context.commentSummary(props.model),
|
|
15
|
+
context.commentTags(props.model))),
|
|
16
|
+
props.model instanceof models_1.DeclarationReflection &&
|
|
17
|
+
props.model.kind === models_1.ReflectionKind.Module &&
|
|
18
|
+
props.model.readme?.length && (utils_1.JSX.createElement("section", { class: "tsd-panel tsd-typography" },
|
|
19
|
+
utils_1.JSX.createElement(utils_1.Raw, { html: context.markdown(props.model.readme) }))),
|
|
14
20
|
(0, lib_1.hasTypeParameters)(props.model) && utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
15
21
|
" ",
|
|
16
22
|
context.typeParameters(props.model.typeParameters),
|
|
@@ -34,7 +40,8 @@ function reflectionTemplate(context, props) {
|
|
|
34
40
|
context.type(item.type)))),
|
|
35
41
|
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "]: "),
|
|
36
42
|
context.type(props.model.indexSignature.type)),
|
|
37
|
-
context.
|
|
43
|
+
context.commentSummary(props.model.indexSignature),
|
|
44
|
+
context.commentTags(props.model.indexSignature),
|
|
38
45
|
props.model.indexSignature?.type instanceof models_1.ReflectionType &&
|
|
39
46
|
context.parameter(props.model.indexSignature.type.declaration))),
|
|
40
47
|
!props.model.signatures && context.memberSources(props.model))),
|
|
@@ -41,6 +41,7 @@ class Serializer extends utils_1.EventDispatcher {
|
|
|
41
41
|
return project;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
+
exports.Serializer = Serializer;
|
|
44
45
|
/**
|
|
45
46
|
* Triggered when the {@link Serializer} begins transforming a project.
|
|
46
47
|
* @event EVENT_BEGIN
|
|
@@ -51,4 +52,3 @@ Serializer.EVENT_BEGIN = "begin";
|
|
|
51
52
|
* @event EVENT_END
|
|
52
53
|
*/
|
|
53
54
|
Serializer.EVENT_END = "end";
|
|
54
|
-
exports.Serializer = Serializer;
|
|
@@ -43,7 +43,7 @@ export declare abstract class AbstractComponent<O extends ComponentHost> extends
|
|
|
43
43
|
*/
|
|
44
44
|
private _componentOwner;
|
|
45
45
|
/**
|
|
46
|
-
* The name of this component as set by the
|
|
46
|
+
* The name of this component as set by the `@Component` decorator.
|
|
47
47
|
*/
|
|
48
48
|
componentName: string;
|
|
49
49
|
/**
|
|
@@ -49,9 +49,9 @@ class ComponentEvent extends events_1.Event {
|
|
|
49
49
|
this.component = component;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
+
exports.ComponentEvent = ComponentEvent;
|
|
52
53
|
ComponentEvent.ADDED = "componentAdded";
|
|
53
54
|
ComponentEvent.REMOVED = "componentRemoved";
|
|
54
|
-
exports.ComponentEvent = ComponentEvent;
|
|
55
55
|
/**
|
|
56
56
|
* Component base class. Has an owner (unless it's the application root component),
|
|
57
57
|
* can dispatch events to its children, and has access to the root Application component.
|
|
@@ -43,4 +43,4 @@ export interface DocumentationEntryPoint {
|
|
|
43
43
|
export declare function getEntryPoints(logger: Logger, options: Options): DocumentationEntryPoint[] | undefined;
|
|
44
44
|
export declare function getWatchEntryPoints(logger: Logger, options: Options, program: ts.Program): DocumentationEntryPoint[] | undefined;
|
|
45
45
|
export declare function getPackageDirectories(logger: Logger, options: Options, packageGlobPaths: string[]): string[];
|
|
46
|
-
export declare function getExpandedEntryPointsForPaths(logger: Logger, inputFiles: string[], options: Options, programs?: ts.Program[]): DocumentationEntryPoint[]
|
|
46
|
+
export declare function getExpandedEntryPointsForPaths(logger: Logger, inputFiles: string[], options: Options, programs?: ts.Program[]): DocumentationEntryPoint[];
|
|
@@ -67,10 +67,15 @@ exports.EntryPointStrategy = {
|
|
|
67
67
|
Merge: "merge",
|
|
68
68
|
};
|
|
69
69
|
function getEntryPoints(logger, options) {
|
|
70
|
+
if (!options.isSet("entryPoints")) {
|
|
71
|
+
logger.warn("No entry points were provided, this is likely a misconfiguration.");
|
|
72
|
+
return [];
|
|
73
|
+
}
|
|
70
74
|
const entryPoints = options.getValue("entryPoints");
|
|
75
|
+
// May be set explicitly to be an empty array to only include a readme for a package
|
|
76
|
+
// See #2264
|
|
71
77
|
if (entryPoints.length === 0) {
|
|
72
|
-
|
|
73
|
-
return;
|
|
78
|
+
return [];
|
|
74
79
|
}
|
|
75
80
|
let result;
|
|
76
81
|
const strategy = options.getValue("entryPointStrategy");
|
package/dist/lib/utils/jsx.d.ts
CHANGED
|
@@ -41,4 +41,7 @@ export declare namespace JSX {
|
|
|
41
41
|
* @param children
|
|
42
42
|
*/
|
|
43
43
|
export declare function createElement(tag: typeof Fragment | string | JsxComponent<any>, props: object | null, ...children: JsxChildren[]): JsxElement;
|
|
44
|
+
export declare function setRenderSettings(options: {
|
|
45
|
+
pretty: boolean;
|
|
46
|
+
}): void;
|
|
44
47
|
export declare function renderElement(element: JsxElement | null | undefined): string;
|
package/dist/lib/utils/jsx.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* @module
|
|
15
15
|
*/
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.renderElement = exports.createElement = exports.Raw = exports.Fragment = void 0;
|
|
17
|
+
exports.renderElement = exports.setRenderSettings = exports.createElement = exports.Raw = exports.Fragment = void 0;
|
|
18
18
|
const html_1 = require("./html");
|
|
19
19
|
const jsx_elements_1 = require("./jsx.elements");
|
|
20
20
|
var jsx_elements_2 = require("./jsx.elements");
|
|
@@ -71,6 +71,11 @@ function createElement(tag, props, ...children) {
|
|
|
71
71
|
return { tag, props, children };
|
|
72
72
|
}
|
|
73
73
|
exports.createElement = createElement;
|
|
74
|
+
let renderPretty = true;
|
|
75
|
+
function setRenderSettings(options) {
|
|
76
|
+
renderPretty = options.pretty;
|
|
77
|
+
}
|
|
78
|
+
exports.setRenderSettings = setRenderSettings;
|
|
74
79
|
function renderElement(element) {
|
|
75
80
|
if (!element) {
|
|
76
81
|
return "";
|
|
@@ -84,7 +89,7 @@ function renderElement(element) {
|
|
|
84
89
|
}
|
|
85
90
|
const html = [];
|
|
86
91
|
if (tag !== jsx_elements_1.JsxFragment) {
|
|
87
|
-
if (blockElements.has(tag)) {
|
|
92
|
+
if (blockElements.has(tag) && renderPretty) {
|
|
88
93
|
html.push("\n");
|
|
89
94
|
}
|
|
90
95
|
html.push("<", tag);
|
|
@@ -19,7 +19,7 @@ var LogLevel;
|
|
|
19
19
|
LogLevel[LogLevel["Warn"] = 2] = "Warn";
|
|
20
20
|
LogLevel[LogLevel["Error"] = 3] = "Error";
|
|
21
21
|
LogLevel[LogLevel["None"] = 4] = "None";
|
|
22
|
-
})(LogLevel
|
|
22
|
+
})(LogLevel || (exports.LogLevel = LogLevel = {}));
|
|
23
23
|
const Colors = {
|
|
24
24
|
red: "\u001b[91m",
|
|
25
25
|
yellow: "\u001b[93m",
|
|
@@ -22,7 +22,7 @@ var ParameterHint;
|
|
|
22
22
|
(function (ParameterHint) {
|
|
23
23
|
ParameterHint[ParameterHint["File"] = 0] = "File";
|
|
24
24
|
ParameterHint[ParameterHint["Directory"] = 1] = "Directory";
|
|
25
|
-
})(ParameterHint
|
|
25
|
+
})(ParameterHint || (exports.ParameterHint = ParameterHint = {}));
|
|
26
26
|
var ParameterType;
|
|
27
27
|
(function (ParameterType) {
|
|
28
28
|
ParameterType[ParameterType["String"] = 0] = "String";
|
|
@@ -55,7 +55,7 @@ var ParameterType;
|
|
|
55
55
|
* An object with true/false flags
|
|
56
56
|
*/
|
|
57
57
|
ParameterType[ParameterType["Flags"] = 11] = "Flags";
|
|
58
|
-
})(ParameterType
|
|
58
|
+
})(ParameterType || (exports.ParameterType = ParameterType = {}));
|
|
59
59
|
const converters = {
|
|
60
60
|
[ParameterType.String](value, option) {
|
|
61
61
|
const stringValue = value == null ? "" : String(value);
|
|
@@ -69,11 +69,15 @@ export declare class Options {
|
|
|
69
69
|
private _fileNames;
|
|
70
70
|
private _projectReferences;
|
|
71
71
|
private _logger;
|
|
72
|
+
/**
|
|
73
|
+
* In packages mode, the directory of the package being converted.
|
|
74
|
+
*/
|
|
75
|
+
packageDir?: string;
|
|
72
76
|
constructor(logger: Logger);
|
|
73
77
|
/**
|
|
74
78
|
* Clones the options, intended for use in packages mode.
|
|
75
79
|
*/
|
|
76
|
-
copyForPackage(): Options;
|
|
80
|
+
copyForPackage(packageDir: string): Options;
|
|
77
81
|
/**
|
|
78
82
|
* Marks the options as readonly, enables caching when fetching options, which improves performance.
|
|
79
83
|
*/
|
|
@@ -42,8 +42,9 @@ class Options {
|
|
|
42
42
|
/**
|
|
43
43
|
* Clones the options, intended for use in packages mode.
|
|
44
44
|
*/
|
|
45
|
-
copyForPackage() {
|
|
45
|
+
copyForPackage(packageDir) {
|
|
46
46
|
const options = new Options(this._logger);
|
|
47
|
+
options.packageDir = packageDir;
|
|
47
48
|
options._readers = this._readers.filter((reader) => reader.supportsPackages);
|
|
48
49
|
options._declarations = new Map(this._declarations);
|
|
49
50
|
return options;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typedoc",
|
|
3
3
|
"description": "Create api documentation for TypeScript projects.",
|
|
4
|
-
"version": "0.24.
|
|
4
|
+
"version": "0.24.8",
|
|
5
5
|
"homepage": "https://typedoc.org",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./dist/index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"shiki": "^0.14.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x"
|
|
33
|
+
"typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/lunr": "^2.3.4",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"prettier": "2.8.7",
|
|
48
48
|
"puppeteer": "^13.5.2",
|
|
49
49
|
"ts-node": "^10.9.1",
|
|
50
|
-
"typescript": "5.
|
|
50
|
+
"typescript": "5.1.3"
|
|
51
51
|
},
|
|
52
52
|
"files": [
|
|
53
53
|
"/bin",
|