typedoc 0.28.0-beta.1 → 0.28.0

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 (70) hide show
  1. package/dist/index.d.ts +2 -2
  2. package/dist/lib/converter/context.d.ts +16 -6
  3. package/dist/lib/converter/context.js +39 -3
  4. package/dist/lib/converter/factories/signature.js +1 -1
  5. package/dist/lib/converter/factories/symbol-id.js +1 -0
  6. package/dist/lib/converter/plugins/MergeModuleWithPlugin.js +1 -1
  7. package/dist/lib/converter/plugins/SourcePlugin.js +1 -1
  8. package/dist/lib/converter/symbols.js +14 -4
  9. package/dist/lib/converter/types.js +16 -21
  10. package/dist/lib/models/ContainerReflection.d.ts +2 -2
  11. package/dist/lib/models/ContainerReflection.js +28 -4
  12. package/dist/lib/models/ProjectReflection.d.ts +1 -1
  13. package/dist/lib/models/ProjectReflection.js +1 -1
  14. package/dist/lib/models/ReflectionSymbolId.d.ts +10 -0
  15. package/dist/lib/models/ReflectionSymbolId.js +10 -0
  16. package/dist/lib/models/types.d.ts +1 -1
  17. package/dist/lib/models/types.js +7 -1
  18. package/dist/lib/output/components.d.ts +3 -3
  19. package/dist/lib/output/events.d.ts +4 -3
  20. package/dist/lib/output/events.js +4 -0
  21. package/dist/lib/output/formatter.d.ts +1 -0
  22. package/dist/lib/output/formatter.js +3 -0
  23. package/dist/lib/output/index.d.ts +1 -1
  24. package/dist/lib/output/plugins/JavascriptIndexPlugin.js +8 -2
  25. package/dist/lib/output/renderer.d.ts +2 -7
  26. package/dist/lib/output/renderer.js +6 -43
  27. package/dist/lib/output/router.d.ts +49 -37
  28. package/dist/lib/output/router.js +73 -47
  29. package/dist/lib/output/theme.d.ts +10 -3
  30. package/dist/lib/output/theme.js +8 -0
  31. package/dist/lib/output/themes/MarkedPlugin.js +21 -6
  32. package/dist/lib/output/themes/default/DefaultTheme.d.ts +12 -6
  33. package/dist/lib/output/themes/default/DefaultTheme.js +281 -207
  34. package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +47 -40
  35. package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +9 -0
  36. package/dist/lib/output/themes/default/layouts/default.js +1 -1
  37. package/dist/lib/output/themes/default/partials/anchor-icon.d.ts +1 -2
  38. package/dist/lib/output/themes/default/partials/anchor-icon.js +2 -9
  39. package/dist/lib/output/themes/default/partials/breadcrumb.js +2 -2
  40. package/dist/lib/output/themes/default/partials/comment.js +2 -3
  41. package/dist/lib/output/themes/default/partials/index.js +4 -6
  42. package/dist/lib/output/themes/default/partials/member.declaration.js +1 -1
  43. package/dist/lib/output/themes/default/partials/member.js +3 -5
  44. package/dist/lib/output/themes/default/partials/member.signature.body.js +2 -2
  45. package/dist/lib/output/themes/default/partials/member.signatures.js +2 -3
  46. package/dist/lib/output/themes/default/partials/members.js +2 -4
  47. package/dist/lib/output/themes/default/partials/moduleReflection.js +6 -10
  48. package/dist/lib/output/themes/default/partials/navigation.js +5 -7
  49. package/dist/lib/output/themes/default/partials/reflectionPreview.js +8 -0
  50. package/dist/lib/output/themes/default/partials/typeDetails.d.ts +5 -5
  51. package/dist/lib/output/themes/default/partials/typeDetails.js +99 -53
  52. package/dist/lib/output/themes/default/partials/typeParameters.js +2 -3
  53. package/dist/lib/output/themes/default/templates/hierarchy.js +3 -5
  54. package/dist/lib/output/themes/default/templates/reflection.js +7 -3
  55. package/dist/lib/output/themes/lib.js +8 -4
  56. package/dist/lib/utils/highlighter.d.ts +1 -0
  57. package/dist/lib/utils/highlighter.js +16 -2
  58. package/dist/lib/utils/index.d.ts +1 -0
  59. package/dist/lib/utils/index.js +1 -0
  60. package/dist/lib/utils/options/defaults.js +2 -0
  61. package/dist/lib/utils/options/tsdoc-defaults.d.ts +1 -1
  62. package/dist/lib/utils/options/tsdoc-defaults.js +4 -0
  63. package/dist/lib/utils-common/jsx.elements.d.ts +16 -0
  64. package/dist/lib/utils-common/path.js +4 -1
  65. package/package.json +8 -8
  66. package/static/main.js +4 -4
  67. package/static/style.css +24 -18
  68. package/tsdoc.json +16 -0
  69. package/dist/lib/converter/factories/types.d.ts +0 -4
  70. package/dist/lib/converter/factories/types.js +0 -13
