typedoc 0.26.4 → 0.26.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/lib/application.js +3 -4
- package/dist/lib/converter/comments/discovery.js +5 -0
- package/dist/lib/converter/comments/parser.js +4 -3
- package/dist/lib/converter/plugins/ImplementsPlugin.d.ts +12 -0
- package/dist/lib/converter/plugins/ImplementsPlugin.js +91 -72
- package/dist/lib/internationalization/internationalization.js +1 -1
- package/dist/lib/internationalization/translatable.js +2 -4
- package/dist/lib/models/FileRegistry.js +5 -1
- package/dist/lib/models/comments/comment.d.ts +12 -0
- package/dist/lib/models/comments/comment.js +33 -0
- package/dist/lib/models/reflections/project.d.ts +8 -0
- package/dist/lib/models/reflections/project.js +14 -1
- package/dist/lib/output/plugins/JavascriptIndexPlugin.js +4 -2
- package/dist/lib/output/themes/default/DefaultTheme.js +27 -18
- package/dist/lib/serialization/components.d.ts +1 -1
- package/dist/lib/serialization/deserializer.js +0 -1
- package/dist/lib/serialization/serializer.d.ts +5 -1
- package/dist/lib/serialization/serializer.js +3 -0
- package/dist/lib/utils/array.d.ts +1 -1
- package/dist/lib/utils/array.js +2 -2
- package/dist/lib/utils/component.d.ts +1 -1
- package/dist/lib/utils/enum.d.ts +3 -3
- package/dist/lib/utils/fs.d.ts +1 -0
- package/dist/lib/utils/fs.js +4 -0
- package/dist/lib/utils/index.d.ts +1 -1
- package/dist/lib/utils/index.js +2 -1
- package/dist/lib/utils/options/declaration.d.ts +1 -0
- package/dist/lib/utils/options/defaults.d.ts +23 -0
- package/dist/lib/utils/options/defaults.js +120 -0
- package/dist/lib/utils/options/index.d.ts +1 -0
- package/dist/lib/utils/options/index.js +3 -1
- package/dist/lib/utils/options/readers/typedoc.js +1 -0
- package/dist/lib/utils/options/sources/typedoc.js +13 -64
- package/dist/lib/utils/options/tsdoc-defaults.d.ts +1 -1
- package/dist/lib/utils/options/tsdoc-defaults.js +3 -0
- package/dist/lib/utils/perf.d.ts +2 -2
- package/dist/lib/utils/plugins.js +1 -0
- package/dist/lib/utils/sort.js +4 -29
- package/dist/lib/validation/documentation.js +5 -1
- package/package.json +2 -2
- package/static/main.js +1 -1
- package/tsdoc.json +12 -0
|
@@ -32,11 +32,14 @@ class Serializer extends utils_1.EventDispatcher {
|
|
|
32
32
|
*/
|
|
33
33
|
projectToObject(value, projectRoot) {
|
|
34
34
|
this.projectRoot = projectRoot;
|
|
35
|
+
this.project = value;
|
|
35
36
|
const eventBegin = new events_1.SerializeEvent(value);
|
|
36
37
|
this.trigger(Serializer.EVENT_BEGIN, eventBegin);
|
|
37
38
|
const project = this.toObject(value);
|
|
38
39
|
const eventEnd = new events_1.SerializeEvent(value, project);
|
|
39
40
|
this.trigger(Serializer.EVENT_END, eventEnd);
|
|
41
|
+
this.project = undefined;
|
|
42
|
+
this.projectRoot = undefined;
|
|
40
43
|
return project;
|
|
41
44
|
}
|
|
42
45
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const emptyArray: readonly [];
|
|
2
2
|
/**
|
|
3
3
|
* Inserts an item into an array sorted by priority. If two items have the same priority,
|
|
4
|
-
* the item will be inserted later will be placed
|
|
4
|
+
* the item will be inserted later will be placed later in the array.
|
|
5
5
|
* @param arr modified by inserting item.
|
|
6
6
|
* @param item
|
|
7
7
|
*/
|
package/dist/lib/utils/array.js
CHANGED
|
@@ -15,12 +15,12 @@ exports.filter = filter;
|
|
|
15
15
|
exports.emptyArray = [];
|
|
16
16
|
/**
|
|
17
17
|
* Inserts an item into an array sorted by priority. If two items have the same priority,
|
|
18
|
-
* the item will be inserted later will be placed
|
|
18
|
+
* the item will be inserted later will be placed later in the array.
|
|
19
19
|
* @param arr modified by inserting item.
|
|
20
20
|
* @param item
|
|
21
21
|
*/
|
|
22
22
|
function insertPrioritySorted(arr, item) {
|
|
23
|
-
const index = binaryFindPartition(arr, (v) => v.priority
|
|
23
|
+
const index = binaryFindPartition(arr, (v) => v.priority < item.priority);
|
|
24
24
|
arr.splice(index === -1 ? arr.length : index, 0, item);
|
|
25
25
|
return arr;
|
|
26
26
|
}
|
|
@@ -8,7 +8,7 @@ export interface ComponentHost {
|
|
|
8
8
|
}
|
|
9
9
|
export interface Component<E extends Record<keyof E, unknown[]> = {}> extends AbstractComponent<ComponentHost, E> {
|
|
10
10
|
}
|
|
11
|
-
export interface ComponentClass<T extends Component, O extends ComponentHost = ComponentHost>
|
|
11
|
+
export interface ComponentClass<T extends Component, O extends ComponentHost = ComponentHost> {
|
|
12
12
|
new (owner: O): T;
|
|
13
13
|
}
|
|
14
14
|
/**
|
package/dist/lib/utils/enum.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ export declare function getEnumFlags<T extends number>(flags: T): T[];
|
|
|
2
2
|
export declare function removeFlag<T extends number>(flag: T, remove: T & {}): T;
|
|
3
3
|
export declare function hasAllFlags(flags: number, check: number): boolean;
|
|
4
4
|
export declare function hasAnyFlag(flags: number, check: number): boolean;
|
|
5
|
-
export declare function debugFlags(Enum:
|
|
6
|
-
export declare function getEnumKeys(Enum:
|
|
7
|
-
export type EnumKeys<E extends
|
|
5
|
+
export declare function debugFlags(Enum: object, flags: number): string[];
|
|
6
|
+
export declare function getEnumKeys(Enum: object): string[];
|
|
7
|
+
export type EnumKeys<E extends object> = {
|
|
8
8
|
[K in keyof E]: number extends E[K] ? K : never;
|
|
9
9
|
}[keyof E] & {};
|
package/dist/lib/utils/fs.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export declare function glob(pattern: string, root: string, options?: {
|
|
|
43
43
|
followSymlinks?: boolean;
|
|
44
44
|
}): string[];
|
|
45
45
|
export declare function hasTsExtension(path: string): boolean;
|
|
46
|
+
export declare function hasDeclarationFileExtension(path: string): boolean;
|
|
46
47
|
export declare function discoverInParentDir<T extends {}>(name: string, dir: string, read: (content: string) => T | undefined): {
|
|
47
48
|
file: string;
|
|
48
49
|
content: T;
|
package/dist/lib/utils/fs.js
CHANGED
|
@@ -34,6 +34,7 @@ exports.copy = copy;
|
|
|
34
34
|
exports.copySync = copySync;
|
|
35
35
|
exports.glob = glob;
|
|
36
36
|
exports.hasTsExtension = hasTsExtension;
|
|
37
|
+
exports.hasDeclarationFileExtension = hasDeclarationFileExtension;
|
|
37
38
|
exports.discoverInParentDir = discoverInParentDir;
|
|
38
39
|
exports.discoverInParentDirExactMatch = discoverInParentDirExactMatch;
|
|
39
40
|
exports.discoverPackageJson = discoverPackageJson;
|
|
@@ -277,6 +278,9 @@ function glob(pattern, root, options = {}) {
|
|
|
277
278
|
function hasTsExtension(path) {
|
|
278
279
|
return /\.[cm]?ts$|\.tsx$/.test(path);
|
|
279
280
|
}
|
|
281
|
+
function hasDeclarationFileExtension(path) {
|
|
282
|
+
return /\.d\.[cm]?ts$/.test(path);
|
|
283
|
+
}
|
|
280
284
|
function discoverInParentDir(name, dir, read) {
|
|
281
285
|
if (!isDir(dir))
|
|
282
286
|
return;
|
|
@@ -8,7 +8,7 @@ export type { IfInternal, NeverIfInternal, Chars } from "./general";
|
|
|
8
8
|
export { assertNever } from "./general";
|
|
9
9
|
export { ConsoleLogger, Logger, LogLevel } from "./loggers";
|
|
10
10
|
export { DefaultMap } from "./map";
|
|
11
|
-
export { ArgumentsReader, Option, CommentStyle, Options, PackageJsonReader, ParameterHint, ParameterType, TSConfigReader, TypeDocReader, } from "./options";
|
|
11
|
+
export { ArgumentsReader, Option, CommentStyle, Options, PackageJsonReader, ParameterHint, ParameterType, TSConfigReader, TypeDocReader, OptionDefaults, } from "./options";
|
|
12
12
|
export type { ArrayDeclarationOption, BooleanDeclarationOption, DeclarationOption, DeclarationOptionBase, DeclarationOptionToOptionType, KeyToDeclaration, MapDeclarationOption, MixedDeclarationOption, NumberDeclarationOption, FlagsDeclarationOption, ObjectDeclarationOption, OptionsReader, StringDeclarationOption, TypeDocOptionMap, TypeDocOptions, ValidationOptions, TypeDocOptionValues, ParameterTypeToOptionTypeMap, ManuallyValidatedOption, JsDocCompatibility, } from "./options";
|
|
13
13
|
export { loadPlugins } from "./plugins";
|
|
14
14
|
export { getSortFunction } from "./sort";
|
package/dist/lib/utils/index.js
CHANGED
|
@@ -26,7 +26,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
26
26
|
return result;
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.MinimalSourceFile = exports.Validation = exports.renderElement = exports.Raw = exports.Fragment = exports.JSX = exports.EventHooks = exports.getSortFunction = exports.loadPlugins = exports.TypeDocReader = exports.TSConfigReader = exports.ParameterType = exports.ParameterHint = exports.PackageJsonReader = exports.Options = exports.CommentStyle = exports.Option = exports.ArgumentsReader = exports.DefaultMap = exports.LogLevel = exports.Logger = exports.ConsoleLogger = exports.assertNever = exports.normalizePath = exports.discoverPackageJson = exports.discoverInParentDir = exports.writeFileSync = exports.writeFile = exports.readFile = exports.getCommonDirectory = exports.copySync = exports.copy = exports.isFile = exports.EventDispatcher = exports.Component = exports.ChildableComponent = exports.AbstractComponent = exports.unique = exports.removeIfPresent = exports.removeIf = exports.partition = exports.insertPrioritySorted = exports.filterMap = void 0;
|
|
29
|
+
exports.MinimalSourceFile = exports.Validation = exports.renderElement = exports.Raw = exports.Fragment = exports.JSX = exports.EventHooks = exports.getSortFunction = exports.loadPlugins = exports.OptionDefaults = exports.TypeDocReader = exports.TSConfigReader = exports.ParameterType = exports.ParameterHint = exports.PackageJsonReader = exports.Options = exports.CommentStyle = exports.Option = exports.ArgumentsReader = exports.DefaultMap = exports.LogLevel = exports.Logger = exports.ConsoleLogger = exports.assertNever = exports.normalizePath = exports.discoverPackageJson = exports.discoverInParentDir = exports.writeFileSync = exports.writeFile = exports.readFile = exports.getCommonDirectory = exports.copySync = exports.copy = exports.isFile = exports.EventDispatcher = exports.Component = exports.ChildableComponent = exports.AbstractComponent = exports.unique = exports.removeIfPresent = exports.removeIf = exports.partition = exports.insertPrioritySorted = exports.filterMap = void 0;
|
|
30
30
|
var array_1 = require("./array");
|
|
31
31
|
Object.defineProperty(exports, "filterMap", { enumerable: true, get: function () { return array_1.filterMap; } });
|
|
32
32
|
Object.defineProperty(exports, "insertPrioritySorted", { enumerable: true, get: function () { return array_1.insertPrioritySorted; } });
|
|
@@ -71,6 +71,7 @@ Object.defineProperty(exports, "ParameterHint", { enumerable: true, get: functio
|
|
|
71
71
|
Object.defineProperty(exports, "ParameterType", { enumerable: true, get: function () { return options_1.ParameterType; } });
|
|
72
72
|
Object.defineProperty(exports, "TSConfigReader", { enumerable: true, get: function () { return options_1.TSConfigReader; } });
|
|
73
73
|
Object.defineProperty(exports, "TypeDocReader", { enumerable: true, get: function () { return options_1.TypeDocReader; } });
|
|
74
|
+
Object.defineProperty(exports, "OptionDefaults", { enumerable: true, get: function () { return options_1.OptionDefaults; } });
|
|
74
75
|
var plugins_1 = require("./plugins");
|
|
75
76
|
Object.defineProperty(exports, "loadPlugins", { enumerable: true, get: function () { return plugins_1.loadPlugins; } });
|
|
76
77
|
var sort_1 = require("./sort");
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { BundledLanguage } from "shiki" with { "resolution-mode": "import" };
|
|
2
|
+
import type { EnumKeys } from "../enum";
|
|
3
|
+
import type { ReflectionKind } from "../../models/index";
|
|
4
|
+
/**
|
|
5
|
+
* Default values for TypeDoc options. This object should not be modified.
|
|
6
|
+
*
|
|
7
|
+
* @privateRemarks
|
|
8
|
+
* These are declared here, rather than within the option declaration, so that
|
|
9
|
+
* they can be exposed as a part of the public API. The unfortunate type declaration
|
|
10
|
+
* is to control the type which appears in the generated documentation.
|
|
11
|
+
*/
|
|
12
|
+
export declare const OptionDefaults: {
|
|
13
|
+
excludeNotDocumentedKinds: readonly EnumKeys<typeof ReflectionKind>[];
|
|
14
|
+
excludeTags: readonly `@${string}`[];
|
|
15
|
+
blockTags: readonly `@${string}`[];
|
|
16
|
+
inlineTags: readonly `@${string}`[];
|
|
17
|
+
modifierTags: readonly `@${string}`[];
|
|
18
|
+
cascadedModifierTags: readonly `@${string}`[];
|
|
19
|
+
highlightLanguages: readonly BundledLanguage[];
|
|
20
|
+
sort: readonly string[];
|
|
21
|
+
kindSortOrder: readonly EnumKeys<typeof ReflectionKind>[];
|
|
22
|
+
requiredToBeDocumented: readonly EnumKeys<typeof ReflectionKind>[];
|
|
23
|
+
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.OptionDefaults = void 0;
|
|
27
|
+
const TagDefaults = __importStar(require("./tsdoc-defaults"));
|
|
28
|
+
/**
|
|
29
|
+
* Default values for TypeDoc options. This object should not be modified.
|
|
30
|
+
*
|
|
31
|
+
* @privateRemarks
|
|
32
|
+
* These are declared here, rather than within the option declaration, so that
|
|
33
|
+
* they can be exposed as a part of the public API. The unfortunate type declaration
|
|
34
|
+
* is to control the type which appears in the generated documentation.
|
|
35
|
+
*/
|
|
36
|
+
exports.OptionDefaults = {
|
|
37
|
+
excludeNotDocumentedKinds: [
|
|
38
|
+
"Module",
|
|
39
|
+
"Namespace",
|
|
40
|
+
"Enum",
|
|
41
|
+
// Not including enum member here by default
|
|
42
|
+
"Variable",
|
|
43
|
+
"Function",
|
|
44
|
+
"Class",
|
|
45
|
+
"Interface",
|
|
46
|
+
"Constructor",
|
|
47
|
+
"Property",
|
|
48
|
+
"Method",
|
|
49
|
+
"CallSignature",
|
|
50
|
+
"IndexSignature",
|
|
51
|
+
"ConstructorSignature",
|
|
52
|
+
"Accessor",
|
|
53
|
+
"GetSignature",
|
|
54
|
+
"SetSignature",
|
|
55
|
+
"TypeAlias",
|
|
56
|
+
"Reference",
|
|
57
|
+
],
|
|
58
|
+
excludeTags: [
|
|
59
|
+
"@override",
|
|
60
|
+
"@virtual",
|
|
61
|
+
"@privateRemarks",
|
|
62
|
+
"@satisfies",
|
|
63
|
+
"@overload",
|
|
64
|
+
],
|
|
65
|
+
blockTags: TagDefaults.blockTags,
|
|
66
|
+
inlineTags: TagDefaults.inlineTags,
|
|
67
|
+
modifierTags: TagDefaults.modifierTags,
|
|
68
|
+
cascadedModifierTags: ["@alpha", "@beta", "@experimental"],
|
|
69
|
+
highlightLanguages: [
|
|
70
|
+
"bash",
|
|
71
|
+
"console",
|
|
72
|
+
"css",
|
|
73
|
+
"html",
|
|
74
|
+
"javascript",
|
|
75
|
+
"json",
|
|
76
|
+
"jsonc",
|
|
77
|
+
"json5",
|
|
78
|
+
"tsx",
|
|
79
|
+
"typescript",
|
|
80
|
+
],
|
|
81
|
+
sort: ["kind", "instance-first", "alphabetical"],
|
|
82
|
+
kindSortOrder: [
|
|
83
|
+
"Document",
|
|
84
|
+
"Reference",
|
|
85
|
+
"Project",
|
|
86
|
+
"Module",
|
|
87
|
+
"Namespace",
|
|
88
|
+
"Enum",
|
|
89
|
+
"EnumMember",
|
|
90
|
+
"Class",
|
|
91
|
+
"Interface",
|
|
92
|
+
"TypeAlias",
|
|
93
|
+
"Constructor",
|
|
94
|
+
"Property",
|
|
95
|
+
"Variable",
|
|
96
|
+
"Function",
|
|
97
|
+
"Accessor",
|
|
98
|
+
"Method",
|
|
99
|
+
"Parameter",
|
|
100
|
+
"TypeParameter",
|
|
101
|
+
"TypeLiteral",
|
|
102
|
+
"CallSignature",
|
|
103
|
+
"ConstructorSignature",
|
|
104
|
+
"IndexSignature",
|
|
105
|
+
"GetSignature",
|
|
106
|
+
"SetSignature",
|
|
107
|
+
],
|
|
108
|
+
requiredToBeDocumented: [
|
|
109
|
+
"Enum",
|
|
110
|
+
"EnumMember",
|
|
111
|
+
"Variable",
|
|
112
|
+
"Function",
|
|
113
|
+
"Class",
|
|
114
|
+
"Interface",
|
|
115
|
+
"Property",
|
|
116
|
+
"Method",
|
|
117
|
+
"Accessor",
|
|
118
|
+
"TypeAlias",
|
|
119
|
+
],
|
|
120
|
+
};
|
|
@@ -3,3 +3,4 @@ export type { OptionsReader } from "./options";
|
|
|
3
3
|
export { ArgumentsReader, PackageJsonReader, TypeDocReader, TSConfigReader, } from "./readers";
|
|
4
4
|
export { CommentStyle, EmitStrategy, ParameterType, ParameterHint, } from "./declaration";
|
|
5
5
|
export type { TypeDocOptions, TypeDocOptionMap, ValidationOptions, KeyToDeclaration, DeclarationOption, DeclarationOptionBase, StringDeclarationOption, NumberDeclarationOption, BooleanDeclarationOption, ArrayDeclarationOption, MixedDeclarationOption, ObjectDeclarationOption, MapDeclarationOption, FlagsDeclarationOption, DeclarationOptionToOptionType, TypeDocOptionValues, ParameterTypeToOptionTypeMap, ManuallyValidatedOption, JsDocCompatibility, } from "./declaration";
|
|
6
|
+
export { OptionDefaults } from "./defaults";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ParameterHint = exports.ParameterType = exports.EmitStrategy = exports.CommentStyle = exports.TSConfigReader = exports.TypeDocReader = exports.PackageJsonReader = exports.ArgumentsReader = exports.Option = exports.Options = void 0;
|
|
3
|
+
exports.OptionDefaults = exports.ParameterHint = exports.ParameterType = exports.EmitStrategy = exports.CommentStyle = exports.TSConfigReader = exports.TypeDocReader = exports.PackageJsonReader = exports.ArgumentsReader = exports.Option = exports.Options = void 0;
|
|
4
4
|
var options_1 = require("./options");
|
|
5
5
|
Object.defineProperty(exports, "Options", { enumerable: true, get: function () { return options_1.Options; } });
|
|
6
6
|
Object.defineProperty(exports, "Option", { enumerable: true, get: function () { return options_1.Option; } });
|
|
@@ -14,3 +14,5 @@ Object.defineProperty(exports, "CommentStyle", { enumerable: true, get: function
|
|
|
14
14
|
Object.defineProperty(exports, "EmitStrategy", { enumerable: true, get: function () { return declaration_1.EmitStrategy; } });
|
|
15
15
|
Object.defineProperty(exports, "ParameterType", { enumerable: true, get: function () { return declaration_1.ParameterType; } });
|
|
16
16
|
Object.defineProperty(exports, "ParameterHint", { enumerable: true, get: function () { return declaration_1.ParameterHint; } });
|
|
17
|
+
var defaults_1 = require("./defaults");
|
|
18
|
+
Object.defineProperty(exports, "OptionDefaults", { enumerable: true, get: function () { return defaults_1.OptionDefaults; } });
|
|
@@ -30,10 +30,10 @@ const sort_1 = require("../../sort");
|
|
|
30
30
|
const entry_point_1 = require("../../entry-point");
|
|
31
31
|
const kind_1 = require("../../../models/reflections/kind");
|
|
32
32
|
const Validation = __importStar(require("../../validation"));
|
|
33
|
-
const tsdoc_defaults_1 = require("../tsdoc-defaults");
|
|
34
33
|
const enum_1 = require("../../enum");
|
|
35
34
|
const highlighter_1 = require("../../highlighter");
|
|
36
35
|
const set_1 = require("../../set");
|
|
36
|
+
const defaults_1 = require("../defaults");
|
|
37
37
|
// For convenience, added in the same order as they are documented on the website.
|
|
38
38
|
function addTypeDocOptions(options) {
|
|
39
39
|
///////////////////////////
|
|
@@ -172,27 +172,7 @@ function addTypeDocOptions(options) {
|
|
|
172
172
|
throw new Error(i18n.exclude_not_documented_specified_0_valid_values_are_1(Array.from(invalid).join(", "), Array.from(valid).join(", ")));
|
|
173
173
|
}
|
|
174
174
|
},
|
|
175
|
-
defaultValue:
|
|
176
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.Module],
|
|
177
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.Namespace],
|
|
178
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.Enum],
|
|
179
|
-
// Not including enum member here by default
|
|
180
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.Variable],
|
|
181
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.Function],
|
|
182
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.Class],
|
|
183
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.Interface],
|
|
184
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.Constructor],
|
|
185
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.Property],
|
|
186
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.Method],
|
|
187
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.CallSignature],
|
|
188
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.IndexSignature],
|
|
189
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.ConstructorSignature],
|
|
190
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.Accessor],
|
|
191
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.GetSignature],
|
|
192
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.SetSignature],
|
|
193
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.TypeAlias],
|
|
194
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.Reference],
|
|
195
|
-
],
|
|
175
|
+
defaultValue: defaults_1.OptionDefaults.excludeNotDocumentedKinds,
|
|
196
176
|
});
|
|
197
177
|
options.addDeclaration({
|
|
198
178
|
name: "excludeInternal",
|
|
@@ -305,18 +285,7 @@ function addTypeDocOptions(options) {
|
|
|
305
285
|
name: "highlightLanguages",
|
|
306
286
|
help: (i18n) => i18n.help_highlightLanguages(),
|
|
307
287
|
type: declaration_1.ParameterType.Array,
|
|
308
|
-
defaultValue:
|
|
309
|
-
"bash",
|
|
310
|
-
"console",
|
|
311
|
-
"css",
|
|
312
|
-
"html",
|
|
313
|
-
"javascript",
|
|
314
|
-
"json",
|
|
315
|
-
"jsonc",
|
|
316
|
-
"json5",
|
|
317
|
-
"tsx",
|
|
318
|
-
"typescript",
|
|
319
|
-
],
|
|
288
|
+
defaultValue: defaults_1.OptionDefaults.highlightLanguages,
|
|
320
289
|
validate(value, i18n) {
|
|
321
290
|
const invalid = (0, set_1.setDifference)(value, (0, highlighter_1.getSupportedLanguagesWithoutAliases)());
|
|
322
291
|
if (invalid.size) {
|
|
@@ -403,13 +372,7 @@ function addTypeDocOptions(options) {
|
|
|
403
372
|
name: "excludeTags",
|
|
404
373
|
help: (i18n) => i18n.help_excludeTags(),
|
|
405
374
|
type: declaration_1.ParameterType.Array,
|
|
406
|
-
defaultValue:
|
|
407
|
-
"@override",
|
|
408
|
-
"@virtual",
|
|
409
|
-
"@privateRemarks",
|
|
410
|
-
"@satisfies",
|
|
411
|
-
"@overload",
|
|
412
|
-
],
|
|
375
|
+
defaultValue: defaults_1.OptionDefaults.excludeTags,
|
|
413
376
|
validate(value, i18n) {
|
|
414
377
|
if (!Validation.validate([Array, Validation.isTagString], value)) {
|
|
415
378
|
throw new Error(i18n.option_0_values_must_be_array_of_tags("excludeTags"));
|
|
@@ -538,6 +501,7 @@ function addTypeDocOptions(options) {
|
|
|
538
501
|
includeCategories: false,
|
|
539
502
|
includeGroups: false,
|
|
540
503
|
includeFolders: true,
|
|
504
|
+
compactFolders: true,
|
|
541
505
|
},
|
|
542
506
|
});
|
|
543
507
|
options.addDeclaration({
|
|
@@ -638,7 +602,7 @@ function addTypeDocOptions(options) {
|
|
|
638
602
|
name: "blockTags",
|
|
639
603
|
help: (i18n) => i18n.help_blockTags(),
|
|
640
604
|
type: declaration_1.ParameterType.Array,
|
|
641
|
-
defaultValue:
|
|
605
|
+
defaultValue: defaults_1.OptionDefaults.blockTags,
|
|
642
606
|
validate(value, i18n) {
|
|
643
607
|
if (!Validation.validate([Array, Validation.isTagString], value)) {
|
|
644
608
|
throw new Error(i18n.option_0_values_must_be_array_of_tags("blockTags"));
|
|
@@ -649,7 +613,7 @@ function addTypeDocOptions(options) {
|
|
|
649
613
|
name: "inlineTags",
|
|
650
614
|
help: (i18n) => i18n.help_inlineTags(),
|
|
651
615
|
type: declaration_1.ParameterType.Array,
|
|
652
|
-
defaultValue:
|
|
616
|
+
defaultValue: defaults_1.OptionDefaults.inlineTags,
|
|
653
617
|
validate(value, i18n) {
|
|
654
618
|
if (!Validation.validate([Array, Validation.isTagString], value)) {
|
|
655
619
|
throw new Error(i18n.option_0_values_must_be_array_of_tags("inlineTags"));
|
|
@@ -660,7 +624,7 @@ function addTypeDocOptions(options) {
|
|
|
660
624
|
name: "modifierTags",
|
|
661
625
|
help: (i18n) => i18n.help_modifierTags(),
|
|
662
626
|
type: declaration_1.ParameterType.Array,
|
|
663
|
-
defaultValue:
|
|
627
|
+
defaultValue: defaults_1.OptionDefaults.modifierTags,
|
|
664
628
|
validate(value, i18n) {
|
|
665
629
|
if (!Validation.validate([Array, Validation.isTagString], value)) {
|
|
666
630
|
throw new Error(i18n.option_0_values_must_be_array_of_tags("modifierTags"));
|
|
@@ -671,7 +635,7 @@ function addTypeDocOptions(options) {
|
|
|
671
635
|
name: "cascadedModifierTags",
|
|
672
636
|
help: (i18n) => i18n.help_modifierTags(),
|
|
673
637
|
type: declaration_1.ParameterType.Array,
|
|
674
|
-
defaultValue:
|
|
638
|
+
defaultValue: defaults_1.OptionDefaults.cascadedModifierTags,
|
|
675
639
|
validate(value, i18n) {
|
|
676
640
|
if (!Validation.validate([Array, Validation.isTagString], value)) {
|
|
677
641
|
throw new Error(i18n.option_0_values_must_be_array_of_tags("cascadedModifierTags"));
|
|
@@ -707,7 +671,7 @@ function addTypeDocOptions(options) {
|
|
|
707
671
|
name: "sort",
|
|
708
672
|
help: (i18n) => i18n.help_sort(),
|
|
709
673
|
type: declaration_1.ParameterType.Array,
|
|
710
|
-
defaultValue:
|
|
674
|
+
defaultValue: defaults_1.OptionDefaults.sort,
|
|
711
675
|
validate(value, i18n) {
|
|
712
676
|
const invalid = new Set(value);
|
|
713
677
|
for (const v of sort_1.SORT_STRATEGIES) {
|
|
@@ -730,13 +694,9 @@ function addTypeDocOptions(options) {
|
|
|
730
694
|
type: declaration_1.ParameterType.Array,
|
|
731
695
|
defaultValue: [],
|
|
732
696
|
validate(value, i18n) {
|
|
733
|
-
const invalid =
|
|
734
|
-
const valid = (0, enum_1.getEnumKeys)(kind_1.ReflectionKind);
|
|
735
|
-
for (const v of valid) {
|
|
736
|
-
invalid.delete(v);
|
|
737
|
-
}
|
|
697
|
+
const invalid = (0, set_1.setDifference)(value, (0, enum_1.getEnumKeys)(kind_1.ReflectionKind));
|
|
738
698
|
if (invalid.size !== 0) {
|
|
739
|
-
throw new Error(i18n.option_0_specified_1_but_only_2_is_valid(`kindSortOrder`, Array.from(invalid).join(", "),
|
|
699
|
+
throw new Error(i18n.option_0_specified_1_but_only_2_is_valid(`kindSortOrder`, Array.from(invalid).join(", "), (0, enum_1.getEnumKeys)(kind_1.ReflectionKind).join(", ")));
|
|
740
700
|
}
|
|
741
701
|
},
|
|
742
702
|
});
|
|
@@ -814,18 +774,7 @@ function addTypeDocOptions(options) {
|
|
|
814
774
|
}
|
|
815
775
|
}
|
|
816
776
|
},
|
|
817
|
-
defaultValue:
|
|
818
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.Enum],
|
|
819
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.EnumMember],
|
|
820
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.Variable],
|
|
821
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.Function],
|
|
822
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.Class],
|
|
823
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.Interface],
|
|
824
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.Property],
|
|
825
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.Method],
|
|
826
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.Accessor],
|
|
827
|
-
kind_1.ReflectionKind[kind_1.ReflectionKind.TypeAlias],
|
|
828
|
-
],
|
|
777
|
+
defaultValue: defaults_1.OptionDefaults.requiredToBeDocumented,
|
|
829
778
|
});
|
|
830
779
|
options.addDeclaration({
|
|
831
780
|
name: "validation",
|
|
@@ -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", "@since", "@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", "@extends", "@augments", "@yields", "@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"];
|
package/dist/lib/utils/perf.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare function bench<T extends
|
|
2
|
-
export declare function Bench<T extends
|
|
1
|
+
export declare function bench<T extends (..._: any) => any>(fn: T, name?: string): T;
|
|
2
|
+
export declare function Bench<T extends (..._: any) => any>(value: T, context: ClassMethodDecoratorContext): T;
|
|
3
3
|
export declare function measure<T>(cb: () => T): T;
|
package/dist/lib/utils/sort.js
CHANGED
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.SORT_STRATEGIES = void 0;
|
|
8
8
|
exports.getSortFunction = getSortFunction;
|
|
9
9
|
const kind_1 = require("../models/reflections/kind");
|
|
10
|
+
const defaults_1 = require("./options/defaults");
|
|
10
11
|
exports.SORT_STRATEGIES = [
|
|
11
12
|
"source-order",
|
|
12
13
|
"alphabetical",
|
|
@@ -23,32 +24,6 @@ exports.SORT_STRATEGIES = [
|
|
|
23
24
|
"documents-first",
|
|
24
25
|
"documents-last",
|
|
25
26
|
];
|
|
26
|
-
const defaultKindSortOrder = [
|
|
27
|
-
kind_1.ReflectionKind.Document,
|
|
28
|
-
kind_1.ReflectionKind.Reference,
|
|
29
|
-
kind_1.ReflectionKind.Project,
|
|
30
|
-
kind_1.ReflectionKind.Module,
|
|
31
|
-
kind_1.ReflectionKind.Namespace,
|
|
32
|
-
kind_1.ReflectionKind.Enum,
|
|
33
|
-
kind_1.ReflectionKind.EnumMember,
|
|
34
|
-
kind_1.ReflectionKind.Class,
|
|
35
|
-
kind_1.ReflectionKind.Interface,
|
|
36
|
-
kind_1.ReflectionKind.TypeAlias,
|
|
37
|
-
kind_1.ReflectionKind.Constructor,
|
|
38
|
-
kind_1.ReflectionKind.Property,
|
|
39
|
-
kind_1.ReflectionKind.Variable,
|
|
40
|
-
kind_1.ReflectionKind.Function,
|
|
41
|
-
kind_1.ReflectionKind.Accessor,
|
|
42
|
-
kind_1.ReflectionKind.Method,
|
|
43
|
-
kind_1.ReflectionKind.Parameter,
|
|
44
|
-
kind_1.ReflectionKind.TypeParameter,
|
|
45
|
-
kind_1.ReflectionKind.TypeLiteral,
|
|
46
|
-
kind_1.ReflectionKind.CallSignature,
|
|
47
|
-
kind_1.ReflectionKind.ConstructorSignature,
|
|
48
|
-
kind_1.ReflectionKind.IndexSignature,
|
|
49
|
-
kind_1.ReflectionKind.GetSignature,
|
|
50
|
-
kind_1.ReflectionKind.SetSignature,
|
|
51
|
-
];
|
|
52
27
|
// Return true if a < b
|
|
53
28
|
const sorts = {
|
|
54
29
|
"source-order"(a, b) {
|
|
@@ -152,9 +127,9 @@ function getSortFunction(opts) {
|
|
|
152
127
|
const kindSortOrder = opts
|
|
153
128
|
.getValue("kindSortOrder")
|
|
154
129
|
.map((k) => kind_1.ReflectionKind[k]);
|
|
155
|
-
for (const kind of
|
|
156
|
-
if (!kindSortOrder.includes(kind)) {
|
|
157
|
-
kindSortOrder.push(kind);
|
|
130
|
+
for (const kind of defaults_1.OptionDefaults.kindSortOrder) {
|
|
131
|
+
if (!kindSortOrder.includes(kind_1.ReflectionKind[kind])) {
|
|
132
|
+
kindSortOrder.push(kind_1.ReflectionKind[kind]);
|
|
158
133
|
}
|
|
159
134
|
}
|
|
160
135
|
const strategies = opts.getValue("sort");
|
|
@@ -71,7 +71,11 @@ function validateDocumentation(project, logger, requiredToBeDocumented) {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
const symbolId = project.getSymbolIdFromReflection(ref);
|
|
74
|
-
|
|
74
|
+
// #2644, signatures may be documented by their parent reflection.
|
|
75
|
+
const hasComment = ref.hasComment() ||
|
|
76
|
+
(ref.kindOf(models_1.ReflectionKind.SomeSignature) &&
|
|
77
|
+
ref.parent?.hasComment());
|
|
78
|
+
if (!hasComment && symbolId) {
|
|
75
79
|
if (symbolId.fileName.includes("node_modules")) {
|
|
76
80
|
continue;
|
|
77
81
|
}
|
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.
|
|
4
|
+
"version": "0.26.6",
|
|
5
5
|
"homepage": "https://typedoc.org",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./dist/index.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"puppeteer": "^22.12.1",
|
|
48
48
|
"ts-node": "^10.9.2",
|
|
49
49
|
"typescript": "5.5.2",
|
|
50
|
-
"typescript-eslint": "^
|
|
50
|
+
"typescript-eslint": "^8.0.1"
|
|
51
51
|
},
|
|
52
52
|
"files": [
|
|
53
53
|
"/bin",
|