typedoc 0.24.0-beta.6 → 0.24.0-beta.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.
Files changed (61) hide show
  1. package/dist/index.d.ts +4 -0
  2. package/dist/index.js +17 -1
  3. package/dist/lib/converter/comments/blockLexer.js +2 -1
  4. package/dist/lib/converter/comments/discovery.js +1 -1
  5. package/dist/lib/converter/comments/index.d.ts +4 -3
  6. package/dist/lib/converter/comments/index.js +9 -2
  7. package/dist/lib/converter/comments/lexer.d.ts +2 -1
  8. package/dist/lib/converter/comments/linkResolver.d.ts +12 -4
  9. package/dist/lib/converter/comments/linkResolver.js +39 -18
  10. package/dist/lib/converter/comments/parser.js +3 -2
  11. package/dist/lib/converter/context.d.ts +3 -0
  12. package/dist/lib/converter/context.js +11 -2
  13. package/dist/lib/converter/converter.d.ts +9 -7
  14. package/dist/lib/converter/converter.js +12 -12
  15. package/dist/lib/converter/factories/signature.js +5 -6
  16. package/dist/lib/converter/jsdoc.js +3 -4
  17. package/dist/lib/converter/plugins/LinkResolverPlugin.js +1 -1
  18. package/dist/lib/converter/plugins/PackagePlugin.js +3 -1
  19. package/dist/lib/converter/symbols.js +9 -4
  20. package/dist/lib/models/comments/comment.d.ts +7 -3
  21. package/dist/lib/models/comments/comment.js +26 -5
  22. package/dist/lib/models/reflections/declaration.d.ts +1 -1
  23. package/dist/lib/models/reflections/project.d.ts +0 -6
  24. package/dist/lib/models/reflections/project.js +0 -16
  25. package/dist/lib/models/types.js +2 -31
  26. package/dist/lib/output/components.d.ts +3 -3
  27. package/dist/lib/output/components.js +1 -5
  28. package/dist/lib/output/events.d.ts +22 -10
  29. package/dist/lib/output/events.js +14 -6
  30. package/dist/lib/output/plugins/JavascriptIndexPlugin.js +1 -3
  31. package/dist/lib/output/renderer.d.ts +12 -4
  32. package/dist/lib/output/renderer.js +3 -3
  33. package/dist/lib/output/theme.d.ts +2 -2
  34. package/dist/lib/output/themes/MarkedPlugin.d.ts +2 -2
  35. package/dist/lib/output/themes/MarkedPlugin.js +15 -12
  36. package/dist/lib/output/themes/default/DefaultTheme.d.ts +5 -5
  37. package/dist/lib/output/themes/default/DefaultTheme.js +58 -11
  38. package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +15 -13
  39. package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +9 -59
  40. package/dist/lib/output/themes/default/layouts/default.d.ts +2 -1
  41. package/dist/lib/output/themes/default/layouts/default.js +18 -12
  42. package/dist/lib/output/themes/default/partials/footer.js +1 -1
  43. package/dist/lib/output/themes/default/partials/member.d.ts +1 -1
  44. package/dist/lib/output/themes/default/partials/member.js +22 -14
  45. package/dist/lib/output/themes/default/partials/members.group.js +3 -3
  46. package/dist/lib/output/themes/default/partials/navigation.d.ts +4 -3
  47. package/dist/lib/output/themes/default/partials/navigation.js +71 -74
  48. package/dist/lib/output/themes/default/partials/toolbar.js +2 -1
  49. package/dist/lib/serialization/schema.d.ts +2 -0
  50. package/dist/lib/serialization/schema.js +1 -0
  51. package/dist/lib/serialization/serializer.d.ts +1 -1
  52. package/dist/lib/utils/entry-point.d.ts +3 -3
  53. package/dist/lib/utils/entry-point.js +4 -4
  54. package/dist/lib/utils/fs.d.ts +5 -0
  55. package/dist/lib/utils/fs.js +35 -2
  56. package/dist/lib/utils/options/declaration.d.ts +1 -0
  57. package/dist/lib/utils/options/options.d.ts +5 -0
  58. package/dist/lib/utils/options/sources/typedoc.js +5 -0
  59. package/package.json +1 -1
  60. package/static/main.js +3 -3
  61. package/static/style.css +186 -257
@@ -1,12 +1,13 @@
1
- import type { RendererHooks } from "../..";
2
- import { CommentDisplayPart, DeclarationReflection, ReferenceType, Reflection, ReflectionKind } from "../../../models";
1
+ import type { PageEvent, RendererHooks } from "../..";
2
+ import { CommentDisplayPart, DeclarationReflection, ReferenceType, Reflection } from "../../../models";
3
3
  import type { NeverIfInternal, Options } from "../../../utils";
4
4
  import type { DefaultTheme } from "./DefaultTheme";
