typedoc 0.27.5 → 0.27.7

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 (67) hide show
  1. package/bin/typedoc +21 -2
  2. package/dist/index.d.ts +1 -1
  3. package/dist/lib/application.d.ts +30 -1
  4. package/dist/lib/application.js +96 -24
  5. package/dist/lib/cli.js +4 -4
  6. package/dist/lib/converter/comments/declarationReference.d.ts +2 -1
  7. package/dist/lib/converter/comments/declarationReference.js +9 -0
  8. package/dist/lib/converter/comments/linkResolver.js +20 -5
  9. package/dist/lib/converter/converter.d.ts +5 -3
  10. package/dist/lib/converter/converter.js +18 -21
  11. package/dist/lib/converter/factories/signature.js +16 -4
  12. package/dist/lib/converter/plugins/IncludePlugin.d.ts +4 -1
  13. package/dist/lib/converter/plugins/IncludePlugin.js +177 -4
  14. package/dist/lib/converter/plugins/PackagePlugin.js +5 -0
  15. package/dist/lib/converter/symbols.js +22 -8
  16. package/dist/lib/converter/types.d.ts +2 -2
  17. package/dist/lib/converter/types.js +26 -10
  18. package/dist/lib/converter/utils/nodes.d.ts +1 -0
  19. package/dist/lib/converter/utils/nodes.js +4 -0
  20. package/dist/lib/internationalization/internationalization.js +3 -1
  21. package/dist/lib/internationalization/locales/en.cjs +15 -0
  22. package/dist/lib/internationalization/locales/en.d.cts +14 -0
  23. package/dist/lib/internationalization/locales/ja.cjs +321 -0
  24. package/dist/lib/internationalization/locales/ja.d.cts +308 -0
  25. package/dist/lib/internationalization/locales/jp.cjs +2 -320
  26. package/dist/lib/internationalization/locales/jp.d.cts +2 -308
  27. package/dist/lib/internationalization/locales/zh.cjs +6 -3
  28. package/dist/lib/internationalization/locales/zh.d.cts +5 -2
  29. package/dist/lib/internationalization/translatable.d.ts +2 -1
  30. package/dist/lib/output/index.d.ts +1 -0
  31. package/dist/lib/output/plugins/AssetsPlugin.d.ts +1 -7
  32. package/dist/lib/output/plugins/AssetsPlugin.js +18 -7
  33. package/dist/lib/output/renderer.d.ts +1 -0
  34. package/dist/lib/output/renderer.js +10 -2
  35. package/dist/lib/output/themes/default/DefaultTheme.d.ts +3 -39
  36. package/dist/lib/output/themes/default/DefaultTheme.js +19 -10
  37. package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +12 -12
  38. package/dist/lib/output/themes/default/partials/icon.d.ts +17 -2
  39. package/dist/lib/output/themes/default/partials/icon.js +77 -79
  40. package/dist/lib/output/themes/default/partials/member.getterSetter.js +6 -6
  41. package/dist/lib/output/themes/default/partials/member.signatures.js +3 -3
  42. package/dist/lib/output/themes/default/templates/reflection.js +2 -2
  43. package/dist/lib/utils/array.d.ts +1 -0
  44. package/dist/lib/utils/array.js +15 -0
  45. package/dist/lib/utils/fs.d.ts +2 -2
  46. package/dist/lib/utils/fs.js +4 -3
  47. package/dist/lib/utils/general.d.ts +1 -0
  48. package/dist/lib/utils/general.js +11 -0
  49. package/dist/lib/utils/highlighter.d.ts +1 -1
  50. package/dist/lib/utils/highlighter.js +6 -4
  51. package/dist/lib/utils/options/declaration.d.ts +1 -0
  52. package/dist/lib/utils/options/defaults.d.ts +1 -0
  53. package/dist/lib/utils/options/defaults.js +1 -0
  54. package/dist/lib/utils/options/options.d.ts +3 -10
  55. package/dist/lib/utils/options/options.js +2 -20
  56. package/dist/lib/utils/options/readers/package-json.d.ts +1 -1
  57. package/dist/lib/utils/options/readers/package-json.js +2 -2
  58. package/dist/lib/utils/options/readers/tsconfig.d.ts +1 -1
  59. package/dist/lib/utils/options/readers/tsconfig.js +2 -2
  60. package/dist/lib/utils/options/readers/typedoc.d.ts +1 -4
  61. package/dist/lib/utils/options/readers/typedoc.js +6 -7
  62. package/dist/lib/utils/options/sources/typedoc.js +6 -0
  63. package/dist/lib/utils/tsconfig.d.ts +1 -1
  64. package/dist/lib/utils/tsconfig.js +2 -2
  65. package/package.json +1 -1
  66. package/static/main.js +3 -3
  67. 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 { icons } from "./partials/icon.js";
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 = { ...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.push("tsd-is-inherited");
441
+ classes.add("tsd-is-inherited");
441
442
  }
