typedoc 0.26.1 → 0.26.3

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 (40) hide show
  1. package/dist/lib/converter/comments/discovery.d.ts +4 -7
  2. package/dist/lib/converter/comments/discovery.js +144 -75
  3. package/dist/lib/converter/comments/index.d.ts +7 -4
  4. package/dist/lib/converter/comments/index.js +22 -16
  5. package/dist/lib/converter/comments/parser.js +5 -0
  6. package/dist/lib/converter/comments/textParser.js +12 -6
  7. package/dist/lib/converter/context.js +5 -5
  8. package/dist/lib/converter/converter.d.ts +0 -2
  9. package/dist/lib/converter/converter.js +5 -12
  10. package/dist/lib/converter/plugins/CommentPlugin.js +1 -1
  11. package/dist/lib/internationalization/locales/jp.cjs +2 -2
  12. package/dist/lib/internationalization/locales/jp.d.cts +1 -320
  13. package/dist/lib/internationalization/locales/ko.d.cts +1 -230
  14. package/dist/lib/internationalization/locales/zh.cjs +2 -2
  15. package/dist/lib/internationalization/locales/zh.d.cts +1 -320
  16. package/dist/lib/internationalization/translatable.d.ts +4 -4
  17. package/dist/lib/internationalization/translatable.js +2 -2
  18. package/dist/lib/models/FileRegistry.js +3 -4
  19. package/dist/lib/models/comments/comment.d.ts +7 -0
  20. package/dist/lib/models/comments/comment.js +15 -1
  21. package/dist/lib/output/events.d.ts +20 -7
  22. package/dist/lib/output/events.js +20 -0
  23. package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +3 -2
  24. package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +0 -2
  25. package/dist/lib/output/themes/default/partials/members.d.ts +1 -1
  26. package/dist/lib/output/themes/default/partials/members.js +39 -9
  27. package/dist/lib/output/themes/default/partials/navigation.js +27 -7
  28. package/dist/lib/utils/array.d.ts +3 -0
  29. package/dist/lib/utils/array.js +19 -0
  30. package/dist/lib/utils/enum.d.ts +3 -3
  31. package/dist/lib/utils/highlighter.js +1 -1
  32. package/dist/lib/utils/options/declaration.d.ts +2 -1
  33. package/dist/lib/utils/options/sources/typedoc.js +5 -0
  34. package/dist/lib/utils/options/tsdoc-defaults.d.ts +1 -1
  35. package/dist/lib/utils/options/tsdoc-defaults.js +2 -1
  36. package/package.json +7 -7
  37. package/static/style.css +10 -0
  38. package/tsdoc.json +4 -0
  39. package/dist/lib/output/themes/default/partials/members.group.d.ts +0 -4
  40. package/dist/lib/output/themes/default/partials/members.group.js +0 -25
@@ -86,7 +86,7 @@ function pageSidebar(context, props) {
86
86
  context.settings(),
87
87
  context.pageNavigation(props)));
88
88
  }