5
5
  export declare class DefaultThemeRenderContext {
6
6
  private theme;
7
+ page: PageEvent<Reflection>;
7
8
  options: Options;
8
- constructor(theme: DefaultTheme, options: Options);
9
- icons: Record<"search" | "anchor" | ReflectionKind | "checkbox" | "chevronDown" | "menu" | "chevronSmall", () => import("../../../utils/jsx.elements").JsxElement>;
9
+ constructor(theme: DefaultTheme, page: PageEvent<Reflection>, options: Options);
10
+ icons: Record<"search" | "anchor" | import("../../../models").ReflectionKind | "checkbox" | "chevronDown" | "menu" | "chevronSmall", () => import("../../../utils/jsx.elements").JsxElement>;
10
11
  hook: (name: keyof RendererHooks) => import("../../../utils/jsx.elements").JsxElement[];
11
12
  /** Avoid this in favor of urlTo if possible */
12
13
  relativeURL: (url: string, cacheBust?: boolean) => string;
@@ -18,15 +19,15 @@ export declare class DefaultThemeRenderContext {
18
19
  * Will be removed in 0.24.
19
20
  */
20
21
  attemptExternalResolution: (type: NeverIfInternal<ReferenceType>) => string | undefined;
21
- getReflectionClasses: (reflection: DeclarationReflection) => string;
22
- reflectionTemplate: (props: import("../..").PageEvent<import("../../../models").ContainerReflection>) => import("../../../utils/jsx.elements").JsxElement;
23
- indexTemplate: (props: import("../..").PageEvent<import("../../../models").ProjectReflection>) => import("../../../utils/jsx.elements").JsxElement;
24
- defaultLayout: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
22
+ getReflectionClasses: (refl: DeclarationReflection) => string;
23
+ reflectionTemplate: (props: PageEvent<import("../../../models").ContainerReflection>) => import("../../../utils/jsx.elements").JsxElement;
24
+ indexTemplate: (props: PageEvent<import("../../../models").ProjectReflection>) => import("../../../utils/jsx.elements").JsxElement;
25
+ defaultLayout: (template: import("../..").RenderTemplate<PageEvent<Reflection>>, props: PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
25
26
  analytics: () => import("../../../utils/jsx.elements").JsxElement | undefined;
26
27
  breadcrumb: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
27
28
  comment: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
28
29
  footer: () => import("../../../utils/jsx.elements").JsxElement | undefined;
29
- header: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
30
+ header: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
30
31
  hierarchy: (props: import("../../../models").DeclarationHierarchy | undefined) => import("../../../utils/jsx.elements").JsxElement | undefined;
31
32
  index: (props: import("../../../models").ContainerReflection) => import("../../../utils/jsx.elements").JsxElement;
32
33
  member: (props: DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
@@ -44,13 +45,14 @@ export declare class DefaultThemeRenderContext {
44
45
  memberSources: (props: import("../../../models").SignatureReflection | DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
45
46
  members: (props: import("../../../models").ContainerReflection) => import("../../../utils/jsx.elements").JsxElement;
46
47
  membersGroup: (group: import("../../../models").ReflectionGroup) => import("../../../utils/jsx.elements").JsxElement;
47
- navigation: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
48
+ sidebar: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
49
+ pageSidebar: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
48
50
  sidebarLinks: () => import("../../../utils/jsx.elements").JsxElement | null;
49
51
  settings: () => import("../../../utils/jsx.elements").JsxElement;
50
- primaryNavigation: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
51
- secondaryNavigation: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement | undefined;
52
+ navigation: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
53
+ pageNavigation: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
52
54
  parameter: (props: DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
53
- toolbar: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
55
+ toolbar: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
54
56
  type: (type: import("../../../models").Type | undefined) => import("../../../utils/jsx.elements").JsxElement;
55
57
  typeAndParent: (props: import("../../../models").Type) => import("../../../utils/jsx.elements").JsxElement;
56
58
  typeParameters: (typeParameters: import("../../../models").TypeParameterReflection[]) => import("../../../utils/jsx.elements").JsxElement;
@@ -33,8 +33,9 @@ function bind(fn, first) {
33
33
  return (...r) => fn(first, ...r);
34
34
  }
35
35
  class DefaultThemeRenderContext {
36
- constructor(theme, options) {
36
+ constructor(theme, page, options) {
37
37
  this.theme = theme;
38
+ this.page = page;
38
39
  this.icons = icon_1.icons;
39
40
  this.hook = (name) => this.theme.owner.hooks.emit(name, this);
40
41
  /** Avoid this in favor of urlTo if possible */
@@ -50,9 +51,9 @@ class DefaultThemeRenderContext {
50
51
  };
51
52
  this.markdown = (md) => {
52
53
  if (md instanceof Array) {
53
- return this.theme.markedPlugin.parseMarkdown(models_1.Comment.displayPartsToMarkdown(md, this.urlTo));
54
+ return this.theme.markedPlugin.parseMarkdown(models_1.Comment.displayPartsToMarkdown(md, this.urlTo), this.page);
54
55
  }
55
- return md ? this.theme.markedPlugin.parseMarkdown(md) : "";
56
+ return md ? this.theme.markedPlugin.parseMarkdown(md, this.page) : "";
56
57
  };
57
58
  /**
58
59
  * Using this method will repeat work already done, instead of calling it, use `type.externalUrl`.
@@ -62,10 +63,7 @@ class DefaultThemeRenderContext {
62
63
  this.attemptExternalResolution = (type) => {
63
64
  return type.externalUrl;
64
65
  };
65
- this.getReflectionClasses = (reflection) => {
66
- const filters = this.options.getValue("visibilityFilters");
67
- return getReflectionClasses(reflection, filters);
68
- };
66
+ this.getReflectionClasses = (refl) => this.theme.getReflectionClasses(refl);
69
67
  this.reflectionTemplate = bind(reflection_1.reflectionTemplate, this);
70
68
  this.indexTemplate = bind(templates_1.indexTemplate, this);
71
69
  this.defaultLayout = bind(default_1.defaultLayout, this);
@@ -86,11 +84,12 @@ class DefaultThemeRenderContext {
86
84
  this.memberSources = bind(member_sources_1.memberSources, this);
87
85
  this.members = bind(members_1.members, this);
88
86
  this.membersGroup = bind(members_group_1.membersGroup, this);
89
- this.navigation = bind(navigation_1.navigation, this);
87
+ this.sidebar = bind(navigation_1.sidebar, this);
88
+ this.pageSidebar = bind(navigation_1.pageSidebar, this);
90
89
  this.sidebarLinks = bind(navigation_1.sidebarLinks, this);
91
90
  this.settings = bind(navigation_1.settings, this);
92
- this.primaryNavigation = bind(navigation_1.primaryNavigation, this);
93
- this.secondaryNavigation = bind(navigation_1.secondaryNavigation, this);
91
+ this.navigation = bind(navigation_1.navigation, this);
92
+ this.pageNavigation = bind(navigation_1.pageNavigation, this);
94
93
  this.parameter = bind(parameter_1.parameter, this);
95
94
  this.toolbar = bind(toolbar_1.toolbar, this);
96
95
  this.type = bind(type_1.type, this);
@@ -100,52 +99,3 @@ class DefaultThemeRenderContext {
100
99
  }
101
100
  }
102
101
  exports.DefaultThemeRenderContext = DefaultThemeRenderContext;
103
- function getReflectionClasses(reflection, filters) {
104
- const classes = [];
105
- classes.push(toStyleClass("tsd-kind-" + models_1.ReflectionKind[reflection.kind]));
106
- if (reflection.parent &&
107
- reflection.parent instanceof models_1.DeclarationReflection) {
108
- classes.push(toStyleClass(`tsd-parent-kind-${models_1.ReflectionKind[reflection.parent.kind]}`));
109
- }
110
- // Filter classes should match up with the settings function in
111
- // partials/navigation.tsx.
112
- for (const key of Object.keys(filters)) {
113
- if (key === "inherited") {
114
- if (reflection.inheritedFrom) {
115
- classes.push("tsd-is-inherited");
116
- }
117
- }
118
- else if (key === "protected") {
119
- if (reflection.flags.isProtected) {
120
- classes.push("tsd-is-protected");
121
- }
122
- }
123
- else if (key === "private") {
124
- if (reflection.flags.isPrivate) {
125
- classes.push("tsd-is-private");
126
- }
127
- }
128
- else if (key === "external") {
129
- if (reflection.flags.isExternal) {
130
- classes.push("tsd-is-external");
131
- }
132
- }
133
- else if (key.startsWith("@")) {
134
- if (key === "@deprecated") {
135
- if (reflection.isDeprecated()) {
136
- classes.push(toStyleClass(`tsd-is-${key.substring(1)}`));
137
- }
138
- }
139
- else if (reflection.comment?.hasModifier(key) ||
140
- reflection.comment?.getTag(key)) {
141
- classes.push(toStyleClass(`tsd-is-${key.substring(1)}`));
142
- }
143
- }
144
- }
145
- return classes.join(" ");
146
- }
147
- function toStyleClass(str) {
148
- return str
149
- .replace(/(\w)([A-Z])/g, (_m, m1, m2) => m1 + "-" + m2)
150
- .toLowerCase();
151
- }
@@ -1,5 +1,6 @@
1
+ import type { RenderTemplate } from "../../..";
1
2
  import type { Reflection } from "../../../../models";
2
3
  import { JSX } from "../../../../utils";
3
4
  import type { PageEvent } from "../../../events";
4
5
  import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
5
- export declare const defaultLayout: (context: DefaultThemeRenderContext, props: PageEvent<Reflection>) => JSX.Element;
6
+ export declare const defaultLayout: (context: DefaultThemeRenderContext, template: RenderTemplate<PageEvent<Reflection>>, props: PageEvent<Reflection>) => JSX.Element;
@@ -2,19 +2,21 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defaultLayout = void 0;
4
4
  const utils_1 = require("../../../../utils");
5
- const defaultLayout = (context, props) => (utils_1.JSX.createElement("html", { class: "default", lang: context.options.getValue("htmlLang") },
5
+ const lib_1 = require("../../lib");
6
+ const defaultLayout = (context, template, props) => (utils_1.JSX.createElement("html", { class: "default", lang: context.options.getValue("htmlLang") },
6
7
  utils_1.JSX.createElement("head", null,
7
8
  utils_1.JSX.createElement("meta", { charSet: "utf-8" }),
8
9
  context.hook("head.begin"),
9
10
  utils_1.JSX.createElement("meta", { "http-equiv": "x-ua-compatible", content: "IE=edge" }),
10
- utils_1.JSX.createElement("title", null, props.model.name === props.project.name
11
- ? props.project.name
12
- : `${props.model.name} | ${props.project.name}`),
11
+ utils_1.JSX.createElement("title", null, props.model.isProject()
12
+ ? (0, lib_1.getDisplayName)(props.model)
13
+ : `${(0, lib_1.getDisplayName)(props.model)} | ${(0, lib_1.getDisplayName)(props.project)}`),
13
14
  utils_1.JSX.createElement("meta", { name: "description", content: "Documentation for " + props.project.name }),
14
15
  utils_1.JSX.createElement("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }),
15
16
  utils_1.JSX.createElement("link", { rel: "stylesheet", href: context.relativeURL("assets/style.css", true) }),
16
17
  utils_1.JSX.createElement("link", { rel: "stylesheet", href: context.relativeURL("assets/highlight.css", true) }),
17
18
  context.options.getValue("customCss") && (utils_1.JSX.createElement("link", { rel: "stylesheet", href: context.relativeURL("assets/custom.css", true) })),
19
+ utils_1.JSX.createElement("script", { defer: true, src: context.relativeURL("assets/main.js", true) }),
18
20
  utils_1.JSX.createElement("script", { async: true, src: context.relativeURL("assets/search.js", true), id: "search-script" }),
19
21
  context.hook("head.end")),
20
22
  utils_1.JSX.createElement("body", null,
@@ -23,18 +25,22 @@ const defaultLayout = (context, props) => (utils_1.JSX.createElement("html", { c
23
25
  utils_1.JSX.createElement(utils_1.Raw, { html: 'document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"' })),
24
26
  context.toolbar(props),
25
27
  utils_1.JSX.createElement("div", { class: "container container-main" },
26
- utils_1.JSX.createElement("div", { class: "col-4 col-menu menu-sticky-wrap menu-highlight" },
27
- context.hook("navigation.begin"),
28
- context.navigation(props),
29
- context.hook("navigation.end")),
30
- utils_1.JSX.createElement("div", { class: "col-8 col-content" },
28
+ utils_1.JSX.createElement("div", { class: "col-content" },
31
29
  context.hook("content.begin"),
32
30
  context.header(props),
33
- props.template(props),
34
- context.hook("content.end"))),
31
+ template(props),
32
+ context.hook("content.end")),
33
+ utils_1.JSX.createElement("div", { class: "col-sidebar" },
34
+ utils_1.JSX.createElement("div", { class: "page-menu" },
35
+ context.hook("pageSidebar.begin"),
36
+ context.pageSidebar(props),
37
+ context.hook("pageSidebar.end")),
38
+ utils_1.JSX.createElement("div", { class: "site-menu" },
39
+ context.hook("sidebar.begin"),
40
+ context.sidebar(props),
41
+ context.hook("sidebar.end")))),
35
42
  context.footer(),
36
43
  utils_1.JSX.createElement("div", { class: "overlay" }),
37
- utils_1.JSX.createElement("script", { src: context.relativeURL("assets/main.js", true) }),
38
44
  context.analytics(),
39
45
  context.hook("body.end"))));
40
46
  exports.defaultLayout = defaultLayout;
@@ -5,7 +5,7 @@ const utils_1 = require("../../../../utils");
5
5
  function footer(context) {
6
6
  const hideGenerator = context.options.getValue("hideGenerator");
7
7
  if (!hideGenerator)
8
- return (utils_1.JSX.createElement("div", { class: "container tsd-generator" },
8
+ return (utils_1.JSX.createElement("div", { class: "tsd-generator" },
9
9
  utils_1.JSX.createElement("p", null,
10
10
  "Generated using ",
11
11
  utils_1.JSX.createElement("a", { href: "https://typedoc.org/", target: "_blank" }, "TypeDoc"))));
@@ -1,4 +1,4 @@
1
1
  import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
2
2
  import { JSX } from "../../../../utils";
3
3
  import { DeclarationReflection } from "../../../../models";
4
- export declare const member: (context: DefaultThemeRenderContext, props: DeclarationReflection) => JSX.Element;
4
+ export declare function member(context: DefaultThemeRenderContext, props: DeclarationReflection): JSX.Element;
@@ -5,18 +5,26 @@ const lib_1 = require("../../lib");
5
5
  const utils_1 = require("../../../../utils");
6
6
  const models_1 = require("../../../../models");
7
7
  const anchor_icon_1 = require("./anchor-icon");
8
- const member = (context, props) => (utils_1.JSX.createElement("section", { class: (0, lib_1.classNames)({ "tsd-panel": true, "tsd-member": true }, context.getReflectionClasses(props)) },
9
- utils_1.JSX.createElement("a", { id: props.anchor, class: "tsd-anchor" }),
10
- !!props.name && (utils_1.JSX.createElement("h3", { class: "tsd-anchor-link" },
11
- (0, lib_1.renderFlags)(props.flags, props.comment),
12
- utils_1.JSX.createElement("span", { class: (0, lib_1.classNames)({ deprecated: props.isDeprecated() }) }, (0, lib_1.wbr)(props.name)),
13
- (0, anchor_icon_1.anchorIcon)(context, props.anchor))),
14
- props.signatures
15
- ? context.memberSignatures(props)
16
- : props.hasGetterOrSetter()
17
- ? context.memberGetterSetter(props)
18
- : props instanceof models_1.ReferenceReflection
19
- ? context.memberReference(props)
20
- : context.memberDeclaration(props),
21
- props.groups?.map((item) => item.children.map((item) => !item.hasOwnDocument && context.member(item)))));
8
+ function member(context, props) {
9
+ context.page.pageHeadings.push({
10
+ link: `#${props.anchor}`,
11
+ text: (0, lib_1.getDisplayName)(props),
12
+ kind: props.kind,
13
+ classes: context.getReflectionClasses(props),
14
+ });
15
+ return (utils_1.JSX.createElement("section", { class: (0, lib_1.classNames)({ "tsd-panel": true, "tsd-member": true }, context.getReflectionClasses(props)) },
16
+ utils_1.JSX.createElement("a", { id: props.anchor, class: "tsd-anchor" }),
17
+ !!props.name && (utils_1.JSX.createElement("h3", { class: "tsd-anchor-link" },
18
+ (0, lib_1.renderFlags)(props.flags, props.comment),
19
+ utils_1.JSX.createElement("span", { class: (0, lib_1.classNames)({ deprecated: props.isDeprecated() }) }, (0, lib_1.wbr)(props.name)),
20
+ (0, anchor_icon_1.anchorIcon)(context, props.anchor))),
21
+ props.signatures
22
+ ? context.memberSignatures(props)
23
+ : props.hasGetterOrSetter()
24
+ ? context.memberGetterSetter(props)
25
+ : props instanceof models_1.ReferenceReflection
26
+ ? context.memberReference(props)
27
+ : context.memberDeclaration(props),
28
+ props.groups?.map((item) => item.children.map((item) => !item.hasOwnDocument && context.member(item)))));
29
+ }
22
30
  exports.member = member;
@@ -6,10 +6,10 @@ function membersGroup(context, group) {
6
6
  if (group.categories) {
7
7
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null, group.categories.map((item) => (utils_1.JSX.createElement("section", { class: "tsd-panel-group tsd-member-group" },
8
8
  utils_1.JSX.createElement("h2", null,
9
+ group.title,
9
10
  !!item.title && utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
10
- item.title,
11
- " "),
12
- group.title),
11
+ " - ",
12
+ item.title)),
13
13
  item.children.map((item) => !item.hasOwnDocument && context.member(item)))))));
14
14
  }
15
15
  return (utils_1.JSX.createElement("section", { class: "tsd-panel-group tsd-member-group" },
@@ -2,8 +2,9 @@ import { Reflection } from "../../../../models";
2
2
  import { JSX } from "../../../../utils";
3
3
  import type { PageEvent } from "../../../events";
4
4
  import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
5
- export declare function navigation(context: DefaultThemeRenderContext, props: PageEvent<Reflection>): JSX.Element;
5
+ export declare function sidebar(context: DefaultThemeRenderContext, props: PageEvent<Reflection>): JSX.Element;
6
6
  export declare function sidebarLinks(context: DefaultThemeRenderContext): JSX.Element | null;
7
7
  export declare function settings(context: DefaultThemeRenderContext): JSX.Element;
8
- export declare function primaryNavigation(context: DefaultThemeRenderContext, props: PageEvent<Reflection>): JSX.Element;
9
- export declare function secondaryNavigation(context: DefaultThemeRenderContext, props: PageEvent<Reflection>): JSX.Element | undefined;
8
+ export declare function navigation(context: DefaultThemeRenderContext, props: PageEvent<Reflection>): JSX.Element;
9
+ export declare function pageSidebar(context: DefaultThemeRenderContext, props: PageEvent<Reflection>): JSX.Element;
10
+ export declare function pageNavigation(context: DefaultThemeRenderContext, props: PageEvent<Reflection>): JSX.Element;
@@ -1,17 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.secondaryNavigation = exports.primaryNavigation = exports.settings = exports.sidebarLinks = exports.navigation = void 0;
3
+ exports.pageNavigation = exports.pageSidebar = exports.navigation = exports.settings = exports.sidebarLinks = exports.sidebar = void 0;
4
4
  const models_1 = require("../../../../models");
5
5
  const utils_1 = require("../../../../utils");
6
6
  const lib_1 = require("../../lib");
7
- function navigation(context, props) {
7
+ function sidebar(context, props) {
8
8
  return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
9
9
  context.sidebarLinks(),
10
- context.settings(),
11
- context.primaryNavigation(props),
12
- context.secondaryNavigation(props)));
10
+ context.navigation(props)));
13
11
  }
14
- exports.navigation = navigation;
12
+ exports.sidebar = sidebar;
15
13
  function buildFilterItem(context, name, displayName, defaultValue) {
16
14
  return (utils_1.JSX.createElement("li", { class: "tsd-filter-item" },
17
15
  utils_1.JSX.createElement("label", { class: "tsd-filter-input" },
@@ -50,7 +48,7 @@ function settings(context) {
50
48
  utils_1.JSX.createElement("summary", { class: "tsd-accordion-summary" },
51
49
  utils_1.JSX.createElement("h3", null,
52
50
  context.icons.chevronDown(),
53
- " Settings")),
51
+ "Settings")),
54
52
  utils_1.JSX.createElement("div", { class: "tsd-accordion-details" },
55
53
  visibilityOptions.length && (utils_1.JSX.createElement("div", { class: "tsd-filter-visibility" },
56
54
  utils_1.JSX.createElement("h4", { class: "uppercase" }, "Member Visibility"),
@@ -64,79 +62,78 @@ function settings(context) {
64
62
  utils_1.JSX.createElement("option", { value: "dark" }, "Dark")))))));
65
63
  }
66
64
  exports.settings = settings;
67
- function primaryNavigation(context, props) {
65
+ function navigation(context, props) {
68
66
  // Create the navigation for the current page
69
- const modules = props.model.project.getChildrenByKind(models_1.ReflectionKind.SomeModule);
70
- const [ext, int] = (0, utils_1.partition)(modules, (m) => m.flags.isExternal);
71
- const selected = props.model.isProject();
72
- const current = selected || int.some((mod) => inPath(mod, props.model));
73
- return (utils_1.JSX.createElement("nav", { class: "tsd-navigation primary" },
74
- utils_1.JSX.createElement("details", { class: "tsd-index-accordion", open: true },
67
+ // Recurse to children if the parent is some kind of module
68
+ return (utils_1.JSX.createElement("nav", { class: "tsd-navigation" },
69
+ link(props.project),
70
+ utils_1.JSX.createElement("ul", { class: "tsd-small-nested-navigation" }, props.project.children?.map((c) => (utils_1.JSX.createElement("li", null, links(c)))))));
71
+ function links(mod) {
72
+ const children = (mod.kindOf(models_1.ReflectionKind.SomeModule | models_1.ReflectionKind.Project) && mod.children) || [];
73
+ const nameClasses = (0, lib_1.classNames)({ deprecated: mod.isDeprecated() }, mod.isProject() ? void 0 : context.getReflectionClasses(mod));
74
+ if (!children.length) {
75
+ return link(mod, nameClasses);
76
+ }
77
+ return (utils_1.JSX.createElement("details", { class: (0, lib_1.classNames)({ "tsd-index-accordion": true }, nameClasses), open: inPath(mod), "data-key": mod.getFullName() },
75
78
  utils_1.JSX.createElement("summary", { class: "tsd-accordion-summary" },
76
- utils_1.JSX.createElement("h3", null,
77
- context.icons.chevronDown(),
78
- " Modules")),
79
+ context.icons.chevronDown(),
80
+ link(mod)),
79
81
  utils_1.JSX.createElement("div", { class: "tsd-accordion-details" },
80
- utils_1.JSX.createElement("ul", null,
81
- utils_1.JSX.createElement("li", { class: (0, lib_1.classNames)({ current, selected }) },
82
- utils_1.JSX.createElement("a", { href: context.urlTo(props.model.project) }, (0, lib_1.wbr)(props.project.name)),
83
- utils_1.JSX.createElement("ul", null, int.map(link))),
84
- ext.map(link))))));
85
- function link(mod) {
86
- const current = inPath(mod, props.model);
87
- const selected = mod.name === props.model.name;
88
- let childNav;
89
- const childModules = mod.children?.filter((m) => m.kindOf(models_1.ReflectionKind.SomeModule));
90
- if (childModules?.length) {
91
- childNav = utils_1.JSX.createElement("ul", null, childModules.map(link));
92
- }
93
- return (utils_1.JSX.createElement("li", { class: (0, lib_1.classNames)({ current, selected, deprecated: mod.isDeprecated() }, context.getReflectionClasses(mod)) },
94
- utils_1.JSX.createElement("a", { href: context.urlTo(mod) }, (0, lib_1.wbr)((0, lib_1.getDisplayName)(mod))),
95
- childNav));
82
+ utils_1.JSX.createElement("ul", { class: "tsd-nested-navigation" }, children.map((c) => (utils_1.JSX.createElement("li", null, links(c))))))));
96
83
  }
97
- }
98
- exports.primaryNavigation = primaryNavigation;
99
- function secondaryNavigation(context, props) {
100
- // Multiple entry points, and on main project page.
101
- if (props.model.isProject() && props.model.getChildrenByKind(models_1.ReflectionKind.Module).length) {
102
- return;
84
+ function link(child, nameClasses) {
85
+ return (utils_1.JSX.createElement("a", { href: context.urlTo(child), class: (0, lib_1.classNames)({ current: child === props.model }, nameClasses) },
86
+ context.icons[child.kind](),
87
+ utils_1.JSX.createElement("span", null, (0, lib_1.wbr)((0, lib_1.getDisplayName)(child)))));
103
88
  }
104
- const effectivePageParent = (props.model instanceof models_1.ContainerReflection && props.model.children?.length) || props.model.isProject()
105
- ? props.model
106
- : props.model.parent;
107
- const children = effectivePageParent.children || [];
108
- const pageNavigation = children
109
- .filter((child) => !child.kindOf(models_1.ReflectionKind.SomeModule))
110
- .map((child) => {
111
- return (utils_1.JSX.createElement("li", { class: (0, lib_1.classNames)({ deprecated: child.isDeprecated(), current: props.model === child }, context.getReflectionClasses(child)) },
112
- utils_1.JSX.createElement("a", { href: context.urlTo(child), class: "tsd-index-link" },
113
- context.icons[child.kind](),
114
- utils_1.JSX.createElement("span", null, (0, lib_1.renderName)(child)))));
115
- });
116
- if (effectivePageParent.kindOf(models_1.ReflectionKind.SomeModule | models_1.ReflectionKind.Project)) {
117
- return (utils_1.JSX.createElement("nav", { class: "tsd-navigation secondary menu-sticky" }, !!pageNavigation.length && utils_1.JSX.createElement("ul", null, pageNavigation)));
89
+ function inPath(mod) {
90
+ let iter = props.model;
91
+ do {
92
+ if (iter == mod)
93
+ return true;
94
+ iter = iter.parent;
95
+ } while (iter);
96
+ return false;
118
97
  }
119
- return (utils_1.JSX.createElement("nav", { class: "tsd-navigation secondary menu-sticky" },
120
- utils_1.JSX.createElement("ul", null,
121
- utils_1.JSX.createElement("li", { class: (0, lib_1.classNames)({
122
- deprecated: effectivePageParent.isDeprecated(),
123
- current: effectivePageParent === props.model,
124
- }, effectivePageParent instanceof models_1.DeclarationReflection
125
- ? context.getReflectionClasses(effectivePageParent)
126
- : "") },
127
- utils_1.JSX.createElement("a", { href: context.urlTo(effectivePageParent), class: "tsd-index-link" },
128
- context.icons[effectivePageParent.kind](),
129
- utils_1.JSX.createElement("span", null, (0, lib_1.renderName)(effectivePageParent))),
130
- !!pageNavigation.length && utils_1.JSX.createElement("ul", null, pageNavigation)))));
131
98
  }
132
- exports.secondaryNavigation = secondaryNavigation;
133
- function inPath(thisPage, toCheck) {
134
- while (toCheck) {
135
- if (toCheck.isProject())
136
- return false;
137
- if (thisPage === toCheck)
138
- return true;
139
- toCheck = toCheck.parent;
99
+ exports.navigation = navigation;
100
+ function pageSidebar(context, props) {
101
+ return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
102
+ context.settings(),
103
+ context.pageNavigation(props)));
104
+ }
105
+ exports.pageSidebar = pageSidebar;
106
+ function pageNavigation(context, props) {
107
+ const levels = [[]];
108
+ function finalizeLevel() {
109
+ const built = (utils_1.JSX.createElement("ul", null, levels.pop().map((l) => (utils_1.JSX.createElement("li", null, l)))));
110
+ levels[levels.length - 1].push(built);
111
+ }
112
+ for (const heading of props.pageHeadings) {
113
+ const inferredLevel = heading.level ? heading.level + 1 : 1;
114
+ while (inferredLevel < levels.length) {
115
+ finalizeLevel();
116
+ }
117
+ if (inferredLevel > levels.length) {
118
+ // Lower level than before
119
+ levels.push([]);
120
+ }
121
+ levels[levels.length - 1].push(utils_1.JSX.createElement("a", { href: heading.link, class: heading.classes },
122
+ heading.kind && context.icons[heading.kind](),
123
+ utils_1.JSX.createElement("span", null, (0, lib_1.wbr)(heading.text))));
124
+ }
125
+ while (levels.length > 1) {
126
+ finalizeLevel();
127
+ }
128
+ if (!levels[0].length) {
129
+ return utils_1.JSX.createElement(utils_1.JSX.Fragment, null);
140
130
  }
141
- return false;
131
+ return (utils_1.JSX.createElement("details", { open: true, class: "tsd-index-accordion tsd-page-navigation" },
132
+ utils_1.JSX.createElement("summary", { class: "tsd-accordion-summary" },
133
+ utils_1.JSX.createElement("h3", null,
134
+ context.icons.chevronDown(),
135
+ "On This Page")),
136
+ utils_1.JSX.createElement("div", { class: "tsd-accordion-details" },
137
+ utils_1.JSX.createElement("ul", null, levels[0].map((l) => (utils_1.JSX.createElement("li", null, l)))))));
142
138
  }
139
+ exports.pageNavigation = pageNavigation;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.toolbar = void 0;
4
4
  const utils_1 = require("../../../../utils");
5
+ const lib_1 = require("../../lib");
5
6
  const toolbar = (context, props) => (utils_1.JSX.createElement("header", { class: "tsd-page-toolbar" },
6
7
  utils_1.JSX.createElement("div", { class: "tsd-toolbar-contents container" },
7
8
  utils_1.JSX.createElement("div", { class: "table-cell", id: "tsd-search", "data-base": context.relativeURL("./") },
@@ -13,7 +14,7 @@ const toolbar = (context, props) => (utils_1.JSX.createElement("header", { class
13
14
  utils_1.JSX.createElement("ul", { class: "results" },
14
15
  utils_1.JSX.createElement("li", { class: "state loading" }, "Preparing search index..."),
15
16
  utils_1.JSX.createElement("li", { class: "state failure" }, "The search index is not available")),
16
- utils_1.JSX.createElement("a", { href: context.options.getValue("titleLink") || context.relativeURL("index.html"), class: "title" }, props.project.name)),
17
+ utils_1.JSX.createElement("a", { href: context.options.getValue("titleLink") || context.relativeURL("index.html"), class: "title" }, (0, lib_1.getDisplayName)(props.project))),
17
18
  utils_1.JSX.createElement("div", { class: "table-cell", id: "tsd-widgets" },
18
19
  utils_1.JSX.createElement("a", { href: "#", class: "tsd-widget tsd-toolbar-icon menu no-caption", "data-toggle": "menu", "aria-label": "Menu" }, context.icons.menu())))));
19
20
  exports.toolbar = toolbar;
@@ -26,6 +26,7 @@
26
26
  *
27
27
  * For documentation on the JSON output properties, view the corresponding model.
28
28
  * @module
29
+ * @internal
29
30
  */
30
31
  import type * as M from "../models";
31
32
  /**
@@ -182,6 +183,7 @@ export interface InlineTagDisplayPart {
182
183
  tag: `@${string}`;
183
184
  text: string;
184
185
  target?: string | number | ReflectionSymbolId;
186
+ tsLinkText?: string;
185
187
  }
186
188
  export interface SourceReference extends S<M.SourceReference, "fileName" | "line" | "character" | "url"> {
187
189
  }
@@ -27,5 +27,6 @@
27
27
  *
28
28
  * For documentation on the JSON output properties, view the corresponding model.
29
29
  * @module
30
+ * @internal
30
31
  */
31
32
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -15,7 +15,7 @@ export declare class Serializer extends EventDispatcher {
15
15
  static EVENT_END: string;
16
16
  private serializers;
17
17
  /**
18
- * Only set after resolve.
18
+ * Only set when serializing.
19
19
  */
20
20
  projectRoot: string;
21
21
  addSerializer(serializer: SerializerComponent<any>): void;
@@ -7,7 +7,7 @@ import type { Options } from "./options";
7
7
  */
8
8
  export declare const EntryPointStrategy: {
9
9
  /**
10
- * The default behavior in v0.22-v0.23, expects all provided entry points as being part of a single program.
10
+ * The default behavior in v0.22+, expects all provided entry points as being part of a single program.
11
11
  * Any directories included in the entry point list will result in `dir/index.([cm][tj]s|[tj]sx?)` being used.
12
12
  */
13
13
  readonly Resolve: "resolve";
@@ -17,8 +17,8 @@ export declare const EntryPointStrategy: {
17
17
  */
18
18
  readonly Expand: "expand";
19
19
  /**
20
- * Run TypeDoc in each directory passed as an entry point, and save the json result to `.typedoc/<project>`
21
- * Once all have been saved, use the merge option to produce final output.
20
+ * Run TypeDoc in each directory passed as an entry point. Once all directories have been converted,
21
+ * use the merge option to produce final output.
22
22
  */
23
23
  readonly Packages: "packages";
24
24
  /**
@@ -42,7 +42,7 @@ const general_1 = require("./general");
42
42
  */
43
43
  exports.EntryPointStrategy = {
44
44
  /**
45
- * The default behavior in v0.22-v0.23, expects all provided entry points as being part of a single program.
45
+ * The default behavior in v0.22+, expects all provided entry points as being part of a single program.
46
46
  * Any directories included in the entry point list will result in `dir/index.([cm][tj]s|[tj]sx?)` being used.
47
47
  */
48
48
  Resolve: "resolve",
@@ -52,8 +52,8 @@ exports.EntryPointStrategy = {
52
52
  */
53
53
  Expand: "expand",
54
54
  /**
55
- * Run TypeDoc in each directory passed as an entry point, and save the json result to `.typedoc/<project>`
56
- * Once all have been saved, use the merge option to produce final output.
55
+ * Run TypeDoc in each directory passed as an entry point. Once all directories have been converted,
56
+ * use the merge option to produce final output.
57
57
  */
58
58
  Packages: "packages",
59
59
  /**
@@ -315,7 +315,7 @@ function getEntryPointsForLegacyPackages(logger, packageGlobPaths, options) {
315
315
  results.push({
316
316
  displayName: typedocPackageConfig?.displayName ?? packageName,
317
317
  version: includeVersion
318
- ? packageJson["version"]
318
+ ? packageJson["version"]?.replace(/^v/, "")
319
319
  : void 0,
320
320
  readmeFile: discoverReadmeFile(logger, Path.join(packageJsonPath, ".."), typedocPackageConfig?.readmeFile),
321
321
  program,
@@ -53,6 +53,10 @@ export declare function discoverInParentDir<T extends {}>(name: string, dir: str
53
53
  file: string;
54
54
  content: T;
55
55
  } | undefined;
56
+ export declare function discoverInParentDirExactMatch<T extends {}>(name: string, dir: string, read: (content: string) => T | undefined): {
57
+ file: string;
58
+ content: T;
59
+ } | undefined;
56
60
  export declare function discoverPackageJson(dir: string): {
57
61
  file: string;
58
62
  content: {
@@ -61,3 +65,4 @@ export declare function discoverPackageJson(dir: string): {
61
65
  name: string;
62
66
  };
63
67
  } | undefined;
68
+ export declare function findPackageForPath(sourcePath: string): string | undefined;