@@ -4,7 +4,7 @@ import { type Options } from "../../../utils/index.js";
4
4
  import type { DefaultTheme } from "./DefaultTheme.js";
5
5
  import { type Icons } from "./partials/icon.js";
6
6
  import type { Router } from "../../router.js";
7
- import type { NeverIfInternal } from "#utils";
7
+ import type { JSX, NeverIfInternal } from "#utils";
8
8
  export declare class DefaultThemeRenderContext {
9
9
  readonly router: Router;
10
10
  readonly theme: DefaultTheme;
@@ -15,11 +15,18 @@ export declare class DefaultThemeRenderContext {
15
15
  constructor(router: Router, theme: DefaultTheme, page: PageEvent<Reflection>, options: Options);
16
16
  /**
17
17
  * Icons available for use within the page.
18
+ * When getting an icon for a reflection, {@link reflectionIcon} should be used so
19
+ * that themes which define multiple icon variants can correctly specify which icon
20
+ * they want to be used.
18
21
  *
19
22
  * Note: This creates a reference to icons declared by {@link DefaultTheme.icons},
20
23
  * to customize icons, that object must be modified instead.
21
24
  */
22
25
  get icons(): Readonly<Icons>;
26
+ /**
27
+ * Do not override this method, override {@link DefaultTheme.getReflectionIcon} instead.
28
+ */
29
+ reflectionIcon: (reflection: Reflection) => JSX.Element;
23
30
  get slugger(): import("./Slugger.js").Slugger;
24
31
  hook: Renderer["hooks"]["emit"];
25
32
  /** Avoid this in favor of urlTo if possible */
@@ -28,14 +35,14 @@ export declare class DefaultThemeRenderContext {
28
35
  urlTo: (reflection: Reflection) => string | undefined;
29
36
  markdown: (md: readonly CommentDisplayPart[] | NeverIfInternal<string | undefined>) => string;
30
37
  /** Renders user comment markdown wrapped in a tsd-comment div */
31
- displayParts: (parts: readonly CommentDisplayPart[] | undefined) => import("../../../utils-common/jsx.elements.js").JsxElement | undefined;
38
+ displayParts: (parts: readonly CommentDisplayPart[] | undefined) => JSX.Element | undefined;
32
39
  getNavigation: () => import("./DefaultTheme.js").NavigationElement[];
33
40
  getReflectionClasses: (refl: Reflection) => string;
34
- documentTemplate: (props: PageEvent<import("../../../models/DocumentReflection.js").DocumentReflection>) => import("../../../utils-common/jsx.elements.js").JsxElement;
35
- reflectionTemplate: (props: PageEvent<import("../../../models/ContainerReflection.js").ContainerReflection>) => import("../../../utils-common/jsx.elements.js").JsxElement;
36
- indexTemplate: (props: PageEvent<import("../../../models/ProjectReflection.js").ProjectReflection>) => import("../../../utils-common/jsx.elements.js").JsxElement;
37
- hierarchyTemplate: (props: PageEvent<import("../../../models/ProjectReflection.js").ProjectReflection>) => import("../../../utils-common/jsx.elements.js").JsxElement;
38
- defaultLayout: (template: import("./DefaultTheme.js").RenderTemplate<PageEvent<Reflection>>, props: PageEvent<Reflection>) => import("../../../utils-common/jsx.elements.js").JsxElement;
41
+ documentTemplate: (props: PageEvent<import("../../../models/DocumentReflection.js").DocumentReflection>) => JSX.Element;
42
+ reflectionTemplate: (props: PageEvent<import("../../../models/ContainerReflection.js").ContainerReflection>) => JSX.Element;
43
+ indexTemplate: (props: PageEvent<import("../../../models/ProjectReflection.js").ProjectReflection>) => JSX.Element;
44
+ hierarchyTemplate: (props: PageEvent<import("../../../models/ProjectReflection.js").ProjectReflection>) => JSX.Element;
45
+ defaultLayout: (template: import("./DefaultTheme.js").RenderTemplate<PageEvent<Reflection>>, props: PageEvent<Reflection>) => JSX.Element;
39
46
  /**
40
47
  * Rendered just after the description for a reflection.
41
48
  * This can be used to render a shortened type display of a reflection that the
@@ -44,55 +51,55 @@ export declare class DefaultThemeRenderContext {
44
51
  * Note: Will not be called for variables/type aliases, as they are summarized
45
52
  * by their type declaration, which is already rendered by {@link DefaultThemeRenderContext.memberDeclaration}
46
53
  */
47
- reflectionPreview: (props: Reflection) => import("../../../utils-common/jsx.elements.js").JsxElement | undefined;
54
+ reflectionPreview: (props: Reflection) => JSX.Element | undefined;
48
55
  /**
49
56
  * Used to render additional details about a type. This is used to implement
50
57
  * the `@expand` tag, comments on union members, comments on object type members...
51
58
  */
52
- typeDetails: (type: import("../../../models/types.js").SomeType, renderAnchors: boolean) => import("../../../utils-common/jsx.elements.js").JsxChildren;
59
+ typeDetails: (reflectionOwningType: Reflection, type: import("../../../models/types.js").SomeType, renderAnchors: boolean) => JSX.Children;
53
60
  /**
54
61
  * Should call the {@link typeDetails} helper if rendering additional details
55
62
  * about the type will provide the user with more information about the type.
56
63
  */
57
- typeDetailsIfUseful: (type: import("../../../models/types.js").SomeType | undefined) => import("../../../utils-common/jsx.elements.js").JsxChildren;
64
+ typeDetailsIfUseful: (reflectionOwningType: Reflection, type: import("../../../models/types.js").SomeType | undefined) => JSX.Children;
58
65
  /**
59
66
  * Wrapper around {@link typeDetails} which checks if it is useful
60
67
  * and includes a "Type Declaration" header.
61
68
  */
62
- typeDeclaration: (type: import("../../../models/types.js").SomeType) => import("../../../utils-common/jsx.elements.js").JsxChildren;
63
- breadcrumbs: (props: Reflection) => import("../../../utils-common/jsx.elements.js").JsxElement;
64
- commentShortSummary: (props: Reflection) => import("../../../utils-common/jsx.elements.js").JsxElement | undefined;
65
- commentSummary: (props: Reflection) => import("../../../utils-common/jsx.elements.js").JsxElement | undefined;
66
- commentTags: (props: Reflection) => import("../../../utils-common/jsx.elements.js").JsxElement | undefined;
67
- reflectionFlags: (props: Reflection) => import("../../../utils-common/jsx.elements.js").JsxElement;
68
- footer: () => import("../../../utils-common/jsx.elements.js").JsxElement;
69
- header: (props: PageEvent<Reflection>) => import("../../../utils-common/jsx.elements.js").JsxElement;
70
- hierarchy: (typeHierarchy: import("../../../models/DeclarationReflection.js").DeclarationHierarchy | undefined) => import("../../../utils-common/jsx.elements.js").JsxElement | undefined;
71
- index: (props: import("../../../models/ContainerReflection.js").ContainerReflection) => import("../../../utils-common/jsx.elements.js").JsxElement;
72
- member: (props: import("../../../models/DocumentReflection.js").DocumentReflection | import("../../../models/DeclarationReflection.js").DeclarationReflection) => import("../../../utils-common/jsx.elements.js").JsxElement;
73
- moduleReflection: (mod: import("../../../models/DeclarationReflection.js").DeclarationReflection | import("../../../models/ProjectReflection.js").ProjectReflection) => import("../../../utils-common/jsx.elements.js").JsxElement;
74
- moduleMemberSummary: (member: import("../../../models/DocumentReflection.js").DocumentReflection | import("../../../models/DeclarationReflection.js").DeclarationReflection) => import("../../../utils-common/jsx.elements.js").JsxElement;
75
- memberDeclaration: (props: import("../../../models/DeclarationReflection.js").DeclarationReflection) => import("../../../utils-common/jsx.elements.js").JsxElement;
76
- memberGetterSetter: (props: import("../../../models/DeclarationReflection.js").DeclarationReflection) => import("../../../utils-common/jsx.elements.js").JsxElement;
69
+ typeDeclaration: (reflectionOwningType: Reflection, type: import("../../../models/types.js").SomeType) => JSX.Children;
70
+ breadcrumbs: (props: Reflection) => JSX.Element;
71
+ commentShortSummary: (props: Reflection) => JSX.Element | undefined;
72
+ commentSummary: (props: Reflection) => JSX.Element | undefined;
73
+ commentTags: (props: Reflection) => JSX.Element | undefined;
74
+ reflectionFlags: (props: Reflection) => JSX.Element;
75
+ footer: () => JSX.Element;
76
+ header: (props: PageEvent<Reflection>) => JSX.Element;
77
+ hierarchy: (typeHierarchy: import("../../../models/DeclarationReflection.js").DeclarationHierarchy | undefined) => JSX.Element | undefined;
78
+ index: (props: import("../../../models/ContainerReflection.js").ContainerReflection) => JSX.Element;
79
+ member: (props: import("../../../models/DocumentReflection.js").DocumentReflection | import("../../../models/DeclarationReflection.js").DeclarationReflection) => JSX.Element;
80
+ moduleReflection: (mod: import("../../../models/DeclarationReflection.js").DeclarationReflection | import("../../../models/ProjectReflection.js").ProjectReflection) => JSX.Element;
81
+ moduleMemberSummary: (member: import("../../../models/DocumentReflection.js").DocumentReflection | import("../../../models/DeclarationReflection.js").DeclarationReflection) => JSX.Element;
82
+ memberDeclaration: (props: import("../../../models/DeclarationReflection.js").DeclarationReflection) => JSX.Element;
83
+ memberGetterSetter: (props: import("../../../models/DeclarationReflection.js").DeclarationReflection) => JSX.Element;
77
84
  memberSignatureBody: (props: import("../../../models/SignatureReflection.js").SignatureReflection, r_1?: {
78
85
  hideSources?: boolean;
79
- } | undefined) => import("../../../utils-common/jsx.elements.js").JsxElement;
86
+ } | undefined) => JSX.Element;
80
87
  memberSignatureTitle: (props: import("../../../models/SignatureReflection.js").SignatureReflection, options?: {
81
88
  hideName?: boolean;
82
- } | undefined) => import("../../../utils-common/jsx.elements.js").JsxElement;
83
- memberSignatures: (props: import("../../../models/DeclarationReflection.js").DeclarationReflection) => import("../../../utils-common/jsx.elements.js").JsxElement;
84
- memberSources: (props: import("../../../models/DeclarationReflection.js").DeclarationReflection | import("../../../models/SignatureReflection.js").SignatureReflection) => import("../../../utils-common/jsx.elements.js").JsxElement;
85
- members: (props: import("../../../models/ContainerReflection.js").ContainerReflection) => import("../../../utils-common/jsx.elements.js").JsxElement;
86
- sidebar: (props: PageEvent<Reflection>) => import("../../../utils-common/jsx.elements.js").JsxElement;
87
- pageSidebar: (props: PageEvent<Reflection>) => import("../../../utils-common/jsx.elements.js").JsxElement;
88
- sidebarLinks: () => import("../../../utils-common/jsx.elements.js").JsxElement | null;
89
- settings: () => import("../../../utils-common/jsx.elements.js").JsxElement;
90
- navigation: (props: PageEvent<Reflection>) => import("../../../utils-common/jsx.elements.js").JsxElement;
91
- pageNavigation: (props: PageEvent<Reflection>) => import("../../../utils-common/jsx.elements.js").JsxElement;
92
- toolbar: (props: PageEvent<Reflection>) => import("../../../utils-common/jsx.elements.js").JsxElement;
89
+ } | undefined) => JSX.Element;
90
+ memberSignatures: (props: import("../../../models/DeclarationReflection.js").DeclarationReflection) => JSX.Element;
91
+ memberSources: (props: import("../../../models/DeclarationReflection.js").DeclarationReflection | import("../../../models/SignatureReflection.js").SignatureReflection) => JSX.Element;
92
+ members: (props: import("../../../models/ContainerReflection.js").ContainerReflection) => JSX.Element;
93
+ sidebar: (props: PageEvent<Reflection>) => JSX.Element;
94
+ pageSidebar: (props: PageEvent<Reflection>) => JSX.Element;
95
+ sidebarLinks: () => JSX.Element | null;
96
+ settings: () => JSX.Element;
97
+ navigation: (props: PageEvent<Reflection>) => JSX.Element;
98
+ pageNavigation: (props: PageEvent<Reflection>) => JSX.Element;
99
+ toolbar: (props: PageEvent<Reflection>) => JSX.Element;
93
100
  type: (type: import("../../../models/types.js").SomeType | undefined, options?: {
94
101
  topLevelLinks: boolean;
95
- } | undefined) => import("../../../utils-common/jsx.elements.js").JsxElement;
96
- typeAndParent: (props: import("../../../models/types.js").Type) => import("../../../utils-common/jsx.elements.js").JsxElement;
97
- typeParameters: (typeParameters: import("../../../models/TypeParameterReflection.js").TypeParameterReflection[]) => import("../../../utils-common/jsx.elements.js").JsxElement;
102
+ } | undefined) => JSX.Element;
103
+ typeAndParent: (props: import("../../../models/types.js").Type) => JSX.Element;
104
+ typeParameters: (typeParameters: import("../../../models/TypeParameterReflection.js").TypeParameterReflection[]) => JSX.Element;
98
105
  }
