typedoc 0.24.7 → 0.25.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.
- package/README.md +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +5 -1
- package/dist/lib/application.d.ts +16 -5
- package/dist/lib/application.js +53 -18
- package/dist/lib/cli.js +25 -21
- package/dist/lib/converter/comments/blockLexer.js +10 -1
- package/dist/lib/converter/comments/declarationReference.js +2 -0
- package/dist/lib/converter/comments/declarationReferenceResolver.js +2 -1
- package/dist/lib/converter/comments/discovery.js +0 -1
- package/dist/lib/converter/comments/lexer.js +1 -1
- package/dist/lib/converter/comments/linkResolver.d.ts +5 -2
- package/dist/lib/converter/comments/linkResolver.js +21 -13
- package/dist/lib/converter/comments/parser.js +2 -1
- package/dist/lib/converter/converter.d.ts +2 -0
- package/dist/lib/converter/converter.js +14 -9
- package/dist/lib/converter/factories/index-signature.js +2 -1
- package/dist/lib/converter/plugins/CategoryPlugin.js +2 -2
- package/dist/lib/converter/plugins/CommentPlugin.js +8 -4
- package/dist/lib/converter/plugins/GroupPlugin.js +3 -3
- package/dist/lib/converter/plugins/ImplementsPlugin.js +8 -6
- package/dist/lib/converter/plugins/InheritDocPlugin.d.ts +2 -0
- package/dist/lib/converter/plugins/InheritDocPlugin.js +11 -5
- package/dist/lib/converter/plugins/LinkResolverPlugin.js +4 -3
- package/dist/lib/converter/plugins/PackagePlugin.js +2 -2
- package/dist/lib/converter/plugins/SourcePlugin.d.ts +1 -0
- package/dist/lib/converter/plugins/SourcePlugin.js +31 -13
- package/dist/lib/converter/plugins/TypePlugin.js +12 -11
- package/dist/lib/converter/symbols.js +15 -3
- package/dist/lib/converter/types.js +6 -1
- package/dist/lib/converter/utils/nodes.d.ts +2 -2
- package/dist/lib/converter/utils/repository.d.ts +15 -5
- package/dist/lib/converter/utils/repository.js +28 -11
- package/dist/lib/models/ReflectionGroup.d.ts +4 -2
- package/dist/lib/models/ReflectionGroup.js +3 -1
- package/dist/lib/models/comments/comment.d.ts +9 -2
- package/dist/lib/models/comments/comment.js +2 -0
- package/dist/lib/models/reflections/abstract.d.ts +2 -1
- package/dist/lib/models/reflections/abstract.js +4 -3
- package/dist/lib/models/reflections/container.d.ts +3 -0
- package/dist/lib/models/reflections/container.js +4 -1
- package/dist/lib/models/reflections/declaration.d.ts +1 -0
- package/dist/lib/models/reflections/declaration.js +2 -1
- package/dist/lib/models/reflections/kind.d.ts +4 -4
- package/dist/lib/models/reflections/kind.js +7 -9
- package/dist/lib/models/reflections/parameter.d.ts +3 -0
- package/dist/lib/models/reflections/parameter.js +3 -0
- package/dist/lib/models/reflections/project.d.ts +1 -0
- package/dist/lib/models/reflections/project.js +3 -1
- package/dist/lib/models/reflections/reference.d.ts +1 -0
- package/dist/lib/models/reflections/reference.js +1 -0
- package/dist/lib/models/reflections/signature.d.ts +3 -0
- package/dist/lib/models/reflections/signature.js +3 -0
- package/dist/lib/models/reflections/type-parameter.d.ts +3 -0
- package/dist/lib/models/reflections/type-parameter.js +3 -0
- package/dist/lib/models/sources/file.d.ts +2 -0
- package/dist/lib/models/sources/file.js +5 -0
- package/dist/lib/models/types.d.ts +24 -0
- package/dist/lib/models/types.js +21 -0
- package/dist/lib/output/components.js +2 -3
- package/dist/lib/output/events.d.ts +8 -2
- package/dist/lib/output/events.js +10 -4
- package/dist/lib/output/plugins/AssetsPlugin.js +2 -2
- package/dist/lib/output/plugins/JavascriptIndexPlugin.js +2 -2
- package/dist/lib/output/renderer.d.ts +2 -0
- package/dist/lib/output/renderer.js +7 -2
- package/dist/lib/output/theme.d.ts +1 -1
- package/dist/lib/output/theme.js +2 -2
- package/dist/lib/output/themes/MarkedPlugin.js +5 -3
- package/dist/lib/output/themes/default/DefaultTheme.js +1 -1
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +4 -8
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +3 -9
- package/dist/lib/output/themes/default/partials/comment.d.ts +3 -1
- package/dist/lib/output/themes/default/partials/comment.js +30 -10
- package/dist/lib/output/themes/default/partials/footer.js +1 -1
- package/dist/lib/output/themes/default/partials/header.js +1 -1
- package/dist/lib/output/themes/default/partials/icon.js +8 -12
- 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.js +1 -1
- package/dist/lib/output/themes/default/partials/member.signature.body.js +6 -4
- package/dist/lib/output/themes/default/partials/navigation.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/navigation.js +28 -15
- package/dist/lib/output/themes/default/partials/parameter.js +11 -7
- package/dist/lib/output/themes/default/partials/typeParameters.js +2 -1
- package/dist/lib/output/themes/default/templates/reflection.js +5 -2
- package/dist/lib/output/themes/lib.d.ts +1 -2
- package/dist/lib/output/themes/lib.js +1 -11
- package/dist/lib/serialization/schema.d.ts +37 -1
- 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 +0 -6
- package/dist/lib/utils/entry-point.js +0 -99
- package/dist/lib/utils/jsx.d.ts +4 -1
- package/dist/lib/utils/jsx.js +30 -16
- package/dist/lib/utils/loggers.js +1 -1
- package/dist/lib/utils/options/declaration.d.ts +4 -1
- package/dist/lib/utils/options/declaration.js +3 -3
- package/dist/lib/utils/options/options.d.ts +3 -9
- package/dist/lib/utils/options/options.js +5 -13
- package/dist/lib/utils/options/readers/typedoc.d.ts +4 -2
- package/dist/lib/utils/options/readers/typedoc.js +33 -7
- package/dist/lib/utils/options/sources/typedoc.js +15 -4
- package/dist/lib/utils/options/tsdoc-defaults.d.ts +1 -1
- package/dist/lib/utils/options/tsdoc-defaults.js +4 -0
- package/dist/lib/utils/package-manifest.d.ts +0 -25
- package/dist/lib/utils/package-manifest.js +7 -148
- package/dist/lib/utils/perf.js +26 -11
- package/dist/lib/utils/sort.js +0 -1
- package/dist/lib/validation/links.js +10 -2
- package/package.json +12 -12
- package/static/main.js +1 -1
- package/static/style.css +19 -7
- package/tsdoc.json +16 -0
|
@@ -21,7 +21,7 @@ function sidebarLinks(context) {
|
|
|
21
21
|
const links = Object.entries(context.options.getValue("sidebarLinks"));
|
|
22
22
|
if (!links.length)
|
|
23
23
|
return null;
|
|
24
|
-
return (utils_1.JSX.createElement("nav", { id: "tsd-sidebar-links", class: "tsd-navigation" }, links.map(([label, url]) => (utils_1.JSX.createElement("a", { href: url
|
|
24
|
+
return (utils_1.JSX.createElement("nav", { id: "tsd-sidebar-links", class: "tsd-navigation" }, links.map(([label, url]) => (utils_1.JSX.createElement("a", { href: url }, label)))));
|
|
25
25
|
}
|
|
26
26
|
exports.sidebarLinks = sidebarLinks;
|
|
27
27
|
function settings(context) {
|
|
@@ -62,46 +62,59 @@ function settings(context) {
|
|
|
62
62
|
utils_1.JSX.createElement("option", { value: "dark" }, "Dark")))))));
|
|
63
63
|
}
|
|
64
64
|
exports.settings = settings;
|
|
65
|
-
function
|
|
65
|
+
function shouldShowCategories(reflection, opts) {
|
|
66
|
+
if (opts.includeCategories) {
|
|
67
|
+
return !reflection.comment?.hasModifier("@hideCategories");
|
|
68
|
+
}
|
|
69
|
+
return reflection.comment?.hasModifier("@showCategories") === true;
|
|
70
|
+
}
|
|
71
|
+
function shouldShowGroups(reflection, opts) {
|
|
72
|
+
if (opts.includeGroups) {
|
|
73
|
+
return !reflection.comment?.hasModifier("@hideGroups");
|
|
74
|
+
}
|
|
75
|
+
return reflection.comment?.hasModifier("@showGroups") === true;
|
|
76
|
+
}
|
|
77
|
+
const getNavigationElements = function getNavigationElements(parent, opts) {
|
|
66
78
|
if (parent instanceof models_1.ReflectionCategory) {
|
|
67
79
|
return parent.children;
|
|
68
80
|
}
|
|
69
81
|
if (parent instanceof models_1.ReflectionGroup) {
|
|
70
|
-
if (
|
|
82
|
+
if (shouldShowCategories(parent.owningReflection, opts) && parent.categories) {
|
|
71
83
|
return parent.categories;
|
|
72
84
|
}
|
|
73
85
|
return parent.children;
|
|
74
86
|
}
|
|
75
87
|
if (!parent.kindOf(models_1.ReflectionKind.SomeModule | models_1.ReflectionKind.Project)) {
|
|
76
|
-
return
|
|
88
|
+
return;
|
|
77
89
|
}
|
|
78
|
-
if (parent.categories && opts
|
|
90
|
+
if (parent.categories && shouldShowCategories(parent, opts)) {
|
|
79
91
|
return parent.categories;
|
|
80
92
|
}
|
|
81
|
-
if (parent.groups && opts
|
|
93
|
+
if (parent.groups && shouldShowGroups(parent, opts)) {
|
|
82
94
|
return parent.groups;
|
|
83
95
|
}
|
|
84
|
-
return parent.children
|
|
85
|
-
}
|
|
86
|
-
function navigation(context, props) {
|
|
96
|
+
return parent.children;
|
|
97
|
+
};
|
|
98
|
+
const navigation = function navigation(context, props) {
|
|
87
99
|
const opts = context.options.getValue("navigation");
|
|
88
100
|
// Create the navigation for the current page
|
|
89
101
|
// Recurse to children if the parent is some kind of module
|
|
90
102
|
return (utils_1.JSX.createElement("nav", { class: "tsd-navigation" },
|
|
91
103
|
createNavElement(props.project),
|
|
92
|
-
utils_1.JSX.createElement("ul", { class: "tsd-small-nested-navigation" }, getNavigationElements(props.project, opts)
|
|
104
|
+
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
105
|
function links(mod, parents) {
|
|
94
|
-
const nameClasses = (0, lib_1.classNames)({ deprecated: mod instanceof models_1.Reflection && mod.isDeprecated() },
|
|
106
|
+
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
107
|
const children = getNavigationElements(mod, opts);
|
|
96
|
-
if (!children.
|
|
108
|
+
if (!children || (!opts.fullTree && mod instanceof models_1.Reflection && !inPath(mod))) {
|
|
97
109
|
return createNavElement(mod, nameClasses);
|
|
98
110
|
}
|
|
99
|
-
|
|
111
|
+
const childParents = mod instanceof models_1.Reflection ? [mod.getFullName()] : [...parents, mod.title];
|
|
112
|
+
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": childParents.join("$") },
|
|
100
113
|
utils_1.JSX.createElement("summary", { class: "tsd-accordion-summary" },
|
|
101
114
|
context.icons.chevronDown(),
|
|
102
115
|
createNavElement(mod)),
|
|
103
116
|
utils_1.JSX.createElement("div", { class: "tsd-accordion-details" },
|
|
104
|
-
utils_1.JSX.createElement("ul", { class: "tsd-nested-navigation" }, children.map((c) => (utils_1.JSX.createElement("li", null, links(c,
|
|
117
|
+
utils_1.JSX.createElement("ul", { class: "tsd-nested-navigation" }, children.map((c) => (utils_1.JSX.createElement("li", null, links(c, childParents))))))));
|
|
105
118
|
}
|
|
106
119
|
function createNavElement(child, nameClasses) {
|
|
107
120
|
if (child instanceof models_1.Reflection) {
|
|
@@ -120,7 +133,7 @@ function navigation(context, props) {
|
|
|
120
133
|
} while (iter);
|
|
121
134
|
return false;
|
|
122
135
|
}
|
|
123
|
-
}
|
|
136
|
+
};
|
|
124
137
|
exports.navigation = navigation;
|
|
125
138
|
function pageSidebar(context, props) {
|
|
126
139
|
return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
@@ -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" },
|
|
@@ -39,29 +40,31 @@ const parameter = (context, props) => (utils_1.JSX.createElement(utils_1.JSX.Fra
|
|
|
39
40
|
context.memberSignatures(item))) : item.type ? (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
40
41
|
utils_1.JSX.createElement("li", { class: "tsd-parameter" },
|
|
41
42
|
utils_1.JSX.createElement("h5", null,
|
|
42
|
-
|
|
43
|
+
context.reflectionFlags(item),
|
|
43
44
|
!!item.flags.isRest && utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "..."),
|
|
44
45
|
utils_1.JSX.createElement("span", { class: (0, lib_1.getKindClass)(item) }, (0, lib_1.wbr)(item.name)),
|
|
45
46
|
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" },
|
|
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,
|
|
53
55
|
utils_1.JSX.createElement("li", { class: "tsd-parameter" },
|
|
54
56
|
utils_1.JSX.createElement("h5", null,
|
|
55
|
-
|
|
57
|
+
context.reflectionFlags(item.getSignature),
|
|
56
58
|
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "get "),
|
|
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,
|
|
64
|
-
|
|
67
|
+
context.reflectionFlags(item.setSignature),
|
|
65
68
|
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "set "),
|
|
66
69
|
utils_1.JSX.createElement("span", { class: (0, lib_1.getKindClass)(item) }, (0, lib_1.wbr)(item.name)),
|
|
67
70
|
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "("),
|
|
@@ -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,9 @@ 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))),
|
|
14
16
|
props.model instanceof models_1.DeclarationReflection &&
|
|
15
17
|
props.model.kind === models_1.ReflectionKind.Module &&
|
|
16
18
|
props.model.readme?.length && (utils_1.JSX.createElement("section", { class: "tsd-panel tsd-typography" },
|
|
@@ -38,7 +40,8 @@ function reflectionTemplate(context, props) {
|
|
|
38
40
|
context.type(item.type)))),
|
|
39
41
|
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "]: "),
|
|
40
42
|
context.type(props.model.indexSignature.type)),
|
|
41
|
-
context.
|
|
43
|
+
context.commentSummary(props.model.indexSignature),
|
|
44
|
+
context.commentTags(props.model.indexSignature),
|
|
42
45
|
props.model.indexSignature?.type instanceof models_1.ReflectionType &&
|
|
43
46
|
context.parameter(props.model.indexSignature.type.declaration))),
|
|
44
47
|
!props.model.signatures && context.memberSources(props.model))),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DefaultThemeRenderContext } from "..";
|
|
2
|
-
import {
|
|
2
|
+
import { Reflection, TypeParameterReflection } from "../../models";
|
|
3
3
|
import { JSX } from "../../utils";
|
|
4
4
|
export declare function stringify(data: unknown): string;
|
|
5
5
|
export declare function getDisplayName(refl: Reflection): string;
|
|
@@ -15,7 +15,6 @@ export declare function getKindClass(refl: Reflection): string;
|
|
|
15
15
|
*/
|
|
16
16
|
export declare function wbr(str: string): (string | JSX.Element)[];
|
|
17
17
|
export declare function join<T>(joiner: JSX.Children, list: readonly T[], cb: (x: T) => JSX.Children): JSX.Element;
|
|
18
|
-
export declare function renderFlags(flags: ReflectionFlags, comment: Comment | undefined): JSX.Element;
|
|
19
18
|
export declare function classNames(names: Record<string, boolean | null | undefined>, extraCss?: string): string | undefined;
|
|
20
19
|
export declare function hasTypeParameters(reflection: Reflection): reflection is Reflection & {
|
|
21
20
|
typeParameters: TypeParameterReflection[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.renderName = exports.camelToTitleCase = exports.renderTypeParametersSignature = exports.hasTypeParameters = exports.classNames = exports.
|
|
3
|
+
exports.renderName = exports.camelToTitleCase = exports.renderTypeParametersSignature = exports.hasTypeParameters = exports.classNames = exports.join = exports.wbr = exports.getKindClass = exports.toStyleClass = exports.getDisplayName = exports.stringify = void 0;
|
|
4
4
|
const models_1 = require("../../models");
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
6
|
function stringify(data) {
|
|
@@ -62,16 +62,6 @@ function join(joiner, list, cb) {
|
|
|
62
62
|
return utils_1.JSX.createElement(utils_1.JSX.Fragment, null, result);
|
|
63
63
|
}
|
|
64
64
|
exports.join = join;
|
|
65
|
-
function renderFlags(flags, comment) {
|
|
66
|
-
const allFlags = [...flags];
|
|
67
|
-
if (comment) {
|
|
68
|
-
allFlags.push(...Array.from(comment.modifierTags, (tag) => tag.replace(/@([a-z])/, (x) => x[1].toUpperCase())));
|
|
69
|
-
}
|
|
70
|
-
return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null, allFlags.map((item) => (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
71
|
-
utils_1.JSX.createElement("code", { class: "tsd-tag ts-flag" + item }, item),
|
|
72
|
-
" ")))));
|
|
73
|
-
}
|
|
74
|
-
exports.renderFlags = renderFlags;
|
|
75
65
|
function classNames(names, extraCss) {
|
|
76
66
|
const css = Object.keys(names)
|
|
77
67
|
.filter((key) => names[key])
|
|
@@ -57,9 +57,11 @@ export interface ReflectionGroup extends S<M.ReflectionGroup, "title" | "categor
|
|
|
57
57
|
export interface ReflectionCategory extends S<M.ReflectionCategory, "title"> {
|
|
58
58
|
children?: M.ReflectionCategory["children"][number]["id"][];
|
|
59
59
|
}
|
|
60
|
+
/** @category Reflections */
|
|
60
61
|
export type SomeReflection = {
|
|
61
62
|
[K in keyof M.ReflectionVariant]: ModelToObject<M.ReflectionVariant[K]>;
|
|
62
63
|
}[keyof M.ReflectionVariant];
|
|
64
|
+
/** @category Reflections */
|
|
63
65
|
export interface ReferenceReflection extends Omit<DeclarationReflection, "variant">, S<M.ReferenceReflection, "variant"> {
|
|
64
66
|
/**
|
|
65
67
|
* -1 if the reference refers to a symbol that does not exist in the documentation.
|
|
@@ -67,25 +69,34 @@ export interface ReferenceReflection extends Omit<DeclarationReflection, "varian
|
|
|
67
69
|
*/
|
|
68
70
|
target: number;
|
|
69
71
|
}
|
|
72
|
+
/** @category Reflections */
|
|
70
73
|
export interface SignatureReflection extends Omit<Reflection, "variant">, S<M.SignatureReflection, "variant" | "sources" | "parameters" | "type" | "overwrites" | "inheritedFrom" | "implementationOf"> {
|
|
71
74
|
typeParameter?: ModelToObject<M.SignatureReflection["typeParameters"]>;
|
|
72
75
|
}
|
|
76
|
+
/** @category Reflections */
|
|
73
77
|
export interface ParameterReflection extends Omit<Reflection, "variant">, S<M.ParameterReflection, "variant" | "type" | "defaultValue"> {
|
|
74
78
|
variant: "param";
|
|
75
79
|
}
|
|
80
|
+
/** @category Reflections */
|
|
76
81
|
export interface DeclarationReflection extends Omit<ContainerReflection, "variant">, S<M.DeclarationReflection, "variant" | "packageVersion" | "sources" | "relevanceBoost" | "type" | "signatures" | "indexSignature" | "defaultValue" | "overwrites" | "inheritedFrom" | "implementationOf" | "extendedTypes" | "extendedBy" | "implementedTypes" | "implementedBy" | "getSignature" | "setSignature" | "typeParameters"> {
|
|
77
82
|
}
|
|
83
|
+
/** @category Reflections */
|
|
78
84
|
export interface TypeParameterReflection extends Omit<Reflection, "variant">, S<M.TypeParameterReflection, "variant" | "type" | "default" | "varianceModifier"> {
|
|
79
85
|
}
|
|
86
|
+
/** @category Reflections */
|
|
80
87
|
export interface ProjectReflection extends Omit<ContainerReflection, "variant">, S<M.ProjectReflection, "variant" | "packageName" | "packageVersion" | "readme"> {
|
|
81
88
|
symbolIdMap: Record<number, ReflectionSymbolId>;
|
|
82
89
|
}
|
|
90
|
+
/** @category Reflections */
|
|
83
91
|
export interface ContainerReflection extends Reflection, S<M.ContainerReflection, "children" | "groups" | "categories"> {
|
|
84
92
|
}
|
|
93
|
+
/** @category Reflections */
|
|
85
94
|
export interface Reflection extends S<M.Reflection, "id" | "variant" | "name" | "kind" | "comment"> {
|
|
86
95
|
flags: ReflectionFlags;
|
|
87
96
|
}
|
|
97
|
+
/** @category Types */
|
|
88
98
|
export type SomeType = ModelToObject<M.SomeType>;
|
|
99
|
+
/** @category Types */
|
|
89
100
|
export type TypeKindMap = {
|
|
90
101
|
array: ArrayType;
|
|
91
102
|
conditional: ConditionalType;
|
|
@@ -108,51 +119,72 @@ export type TypeKindMap = {
|
|
|
108
119
|
union: UnionType;
|
|
109
120
|
unknown: UnknownType;
|
|
110
121
|
};
|
|
122
|
+
/** @category Types */
|
|
111
123
|
export interface ArrayType extends Type, S<M.ArrayType, "type" | "elementType"> {
|
|
112
124
|
}
|
|
125
|
+
/** @category Types */
|
|
113
126
|
export interface ConditionalType extends Type, S<M.ConditionalType, "type" | "checkType" | "extendsType" | "trueType" | "falseType"> {
|
|
114
127
|
}
|
|
128
|
+
/** @category Types */
|
|
115
129
|
export interface IndexedAccessType extends Type, S<M.IndexedAccessType, "type" | "indexType" | "objectType"> {
|
|
116
130
|
}
|
|
131
|
+
/** @category Types */
|
|
117
132
|
export interface InferredType extends Type, S<M.InferredType, "type" | "name" | "constraint"> {
|
|
118
133
|
}
|
|
134
|
+
/** @category Types */
|
|
119
135
|
export interface IntersectionType extends Type, S<M.IntersectionType, "type" | "types"> {
|
|
120
136
|
}
|
|
137
|
+
/** @category Types */
|
|
121
138
|
export interface IntrinsicType extends Type, S<M.IntrinsicType, "type" | "name"> {
|
|
122
139
|
}
|
|
140
|
+
/** @category Types */
|
|
123
141
|
export interface OptionalType extends Type, S<M.OptionalType, "type" | "elementType"> {
|
|
124
142
|
}
|
|
143
|
+
/** @category Types */
|
|
125
144
|
export interface PredicateType extends Type, S<M.PredicateType, "type" | "name" | "asserts" | "targetType"> {
|
|
126
145
|
}
|
|
146
|
+
/** @category Types */
|
|
127
147
|
export interface QueryType extends Type, S<M.QueryType, "type" | "queryType"> {
|
|
128
148
|
}
|
|
149
|
+
/** @category Types */
|
|
129
150
|
export interface ReferenceType extends Type, S<M.ReferenceType, "type" | "name" | "typeArguments" | "package" | "externalUrl"> {
|
|
130
151
|
target: number | ReflectionSymbolId;
|
|
131
152
|
qualifiedName?: string;
|
|
132
153
|
refersToTypeParameter?: boolean;
|
|
133
154
|
}
|
|
155
|
+
/** @category Types */
|
|
134
156
|
export interface ReflectionType extends Type, S<M.ReflectionType, "type" | "declaration"> {
|
|
135
157
|
}
|
|
158
|
+
/** @category Types */
|
|
136
159
|
export interface RestType extends Type, S<M.RestType, "type" | "elementType"> {
|
|
137
160
|
}
|
|
161
|
+
/** @category Types */
|
|
138
162
|
export interface LiteralType extends Type, S<M.LiteralType, "type" | "value"> {
|
|
139
163
|
}
|
|
164
|
+
/** @category Types */
|
|
140
165
|
export interface TupleType extends Type, S<M.TupleType, "type"> {
|
|
141
166
|
elements?: ModelToObject<M.TupleType["elements"]>;
|
|
142
167
|
}
|
|
168
|
+
/** @category Types */
|
|
143
169
|
export interface NamedTupleMemberType extends Type, S<M.NamedTupleMember, "type" | "name" | "isOptional" | "element"> {
|
|
144
170
|
}
|
|
171
|
+
/** @category Types */
|
|
145
172
|
export interface TemplateLiteralType extends Type, S<M.TemplateLiteralType, "type" | "head"> {
|
|
146
173
|
tail: [SomeType, string][];
|
|
147
174
|
}
|
|
175
|
+
/** @category Types */
|
|
148
176
|
export interface MappedType extends Type, S<M.MappedType, "type" | "parameter" | "parameterType" | "templateType" | "readonlyModifier" | "optionalModifier" | "nameType"> {
|
|
149
177
|
}
|
|
178
|
+
/** @category Types */
|
|
150
179
|
export interface TypeOperatorType extends Type, S<M.TypeOperatorType, "type" | "operator" | "target"> {
|
|
151
180
|
}
|
|
181
|
+
/** @category Types */
|
|
152
182
|
export interface UnionType extends Type, S<M.UnionType, "type" | "types"> {
|
|
153
183
|
}
|
|
184
|
+
/** @category Types */
|
|
154
185
|
export interface UnknownType extends Type, S<M.UnknownType, "type" | "name"> {
|
|
155
186
|
}
|
|
187
|
+
/** @category Types */
|
|
156
188
|
export interface Type {
|
|
157
189
|
}
|
|
158
190
|
type BoolKeys<T> = {
|
|
@@ -160,13 +192,16 @@ type BoolKeys<T> = {
|
|
|
160
192
|
}[keyof T];
|
|
161
193
|
export interface ReflectionFlags extends Partial<S<M.ReflectionFlags, BoolKeys<M.ReflectionFlags>>> {
|
|
162
194
|
}
|
|
195
|
+
/** @category Comments */
|
|
163
196
|
export interface Comment extends Partial<S<M.Comment, "blockTags" | "label">> {
|
|
164
197
|
summary: CommentDisplayPart[];
|
|
165
|
-
modifierTags?: string[];
|
|
198
|
+
modifierTags?: `@${string}`[];
|
|
166
199
|
}
|
|
200
|
+
/** @category Comments */
|
|
167
201
|
export interface CommentTag extends S<M.CommentTag, "tag" | "name"> {
|
|
168
202
|
content: CommentDisplayPart[];
|
|
169
203
|
}
|
|
204
|
+
/** @category Comments */
|
|
170
205
|
export type CommentDisplayPart = {
|
|
171
206
|
kind: "text";
|
|
172
207
|
text: string;
|
|
@@ -177,6 +212,7 @@ export type CommentDisplayPart = {
|
|
|
177
212
|
/**
|
|
178
213
|
* If `target` is a number, it is a reflection ID. If a string, it is a URL.
|
|
179
214
|
* `target` will only be set for `@link`, `@linkcode`, and `@linkplain` tags.
|
|
215
|
+
* @category Comments
|
|
180
216
|
*/
|
|
181
217
|
export interface InlineTagDisplayPart {
|
|
182
218
|
kind: "inline-tag";
|
|
@@ -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.
|
|
@@ -21,12 +21,6 @@ export declare const EntryPointStrategy: {
|
|
|
21
21
|
* use the merge option to produce final output.
|
|
22
22
|
*/
|
|
23
23
|
readonly Packages: "packages";
|
|
24
|
-
/**
|
|
25
|
-
* Will be removed in 0.25, this was called packages mode in 0.24.
|
|
26
|
-
* Alternative resolution mode useful for monorepos. With this mode, TypeDoc will look for a package.json
|
|
27
|
-
* and tsconfig.json under each provided entry point. The `main` field of each package will be documented.
|
|
28
|
-
*/
|
|
29
|
-
readonly LegacyPackages: "legacy-packages";
|
|
30
24
|
/**
|
|
31
25
|
* Merges multiple previously generated output from TypeDoc's --json output together into a single project.
|
|
32
26
|
*/
|
|
@@ -30,7 +30,6 @@ exports.getExpandedEntryPointsForPaths = exports.getPackageDirectories = exports
|
|
|
30
30
|
const path_1 = require("path");
|
|
31
31
|
const typescript_1 = __importDefault(require("typescript"));
|
|
32
32
|
const FS = __importStar(require("fs"));
|
|
33
|
-
const Path = __importStar(require("path"));
|
|
34
33
|
const package_manifest_1 = require("./package-manifest");
|
|
35
34
|
const paths_1 = require("./paths");
|
|
36
35
|
const fs_1 = require("./fs");
|
|
@@ -55,12 +54,6 @@ exports.EntryPointStrategy = {
|
|
|
55
54
|
* use the merge option to produce final output.
|
|
56
55
|
*/
|
|
57
56
|
Packages: "packages",
|
|
58
|
-
/**
|
|
59
|
-
* Will be removed in 0.25, this was called packages mode in 0.24.
|
|
60
|
-
* Alternative resolution mode useful for monorepos. With this mode, TypeDoc will look for a package.json
|
|
61
|
-
* and tsconfig.json under each provided entry point. The `main` field of each package will be documented.
|
|
62
|
-
*/
|
|
63
|
-
LegacyPackages: "legacy-packages",
|
|
64
57
|
/**
|
|
65
58
|
* Merges multiple previously generated output from TypeDoc's --json output together into a single project.
|
|
66
59
|
*/
|
|
@@ -86,9 +79,6 @@ function getEntryPoints(logger, options) {
|
|
|
86
79
|
case exports.EntryPointStrategy.Expand:
|
|
87
80
|
result = getExpandedEntryPointsForPaths(logger, expandGlobs(entryPoints, logger), options);
|
|
88
81
|
break;
|
|
89
|
-
case exports.EntryPointStrategy.LegacyPackages:
|
|
90
|
-
result = getEntryPointsForLegacyPackages(logger, entryPoints, options);
|
|
91
|
-
break;
|
|
92
82
|
case exports.EntryPointStrategy.Merge:
|
|
93
83
|
case exports.EntryPointStrategy.Packages:
|
|
94
84
|
// Doesn't really have entry points in the traditional way of how TypeDoc has dealt with them.
|
|
@@ -268,92 +258,3 @@ function expandInputFiles(logger, entryPoints, options) {
|
|
|
268
258
|
});
|
|
269
259
|
return files;
|
|
270
260
|
}
|
|
271
|
-
/**
|
|
272
|
-
* Expand the provided packages configuration paths, determining the entry points
|
|
273
|
-
* and creating the ts.Programs for any which are found.
|
|
274
|
-
* @param logger
|
|
275
|
-
* @param packageGlobPaths
|
|
276
|
-
* @returns The information about the discovered programs, undefined if an error occurs.
|
|
277
|
-
*/
|
|
278
|
-
function getEntryPointsForLegacyPackages(logger, packageGlobPaths, options) {
|
|
279
|
-
const results = [];
|
|
280
|
-
for (const packagePath of getPackageDirectories(logger, options, packageGlobPaths)) {
|
|
281
|
-
const packageJsonPath = (0, path_1.resolve)(packagePath, "package.json");
|
|
282
|
-
const packageJson = (0, package_manifest_1.loadPackageManifest)(logger, packageJsonPath);
|
|
283
|
-
const includeVersion = options.getValue("includeVersion");
|
|
284
|
-
const typedocPackageConfig = packageJson
|
|
285
|
-
? (0, package_manifest_1.extractTypedocConfigFromPackageManifest)(logger, packageJsonPath)
|
|
286
|
-
: undefined;
|
|
287
|
-
if (packageJson === undefined) {
|
|
288
|
-
logger.error(`Could not load package manifest ${packageJsonPath}`);
|
|
289
|
-
return;
|
|
290
|
-
}
|
|
291
|
-
const packageEntryPoint = (0, package_manifest_1.getTsEntryPointForPackage)(logger, packageJsonPath, packageJson);
|
|
292
|
-
if (packageEntryPoint === undefined) {
|
|
293
|
-
logger.error(`Could not determine TS entry point for package ${packageJsonPath}`);
|
|
294
|
-
return;
|
|
295
|
-
}
|
|
296
|
-
if (packageEntryPoint === package_manifest_1.ignorePackage) {
|
|
297
|
-
continue;
|
|
298
|
-
}
|
|
299
|
-
const tsconfigFile = typescript_1.default.findConfigFile(packageEntryPoint, typescript_1.default.sys.fileExists, typedocPackageConfig?.tsconfig);
|
|
300
|
-
if (tsconfigFile === undefined) {
|
|
301
|
-
logger.error(`Could not determine tsconfig.json for source file ${packageEntryPoint} (it must be on an ancestor path)`);
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
// Consider deduplicating this with similar code in src/lib/utils/options/readers/tsconfig.ts
|
|
305
|
-
let fatalError = false;
|
|
306
|
-
const parsedCommandLine = typescript_1.default.getParsedCommandLineOfConfigFile(tsconfigFile, {}, {
|
|
307
|
-
...typescript_1.default.sys,
|
|
308
|
-
onUnRecoverableConfigFileDiagnostic: (error) => {
|
|
309
|
-
logger.diagnostic(error);
|
|
310
|
-
fatalError = true;
|
|
311
|
-
},
|
|
312
|
-
});
|
|
313
|
-
if (!parsedCommandLine) {
|
|
314
|
-
return;
|
|
315
|
-
}
|
|
316
|
-
logger.diagnostics(parsedCommandLine.errors);
|
|
317
|
-
if (fatalError) {
|
|
318
|
-
return;
|
|
319
|
-
}
|
|
320
|
-
const program = typescript_1.default.createProgram({
|
|
321
|
-
rootNames: parsedCommandLine.fileNames,
|
|
322
|
-
options: options.fixCompilerOptions(parsedCommandLine.options),
|
|
323
|
-
projectReferences: parsedCommandLine.projectReferences,
|
|
324
|
-
});
|
|
325
|
-
const sourceFile = program.getSourceFile(packageEntryPoint);
|
|
326
|
-
if (sourceFile === undefined) {
|
|
327
|
-
logger.error(`Entry point "${packageEntryPoint}" does not appear to be built by/included in the tsconfig found at "${tsconfigFile}"`);
|
|
328
|
-
return;
|
|
329
|
-
}
|
|
330
|
-
const packageName = packageJson["name"];
|
|
331
|
-
results.push({
|
|
332
|
-
displayName: typedocPackageConfig?.displayName ?? packageName,
|
|
333
|
-
version: includeVersion
|
|
334
|
-
? packageJson["version"]?.replace(/^v/, "")
|
|
335
|
-
: void 0,
|
|
336
|
-
readmeFile: discoverReadmeFile(logger, Path.join(packageJsonPath, ".."), typedocPackageConfig?.readmeFile),
|
|
337
|
-
program,
|
|
338
|
-
sourceFile,
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
return results;
|
|
342
|
-
}
|
|
343
|
-
function discoverReadmeFile(logger, packageDir, userReadme) {
|
|
344
|
-
if (userReadme?.endsWith("none")) {
|
|
345
|
-
return;
|
|
346
|
-
}
|
|
347
|
-
if (userReadme) {
|
|
348
|
-
if (!FS.existsSync(Path.join(packageDir, userReadme))) {
|
|
349
|
-
logger.warn(`Failed to find ${userReadme} in ${(0, paths_1.nicePath)(packageDir)}`);
|
|
350
|
-
return;
|
|
351
|
-
}
|
|
352
|
-
return Path.resolve(Path.join(packageDir, userReadme));
|
|
353
|
-
}
|
|
354
|
-
for (const file of FS.readdirSync(packageDir)) {
|
|
355
|
-
if (file.toLowerCase() === "readme.md") {
|
|
356
|
-
return Path.resolve(Path.join(packageDir, file));
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
}
|
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
|
|
44
|
+
export declare function setRenderSettings(options: {
|
|
45
|
+
pretty: boolean;
|
|
46
|
+
}): void;
|
|
47
|
+
export declare const renderElement: (element: JsxElement | null | undefined) => string;
|