89
- function pageNavigation(context, props) {
89
+ function buildSectionNavigation(context, headings) {
90
90
  const levels = [[]];
91
91
  function finalizeLevel(finishedHandlingHeadings) {
92
92
  const level = levels.pop();
@@ -97,8 +97,12 @@ function pageNavigation(context, props) {
97
97
  const built = (utils_1.JSX.createElement("ul", null, level.map((l) => (utils_1.JSX.createElement("li", null, l)))));
98
98
  levels[levels.length - 1].push(built);
99
99
  }
100
- for (const heading of props.pageHeadings) {
101
- const inferredLevel = heading.level ? heading.level + 1 : 1;
100
+ for (const heading of headings) {
101
+ const inferredLevel = heading.level
102
+ ? heading.level + 2 // regular heading
103
+ : heading.kind
104
+ ? 2 // reflection
105
+ : 1; // group/category
102
106
  while (inferredLevel < levels.length) {
103
107
  finalizeLevel(false);
104
108
  }
@@ -113,15 +117,31 @@ function pageNavigation(context, props) {
113
117
  while (levels.length > 1) {
114
118
  finalizeLevel(true);
115
119
  }
116
- if (!levels[0].length) {
117
- return utils_1.JSX.createElement(utils_1.JSX.Fragment, null);
118
- }
119
120
  levels.unshift([]);
120
121
  finalizeLevel(true);
122
+ return levels[0];
123
+ }
124
+ function pageNavigation(context, props) {
125
+ if (!props.pageSections.some((sect) => sect.headings.length)) {
126
+ return utils_1.JSX.createElement(utils_1.JSX.Fragment, null);
127
+ }
128
+ const sections = [];
129
+ for (const section of props.pageSections) {
130
+ if (section.title) {
131
+ sections.push(utils_1.JSX.createElement("details", { open: true, class: "tsd-accordion tsd-page-navigation-section" },
132
+ utils_1.JSX.createElement("summary", { class: "tsd-accordion-summary", "data-key": `tsd-otp-${section.title}` },
133
+ context.icons.chevronDown(),
134
+ section.title),
135
+ utils_1.JSX.createElement("div", null, buildSectionNavigation(context, section.headings))));
136
+ }
137
+ else {
138
+ sections.push(buildSectionNavigation(context, section.headings));
139
+ }
140
+ }
121
141
  return (utils_1.JSX.createElement("details", { open: true, class: "tsd-accordion tsd-page-navigation" },
122
142
  utils_1.JSX.createElement("summary", { class: "tsd-accordion-summary" },
123
143
  utils_1.JSX.createElement("h3", null,
124
144
  context.icons.chevronDown(),
125
145
  context.i18n.theme_on_this_page())),
126
- utils_1.JSX.createElement("div", { class: "tsd-accordion-details" }, levels[0])));
146
+ utils_1.JSX.createElement("div", { class: "tsd-accordion-details" }, sections)));
127
147
  }
@@ -1,3 +1,4 @@
1
+ export declare const emptyArray: readonly [];
1
2
  /**
2
3
  * Inserts an item into an array sorted by priority. If two items have the same priority,
3
4
  * the item will be inserted later will be placed earlier in the array.
@@ -48,3 +49,5 @@ export declare function zip<T extends Iterable<any>[]>(...args: T): Iterable<{
48
49
  [K in keyof T]: T[K] extends Iterable<infer U> ? U : T[K];
49
50
  }>;
50
51
  export declare function filterMap<T, U>(iter: Iterable<T>, fn: (item: T) => U | undefined): U[];
52
+ export declare function firstDefined<T, U>(array: readonly T[] | undefined, callback: (element: T, index: number) => U | undefined): U | undefined;
53
+ export declare function filter<T>(array: readonly T[] | undefined, predicate: (value: T, index: number, array: readonly T[]) => boolean): readonly T[];
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.emptyArray = void 0;
3
4
  exports.insertPrioritySorted = insertPrioritySorted;
4
5
  exports.insertOrderSorted = insertOrderSorted;
5
6
  exports.binaryFindPartition = binaryFindPartition;
@@ -9,6 +10,9 @@ exports.unique = unique;
9
10
  exports.partition = partition;
10
11
  exports.zip = zip;
11
12
  exports.filterMap = filterMap;
13
+ exports.firstDefined = firstDefined;
14
+ exports.filter = filter;
15
+ exports.emptyArray = [];
12
16
  /**
13
17
  * Inserts an item into an array sorted by priority. If two items have the same priority,
14
18
  * the item will be inserted later will be placed earlier in the array.
@@ -123,3 +127,18 @@ function filterMap(iter, fn) {
123
127
  }
124
128
  return result;
125
129
  }
130
+ function firstDefined(array, callback) {
131
+ if (array === undefined) {
132
+ return undefined;
133
+ }
134
+ for (let i = 0; i < array.length; i++) {
135
+ const result = callback(array[i], i);
136
+ if (result !== undefined) {
137
+ return result;
138
+ }
139
+ }
140
+ return undefined;
141
+ }
142
+ function filter(array, predicate) {
143
+ return array ? array.filter(predicate) : exports.emptyArray;
144
+ }
@@ -4,6 +4,6 @@ export declare function hasAllFlags(flags: number, check: number): boolean;
4
4
  export declare function hasAnyFlag(flags: number, check: number): boolean;
5
5
  export declare function debugFlags(Enum: {}, flags: number): string[];
6
6
  export declare function getEnumKeys(Enum: {}): string[];
7
- export type EnumKeys<E extends {}> = keyof {
8
- [K in keyof E as number extends E[K] ? K : never]: 1;
9
- };
7
+ export type EnumKeys<E extends {}> = {
8
+ [K in keyof E]: number extends E[K] ? K : never;
9
+ }[keyof E] & {};
@@ -152,7 +152,7 @@ function getSupportedThemes() {
152
152
  return supportedThemes;
153
153
  }
154
154
  function isLoadedLanguage(lang) {
155
- return highlighter?.supports(lang) ?? false;
155
+ return lang === "text" || (highlighter?.supports(lang) ?? false);
156
156
  }
157
157
  function highlight(code, lang) {
158
158
  (0, assert_1.ok)(highlighter, "Tried to highlight with an uninitialized highlighter");
@@ -73,7 +73,7 @@ export interface TypeDocOptionMap {
73
73
  externalPattern: string[];
74
74
  excludeExternals: boolean;
75
75
  excludeNotDocumented: boolean;
76
- excludeNotDocumentedKinds: Array<keyof typeof ReflectionKind>;
76
+ excludeNotDocumentedKinds: ReflectionKind.KindString[];
77
77
  excludeInternal: boolean;
78
78
  excludePrivate: boolean;
79
79
  excludeProtected: boolean;
@@ -155,6 +155,7 @@ export interface TypeDocOptionMap {
155
155
  useTsLinkResolution: boolean;
156
156
  preserveLinkText: boolean;
157
157
  jsDocCompatibility: JsDocCompatibility;
158
+ suppressCommentWarningsInDeclarationFiles: boolean;
158
159
  blockTags: `@${string}`[];
159
160
  inlineTags: `@${string}`[];
160
161
  modifierTags: `@${string}`[];
@@ -610,6 +610,11 @@ function addTypeDocOptions(options) {
610
610
  ignoreUnescapedBraces: true,
611
611
  },
612
612
  });
613
+ options.addDeclaration({
614
+ name: "suppressCommentWarningsInDeclarationFiles",
615
+ help: (i18n) => i18n.help_lang(),
616
+ type: declaration_1.ParameterType.Boolean,
617
+ });
613
618
  options.addDeclaration({
614
619
  name: "commentStyle",
615
620
  help: (i18n) => i18n.help_commentStyle(),
@@ -1,5 +1,5 @@
1
1
  export declare const tsdocBlockTags: readonly ["@defaultValue", "@deprecated", "@example", "@param", "@privateRemarks", "@remarks", "@returns", "@see", "@throws", "@typeParam"];
2
- export declare const blockTags: readonly ["@defaultValue", "@deprecated", "@example", "@param", "@privateRemarks", "@remarks", "@returns", "@see", "@throws", "@typeParam", "@author", "@callback", "@category", "@categoryDescription", "@default", "@document", "@group", "@groupDescription", "@import", "@inheritDoc", "@jsx", "@license", "@module", "@prop", "@property", "@return", "@satisfies", "@template", "@type", "@typedef"];
2
+ export declare const blockTags: readonly ["@defaultValue", "@deprecated", "@example", "@param", "@privateRemarks", "@remarks", "@returns", "@see", "@throws", "@typeParam", "@author", "@callback", "@category", "@categoryDescription", "@default", "@document", "@group", "@groupDescription", "@import", "@inheritDoc", "@jsx", "@license", "@module", "@prop", "@property", "@return", "@satisfies", "@since", "@template", "@type", "@typedef"];
3
3
  export declare const tsdocInlineTags: readonly ["@link", "@inheritDoc", "@label"];
4
4
  export declare const inlineTags: readonly ["@link", "@inheritDoc", "@label", "@linkcode", "@linkplain"];
5
5
  export declare const tsdocModifierTags: readonly ["@alpha", "@beta", "@eventProperty", "@experimental", "@internal", "@override", "@packageDocumentation", "@public", "@readonly", "@sealed", "@virtual"];
@@ -33,8 +33,9 @@ exports.blockTags = [
33
33
  "@property",
34
34
  "@return",
35
35
  "@satisfies",
36
+ "@since",
36
37
  "@template", // Alias for @typeParam
37
- "@type", // Because TypeScript is important!
38
+ "@type",
38
39
  "@typedef",
39
40
  ];
40
41
  exports.tsdocInlineTags = ["@link", "@inheritDoc", "@label"];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "typedoc",
3
3
  "description": "Create api documentation for TypeScript projects.",
4
- "version": "0.26.1",
4
+ "version": "0.26.3",
5
5
  "homepage": "https://typedoc.org",
6
6
  "exports": {
7
7
  ".": "./dist/index.js",
@@ -26,8 +26,8 @@
26
26
  "dependencies": {
27
27
  "lunr": "^2.3.9",
28
28
  "markdown-it": "^14.1.0",
29
- "minimatch": "^9.0.4",
30
- "shiki": "^1.9.0",
29
+ "minimatch": "^9.0.5",
30
+ "shiki": "^1.9.1",
31
31
  "yaml": "^2.4.5"
32
32
  },
33
33
  "peerDependencies": {
@@ -36,18 +36,18 @@
36
36
  "devDependencies": {
37
37
  "@types/lunr": "^2.3.7",
38
38
  "@types/markdown-it": "^14.1.1",
39
- "@types/mocha": "^10.0.6",
39
+ "@types/mocha": "^10.0.7",
40
40
  "@types/node": "18",
41
41
  "@typestrong/fs-fixture-builder": "github:TypeStrong/fs-fixture-builder#34113409e3a171e68ce5e2b55461ef5c35591cfe",
42
42
  "c8": "^10.1.2",
43
43
  "esbuild": "^0.21.5",
44
44
  "eslint": "^9.5.0",
45
- "mocha": "^10.4.0",
45
+ "mocha": "^10.5.2",
46
46
  "prettier": "3.3.2",
47
- "puppeteer": "^22.12.0",
47
+ "puppeteer": "^22.12.1",
48
48
  "ts-node": "^10.9.2",
49
49
  "typescript": "5.5.2",
50
- "typescript-eslint": "^7.13.1"
50
+ "typescript-eslint": "^7.14.1"
51
51
  },
52
52
  "files": [
53
53
  "/bin",
package/static/style.css CHANGED
@@ -793,6 +793,15 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark {
793
793
  margin-left: -1.5rem;
794
794
  }
795
795
 
796
+ .tsd-page-navigation-section {
797
+ margin-left: 10px;
798
+ }
799
+ .tsd-page-navigation-section > summary {
800
+ padding: 0.25rem;
801
+ }
802
+ .tsd-page-navigation-section > div {
803
+ margin-left: 20px;
804
+ }
796
805
  .tsd-page-navigation ul {
797
806
  padding-left: 1.75rem;
798
807
  }
@@ -841,6 +850,7 @@ a.tsd-index-link {
841
850
  }
842
851
  .tsd-accordion .tsd-accordion-summary > svg {
843
852
  margin-left: 0.25rem;
853
+ vertical-align: text-top;
844
854
  }
845
855
  .tsd-index-content > :not(:first-child) {
846
856
  margin-top: 0.75rem;
package/tsdoc.json CHANGED
@@ -115,6 +115,10 @@
115
115
  "tagName": "@satisfies",
116
116
  "syntaxKind": "block"
117
117
  },
118
+ {
119
+ "tagName": "@since",
120
+ "syntaxKind": "block"
121
+ },
118
122
  {
119
123
  "tagName": "@license",
120
124
  "syntaxKind": "block"
@@ -1,4 +0,0 @@
1
- import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
2
- import { JSX } from "../../../../utils";
3
- import type { ReflectionGroup } from "../../../../models";
4
- export declare function membersGroup(context: DefaultThemeRenderContext, group: ReflectionGroup): JSX.Element;
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.membersGroup = membersGroup;
4
- const utils_1 = require("../../../../utils");
5
- function membersGroup(context, group) {
6
- if (group.categories) {
7
- return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null, group.categories.map((item) => {
8
- const title = `${group.title} - ${item.title}`;
9
- return (utils_1.JSX.createElement("details", { class: "tsd-panel-group tsd-member-group tsd-accordion", open: true },
10
- utils_1.JSX.createElement("summary", { class: "tsd-accordion-summary", "data-key": "section-" + title },
11
- utils_1.JSX.createElement("h2", null,
12
- context.icons.chevronDown(),
13
- " ",
14
- title)),
15
- utils_1.JSX.createElement("section", null, item.children.map((item) => !item.hasOwnDocument && context.member(item)))));
16
- })));
17
- }
18
- return (utils_1.JSX.createElement("details", { class: "tsd-panel-group tsd-member-group tsd-accordion", open: true },
19
- utils_1.JSX.createElement("summary", { class: "tsd-accordion-summary", "data-key": "section-" + group.title },
20
- utils_1.JSX.createElement("h2", null,
21
- context.icons.chevronDown(),
22
- " ",
23
- group.title)),
24
- utils_1.JSX.createElement("section", null, group.children.map((item) => !item.hasOwnDocument && context.member(item)))));
25
- }