@@ -47,6 +47,9 @@ export class DefaultThemeRenderContext {
47
47
  }
48
48
  /**
49
49
  * Icons available for use within the page.
50
+ * When getting an icon for a reflection, {@link reflectionIcon} should be used so
51
+ * that themes which define multiple icon variants can correctly specify which icon
52
+ * they want to be used.
50
53
  *
51
54
  * Note: This creates a reference to icons declared by {@link DefaultTheme.icons},
52
55
  * to customize icons, that object must be modified instead.
@@ -54,6 +57,12 @@ export class DefaultThemeRenderContext {
54
57
  get icons() {
55
58
  return this._refIcons;
56
59
  }
60
+ /**
61
+ * Do not override this method, override {@link DefaultTheme.getReflectionIcon} instead.
62
+ */
63
+ reflectionIcon = (reflection) => {
64
+ return this.icons[this.theme.getReflectionIcon(reflection)]();
65
+ };
57
66
  get slugger() {
58
67
  return this.router.getSlugger(this.page.model);
59
68
  }
@@ -67,7 +67,7 @@ export const defaultLayout = (context, template, props) => (JSX.createElement("h
67
67
  JSX.createElement("script", null,
68
68
  JSX.createElement(JSX.Raw, { html: 'document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";' }),
69
69
  JSX.createElement(JSX.Raw, { html: 'document.body.style.display="none";' }),
70
- JSX.createElement(JSX.Raw, { html: 'setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)' })),
70
+ JSX.createElement(JSX.Raw, { html: 'setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)' })),
71
71
  context.toolbar(props),
72
72
  JSX.createElement("div", { class: "container container-main" },
73
73
  JSX.createElement("div", { class: "col-content" },
@@ -2,5 +2,4 @@ import type { Reflection } from "../../../../models/index.js";
2
2
  import { JSX } from "#utils";
3
3
  import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
4
4
  export declare function anchorIcon(context: DefaultThemeRenderContext, anchor: string | undefined): JSX.Element;
5
- export declare function anchorLink(anchor: string | undefined): JSX.Element;
6
- export declare function anchorLinkIfPresent(context: DefaultThemeRenderContext, refl: Reflection): JSX.Element;
5
+ export declare function anchorTargetIfPresent(context: DefaultThemeRenderContext, refl: Reflection): string | undefined;
@@ -4,13 +4,6 @@ export function anchorIcon(context, anchor) {
4
4
  return JSX.createElement(JSX.Fragment, null);
5
5
  return (JSX.createElement("a", { href: `#${anchor}`, "aria-label": i18n.theme_permalink(), class: "tsd-anchor-icon" }, context.icons.anchor()));
6
6
  }
7
- export function anchorLink(anchor) {
8
- if (!anchor)
9
- return JSX.createElement(JSX.Fragment, null);
10
- return JSX.createElement("a", { id: anchor, class: "tsd-anchor" });
11
- }
12
- export function anchorLinkIfPresent(context, refl) {
13
- if (!context.router.hasUrl(refl))
14
- return JSX.createElement(JSX.Fragment, null);
15
- return anchorLink(context.router.getAnchor(refl));
7
+ export function anchorTargetIfPresent(context, refl) {
8
+ return context.router.hasUrl(refl) ? context.router.getAnchor(refl) : undefined;
16
9
  }
@@ -6,6 +6,6 @@ export function breadcrumbs(context, props) {
6
6
  path.push(refl);
7
7
  refl = refl.parent;
8
8
  }
9
- return (JSX.createElement("ul", { class: "tsd-breadcrumb" }, path.reverse().map((r) => (JSX.createElement("li", null,
10
- JSX.createElement("a", { href: context.urlTo(r) }, r.name))))));
9
+ return (JSX.createElement("ul", { class: "tsd-breadcrumb", "aria-label": "Breadcrumb" }, path.reverse().map((r, index) => (JSX.createElement("li", null,
10
+ JSX.createElement("a", { href: context.urlTo(r), "aria-current": index === path.length - 1 ? "page" : undefined }, r.name))))));
11
11
  }
@@ -1,6 +1,6 @@
1
1
  import { JSX, translateTagName } from "#utils";
2
2
  import { ReflectionKind } from "../../../../models/index.js";
3
- import { anchorIcon, anchorLink } from "./anchor-icon.js";
3
+ import { anchorIcon } from "./anchor-icon.js";
4
4
  import { join } from "../../lib.js";
5
5
  // Note: Comment modifiers are handled in `renderFlags`
6
6
  export function renderDisplayParts({ markdown }, parts) {
@@ -57,8 +57,7 @@ export function commentTags(context, props) {
57
57
  const anchor = context.slugger.slug(name);
58
58
  return (JSX.createElement(JSX.Fragment, null,
59
59
  JSX.createElement("div", { class: `tsd-tag-${item.tag.substring(1)}` },
60
- JSX.createElement("h4", { class: "tsd-anchor-link" },
61
- anchorLink(anchor),
60
+ JSX.createElement("h4", { class: "tsd-anchor-link", id: anchor },
62
61
  name,
63
62
  anchorIcon(context, anchor)),
64
63
  JSX.createElement(JSX.Raw, { html: context.markdown(item.content) }))));
@@ -1,13 +1,13 @@
1
1
  import { classNames, renderName } from "../../lib.js";
2
2
  import { i18n, JSX } from "#utils";
3
- function renderCategory({ urlTo, icons, getReflectionClasses, markdown }, item, prependName = "") {
3
+ function renderCategory({ urlTo, reflectionIcon, getReflectionClasses, markdown }, item, prependName = "") {
4
4
  return (JSX.createElement("section", { class: "tsd-index-section" },
5
5
  JSX.createElement("h3", { class: "tsd-index-heading" }, prependName ? `${prependName} - ${item.title}` : item.title),
6
6
  item.description && (JSX.createElement("div", { class: "tsd-comment tsd-typography" },
7
7
  JSX.createElement(JSX.Raw, { html: markdown(item.description) }))),
8
8
  JSX.createElement("div", { class: "tsd-index-list" }, item.children.map((item) => (JSX.createElement(JSX.Fragment, null,
9
9
  JSX.createElement("a", { href: urlTo(item), class: classNames({ "tsd-index-link": true, deprecated: item.isDeprecated() }, getReflectionClasses(item)) },
10
- icons[item.kind](),
10
+ reflectionIcon(item),
11
11
  JSX.createElement("span", null, renderName(item))),
12
12
  "\n"))))));
13
13
  }
@@ -26,9 +26,7 @@ export function index(context, props) {
26
26
  JSX.createElement("section", { class: "tsd-panel tsd-index-panel" },
27
27
  JSX.createElement("details", { class: "tsd-index-content tsd-accordion", open: true },
28
28
  JSX.createElement("summary", { class: "tsd-accordion-summary tsd-index-summary" },
29
- JSX.createElement("h5", { class: "tsd-index-heading uppercase", role: "button", "aria-expanded": "false", tabIndex: 0 },
30
- context.icons.chevronSmall(),
31
- " ",
32
- i18n.theme_index())),
29
+ context.icons.chevronSmall(),
30
+ JSX.createElement("h5", { class: "tsd-index-heading uppercase" }, i18n.theme_index())),
33
31
  JSX.createElement("div", { class: "tsd-accordion-details" }, content))))));
34
32
  }
@@ -27,7 +27,7 @@ export function memberDeclaration(context, props) {
27
27
  props.defaultValue)))),
