typedoc 0.25.0 → 0.25.2
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 +2 -2
- package/dist/index.js +2 -1
- package/dist/lib/application.d.ts +3 -3
- package/dist/lib/application.js +440 -359
- package/dist/lib/cli.js +6 -3
- package/dist/lib/converter/comments/discovery.js +8 -2
- package/dist/lib/converter/comments/index.js +9 -1
- package/dist/lib/converter/comments/parser.js +5 -11
- package/dist/lib/converter/comments/tagName.d.ts +8 -0
- package/dist/lib/converter/comments/tagName.js +62 -0
- package/dist/lib/converter/context.js +1 -2
- package/dist/lib/converter/converter.d.ts +11 -11
- package/dist/lib/converter/converter.js +436 -311
- package/dist/lib/converter/factories/signature.d.ts +1 -0
- package/dist/lib/converter/factories/signature.js +31 -5
- package/dist/lib/converter/jsdoc.js +2 -6
- package/dist/lib/converter/plugins/CategoryPlugin.d.ts +8 -8
- package/dist/lib/converter/plugins/CategoryPlugin.js +293 -200
- package/dist/lib/converter/plugins/CommentPlugin.d.ts +8 -5
- package/dist/lib/converter/plugins/CommentPlugin.js +433 -305
- package/dist/lib/converter/plugins/GroupPlugin.d.ts +4 -3
- package/dist/lib/converter/plugins/GroupPlugin.js +226 -145
- package/dist/lib/converter/plugins/ImplementsPlugin.js +239 -194
- package/dist/lib/converter/plugins/InheritDocPlugin.d.ts +1 -1
- package/dist/lib/converter/plugins/InheritDocPlugin.js +201 -138
- package/dist/lib/converter/plugins/LinkResolverPlugin.d.ts +1 -1
- package/dist/lib/converter/plugins/LinkResolverPlugin.js +110 -44
- package/dist/lib/converter/plugins/PackagePlugin.d.ts +6 -4
- package/dist/lib/converter/plugins/PackagePlugin.js +191 -96
- package/dist/lib/converter/plugins/SourcePlugin.d.ts +6 -6
- package/dist/lib/converter/plugins/SourcePlugin.js +234 -146
- package/dist/lib/converter/plugins/TypePlugin.js +147 -102
- package/dist/lib/converter/symbols.js +1 -1
- package/dist/lib/converter/types.js +10 -0
- package/dist/lib/converter/utils/repository.js +2 -2
- package/dist/lib/models/reflections/ReflectionSymbolId.js +1 -1
- package/dist/lib/models/reflections/abstract.d.ts +4 -0
- package/dist/lib/models/reflections/abstract.js +14 -2
- package/dist/lib/models/reflections/index.d.ts +1 -1
- package/dist/lib/output/components.d.ts +1 -0
- package/dist/lib/output/components.js +9 -1
- package/dist/lib/output/index.d.ts +1 -1
- package/dist/lib/output/plugins/AssetsPlugin.d.ts +1 -1
- package/dist/lib/output/plugins/AssetsPlugin.js +111 -44
- package/dist/lib/output/plugins/JavascriptIndexPlugin.d.ts +2 -1
- package/dist/lib/output/plugins/JavascriptIndexPlugin.js +173 -99
- package/dist/lib/output/plugins/NavigationPlugin.d.ts +6 -0
- package/dist/lib/output/plugins/NavigationPlugin.js +109 -0
- package/dist/lib/output/plugins/index.d.ts +2 -1
- package/dist/lib/output/plugins/index.js +5 -3
- package/dist/lib/output/renderer.d.ts +10 -8
- package/dist/lib/output/renderer.js +315 -202
- package/dist/lib/output/theme.js +63 -18
- package/dist/lib/output/themes/MarkedPlugin.d.ts +4 -4
- package/dist/lib/output/themes/MarkedPlugin.js +223 -145
- package/dist/lib/output/themes/default/DefaultTheme.d.ts +14 -1
- package/dist/lib/output/themes/default/DefaultTheme.js +72 -0
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +42 -36
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +15 -1
- package/dist/lib/output/themes/default/layouts/default.js +2 -0
- package/dist/lib/output/themes/default/partials/header.js +1 -1
- package/dist/lib/output/themes/default/partials/icon.d.ts +4 -1
- package/dist/lib/output/themes/default/partials/icon.js +46 -35
- package/dist/lib/output/themes/default/partials/member.signature.body.js +1 -1
- package/dist/lib/output/themes/default/partials/navigation.js +34 -67
- package/dist/lib/utils/component.d.ts +1 -1
- package/dist/lib/utils/component.js +3 -1
- package/dist/lib/utils/entry-point.js +36 -18
- package/dist/lib/utils/events.js +1 -1
- package/dist/lib/utils/general.js +1 -1
- package/dist/lib/utils/index.d.ts +1 -1
- package/dist/lib/utils/index.js +2 -1
- package/dist/lib/utils/jsx.js +1 -1
- package/dist/lib/utils/options/declaration.d.ts +4 -0
- package/dist/lib/utils/options/index.d.ts +1 -1
- package/dist/lib/utils/options/index.js +2 -1
- package/dist/lib/utils/options/options.d.ts +19 -0
- package/dist/lib/utils/options/options.js +22 -2
- package/dist/lib/utils/options/readers/tsconfig.js +2 -7
- package/dist/lib/utils/options/sources/typedoc.js +22 -0
- package/dist/lib/utils/perf.d.ts +1 -1
- package/dist/lib/utils/perf.js +10 -20
- package/package.json +9 -9
- package/static/main.js +4 -3
- package/static/style.css +7 -3
|
@@ -5,3 +5,4 @@ export declare function createSignature(context: Context, kind: ReflectionKind.C
|
|
|
5
5
|
export declare function convertParameterNodes(context: Context, sigRef: SignatureReflection, parameters: readonly (ts.JSDocParameterTag | ts.ParameterDeclaration)[]): ParameterReflection[];
|
|
6
6
|
export declare function convertTypeParameterNodes(context: Context, parameters: readonly ts.TypeParameterDeclaration[] | undefined): TypeParameterReflection[] | undefined;
|
|
7
7
|
export declare function createTypeParamReflection(param: ts.TypeParameterDeclaration, context: Context): TypeParameterReflection;
|
|
8
|
+
export declare function convertTemplateParameterNodes(context: Context, nodes: readonly ts.JSDocTemplateTag[] | undefined): TypeParameterReflection[] | undefined;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createTypeParamReflection = exports.convertTypeParameterNodes = exports.convertParameterNodes = exports.createSignature = void 0;
|
|
6
|
+
exports.convertTemplateParameterNodes = exports.createTypeParamReflection = exports.convertTypeParameterNodes = exports.convertParameterNodes = exports.createSignature = void 0;
|
|
7
7
|
const typescript_1 = __importDefault(require("typescript"));
|
|
8
8
|
const assert_1 = __importDefault(require("assert"));
|
|
9
9
|
const models_1 = require("../../models");
|
|
@@ -12,9 +12,8 @@ const convert_expression_1 = require("../convert-expression");
|
|
|
12
12
|
const reflections_1 = require("../utils/reflections");
|
|
13
13
|
const ReflectionSymbolId_1 = require("../../models/reflections/ReflectionSymbolId");
|
|
14
14
|
function createSignature(context, kind, signature, symbol, declaration) {
|
|
15
|
-
var _a;
|
|
16
15
|
(0, assert_1.default)(context.scope instanceof models_1.DeclarationReflection);
|
|
17
|
-
declaration
|
|
16
|
+
declaration ||= signature.getDeclaration();
|
|
18
17
|
const sigRef = new models_1.SignatureReflection(kind == models_1.ReflectionKind.ConstructorSignature
|
|
19
18
|
? `new ${context.scope.parent.name}`
|
|
20
19
|
: context.scope.name, kind, context.scope);
|
|
@@ -63,7 +62,7 @@ function createSignature(context, kind, signature, symbol, declaration) {
|
|
|
63
62
|
break;
|
|
64
63
|
case models_1.ReflectionKind.CallSignature:
|
|
65
64
|
case models_1.ReflectionKind.ConstructorSignature:
|
|
66
|
-
|
|
65
|
+
context.scope.signatures ??= [];
|
|
67
66
|
context.scope.signatures.push(sigRef);
|
|
68
67
|
break;
|
|
69
68
|
}
|
|
@@ -80,7 +79,7 @@ function convertParameters(context, sigRef, parameters, parameterNodes) {
|
|
|
80
79
|
if (declaration && typescript_1.default.isJSDocParameterTag(declaration)) {
|
|
81
80
|
paramRefl.comment = context.getJsDocComment(declaration);
|
|
82
81
|
}
|
|
83
|
-
paramRefl.comment
|
|
82
|
+
paramRefl.comment ||= context.getComment(param, paramRefl.kind);
|
|
84
83
|
context.registerReflection(paramRefl, param);
|
|
85
84
|
context.trigger(converter_events_1.ConverterEvents.CREATE_PARAMETER, paramRefl);
|
|
86
85
|
let type;
|
|
@@ -196,6 +195,33 @@ function createTypeParamReflection(param, context) {
|
|
|
196
195
|
return paramRefl;
|
|
197
196
|
}
|
|
198
197
|
exports.createTypeParamReflection = createTypeParamReflection;
|
|
198
|
+
function convertTemplateParameterNodes(context, nodes) {
|
|
199
|
+
return nodes?.flatMap((node) => {
|
|
200
|
+
return node.typeParameters.map((param, index) => {
|
|
201
|
+
const paramRefl = new models_1.TypeParameterReflection(param.name.text, context.scope, getVariance(param.modifiers));
|
|
202
|
+
const paramScope = context.withScope(paramRefl);
|
|
203
|
+
paramRefl.type =
|
|
204
|
+
index || !node.constraint
|
|
205
|
+
? void 0
|
|
206
|
+
: context.converter.convertType(paramScope, node.constraint.type);
|
|
207
|
+
paramRefl.default = param.default
|
|
208
|
+
? context.converter.convertType(paramScope, param.default)
|
|
209
|
+
: void 0;
|
|
210
|
+
if (param.modifiers?.some((m) => m.kind === typescript_1.default.SyntaxKind.ConstKeyword)) {
|
|
211
|
+
paramRefl.flags.setFlag(models_1.ReflectionFlag.Const, true);
|
|
212
|
+
}
|
|
213
|
+
context.registerReflection(paramRefl, param.symbol);
|
|
214
|
+
if (typescript_1.default.isJSDocTemplateTag(param.parent)) {
|
|
215
|
+
paramRefl.comment = context.getJsDocComment(param.parent);
|
|
216
|
+
}
|
|
217
|
+
context.trigger(converter_events_1.ConverterEvents.CREATE_TYPE_PARAMETER, paramRefl, param);
|
|
218
|
+
return paramRefl;
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
const params = (nodes ?? []).flatMap((tag) => tag.typeParameters);
|
|
222
|
+
return convertTypeParameterNodes(context, params);
|
|
223
|
+
}
|
|
224
|
+
exports.convertTemplateParameterNodes = convertTemplateParameterNodes;
|
|
199
225
|
function getVariance(modifiers) {
|
|
200
226
|
const hasIn = modifiers?.some((mod) => mod.kind === typescript_1.default.SyntaxKind.InKeyword);
|
|
201
227
|
const hasOut = modifiers?.some((mod) => mod.kind === typescript_1.default.SyntaxKind.OutKeyword);
|
|
@@ -70,16 +70,12 @@ function convertJsDocSignature(context, node) {
|
|
|
70
70
|
reflection.signatures = [signature];
|
|
71
71
|
signature.type = context.converter.convertType(signatureCtx, node.type?.typeExpression?.type);
|
|
72
72
|
signature.parameters = (0, signature_1.convertParameterNodes)(signatureCtx, signature, node.parameters);
|
|
73
|
-
signature.typeParameters = convertTemplateParameterNodes(context.withScope(reflection), node.typeParameters);
|
|
73
|
+
signature.typeParameters = (0, signature_1.convertTemplateParameterNodes)(context.withScope(reflection), node.typeParameters);
|
|
74
74
|
return new models_1.ReflectionType(reflection);
|
|
75
75
|
}
|
|
76
76
|
function convertTemplateParameters(context, node) {
|
|
77
77
|
(0, assert_1.ok)(context.scope instanceof models_1.DeclarationReflection);
|
|
78
|
-
context.scope.typeParameters = convertTemplateParameterNodes(context, node.tags?.filter(typescript_1.default.isJSDocTemplateTag));
|
|
79
|
-
}
|
|
80
|
-
function convertTemplateParameterNodes(context, nodes) {
|
|
81
|
-
const params = (nodes ?? []).flatMap((tag) => tag.typeParameters);
|
|
82
|
-
return (0, signature_1.convertTypeParameterNodes)(context, params);
|
|
78
|
+
context.scope.typeParameters = (0, signature_1.convertTemplateParameterNodes)(context, node.tags?.filter(typescript_1.default.isJSDocTemplateTag));
|
|
83
79
|
}
|
|
84
80
|
function getTypedefReExportTarget(context, declaration) {
|
|
85
81
|
const typeExpression = declaration.typeExpression;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { DeclarationReflection } from "../../models";
|
|
2
|
-
import { ReflectionCategory } from "../../models";
|
|
3
2
|
import { ConverterComponent } from "../components";
|
|
4
3
|
/**
|
|
5
4
|
* A handler that sorts and categorizes the found reflections in the resolving phase.
|
|
@@ -8,10 +7,10 @@ import { ConverterComponent } from "../components";
|
|
|
8
7
|
*/
|
|
9
8
|
export declare class CategoryPlugin extends ConverterComponent {
|
|
10
9
|
sortFunction: (reflections: DeclarationReflection[]) => void;
|
|
11
|
-
defaultCategory: string;
|
|
12
|
-
categoryOrder: string[];
|
|
13
|
-
categorizeByGroup: boolean;
|
|
14
|
-
boosts: Record<string, number>;
|
|
10
|
+
accessor defaultCategory: string;
|
|
11
|
+
accessor categoryOrder: string[];
|
|
12
|
+
accessor categorizeByGroup: boolean;
|
|
13
|
+
accessor boosts: Record<string, number>;
|
|
15
14
|
usedBoosts: Set<string>;
|
|
16
15
|
static defaultCategory: string;
|
|
17
16
|
static WEIGHTS: string[];
|
|
@@ -47,7 +46,7 @@ export declare class CategoryPlugin extends ConverterComponent {
|
|
|
47
46
|
* relevance boost to be used when searching
|
|
48
47
|
* @returns An array containing all children of the given reflection categorized
|
|
49
48
|
*/
|
|
50
|
-
getReflectionCategories
|
|
49
|
+
private getReflectionCategories;
|
|
51
50
|
/**
|
|
52
51
|
* Return the category of a given reflection.
|
|
53
52
|
*
|
|
@@ -57,7 +56,7 @@ export declare class CategoryPlugin extends ConverterComponent {
|
|
|
57
56
|
* @privateRemarks
|
|
58
57
|
* If you change this, also update getGroups in GroupPlugin accordingly.
|
|
59
58
|
*/
|
|
60
|
-
|
|
59
|
+
private extractCategories;
|
|
61
60
|
/**
|
|
62
61
|
* Callback used to sort categories by name.
|
|
63
62
|
*
|
|
@@ -65,5 +64,6 @@ export declare class CategoryPlugin extends ConverterComponent {
|
|
|
65
64
|
* @param b The right reflection to sort.
|
|
66
65
|
* @returns The sorting weight.
|
|
67
66
|
*/
|
|
68
|
-
static sortCatCallback
|
|
67
|
+
private static sortCatCallback;
|
|
68
|
+
static getCategories(reflection: DeclarationReflection): Set<string>;
|
|
69
69
|
}
|