442
443
  }
443
444
  else if (key === "protected") {
444
445
  if (reflection.flags.isProtected) {
445
- classes.push("tsd-is-protected");
446
+ classes.add("tsd-is-protected");
446
447
  }
447
448
  }
448
449
  else if (key === "private") {
449
450
  if (reflection.flags.isPrivate) {
450
- classes.push("tsd-is-private");
451
+ classes.add("tsd-is-private");
451
452
  }
452
453
  }
453
454
  else if (key === "external") {
454
455
  if (reflection.flags.isExternal) {
455
- classes.push("tsd-is-external");
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.push(toStyleClass(`tsd-is-${key.substring(1)}`));
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.push(toStyleClass(`tsd-is-${key.substring(1)}`));
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 { DocumentReflection, CommentDisplayPart, DeclarationReflection, Reflection } from "../../../models/index.js";
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 icons } from "./partials/icon.js";
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<typeof icons>;
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: DeclarationReflection | DocumentReflection) => string;
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;
@@ -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
- export declare function buildRefIcons<T extends Record<string, () => JSX.Element>>(icons: T, context: DefaultThemeRenderContext): T;
5
- export declare const icons: Record<ReflectionKind | "chevronDown" | "checkbox" | "menu" | "search" | "chevronSmall" | "anchor" | "folder" | "alertNote" | "alertTip" | "alertImportant" | "alertWarning" | "alertCaution", () => JSX.Element>;
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 const icons = {
28
- [ReflectionKind.Accessor]: () => textIcon("A", "var(--color-ts-accessor)", true),
29
- [ReflectionKind.CallSignature]() {
30
- return this[ReflectionKind.Function]();
31
- },
32
- [ReflectionKind.Class]: () => textIcon("C", "var(--color-ts-class)"),
33
- [ReflectionKind.Constructor]: () => textIcon("C", "var(--color-ts-constructor)", true),
34
- [ReflectionKind.ConstructorSignature]() {
35
- return this[ReflectionKind.Constructor]();
36
- },
37
- [ReflectionKind.Enum]: () => textIcon("E", "var(--color-ts-enum)"),
38
- [ReflectionKind.EnumMember]() {
39
- return this[ReflectionKind.Property]();
40
- },
41
- [ReflectionKind.Function]: () => textIcon("F", "var(--color-ts-function)"),
42
- [ReflectionKind.GetSignature]() {
43
- return this[ReflectionKind.Accessor]();
44
- },
45
- [ReflectionKind.IndexSignature]() {
46
- return this[ReflectionKind.Property]();
47
- },
48
- [ReflectionKind.Interface]: () => textIcon("I", "var(--color-ts-interface)"),
49
- [ReflectionKind.Method]: () => textIcon("M", "var(--color-ts-method)", true),
50
- [ReflectionKind.Module]: () => textIcon("M", "var(--color-ts-module)"),
51
- [ReflectionKind.Namespace]: () => textIcon("N", "var(--color-ts-namespace)"),
52
- [ReflectionKind.Parameter]() {
53
- return this[ReflectionKind.Property]();
54
- },
55
- [ReflectionKind.Project]() {
56
- return this[ReflectionKind.Module]();
57
- },
58
- [ReflectionKind.Property]: () => textIcon("P", "var(--color-ts-property)", true),
59
- [ReflectionKind.Reference]: () => textIcon("R", "var(--color-ts-reference)", true),
60
- [ReflectionKind.SetSignature]() {
61
- return this[ReflectionKind.Accessor]();
62
- },
63
- [ReflectionKind.TypeAlias]: () => textIcon("T", "var(--color-ts-type-alias)"),
64
- [ReflectionKind.TypeLiteral]() {
65
- return this[ReflectionKind.TypeAlias]();
66
- },
67
- [ReflectionKind.TypeParameter]() {
68
- return this[ReflectionKind.TypeAlias]();
69
- },
70
- [ReflectionKind.Variable]: () => textIcon("V", "var(--color-ts-variable)"),
71
- [ReflectionKind.Document]: () => kindIcon(JSX.createElement("g", { stroke: "var(--color-icon-text)", fill: "none", "stroke-width": "1.5" },
72
- JSX.createElement("polygon", { points: "6,5 6,19 18,19, 18,10 13,5" }),
73
- JSX.createElement("line", { x1: "9", y1: "9", x2: "13", y2: "9" }),
74
- JSX.createElement("line", { x1: "9", y1: "12", x2: "15", y2: "12" }),
75
- JSX.createElement("line", { x1: "9", y1: "15", x2: "15", y2: "15" })), "var(--color-document)"),
76
- folder: () => kindIcon(JSX.createElement("g", { stroke: "var(--color-icon-text)", fill: "none", "stroke-width": "1.5" },
77
- JSX.createElement("polygon", { points: "5,5 10,5 12,8 19,8 19,18 5,18" })), "var(--color-document)"),
78
- chevronDown: () => (JSX.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none" },
79
- 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)" }))),
80
- chevronSmall: () => (JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
81
- 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)" }))),
82
- checkbox: () => (JSX.createElement("svg", { width: "32", height: "32", viewBox: "0 0 32 32", "aria-hidden": "true" },
83
- JSX.createElement("rect", { class: "tsd-checkbox-background", width: "30", height: "30", x: "1", y: "1", rx: "6", fill: "none" }),
84
- 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" }))),
85
- menu: () => (JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, ["3", "7", "11"].map((y) => (JSX.createElement("rect", { x: "1", y: y, width: "14", height: "2", fill: "var(--color-icon-text)" }))))),
86
- search: () => (JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
87
- 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)" }))),
88
- anchor: () => (JSX.createElement("svg", { viewBox: "0 0 24 24" },
89
- JSX.createElement("g", { "stroke-width": "2", stroke: "currentColor", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round" },
90
- JSX.createElement("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
91
- 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" }),
92
- 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" })))),
93
- alertNote: () => (JSX.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16" },
94
- 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" }))),
95
- alertTip: () => (JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16" },
96
- 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" }))),
97
- alertImportant: () => (JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16" },
98
- 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" }))),
99
- alertWarning: () => (JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16" },
100
- 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" }))),
101
- alertCaution: () => (JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16" },
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(JSX.Fragment, null,
8
- JSX.createElement("li", { class: "tsd-signature", id: props.getSignature.anchor }, context.memberSignatureTitle(props.getSignature)),
9
- JSX.createElement("li", { class: "tsd-description" }, context.memberSignatureBody(props.getSignature)))),
10
- !!props.setSignature && (JSX.createElement(JSX.Fragment, null,
11
- JSX.createElement("li", { class: "tsd-signature", id: props.setSignature.anchor }, context.memberSignatureTitle(props.setSignature)),
12
- JSX.createElement("li", { class: "tsd-description" }, context.memberSignatureBody(props.setSignature)))))));
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(JSX.Fragment, null,
6
- JSX.createElement("li", { class: "tsd-signature tsd-anchor-link" },
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("li", { class: "tsd-description" }, context.memberSignatureBody(item))))))));
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: classNames({ "tsd-panel": true }, context.getReflectionClasses(props.model)) },
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" }, "["),
@@ -54,3 +54,4 @@ export declare function filter<T>(array: readonly T[] | undefined, predicate: (v
54
54
  export declare function aggregate<T>(arr: T[], fn: (item: T) => number): number;
55
55
  export declare function aggregateWithJoiner<T>(arr: T[], fn: (item: T) => number, joiner: string): number;
56
56
  export declare function joinArray<T>(arr: readonly T[] | undefined, joiner: string, mapper: (item: T) => string): string;
57
+ export declare function maxElementByScore<T>(arr: readonly T[], score: (a: T) => number): T | undefined;
@@ -141,3 +141,18 @@ export function joinArray(arr, joiner, mapper) {
141
141
  }
142
142
  return "";
143
143
  }
144
+ export function maxElementByScore(arr, score) {
145
+ if (arr.length === 0) {
146
+ return undefined;
147
+ }
148
+ let largest = arr[0];
149
+ let largestScore = score(arr[0]);
150
+ for (let i = 1; i < arr.length; ++i) {
151
+ const itemScore = score(arr[i]);
152
+ if (itemScore > largestScore) {
153
+ largest = arr[i];
154
+ largestScore = itemScore;
155
+ }
156
+ }
157
+ return largest;
158
+ }
@@ -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;
@@ -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;
@@ -1,5 +1,5 @@
1
1
  import * as shiki from "@gerrit0/mini-shiki";
2
- export declare function loadHighlighter(lightTheme: shiki.BundledTheme, darkTheme: shiki.BundledTheme, langs: shiki.BundledLanguage[]): Promise<void>;
2
+ export declare function loadHighlighter(lightTheme: shiki.BundledTheme, darkTheme: shiki.BundledTheme, langs: shiki.BundledLanguage[], ignoredLangs: string[] | undefined): Promise<void>;
3
3
  export declare function isSupportedLanguage(lang: string): boolean;
4
4
  export declare function getSupportedLanguages(): string[];
5
5
  export declare function getSupportedThemes(): string[];
@@ -92,9 +92,11 @@ class DoubleHighlighter {
92
92
  }
93
93
  let shikiEngine;
94
94
  let highlighter;
95
- export async function loadHighlighter(lightTheme, darkTheme, langs) {
95
+ let ignoredLanguages;
96
+ export async function loadHighlighter(lightTheme, darkTheme, langs, ignoredLangs) {
96
97
  if (highlighter)
97
98
  return;
99
+ ignoredLanguages = ignoredLangs;
98
100
  if (!shikiEngine) {
99
101
  await shiki.loadBuiltinWasm();
100
102
  shikiEngine = await shiki.createOnigurumaEngine();
@@ -107,7 +109,7 @@ export async function loadHighlighter(lightTheme, darkTheme, langs) {
107
109
  highlighter = new DoubleHighlighter(hl, lightTheme, darkTheme);
108
110
  }
109
111
  export function isSupportedLanguage(lang) {
110
- return getSupportedLanguages().includes(lang);
112
+ return ignoredLanguages?.includes(lang) || getSupportedLanguages().includes(lang);
111
113
  }
112
114
  export function getSupportedLanguages() {
113
115
  return supportedLanguages;
@@ -116,11 +118,11 @@ export function getSupportedThemes() {
116
118
  return supportedThemes;
117
119
  }
118
120
  export function isLoadedLanguage(lang) {
119
- return plaintextLanguages.includes(lang) || (highlighter?.supports(lang) ?? false);
121
+ return (plaintextLanguages.includes(lang) || ignoredLanguages?.includes(lang) || highlighter?.supports(lang) || false);
120
122
  }
121
123
  export function highlight(code, lang) {
122
124
  assert(highlighter, "Tried to highlight with an uninitialized highlighter");
123
- if (plaintextLanguages.includes(lang)) {
125
+ if (plaintextLanguages.includes(lang) || ignoredLanguages?.includes(lang)) {
124
126
  return JSX.renderElement(JSX.createElement(JSX.Fragment, null, code));
125
127
  }
126
128
  return highlighter.highlight(code, aliases.get(lang) ?? lang);
@@ -105,6 +105,7 @@ export interface TypeDocOptionMap {
105
105
  lightHighlightTheme: ShikiTheme;
106
106
  darkHighlightTheme: ShikiTheme;
107
107
  highlightLanguages: string[];
108
+ ignoredHighlightLanguages: string[];
108
109
  typePrintWidth: number;
109
110
  customCss: string;
110
111
  customJs: string;
@@ -13,6 +13,7 @@ export declare const modifierTags: readonly `@${string}`[];
13
13
  export declare const cascadedModifierTags: readonly `@${string}`[];
14
14
  export declare const notRenderedTags: readonly `@${string}`[];
15
15
  export declare const highlightLanguages: readonly BundledLanguage[];
16
+ export declare const ignoredHighlightLanguages: readonly string[];
16
17
  export declare const sort: readonly string[];
17
18
  export declare const kindSortOrder: readonly EnumKeys<typeof ReflectionKind>[];
18
19
  export declare const requiredToBeDocumented: readonly EnumKeys<typeof ReflectionKind>[];
@@ -61,6 +61,7 @@ export const highlightLanguages = [
61
61
  "tsx",
62
62
  "typescript",
63
63
  ];
64
+ export const ignoredHighlightLanguages = [];
64
65
  export const sort = [
65
66
  "kind",
66
67
  "instance-first",