28
28
  context.commentSummary(props),
29
29
  hasTypeParameters(props) && context.typeParameters(props.typeParameters),
30
- props.type && context.typeDeclaration(props.type),
30
+ props.type && context.typeDeclaration(props, props.type),
31
31
  context.commentTags(props),
32
32
  context.memberSources(props)));
33
33
  }
@@ -1,7 +1,7 @@
1
1
  import { classNames, getDisplayName, wbr } from "../../lib.js";
2
2
  import { JSX } from "#utils";
3
3
  import {} from "../../../../models/index.js";
4
- import { anchorIcon, anchorLink } from "./anchor-icon.js";
4
+ import { anchorIcon } from "./anchor-icon.js";
5
5
  export function member(context, props) {
6
6
  const anchor = context.getAnchor(props);
7
7
  context.page.pageHeadings.push({
@@ -14,8 +14,7 @@ export function member(context, props) {
14
14
  // own pages. Handle it here in case someone creates a custom url scheme which embeds guides within the page.
15
15
  if (props.isDocument()) {
16
16
  return (JSX.createElement("section", { class: classNames({ "tsd-panel": true, "tsd-member": true }, context.getReflectionClasses(props)) },
17
- anchorLink(anchor),
18
- !!props.name && (JSX.createElement("h3", { class: "tsd-anchor-link" },
17
+ !!props.name && (JSX.createElement("h3", { class: "tsd-anchor-link", id: anchor },
19
18
  context.reflectionFlags(props),
20
19
  JSX.createElement("span", { class: classNames({ deprecated: props.isDeprecated() }) }, wbr(props.name)),
21
20
  anchorIcon(context, anchor))),
@@ -23,8 +22,7 @@ export function member(context, props) {
23
22
  JSX.createElement(JSX.Raw, { html: context.markdown(props.content) }))));
24
23
  }
25
24
  return (JSX.createElement("section", { class: classNames({ "tsd-panel": true, "tsd-member": true }, context.getReflectionClasses(props)) },
26
- anchorLink(anchor),
27
- !!props.name && (JSX.createElement("h3", { class: "tsd-anchor-link" },
25
+ !!props.name && (JSX.createElement("h3", { class: "tsd-anchor-link", id: anchor },
28
26
  context.reflectionFlags(props),
29
27
  JSX.createElement("span", { class: classNames({ deprecated: props.isDeprecated() }) }, wbr(props.name)),
30
28
  anchorIcon(context, anchor))),
@@ -20,14 +20,14 @@ export function memberSignatureBody(context, props, { hideSources = false } = {}
20
20
  item.defaultValue))),
21
21
  context.commentSummary(item),
22
22
  context.commentTags(item),
23
- context.typeDetailsIfUseful(item.type))))))),
23
+ context.typeDetailsIfUseful(item, item.type))))))),
24
24
  props.type && (JSX.createElement(JSX.Fragment, null,
25
25
  JSX.createElement("h4", { class: "tsd-returns-title" },
26
26
  i18n.theme_returns(),
27
27
  " ",
28
28
  context.type(props.type)),
29
29
  returnsTag && JSX.createElement(JSX.Raw, { html: context.markdown(returnsTag.content) }),
30
- context.typeDetailsIfUseful(props.type))),
30
+ context.typeDetailsIfUseful(props, props.type))),
31
31
  context.commentTags(props),
