typedoc 0.27.6 → 0.27.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/bin/typedoc +21 -2
- package/dist/index.d.ts +1 -1
- package/dist/lib/application.d.ts +30 -1
- package/dist/lib/application.js +97 -21
- package/dist/lib/cli.js +4 -4
- package/dist/lib/converter/converter.d.ts +2 -3
- package/dist/lib/converter/converter.js +15 -20
- package/dist/lib/converter/factories/signature.js +16 -4
- package/dist/lib/converter/plugins/IncludePlugin.d.ts +2 -0
- package/dist/lib/converter/plugins/IncludePlugin.js +177 -4
- package/dist/lib/converter/plugins/PackagePlugin.js +2 -0
- package/dist/lib/converter/symbols.js +21 -7
- package/dist/lib/converter/types.d.ts +2 -2
- package/dist/lib/converter/types.js +21 -18
- package/dist/lib/internationalization/internationalization.js +6 -2
- package/dist/lib/internationalization/locales/en.cjs +18 -1
- package/dist/lib/internationalization/locales/en.d.cts +17 -1
- package/dist/lib/internationalization/locales/ja.cjs +321 -0
- package/dist/lib/internationalization/locales/ja.d.cts +308 -0
- package/dist/lib/internationalization/locales/jp.cjs +2 -320
- package/dist/lib/internationalization/locales/jp.d.cts +2 -308
- package/dist/lib/internationalization/locales/zh.cjs +6 -3
- package/dist/lib/internationalization/locales/zh.d.cts +5 -2
- package/dist/lib/internationalization/translatable.d.ts +2 -1
- package/dist/lib/output/formatter.js +6 -1
- package/dist/lib/output/index.d.ts +1 -0
- package/dist/lib/output/plugins/AssetsPlugin.d.ts +1 -7
- package/dist/lib/output/plugins/AssetsPlugin.js +20 -8
- package/dist/lib/output/themes/MarkedPlugin.js +5 -3
- package/dist/lib/output/themes/default/DefaultTheme.d.ts +3 -39
- package/dist/lib/output/themes/default/DefaultTheme.js +19 -10
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +12 -12
- package/dist/lib/output/themes/default/layouts/default.js +3 -0
- package/dist/lib/output/themes/default/partials/icon.d.ts +17 -2
- package/dist/lib/output/themes/default/partials/icon.js +77 -79
- package/dist/lib/output/themes/default/partials/member.getterSetter.js +6 -6
- package/dist/lib/output/themes/default/partials/member.signatures.js +3 -3
- package/dist/lib/output/themes/default/templates/reflection.js +2 -2
- package/dist/lib/utils/fs.d.ts +2 -2
- package/dist/lib/utils/fs.js +4 -3
- package/dist/lib/utils/general.d.ts +1 -0
- package/dist/lib/utils/general.js +11 -0
- package/dist/lib/utils/options/declaration.d.ts +18 -12
- package/dist/lib/utils/options/declaration.js +37 -10
- package/dist/lib/utils/options/options.d.ts +3 -2
- package/dist/lib/utils/options/options.js +2 -2
- package/dist/lib/utils/options/readers/package-json.d.ts +1 -1
- package/dist/lib/utils/options/readers/package-json.js +2 -2
- package/dist/lib/utils/options/readers/tsconfig.d.ts +1 -1
- package/dist/lib/utils/options/readers/tsconfig.js +2 -2
- package/dist/lib/utils/options/readers/typedoc.d.ts +1 -1
- package/dist/lib/utils/options/readers/typedoc.js +4 -4
- package/dist/lib/utils/options/sources/typedoc.js +11 -4
- package/dist/lib/utils/tsconfig.d.ts +1 -1
- package/dist/lib/utils/tsconfig.js +2 -2
- package/dist/lib/validation/documentation.d.ts +1 -1
- package/dist/lib/validation/documentation.js +11 -1
- package/package.json +1 -1
- package/static/main.js +3 -3
- package/static/style.css +5 -4
|
@@ -38,7 +38,7 @@ import { UrlMapping } from "../../models/UrlMapping.js";
|
|
|
38
38
|
import { DefaultThemeRenderContext } from "./DefaultThemeRenderContext.js";
|
|
39
39
|
import { filterMap, JSX, Option } from "../../../utils/index.js";
|
|
40
40
|
import { classNames, getDisplayName, getHierarchyRoots, toStyleClass } from "../lib.js";
|
|
41
|
-
import {
|
|
41
|
+
import { getIcons } from "./partials/icon.js";
|
|
42
42
|
import { Slugger } from "./Slugger.js";
|
|
43
43
|
import { createNormalizedUrl } from "../../../utils/html.js";
|
|
44
44
|
let DefaultTheme = (() => {
|
|
@@ -74,7 +74,7 @@ let DefaultTheme = (() => {
|
|
|
74
74
|
* the icons used within the page, however TypeDoc currently assumes that all icons are svg
|
|
75
75
|
* elements, so custom themes must also use svg elements.
|
|
76
76
|
*/
|
|
77
|
-
icons
|
|
77
|
+
icons;
|
|
78
78
|
getRenderContext(pageEvent) {
|
|
79
79
|
return new DefaultThemeRenderContext(this, pageEvent, this.application.options);
|
|
80
80
|
}
|
|
@@ -150,6 +150,7 @@ let DefaultTheme = (() => {
|
|
|
150
150
|
*/
|
|
151
151
|
constructor(renderer) {
|
|
152
152
|
super(renderer);
|
|
153
|
+
this.icons = getIcons(renderer.application.i18n);
|
|
153
154
|
this.markedPlugin = renderer.markedPlugin;
|
|
154
155
|
}
|
|
155
156
|
/**
|
|
@@ -431,43 +432,51 @@ let DefaultTheme = (() => {
|
|
|
431
432
|
})();
|
|
432
433
|
export { DefaultTheme };
|
|
433
434
|
function getReflectionClasses(reflection, filters) {
|
|
434
|
-
const classes =
|
|
435
|
+
const classes = new Set();
|
|
435
436
|
// Filter classes should match up with the settings function in
|
|
436
437
|
// partials/navigation.tsx.
|
|
437
438
|
for (const key of Object.keys(filters)) {
|
|
438
439
|
if (key === "inherited") {
|
|
439
440
|
if (reflection.flags.isInherited) {
|
|
440
|
-
classes.
|
|
441
|
+
classes.add("tsd-is-inherited");
|
|
441
442
|
}
|
|
442
443
|
}
|
|
443
444
|
else if (key === "protected") {
|
|
444
445
|
if (reflection.flags.isProtected) {
|
|
445
|
-
classes.
|
|
446
|
+
classes.add("tsd-is-protected");
|
|
446
447
|
}
|
|
447
448
|
}
|
|
448
449
|
else if (key === "private") {
|
|
449
450
|
if (reflection.flags.isPrivate) {
|
|
450
|
-
classes.
|
|
451
|
+
classes.add("tsd-is-private");
|
|
451
452
|
}
|
|
452
453
|
}
|
|
453
454
|
else if (key === "external") {
|
|
454
455
|
if (reflection.flags.isExternal) {
|
|
455
|
-
classes.
|
|
456
|
+
classes.add("tsd-is-external");
|
|
456
457
|
}
|
|
457
458
|
}
|
|
458
459
|
else if (key.startsWith("@")) {
|
|
459
460
|
if (key === "@deprecated") {
|
|
460
461
|
if (reflection.isDeprecated()) {
|
|
461
|
-
classes.
|
|
462
|
+
classes.add(toStyleClass(`tsd-is-${key.substring(1)}`));
|
|
462
463
|
}
|
|
463
464
|
}
|
|
464
465
|
else if (reflection.comment?.hasModifier(key) ||
|
|
465
466
|
reflection.comment?.getTag(key)) {
|
|
466
|
-
classes.
|
|
467
|
+
classes.add(toStyleClass(`tsd-is-${key.substring(1)}`));
|
|
468
|
+
}
|
|
469
|
+
else if (reflection.isDeclaration()) {
|
|
470
|
+
const ownSignatures = reflection.getNonIndexSignatures();
|
|
471
|
+
// Check methods and accessors, find common tags, elevate
|
|
472
|
+
if (ownSignatures.length &&
|
|
473
|
+
ownSignatures.every((refl) => refl.comment?.hasModifier(key) || refl.comment?.getTag(key))) {
|
|
474
|
+
classes.add(toStyleClass(`tsd-is-${key.substring(1)}`));
|
|
475
|
+
}
|
|
467
476
|
}
|
|
468
477
|
}
|
|
469
478
|
}
|
|
470
|
-
return classes.join(" ");
|
|
479
|
+
return Array.from(classes).join(" ");
|
|
471
480
|
}
|
|
472
481
|
function shouldShowCategories(reflection, opts) {
|
|
473
482
|
if (opts.includeCategories) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { PageEvent, Renderer } from "../../index.js";
|
|
2
2
|
import type { Internationalization, TranslationProxy } from "../../../internationalization/internationalization.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { CommentDisplayPart, Reflection } from "../../../models/index.js";
|
|
4
4
|
import { type NeverIfInternal, type Options } from "../../../utils/index.js";
|
|
5
5
|
import type { DefaultTheme } from "./DefaultTheme.js";
|
|
6
|
-
import { type
|
|
6
|
+
import { type Icons } from "./partials/icon.js";
|
|
7
7
|
export declare class DefaultThemeRenderContext {
|
|
8
8
|
readonly theme: DefaultTheme;
|
|
9
9
|
page: PageEvent<Reflection>;
|
|
@@ -18,7 +18,7 @@ export declare class DefaultThemeRenderContext {
|
|
|
18
18
|
* Note: This creates a reference to icons declared by {@link DefaultTheme.icons},
|
|
19
19
|
* to customize icons, that object must be modified instead.
|
|
20
20
|
*/
|
|
21
|
-
get icons(): Readonly<
|
|
21
|
+
get icons(): Readonly<Icons>;
|
|
22
22
|
get slugger(): import("./Slugger.js").Slugger;
|
|
23
23
|
hook: Renderer["hooks"]["emit"];
|
|
24
24
|
/** Avoid this in favor of urlTo if possible */
|
|
@@ -28,8 +28,8 @@ export declare class DefaultThemeRenderContext {
|
|
|
28
28
|
/** Renders user comment markdown wrapped in a tsd-comment div */
|
|
29
29
|
displayParts: (parts: readonly CommentDisplayPart[] | undefined) => import("../../../utils/jsx.elements.js").JsxElement | undefined;
|
|
30
30
|
getNavigation: () => import("./DefaultTheme.js").NavigationElement[];
|
|
31
|
-
getReflectionClasses: (refl:
|
|
32
|
-
documentTemplate: (props: PageEvent<DocumentReflection>) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
31
|
+
getReflectionClasses: (refl: Reflection) => string;
|
|
32
|
+
documentTemplate: (props: PageEvent<import("../../../models/index.js").DocumentReflection>) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
33
33
|
reflectionTemplate: (props: PageEvent<import("../../../models/index.js").ContainerReflection>) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
34
34
|
indexTemplate: (props: PageEvent<import("../../../models/index.js").ProjectReflection>) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
35
35
|
hierarchyTemplate: (props: PageEvent<import("../../../models/index.js").ProjectReflection>) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
@@ -67,19 +67,19 @@ export declare class DefaultThemeRenderContext {
|
|
|
67
67
|
header: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
68
68
|
hierarchy: (typeHierarchy: import("../../../models/index.js").DeclarationHierarchy | undefined) => import("../../../utils/jsx.elements.js").JsxElement | undefined;
|
|
69
69
|
index: (props: import("../../../models/index.js").ContainerReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
70
|
-
member: (props: DeclarationReflection | DocumentReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
71
|
-
moduleReflection: (mod: DeclarationReflection | import("../../../models/index.js").ProjectReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
72
|
-
moduleMemberSummary: (member: DeclarationReflection | DocumentReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
73
|
-
memberDeclaration: (props: DeclarationReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
74
|
-
memberGetterSetter: (props: DeclarationReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
70
|
+
member: (props: import("../../../models/index.js").DeclarationReflection | import("../../../models/index.js").DocumentReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
71
|
+
moduleReflection: (mod: import("../../../models/index.js").DeclarationReflection | import("../../../models/index.js").ProjectReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
72
|
+
moduleMemberSummary: (member: import("../../../models/index.js").DeclarationReflection | import("../../../models/index.js").DocumentReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
73
|
+
memberDeclaration: (props: import("../../../models/index.js").DeclarationReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
74
|
+
memberGetterSetter: (props: import("../../../models/index.js").DeclarationReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
75
75
|
memberSignatureBody: (props: import("../../../models/index.js").SignatureReflection, r_1?: {
|
|
76
76
|
hideSources?: boolean;
|
|
77
77
|
} | undefined) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
78
78
|
memberSignatureTitle: (props: import("../../../models/index.js").SignatureReflection, options?: {
|
|
79
79
|
hideName?: boolean;
|
|
80
80
|
} | undefined) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
81
|
-
memberSignatures: (props: DeclarationReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
82
|
-
memberSources: (props: DeclarationReflection | import("../../../models/index.js").SignatureReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
81
|
+
memberSignatures: (props: import("../../../models/index.js").DeclarationReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
82
|
+
memberSources: (props: import("../../../models/index.js").DeclarationReflection | import("../../../models/index.js").SignatureReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
83
83
|
members: (props: import("../../../models/index.js").ContainerReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
84
84
|
sidebar: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
85
85
|
pageSidebar: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
@@ -5,6 +5,9 @@ function favicon(context) {
|
|
|
5
5
|
const fav = context.options.getValue("favicon");
|
|
6
6
|
if (!fav)
|
|
7
7
|
return null;
|
|
8
|
+
if (/^https?:\/\//i.test(fav)) {
|
|
9
|
+
return JSX.createElement("link", { rel: "icon", href: fav });
|
|
10
|
+
}
|
|
8
11
|
switch (extname(fav)) {
|
|
9
12
|
case ".ico":
|
|
10
13
|
return JSX.createElement("link", { rel: "icon", href: context.relativeURL("assets/favicon.ico", true) });
|
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import { ReflectionKind } from "../../../../models/index.js";
|
|
2
2
|
import { JSX } from "../../../../utils/index.js";
|
|
3
3
|
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
|
|
4
|
-
|
|
5
|
-
export declare
|
|
4
|
+
import type { TranslationProxy } from "../../../../internationalization/index.js";
|
|
5
|
+
export declare function buildRefIcons(icons: Icons, context: DefaultThemeRenderContext): Icons;
|
|
6
|
+
export interface Icons extends Record<ReflectionKind, () => JSX.Element> {
|
|
7
|
+
chevronDown(): JSX.Element;
|
|
8
|
+
checkbox(): JSX.Element;
|
|
9
|
+
menu(): JSX.Element;
|
|
10
|
+
search(): JSX.Element;
|
|
11
|
+
chevronSmall(): JSX.Element;
|
|
12
|
+
anchor(): JSX.Element;
|
|
13
|
+
folder(): JSX.Element;
|
|
14
|
+
alertNote(): JSX.Element;
|
|
15
|
+
alertTip(): JSX.Element;
|
|
16
|
+
alertImportant(): JSX.Element;
|
|
17
|
+
alertWarning(): JSX.Element;
|
|
18
|
+
alertCaution(): JSX.Element;
|
|
19
|
+
}
|
|
20
|
+
export declare function getIcons(i18n: TranslationProxy): Icons;
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import assert from "assert";
|
|
4
4
|
import { ReflectionKind } from "../../../../models/index.js";
|
|
5
5
|
import { JSX } from "../../../../utils/index.js";
|
|
6
|
-
const kindIcon = (letterPath, color, circular = false) => (JSX.createElement("svg", { class: "tsd-kind-icon", viewBox: "0 0 24 24" },
|
|
6
|
+
const kindIcon = (letterPath, color, label, circular = false) => (JSX.createElement("svg", { class: "tsd-kind-icon", viewBox: "0 0 24 24", "aria-label": label },
|
|
7
7
|
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" }),
|
|
8
8
|
letterPath));
|
|
9
|
-
const textIcon = (letter, color, circular = false) => kindIcon(JSX.createElement("text", { fill: "var(--color-icon-text)", x: "50%", y: "50%", "dominant-baseline": "central", "text-anchor": "middle" }, letter), color, circular);
|
|
9
|
+
const textIcon = (letter, color, label, circular = false) => kindIcon(JSX.createElement("text", { fill: "var(--color-icon-text)", x: "50%", y: "50%", "dominant-baseline": "central", "text-anchor": "middle" }, letter), color, label, circular);
|
|
10
10
|
export function buildRefIcons(icons, context) {
|
|
11
11
|
const refs = {};
|
|
12
12
|
for (const [name, builder] of Object.entries(icons)) {
|
|
@@ -24,80 +24,78 @@ export function buildRefIcons(icons, context) {
|
|
|
24
24
|
}
|
|
25
25
|
return refs;
|
|
26
26
|
}
|
|
27
|
-
export
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
JSX.createElement("
|
|
74
|
-
|
|
75
|
-
JSX.createElement("
|
|
76
|
-
|
|
77
|
-
JSX.createElement("
|
|
78
|
-
|
|
79
|
-
JSX.createElement("
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
JSX.createElement("
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
JSX.createElement("path", { d: "
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
JSX.createElement("
|
|
95
|
-
|
|
96
|
-
JSX.createElement("
|
|
97
|
-
|
|
98
|
-
JSX.createElement("
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
JSX.createElement("path", { fill: "var(--color-alert-caution)", d: "M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z" }))),
|
|
103
|
-
};
|
|
27
|
+
export function getIcons(i18n) {
|
|
28
|
+
return {
|
|
29
|
+
[ReflectionKind.Accessor]: () => textIcon("A", "var(--color-ts-accessor)", i18n.kind_accessor(), true),
|
|
30
|
+
[ReflectionKind.CallSignature]() {
|
|
31
|
+
return this[ReflectionKind.Function]();
|
|
32
|
+
},
|
|
33
|
+
[ReflectionKind.Class]: () => textIcon("C", "var(--color-ts-class)", i18n.kind_class()),
|
|
34
|
+
[ReflectionKind.Constructor]: () => textIcon("C", "var(--color-ts-constructor)", i18n.kind_constructor(), true),
|
|
35
|
+
[ReflectionKind.ConstructorSignature]() {
|
|
36
|
+
return this[ReflectionKind.Constructor]();
|
|
37
|
+
},
|
|
38
|
+
[ReflectionKind.Enum]: () => textIcon("E", "var(--color-ts-enum)", i18n.kind_enum()),
|
|
39
|
+
[ReflectionKind.EnumMember]: () => textIcon("P", "var(--color-ts-property)", i18n.kind_enum_member(), true),
|
|
40
|
+
[ReflectionKind.Function]: () => textIcon("F", "var(--color-ts-function)", i18n.kind_function()),
|
|
41
|
+
[ReflectionKind.GetSignature]() {
|
|
42
|
+
return this[ReflectionKind.Accessor]();
|
|
43
|
+
},
|
|
44
|
+
[ReflectionKind.IndexSignature]: () => textIcon("P", "var(--color-ts-property)", i18n.kind_index_signature(), true),
|
|
45
|
+
[ReflectionKind.Interface]: () => textIcon("I", "var(--color-ts-interface)", i18n.kind_interface()),
|
|
46
|
+
[ReflectionKind.Method]: () => textIcon("M", "var(--color-ts-method)", i18n.kind_method(), true),
|
|
47
|
+
[ReflectionKind.Module]: () => textIcon("M", "var(--color-ts-module)", i18n.kind_module()),
|
|
48
|
+
[ReflectionKind.Namespace]: () => textIcon("N", "var(--color-ts-namespace)", i18n.kind_namespace()),
|
|
49
|
+
[ReflectionKind.Parameter]() {
|
|
50
|
+
return this[ReflectionKind.Property]();
|
|
51
|
+
},
|
|
52
|
+
[ReflectionKind.Project]() {
|
|
53
|
+
return this[ReflectionKind.Module]();
|
|
54
|
+
},
|
|
55
|
+
[ReflectionKind.Property]: () => textIcon("P", "var(--color-ts-property)", i18n.kind_property(), true),
|
|
56
|
+
[ReflectionKind.Reference]: () => textIcon("R", "var(--color-ts-reference)", i18n.kind_reference(), true),
|
|
57
|
+
[ReflectionKind.SetSignature]() {
|
|
58
|
+
return this[ReflectionKind.Accessor]();
|
|
59
|
+
},
|
|
60
|
+
[ReflectionKind.TypeAlias]: () => textIcon("T", "var(--color-ts-type-alias)", i18n.kind_type_alias()),
|
|
61
|
+
[ReflectionKind.TypeLiteral]() {
|
|
62
|
+
return this[ReflectionKind.TypeAlias]();
|
|
63
|
+
},
|
|
64
|
+
[ReflectionKind.TypeParameter]() {
|
|
65
|
+
return this[ReflectionKind.TypeAlias]();
|
|
66
|
+
},
|
|
67
|
+
[ReflectionKind.Variable]: () => textIcon("V", "var(--color-ts-variable)", i18n.kind_variable()),
|
|
68
|
+
[ReflectionKind.Document]: () => kindIcon(JSX.createElement("g", { stroke: "var(--color-icon-text)", fill: "none", "stroke-width": "1.5" },
|
|
69
|
+
JSX.createElement("polygon", { points: "6,5 6,19 18,19, 18,10 13,5" }),
|
|
70
|
+
JSX.createElement("line", { x1: "9", y1: "9", x2: "13", y2: "9" }),
|
|
71
|
+
JSX.createElement("line", { x1: "9", y1: "12", x2: "15", y2: "12" }),
|
|
72
|
+
JSX.createElement("line", { x1: "9", y1: "15", x2: "15", y2: "15" })), "var(--color-document)", i18n.kind_document()),
|
|
73
|
+
folder: () => kindIcon(JSX.createElement("g", { stroke: "var(--color-icon-text)", fill: "none", "stroke-width": "1.5" },
|
|
74
|
+
JSX.createElement("polygon", { points: "5,5 10,5 12,8 19,8 19,18 5,18" })), "var(--color-document)", i18n.theme_folder()),
|
|
75
|
+
chevronDown: () => (JSX.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true" },
|
|
76
|
+
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-icon-text)" }))),
|
|
77
|
+
chevronSmall: () => (JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" },
|
|
78
|
+
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-icon-text)" }))),
|
|
79
|
+
checkbox: () => (JSX.createElement("svg", { width: "32", height: "32", viewBox: "0 0 32 32", "aria-hidden": "true" },
|
|
80
|
+
JSX.createElement("rect", { class: "tsd-checkbox-background", width: "30", height: "30", x: "1", y: "1", rx: "6", fill: "none" }),
|
|
81
|
+
JSX.createElement("path", { class: "tsd-checkbox-checkmark", d: "M8.35422 16.8214L13.2143 21.75L24.6458 10.25", stroke: "none", "stroke-width": "3.5", "stroke-linejoin": "round", fill: "none" }))),
|
|
82
|
+
menu: () => (JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" }, ["3", "7", "11"].map((y) => (JSX.createElement("rect", { x: "1", y: y, width: "14", height: "2", fill: "var(--color-icon-text)" }))))),
|
|
83
|
+
search: () => (JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" },
|
|
84
|
+
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-icon-text)" }))),
|
|
85
|
+
anchor: () => (JSX.createElement("svg", { viewBox: "0 0 24 24", "aria-hidden": "true" },
|
|
86
|
+
JSX.createElement("g", { "stroke-width": "2", stroke: "currentColor", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round" },
|
|
87
|
+
JSX.createElement("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
|
|
88
|
+
JSX.createElement("path", { d: "M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5" }),
|
|
89
|
+
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" })))),
|
|
90
|
+
alertNote: () => (JSX.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": "true" },
|
|
91
|
+
JSX.createElement("path", { fill: "var(--color-alert-note)", d: "M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z" }))),
|
|
92
|
+
alertTip: () => (JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": "true" },
|
|
93
|
+
JSX.createElement("path", { fill: "var(--color-alert-tip)", d: "M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z" }))),
|
|
94
|
+
alertImportant: () => (JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": "true" },
|
|
95
|
+
JSX.createElement("path", { fill: "var(--color-alert-important)", d: "M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z" }))),
|
|
96
|
+
alertWarning: () => (JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": "true" },
|
|
97
|
+
JSX.createElement("path", { fill: "var(--color-alert-warning)", d: "M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z" }))),
|
|
98
|
+
alertCaution: () => (JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": "true" },
|
|
99
|
+
JSX.createElement("path", { fill: "var(--color-alert-caution)", d: "M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z" }))),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
@@ -4,9 +4,9 @@ export const memberGetterSetter = (context, props) => (JSX.createElement(JSX.Fra
|
|
|
4
4
|
JSX.createElement("ul", { class: classNames({
|
|
5
5
|
"tsd-signatures": true,
|
|
6
6
|
}, context.getReflectionClasses(props)) },
|
|
7
|
-
!!props.getSignature && (JSX.createElement(
|
|
8
|
-
JSX.createElement("
|
|
9
|
-
JSX.createElement("
|
|
10
|
-
!!props.setSignature && (JSX.createElement(
|
|
11
|
-
JSX.createElement("
|
|
12
|
-
JSX.createElement("
|
|
7
|
+
!!props.getSignature && (JSX.createElement("li", { class: context.getReflectionClasses(props.getSignature) },
|
|
8
|
+
JSX.createElement("div", { class: "tsd-signature", id: props.getSignature.anchor }, context.memberSignatureTitle(props.getSignature)),
|
|
9
|
+
JSX.createElement("div", { class: "tsd-description" }, context.memberSignatureBody(props.getSignature)))),
|
|
10
|
+
!!props.setSignature && (JSX.createElement("li", { class: context.getReflectionClasses(props.setSignature) },
|
|
11
|
+
JSX.createElement("div", { class: "tsd-signature", id: props.setSignature.anchor }, context.memberSignatureTitle(props.setSignature)),
|
|
12
|
+
JSX.createElement("div", { class: "tsd-description" }, context.memberSignatureBody(props.setSignature)))))));
|
|
@@ -2,9 +2,9 @@ import { JSX } from "../../../../utils/index.js";
|
|
|
2
2
|
import { anchorIcon } from "./anchor-icon.js";
|
|
3
3
|
import { classNames } from "../../lib.js";
|
|
4
4
|
export const memberSignatures = (context, props) => (JSX.createElement(JSX.Fragment, null,
|
|
5
|
-
JSX.createElement("ul", { class: classNames({ "tsd-signatures": true }, context.getReflectionClasses(props)) }, props.signatures?.map((item) => (JSX.createElement(
|
|
6
|
-
JSX.createElement("
|
|
5
|
+
JSX.createElement("ul", { class: classNames({ "tsd-signatures": true }, context.getReflectionClasses(props)) }, props.signatures?.map((item) => (JSX.createElement("li", { class: context.getReflectionClasses(item) },
|
|
6
|
+
JSX.createElement("div", { class: "tsd-signature tsd-anchor-link" },
|
|
7
7
|
item.anchor && JSX.createElement("a", { id: item.anchor, class: "tsd-anchor" }),
|
|
8
8
|
context.memberSignatureTitle(item),
|
|
9
9
|
anchorIcon(context, item.anchor)),
|
|
10
|
-
JSX.createElement("
|
|
10
|
+
JSX.createElement("div", { class: "tsd-description" }, context.memberSignatureBody(item))))))));
|
|
@@ -28,7 +28,7 @@ export function reflectionTemplate(context, props) {
|
|
|
28
28
|
JSX.createElement("h4", null, context.i18n.theme_implemented_by()),
|
|
29
29
|
JSX.createElement("ul", { class: "tsd-hierarchy" }, props.model.implementedBy.map((item) => (JSX.createElement("li", null, context.type(item))))))),
|
|
30
30
|
!!props.model.signatures?.length && (JSX.createElement("section", { class: "tsd-panel" }, context.memberSignatures(props.model))),
|
|
31
|
-
!!props.model.indexSignatures?.length && (JSX.createElement("section", { class:
|
|
31
|
+
!!props.model.indexSignatures?.length && (JSX.createElement("section", { class: "tsd-panel" },
|
|
32
32
|
JSX.createElement("h4", { class: "tsd-before-signature" }, context.i18n.theme_indexable()),
|
|
33
33
|
JSX.createElement("ul", { class: "tsd-signatures" }, props.model.indexSignatures.map((index) => renderIndexSignature(context, index))))),
|
|
34
34
|
!props.model.signatures && context.memberSources(props.model))),
|
|
@@ -36,7 +36,7 @@ export function reflectionTemplate(context, props) {
|
|
|
36
36
|
context.members(props.model)));
|
|
37
37
|
}
|
|
38
38
|
function renderIndexSignature(context, index) {
|
|
39
|
-
return (JSX.createElement("li", { class: "tsd-index-signature" },
|
|
39
|
+
return (JSX.createElement("li", { class: classNames({ "tsd-index-signature": true }, context.getReflectionClasses(index)) },
|
|
40
40
|
JSX.createElement("div", { class: "tsd-signature" },
|
|
41
41
|
index.flags.isReadonly && JSX.createElement("span", { class: "tsd-signature-keyword" }, "readonly "),
|
|
42
42
|
JSX.createElement("span", { class: "tsd-signature-symbol" }, "["),
|
package/dist/lib/utils/fs.d.ts
CHANGED
|
@@ -57,11 +57,11 @@ export declare function discoverInParentDir<T extends {}>(name: string, dir: str
|
|
|
57
57
|
file: string;
|
|
58
58
|
content: T;
|
|
59
59
|
} | undefined;
|
|
60
|
-
export declare function discoverInParentDirExactMatch<T extends {}>(name: string, dir: string, read: (content: string) => T | undefined): {
|
|
60
|
+
export declare function discoverInParentDirExactMatch<T extends {}>(name: string, dir: string, read: (content: string) => T | undefined, usedFile?: (path: string) => void): {
|
|
61
61
|
file: string;
|
|
62
62
|
content: T;
|
|
63
63
|
} | undefined;
|
|
64
|
-
export declare function discoverPackageJson(dir: string): {
|
|
64
|
+
export declare function discoverPackageJson(dir: string, usedFile?: (path: string) => void): {
|
|
65
65
|
file: string;
|
|
66
66
|
content: {
|
|
67
67
|
version?: string | undefined;
|
package/dist/lib/utils/fs.js
CHANGED
|
@@ -278,11 +278,12 @@ export function discoverInParentDir(name, dir, read) {
|
|
|
278
278
|
dir = resolve(join(dir, ".."));
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
|
-
export function discoverInParentDirExactMatch(name, dir, read) {
|
|
281
|
+
export function discoverInParentDirExactMatch(name, dir, read, usedFile) {
|
|
282
282
|
if (!isDir(dir))
|
|
283
283
|
return;
|
|
284
284
|
const reachedTopDirectory = (dirName) => dirName === resolve(join(dirName, ".."));
|
|
285
285
|
while (!reachedTopDirectory(dir)) {
|
|
286
|
+
usedFile?.(join(dir, name));
|
|
286
287
|
try {
|
|
287
288
|
const content = read(readFile(join(dir, name)));
|
|
288
289
|
if (content != null) {
|
|
@@ -295,13 +296,13 @@ export function discoverInParentDirExactMatch(name, dir, read) {
|
|
|
295
296
|
dir = resolve(join(dir, ".."));
|
|
296
297
|
}
|
|
297
298
|
}
|
|
298
|
-
export function discoverPackageJson(dir) {
|
|
299
|
+
export function discoverPackageJson(dir, usedFile) {
|
|
299
300
|
return discoverInParentDirExactMatch("package.json", dir, (content) => {
|
|
300
301
|
const pkg = JSON.parse(content);
|
|
301
302
|
if (validate({ name: String, version: optional(String) }, pkg)) {
|
|
302
303
|
return pkg;
|
|
303
304
|
}
|
|
304
|
-
});
|
|
305
|
+
}, usedFile);
|
|
305
306
|
}
|
|
306
307
|
// dir -> package name according to package.json in this or some parent dir
|
|
307
308
|
const packageCache = new Map();
|
|
@@ -41,6 +41,7 @@ export type Chars<T extends string> = T extends `${infer C}${infer R}` ? C | Cha
|
|
|
41
41
|
export declare function assertNever(x: never): never;
|
|
42
42
|
export declare function escapeRegExp(s: string): string;
|
|
43
43
|
export declare function editDistance(s: string, t: string): number;
|
|
44
|
+
export declare function dedent(text: string): string;
|
|
44
45
|
export declare function getSimilarValues(values: Iterable<string>, compareTo: string): string[];
|
|
45
46
|
export declare function NonEnumerable(_cls: unknown, context: ClassFieldDecoratorContext): void;
|
|
46
47
|
export declare const TYPEDOC_ROOT: string;
|
|
@@ -40,6 +40,17 @@ export function editDistance(s, t) {
|
|
|
40
40
|
}
|
|
41
41
|
return v0[t.length];
|
|
42
42
|
}
|
|
43
|
+
export function dedent(text) {
|
|
44
|
+
const lines = text.split(/\r?\n/);
|
|
45
|
+
while (lines.length && lines[0].search(/\S/) === -1) {
|
|
46
|
+
lines.shift();
|
|
47
|
+
}
|
|
48
|
+
while (lines.length && lines[lines.length - 1].search(/\S/) === -1) {
|
|
49
|
+
lines.pop();
|
|
50
|
+
}
|
|
51
|
+
const minIndent = lines.reduce((indent, line) => line.length ? Math.min(indent, line.search(/\S/)) : indent, Infinity);
|
|
52
|
+
return lines.map((line) => line.substring(minIndent)).join("\n");
|
|
53
|
+
}
|
|
43
54
|
export function getSimilarValues(values, compareTo) {
|
|
44
55
|
const results = new DefaultMap(() => []);
|
|
45
56
|
let lowest = Infinity;
|
|
@@ -198,6 +198,7 @@ export interface TypeDocOptionMap {
|
|
|
198
198
|
intentionallyNotExported: string[];
|
|
199
199
|
validation: ValidationOptions;
|
|
200
200
|
requiredToBeDocumented: ReflectionKind.KindString[];
|
|
201
|
+
intentionallyNotDocumented: string[];
|
|
201
202
|
watch: boolean;
|
|
202
203
|
preserveWatchOutput: boolean;
|
|
203
204
|
help: boolean;
|
|
@@ -276,31 +277,35 @@ export declare enum ParameterType {
|
|
|
276
277
|
* Resolved according to the config directory.
|
|
277
278
|
*/
|
|
278
279
|
Path = 1,
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
280
|
+
/**
|
|
281
|
+
* Resolved according to the config directory unless it starts with https?://
|
|
282
|
+
*/
|
|
283
|
+
UrlOrPath = 2,
|
|
284
|
+
Number = 3,
|
|
285
|
+
Boolean = 4,
|
|
286
|
+
Map = 5,
|
|
287
|
+
Mixed = 6,
|
|
288
|
+
Array = 7,
|
|
284
289
|
/**
|
|
285
290
|
* Resolved according to the config directory.
|
|
286
291
|
*/
|
|
287
|
-
PathArray =
|
|
292
|
+
PathArray = 8,
|
|
288
293
|
/**
|
|
289
294
|
* Resolved according to the config directory if it starts with `.`
|
|
290
295
|
*/
|
|
291
|
-
ModuleArray =
|
|
296
|
+
ModuleArray = 9,
|
|
292
297
|
/**
|
|
293
298
|
* Resolved according to the config directory unless it starts with `**`, after skipping any leading `!` and `#` characters.
|
|
294
299
|
*/
|
|
295
|
-
GlobArray =
|
|
300
|
+
GlobArray = 10,
|
|
296
301
|
/**
|
|
297
302
|
* An object which partially merges user-set values into the defaults.
|
|
298
303
|
*/
|
|
299
|
-
Object =
|
|
304
|
+
Object = 11,
|
|
300
305
|
/**
|
|
301
306
|
* An object with true/false flags
|
|
302
307
|
*/
|
|
303
|
-
Flags =
|
|
308
|
+
Flags = 12
|
|
304
309
|
}
|
|
305
310
|
export interface DeclarationOptionBase {
|
|
306
311
|
/**
|
|
@@ -331,9 +336,9 @@ export interface StringDeclarationOption extends DeclarationOptionBase {
|
|
|
331
336
|
* Specifies the resolution strategy. If `Path` is provided, values will be resolved according to their
|
|
332
337
|
* location in a file. If `String` or no value is provided, values will not be resolved.
|
|
333
338
|
*/
|
|
334
|
-
type?: ParameterType.String | ParameterType.Path;
|
|
339
|
+
type?: ParameterType.String | ParameterType.Path | ParameterType.UrlOrPath;
|
|
335
340
|
/**
|
|
336
|
-
* If not specified defaults to the empty string for
|
|
341
|
+
* If not specified defaults to the empty string for all types.
|
|
337
342
|
*/
|
|
338
343
|
defaultValue?: string;
|
|
339
344
|
/**
|
|
@@ -443,6 +448,7 @@ export type DeclarationOption = StringDeclarationOption | NumberDeclarationOptio
|
|
|
443
448
|
export interface ParameterTypeToOptionTypeMap {
|
|
444
449
|
[ParameterType.String]: string;
|
|
445
450
|
[ParameterType.Path]: string;
|
|
451
|
+
[ParameterType.UrlOrPath]: string;
|
|
446
452
|
[ParameterType.Number]: number;
|
|
447
453
|
[ParameterType.Boolean]: boolean;
|
|
448
454
|
[ParameterType.Mixed]: unknown;
|