typedoc 0.23.26 → 0.24.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/typedoc +1 -130
- package/dist/index.d.ts +4 -5
- package/dist/index.js +15 -5
- package/dist/lib/application-events.d.ts +1 -1
- package/dist/lib/application-events.js +1 -1
- package/dist/lib/application.d.ts +24 -13
- package/dist/lib/application.js +136 -69
- package/dist/lib/cli.d.ts +1 -0
- package/dist/lib/cli.js +129 -0
- package/dist/lib/converter/comments/declarationReference.d.ts +1 -1
- package/dist/lib/converter/comments/declarationReferenceResolver.js +11 -5
- package/dist/lib/converter/comments/discovery.d.ts +1 -1
- package/dist/lib/converter/comments/discovery.js +96 -76
- package/dist/lib/converter/comments/index.d.ts +1 -1
- package/dist/lib/converter/comments/index.js +41 -21
- package/dist/lib/converter/comments/linkResolver.d.ts +2 -8
- package/dist/lib/converter/comments/linkResolver.js +42 -145
- package/dist/lib/converter/context.d.ts +1 -1
- package/dist/lib/converter/context.js +27 -14
- package/dist/lib/converter/convert-expression.d.ts +1 -1
- package/dist/lib/converter/convert-expression.js +35 -15
- package/dist/lib/converter/converter.d.ts +4 -6
- package/dist/lib/converter/converter.js +38 -27
- package/dist/lib/converter/factories/index-signature.d.ts +1 -1
- package/dist/lib/converter/factories/index-signature.js +26 -3
- package/dist/lib/converter/factories/signature.d.ts +2 -2
- package/dist/lib/converter/factories/signature.js +76 -52
- package/dist/lib/converter/index.d.ts +0 -1
- package/dist/lib/converter/jsdoc.d.ts +1 -1
- package/dist/lib/converter/jsdoc.js +39 -17
- package/dist/lib/converter/plugins/CommentPlugin.d.ts +0 -2
- package/dist/lib/converter/plugins/CommentPlugin.js +7 -28
- package/dist/lib/converter/plugins/GroupPlugin.d.ts +1 -39
- package/dist/lib/converter/plugins/GroupPlugin.js +3 -61
- package/dist/lib/converter/plugins/ImplementsPlugin.d.ts +1 -4
- package/dist/lib/converter/plugins/ImplementsPlugin.js +49 -28
- package/dist/lib/converter/plugins/InheritDocPlugin.d.ts +0 -3
- package/dist/lib/converter/plugins/InheritDocPlugin.js +6 -7
- package/dist/lib/converter/plugins/LinkResolverPlugin.d.ts +2 -3
- package/dist/lib/converter/plugins/LinkResolverPlugin.js +12 -18
- package/dist/lib/converter/plugins/PackagePlugin.d.ts +5 -14
- package/dist/lib/converter/plugins/PackagePlugin.js +44 -56
- package/dist/lib/converter/plugins/SourcePlugin.js +31 -6
- package/dist/lib/converter/plugins/TypePlugin.d.ts +4 -10
- package/dist/lib/converter/plugins/TypePlugin.js +23 -13
- package/dist/lib/converter/symbols.d.ts +1 -1
- package/dist/lib/converter/symbols.js +153 -132
- package/dist/lib/converter/types.d.ts +1 -1
- package/dist/lib/converter/types.js +121 -95
- package/dist/lib/converter/utils/nodes.d.ts +1 -1
- package/dist/lib/converter/utils/nodes.js +24 -4
- package/dist/lib/converter/utils/symbols.d.ts +1 -1
- package/dist/lib/converter/utils/symbols.js +24 -4
- package/dist/lib/models/ReflectionCategory.d.ts +2 -1
- package/dist/lib/models/ReflectionCategory.js +12 -0
- package/dist/lib/models/ReflectionGroup.d.ts +3 -2
- package/dist/lib/models/ReflectionGroup.js +20 -0
- package/dist/lib/models/comments/comment.d.ts +12 -7
- package/dist/lib/models/comments/comment.js +77 -64
- package/dist/lib/models/reflections/ReflectionSymbolId.d.ts +29 -0
- package/dist/lib/models/reflections/ReflectionSymbolId.js +94 -0
- package/dist/lib/models/reflections/abstract.d.ts +12 -37
- package/dist/lib/models/reflections/abstract.js +27 -35
- package/dist/lib/models/reflections/container.d.ts +6 -10
- package/dist/lib/models/reflections/container.js +8 -1
- package/dist/lib/models/reflections/declaration.d.ts +19 -4
- package/dist/lib/models/reflections/declaration.js +54 -1
- package/dist/lib/models/reflections/index.d.ts +2 -0
- package/dist/lib/models/reflections/index.js +3 -1
- package/dist/lib/models/reflections/kind.d.ts +15 -1
- package/dist/lib/models/reflections/kind.js +43 -1
- package/dist/lib/models/reflections/parameter.d.ts +3 -1
- package/dist/lib/models/reflections/parameter.js +10 -0
- package/dist/lib/models/reflections/project.d.ts +32 -5
- package/dist/lib/models/reflections/project.js +84 -20
- package/dist/lib/models/reflections/reference.d.ts +5 -9
- package/dist/lib/models/reflections/reference.js +13 -29
- package/dist/lib/models/reflections/signature.d.ts +8 -1
- package/dist/lib/models/reflections/signature.js +14 -0
- package/dist/lib/models/reflections/type-parameter.d.ts +7 -4
- package/dist/lib/models/reflections/type-parameter.js +9 -3
- package/dist/lib/models/reflections/variant.d.ts +18 -0
- package/dist/lib/models/reflections/variant.js +2 -0
- package/dist/lib/models/sources/file.d.ts +2 -0
- package/dist/lib/models/sources/file.js +3 -0
- package/dist/lib/models/types.d.ts +24 -20
- package/dist/lib/models/types.js +132 -33
- package/dist/lib/output/plugins/JavascriptIndexPlugin.js +3 -7
- package/dist/lib/output/renderer.d.ts +21 -14
- package/dist/lib/output/renderer.js +25 -25
- package/dist/lib/output/themes/MarkedPlugin.js +2 -3
- package/dist/lib/output/themes/default/DefaultTheme.d.ts +2 -20
- package/dist/lib/output/themes/default/DefaultTheme.js +4 -75
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +10 -9
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +55 -1
- package/dist/lib/output/themes/default/partials/header.js +2 -5
- package/dist/lib/output/themes/default/partials/index.js +2 -2
- package/dist/lib/output/themes/default/partials/member.getterSetter.d.ts +2 -2
- package/dist/lib/output/themes/default/partials/member.getterSetter.js +4 -1
- package/dist/lib/output/themes/default/partials/member.js +1 -1
- package/dist/lib/output/themes/default/partials/member.signatures.js +2 -1
- package/dist/lib/output/themes/default/partials/members.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/members.js +3 -1
- package/dist/lib/output/themes/default/partials/navigation.js +6 -4
- package/dist/lib/output/themes/default/partials/parameter.js +1 -1
- package/dist/lib/output/themes/default/partials/type.js +4 -4
- package/dist/lib/output/themes/default/templates/reflection.js +1 -1
- package/dist/lib/output/themes/lib.d.ts +4 -1
- package/dist/lib/output/themes/lib.js +53 -3
- package/dist/lib/serialization/deserializer.d.ts +54 -0
- package/dist/lib/serialization/deserializer.js +212 -0
- package/dist/lib/serialization/events.d.ts +0 -15
- package/dist/lib/serialization/index.d.ts +2 -3
- package/dist/lib/serialization/index.js +4 -3
- package/dist/lib/serialization/schema.d.ts +23 -17
- package/dist/lib/serialization/serializer.d.ts +5 -5
- package/dist/lib/serialization/serializer.js +4 -15
- package/dist/lib/utils/array.d.ts +0 -1
- package/dist/lib/utils/array.js +1 -2
- package/dist/lib/utils/entry-point.d.ts +15 -4
- package/dist/lib/utils/entry-point.js +45 -28
- package/dist/lib/utils/enum.d.ts +4 -1
- package/dist/lib/utils/enum.js +2 -3
- package/dist/lib/utils/fs.d.ts +3 -1
- package/dist/lib/utils/fs.js +36 -73
- package/dist/lib/utils/index.d.ts +4 -3
- package/dist/lib/utils/index.js +3 -3
- package/dist/lib/utils/loggers.d.ts +5 -26
- package/dist/lib/utils/loggers.js +38 -42
- package/dist/lib/utils/map.d.ts +17 -0
- package/dist/lib/utils/map.js +49 -1
- package/dist/lib/utils/options/declaration.d.ts +20 -6
- package/dist/lib/utils/options/help.js +1 -1
- package/dist/lib/utils/options/options.d.ts +27 -18
- package/dist/lib/utils/options/options.js +68 -14
- package/dist/lib/utils/options/readers/arguments.d.ts +2 -1
- package/dist/lib/utils/options/readers/arguments.js +9 -2
- package/dist/lib/utils/options/readers/tsconfig.d.ts +3 -7
- package/dist/lib/utils/options/readers/tsconfig.js +35 -36
- package/dist/lib/utils/options/readers/typedoc.d.ts +4 -5
- package/dist/lib/utils/options/readers/typedoc.js +9 -21
- package/dist/lib/utils/options/sources/typedoc.js +18 -64
- package/dist/lib/utils/package-manifest.js +1 -2
- package/dist/lib/utils/paths.js +2 -0
- package/dist/lib/utils/plugins.d.ts +1 -2
- package/dist/lib/utils/plugins.js +22 -106
- package/dist/lib/utils/sort.d.ts +1 -1
- package/dist/lib/utils/sort.js +8 -11
- package/dist/lib/utils/tsconfig.d.ts +4 -0
- package/dist/lib/utils/tsconfig.js +36 -0
- package/dist/lib/utils/tsutils.d.ts +3 -2
- package/dist/lib/utils/tsutils.js +46 -12
- package/dist/lib/validation/documentation.d.ts +1 -1
- package/dist/lib/validation/documentation.js +6 -29
- package/dist/lib/validation/exports.js +18 -21
- package/dist/lib/validation/links.js +1 -1
- package/package.json +18 -19
- package/static/main.js +1 -55
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { RendererHooks } from "../..";
|
|
2
|
-
import { CommentDisplayPart, ReferenceType, Reflection } from "../../../models";
|
|
2
|
+
import { CommentDisplayPart, DeclarationReflection, ReferenceType, Reflection, ReflectionKind } from "../../../models";
|
|
3
3
|
import type { NeverIfInternal, Options } from "../../../utils";
|
|
4
4
|
import type { DefaultTheme } from "./DefaultTheme";
|
|
5
5
|
export declare class DefaultThemeRenderContext {
|
|
6
6
|
private theme;
|
|
7
7
|
options: Options;
|
|
8
8
|
constructor(theme: DefaultTheme, options: Options);
|
|
9
|
-
icons: Record<"
|
|
9
|
+
icons: Record<"search" | "anchor" | ReflectionKind | "checkbox" | "chevronDown" | "menu" | "chevronSmall", () => import("../../../utils/jsx.elements").JsxElement>;
|
|
10
10
|
hook: (name: keyof RendererHooks) => import("../../../utils/jsx.elements").JsxElement[];
|
|
11
11
|
/** Avoid this in favor of urlTo if possible */
|
|
12
12
|
relativeURL: (url: string | undefined) => string | undefined;
|
|
13
|
-
urlTo: (reflection: Reflection) => string;
|
|
13
|
+
urlTo: (reflection: Reflection) => string | undefined;
|
|
14
14
|
markdown: (md: readonly CommentDisplayPart[] | NeverIfInternal<string | undefined>) => string;
|
|
15
15
|
/**
|
|
16
16
|
* Using this method will repeat work already done, instead of calling it, use `type.externalUrl`.
|
|
@@ -18,6 +18,7 @@ export declare class DefaultThemeRenderContext {
|
|
|
18
18
|
* Will be removed in 0.24.
|
|
19
19
|
*/
|
|
20
20
|
attemptExternalResolution: (type: NeverIfInternal<ReferenceType>) => string | undefined;
|
|
21
|
+
getReflectionClasses: (reflection: DeclarationReflection) => string;
|
|
21
22
|
reflectionTemplate: (props: import("../..").PageEvent<import("../../../models").ContainerReflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
22
23
|
indexTemplate: (props: import("../..").PageEvent<import("../../../models").ProjectReflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
23
24
|
defaultLayout: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
@@ -28,9 +29,9 @@ export declare class DefaultThemeRenderContext {
|
|
|
28
29
|
header: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
29
30
|
hierarchy: (props: import("../../../models").DeclarationHierarchy | undefined) => import("../../../utils/jsx.elements").JsxElement | undefined;
|
|
30
31
|
index: (props: import("../../../models").ContainerReflection) => import("../../../utils/jsx.elements").JsxElement;
|
|
31
|
-
member: (props:
|
|
32
|
-
memberDeclaration: (props:
|
|
33
|
-
memberGetterSetter: (props:
|
|
32
|
+
member: (props: DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
|
|
33
|
+
memberDeclaration: (props: DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
|
|
34
|
+
memberGetterSetter: (props: DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
|
|
34
35
|
memberReference: (props: import("../../../models").ReferenceReflection) => import("../../../utils/jsx.elements").JsxElement;
|
|
35
36
|
memberSignatureBody: (r_0: import("../../../models").SignatureReflection, r_1?: {
|
|
36
37
|
hideSources?: boolean | undefined;
|
|
@@ -39,8 +40,8 @@ export declare class DefaultThemeRenderContext {
|
|
|
39
40
|
hideName?: boolean | undefined;
|
|
40
41
|
arrowStyle?: boolean | undefined;
|
|
41
42
|
} | undefined) => import("../../../utils/jsx.elements").JsxElement;
|
|
42
|
-
memberSignatures: (props:
|
|
43
|
-
memberSources: (props: import("../../../models").SignatureReflection |
|
|
43
|
+
memberSignatures: (props: DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
|
|
44
|
+
memberSources: (props: import("../../../models").SignatureReflection | DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
|
|
44
45
|
members: (props: import("../../../models").ContainerReflection) => import("../../../utils/jsx.elements").JsxElement;
|
|
45
46
|
membersGroup: (group: import("../../../models").ReflectionGroup) => import("../../../utils/jsx.elements").JsxElement;
|
|
46
47
|
navigation: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
@@ -48,7 +49,7 @@ export declare class DefaultThemeRenderContext {
|
|
|
48
49
|
settings: () => import("../../../utils/jsx.elements").JsxElement;
|
|
49
50
|
primaryNavigation: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
50
51
|
secondaryNavigation: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement | undefined;
|
|
51
|
-
parameter: (props:
|
|
52
|
+
parameter: (props: DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
|
|
52
53
|
toolbar: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
53
54
|
type: (type: import("../../../models").Type | undefined) => import("../../../utils/jsx.elements").JsxElement;
|
|
54
55
|
typeAndParent: (props: import("../../../models").Type) => import("../../../utils/jsx.elements").JsxElement;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DefaultThemeRenderContext = void 0;
|
|
4
4
|
const models_1 = require("../../../models");
|
|
5
|
+
const lib_1 = require("../lib");
|
|
5
6
|
const default_1 = require("./layouts/default");
|
|
6
7
|
const partials_1 = require("./partials");
|
|
7
8
|
const analytics_1 = require("./partials/analytics");
|
|
@@ -44,7 +45,7 @@ class DefaultThemeRenderContext {
|
|
|
44
45
|
this.urlTo = (reflection) => this.relativeURL(reflection.url);
|
|
45
46
|
this.markdown = (md) => {
|
|
46
47
|
if (md instanceof Array) {
|
|
47
|
-
return this.theme.markedPlugin.parseMarkdown(
|
|
48
|
+
return this.theme.markedPlugin.parseMarkdown((0, lib_1.displayPartsToMarkdown)(md, this.urlTo));
|
|
48
49
|
}
|
|
49
50
|
return md ? this.theme.markedPlugin.parseMarkdown(md) : "";
|
|
50
51
|
};
|
|
@@ -56,6 +57,10 @@ class DefaultThemeRenderContext {
|
|
|
56
57
|
this.attemptExternalResolution = (type) => {
|
|
57
58
|
return type.externalUrl;
|
|
58
59
|
};
|
|
60
|
+
this.getReflectionClasses = (reflection) => {
|
|
61
|
+
const filters = this.options.getValue("visibilityFilters");
|
|
62
|
+
return getReflectionClasses(reflection, filters);
|
|
63
|
+
};
|
|
59
64
|
this.reflectionTemplate = bind(reflection_1.reflectionTemplate, this);
|
|
60
65
|
this.indexTemplate = bind(templates_1.indexTemplate, this);
|
|
61
66
|
this.defaultLayout = bind(default_1.defaultLayout, this);
|
|
@@ -90,3 +95,52 @@ class DefaultThemeRenderContext {
|
|
|
90
95
|
}
|
|
91
96
|
}
|
|
92
97
|
exports.DefaultThemeRenderContext = DefaultThemeRenderContext;
|
|
98
|
+
function getReflectionClasses(reflection, filters) {
|
|
99
|
+
const classes = [];
|
|
100
|
+
classes.push(toStyleClass("tsd-kind-" + models_1.ReflectionKind[reflection.kind]));
|
|
101
|
+
if (reflection.parent &&
|
|
102
|
+
reflection.parent instanceof models_1.DeclarationReflection) {
|
|
103
|
+
classes.push(toStyleClass(`tsd-parent-kind-${models_1.ReflectionKind[reflection.parent.kind]}`));
|
|
104
|
+
}
|
|
105
|
+
// Filter classes should match up with the settings function in
|
|
106
|
+
// partials/navigation.tsx.
|
|
107
|
+
for (const key of Object.keys(filters)) {
|
|
108
|
+
if (key === "inherited") {
|
|
109
|
+
if (reflection.inheritedFrom) {
|
|
110
|
+
classes.push("tsd-is-inherited");
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
else if (key === "protected") {
|
|
114
|
+
if (reflection.flags.isProtected) {
|
|
115
|
+
classes.push("tsd-is-protected");
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else if (key === "private") {
|
|
119
|
+
if (reflection.flags.isPrivate) {
|
|
120
|
+
classes.push("tsd-is-private");
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
else if (key === "external") {
|
|
124
|
+
if (reflection.flags.isExternal) {
|
|
125
|
+
classes.push("tsd-is-external");
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
else if (key.startsWith("@")) {
|
|
129
|
+
if (key === "@deprecated") {
|
|
130
|
+
if (reflection.isDeprecated()) {
|
|
131
|
+
classes.push(toStyleClass(`tsd-is-${key.substring(1)}`));
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
else if (reflection.comment?.hasModifier(key) ||
|
|
135
|
+
reflection.comment?.getTag(key)) {
|
|
136
|
+
classes.push(toStyleClass(`tsd-is-${key.substring(1)}`));
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return classes.join(" ");
|
|
141
|
+
}
|
|
142
|
+
function toStyleClass(str) {
|
|
143
|
+
return str
|
|
144
|
+
.replace(/(\w)([A-Z])/g, (_m, m1, m2) => m1 + "-" + m2)
|
|
145
|
+
.toLowerCase();
|
|
146
|
+
}
|
|
@@ -9,11 +9,8 @@ const header = (context, props) => {
|
|
|
9
9
|
return (utils_1.JSX.createElement("div", { class: "tsd-page-title" },
|
|
10
10
|
!!props.model.parent && utils_1.JSX.createElement("ul", { class: "tsd-breadcrumb" }, context.breadcrumb(props.model)),
|
|
11
11
|
utils_1.JSX.createElement(HeadingLevel, null,
|
|
12
|
-
props.model.kind !== models_1.ReflectionKind.Project && `${props.model.
|
|
13
|
-
props.model
|
|
14
|
-
props.model instanceof models_1.DeclarationReflection &&
|
|
15
|
-
props.model.version !== undefined &&
|
|
16
|
-
` - v${props.model.version}`,
|
|
12
|
+
props.model.kind !== models_1.ReflectionKind.Project && `${models_1.ReflectionKind.singularString(props.model.kind)} `,
|
|
13
|
+
(0, lib_1.getDisplayName)(context, props.model),
|
|
17
14
|
(0, lib_1.hasTypeParameters)(props.model) && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
18
15
|
"<",
|
|
19
16
|
(0, lib_1.join)(", ", props.model.typeParameters, (item) => item.name),
|
|
@@ -4,11 +4,11 @@ exports.index = void 0;
|
|
|
4
4
|
const lib_1 = require("../../lib");
|
|
5
5
|
const utils_1 = require("../../../../utils");
|
|
6
6
|
const models_1 = require("../../../../models");
|
|
7
|
-
function renderCategory({ urlTo, icons }, item, prependName = "") {
|
|
7
|
+
function renderCategory({ urlTo, icons, getReflectionClasses }, item, prependName = "") {
|
|
8
8
|
return (utils_1.JSX.createElement("section", { class: "tsd-index-section" },
|
|
9
9
|
utils_1.JSX.createElement("h3", { class: "tsd-index-heading" }, prependName ? `${prependName} - ${item.title}` : item.title),
|
|
10
10
|
utils_1.JSX.createElement("div", { class: "tsd-index-list" }, item.children.map((item) => (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
11
|
-
utils_1.JSX.createElement("a", { href: urlTo(item), class: (0, lib_1.classNames)({ "tsd-index-link": true, deprecated: item.isDeprecated() }, item
|
|
11
|
+
utils_1.JSX.createElement("a", { href: urlTo(item), class: (0, lib_1.classNames)({ "tsd-index-link": true, deprecated: item.isDeprecated() }, getReflectionClasses(item)) },
|
|
12
12
|
icons[item.kind](),
|
|
13
13
|
utils_1.JSX.createElement("span", null, (0, lib_1.renderName)(item))),
|
|
14
14
|
"\n"))))));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
|
|
2
|
-
import { JSX } from "../../../../utils";
|
|
3
1
|
import type { DeclarationReflection } from "../../../../models";
|
|
2
|
+
import { JSX } from "../../../../utils";
|
|
3
|
+
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
|
|
4
4
|
export declare const memberGetterSetter: (context: DefaultThemeRenderContext, props: DeclarationReflection) => JSX.Element;
|
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.memberGetterSetter = void 0;
|
|
4
4
|
const utils_1 = require("../../../../utils");
|
|
5
|
+
const lib_1 = require("../../lib");
|
|
5
6
|
const memberGetterSetter = (context, props) => (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
6
|
-
utils_1.JSX.createElement("ul", { class:
|
|
7
|
+
utils_1.JSX.createElement("ul", { class: (0, lib_1.classNames)({
|
|
8
|
+
"tsd-signatures": true,
|
|
9
|
+
}, context.getReflectionClasses(props)) },
|
|
7
10
|
!!props.getSignature && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
8
11
|
utils_1.JSX.createElement("li", { class: "tsd-signature", id: props.getSignature.anchor },
|
|
9
12
|
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "get"),
|
|
@@ -5,7 +5,7 @@ const lib_1 = require("../../lib");
|
|
|
5
5
|
const utils_1 = require("../../../../utils");
|
|
6
6
|
const models_1 = require("../../../../models");
|
|
7
7
|
const anchor_icon_1 = require("./anchor-icon");
|
|
8
|
-
const member = (context, props) => (utils_1.JSX.createElement("section", { class: "tsd-panel tsd-member
|
|
8
|
+
const member = (context, props) => (utils_1.JSX.createElement("section", { class: (0, lib_1.classNames)({ "tsd-panel": true, "tsd-member": true }, context.getReflectionClasses(props)) },
|
|
9
9
|
utils_1.JSX.createElement("a", { id: props.anchor, class: "tsd-anchor" }),
|
|
10
10
|
!!props.name && (utils_1.JSX.createElement("h3", { class: "tsd-anchor-link" },
|
|
11
11
|
(0, lib_1.renderFlags)(props.flags, props.comment),
|
|
@@ -3,8 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.memberSignatures = void 0;
|
|
4
4
|
const utils_1 = require("../../../../utils");
|
|
5
5
|
const anchor_icon_1 = require("./anchor-icon");
|
|
6
|
+
const lib_1 = require("../../lib");
|
|
6
7
|
const memberSignatures = (context, props) => (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
7
|
-
utils_1.JSX.createElement("ul", { class: "tsd-signatures
|
|
8
|
+
utils_1.JSX.createElement("ul", { class: (0, lib_1.classNames)({ "tsd-signatures": true }, context.getReflectionClasses(props)) }, props.signatures?.map((item) => (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
8
9
|
utils_1.JSX.createElement("li", { class: "tsd-signature tsd-anchor-link", id: item.anchor },
|
|
9
10
|
context.memberSignatureTitle(item),
|
|
10
11
|
(0, anchor_icon_1.anchorIcon)(context, item.anchor)),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
|
|
2
2
|
import { JSX } from "../../../../utils";
|
|
3
|
-
import
|
|
3
|
+
import { ContainerReflection } from "../../../../models";
|
|
4
4
|
export declare function members(context: DefaultThemeRenderContext, props: ContainerReflection): JSX.Element;
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.members = void 0;
|
|
4
4
|
const utils_1 = require("../../../../utils");
|
|
5
|
+
const models_1 = require("../../../../models");
|
|
6
|
+
const lib_1 = require("../../lib");
|
|
5
7
|
function members(context, props) {
|
|
6
8
|
if (props.categories && props.categories.length) {
|
|
7
|
-
return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null, props.categories.map((item) => !item.allChildrenHaveOwnDocument() && (utils_1.JSX.createElement("section", { class: "tsd-panel-group tsd-member-group
|
|
9
|
+
return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null, props.categories.map((item) => !item.allChildrenHaveOwnDocument() && (utils_1.JSX.createElement("section", { class: (0, lib_1.classNames)({ "tsd-panel-group": true, "tsd-member-group": true }, props instanceof models_1.DeclarationReflection ? context.getReflectionClasses(props) : "") },
|
|
8
10
|
utils_1.JSX.createElement("h2", null, item.title),
|
|
9
11
|
item.children.map((item) => !item.hasOwnDocument && context.member(item)))))));
|
|
10
12
|
}
|
|
@@ -90,8 +90,8 @@ function primaryNavigation(context, props) {
|
|
|
90
90
|
if (childModules?.length) {
|
|
91
91
|
childNav = utils_1.JSX.createElement("ul", null, childModules.map(link));
|
|
92
92
|
}
|
|
93
|
-
return (utils_1.JSX.createElement("li", { class: (0, lib_1.classNames)({ current, selected, deprecated: mod.isDeprecated() }, mod
|
|
94
|
-
utils_1.JSX.createElement("a", { href: context.urlTo(mod) }, (0, lib_1.wbr)(
|
|
93
|
+
return (utils_1.JSX.createElement("li", { class: (0, lib_1.classNames)({ current, selected, deprecated: mod.isDeprecated() }, context.getReflectionClasses(mod)) },
|
|
94
|
+
utils_1.JSX.createElement("a", { href: context.urlTo(mod) }, (0, lib_1.wbr)((0, lib_1.getDisplayName)(context, mod))),
|
|
95
95
|
childNav));
|
|
96
96
|
}
|
|
97
97
|
}
|
|
@@ -108,7 +108,7 @@ function secondaryNavigation(context, props) {
|
|
|
108
108
|
const pageNavigation = children
|
|
109
109
|
.filter((child) => !child.kindOf(models_1.ReflectionKind.SomeModule))
|
|
110
110
|
.map((child) => {
|
|
111
|
-
return (utils_1.JSX.createElement("li", { class: (0, lib_1.classNames)({ deprecated: child.isDeprecated(), current: props.model === child }, child
|
|
111
|
+
return (utils_1.JSX.createElement("li", { class: (0, lib_1.classNames)({ deprecated: child.isDeprecated(), current: props.model === child }, context.getReflectionClasses(child)) },
|
|
112
112
|
utils_1.JSX.createElement("a", { href: context.urlTo(child), class: "tsd-index-link" },
|
|
113
113
|
context.icons[child.kind](),
|
|
114
114
|
(0, lib_1.renderName)(child))));
|
|
@@ -121,7 +121,9 @@ function secondaryNavigation(context, props) {
|
|
|
121
121
|
utils_1.JSX.createElement("li", { class: (0, lib_1.classNames)({
|
|
122
122
|
deprecated: effectivePageParent.isDeprecated(),
|
|
123
123
|
current: effectivePageParent === props.model,
|
|
124
|
-
}, effectivePageParent.
|
|
124
|
+
}, effectivePageParent instanceof models_1.DeclarationReflection
|
|
125
|
+
? context.getReflectionClasses(effectivePageParent)
|
|
126
|
+
: "") },
|
|
125
127
|
utils_1.JSX.createElement("a", { href: context.urlTo(effectivePageParent), class: "tsd-index-link" },
|
|
126
128
|
context.icons[effectivePageParent.kind](),
|
|
127
129
|
utils_1.JSX.createElement("span", null, (0, lib_1.renderName)(effectivePageParent))),
|
|
@@ -7,7 +7,7 @@ const models_1 = require("../../../../models");
|
|
|
7
7
|
const parameter = (context, props) => (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
8
8
|
utils_1.JSX.createElement("ul", { class: "tsd-parameters" },
|
|
9
9
|
!!props.signatures && (utils_1.JSX.createElement("li", { class: "tsd-parameter-signature" },
|
|
10
|
-
utils_1.JSX.createElement("ul", { class: "tsd-signatures
|
|
10
|
+
utils_1.JSX.createElement("ul", { class: (0, lib_1.classNames)({ "tsd-signatures": true }, context.getReflectionClasses(props)) }, props.signatures.map((item) => (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
11
11
|
utils_1.JSX.createElement("li", { class: "tsd-signature", id: item.anchor }, context.memberSignatureTitle(item, {
|
|
12
12
|
hideName: true,
|
|
13
13
|
})),
|
|
@@ -50,7 +50,7 @@ function getNamespacedPath(reflection) {
|
|
|
50
50
|
return path;
|
|
51
51
|
}
|
|
52
52
|
function renderUniquePath(context, reflection) {
|
|
53
|
-
return (0, lib_1.join)(utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "."), getUniquePath(reflection), (item) => (utils_1.JSX.createElement("a", { href: context.urlTo(item), class: "tsd-signature-type", "data-tsd-kind": item.
|
|
53
|
+
return (0, lib_1.join)(utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "."), getUniquePath(reflection), (item) => (utils_1.JSX.createElement("a", { href: context.urlTo(item), class: "tsd-signature-type", "data-tsd-kind": models_1.ReflectionKind.singularString(item.kind) }, item.name)));
|
|
54
54
|
}
|
|
55
55
|
let indentationDepth = 0;
|
|
56
56
|
function includeIndentation() {
|
|
@@ -148,7 +148,7 @@ const typeRenderers = {
|
|
|
148
148
|
" ",
|
|
149
149
|
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "}")));
|
|
150
150
|
},
|
|
151
|
-
|
|
151
|
+
namedTupleMember(context, type) {
|
|
152
152
|
return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
153
153
|
type.name,
|
|
154
154
|
type.isOptional ? (utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "?: ")) : (utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, ": ")),
|
|
@@ -178,7 +178,7 @@ const typeRenderers = {
|
|
|
178
178
|
if (reflection) {
|
|
179
179
|
if (reflection.kindOf(models_1.ReflectionKind.TypeParameter)) {
|
|
180
180
|
// Don't generate a link will always point to this page, but do set the kind.
|
|
181
|
-
name = (utils_1.JSX.createElement("span", { class: "tsd-signature-type", "data-tsd-kind": reflection.
|
|
181
|
+
name = (utils_1.JSX.createElement("span", { class: "tsd-signature-type", "data-tsd-kind": models_1.ReflectionKind.singularString(reflection.kind) }, reflection.name));
|
|
182
182
|
}
|
|
183
183
|
else {
|
|
184
184
|
name = renderUniquePath(context, reflection);
|
|
@@ -299,7 +299,7 @@ const typeRenderers = {
|
|
|
299
299
|
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "..."),
|
|
300
300
|
renderType(context, type.elementType, models_1.TypeContext.restElement)));
|
|
301
301
|
},
|
|
302
|
-
|
|
302
|
+
templateLiteral(context, type) {
|
|
303
303
|
return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
304
304
|
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "`"),
|
|
305
305
|
type.head && utils_1.JSX.createElement("span", { class: "tsd-signature-type" }, type.head),
|
|
@@ -23,7 +23,7 @@ function reflectionTemplate(context, props) {
|
|
|
23
23
|
utils_1.JSX.createElement("h4", null, "Implemented by"),
|
|
24
24
|
utils_1.JSX.createElement("ul", { class: "tsd-hierarchy" }, props.model.implementedBy.map((item) => (utils_1.JSX.createElement("li", null, context.type(item))))))),
|
|
25
25
|
!!props.model.signatures && (utils_1.JSX.createElement("section", { class: "tsd-panel" }, context.memberSignatures(props.model))),
|
|
26
|
-
!!props.model.indexSignature && (utils_1.JSX.createElement("section", { class: "tsd-panel
|
|
26
|
+
!!props.model.indexSignature && (utils_1.JSX.createElement("section", { class: (0, lib_1.classNames)({ "tsd-panel": true }, context.getReflectionClasses(props.model)) },
|
|
27
27
|
utils_1.JSX.createElement("h4", { class: "tsd-before-signature" }, "Indexable"),
|
|
28
28
|
utils_1.JSX.createElement("div", { class: "tsd-signature" },
|
|
29
29
|
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "["),
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { Comment, Reflection, ReflectionFlags, TypeParameterReflection } from "../../models";
|
|
1
|
+
import { Comment, CommentDisplayPart, Reflection, ReflectionFlags, TypeParameterReflection } from "../../models";
|
|
2
2
|
import { JSX } from "../../utils";
|
|
3
|
+
import type { DefaultThemeRenderContext } from "./default/DefaultThemeRenderContext";
|
|
3
4
|
export declare function stringify(data: unknown): string;
|
|
5
|
+
export declare function getDisplayName(context: DefaultThemeRenderContext, refl: Reflection): string;
|
|
4
6
|
/**
|
|
5
7
|
* Insert word break tags ``<wbr>`` into the given string.
|
|
6
8
|
*
|
|
@@ -18,6 +20,7 @@ export declare function hasTypeParameters(reflection: Reflection): reflection is
|
|
|
18
20
|
};
|
|
19
21
|
export declare function renderTypeParametersSignature(typeParameters: readonly TypeParameterReflection[] | undefined): JSX.Element;
|
|
20
22
|
export declare function camelToTitleCase(text: string): string;
|
|
23
|
+
export declare function displayPartsToMarkdown(parts: readonly CommentDisplayPart[], urlTo: DefaultThemeRenderContext["urlTo"]): string;
|
|
21
24
|
/**
|
|
22
25
|
* Renders the reflection name with an additional `?` if optional.
|
|
23
26
|
*/
|
|
@@ -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.renderFlags = exports.join = exports.wbr = exports.stringify = void 0;
|
|
3
|
+
exports.renderName = exports.displayPartsToMarkdown = exports.camelToTitleCase = exports.renderTypeParametersSignature = exports.hasTypeParameters = exports.classNames = exports.renderFlags = exports.join = exports.wbr = 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) {
|
|
@@ -10,6 +10,16 @@ function stringify(data) {
|
|
|
10
10
|
return JSON.stringify(data);
|
|
11
11
|
}
|
|
12
12
|
exports.stringify = stringify;
|
|
13
|
+
function getDisplayName(context, refl) {
|
|
14
|
+
let version = "";
|
|
15
|
+
if ((refl instanceof models_1.DeclarationReflection || refl instanceof models_1.ProjectReflection) &&
|
|
16
|
+
refl.packageVersion &&
|
|
17
|
+
context.options.getValue("includeVersion")) {
|
|
18
|
+
version = ` - v${refl.packageVersion}`;
|
|
19
|
+
}
|
|
20
|
+
return `${refl.name}${version}`;
|
|
21
|
+
}
|
|
22
|
+
exports.getDisplayName = getDisplayName;
|
|
13
23
|
/**
|
|
14
24
|
* Insert word break tags ``<wbr>`` into the given string.
|
|
15
25
|
*
|
|
@@ -74,7 +84,7 @@ function renderTypeParametersSignature(typeParameters) {
|
|
|
74
84
|
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "<"),
|
|
75
85
|
join(utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, ", "), typeParameters, (item) => (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
76
86
|
item.varianceModifier ? `${item.varianceModifier} ` : "",
|
|
77
|
-
utils_1.JSX.createElement("span", { class: "tsd-signature-type", "data-tsd-kind": item.
|
|
87
|
+
utils_1.JSX.createElement("span", { class: "tsd-signature-type", "data-tsd-kind": models_1.ReflectionKind.singularString(item.kind) }, item.name)))),
|
|
78
88
|
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, ">")))));
|
|
79
89
|
}
|
|
80
90
|
exports.renderTypeParametersSignature = renderTypeParametersSignature;
|
|
@@ -82,12 +92,52 @@ function camelToTitleCase(text) {
|
|
|
82
92
|
return text.substring(0, 1).toUpperCase() + text.substring(1).replace(/[a-z][A-Z]/g, (x) => `${x[0]} ${x[1]}`);
|
|
83
93
|
}
|
|
84
94
|
exports.camelToTitleCase = camelToTitleCase;
|
|
95
|
+
function displayPartsToMarkdown(parts, urlTo) {
|
|
96
|
+
const result = [];
|
|
97
|
+
for (const part of parts) {
|
|
98
|
+
switch (part.kind) {
|
|
99
|
+
case "text":
|
|
100
|
+
case "code":
|
|
101
|
+
result.push(part.text);
|
|
102
|
+
break;
|
|
103
|
+
case "inline-tag":
|
|
104
|
+
switch (part.tag) {
|
|
105
|
+
case "@label":
|
|
106
|
+
case "@inheritdoc": // Shouldn't happen
|
|
107
|
+
break; // Not rendered.
|
|
108
|
+
case "@link":
|
|
109
|
+
case "@linkcode":
|
|
110
|
+
case "@linkplain": {
|
|
111
|
+
if (part.target) {
|
|
112
|
+
const url = typeof part.target === "string" ? part.target : urlTo(part.target);
|
|
113
|
+
const text = part.tag === "@linkcode" ? `<code>${part.text}</code>` : part.text;
|
|
114
|
+
result.push(url ? `<a href="${url}">${text}</a>` : part.text);
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
result.push(part.text);
|
|
118
|
+
}
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
default:
|
|
122
|
+
// Hmm... probably want to be able to render these somehow, so custom inline tags can be given
|
|
123
|
+
// special rendering rules. Future capability. For now, just render their text.
|
|
124
|
+
result.push(`{${part.tag} ${part.text}}`);
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
break;
|
|
128
|
+
default:
|
|
129
|
+
(0, utils_1.assertNever)(part);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return result.join("");
|
|
133
|
+
}
|
|
134
|
+
exports.displayPartsToMarkdown = displayPartsToMarkdown;
|
|
85
135
|
/**
|
|
86
136
|
* Renders the reflection name with an additional `?` if optional.
|
|
87
137
|
*/
|
|
88
138
|
function renderName(refl) {
|
|
89
139
|
if (!refl.name) {
|
|
90
|
-
return utils_1.JSX.createElement("em", null, wbr(refl.
|
|
140
|
+
return utils_1.JSX.createElement("em", null, wbr(models_1.ReflectionKind.singularString(refl.kind)));
|
|
91
141
|
}
|
|
92
142
|
if (refl.flags.isOptional) {
|
|
93
143
|
return utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Application } from "../application";
|
|
2
|
+
import { ProjectReflection, ReflectionVariant, TypeKindMap } from "../models/index";
|
|
3
|
+
import type { Logger } from "../utils/loggers";
|
|
4
|
+
import type { JSONOutput } from "./index";
|
|
5
|
+
export interface DeserializerComponent {
|
|
6
|
+
priority: number;
|
|
7
|
+
supports(model: unknown, obj: unknown): boolean;
|
|
8
|
+
fromObject(model: unknown, obj: unknown): void;
|
|
9
|
+
}
|
|
10
|
+
export interface Deserializable<T> {
|
|
11
|
+
fromObject(d: Deserializer, o: T): void;
|
|
12
|
+
}
|
|
13
|
+
export declare class Deserializer {
|
|
14
|
+
private app;
|
|
15
|
+
private deferred;
|
|
16
|
+
private deserializers;
|
|
17
|
+
private activeReflection;
|
|
18
|
+
constructor(app: Application);
|
|
19
|
+
get logger(): Logger;
|
|
20
|
+
reflectionBuilders: {
|
|
21
|
+
[K in keyof ReflectionVariant]: (parent: NonNullable<ReflectionVariant[K]["parent"]>, obj: JSONOutput.ModelToObject<ReflectionVariant[K]>) => ReflectionVariant[K];
|
|
22
|
+
};
|
|
23
|
+
typeBuilders: {
|
|
24
|
+
[K in keyof TypeKindMap]: (obj: JSONOutput.ModelToObject<TypeKindMap[K]>, de: Deserializer) => TypeKindMap[K];
|
|
25
|
+
};
|
|
26
|
+
oldIdToNewId: Record<number, number | undefined>;
|
|
27
|
+
project: ProjectReflection | undefined;
|
|
28
|
+
addDeserializer(de: DeserializerComponent): void;
|
|
29
|
+
/**
|
|
30
|
+
* Revive a single project into the structure it was originally created with.
|
|
31
|
+
* This is generally not appropriate for merging multiple projects since projects may
|
|
32
|
+
* contain reflections in their root, not inside a module.
|
|
33
|
+
*/
|
|
34
|
+
reviveProject(projectObj: JSONOutput.ProjectReflection, name?: string): ProjectReflection;
|
|
35
|
+
reviveProjects(name: string, projects: readonly JSONOutput.ProjectReflection[]): ProjectReflection;
|
|
36
|
+
revive<T, U extends Deserializable<T>>(source: NonNullable<T>, creator: (obj: T) => U): U;
|
|
37
|
+
revive<T, U extends Deserializable<T>>(source: T | undefined, creator: (obj: T) => U): U | undefined;
|
|
38
|
+
reviveMany<T, U extends Deserializable<T>>(sourceArray: T[], creator: (obj: T) => U): U[];
|
|
39
|
+
reviveMany<T, U extends Deserializable<T>>(sourceArray: T[] | undefined, creator: (obj: T) => U): U[] | undefined;
|
|
40
|
+
reviveType<T extends JSONOutput.SomeType>(obj: T): TypeKindMap[T["type"]];
|
|
41
|
+
reviveType<T extends JSONOutput.SomeType>(obj: T | undefined): TypeKindMap[T["type"]] | undefined;
|
|
42
|
+
constructReflection<T extends JSONOutput.SomeReflection>(obj: T): ReflectionVariant[T["variant"]];
|
|
43
|
+
constructType<T extends JSONOutput.SomeType>(obj: T): TypeKindMap[T["type"]];
|
|
44
|
+
fromObject<T>(receiver: {
|
|
45
|
+
fromObject(d: Deserializer, o: T): void;
|
|
46
|
+
}, obj: T): void;
|
|
47
|
+
/**
|
|
48
|
+
* Defers work until the initial pass of serialization has been completed.
|
|
49
|
+
* This can be used to set up references which cannot be immediately restored.
|
|
50
|
+
*
|
|
51
|
+
* May only be called when deserializing.
|
|
52
|
+
*/
|
|
53
|
+
defer(cb: (project: ProjectReflection) => void): void;
|
|
54
|
+
}
|