32
32
  !hideSources && context.memberSources(props)));
33
33
  }
@@ -1,10 +1,9 @@
1
1
  import { JSX } from "#utils";
2
- import { anchorIcon, anchorLink } from "./anchor-icon.js";
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
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
- anchorLink(context.getAnchor(item)),
6
+ JSX.createElement("div", { class: "tsd-signature tsd-anchor-link", id: context.getAnchor(item) },
8
7
  context.memberSignatureTitle(item),
9
8
  anchorIcon(context, context.getAnchor(item))),
10
9
  JSX.createElement("div", { class: "tsd-description" }, context.memberSignatureBody(item))))))));
@@ -7,10 +7,8 @@ export function members(context, props) {
7
7
  context.page.startNewSection(title);
8
8
  return (JSX.createElement("details", { class: "tsd-panel-group tsd-member-group tsd-accordion", open: true },
9
9
  JSX.createElement("summary", { class: "tsd-accordion-summary", "data-key": "section-" + title },
10
- JSX.createElement("h2", null,
11
- context.icons.chevronDown(),
12
- " ",
13
- title)),
10
+ context.icons.chevronDown(),
11
+ JSX.createElement("h2", null, title)),
14
12
  JSX.createElement("section", null, children.map((item) => context.member(item)))));
15
13
  })));
