typedoc 0.25.7 → 0.25.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/index.d.ts +7 -0
- package/dist/index.js +7 -0
- package/dist/lib/converter/comments/discovery.d.ts +1 -0
- package/dist/lib/converter/comments/discovery.js +19 -1
- package/dist/lib/converter/comments/index.d.ts +1 -0
- package/dist/lib/converter/comments/index.js +5 -1
- package/dist/lib/converter/context.d.ts +1 -0
- package/dist/lib/converter/context.js +3 -0
- package/dist/lib/converter/converter.js +1 -1
- package/dist/lib/converter/factories/signature.d.ts +5 -1
- package/dist/lib/converter/factories/signature.js +25 -1
- package/dist/lib/converter/plugins/CategoryPlugin.js +19 -3
- package/dist/lib/converter/plugins/GroupPlugin.d.ts +2 -2
- package/dist/lib/converter/plugins/GroupPlugin.js +18 -2
- package/dist/lib/converter/plugins/LinkResolverPlugin.d.ts +1 -0
- package/dist/lib/converter/plugins/LinkResolverPlugin.js +24 -0
- package/dist/lib/converter/symbols.js +57 -4
- package/dist/lib/models/ReflectionCategory.d.ts +6 -2
- package/dist/lib/models/ReflectionCategory.js +8 -1
- package/dist/lib/models/ReflectionGroup.d.ts +5 -1
- package/dist/lib/models/ReflectionGroup.js +7 -0
- package/dist/lib/models/comments/comment.d.ts +10 -1
- package/dist/lib/models/comments/comment.js +45 -0
- package/dist/lib/output/plugins/SitemapPlugin.d.ts +7 -0
- package/dist/lib/output/plugins/SitemapPlugin.js +152 -0
- package/dist/lib/output/plugins/index.d.ts +1 -0
- package/dist/lib/output/plugins/index.js +3 -1
- package/dist/lib/output/themes/default/DefaultTheme.js +1 -13
- package/dist/lib/output/themes/default/partials/index.js +3 -1
- package/dist/lib/output/themes/default/templates/hierarchy.d.ts +1 -1
- package/dist/lib/output/themes/default/templates/hierarchy.js +8 -9
- package/dist/lib/output/themes/lib.d.ts +2 -1
- package/dist/lib/output/themes/lib.js +24 -1
- package/dist/lib/serialization/schema.d.ts +2 -2
- package/dist/lib/utils/entry-point.js +1 -1
- package/dist/lib/utils/events.js +1 -0
- package/dist/lib/utils/options/declaration.d.ts +1 -0
- package/dist/lib/utils/options/sources/typedoc.js +9 -0
- package/dist/lib/utils/options/tsdoc-defaults.d.ts +2 -2
- package/dist/lib/utils/options/tsdoc-defaults.js +4 -1
- package/package.json +3 -3
- package/static/main.js +4 -4
- package/tsdoc.json +14 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
+
var _, done = false;
|
|
8
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
+
var context = {};
|
|
10
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
+
if (kind === "accessor") {
|
|
15
|
+
if (result === void 0) continue;
|
|
16
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
+
}
|
|
21
|
+
else if (_ = accept(result)) {
|
|
22
|
+
if (kind === "field") initializers.unshift(_);
|
|
23
|
+
else descriptor[key] = _;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
+
done = true;
|
|
28
|
+
};
|
|
29
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
+
var useValue = arguments.length > 2;
|
|
31
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
+
}
|
|
34
|
+
return useValue ? value : void 0;
|
|
35
|
+
};
|
|
36
|
+
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
37
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
38
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
39
|
+
};
|
|
40
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
41
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
42
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
43
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
44
|
+
};
|
|
45
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
46
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
47
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
48
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
49
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
50
|
+
};
|
|
51
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
52
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
53
|
+
};
|
|
54
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
+
exports.SitemapPlugin = void 0;
|
|
56
|
+
const path_1 = __importDefault(require("path"));
|
|
57
|
+
const components_1 = require("../components");
|
|
58
|
+
const events_1 = require("../events");
|
|
59
|
+
const DefaultTheme_1 = require("../themes/default/DefaultTheme");
|
|
60
|
+
const utils_1 = require("../../utils");
|
|
61
|
+
const html_1 = require("../../utils/html");
|
|
62
|
+
let SitemapPlugin = (() => {
|
|
63
|
+
var _SitemapPlugin_sitemapBaseUrl_accessor_storage;
|
|
64
|
+
let _classDecorators = [(0, components_1.Component)({ name: "sitemap" })];
|
|
65
|
+
let _classDescriptor;
|
|
66
|
+
let _classExtraInitializers = [];
|
|
67
|
+
let _classThis;
|
|
68
|
+
let _classSuper = components_1.RendererComponent;
|
|
69
|
+
let _instanceExtraInitializers = [];
|
|
70
|
+
let _sitemapBaseUrl_decorators;
|
|
71
|
+
let _sitemapBaseUrl_initializers = [];
|
|
72
|
+
var SitemapPlugin = _classThis = class extends _classSuper {
|
|
73
|
+
constructor() {
|
|
74
|
+
super(...arguments);
|
|
75
|
+
_SitemapPlugin_sitemapBaseUrl_accessor_storage.set(this, (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _sitemapBaseUrl_initializers, void 0)));
|
|
76
|
+
}
|
|
77
|
+
get sitemapBaseUrl() { return __classPrivateFieldGet(this, _SitemapPlugin_sitemapBaseUrl_accessor_storage, "f"); }
|
|
78
|
+
set sitemapBaseUrl(value) { __classPrivateFieldSet(this, _SitemapPlugin_sitemapBaseUrl_accessor_storage, value, "f"); }
|
|
79
|
+
initialize() {
|
|
80
|
+
this.listenTo(this.owner, events_1.RendererEvent.BEGIN, this.onRendererBegin);
|
|
81
|
+
}
|
|
82
|
+
onRendererBegin(event) {
|
|
83
|
+
if (!(this.owner.theme instanceof DefaultTheme_1.DefaultTheme)) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (event.isDefaultPrevented || !this.sitemapBaseUrl) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
this.owner.preRenderAsyncJobs.push((event) => this.buildSitemap(event));
|
|
90
|
+
}
|
|
91
|
+
async buildSitemap(event) {
|
|
92
|
+
// cSpell:words lastmod urlset
|
|
93
|
+
const sitemapXml = path_1.default.join(event.outputDirectory, "sitemap.xml");
|
|
94
|
+
const lastmod = new Date(this.owner.renderStartTime).toISOString();
|
|
95
|
+
const urls = event.urls?.map((url) => {
|
|
96
|
+
return {
|
|
97
|
+
tag: "url",
|
|
98
|
+
children: [
|
|
99
|
+
{
|
|
100
|
+
tag: "loc",
|
|
101
|
+
children: new URL(url.url, this.sitemapBaseUrl).toString(),
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
tag: "lastmod",
|
|
105
|
+
children: lastmod,
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
};
|
|
109
|
+
}) ?? [];
|
|
110
|
+
const sitemap = `<?xml version="1.0" encoding="UTF-8"?>\n` +
|
|
111
|
+
stringifyXml({
|
|
112
|
+
tag: "urlset",
|
|
113
|
+
attr: { xmlns: "http://www.sitemaps.org/schemas/sitemap/0.9" },
|
|
114
|
+
children: urls,
|
|
115
|
+
}) +
|
|
116
|
+
"\n";
|
|
117
|
+
await (0, utils_1.writeFile)(sitemapXml, sitemap);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
_SitemapPlugin_sitemapBaseUrl_accessor_storage = new WeakMap();
|
|
121
|
+
__setFunctionName(_classThis, "SitemapPlugin");
|
|
122
|
+
(() => {
|
|
123
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
124
|
+
_sitemapBaseUrl_decorators = [(0, utils_1.Option)("sitemapBaseUrl")];
|
|
125
|
+
__esDecorate(_classThis, null, _sitemapBaseUrl_decorators, { kind: "accessor", name: "sitemapBaseUrl", static: false, private: false, access: { has: obj => "sitemapBaseUrl" in obj, get: obj => obj.sitemapBaseUrl, set: (obj, value) => { obj.sitemapBaseUrl = value; } }, metadata: _metadata }, _sitemapBaseUrl_initializers, _instanceExtraInitializers);
|
|
126
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
127
|
+
SitemapPlugin = _classThis = _classDescriptor.value;
|
|
128
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
129
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
130
|
+
})();
|
|
131
|
+
return SitemapPlugin = _classThis;
|
|
132
|
+
})();
|
|
133
|
+
exports.SitemapPlugin = SitemapPlugin;
|
|
134
|
+
function stringifyXml(xml, indent = 0) {
|
|
135
|
+
const parts = ["\t".repeat(indent), "<", xml.tag];
|
|
136
|
+
for (const [key, val] of Object.entries(xml.attr || {})) {
|
|
137
|
+
parts.push(" ", key, '="', (0, html_1.escapeHtml)(val), '"');
|
|
138
|
+
}
|
|
139
|
+
parts.push(">");
|
|
140
|
+
if (typeof xml.children === "string") {
|
|
141
|
+
parts.push((0, html_1.escapeHtml)(xml.children));
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
for (const child of xml.children) {
|
|
145
|
+
parts.push("\n");
|
|
146
|
+
parts.push(stringifyXml(child, indent + 1));
|
|
147
|
+
}
|
|
148
|
+
parts.push("\n", "\t".repeat(indent));
|
|
149
|
+
}
|
|
150
|
+
parts.push("</", xml.tag, ">");
|
|
151
|
+
return parts.join("");
|
|
152
|
+
}
|
|
@@ -2,3 +2,4 @@ export { MarkedPlugin } from "../themes/MarkedPlugin";
|
|
|
2
2
|
export { AssetsPlugin } from "./AssetsPlugin";
|
|
3
3
|
export { JavascriptIndexPlugin } from "./JavascriptIndexPlugin";
|
|
4
4
|
export { NavigationPlugin } from "./NavigationPlugin";
|
|
5
|
+
export { SitemapPlugin } from "./SitemapPlugin";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NavigationPlugin = exports.JavascriptIndexPlugin = exports.AssetsPlugin = exports.MarkedPlugin = void 0;
|
|
3
|
+
exports.SitemapPlugin = exports.NavigationPlugin = exports.JavascriptIndexPlugin = exports.AssetsPlugin = exports.MarkedPlugin = void 0;
|
|
4
4
|
var MarkedPlugin_1 = require("../themes/MarkedPlugin");
|
|
5
5
|
Object.defineProperty(exports, "MarkedPlugin", { enumerable: true, get: function () { return MarkedPlugin_1.MarkedPlugin; } });
|
|
6
6
|
var AssetsPlugin_1 = require("./AssetsPlugin");
|
|
@@ -9,3 +9,5 @@ var JavascriptIndexPlugin_1 = require("./JavascriptIndexPlugin");
|
|
|
9
9
|
Object.defineProperty(exports, "JavascriptIndexPlugin", { enumerable: true, get: function () { return JavascriptIndexPlugin_1.JavascriptIndexPlugin; } });
|
|
10
10
|
var NavigationPlugin_1 = require("./NavigationPlugin");
|
|
11
11
|
Object.defineProperty(exports, "NavigationPlugin", { enumerable: true, get: function () { return NavigationPlugin_1.NavigationPlugin; } });
|
|
12
|
+
var SitemapPlugin_1 = require("./SitemapPlugin");
|
|
13
|
+
Object.defineProperty(exports, "SitemapPlugin", { enumerable: true, get: function () { return SitemapPlugin_1.SitemapPlugin; } });
|
|
@@ -104,7 +104,7 @@ class DefaultTheme extends theme_1.Theme {
|
|
|
104
104
|
urls.push(new UrlMapping_1.UrlMapping("modules.html", project, this.reflectionTemplate));
|
|
105
105
|
urls.push(new UrlMapping_1.UrlMapping("index.html", project, this.indexTemplate));
|
|
106
106
|
}
|
|
107
|
-
if (
|
|
107
|
+
if ((0, lib_1.getHierarchyRoots)(project).length) {
|
|
108
108
|
urls.push(new UrlMapping_1.UrlMapping("hierarchy.html", project, this.hierarchyTemplate));
|
|
109
109
|
}
|
|
110
110
|
project.children?.forEach((child) => {
|
|
@@ -365,15 +365,3 @@ function shouldShowGroups(reflection, opts) {
|
|
|
365
365
|
}
|
|
366
366
|
return reflection.comment?.hasModifier("@showGroups") === true;
|
|
367
367
|
}
|
|
368
|
-
function includeHierarchyPage(project) {
|
|
369
|
-
for (const id in project.reflections) {
|
|
370
|
-
const refl = project.reflections[id];
|
|
371
|
-
if (refl.kindOf(models_1.ReflectionKind.ClassOrInterface)) {
|
|
372
|
-
// Keep this condition in sync with the one in hierarchy.tsx for determining roots
|
|
373
|
-
if (!(refl.implementedTypes || refl.extendedTypes) && (refl.implementedBy || refl.extendedBy)) {
|
|
374
|
-
return true;
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
return false;
|
|
379
|
-
}
|
|
@@ -3,9 +3,11 @@ 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
|
-
function renderCategory({ urlTo, icons, getReflectionClasses }, item, prependName = "") {
|
|
6
|
+
function renderCategory({ urlTo, icons, getReflectionClasses, markdown }, item, prependName = "") {
|
|
7
7
|
return (utils_1.JSX.createElement("section", { class: "tsd-index-section" },
|
|
8
8
|
utils_1.JSX.createElement("h3", { class: "tsd-index-heading" }, prependName ? `${prependName} - ${item.title}` : item.title),
|
|
9
|
+
item.description && (utils_1.JSX.createElement("div", { class: "tsd-comment tsd-typography" },
|
|
10
|
+
utils_1.JSX.createElement(utils_1.Raw, { html: markdown(item.description) }))),
|
|
9
11
|
utils_1.JSX.createElement("div", { class: "tsd-index-list" }, item.children.map((item) => (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
10
12
|
utils_1.JSX.createElement("a", { href: urlTo(item), class: (0, lib_1.classNames)({ "tsd-index-link": true, deprecated: item.isDeprecated() }, getReflectionClasses(item)) },
|
|
11
13
|
icons[item.kind](),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
|
|
2
2
|
import type { PageEvent } from "../../../events";
|
|
3
3
|
import { JSX } from "../../../../utils";
|
|
4
|
-
import {
|
|
4
|
+
import type { ProjectReflection } from "../../../../models";
|
|
5
5
|
export declare function hierarchyTemplate(context: DefaultThemeRenderContext, props: PageEvent<ProjectReflection>): JSX.Element;
|
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.hierarchyTemplate = void 0;
|
|
4
4
|
const utils_1 = require("../../../../utils");
|
|
5
|
-
const
|
|
6
|
-
function fullHierarchy(context, root) {
|
|
5
|
+
const lib_1 = require("../../lib");
|
|
6
|
+
function fullHierarchy(context, root, seen = new Set()) {
|
|
7
|
+
if (seen.has(root))
|
|
8
|
+
return;
|
|
9
|
+
seen.add(root);
|
|
7
10
|
// Note: We don't use root.anchor for the anchor, because those are built on a per page basis.
|
|
8
11
|
// And classes/interfaces get their own page, so all the anchors will be empty anyways.
|
|
9
12
|
// Full name should be safe here, since this list only includes classes/interfaces.
|
|
@@ -14,19 +17,15 @@ function fullHierarchy(context, root) {
|
|
|
14
17
|
root.name),
|
|
15
18
|
utils_1.JSX.createElement("ul", null,
|
|
16
19
|
root.implementedBy?.map((child) => {
|
|
17
|
-
return child.reflection && fullHierarchy(context, child.reflection);
|
|
20
|
+
return child.reflection && fullHierarchy(context, child.reflection, seen);
|
|
18
21
|
}),
|
|
19
22
|
root.extendedBy?.map((child) => {
|
|
20
|
-
return child.reflection && fullHierarchy(context, child.reflection);
|
|
23
|
+
return child.reflection && fullHierarchy(context, child.reflection, seen);
|
|
21
24
|
}))));
|
|
22
25
|
}
|
|
23
26
|
function hierarchyTemplate(context, props) {
|
|
24
|
-
// Keep this condition in sync with the one in DefaultTheme.tsx
|
|
25
|
-
const roots = props.project.getReflectionsByKind(models_1.ReflectionKind.ClassOrInterface)
|
|
26
|
-
.filter((refl) => !(refl.implementedTypes || refl.extendedTypes) && (refl.implementedBy || refl.extendedBy))
|
|
27
|
-
.sort((a, b) => a.name.localeCompare(b.name));
|
|
28
27
|
return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
29
28
|
utils_1.JSX.createElement("h2", null, "Class Hierarchy"),
|
|
30
|
-
|
|
29
|
+
(0, lib_1.getHierarchyRoots)(props.project).map((root) => (utils_1.JSX.createElement("ul", { class: "tsd-full-hierarchy" }, fullHierarchy(context, root))))));
|
|
31
30
|
}
|
|
32
31
|
exports.hierarchyTemplate = hierarchyTemplate;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DefaultThemeRenderContext } from "..";
|
|
2
|
-
import { Reflection, TypeParameterReflection } from "../../models";
|
|
2
|
+
import { DeclarationReflection, ProjectReflection, 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;
|
|
@@ -25,3 +25,4 @@ export declare function camelToTitleCase(text: string): string;
|
|
|
25
25
|
* Renders the reflection name with an additional `?` if optional.
|
|
26
26
|
*/
|
|
27
27
|
export declare function renderName(refl: Reflection): JSX.Element | (string | JSX.Element)[];
|
|
28
|
+
export declare function getHierarchyRoots(project: ProjectReflection): DeclarationReflection[];
|
|
@@ -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.join = exports.wbr = exports.getKindClass = exports.toStyleClass = exports.getDisplayName = exports.stringify = void 0;
|
|
3
|
+
exports.getHierarchyRoots = 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) {
|
|
@@ -122,3 +122,26 @@ function renderName(refl) {
|
|
|
122
122
|
return wbr(refl.name);
|
|
123
123
|
}
|
|
124
124
|
exports.renderName = renderName;
|
|
125
|
+
function getHierarchyRoots(project) {
|
|
126
|
+
const allClasses = project.getReflectionsByKind(models_1.ReflectionKind.ClassOrInterface);
|
|
127
|
+
const roots = allClasses.filter((refl) => {
|
|
128
|
+
// If nobody extends this class, there's no possible hierarchy to display.
|
|
129
|
+
if (!refl.implementedBy && !refl.extendedBy) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
// If we don't extend anything, then we are a root
|
|
133
|
+
if (!refl.implementedTypes && !refl.extendedTypes) {
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
// We might still be a root, if our extended/implemented types are not included
|
|
137
|
+
// in the documentation.
|
|
138
|
+
const types = [...(refl.implementedTypes || []), ...(refl.extendedTypes || [])];
|
|
139
|
+
return types.every((type) => !type.visit({
|
|
140
|
+
reference(ref) {
|
|
141
|
+
return ref.reflection !== undefined;
|
|
142
|
+
},
|
|
143
|
+
}));
|
|
144
|
+
});
|
|
145
|
+
return roots.sort((a, b) => a.name.localeCompare(b.name));
|
|
146
|
+
}
|
|
147
|
+
exports.getHierarchyRoots = getHierarchyRoots;
|
|
@@ -51,10 +51,10 @@ export interface ReflectionSymbolId {
|
|
|
51
51
|
sourceFileName: string;
|
|
52
52
|
qualifiedName: string;
|
|
53
53
|
}
|
|
54
|
-
export interface ReflectionGroup extends S<M.ReflectionGroup, "title" | "categories"> {
|
|
54
|
+
export interface ReflectionGroup extends S<M.ReflectionGroup, "title" | "description" | "categories"> {
|
|
55
55
|
children?: M.ReflectionGroup["children"][number]["id"][];
|
|
56
56
|
}
|
|
57
|
-
export interface ReflectionCategory extends S<M.ReflectionCategory, "title"> {
|
|
57
|
+
export interface ReflectionCategory extends S<M.ReflectionCategory, "title" | "description"> {
|
|
58
58
|
children?: M.ReflectionCategory["children"][number]["id"][];
|
|
59
59
|
}
|
|
60
60
|
/** @category Reflections */
|
|
@@ -161,7 +161,7 @@ function getEntryPointsForPaths(logger, inputFiles, options, programs = getEntry
|
|
|
161
161
|
const suggestion = (0, fs_1.isDir)(fileOrDir)
|
|
162
162
|
? " If you wanted to include files inside this directory, set --entryPointStrategy to expand or specify a glob."
|
|
163
163
|
: "";
|
|
164
|
-
logger.warn(`The entry point ${(0, paths_1.nicePath)(fileOrDir)} is not
|
|
164
|
+
logger.warn(`The entry point ${(0, paths_1.nicePath)(fileOrDir)} is not referenced by the 'files' or 'include' option in your tsconfig.${suggestion}`);
|
|
165
165
|
}
|
|
166
166
|
return entryPoints;
|
|
167
167
|
}
|
package/dist/lib/utils/events.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
// https://github.com/jashkenas/backbone/blob/05fde9e201f7e2137796663081105cd6dad12a98/backbone.js#L119-L374
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
11
|
exports.EventDispatcher = exports.Event = void 0;
|
|
12
|
+
// Priority: Higher number makes the listener be called earlier.
|
|
12
13
|
const uniqueId = (function () {
|
|
13
14
|
const prefixes = Object.create(null);
|
|
14
15
|
return function (prefix) {
|
|
@@ -357,6 +357,15 @@ function addTypeDocOptions(options) {
|
|
|
357
357
|
type: declaration_1.ParameterType.Boolean,
|
|
358
358
|
defaultValue: true,
|
|
359
359
|
});
|
|
360
|
+
options.addDeclaration({
|
|
361
|
+
name: "sitemapBaseUrl",
|
|
362
|
+
help: "Specify a base URL to be used in generating a sitemap.xml in our output folder. If not specified, no sitemap will be generated.",
|
|
363
|
+
validate(value) {
|
|
364
|
+
if (!/https?:\/\//.test(value)) {
|
|
365
|
+
throw new Error("sitemapBaseUrl must start with http:// or https://");
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
});
|
|
360
369
|
options.addDeclaration({
|
|
361
370
|
name: "htmlLang",
|
|
362
371
|
help: "Sets the lang attribute in the generated html tag.",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const tsdocBlockTags: readonly ["@deprecated", "@param", "@remarks", "@returns", "@throws", "@privateRemarks", "@defaultValue", "@typeParam"];
|
|
2
|
-
export declare const blockTags: readonly ["@deprecated", "@param", "@remarks", "@returns", "@throws", "@privateRemarks", "@defaultValue", "@typeParam", "@module", "@inheritDoc", "@group", "@category", "@template", "@type", "@typedef", "@callback", "@prop", "@property", "@satisfies"];
|
|
2
|
+
export declare const blockTags: readonly ["@deprecated", "@param", "@remarks", "@returns", "@throws", "@privateRemarks", "@defaultValue", "@typeParam", "@module", "@inheritDoc", "@group", "@groupDescription", "@category", "@categoryDescription", "@template", "@type", "@typedef", "@callback", "@prop", "@property", "@satisfies"];
|
|
3
3
|
export declare const tsdocInlineTags: readonly ["@link", "@inheritDoc", "@label"];
|
|
4
4
|
export declare const inlineTags: string[];
|
|
5
5
|
export declare const tsdocModifierTags: readonly ["@public", "@private", "@protected", "@internal", "@readonly", "@packageDocumentation", "@eventProperty", "@alpha", "@beta", "@experimental", "@sealed", "@override", "@virtual"];
|
|
6
|
-
export declare const modifierTags: readonly ["@public", "@private", "@protected", "@internal", "@readonly", "@packageDocumentation", "@eventProperty", "@alpha", "@beta", "@experimental", "@sealed", "@override", "@virtual", "@hidden", "@ignore", "@enum", "@event", "@overload", "@namespace", "@interface", "@showCategories", "@hideCategories", "@showGroups", "@hideGroups"];
|
|
6
|
+
export declare const modifierTags: readonly ["@public", "@private", "@protected", "@internal", "@readonly", "@packageDocumentation", "@eventProperty", "@alpha", "@beta", "@experimental", "@sealed", "@override", "@virtual", "@hidden", "@ignore", "@class", "@enum", "@event", "@overload", "@namespace", "@interface", "@showCategories", "@hideCategories", "@showGroups", "@hideGroups"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// If updating these lists, also
|
|
2
|
+
// If updating these lists, also update tsdoc.json
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.modifierTags = exports.tsdocModifierTags = exports.inlineTags = exports.tsdocInlineTags = exports.blockTags = exports.tsdocBlockTags = void 0;
|
|
5
5
|
exports.tsdocBlockTags = [
|
|
@@ -17,7 +17,9 @@ exports.blockTags = [
|
|
|
17
17
|
"@module",
|
|
18
18
|
"@inheritDoc",
|
|
19
19
|
"@group",
|
|
20
|
+
"@groupDescription",
|
|
20
21
|
"@category",
|
|
22
|
+
"@categoryDescription",
|
|
21
23
|
// Alias for @typeParam
|
|
22
24
|
"@template",
|
|
23
25
|
// Because TypeScript is important!
|
|
@@ -49,6 +51,7 @@ exports.modifierTags = [
|
|
|
49
51
|
...exports.tsdocModifierTags,
|
|
50
52
|
"@hidden",
|
|
51
53
|
"@ignore",
|
|
54
|
+
"@class",
|
|
52
55
|
"@enum",
|
|
53
56
|
"@event",
|
|
54
57
|
"@overload",
|
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.25.
|
|
4
|
+
"version": "0.25.8",
|
|
5
5
|
"homepage": "https://typedoc.org",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./dist/index.js",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"test:cov": "c8 mocha --config .config/mocha.fast.json",
|
|
66
66
|
"doc:c": "node bin/typedoc --tsconfig src/test/converter/tsconfig.json",
|
|
67
67
|
"doc:cd": "node --inspect-brk bin/typedoc --tsconfig src/test/converter/tsconfig.json",
|
|
68
|
-
"doc:c2": "node bin/typedoc --tsconfig src/test/converter2/tsconfig.json",
|
|
69
|
-
"doc:c2d": "node --inspect-brk bin/typedoc --tsconfig src/test/converter2/tsconfig.json",
|
|
68
|
+
"doc:c2": "node bin/typedoc --options src/test/converter2 --tsconfig src/test/converter2/tsconfig.json",
|
|
69
|
+
"doc:c2d": "node --inspect-brk bin/typedoc --options src/test/converter2 --tsconfig src/test/converter2/tsconfig.json",
|
|
70
70
|
"example": "cd example && node ../bin/typedoc",
|
|
71
71
|
"test:full": "c8 mocha --config .config/mocha.full.json",
|
|
72
72
|
"test:visual": "ts-node ./src/test/capture-screenshots.ts && ./scripts/compare_screenshots.sh",
|