typedoc 0.25.0 → 0.25.2
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 +2 -2
- package/dist/index.js +2 -1
- package/dist/lib/application.d.ts +3 -3
- package/dist/lib/application.js +440 -359
- package/dist/lib/cli.js +6 -3
- package/dist/lib/converter/comments/discovery.js +8 -2
- package/dist/lib/converter/comments/index.js +9 -1
- package/dist/lib/converter/comments/parser.js +5 -11
- package/dist/lib/converter/comments/tagName.d.ts +8 -0
- package/dist/lib/converter/comments/tagName.js +62 -0
- package/dist/lib/converter/context.js +1 -2
- package/dist/lib/converter/converter.d.ts +11 -11
- package/dist/lib/converter/converter.js +436 -311
- package/dist/lib/converter/factories/signature.d.ts +1 -0
- package/dist/lib/converter/factories/signature.js +31 -5
- package/dist/lib/converter/jsdoc.js +2 -6
- package/dist/lib/converter/plugins/CategoryPlugin.d.ts +8 -8
- package/dist/lib/converter/plugins/CategoryPlugin.js +293 -200
- package/dist/lib/converter/plugins/CommentPlugin.d.ts +8 -5
- package/dist/lib/converter/plugins/CommentPlugin.js +433 -305
- package/dist/lib/converter/plugins/GroupPlugin.d.ts +4 -3
- package/dist/lib/converter/plugins/GroupPlugin.js +226 -145
- package/dist/lib/converter/plugins/ImplementsPlugin.js +239 -194
- package/dist/lib/converter/plugins/InheritDocPlugin.d.ts +1 -1
- package/dist/lib/converter/plugins/InheritDocPlugin.js +201 -138
- package/dist/lib/converter/plugins/LinkResolverPlugin.d.ts +1 -1
- package/dist/lib/converter/plugins/LinkResolverPlugin.js +110 -44
- package/dist/lib/converter/plugins/PackagePlugin.d.ts +6 -4
- package/dist/lib/converter/plugins/PackagePlugin.js +191 -96
- package/dist/lib/converter/plugins/SourcePlugin.d.ts +6 -6
- package/dist/lib/converter/plugins/SourcePlugin.js +234 -146
- package/dist/lib/converter/plugins/TypePlugin.js +147 -102
- package/dist/lib/converter/symbols.js +1 -1
- package/dist/lib/converter/types.js +10 -0
- package/dist/lib/converter/utils/repository.js +2 -2
- package/dist/lib/models/reflections/ReflectionSymbolId.js +1 -1
- package/dist/lib/models/reflections/abstract.d.ts +4 -0
- package/dist/lib/models/reflections/abstract.js +14 -2
- package/dist/lib/models/reflections/index.d.ts +1 -1
- package/dist/lib/output/components.d.ts +1 -0
- package/dist/lib/output/components.js +9 -1
- package/dist/lib/output/index.d.ts +1 -1
- package/dist/lib/output/plugins/AssetsPlugin.d.ts +1 -1
- package/dist/lib/output/plugins/AssetsPlugin.js +111 -44
- package/dist/lib/output/plugins/JavascriptIndexPlugin.d.ts +2 -1
- package/dist/lib/output/plugins/JavascriptIndexPlugin.js +173 -99
- package/dist/lib/output/plugins/NavigationPlugin.d.ts +6 -0
- package/dist/lib/output/plugins/NavigationPlugin.js +109 -0
- package/dist/lib/output/plugins/index.d.ts +2 -1
- package/dist/lib/output/plugins/index.js +5 -3
- package/dist/lib/output/renderer.d.ts +10 -8
- package/dist/lib/output/renderer.js +315 -202
- package/dist/lib/output/theme.js +63 -18
- package/dist/lib/output/themes/MarkedPlugin.d.ts +4 -4
- package/dist/lib/output/themes/MarkedPlugin.js +223 -145
- package/dist/lib/output/themes/default/DefaultTheme.d.ts +14 -1
- package/dist/lib/output/themes/default/DefaultTheme.js +72 -0
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +42 -36
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +15 -1
- package/dist/lib/output/themes/default/layouts/default.js +2 -0
- package/dist/lib/output/themes/default/partials/header.js +1 -1
- package/dist/lib/output/themes/default/partials/icon.d.ts +4 -1
- package/dist/lib/output/themes/default/partials/icon.js +46 -35
- package/dist/lib/output/themes/default/partials/member.signature.body.js +1 -1
- package/dist/lib/output/themes/default/partials/navigation.js +34 -67
- package/dist/lib/utils/component.d.ts +1 -1
- package/dist/lib/utils/component.js +3 -1
- package/dist/lib/utils/entry-point.js +36 -18
- package/dist/lib/utils/events.js +1 -1
- package/dist/lib/utils/general.js +1 -1
- package/dist/lib/utils/index.d.ts +1 -1
- package/dist/lib/utils/index.js +2 -1
- package/dist/lib/utils/jsx.js +1 -1
- package/dist/lib/utils/options/declaration.d.ts +4 -0
- package/dist/lib/utils/options/index.d.ts +1 -1
- package/dist/lib/utils/options/index.js +2 -1
- package/dist/lib/utils/options/options.d.ts +19 -0
- package/dist/lib/utils/options/options.js +22 -2
- package/dist/lib/utils/options/readers/tsconfig.js +2 -7
- package/dist/lib/utils/options/sources/typedoc.js +22 -0
- package/dist/lib/utils/perf.d.ts +1 -1
- package/dist/lib/utils/perf.js +10 -20
- package/package.json +9 -9
- package/static/main.js +4 -3
- package/static/style.css +7 -3
|
@@ -1,55 +1,61 @@
|
|
|
1
1
|
import type { PageEvent, RendererHooks } from "../..";
|
|
2
2
|
import { CommentDisplayPart, DeclarationReflection, Reflection } from "../../../models";
|
|
3
|
-
import type { NeverIfInternal, Options } from "../../../utils";
|
|
3
|
+
import type { JSX, NeverIfInternal, Options } from "../../../utils";
|
|
4
4
|
import type { DefaultTheme } from "./DefaultTheme";
|
|
5
|
+
import { icons } from "./partials/icon";
|
|
5
6
|
export declare class DefaultThemeRenderContext {
|
|
6
7
|
private theme;
|
|
7
8
|
page: PageEvent<Reflection>;
|
|
9
|
+
private _iconsCache;
|
|
10
|
+
private _refIcons;
|
|
8
11
|
options: Options;
|
|
9
12
|
constructor(theme: DefaultTheme, page: PageEvent<Reflection>, options: Options);
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
iconsCache(): JSX.Element;
|
|
14
|
+
get icons(): Readonly<typeof icons>;
|
|
15
|
+
set icons(value: Readonly<typeof icons>);
|
|
16
|
+
hook: (name: keyof RendererHooks) => JSX.Element[];
|
|
12
17
|
/** Avoid this in favor of urlTo if possible */
|
|
13
18
|
relativeURL: (url: string, cacheBust?: boolean) => string;
|
|
14
19
|
urlTo: (reflection: Reflection) => string;
|
|
15
20
|
markdown: (md: readonly CommentDisplayPart[] | NeverIfInternal<string | undefined>) => string;
|
|
21
|
+
getNavigation: () => import("./DefaultTheme").NavigationElement[];
|
|
16
22
|
getReflectionClasses: (refl: DeclarationReflection) => string;
|
|
17
|
-
reflectionTemplate: (props: PageEvent<import("../../../models").ContainerReflection>) =>
|
|
18
|
-
indexTemplate: (props: PageEvent<import("../../../models").ProjectReflection>) =>
|
|
19
|
-
defaultLayout: (template: import("../..").RenderTemplate<PageEvent<Reflection>>, props: PageEvent<Reflection>) =>
|
|
20
|
-
analytics: () =>
|
|
21
|
-
breadcrumb: (props: Reflection) =>
|
|
22
|
-
commentSummary: (props: Reflection) =>
|
|
23
|
-
commentTags: (props: Reflection) =>
|
|
24
|
-
reflectionFlags: (props: Reflection) =>
|
|
25
|
-
footer: () =>
|
|
26
|
-
header: (props: PageEvent<Reflection>) =>
|
|
27
|
-
hierarchy: (props: import("../../../models").DeclarationHierarchy | undefined) =>
|
|
28
|
-
index: (props: import("../../../models").ContainerReflection) =>
|
|
29
|
-
member: (props: DeclarationReflection) =>
|
|
30
|
-
memberDeclaration: (props: DeclarationReflection) =>
|
|
31
|
-
memberGetterSetter: (props: DeclarationReflection) =>
|
|
32
|
-
memberReference: (props: import("../../../models").ReferenceReflection) =>
|
|
23
|
+
reflectionTemplate: (props: PageEvent<import("../../../models").ContainerReflection>) => JSX.Element;
|
|
24
|
+
indexTemplate: (props: PageEvent<import("../../../models").ProjectReflection>) => JSX.Element;
|
|
25
|
+
defaultLayout: (template: import("../..").RenderTemplate<PageEvent<Reflection>>, props: PageEvent<Reflection>) => JSX.Element;
|
|
26
|
+
analytics: () => JSX.Element | undefined;
|
|
27
|
+
breadcrumb: (props: Reflection) => JSX.Element | undefined;
|
|
28
|
+
commentSummary: (props: Reflection) => JSX.Element | undefined;
|
|
29
|
+
commentTags: (props: Reflection) => JSX.Element | undefined;
|
|
30
|
+
reflectionFlags: (props: Reflection) => JSX.Element;
|
|
31
|
+
footer: () => JSX.Element | undefined;
|
|
32
|
+
header: (props: PageEvent<Reflection>) => JSX.Element;
|
|
33
|
+
hierarchy: (props: import("../../../models").DeclarationHierarchy | undefined) => JSX.Element | undefined;
|
|
34
|
+
index: (props: import("../../../models").ContainerReflection) => JSX.Element;
|
|
35
|
+
member: (props: DeclarationReflection) => JSX.Element;
|
|
36
|
+
memberDeclaration: (props: DeclarationReflection) => JSX.Element;
|
|
37
|
+
memberGetterSetter: (props: DeclarationReflection) => JSX.Element;
|
|
38
|
+
memberReference: (props: import("../../../models").ReferenceReflection) => JSX.Element;
|
|
33
39
|
memberSignatureBody: (r_0: import("../../../models").SignatureReflection, r_1?: {
|
|
34
40
|
hideSources?: boolean | undefined;
|
|
35
|
-
} | undefined) =>
|
|
41
|
+
} | undefined) => JSX.Element;
|
|
36
42
|
memberSignatureTitle: (r_0: import("../../../models").SignatureReflection, r_1?: {
|
|
37
43
|
hideName?: boolean | undefined;
|
|
38
44
|
arrowStyle?: boolean | undefined;
|
|
39
|
-
} | undefined) =>
|
|
40
|
-
memberSignatures: (props: DeclarationReflection) =>
|
|
41
|
-
memberSources: (props: import("../../../models").SignatureReflection | DeclarationReflection) =>
|
|
42
|
-
members: (props: import("../../../models").ContainerReflection) =>
|
|
43
|
-
membersGroup: (group: import("../../../models").ReflectionGroup) =>
|
|
44
|
-
sidebar: (props: PageEvent<Reflection>) =>
|
|
45
|
-
pageSidebar: (props: PageEvent<Reflection>) =>
|
|
46
|
-
sidebarLinks: () =>
|
|
47
|
-
settings: () =>
|
|
48
|
-
navigation: (props: PageEvent<Reflection>) =>
|
|
49
|
-
pageNavigation: (props: PageEvent<Reflection>) =>
|
|
50
|
-
parameter: (props: DeclarationReflection) =>
|
|
51
|
-
toolbar: (props: PageEvent<Reflection>) =>
|
|
52
|
-
type: (type: import("../../../models").Type | undefined) =>
|
|
53
|
-
typeAndParent: (props: import("../../../models").Type) =>
|
|
54
|
-
typeParameters: (typeParameters: import("../../../models").TypeParameterReflection[]) =>
|
|
45
|
+
} | undefined) => JSX.Element;
|
|
46
|
+
memberSignatures: (props: DeclarationReflection) => JSX.Element;
|
|
47
|
+
memberSources: (props: import("../../../models").SignatureReflection | DeclarationReflection) => JSX.Element;
|
|
48
|
+
members: (props: import("../../../models").ContainerReflection) => JSX.Element;
|
|
49
|
+
membersGroup: (group: import("../../../models").ReflectionGroup) => JSX.Element;
|
|
50
|
+
sidebar: (props: PageEvent<Reflection>) => JSX.Element;
|
|
51
|
+
pageSidebar: (props: PageEvent<Reflection>) => JSX.Element;
|
|
52
|
+
sidebarLinks: () => JSX.Element | null;
|
|
53
|
+
settings: () => JSX.Element;
|
|
54
|
+
navigation: (props: PageEvent<Reflection>) => JSX.Element;
|
|
55
|
+
pageNavigation: (props: PageEvent<Reflection>) => JSX.Element;
|
|
56
|
+
parameter: (props: DeclarationReflection) => JSX.Element;
|
|
57
|
+
toolbar: (props: PageEvent<Reflection>) => JSX.Element;
|
|
58
|
+
type: (type: import("../../../models").Type | undefined) => JSX.Element;
|
|
59
|
+
typeAndParent: (props: import("../../../models").Type) => JSX.Element;
|
|
60
|
+
typeParameters: (typeParameters: import("../../../models").TypeParameterReflection[]) => JSX.Element;
|
|
55
61
|
}
|
|
@@ -36,7 +36,6 @@ class DefaultThemeRenderContext {
|
|
|
36
36
|
constructor(theme, page, options) {
|
|
37
37
|
this.theme = theme;
|
|
38
38
|
this.page = page;
|
|
39
|
-
this.icons = icon_1.icons;
|
|
40
39
|
this.hook = (name) => this.theme.owner.hooks.emit(name, this);
|
|
41
40
|
/** Avoid this in favor of urlTo if possible */
|
|
42
41
|
this.relativeURL = (url, cacheBust = false) => {
|
|
@@ -55,6 +54,7 @@ class DefaultThemeRenderContext {
|
|
|
55
54
|
}
|
|
56
55
|
return md ? this.theme.markedPlugin.parseMarkdown(md, this.page) : "";
|
|
57
56
|
};
|
|
57
|
+
this.getNavigation = () => this.theme.getNavigation(this.page.project);
|
|
58
58
|
this.getReflectionClasses = (refl) => this.theme.getReflectionClasses(refl);
|
|
59
59
|
this.reflectionTemplate = bind(reflection_1.reflectionTemplate, this);
|
|
60
60
|
this.indexTemplate = bind(templates_1.indexTemplate, this);
|
|
@@ -90,6 +90,20 @@ class DefaultThemeRenderContext {
|
|
|
90
90
|
this.typeAndParent = bind(typeAndParent_1.typeAndParent, this);
|
|
91
91
|
this.typeParameters = bind(typeParameters_1.typeParameters, this);
|
|
92
92
|
this.options = options;
|
|
93
|
+
const { refs, cache } = (0, icon_1.buildRefIcons)(icon_1.icons);
|
|
94
|
+
this._refIcons = refs;
|
|
95
|
+
this._iconsCache = cache;
|
|
96
|
+
}
|
|
97
|
+
iconsCache() {
|
|
98
|
+
return this._iconsCache;
|
|
99
|
+
}
|
|
100
|
+
get icons() {
|
|
101
|
+
return this._refIcons;
|
|
102
|
+
}
|
|
103
|
+
set icons(value) {
|
|
104
|
+
const { refs, cache } = (0, icon_1.buildRefIcons)(value);
|
|
105
|
+
this._refIcons = refs;
|
|
106
|
+
this._iconsCache = cache;
|
|
93
107
|
}
|
|
94
108
|
}
|
|
95
109
|
exports.DefaultThemeRenderContext = DefaultThemeRenderContext;
|
|
@@ -18,6 +18,7 @@ const defaultLayout = (context, template, props) => (utils_1.JSX.createElement("
|
|
|
18
18
|
context.options.getValue("customCss") && (utils_1.JSX.createElement("link", { rel: "stylesheet", href: context.relativeURL("assets/custom.css", true) })),
|
|
19
19
|
utils_1.JSX.createElement("script", { defer: true, src: context.relativeURL("assets/main.js", true) }),
|
|
20
20
|
utils_1.JSX.createElement("script", { async: true, src: context.relativeURL("assets/search.js", true), id: "tsd-search-script" }),
|
|
21
|
+
utils_1.JSX.createElement("script", { async: true, src: context.relativeURL("assets/navigation.js", true), id: "tsd-nav-script" }),
|
|
21
22
|
context.hook("head.end")),
|
|
22
23
|
utils_1.JSX.createElement("body", null,
|
|
23
24
|
context.hook("body.begin"),
|
|
@@ -42,5 +43,6 @@ const defaultLayout = (context, template, props) => (utils_1.JSX.createElement("
|
|
|
42
43
|
context.footer(),
|
|
43
44
|
utils_1.JSX.createElement("div", { class: "overlay" }),
|
|
44
45
|
context.analytics(),
|
|
46
|
+
context.iconsCache(),
|
|
45
47
|
context.hook("body.end"))));
|
|
46
48
|
exports.defaultLayout = defaultLayout;
|
|
@@ -8,7 +8,7 @@ const header = (context, props) => {
|
|
|
8
8
|
const HeadingLevel = props.model.isProject() ? "h2" : "h1";
|
|
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
|
-
utils_1.JSX.createElement(HeadingLevel,
|
|
11
|
+
utils_1.JSX.createElement(HeadingLevel, { class: (0, lib_1.classNames)({ deprecated: props.model.isDeprecated() }) },
|
|
12
12
|
props.model.kind !== models_1.ReflectionKind.Project && `${models_1.ReflectionKind.singularString(props.model.kind)} `,
|
|
13
13
|
(0, lib_1.getDisplayName)(props.model),
|
|
14
14
|
(0, lib_1.hasTypeParameters)(props.model) && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { ReflectionKind } from "../../../../models";
|
|
2
2
|
import { JSX } from "../../../../utils";
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function buildRefIcons<T extends Record<string, () => JSX.Element>>(icons: T): {
|
|
4
|
+
refs: T;
|
|
5
|
+
cache: JSX.Element;
|
|
6
|
+
};
|
|
4
7
|
export declare const icons: Record<ReflectionKind | "chevronDown" | "checkbox" | "menu" | "search" | "chevronSmall" | "anchor", () => JSX.Element>;
|
|
@@ -1,77 +1,87 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.icons = exports.
|
|
6
|
+
exports.icons = exports.buildRefIcons = void 0;
|
|
7
|
+
const assert_1 = __importDefault(require("assert"));
|
|
4
8
|
const models_1 = require("../../../../models");
|
|
5
9
|
const utils_1 = require("../../../../utils");
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const kindIcon = (letterPath, color, circular = false) => (utils_1.JSX.createElement("svg", { class: "tsd-kind-icon", viewBox: "0 0 24 24" },
|
|
11
|
+
utils_1.JSX.createElement("rect", { fill: "var(--color-icon-background)", stroke: color, "stroke-width": "1.5", x: "1", y: "1", width: "22", height: "22", rx: circular ? "12" : "6" }),
|
|
12
|
+
letterPath));
|
|
13
|
+
function buildRefIcons(icons) {
|
|
14
|
+
const refs = {};
|
|
15
|
+
const children = [];
|
|
16
|
+
for (const [name, builder] of Object.entries(icons)) {
|
|
17
|
+
const jsx = builder.call(icons);
|
|
18
|
+
(0, assert_1.default)(jsx.tag === "svg", "TypeDoc's frontend assumes that icons are written as svg elements");
|
|
19
|
+
// This one cannot be cached because the CSS selector depends on targeting SVG elements
|
|
20
|
+
// within it. Ick. Surely there's a nicer way?
|
|
21
|
+
if (name === "checkbox") {
|
|
22
|
+
refs[name] = () => jsx;
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
children.push(utils_1.JSX.createElement("g", { id: `icon-${name}` }, jsx.children));
|
|
26
|
+
const ref = (utils_1.JSX.createElement("svg", { ...jsx.props, id: undefined },
|
|
27
|
+
utils_1.JSX.createElement("use", { href: `#icon-${name}` })));
|
|
28
|
+
refs[name] = () => ref;
|
|
14
29
|
}
|
|
15
|
-
seenIcons.add(key);
|
|
16
30
|
return {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
...svgPart.props,
|
|
20
|
-
id: `icon-${key}`,
|
|
21
|
-
},
|
|
31
|
+
refs: refs,
|
|
32
|
+
cache: utils_1.JSX.createElement("svg", { style: "display: none" }, children),
|
|
22
33
|
};
|
|
23
34
|
}
|
|
24
|
-
|
|
25
|
-
utils_1.JSX.createElement("rect", { fill: "var(--color-icon-background)", stroke: color, "stroke-width": "1.5", x: "1", y: "1", width: "22", height: "22", rx: circular ? "12" : "6" }),
|
|
26
|
-
letterPath))));
|
|
35
|
+
exports.buildRefIcons = buildRefIcons;
|
|
27
36
|
exports.icons = {
|
|
28
|
-
[models_1.ReflectionKind.Accessor]: () => kindIcon(
|
|
37
|
+
[models_1.ReflectionKind.Accessor]: () => kindIcon(utils_1.JSX.createElement("path", { d: "M8.85 16L11.13 7.24H12.582L14.85 16H13.758L13.182 13.672H10.53L9.954 16H8.85ZM10.746 12.76H12.954L12.282 10.06C12.154 9.548 12.054 9.12 11.982 8.776C11.91 8.432 11.866 8.208 11.85 8.104C11.834 8.208 11.79 8.432 11.718 8.776C11.646 9.12 11.546 9.544 11.418 10.048L10.746 12.76Z", fill: "var(--color-text)" }), "#FF4D4D", true),
|
|
29
38
|
[models_1.ReflectionKind.CallSignature]() {
|
|
30
39
|
return this[models_1.ReflectionKind.Function]();
|
|
31
40
|
},
|
|
32
|
-
[models_1.ReflectionKind.Class]: () => kindIcon(
|
|
33
|
-
[models_1.ReflectionKind.Constructor]: () => kindIcon(
|
|
41
|
+
[models_1.ReflectionKind.Class]: () => kindIcon(utils_1.JSX.createElement("path", { d: "M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z", fill: "var(--color-text)" }), "var(--color-ts-class)"),
|
|
42
|
+
[models_1.ReflectionKind.Constructor]: () => kindIcon(utils_1.JSX.createElement("path", { d: "M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z", fill: "var(--color-text)" }), "#4D7FFF", true),
|
|
34
43
|
[models_1.ReflectionKind.ConstructorSignature]() {
|
|
35
44
|
return this[models_1.ReflectionKind.Constructor]();
|
|
36
45
|
},
|
|
37
|
-
[models_1.ReflectionKind.Enum]: () => kindIcon(
|
|
46
|
+
[models_1.ReflectionKind.Enum]: () => kindIcon(utils_1.JSX.createElement("path", { d: "M9.45 16V7.24H14.49V8.224H10.518V10.936H14.07V11.908H10.518V15.016H14.49V16H9.45Z", fill: "var(--color-text)" }), "var(--color-ts-enum)"),
|
|
38
47
|
[models_1.ReflectionKind.EnumMember]() {
|
|
39
48
|
return this[models_1.ReflectionKind.Property]();
|
|
40
49
|
},
|
|
41
|
-
[models_1.ReflectionKind.Function]: () => kindIcon(
|
|
50
|
+
[models_1.ReflectionKind.Function]: () => kindIcon(utils_1.JSX.createElement("path", { d: "M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z", fill: "var(--color-text)" }), "var(--color-ts-function)"),
|
|
42
51
|
[models_1.ReflectionKind.GetSignature]() {
|
|
43
52
|
return this[models_1.ReflectionKind.Accessor]();
|
|
44
53
|
},
|
|
45
54
|
[models_1.ReflectionKind.IndexSignature]() {
|
|
46
55
|
return this[models_1.ReflectionKind.Property]();
|
|
47
56
|
},
|
|
48
|
-
[models_1.ReflectionKind.Interface]: () => kindIcon(
|
|
49
|
-
[models_1.ReflectionKind.Method]: () => kindIcon(
|
|
57
|
+
[models_1.ReflectionKind.Interface]: () => kindIcon(utils_1.JSX.createElement("path", { d: "M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z", fill: "var(--color-text)" }), "var(--color-ts-interface)"),
|
|
58
|
+
[models_1.ReflectionKind.Method]: () => kindIcon(utils_1.JSX.createElement("path", { d: "M9.162 16V7.24H10.578L11.514 10.072C11.602 10.328 11.674 10.584 11.73 10.84C11.794 11.088 11.842 11.28 11.874 11.416C11.906 11.28 11.954 11.088 12.018 10.84C12.082 10.584 12.154 10.324 12.234 10.06L13.122 7.24H14.538V16H13.482V12.82C13.482 12.468 13.49 12.068 13.506 11.62C13.53 11.172 13.558 10.716 13.59 10.252C13.622 9.78 13.654 9.332 13.686 8.908C13.726 8.476 13.762 8.1 13.794 7.78L12.366 12.16H11.334L9.894 7.78C9.934 8.092 9.97 8.456 10.002 8.872C10.042 9.28 10.078 9.716 10.11 10.18C10.142 10.636 10.166 11.092 10.182 11.548C10.206 12.004 10.218 12.428 10.218 12.82V16H9.162Z", fill: "var(--color-text)" }), "#FF4DB8", true),
|
|
50
59
|
[models_1.ReflectionKind.Module]() {
|
|
51
60
|
return this[models_1.ReflectionKind.Namespace]();
|
|
52
61
|
},
|
|
53
|
-
[models_1.ReflectionKind.Namespace]: () => kindIcon(
|
|
62
|
+
[models_1.ReflectionKind.Namespace]: () => kindIcon(utils_1.JSX.createElement("path", { d: "M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z", fill: "var(--color-text)" }), "var(--color-ts-namespace)"),
|
|
54
63
|
[models_1.ReflectionKind.Parameter]() {
|
|
55
64
|
return this[models_1.ReflectionKind.Property]();
|
|
56
65
|
},
|
|
57
66
|
[models_1.ReflectionKind.Project]() {
|
|
58
67
|
return this[models_1.ReflectionKind.Namespace]();
|
|
59
68
|
},
|
|
60
|
-
[models_1.ReflectionKind.Property]: () => kindIcon(
|
|
61
|
-
[models_1.ReflectionKind.Reference]: () => kindIcon(
|
|
69
|
+
[models_1.ReflectionKind.Property]: () => kindIcon(utils_1.JSX.createElement("path", { d: "M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z", fill: "var(--color-text)" }), "#FF984D", true),
|
|
70
|
+
[models_1.ReflectionKind.Reference]: () => kindIcon(utils_1.JSX.createElement("path", { d: "M10.354 17V8.24H13.066C13.586 8.24 14.042 8.348 14.434 8.564C14.826 8.772 15.13 9.064 15.346 9.44C15.562 9.816 15.67 10.256 15.67 10.76C15.67 11.352 15.514 11.86 15.202 12.284C14.898 12.708 14.482 13 13.954 13.16L15.79 17H14.518L12.838 13.28H11.434V17H10.354ZM11.434 12.308H13.066C13.514 12.308 13.874 12.168 14.146 11.888C14.418 11.6 14.554 11.224 14.554 10.76C14.554 10.288 14.418 9.912 14.146 9.632C13.874 9.352 13.514 9.212 13.066 9.212H11.434V12.308Z", fill: "var(--color-text)" }), "#FF4D82", // extract into a CSS variable potentially?
|
|
62
71
|
true),
|
|
63
72
|
[models_1.ReflectionKind.SetSignature]() {
|
|
64
73
|
return this[models_1.ReflectionKind.Accessor]();
|
|
65
74
|
},
|
|
66
|
-
[models_1.ReflectionKind.TypeAlias]: () => kindIcon(
|
|
75
|
+
[models_1.ReflectionKind.TypeAlias]: () => kindIcon(utils_1.JSX.createElement("path", { d: "M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z", fill: "var(--color-text)" }), "var(--color-ts-type-alias)"),
|
|
67
76
|
[models_1.ReflectionKind.TypeLiteral]() {
|
|
68
77
|
return this[models_1.ReflectionKind.TypeAlias]();
|
|
69
78
|
},
|
|
70
79
|
[models_1.ReflectionKind.TypeParameter]() {
|
|
71
80
|
return this[models_1.ReflectionKind.TypeAlias]();
|
|
72
81
|
},
|
|
73
|
-
[models_1.ReflectionKind.Variable]: () => kindIcon(
|
|
74
|
-
chevronDown: () => (utils_1.JSX.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none" },
|
|
82
|
+
[models_1.ReflectionKind.Variable]: () => kindIcon(utils_1.JSX.createElement("path", { d: "M11.106 16L8.85 7.24H9.966L11.454 13.192C11.558 13.608 11.646 13.996 11.718 14.356C11.79 14.708 11.842 14.976 11.874 15.16C11.906 14.976 11.954 14.708 12.018 14.356C12.09 13.996 12.178 13.608 12.282 13.192L13.758 7.24H14.85L12.582 16H11.106Z", fill: "var(--color-text)" }), "var(--color-ts-variable)"),
|
|
83
|
+
chevronDown: () => (utils_1.JSX.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none" },
|
|
84
|
+
utils_1.JSX.createElement("path", { d: "M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z", fill: "var(--color-text)" }))),
|
|
75
85
|
chevronSmall: () => (utils_1.JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
|
|
76
86
|
utils_1.JSX.createElement("path", { d: "M1.5 5.50969L8 11.6609L14.5 5.50969L12.5466 3.66086L8 7.96494L3.45341 3.66086L1.5 5.50969Z", fill: "var(--color-text)" }))),
|
|
77
87
|
checkbox: () => (utils_1.JSX.createElement("svg", { width: "32", height: "32", viewBox: "0 0 32 32", "aria-hidden": "true" },
|
|
@@ -80,8 +90,9 @@ exports.icons = {
|
|
|
80
90
|
menu: () => (utils_1.JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, ["3", "7", "11"].map((y) => (utils_1.JSX.createElement("rect", { x: "1", y: y, width: "14", height: "2", fill: "var(--color-text)" }))))),
|
|
81
91
|
search: () => (utils_1.JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
|
|
82
92
|
utils_1.JSX.createElement("path", { d: "M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z", fill: "var(--color-text)" }))),
|
|
83
|
-
anchor: () => (utils_1.JSX.createElement("svg", { viewBox: "0 0 24 24" },
|
|
84
|
-
utils_1.JSX.createElement("
|
|
85
|
-
|
|
86
|
-
|
|
93
|
+
anchor: () => (utils_1.JSX.createElement("svg", { viewBox: "0 0 24 24" },
|
|
94
|
+
utils_1.JSX.createElement("g", { "stroke-width": "2", stroke: "currentColor", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round" },
|
|
95
|
+
utils_1.JSX.createElement("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
|
|
96
|
+
utils_1.JSX.createElement("path", { d: "M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5" }),
|
|
97
|
+
utils_1.JSX.createElement("path", { d: "M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5" })))),
|
|
87
98
|
};
|
|
@@ -23,7 +23,7 @@ function memberSignatureBody(context, props, { hideSources = false } = {}) {
|
|
|
23
23
|
" = ",
|
|
24
24
|
item.defaultValue))),
|
|
25
25
|
context.commentSummary(item),
|
|
26
|
-
context.
|
|
26
|
+
context.commentTags(item),
|
|
27
27
|
item.type instanceof models_1.ReflectionType && context.parameter(item.type.declaration))))))),
|
|
28
28
|
props.type && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
29
29
|
utils_1.JSX.createElement("h4", { class: "tsd-returns-title" },
|
|
@@ -4,6 +4,7 @@ exports.pageNavigation = exports.pageSidebar = exports.navigation = exports.sett
|
|
|
4
4
|
const models_1 = require("../../../../models");
|
|
5
5
|
const utils_1 = require("../../../../utils");
|
|
6
6
|
const lib_1 = require("../../lib");
|
|
7
|
+
const MAX_EMBEDDED_NAV_SIZE = 20;
|
|
7
8
|
function sidebar(context, props) {
|
|
8
9
|
return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
9
10
|
context.sidebarLinks(),
|
|
@@ -62,77 +63,43 @@ function settings(context) {
|
|
|
62
63
|
utils_1.JSX.createElement("option", { value: "dark" }, "Dark")))))));
|
|
63
64
|
}
|
|
64
65
|
exports.settings = settings;
|
|
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) {
|
|
78
|
-
if (parent instanceof models_1.ReflectionCategory) {
|
|
79
|
-
return parent.children;
|
|
80
|
-
}
|
|
81
|
-
if (parent instanceof models_1.ReflectionGroup) {
|
|
82
|
-
if (shouldShowCategories(parent.owningReflection, opts) && parent.categories) {
|
|
83
|
-
return parent.categories;
|
|
84
|
-
}
|
|
85
|
-
return parent.children;
|
|
86
|
-
}
|
|
87
|
-
if (!parent.kindOf(models_1.ReflectionKind.SomeModule | models_1.ReflectionKind.Project)) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
if (parent.categories && shouldShowCategories(parent, opts)) {
|
|
91
|
-
return parent.categories;
|
|
92
|
-
}
|
|
93
|
-
if (parent.groups && shouldShowGroups(parent, opts)) {
|
|
94
|
-
return parent.groups;
|
|
95
|
-
}
|
|
96
|
-
return parent.children;
|
|
97
|
-
};
|
|
98
66
|
const navigation = function navigation(context, props) {
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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, []))))));
|
|
105
|
-
function links(mod, parents) {
|
|
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);
|
|
107
|
-
const children = getNavigationElements(mod, opts);
|
|
108
|
-
if (!children || (!opts.fullTree && mod instanceof models_1.Reflection && !inPath(mod))) {
|
|
109
|
-
return createNavElement(mod, nameClasses);
|
|
67
|
+
const nav = context.getNavigation();
|
|
68
|
+
let elements = 0;
|
|
69
|
+
function link(el, path = []) {
|
|
70
|
+
if (elements > MAX_EMBEDDED_NAV_SIZE) {
|
|
71
|
+
return utils_1.JSX.createElement(utils_1.JSX.Fragment, null);
|
|
110
72
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
utils_1.JSX.createElement("
|
|
114
|
-
context.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
utils_1.JSX.createElement("ul", { class: "tsd-nested-navigation" }, children.map((c) => (utils_1.JSX.createElement("li", null, links(c, childParents))))))));
|
|
118
|
-
}
|
|
119
|
-
function createNavElement(child, nameClasses) {
|
|
120
|
-
if (child instanceof models_1.Reflection) {
|
|
121
|
-
return (utils_1.JSX.createElement("a", { href: context.urlTo(child), class: (0, lib_1.classNames)({ current: child === props.model }, nameClasses) },
|
|
122
|
-
context.icons[child.kind](),
|
|
123
|
-
utils_1.JSX.createElement("span", null, (0, lib_1.wbr)((0, lib_1.getDisplayName)(child)))));
|
|
73
|
+
if (el.path) {
|
|
74
|
+
++elements;
|
|
75
|
+
return (utils_1.JSX.createElement("li", null,
|
|
76
|
+
utils_1.JSX.createElement("a", { href: context.relativeURL(el.path), class: (0, lib_1.classNames)({ current: props.model.url === el.path }, el.class) },
|
|
77
|
+
el.kind && context.icons[el.kind](),
|
|
78
|
+
el.text)));
|
|
124
79
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
80
|
+
// Top level element is a group/category, recurse so that we don't have a half-broken
|
|
81
|
+
// navigation tree for people with JS turned off.
|
|
82
|
+
if (el.children) {
|
|
83
|
+
++elements;
|
|
84
|
+
const fullPath = [...path, el.text];
|
|
85
|
+
return (utils_1.JSX.createElement("details", { class: (0, lib_1.classNames)({ "tsd-index-accordion": true }, el.class), "data-key": fullPath.join("$") },
|
|
86
|
+
utils_1.JSX.createElement("summary", { class: "tsd-accordion-summary" },
|
|
87
|
+
context.icons.chevronDown(),
|
|
88
|
+
utils_1.JSX.createElement("span", null, el.text)),
|
|
89
|
+
utils_1.JSX.createElement("div", { class: "tsd-accordion-details" },
|
|
90
|
+
utils_1.JSX.createElement("ul", { class: "tsd-nested-navigation" }, el.children.map((c) => link(c, fullPath))))));
|
|
91
|
+
}
|
|
92
|
+
return (utils_1.JSX.createElement("li", null,
|
|
93
|
+
utils_1.JSX.createElement("span", null, el.text)));
|
|
135
94
|
}
|
|
95
|
+
const navEl = nav.map((el) => link(el));
|
|
96
|
+
return (utils_1.JSX.createElement("nav", { class: "tsd-navigation" },
|
|
97
|
+
utils_1.JSX.createElement("a", { href: context.urlTo(props.project), class: (0, lib_1.classNames)({ current: props.project === props.model }) },
|
|
98
|
+
context.icons[models_1.ReflectionKind.Project](),
|
|
99
|
+
utils_1.JSX.createElement("span", null, (0, lib_1.getDisplayName)(props.project))),
|
|
100
|
+
utils_1.JSX.createElement("ul", { class: "tsd-small-nested-navigation", id: "tsd-nav-container", "data-base": context.relativeURL("./") },
|
|
101
|
+
navEl,
|
|
102
|
+
elements < MAX_EMBEDDED_NAV_SIZE || utils_1.JSX.createElement("li", null, "Loading..."))));
|
|
136
103
|
};
|
|
137
104
|
exports.navigation = navigation;
|
|
138
105
|
function pageSidebar(context, props) {
|
|
@@ -23,7 +23,7 @@ export interface ComponentOptions {
|
|
|
23
23
|
/**
|
|
24
24
|
* Class decorator applied to Components
|
|
25
25
|
*/
|
|
26
|
-
export declare function Component(options: ComponentOptions):
|
|
26
|
+
export declare function Component(options: ComponentOptions): (target: Function, _context: unknown) => void;
|
|
27
27
|
export declare class ComponentEvent extends Event {
|
|
28
28
|
owner: ComponentHost;
|
|
29
29
|
component: AbstractComponent<ComponentHost>;
|
|
@@ -7,7 +7,9 @@ const childMappings = [];
|
|
|
7
7
|
* Class decorator applied to Components
|
|
8
8
|
*/
|
|
9
9
|
function Component(options) {
|
|
10
|
-
|
|
10
|
+
// _context is ClassDecoratorContext, but that then requires a public constructor
|
|
11
|
+
// which Application does not have.
|
|
12
|
+
return (target, _context) => {
|
|
11
13
|
const proto = target.prototype;
|
|
12
14
|
if (!(proto instanceof AbstractComponent)) {
|
|
13
15
|
throw new Error("The `Component` decorator can only be used with a subclass of `AbstractComponent`.");
|
|
@@ -65,6 +65,7 @@ function getEntryPoints(logger, options) {
|
|
|
65
65
|
return [];
|
|
66
66
|
}
|
|
67
67
|
const entryPoints = options.getValue("entryPoints");
|
|
68
|
+
const exclude = options.getValue("exclude");
|
|
68
69
|
// May be set explicitly to be an empty array to only include a readme for a package
|
|
69
70
|
// See #2264
|
|
70
71
|
if (entryPoints.length === 0) {
|
|
@@ -74,10 +75,10 @@ function getEntryPoints(logger, options) {
|
|
|
74
75
|
const strategy = options.getValue("entryPointStrategy");
|
|
75
76
|
switch (strategy) {
|
|
76
77
|
case exports.EntryPointStrategy.Resolve:
|
|
77
|
-
result = getEntryPointsForPaths(logger, expandGlobs(entryPoints, logger), options);
|
|
78
|
+
result = getEntryPointsForPaths(logger, expandGlobs(entryPoints, exclude, logger), options);
|
|
78
79
|
break;
|
|
79
80
|
case exports.EntryPointStrategy.Expand:
|
|
80
|
-
result = getExpandedEntryPointsForPaths(logger, expandGlobs(entryPoints, logger), options);
|
|
81
|
+
result = getExpandedEntryPointsForPaths(logger, expandGlobs(entryPoints, exclude, logger), options);
|
|
81
82
|
break;
|
|
82
83
|
case exports.EntryPointStrategy.Merge:
|
|
83
84
|
case exports.EntryPointStrategy.Packages:
|
|
@@ -96,18 +97,23 @@ exports.getEntryPoints = getEntryPoints;
|
|
|
96
97
|
function getWatchEntryPoints(logger, options, program) {
|
|
97
98
|
let result;
|
|
98
99
|
const entryPoints = options.getValue("entryPoints");
|
|
99
|
-
|
|
100
|
+
const exclude = options.getValue("exclude");
|
|
101
|
+
const strategy = options.getValue("entryPointStrategy");
|
|
102
|
+
switch (strategy) {
|
|
100
103
|
case exports.EntryPointStrategy.Resolve:
|
|
101
|
-
result = getEntryPointsForPaths(logger, entryPoints, options, [
|
|
102
|
-
program,
|
|
103
|
-
]);
|
|
104
|
+
result = getEntryPointsForPaths(logger, expandGlobs(entryPoints, exclude, logger), options, [program]);
|
|
104
105
|
break;
|
|
105
106
|
case exports.EntryPointStrategy.Expand:
|
|
106
|
-
result = getExpandedEntryPointsForPaths(logger, entryPoints, options, [program]);
|
|
107
|
+
result = getExpandedEntryPointsForPaths(logger, expandGlobs(entryPoints, exclude, logger), options, [program]);
|
|
107
108
|
break;
|
|
108
109
|
case exports.EntryPointStrategy.Packages:
|
|
109
110
|
logger.error("Watch mode does not support 'packages' style entry points.");
|
|
110
111
|
break;
|
|
112
|
+
case exports.EntryPointStrategy.Merge:
|
|
113
|
+
logger.error("Watch mode does not support 'merge' style entry points.");
|
|
114
|
+
break;
|
|
115
|
+
default:
|
|
116
|
+
(0, general_1.assertNever)(strategy);
|
|
111
117
|
}
|
|
112
118
|
if (result && result.length === 0) {
|
|
113
119
|
logger.error("Unable to find any entry points.");
|
|
@@ -131,7 +137,7 @@ function getModuleName(fileName, baseDir) {
|
|
|
131
137
|
* Converts a list of file-oriented paths in to DocumentationEntryPoints for conversion.
|
|
132
138
|
* This is in contrast with the package-oriented `getEntryPointsForPackages`
|
|
133
139
|
*/
|
|
134
|
-
function getEntryPointsForPaths(logger, inputFiles, options, programs = getEntryPrograms(logger, options)) {
|
|
140
|
+
function getEntryPointsForPaths(logger, inputFiles, options, programs = getEntryPrograms(inputFiles, logger, options)) {
|
|
135
141
|
const baseDir = options.getValue("basePath") || (0, fs_1.deriveRootDir)(inputFiles);
|
|
136
142
|
const entryPoints = [];
|
|
137
143
|
entryLoop: for (const fileOrDir of inputFiles.map(paths_1.normalizePath)) {
|
|
@@ -159,35 +165,47 @@ function getEntryPointsForPaths(logger, inputFiles, options, programs = getEntry
|
|
|
159
165
|
}
|
|
160
166
|
return entryPoints;
|
|
161
167
|
}
|
|
162
|
-
function getExpandedEntryPointsForPaths(logger, inputFiles, options, programs = getEntryPrograms(logger, options)) {
|
|
168
|
+
function getExpandedEntryPointsForPaths(logger, inputFiles, options, programs = getEntryPrograms(inputFiles, logger, options)) {
|
|
163
169
|
return getEntryPointsForPaths(logger, expandInputFiles(logger, inputFiles, options), options, programs);
|
|
164
170
|
}
|
|
165
171
|
exports.getExpandedEntryPointsForPaths = getExpandedEntryPointsForPaths;
|
|
166
|
-
function expandGlobs(inputFiles, logger) {
|
|
172
|
+
function expandGlobs(inputFiles, exclude, logger) {
|
|
173
|
+
const excludePatterns = (0, paths_1.createMinimatch)(exclude);
|
|
167
174
|
const base = (0, fs_1.deriveRootDir)(inputFiles);
|
|
168
175
|
const result = inputFiles.flatMap((entry) => {
|
|
169
176
|
const result = (0, fs_1.glob)(entry, base, {
|
|
170
177
|
includeDirectories: true,
|
|
171
178
|
followSymlinks: true,
|
|
172
179
|
});
|
|
180
|
+
const filtered = result.filter((file) => file === entry || !(0, paths_1.matchesAny)(excludePatterns, file));
|
|
173
181
|
if (result.length === 0) {
|
|
174
182
|
logger.warn(`The entrypoint glob ${(0, paths_1.nicePath)(entry)} did not match any files.`);
|
|
175
183
|
}
|
|
184
|
+
else if (filtered.length === 0) {
|
|
185
|
+
logger.warn(`The entrypoint glob ${(0, paths_1.nicePath)(entry)} did not match any files after applying exclude patterns.`);
|
|
186
|
+
}
|
|
176
187
|
else {
|
|
177
|
-
logger.verbose(`Expanded ${(0, paths_1.nicePath)(entry)} to:\n\t${
|
|
188
|
+
logger.verbose(`Expanded ${(0, paths_1.nicePath)(entry)} to:\n\t${filtered
|
|
178
189
|
.map(paths_1.nicePath)
|
|
179
190
|
.join("\n\t")}`);
|
|
180
191
|
}
|
|
181
|
-
return
|
|
192
|
+
return filtered;
|
|
182
193
|
});
|
|
183
194
|
return result;
|
|
184
195
|
}
|
|
185
|
-
function getEntryPrograms(logger, options) {
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
196
|
+
function getEntryPrograms(inputFiles, logger, options) {
|
|
197
|
+
const noTsConfigFound = options.getFileNames().length === 0 &&
|
|
198
|
+
options.getProjectReferences().length === 0;
|
|
199
|
+
const rootProgram = noTsConfigFound
|
|
200
|
+
? typescript_1.default.createProgram({
|
|
201
|
+
rootNames: inputFiles,
|
|
202
|
+
options: options.getCompilerOptions(),
|
|
203
|
+
})
|
|
204
|
+
: typescript_1.default.createProgram({
|
|
205
|
+
rootNames: options.getFileNames(),
|
|
206
|
+
options: options.getCompilerOptions(),
|
|
207
|
+
projectReferences: options.getProjectReferences(),
|
|
208
|
+
});
|
|
191
209
|
const programs = [rootProgram];
|
|
192
210
|
// This might be a solution style tsconfig, in which case we need to add a program for each
|
|
193
211
|
// reference so that the converter can look through each of these.
|
package/dist/lib/utils/events.js
CHANGED
|
@@ -66,7 +66,7 @@ function eventsApi(iteratee, events, name, callback, options) {
|
|
|
66
66
|
*/
|
|
67
67
|
function onApi(events, name, callback, options) {
|
|
68
68
|
if (callback) {
|
|
69
|
-
const handlers = (events[name]
|
|
69
|
+
const handlers = (events[name] ||= []);
|
|
70
70
|
const context = options.context, ctx = options.ctx, listening = options.listening, priority = options.priority;
|
|
71
71
|
if (listening) {
|
|
72
72
|
listening.count++;
|