16
14
  }
@@ -1,7 +1,7 @@
1
1
  import { ReferenceReflection, ReflectionKind, } from "../../../../models/index.js";
2
2
  import { JSX } from "#utils";
3
3
  import { classNames, getDisplayName, getMemberSections, getUniquePath, join } from "../../lib.js";
4
- import { anchorIcon, anchorLink } from "./anchor-icon.js";
4
+ import { anchorIcon } from "./anchor-icon.js";
5
5
  export function moduleReflection(context, mod) {
6
6
  const sections = getMemberSections(mod);
7
7
  return (JSX.createElement(JSX.Fragment, null,
@@ -14,10 +14,8 @@ export function moduleReflection(context, mod) {
14
14
  context.page.startNewSection(title);
15
15
  return (JSX.createElement("details", { class: "tsd-panel-group tsd-member-group tsd-accordion", open: true },
16
16
  JSX.createElement("summary", { class: "tsd-accordion-summary", "data-key": "section-" + title },
17
- JSX.createElement("h2", null,
18
- context.icons.chevronDown(),
19
- " ",
20
- title)),
17
+ context.icons.chevronDown(),
18
+ JSX.createElement("h2", null, title)),
21
19
  description && (JSX.createElement("div", { class: "tsd-comment tsd-typography" },
22
20
  JSX.createElement(JSX.Raw, { html: context.markdown(description) }))),
23
21
  JSX.createElement("dl", { class: "tsd-member-summaries" }, children.map((item) => context.moduleMemberSummary(item)))));
@@ -35,7 +33,7 @@ export function moduleMemberSummary(context, member) {
35
33
  if (member instanceof ReferenceReflection) {
36
34
  const target = member.getTargetReflectionDeep();
37
35
  name = (JSX.createElement("span", { class: "tsd-member-summary-name" },
38
- context.icons[target.kind](),
36
+ context.reflectionIcon(target),
39
37
  JSX.createElement("span", { class: classNames({ deprecated: member.isDeprecated() }) }, member.name),
40
38
  JSX.createElement("span", null,
41
39
  "\u00A0",
@@ -46,14 +44,12 @@ export function moduleMemberSummary(context, member) {
46
44
  }
47
45
  else {
48
46
  name = (JSX.createElement("span", { class: "tsd-member-summary-name" },
49
- context.icons[member.kind](),
47
+ context.reflectionIcon(member),
50
48
  JSX.createElement("a", { class: classNames({ deprecated: member.isDeprecated() }), href: context.urlTo(member) }, member.name),
51
49
  anchorIcon(context, id)));
52
50
  }
53
51
  return (JSX.createElement(JSX.Fragment, null,
54
- JSX.createElement("dt", { class: classNames({ "tsd-member-summary": true }, context.getReflectionClasses(member)) },
55
- anchorLink(id),
56
- name),
52
+ JSX.createElement("dt", { class: classNames({ "tsd-member-summary": true }, context.getReflectionClasses(member)), id: id }, name),
57
53
  JSX.createElement("dd", { class: classNames({ "tsd-member-summary": true }, context.getReflectionClasses(member)) }, context.commentShortSummary(member))));
58
54
  }
59
55
  // Note: This version of uniqueName does NOT include colors... they looked weird to me
@@ -50,9 +50,8 @@ export function settings(context) {
50
50
  return (JSX.createElement("div", { class: "tsd-navigation settings" },
51
51
  JSX.createElement("details", { class: "tsd-accordion", open: false },
52
52
  JSX.createElement("summary", { class: "tsd-accordion-summary" },
53
- JSX.createElement("h3", null,
54
- context.icons.chevronDown(),
55
- i18n.theme_settings())),
53
+ context.icons.chevronDown(),
54
+ JSX.createElement("h3", null, i18n.theme_settings())),
56
55
  JSX.createElement("div", { class: "tsd-accordion-details" },
57
56
  visibilityOptions.length && (JSX.createElement("div", { class: "tsd-filter-visibility" },
58
57
  JSX.createElement("span", { class: "settings-label" }, i18n.theme_member_visibility()),
@@ -101,7 +100,7 @@ function buildSectionNavigation(context, headings) {
101
100
  // Lower level than before
102
101
  levels.push([]);
103
102
  }
104
- levels[levels.length - 1].push(JSX.createElement("a", { href: heading.link, class: heading.classes },
103
+ levels[levels.length - 1].push(JSX.createElement("a", { href: heading.link, class: classNames({}, heading.classes) },
105
104
  heading.kind && context.icons[heading.kind](),
106
105
  JSX.createElement("span", null, wbr(heading.text))));
107
106
  }
@@ -131,8 +130,7 @@ export function pageNavigation(context, props) {
131
130
  }
132
131
  return (JSX.createElement("details", { open: true, class: "tsd-accordion tsd-page-navigation" },
133
132
  JSX.createElement("summary", { class: "tsd-accordion-summary" },
134
- JSX.createElement("h3", null,
135
- context.icons.chevronDown(),
136
- i18n.theme_on_this_page())),
133
+ context.icons.chevronDown(),
134
+ JSX.createElement("h3", null, i18n.theme_on_this_page())),
137
135
  JSX.createElement("div", { class: "tsd-accordion-details" }, sections)));
138
136
  }
@@ -15,4 +15,12 @@ export function reflectionPreview(context, props) {
15
15
  generator.node(tree, Wrap.Enable);
16
16
  return JSX.createElement("div", { class: "tsd-signature" }, generator.toElement());
17
17
  }
18
+ if (props.kindOf(ReflectionKind.TypeAlias) && props.children) {
19
+ const builder = new FormattedCodeBuilder(context.router, context.model);
20
+ const tree = builder.typeAlias(props);
21
+ const generator = new FormattedCodeGenerator(context.options.getValue("typePrintWidth"));
22
+ generator.forceWrap(builder.forceWrap); // Ensure elements are added to new lines.
23
+ generator.node(tree, Wrap.Enable);
24
+ return JSX.createElement("div", { class: "tsd-signature" }, generator.toElement());
25
+ }
18
26
  }
@@ -1,8 +1,8 @@
1
- import { type CommentDisplayPart } from "../../../../models/index.js";
1
+ import { type CommentDisplayPart, Reflection } from "../../../../models/index.js";
2
2
  import type { SomeType } from "../../../../models/types.js";
3
3
  import { JSX } from "#utils";
4
4
  import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
5
- export declare function typeDeclaration(context: DefaultThemeRenderContext, type: SomeType): JSX.Children;
6
- export declare function typeDetails(context: DefaultThemeRenderContext, type: SomeType, renderAnchors: boolean): JSX.Children;
7
- export declare function typeDetailsImpl(context: DefaultThemeRenderContext, type: SomeType, renderAnchors: boolean, highlighted?: Map<string, CommentDisplayPart[]>): JSX.Children;
8
- export declare function typeDetailsIfUseful(context: DefaultThemeRenderContext, type: SomeType | undefined): JSX.Children;
5
+ export declare function typeDeclaration(context: DefaultThemeRenderContext, reflectionOwningType: Reflection, type: SomeType): JSX.Children;
6
+ export declare function typeDetails(context: DefaultThemeRenderContext, reflectionOwningType: Reflection, type: SomeType, renderAnchors: boolean): JSX.Children;
7
+ export declare function typeDetailsImpl(context: DefaultThemeRenderContext, reflectionOwningType: Reflection, type: SomeType, renderAnchors: boolean, highlighted?: Map<string, CommentDisplayPart[]>): JSX.Children;
8
+ export declare function typeDetailsIfUseful(context: DefaultThemeRenderContext, reflectionOwningType: Reflection, type: SomeType | undefined): JSX.Children;