typedoc 0.24.7 → 0.24.8
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/lib/application.d.ts +9 -0
- package/dist/lib/application.js +11 -3
- package/dist/lib/converter/comments/lexer.js +1 -1
- package/dist/lib/converter/converter.js +2 -3
- package/dist/lib/converter/plugins/CategoryPlugin.js +2 -3
- package/dist/lib/converter/plugins/CommentPlugin.js +8 -5
- package/dist/lib/converter/plugins/GroupPlugin.js +2 -3
- package/dist/lib/converter/plugins/ImplementsPlugin.js +2 -3
- package/dist/lib/converter/plugins/InheritDocPlugin.js +2 -3
- package/dist/lib/converter/plugins/LinkResolverPlugin.js +2 -3
- package/dist/lib/converter/plugins/PackagePlugin.js +2 -3
- package/dist/lib/converter/plugins/SourcePlugin.js +2 -3
- package/dist/lib/converter/plugins/TypePlugin.js +2 -3
- package/dist/lib/models/reflections/abstract.js +3 -3
- package/dist/lib/models/reflections/declaration.js +1 -1
- package/dist/lib/models/reflections/kind.js +2 -2
- package/dist/lib/output/events.d.ts +6 -0
- package/dist/lib/output/events.js +10 -4
- package/dist/lib/output/plugins/AssetsPlugin.js +2 -3
- package/dist/lib/output/plugins/JavascriptIndexPlugin.js +2 -3
- package/dist/lib/output/renderer.d.ts +2 -0
- package/dist/lib/output/renderer.js +7 -3
- package/dist/lib/output/theme.js +2 -3
- package/dist/lib/output/themes/MarkedPlugin.js +5 -4
- package/dist/lib/output/themes/default/DefaultTheme.js +1 -1
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +3 -0
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +3 -0
- package/dist/lib/output/themes/default/partials/comment.d.ts +2 -0
- package/dist/lib/output/themes/default/partials/comment.js +20 -2
- package/dist/lib/output/themes/default/partials/icon.js +8 -9
- package/dist/lib/output/themes/default/partials/member.declaration.d.ts +2 -2
- package/dist/lib/output/themes/default/partials/member.declaration.js +34 -21
- package/dist/lib/output/themes/default/partials/member.signature.body.js +4 -2
- package/dist/lib/output/themes/default/partials/navigation.js +2 -2
- package/dist/lib/output/themes/default/partials/parameter.js +8 -4
- package/dist/lib/output/themes/default/partials/typeParameters.js +2 -1
- package/dist/lib/output/themes/default/templates/reflection.js +5 -2
- package/dist/lib/serialization/serializer.js +1 -1
- package/dist/lib/utils/component.d.ts +1 -1
- package/dist/lib/utils/component.js +1 -1
- package/dist/lib/utils/jsx.d.ts +3 -0
- package/dist/lib/utils/jsx.js +7 -2
- package/dist/lib/utils/loggers.js +1 -1
- package/dist/lib/utils/options/declaration.d.ts +1 -0
- package/dist/lib/utils/options/declaration.js +2 -2
- package/dist/lib/utils/options/sources/typedoc.js +1 -0
- package/package.json +3 -3
|
@@ -77,6 +77,15 @@ export declare class Application extends ChildableComponent<Application, Abstrac
|
|
|
77
77
|
bootstrapWithPlugins(options?: Partial<TypeDocOptions>): Promise<void>;
|
|
78
78
|
/**
|
|
79
79
|
* Initialize TypeDoc without loading plugins.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* Initialize the application with pretty-printing output disabled.
|
|
83
|
+
* ```ts
|
|
84
|
+
* const app = new Application();
|
|
85
|
+
* app.bootstrap({ pretty: false });
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* @param options - Options to set during initialization
|
|
80
89
|
*/
|
|
81
90
|
bootstrap(options?: Partial<TypeDocOptions>): void;
|
|
82
91
|
private setOptions;
|
package/dist/lib/application.js
CHANGED
|
@@ -72,7 +72,7 @@ const supportedVersionMajorMinor = packageInfo.peerDependencies.typescript
|
|
|
72
72
|
* Both the {@link Converter} and the {@link Renderer} emit a series of events while processing the project.
|
|
73
73
|
* Subscribe to these Events to control the application flow or alter the output.
|
|
74
74
|
*/
|
|
75
|
-
let Application = Application_1 = class Application extends component_1.ChildableComponent {
|
|
75
|
+
let Application = exports.Application = Application_1 = class Application extends component_1.ChildableComponent {
|
|
76
76
|
/**
|
|
77
77
|
* Create a new TypeDoc application instance.
|
|
78
78
|
*/
|
|
@@ -104,6 +104,15 @@ let Application = Application_1 = class Application extends component_1.Childabl
|
|
|
104
104
|
}
|
|
105
105
|
/**
|
|
106
106
|
* Initialize TypeDoc without loading plugins.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* Initialize the application with pretty-printing output disabled.
|
|
110
|
+
* ```ts
|
|
111
|
+
* const app = new Application();
|
|
112
|
+
* app.bootstrap({ pretty: false });
|
|
113
|
+
* ```
|
|
114
|
+
*
|
|
115
|
+
* @param options - Options to set during initialization
|
|
107
116
|
*/
|
|
108
117
|
bootstrap(options = {}) {
|
|
109
118
|
this.options.reset();
|
|
@@ -438,7 +447,6 @@ __decorate([
|
|
|
438
447
|
__decorate([
|
|
439
448
|
(0, utils_1.BindOption)("entryPoints")
|
|
440
449
|
], Application.prototype, "entryPoints", void 0);
|
|
441
|
-
Application = Application_1 = __decorate([
|
|
450
|
+
exports.Application = Application = Application_1 = __decorate([
|
|
442
451
|
(0, component_1.Component)({ name: "application", internal: true })
|
|
443
452
|
], Application);
|
|
444
|
-
exports.Application = Application;
|
|
@@ -10,4 +10,4 @@ var TokenSyntaxKind;
|
|
|
10
10
|
TokenSyntaxKind["Tag"] = "tag";
|
|
11
11
|
TokenSyntaxKind["Code"] = "code";
|
|
12
12
|
TokenSyntaxKind["TypeAnnotation"] = "type";
|
|
13
|
-
})(TokenSyntaxKind
|
|
13
|
+
})(TokenSyntaxKind || (exports.TokenSyntaxKind = TokenSyntaxKind = {}));
|
|
@@ -28,7 +28,7 @@ const linkResolver_1 = require("./comments/linkResolver");
|
|
|
28
28
|
/**
|
|
29
29
|
* Compiles source files using TypeScript and converts compiler symbols to reflections.
|
|
30
30
|
*/
|
|
31
|
-
let Converter = Converter_1 = class Converter extends component_1.ChildableComponent {
|
|
31
|
+
let Converter = exports.Converter = Converter_1 = class Converter extends component_1.ChildableComponent {
|
|
32
32
|
get config() {
|
|
33
33
|
return this._config || this._buildCommentParserConfig();
|
|
34
34
|
}
|
|
@@ -343,14 +343,13 @@ __decorate([
|
|
|
343
343
|
__decorate([
|
|
344
344
|
(0, utils_1.BindOption)("useTsLinkResolution")
|
|
345
345
|
], Converter.prototype, "useTsLinkResolution", void 0);
|
|
346
|
-
Converter = Converter_1 = __decorate([
|
|
346
|
+
exports.Converter = Converter = Converter_1 = __decorate([
|
|
347
347
|
(0, component_1.Component)({
|
|
348
348
|
name: "converter",
|
|
349
349
|
internal: true,
|
|
350
350
|
childClass: components_1.ConverterComponent,
|
|
351
351
|
})
|
|
352
352
|
], Converter);
|
|
353
|
-
exports.Converter = Converter;
|
|
354
353
|
function getSymbolForModuleLike(context, node) {
|
|
355
354
|
const symbol = context.checker.getSymbolAtLocation(node) ?? node.symbol;
|
|
356
355
|
if (symbol) {
|
|
@@ -18,7 +18,7 @@ const utils_1 = require("../../utils");
|
|
|
18
18
|
*
|
|
19
19
|
* The handler sets the ´category´ property of all reflections.
|
|
20
20
|
*/
|
|
21
|
-
let CategoryPlugin = CategoryPlugin_1 = class CategoryPlugin extends components_1.ConverterComponent {
|
|
21
|
+
let CategoryPlugin = exports.CategoryPlugin = CategoryPlugin_1 = class CategoryPlugin extends components_1.ConverterComponent {
|
|
22
22
|
constructor() {
|
|
23
23
|
super(...arguments);
|
|
24
24
|
this.usedBoosts = new Set();
|
|
@@ -232,7 +232,6 @@ __decorate([
|
|
|
232
232
|
__decorate([
|
|
233
233
|
(0, utils_1.BindOption)("searchCategoryBoosts")
|
|
234
234
|
], CategoryPlugin.prototype, "boosts", void 0);
|
|
235
|
-
CategoryPlugin = CategoryPlugin_1 = __decorate([
|
|
235
|
+
exports.CategoryPlugin = CategoryPlugin = CategoryPlugin_1 = __decorate([
|
|
236
236
|
(0, components_1.Component)({ name: "category" })
|
|
237
237
|
], CategoryPlugin);
|
|
238
|
-
exports.CategoryPlugin = CategoryPlugin;
|
|
@@ -88,7 +88,7 @@ const NEVER_RENDERED = [
|
|
|
88
88
|
* - Resolve `@link` tags to point to target reflections
|
|
89
89
|
*
|
|
90
90
|
*/
|
|
91
|
-
let CommentPlugin = class CommentPlugin extends components_1.ConverterComponent {
|
|
91
|
+
let CommentPlugin = exports.CommentPlugin = class CommentPlugin extends components_1.ConverterComponent {
|
|
92
92
|
get excludeNotDocumentedKinds() {
|
|
93
93
|
this._excludeKinds ?? (this._excludeKinds = this.application.options
|
|
94
94
|
.getValue("excludeNotDocumentedKinds")
|
|
@@ -289,11 +289,15 @@ let CommentPlugin = class CommentPlugin extends components_1.ConverterComponent
|
|
|
289
289
|
if (!signatures.length) {
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
const comment = reflection.
|
|
292
|
+
const comment = reflection.kindOf(models_1.ReflectionKind.ClassOrInterface)
|
|
293
|
+
? undefined
|
|
294
|
+
: reflection.comment;
|
|
293
295
|
// Since this reflection has signatures, remove the comment from the parent
|
|
294
296
|
// reflection. This is important so that in type aliases we don't end up with
|
|
295
297
|
// a comment rendered twice.
|
|
296
|
-
|
|
298
|
+
if (!reflection.kindOf(models_1.ReflectionKind.ClassOrInterface)) {
|
|
299
|
+
delete reflection.comment;
|
|
300
|
+
}
|
|
297
301
|
for (const signature of signatures) {
|
|
298
302
|
const childComment = (signature.comment || (signature.comment = comment?.clone()));
|
|
299
303
|
if (!childComment)
|
|
@@ -414,10 +418,9 @@ __decorate([
|
|
|
414
418
|
__decorate([
|
|
415
419
|
(0, utils_1.BindOption)("excludeNotDocumented")
|
|
416
420
|
], CommentPlugin.prototype, "excludeNotDocumented", void 0);
|
|
417
|
-
CommentPlugin = __decorate([
|
|
421
|
+
exports.CommentPlugin = CommentPlugin = __decorate([
|
|
418
422
|
(0, components_1.Component)({ name: "comment" })
|
|
419
423
|
], CommentPlugin);
|
|
420
|
-
exports.CommentPlugin = CommentPlugin;
|
|
421
424
|
function inTypeLiteral(refl) {
|
|
422
425
|
while (refl) {
|
|
423
426
|
if (refl.kind === models_1.ReflectionKind.TypeLiteral) {
|
|
@@ -20,7 +20,7 @@ const models_1 = require("../../models");
|
|
|
20
20
|
*
|
|
21
21
|
* The handler sets the `groups` property of all container reflections.
|
|
22
22
|
*/
|
|
23
|
-
let GroupPlugin = GroupPlugin_1 = class GroupPlugin extends components_1.ConverterComponent {
|
|
23
|
+
let GroupPlugin = exports.GroupPlugin = GroupPlugin_1 = class GroupPlugin extends components_1.ConverterComponent {
|
|
24
24
|
constructor() {
|
|
25
25
|
super(...arguments);
|
|
26
26
|
this.usedBoosts = new Set();
|
|
@@ -170,7 +170,6 @@ __decorate([
|
|
|
170
170
|
__decorate([
|
|
171
171
|
(0, utils_1.BindOption)("groupOrder")
|
|
172
172
|
], GroupPlugin.prototype, "groupOrder", void 0);
|
|
173
|
-
GroupPlugin = GroupPlugin_1 = __decorate([
|
|
173
|
+
exports.GroupPlugin = GroupPlugin = GroupPlugin_1 = __decorate([
|
|
174
174
|
(0, components_1.Component)({ name: "group" })
|
|
175
175
|
], GroupPlugin);
|
|
176
|
-
exports.GroupPlugin = GroupPlugin;
|
|
@@ -22,7 +22,7 @@ const utils_1 = require("../../utils");
|
|
|
22
22
|
* A plugin that detects interface implementations of functions and
|
|
23
23
|
* properties on classes and links them.
|
|
24
24
|
*/
|
|
25
|
-
let ImplementsPlugin = class ImplementsPlugin extends components_1.ConverterComponent {
|
|
25
|
+
let ImplementsPlugin = exports.ImplementsPlugin = class ImplementsPlugin extends components_1.ConverterComponent {
|
|
26
26
|
constructor() {
|
|
27
27
|
super(...arguments);
|
|
28
28
|
this.resolved = new WeakSet();
|
|
@@ -224,10 +224,9 @@ let ImplementsPlugin = class ImplementsPlugin extends components_1.ConverterComp
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
};
|
|
227
|
-
ImplementsPlugin = __decorate([
|
|
227
|
+
exports.ImplementsPlugin = ImplementsPlugin = __decorate([
|
|
228
228
|
(0, components_1.Component)({ name: "implements" })
|
|
229
229
|
], ImplementsPlugin);
|
|
230
|
-
exports.ImplementsPlugin = ImplementsPlugin;
|
|
231
230
|
function constructorInheritance(context, reflection, childDecl, constructorDecl) {
|
|
232
231
|
const extendsClause = childDecl.heritageClauses?.find((cl) => cl.token === typescript_1.default.SyntaxKind.ExtendsKeyword);
|
|
233
232
|
if (!extendsClause)
|
|
@@ -28,7 +28,7 @@ const application_events_1 = require("../../application-events");
|
|
|
28
28
|
* - `@typeParam` block
|
|
29
29
|
* - `@return` block
|
|
30
30
|
*/
|
|
31
|
-
let InheritDocPlugin = class InheritDocPlugin extends components_1.ConverterComponent {
|
|
31
|
+
let InheritDocPlugin = exports.InheritDocPlugin = class InheritDocPlugin extends components_1.ConverterComponent {
|
|
32
32
|
constructor() {
|
|
33
33
|
super(...arguments);
|
|
34
34
|
// Key is depended on by Values
|
|
@@ -159,10 +159,9 @@ let InheritDocPlugin = class InheritDocPlugin extends components_1.ConverterComp
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
};
|
|
162
|
-
InheritDocPlugin = __decorate([
|
|
162
|
+
exports.InheritDocPlugin = InheritDocPlugin = __decorate([
|
|
163
163
|
(0, components_1.Component)({ name: "inheritDoc" })
|
|
164
164
|
], InheritDocPlugin);
|
|
165
|
-
exports.InheritDocPlugin = InheritDocPlugin;
|
|
166
165
|
function copySummaries(source, target) {
|
|
167
166
|
for (const [s, t] of (0, array_1.zip)(source || [], target || [])) {
|
|
168
167
|
t.comment = new models_1.Comment(s.comment?.summary);
|
|
@@ -16,7 +16,7 @@ const application_events_1 = require("../../application-events");
|
|
|
16
16
|
/**
|
|
17
17
|
* A plugin that resolves `{@link Foo}` tags.
|
|
18
18
|
*/
|
|
19
|
-
let LinkResolverPlugin = class LinkResolverPlugin extends components_1.ConverterComponent {
|
|
19
|
+
let LinkResolverPlugin = exports.LinkResolverPlugin = class LinkResolverPlugin extends components_1.ConverterComponent {
|
|
20
20
|
initialize() {
|
|
21
21
|
super.initialize();
|
|
22
22
|
this.owner.on(converter_events_1.ConverterEvents.RESOLVE_END, this.onResolve, this, -300);
|
|
@@ -56,7 +56,6 @@ let LinkResolverPlugin = class LinkResolverPlugin extends components_1.Converter
|
|
|
56
56
|
__decorate([
|
|
57
57
|
(0, utils_1.BindOption)("validation")
|
|
58
58
|
], LinkResolverPlugin.prototype, "validation", void 0);
|
|
59
|
-
LinkResolverPlugin = __decorate([
|
|
59
|
+
exports.LinkResolverPlugin = LinkResolverPlugin = __decorate([
|
|
60
60
|
(0, components_1.Component)({ name: "link-resolver" })
|
|
61
61
|
], LinkResolverPlugin);
|
|
62
|
-
exports.LinkResolverPlugin = LinkResolverPlugin;
|
|
@@ -43,7 +43,7 @@ const path_1 = require("path");
|
|
|
43
43
|
* A handler that tries to find the package.json and readme.md files of the
|
|
44
44
|
* current project.
|
|
45
45
|
*/
|
|
46
|
-
let PackagePlugin = class PackagePlugin extends components_1.ConverterComponent {
|
|
46
|
+
let PackagePlugin = exports.PackagePlugin = class PackagePlugin extends components_1.ConverterComponent {
|
|
47
47
|
initialize() {
|
|
48
48
|
this.listenTo(this.owner, {
|
|
49
49
|
[converter_1.Converter.EVENT_BEGIN]: this.onBegin,
|
|
@@ -141,7 +141,6 @@ __decorate([
|
|
|
141
141
|
__decorate([
|
|
142
142
|
(0, utils_1.BindOption)("includeVersion")
|
|
143
143
|
], PackagePlugin.prototype, "includeVersion", void 0);
|
|
144
|
-
PackagePlugin = __decorate([
|
|
144
|
+
exports.PackagePlugin = PackagePlugin = __decorate([
|
|
145
145
|
(0, components_1.Component)({ name: "package" })
|
|
146
146
|
], PackagePlugin);
|
|
147
|
-
exports.PackagePlugin = PackagePlugin;
|
|
@@ -23,7 +23,7 @@ const base_path_1 = require("../utils/base-path");
|
|
|
23
23
|
/**
|
|
24
24
|
* A handler that attaches source file information to reflections.
|
|
25
25
|
*/
|
|
26
|
-
let SourcePlugin = class SourcePlugin extends components_1.ConverterComponent {
|
|
26
|
+
let SourcePlugin = exports.SourcePlugin = class SourcePlugin extends components_1.ConverterComponent {
|
|
27
27
|
constructor() {
|
|
28
28
|
super(...arguments);
|
|
29
29
|
/**
|
|
@@ -163,7 +163,6 @@ __decorate([
|
|
|
163
163
|
__decorate([
|
|
164
164
|
(0, utils_1.BindOption)("basePath")
|
|
165
165
|
], SourcePlugin.prototype, "basePath", void 0);
|
|
166
|
-
SourcePlugin = __decorate([
|
|
166
|
+
exports.SourcePlugin = SourcePlugin = __decorate([
|
|
167
167
|
(0, components_1.Component)({ name: "source" })
|
|
168
168
|
], SourcePlugin);
|
|
169
|
-
exports.SourcePlugin = SourcePlugin;
|
|
@@ -15,7 +15,7 @@ const application_events_1 = require("../../application-events");
|
|
|
15
15
|
/**
|
|
16
16
|
* Responsible for adding `implementedBy` / `implementedFrom`
|
|
17
17
|
*/
|
|
18
|
-
let TypePlugin = class TypePlugin extends components_1.ConverterComponent {
|
|
18
|
+
let TypePlugin = exports.TypePlugin = class TypePlugin extends components_1.ConverterComponent {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(...arguments);
|
|
21
21
|
this.reflections = new Set();
|
|
@@ -121,7 +121,6 @@ let TypePlugin = class TypePlugin extends components_1.ConverterComponent {
|
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
|
-
TypePlugin = __decorate([
|
|
124
|
+
exports.TypePlugin = TypePlugin = __decorate([
|
|
125
125
|
(0, components_1.Component)({ name: "type" })
|
|
126
126
|
], TypePlugin);
|
|
127
|
-
exports.TypePlugin = TypePlugin;
|
|
@@ -34,7 +34,7 @@ var ReflectionFlag;
|
|
|
34
34
|
ReflectionFlag[ReflectionFlag["Const"] = 1024] = "Const";
|
|
35
35
|
ReflectionFlag[ReflectionFlag["Let"] = 2048] = "Let";
|
|
36
36
|
ReflectionFlag[ReflectionFlag["Readonly"] = 4096] = "Readonly";
|
|
37
|
-
})(ReflectionFlag
|
|
37
|
+
})(ReflectionFlag || (exports.ReflectionFlag = ReflectionFlag = {}));
|
|
38
38
|
const relevantFlags = [
|
|
39
39
|
ReflectionFlag.Private,
|
|
40
40
|
ReflectionFlag.Protected,
|
|
@@ -170,6 +170,7 @@ class ReflectionFlags extends Array {
|
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
+
exports.ReflectionFlags = ReflectionFlags;
|
|
173
174
|
ReflectionFlags.serializedFlags = [
|
|
174
175
|
"isPrivate",
|
|
175
176
|
"isProtected",
|
|
@@ -183,7 +184,6 @@ ReflectionFlags.serializedFlags = [
|
|
|
183
184
|
"isConst",
|
|
184
185
|
"isReadonly",
|
|
185
186
|
];
|
|
186
|
-
exports.ReflectionFlags = ReflectionFlags;
|
|
187
187
|
var TraverseProperty;
|
|
188
188
|
(function (TraverseProperty) {
|
|
189
189
|
TraverseProperty[TraverseProperty["Children"] = 0] = "Children";
|
|
@@ -194,7 +194,7 @@ var TraverseProperty;
|
|
|
194
194
|
TraverseProperty[TraverseProperty["IndexSignature"] = 5] = "IndexSignature";
|
|
195
195
|
TraverseProperty[TraverseProperty["GetSignature"] = 6] = "GetSignature";
|
|
196
196
|
TraverseProperty[TraverseProperty["SetSignature"] = 7] = "SetSignature";
|
|
197
|
-
})(TraverseProperty
|
|
197
|
+
})(TraverseProperty || (exports.TraverseProperty = TraverseProperty = {}));
|
|
198
198
|
/**
|
|
199
199
|
* Base class for all reflection classes.
|
|
200
200
|
*
|
|
@@ -15,7 +15,7 @@ var ConversionFlags;
|
|
|
15
15
|
(function (ConversionFlags) {
|
|
16
16
|
ConversionFlags[ConversionFlags["None"] = 0] = "None";
|
|
17
17
|
ConversionFlags[ConversionFlags["VariableOrPropertySource"] = 1] = "VariableOrPropertySource";
|
|
18
|
-
})(ConversionFlags
|
|
18
|
+
})(ConversionFlags || (exports.ConversionFlags = ConversionFlags = {}));
|
|
19
19
|
/**
|
|
20
20
|
* A reflection that represents a single declaration emitted by the TypeScript compiler.
|
|
21
21
|
*
|
|
@@ -31,7 +31,7 @@ var ReflectionKind;
|
|
|
31
31
|
ReflectionKind[ReflectionKind["ObjectLiteral"] = 2097152] = "ObjectLiteral";
|
|
32
32
|
ReflectionKind[ReflectionKind["TypeAlias"] = 4194304] = "TypeAlias";
|
|
33
33
|
ReflectionKind[ReflectionKind["Reference"] = 8388608] = "Reference";
|
|
34
|
-
})(ReflectionKind
|
|
34
|
+
})(ReflectionKind || (exports.ReflectionKind = ReflectionKind = {}));
|
|
35
35
|
(function (ReflectionKind) {
|
|
36
36
|
ReflectionKind.All = ReflectionKind.Reference * 2 - 1;
|
|
37
37
|
/** @internal */
|
|
@@ -129,7 +129,7 @@ var ReflectionKind;
|
|
|
129
129
|
.toLowerCase()}`;
|
|
130
130
|
}
|
|
131
131
|
ReflectionKind.classString = classString;
|
|
132
|
-
})(ReflectionKind
|
|
132
|
+
})(ReflectionKind || (exports.ReflectionKind = ReflectionKind = {}));
|
|
133
133
|
function getKindString(kind) {
|
|
134
134
|
return ReflectionKind[kind].replace(/(.)([A-Z])/g, (_m, a, b) => a + " " + b.toLowerCase());
|
|
135
135
|
}
|
|
@@ -101,6 +101,7 @@ export declare class PageEvent<out Model = unknown> extends Event {
|
|
|
101
101
|
* An event emitted when markdown is being parsed. Allows other plugins to manipulate the result.
|
|
102
102
|
*
|
|
103
103
|
* @see {@link MarkdownEvent.PARSE}
|
|
104
|
+
* @see {@link MarkdownEvent.INCLUDE}
|
|
104
105
|
*/
|
|
105
106
|
export declare class MarkdownEvent extends Event {
|
|
106
107
|
/**
|
|
@@ -120,6 +121,11 @@ export declare class MarkdownEvent extends Event {
|
|
|
120
121
|
* @event
|
|
121
122
|
*/
|
|
122
123
|
static readonly PARSE = "parseMarkdown";
|
|
124
|
+
/**
|
|
125
|
+
* Triggered on the renderer when this plugin includes a markdown file through a markdown include tag.
|
|
126
|
+
* @event
|
|
127
|
+
*/
|
|
128
|
+
static readonly INCLUDE = "includeMarkdown";
|
|
123
129
|
constructor(name: string, page: PageEvent, originalText: string, parsedText: string);
|
|
124
130
|
}
|
|
125
131
|
/**
|
|
@@ -54,6 +54,7 @@ class RendererEvent extends events_1.Event {
|
|
|
54
54
|
return [mapping.template, event];
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
+
exports.RendererEvent = RendererEvent;
|
|
57
58
|
/**
|
|
58
59
|
* Triggered before the renderer starts rendering a project.
|
|
59
60
|
* @event
|
|
@@ -64,7 +65,6 @@ RendererEvent.BEGIN = "beginRender";
|
|
|
64
65
|
* @event
|
|
65
66
|
*/
|
|
66
67
|
RendererEvent.END = "endRender";
|
|
67
|
-
exports.RendererEvent = RendererEvent;
|
|
68
68
|
/**
|
|
69
69
|
* An event emitted by the {@link Renderer} class before and after the
|
|
70
70
|
* markup of a page is rendered.
|
|
@@ -83,6 +83,7 @@ class PageEvent extends events_1.Event {
|
|
|
83
83
|
this.model = model;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
+
exports.PageEvent = PageEvent;
|
|
86
87
|
/**
|
|
87
88
|
* Triggered before a document will be rendered.
|
|
88
89
|
* @event
|
|
@@ -93,11 +94,11 @@ PageEvent.BEGIN = "beginPage";
|
|
|
93
94
|
* @event
|
|
94
95
|
*/
|
|
95
96
|
PageEvent.END = "endPage";
|
|
96
|
-
exports.PageEvent = PageEvent;
|
|
97
97
|
/**
|
|
98
98
|
* An event emitted when markdown is being parsed. Allows other plugins to manipulate the result.
|
|
99
99
|
*
|
|
100
100
|
* @see {@link MarkdownEvent.PARSE}
|
|
101
|
+
* @see {@link MarkdownEvent.INCLUDE}
|
|
101
102
|
*/
|
|
102
103
|
class MarkdownEvent extends events_1.Event {
|
|
103
104
|
constructor(name, page, originalText, parsedText) {
|
|
@@ -107,12 +108,17 @@ class MarkdownEvent extends events_1.Event {
|
|
|
107
108
|
this.parsedText = parsedText;
|
|
108
109
|
}
|
|
109
110
|
}
|
|
111
|
+
exports.MarkdownEvent = MarkdownEvent;
|
|
110
112
|
/**
|
|
111
113
|
* Triggered on the renderer when this plugin parses a markdown string.
|
|
112
114
|
* @event
|
|
113
115
|
*/
|
|
114
116
|
MarkdownEvent.PARSE = "parseMarkdown";
|
|
115
|
-
|
|
117
|
+
/**
|
|
118
|
+
* Triggered on the renderer when this plugin includes a markdown file through a markdown include tag.
|
|
119
|
+
* @event
|
|
120
|
+
*/
|
|
121
|
+
MarkdownEvent.INCLUDE = "includeMarkdown";
|
|
116
122
|
/**
|
|
117
123
|
* An event emitted when the search index is being prepared.
|
|
118
124
|
*/
|
|
@@ -144,9 +150,9 @@ class IndexEvent extends events_1.Event {
|
|
|
144
150
|
this.searchFields = Array.from({ length: this.searchResults.length }, () => ({}));
|
|
145
151
|
}
|
|
146
152
|
}
|
|
153
|
+
exports.IndexEvent = IndexEvent;
|
|
147
154
|
/**
|
|
148
155
|
* Triggered on the renderer when the search index is being prepared.
|
|
149
156
|
* @event
|
|
150
157
|
*/
|
|
151
158
|
IndexEvent.PREPARE_INDEX = "prepareIndex";
|
|
152
|
-
exports.IndexEvent = IndexEvent;
|
|
@@ -19,7 +19,7 @@ const path_1 = require("path");
|
|
|
19
19
|
* A plugin that copies the subdirectory ´assets´ from the current themes
|
|
20
20
|
* source folder to the output directory.
|
|
21
21
|
*/
|
|
22
|
-
let AssetsPlugin = class AssetsPlugin extends components_1.RendererComponent {
|
|
22
|
+
let AssetsPlugin = exports.AssetsPlugin = class AssetsPlugin extends components_1.RendererComponent {
|
|
23
23
|
/**
|
|
24
24
|
* Create a new AssetsPlugin instance.
|
|
25
25
|
*/
|
|
@@ -57,7 +57,6 @@ let AssetsPlugin = class AssetsPlugin extends components_1.RendererComponent {
|
|
|
57
57
|
__decorate([
|
|
58
58
|
(0, utils_1.BindOption)("customCss")
|
|
59
59
|
], AssetsPlugin.prototype, "customCss", void 0);
|
|
60
|
-
AssetsPlugin = __decorate([
|
|
60
|
+
exports.AssetsPlugin = AssetsPlugin = __decorate([
|
|
61
61
|
(0, components_1.Component)({ name: "assets" })
|
|
62
62
|
], AssetsPlugin);
|
|
63
|
-
exports.AssetsPlugin = AssetsPlugin;
|
|
@@ -42,7 +42,7 @@ const DefaultTheme_1 = require("../themes/default/DefaultTheme");
|
|
|
42
42
|
*
|
|
43
43
|
* The resulting javascript file can be used to build a simple search function.
|
|
44
44
|
*/
|
|
45
|
-
let JavascriptIndexPlugin = class JavascriptIndexPlugin extends components_1.RendererComponent {
|
|
45
|
+
let JavascriptIndexPlugin = exports.JavascriptIndexPlugin = class JavascriptIndexPlugin extends components_1.RendererComponent {
|
|
46
46
|
/**
|
|
47
47
|
* Create a new JavascriptIndexPlugin instance.
|
|
48
48
|
*/
|
|
@@ -141,7 +141,6 @@ let JavascriptIndexPlugin = class JavascriptIndexPlugin extends components_1.Ren
|
|
|
141
141
|
__decorate([
|
|
142
142
|
(0, utils_1.BindOption)("searchInComments")
|
|
143
143
|
], JavascriptIndexPlugin.prototype, "searchComments", void 0);
|
|
144
|
-
JavascriptIndexPlugin = __decorate([
|
|
144
|
+
exports.JavascriptIndexPlugin = JavascriptIndexPlugin = __decorate([
|
|
145
145
|
(0, components_1.Component)({ name: "javascript-index" })
|
|
146
146
|
], JavascriptIndexPlugin);
|
|
147
|
-
exports.JavascriptIndexPlugin = JavascriptIndexPlugin;
|
|
@@ -145,6 +145,8 @@ export declare class Renderer extends ChildableComponent<Application, RendererCo
|
|
|
145
145
|
lightTheme: ShikiTheme;
|
|
146
146
|
/** @internal */
|
|
147
147
|
darkTheme: ShikiTheme;
|
|
148
|
+
/** @internal */
|
|
149
|
+
pretty: boolean;
|
|
148
150
|
renderStartTime: number;
|
|
149
151
|
/**
|
|
150
152
|
* Define a new theme that can be used to render output.
|
|
@@ -82,7 +82,7 @@ const type_1 = require("./themes/default/partials/type");
|
|
|
82
82
|
* Triggered when the JavascriptIndexPlugin is preparing the search index. Listeners receive
|
|
83
83
|
* an instance of {@link IndexEvent}.
|
|
84
84
|
*/
|
|
85
|
-
let Renderer = class Renderer extends component_1.ChildableComponent {
|
|
85
|
+
let Renderer = exports.Renderer = class Renderer extends component_1.ChildableComponent {
|
|
86
86
|
constructor() {
|
|
87
87
|
super(...arguments);
|
|
88
88
|
this.themes = new Map([
|
|
@@ -139,6 +139,7 @@ let Renderer = class Renderer extends component_1.ChildableComponent {
|
|
|
139
139
|
* @param outputDirectory The path of the directory the documentation should be rendered to.
|
|
140
140
|
*/
|
|
141
141
|
async render(project, outputDirectory) {
|
|
142
|
+
(0, jsx_1.setRenderSettings)({ pretty: this.pretty });
|
|
142
143
|
const momento = this.hooks.saveMomento();
|
|
143
144
|
this.renderStartTime = Date.now();
|
|
144
145
|
await (0, highlighter_1.loadHighlighter)(this.lightTheme, this.darkTheme);
|
|
@@ -296,10 +297,13 @@ __decorate([
|
|
|
296
297
|
__decorate([
|
|
297
298
|
(0, utils_1.BindOption)("darkHighlightTheme")
|
|
298
299
|
], Renderer.prototype, "darkTheme", void 0);
|
|
299
|
-
|
|
300
|
+
__decorate([
|
|
301
|
+
(0, utils_1.BindOption)("pretty")
|
|
302
|
+
], Renderer.prototype, "pretty", void 0);
|
|
303
|
+
exports.Renderer = Renderer = __decorate([
|
|
300
304
|
(0, component_1.Component)({ name: "renderer", internal: true, childClass: components_1.RendererComponent })
|
|
301
305
|
], Renderer);
|
|
302
|
-
exports.Renderer = Renderer;
|
|
303
306
|
// HACK: THIS HAS TO STAY DOWN HERE
|
|
304
307
|
// if you try to move it up to the top of the file, then you'll run into stuff being used before it has been defined.
|
|
305
308
|
require("./plugins");
|
|
309
|
+
const jsx_1 = require("../utils/jsx");
|
package/dist/lib/output/theme.js
CHANGED
|
@@ -17,7 +17,7 @@ const component_1 = require("../utils/component");
|
|
|
17
17
|
* and templates to use. Additionally themes can subscribe to the events emitted by
|
|
18
18
|
* {@link Renderer} to control and manipulate the output process.
|
|
19
19
|
*/
|
|
20
|
-
let Theme = class Theme extends components_1.RendererComponent {
|
|
20
|
+
let Theme = exports.Theme = class Theme extends components_1.RendererComponent {
|
|
21
21
|
/**
|
|
22
22
|
* Create a new BaseTheme instance.
|
|
23
23
|
*
|
|
@@ -27,7 +27,6 @@ let Theme = class Theme extends components_1.RendererComponent {
|
|
|
27
27
|
super(renderer);
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
Theme = __decorate([
|
|
30
|
+
exports.Theme = Theme = __decorate([
|
|
31
31
|
(0, component_1.Component)({ name: "theme", internal: true })
|
|
32
32
|
], Theme);
|
|
33
|
-
exports.Theme = Theme;
|
|
@@ -42,7 +42,7 @@ const html_1 = require("../../utils/html");
|
|
|
42
42
|
* Implements markdown and relativeURL helpers for templates.
|
|
43
43
|
* @internal
|
|
44
44
|
*/
|
|
45
|
-
let MarkedPlugin = class MarkedPlugin extends components_1.ContextAwareRendererComponent {
|
|
45
|
+
let MarkedPlugin = exports.MarkedPlugin = class MarkedPlugin extends components_1.ContextAwareRendererComponent {
|
|
46
46
|
constructor() {
|
|
47
47
|
super(...arguments);
|
|
48
48
|
/**
|
|
@@ -96,7 +96,9 @@ output file :
|
|
|
96
96
|
path = Path.join(this.includes, path.trim());
|
|
97
97
|
if ((0, utils_1.isFile)(path)) {
|
|
98
98
|
const contents = (0, utils_1.readFile)(path);
|
|
99
|
-
|
|
99
|
+
const event = new events_1.MarkdownEvent(events_1.MarkdownEvent.INCLUDE, page, contents, contents);
|
|
100
|
+
this.owner.trigger(event);
|
|
101
|
+
return event.parsedText;
|
|
100
102
|
}
|
|
101
103
|
else {
|
|
102
104
|
this.application.logger.warn("Could not find file to include: " + path);
|
|
@@ -199,10 +201,9 @@ __decorate([
|
|
|
199
201
|
__decorate([
|
|
200
202
|
(0, utils_1.BindOption)("darkHighlightTheme")
|
|
201
203
|
], MarkedPlugin.prototype, "darkTheme", void 0);
|
|
202
|
-
MarkedPlugin = __decorate([
|
|
204
|
+
exports.MarkedPlugin = MarkedPlugin = __decorate([
|
|
203
205
|
(0, components_1.Component)({ name: "marked" })
|
|
204
206
|
], MarkedPlugin);
|
|
205
|
-
exports.MarkedPlugin = MarkedPlugin;
|
|
206
207
|
// Basically a copy/paste of Marked's code, with the addition of the button
|
|
207
208
|
// https://github.com/markedjs/marked/blob/v4.3.0/src/Renderer.js#L15-L39
|
|
208
209
|
function renderCode(code, infostring, escaped) {
|
|
@@ -190,8 +190,8 @@ class DefaultTheme extends theme_1.Theme {
|
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
DefaultTheme.URL_PREFIX = /^(http|ftp)s?:\/\//;
|
|
194
193
|
exports.DefaultTheme = DefaultTheme;
|
|
194
|
+
DefaultTheme.URL_PREFIX = /^(http|ftp)s?:\/\//;
|
|
195
195
|
function hasReadme(readme) {
|
|
196
196
|
return !readme.endsWith("none");
|
|
197
197
|
}
|
|
@@ -25,7 +25,10 @@ export declare class DefaultThemeRenderContext {
|
|
|
25
25
|
defaultLayout: (template: import("../..").RenderTemplate<PageEvent<Reflection>>, props: PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
26
26
|
analytics: () => import("../../../utils/jsx.elements").JsxElement | undefined;
|
|
27
27
|
breadcrumb: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
|
|
28
|
+
/** @deprecated will be removed in 0.25 */
|
|
28
29
|
comment: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
|
|
30
|
+
commentSummary: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
|
|
31
|
+
commentTags: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
|
|
29
32
|
footer: () => import("../../../utils/jsx.elements").JsxElement | undefined;
|
|
30
33
|
header: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
31
34
|
hierarchy: (props: import("../../../models").DeclarationHierarchy | undefined) => import("../../../utils/jsx.elements").JsxElement | undefined;
|
|
@@ -69,7 +69,10 @@ class DefaultThemeRenderContext {
|
|
|
69
69
|
this.defaultLayout = bind(default_1.defaultLayout, this);
|
|
70
70
|
this.analytics = bind(analytics_1.analytics, this);
|
|
71
71
|
this.breadcrumb = bind(breadcrumb_1.breadcrumb, this);
|
|
72
|
+
/** @deprecated will be removed in 0.25 */
|
|
72
73
|
this.comment = bind(comment_1.comment, this);
|
|
74
|
+
this.commentSummary = bind(comment_1.commentSummary, this);
|
|
75
|
+
this.commentTags = bind(comment_1.commentTags, this);
|
|
73
76
|
this.footer = bind(footer_1.footer, this);
|
|
74
77
|
this.header = bind(header_1.header, this);
|
|
75
78
|
this.hierarchy = bind(hierarchy_1.hierarchy, this);
|
|
@@ -2,3 +2,5 @@ import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
|
|
|
2
2
|
import { JSX } from "../../../../utils";
|
|
3
3
|
import { Reflection } from "../../../../models";
|
|
4
4
|
export declare function comment({ markdown }: DefaultThemeRenderContext, props: Reflection): JSX.Element | undefined;
|
|
5
|
+
export declare function commentSummary({ markdown }: DefaultThemeRenderContext, props: Reflection): JSX.Element | undefined;
|
|
6
|
+
export declare function commentTags({ markdown }: DefaultThemeRenderContext, props: Reflection): JSX.Element | undefined;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.comment = void 0;
|
|
3
|
+
exports.commentTags = exports.commentSummary = exports.comment = void 0;
|
|
4
4
|
const utils_1 = require("../../../../utils");
|
|
5
5
|
const models_1 = require("../../../../models");
|
|
6
6
|
const lib_1 = require("../../lib");
|
|
7
|
+
// Note: Comment modifiers are handled in `renderFlags`
|
|
7
8
|
function comment({ markdown }, props) {
|
|
8
9
|
if (!props.comment?.hasVisibleComponent())
|
|
9
10
|
return;
|
|
10
|
-
// Note: Comment modifiers are handled in `renderFlags`
|
|
11
11
|
const tags = props.kindOf(models_1.ReflectionKind.SomeSignature)
|
|
12
12
|
? props.comment.blockTags.filter((tag) => tag.tag !== "@returns")
|
|
13
13
|
: props.comment.blockTags;
|
|
@@ -18,3 +18,21 @@ function comment({ markdown }, props) {
|
|
|
18
18
|
utils_1.JSX.createElement(utils_1.Raw, { html: markdown(item.content) }))))));
|
|
19
19
|
}
|
|
20
20
|
exports.comment = comment;
|
|
21
|
+
function commentSummary({ markdown }, props) {
|
|
22
|
+
if (!props.comment?.summary.some((part) => part.text))
|
|
23
|
+
return;
|
|
24
|
+
return (utils_1.JSX.createElement("div", { class: "tsd-comment tsd-typography" },
|
|
25
|
+
utils_1.JSX.createElement(utils_1.Raw, { html: markdown(props.comment.summary) })));
|
|
26
|
+
}
|
|
27
|
+
exports.commentSummary = commentSummary;
|
|
28
|
+
function commentTags({ markdown }, props) {
|
|
29
|
+
if (!props.comment)
|
|
30
|
+
return;
|
|
31
|
+
const tags = props.kindOf(models_1.ReflectionKind.SomeSignature)
|
|
32
|
+
? props.comment.blockTags.filter((tag) => tag.tag !== "@returns")
|
|
33
|
+
: props.comment.blockTags;
|
|
34
|
+
return (utils_1.JSX.createElement("div", { class: "tsd-comment tsd-typography" }, tags.map((item) => (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
35
|
+
utils_1.JSX.createElement("h4", null, (0, lib_1.camelToTitleCase)(item.tag.substring(1))),
|
|
36
|
+
utils_1.JSX.createElement(utils_1.Raw, { html: markdown(item.content) }))))));
|
|
37
|
+
}
|
|
38
|
+
exports.commentTags = commentTags;
|
|
@@ -21,9 +21,9 @@ function cachedPart(key, svgPart) {
|
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
const kindIcon = (kind, letterPath, color, circular = false) => (utils_1.JSX.createElement("svg", { class: "tsd-kind-icon",
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
const kindIcon = (kind, letterPath, color, circular = false) => (utils_1.JSX.createElement("svg", { class: "tsd-kind-icon", viewBox: "0 0 24 24" }, cachedPart(`${kind}`, utils_1.JSX.createElement("g", null,
|
|
25
|
+
utils_1.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" }),
|
|
26
|
+
letterPath))));
|
|
27
27
|
exports.icons = {
|
|
28
28
|
[models_1.ReflectionKind.Accessor]: () => kindIcon(models_1.ReflectionKind.Accessor, utils_1.JSX.createElement("path", { d: "M8.85 16L11.13 7.24H12.582L14.85 16H13.758L13.182 13.672H10.53L9.954 16H8.85ZM10.746 12.76H12.954L12.282 10.06C12.154 9.548 12.054 9.12 11.982 8.776C11.91 8.432 11.866 8.208 11.85 8.104C11.834 8.208 11.79 8.432 11.718 8.776C11.646 9.12 11.546 9.544 11.418 10.048L10.746 12.76Z", fill: "var(--color-text)" }), "#FF4D4D", true),
|
|
29
29
|
[models_1.ReflectionKind.CallSignature]() {
|
|
@@ -74,8 +74,7 @@ exports.icons = {
|
|
|
74
74
|
return this[models_1.ReflectionKind.TypeAlias]();
|
|
75
75
|
},
|
|
76
76
|
[models_1.ReflectionKind.Variable]: () => kindIcon(models_1.ReflectionKind.Variable, utils_1.JSX.createElement("path", { d: "M11.106 16L8.85 7.24H9.966L11.454 13.192C11.558 13.608 11.646 13.996 11.718 14.356C11.79 14.708 11.842 14.976 11.874 15.16C11.906 14.976 11.954 14.708 12.018 14.356C12.09 13.996 12.178 13.608 12.282 13.192L13.758 7.24H14.85L12.582 16H11.106Z", fill: "var(--color-text)" }), "var(--color-ts-variable)"),
|
|
77
|
-
chevronDown: () => (utils_1.JSX.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none" },
|
|
78
|
-
utils_1.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-text)" }))),
|
|
77
|
+
chevronDown: () => (utils_1.JSX.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none" }, cachedPart("chevronDown", utils_1.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-text)" })))),
|
|
79
78
|
chevronSmall: () => (utils_1.JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
|
|
80
79
|
utils_1.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-text)" }))),
|
|
81
80
|
checkbox: () => (utils_1.JSX.createElement("svg", { width: "32", height: "32", viewBox: "0 0 32 32", "aria-hidden": "true" },
|
|
@@ -84,8 +83,8 @@ exports.icons = {
|
|
|
84
83
|
menu: () => (utils_1.JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, ["3", "7", "11"].map((y) => (utils_1.JSX.createElement("rect", { x: "1", y: y, width: "14", height: "2", fill: "var(--color-text)" }))))),
|
|
85
84
|
search: () => (utils_1.JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
|
|
86
85
|
utils_1.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-text)" }))),
|
|
87
|
-
anchor: () => (utils_1.JSX.createElement("svg", {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
anchor: () => (utils_1.JSX.createElement("svg", { viewBox: "0 0 24 24" }, cachedPart("anchor", utils_1.JSX.createElement("g", { "stroke-width": "2", stroke: "currentColor", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round" },
|
|
87
|
+
utils_1.JSX.createElement("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
|
|
88
|
+
utils_1.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
|
+
utils_1.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" }))))),
|
|
91
90
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DeclarationReflection } from "../../../../models";
|
|
1
|
+
import type { DeclarationReflection } from "../../../../models";
|
|
2
2
|
import { JSX } from "../../../../utils";
|
|
3
3
|
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
|
|
4
|
-
export declare
|
|
4
|
+
export declare function memberDeclaration(context: DefaultThemeRenderContext, props: DeclarationReflection): JSX.Element;
|
|
@@ -1,27 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.memberDeclaration = void 0;
|
|
4
|
-
const models_1 = require("../../../../models");
|
|
5
4
|
const utils_1 = require("../../../../utils");
|
|
6
5
|
const lib_1 = require("../../lib");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
utils_1.JSX.createElement("
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
utils_1.JSX.createElement(
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
6
|
+
function memberDeclaration(context, props) {
|
|
7
|
+
function renderTypeDeclaration(type) {
|
|
8
|
+
return (utils_1.JSX.createElement("div", { class: "tsd-type-declaration" },
|
|
9
|
+
utils_1.JSX.createElement("h4", null, "Type declaration"),
|
|
10
|
+
context.parameter(type.declaration)));
|
|
11
|
+
}
|
|
12
|
+
const visitor = { reflection: renderTypeDeclaration };
|
|
13
|
+
return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
14
|
+
utils_1.JSX.createElement("div", { class: "tsd-signature" },
|
|
15
|
+
utils_1.JSX.createElement("span", { class: (0, lib_1.getKindClass)(props) }, (0, lib_1.wbr)(props.name)),
|
|
16
|
+
(0, lib_1.renderTypeParametersSignature)(context, props.typeParameters),
|
|
17
|
+
props.type && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
18
|
+
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" },
|
|
19
|
+
!!props.flags.isOptional && "?",
|
|
20
|
+
":"),
|
|
21
|
+
" ",
|
|
22
|
+
context.type(props.type))),
|
|
23
|
+
!!props.defaultValue && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
24
|
+
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" },
|
|
25
|
+
" = ",
|
|
26
|
+
props.defaultValue)))),
|
|
27
|
+
context.commentSummary(props),
|
|
28
|
+
(0, lib_1.hasTypeParameters)(props) && context.typeParameters(props.typeParameters),
|
|
29
|
+
props.type?.visit({
|
|
30
|
+
reflection: renderTypeDeclaration,
|
|
31
|
+
array: (arr) => arr.elementType.visit(visitor),
|
|
32
|
+
intersection: (int) => int.types.map((t) => t.visit(visitor)),
|
|
33
|
+
union: (union) => union.types.map((t) => t.visit(visitor)),
|
|
34
|
+
reference: (ref) => ref.typeArguments?.map((t) => t.visit(visitor)),
|
|
35
|
+
tuple: (ref) => ref.elements.map((t) => t.visit(visitor)),
|
|
36
|
+
}),
|
|
37
|
+
context.commentTags(props),
|
|
38
|
+
context.memberSources(props)));
|
|
39
|
+
}
|
|
27
40
|
exports.memberDeclaration = memberDeclaration;
|
|
@@ -8,7 +8,7 @@ function memberSignatureBody(context, props, { hideSources = false } = {}) {
|
|
|
8
8
|
const returnsTag = props.comment?.getTag("@returns");
|
|
9
9
|
return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
10
10
|
(0, lib_1.renderFlags)(props.flags, props.comment),
|
|
11
|
-
context.
|
|
11
|
+
context.commentSummary(props),
|
|
12
12
|
(0, lib_1.hasTypeParameters)(props) && context.typeParameters(props.typeParameters),
|
|
13
13
|
props.parameters && props.parameters.length > 0 && (utils_1.JSX.createElement("div", { class: "tsd-parameters" },
|
|
14
14
|
utils_1.JSX.createElement("h4", { class: "tsd-parameters-title" }, "Parameters"),
|
|
@@ -22,7 +22,8 @@ function memberSignatureBody(context, props, { hideSources = false } = {}) {
|
|
|
22
22
|
item.defaultValue != null && (utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" },
|
|
23
23
|
" = ",
|
|
24
24
|
item.defaultValue))),
|
|
25
|
-
context.
|
|
25
|
+
context.commentSummary(item),
|
|
26
|
+
context.commentTags(item),
|
|
26
27
|
item.type instanceof models_1.ReflectionType && context.parameter(item.type.declaration))))))),
|
|
27
28
|
props.type && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
28
29
|
utils_1.JSX.createElement("h4", { class: "tsd-returns-title" },
|
|
@@ -30,6 +31,7 @@ function memberSignatureBody(context, props, { hideSources = false } = {}) {
|
|
|
30
31
|
context.type(props.type)),
|
|
31
32
|
returnsTag && utils_1.JSX.createElement(utils_1.Raw, { html: context.markdown(returnsTag.content) }),
|
|
32
33
|
props.type instanceof models_1.ReflectionType && context.parameter(props.type.declaration))),
|
|
34
|
+
context.commentTags(props),
|
|
33
35
|
!hideSources && context.memberSources(props)));
|
|
34
36
|
}
|
|
35
37
|
exports.memberSignatureBody = memberSignatureBody;
|
|
@@ -91,9 +91,9 @@ function navigation(context, props) {
|
|
|
91
91
|
createNavElement(props.project),
|
|
92
92
|
utils_1.JSX.createElement("ul", { class: "tsd-small-nested-navigation" }, getNavigationElements(props.project, opts).map((c) => (utils_1.JSX.createElement("li", null, links(c, [])))))));
|
|
93
93
|
function links(mod, parents) {
|
|
94
|
-
const nameClasses = (0, lib_1.classNames)({ deprecated: mod instanceof models_1.Reflection && mod.isDeprecated() },
|
|
94
|
+
const nameClasses = (0, lib_1.classNames)({ deprecated: mod instanceof models_1.Reflection && mod.isDeprecated() }, mod instanceof models_1.DeclarationReflection ? context.getReflectionClasses(mod) : void 0);
|
|
95
95
|
const children = getNavigationElements(mod, opts);
|
|
96
|
-
if (!children.length) {
|
|
96
|
+
if (!children.length || (!opts.fullTree && mod instanceof models_1.Reflection && !inPath(mod))) {
|
|
97
97
|
return createNavElement(mod, nameClasses);
|
|
98
98
|
}
|
|
99
99
|
return (utils_1.JSX.createElement("details", { class: (0, lib_1.classNames)({ "tsd-index-accordion": true }, nameClasses), open: mod instanceof models_1.Reflection && inPath(mod), "data-key": mod instanceof models_1.Reflection ? mod.getFullName() : [...parents, mod.title].join("$") },
|
|
@@ -25,7 +25,8 @@ const parameter = (context, props) => (utils_1.JSX.createElement(utils_1.JSX.Fra
|
|
|
25
25
|
context.type(item.type)))),
|
|
26
26
|
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "]: "),
|
|
27
27
|
context.type(props.indexSignature.type)),
|
|
28
|
-
context.
|
|
28
|
+
context.commentSummary(props.indexSignature),
|
|
29
|
+
context.commentTags(props.indexSignature),
|
|
29
30
|
props.indexSignature.type instanceof models_1.ReflectionType &&
|
|
30
31
|
context.parameter(props.indexSignature.type.declaration)))),
|
|
31
32
|
props.children?.map((item) => (utils_1.JSX.createElement(utils_1.JSX.Fragment, null, item.signatures ? (utils_1.JSX.createElement("li", { class: "tsd-parameter" },
|
|
@@ -46,7 +47,8 @@ const parameter = (context, props) => (utils_1.JSX.createElement(utils_1.JSX.Fra
|
|
|
46
47
|
!!item.flags.isOptional && "?",
|
|
47
48
|
": "),
|
|
48
49
|
context.type(item.type)),
|
|
49
|
-
context.
|
|
50
|
+
context.commentSummary(item),
|
|
51
|
+
context.commentTags(item),
|
|
50
52
|
!!item.children && context.parameter(item),
|
|
51
53
|
item.type instanceof models_1.ReflectionType && context.parameter(item.type.declaration)))) : (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
52
54
|
item.getSignature && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
@@ -57,7 +59,8 @@ const parameter = (context, props) => (utils_1.JSX.createElement(utils_1.JSX.Fra
|
|
|
57
59
|
utils_1.JSX.createElement("span", { class: (0, lib_1.getKindClass)(item) }, (0, lib_1.wbr)(item.name)),
|
|
58
60
|
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "(): "),
|
|
59
61
|
context.type(item.getSignature.type)),
|
|
60
|
-
context.
|
|
62
|
+
context.commentSummary(item.getSignature),
|
|
63
|
+
context.commentTags(item.getSignature)))),
|
|
61
64
|
item.setSignature && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
62
65
|
utils_1.JSX.createElement("li", { class: "tsd-parameter" },
|
|
63
66
|
utils_1.JSX.createElement("h5", null,
|
|
@@ -71,5 +74,6 @@ const parameter = (context, props) => (utils_1.JSX.createElement(utils_1.JSX.Fra
|
|
|
71
74
|
context.type(item.type)))),
|
|
72
75
|
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "): "),
|
|
73
76
|
context.type(item.setSignature.type)),
|
|
74
|
-
context.
|
|
77
|
+
context.commentSummary(item.setSignature),
|
|
78
|
+
context.commentTags(item.setSignature))))))))))));
|
|
75
79
|
exports.parameter = parameter;
|
|
@@ -17,6 +17,7 @@ function typeParameters(context, typeParameters) {
|
|
|
17
17
|
!!item.default && (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
18
18
|
" = ",
|
|
19
19
|
context.type(item.default)))),
|
|
20
|
-
context.
|
|
20
|
+
context.commentSummary(item),
|
|
21
|
+
context.commentTags(item))))))));
|
|
21
22
|
}
|
|
22
23
|
exports.typeParameters = typeParameters;
|
|
@@ -10,7 +10,9 @@ function reflectionTemplate(context, props) {
|
|
|
10
10
|
return context.memberDeclaration(props.model);
|
|
11
11
|
}
|
|
12
12
|
return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
13
|
-
props.model.hasComment() && (utils_1.JSX.createElement("section", { class: "tsd-panel tsd-comment" },
|
|
13
|
+
props.model.hasComment() && (utils_1.JSX.createElement("section", { class: "tsd-panel tsd-comment" },
|
|
14
|
+
context.commentSummary(props.model),
|
|
15
|
+
context.commentTags(props.model))),
|
|
14
16
|
props.model instanceof models_1.DeclarationReflection &&
|
|
15
17
|
props.model.kind === models_1.ReflectionKind.Module &&
|
|
16
18
|
props.model.readme?.length && (utils_1.JSX.createElement("section", { class: "tsd-panel tsd-typography" },
|
|
@@ -38,7 +40,8 @@ function reflectionTemplate(context, props) {
|
|
|
38
40
|
context.type(item.type)))),
|
|
39
41
|
utils_1.JSX.createElement("span", { class: "tsd-signature-symbol" }, "]: "),
|
|
40
42
|
context.type(props.model.indexSignature.type)),
|
|
41
|
-
context.
|
|
43
|
+
context.commentSummary(props.model.indexSignature),
|
|
44
|
+
context.commentTags(props.model.indexSignature),
|
|
42
45
|
props.model.indexSignature?.type instanceof models_1.ReflectionType &&
|
|
43
46
|
context.parameter(props.model.indexSignature.type.declaration))),
|
|
44
47
|
!props.model.signatures && context.memberSources(props.model))),
|
|
@@ -41,6 +41,7 @@ class Serializer extends utils_1.EventDispatcher {
|
|
|
41
41
|
return project;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
+
exports.Serializer = Serializer;
|
|
44
45
|
/**
|
|
45
46
|
* Triggered when the {@link Serializer} begins transforming a project.
|
|
46
47
|
* @event EVENT_BEGIN
|
|
@@ -51,4 +52,3 @@ Serializer.EVENT_BEGIN = "begin";
|
|
|
51
52
|
* @event EVENT_END
|
|
52
53
|
*/
|
|
53
54
|
Serializer.EVENT_END = "end";
|
|
54
|
-
exports.Serializer = Serializer;
|
|
@@ -43,7 +43,7 @@ export declare abstract class AbstractComponent<O extends ComponentHost> extends
|
|
|
43
43
|
*/
|
|
44
44
|
private _componentOwner;
|
|
45
45
|
/**
|
|
46
|
-
* The name of this component as set by the
|
|
46
|
+
* The name of this component as set by the `@Component` decorator.
|
|
47
47
|
*/
|
|
48
48
|
componentName: string;
|
|
49
49
|
/**
|
|
@@ -49,9 +49,9 @@ class ComponentEvent extends events_1.Event {
|
|
|
49
49
|
this.component = component;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
+
exports.ComponentEvent = ComponentEvent;
|
|
52
53
|
ComponentEvent.ADDED = "componentAdded";
|
|
53
54
|
ComponentEvent.REMOVED = "componentRemoved";
|
|
54
|
-
exports.ComponentEvent = ComponentEvent;
|
|
55
55
|
/**
|
|
56
56
|
* Component base class. Has an owner (unless it's the application root component),
|
|
57
57
|
* can dispatch events to its children, and has access to the root Application component.
|
package/dist/lib/utils/jsx.d.ts
CHANGED
|
@@ -41,4 +41,7 @@ export declare namespace JSX {
|
|
|
41
41
|
* @param children
|
|
42
42
|
*/
|
|
43
43
|
export declare function createElement(tag: typeof Fragment | string | JsxComponent<any>, props: object | null, ...children: JsxChildren[]): JsxElement;
|
|
44
|
+
export declare function setRenderSettings(options: {
|
|
45
|
+
pretty: boolean;
|
|
46
|
+
}): void;
|
|
44
47
|
export declare function renderElement(element: JsxElement | null | undefined): string;
|
package/dist/lib/utils/jsx.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* @module
|
|
15
15
|
*/
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.renderElement = exports.createElement = exports.Raw = exports.Fragment = void 0;
|
|
17
|
+
exports.renderElement = exports.setRenderSettings = exports.createElement = exports.Raw = exports.Fragment = void 0;
|
|
18
18
|
const html_1 = require("./html");
|
|
19
19
|
const jsx_elements_1 = require("./jsx.elements");
|
|
20
20
|
var jsx_elements_2 = require("./jsx.elements");
|
|
@@ -71,6 +71,11 @@ function createElement(tag, props, ...children) {
|
|
|
71
71
|
return { tag, props, children };
|
|
72
72
|
}
|
|
73
73
|
exports.createElement = createElement;
|
|
74
|
+
let renderPretty = true;
|
|
75
|
+
function setRenderSettings(options) {
|
|
76
|
+
renderPretty = options.pretty;
|
|
77
|
+
}
|
|
78
|
+
exports.setRenderSettings = setRenderSettings;
|
|
74
79
|
function renderElement(element) {
|
|
75
80
|
if (!element) {
|
|
76
81
|
return "";
|
|
@@ -84,7 +89,7 @@ function renderElement(element) {
|
|
|
84
89
|
}
|
|
85
90
|
const html = [];
|
|
86
91
|
if (tag !== jsx_elements_1.JsxFragment) {
|
|
87
|
-
if (blockElements.has(tag)) {
|
|
92
|
+
if (blockElements.has(tag) && renderPretty) {
|
|
88
93
|
html.push("\n");
|
|
89
94
|
}
|
|
90
95
|
html.push("<", tag);
|
|
@@ -19,7 +19,7 @@ var LogLevel;
|
|
|
19
19
|
LogLevel[LogLevel["Warn"] = 2] = "Warn";
|
|
20
20
|
LogLevel[LogLevel["Error"] = 3] = "Error";
|
|
21
21
|
LogLevel[LogLevel["None"] = 4] = "None";
|
|
22
|
-
})(LogLevel
|
|
22
|
+
})(LogLevel || (exports.LogLevel = LogLevel = {}));
|
|
23
23
|
const Colors = {
|
|
24
24
|
red: "\u001b[91m",
|
|
25
25
|
yellow: "\u001b[93m",
|
|
@@ -22,7 +22,7 @@ var ParameterHint;
|
|
|
22
22
|
(function (ParameterHint) {
|
|
23
23
|
ParameterHint[ParameterHint["File"] = 0] = "File";
|
|
24
24
|
ParameterHint[ParameterHint["Directory"] = 1] = "Directory";
|
|
25
|
-
})(ParameterHint
|
|
25
|
+
})(ParameterHint || (exports.ParameterHint = ParameterHint = {}));
|
|
26
26
|
var ParameterType;
|
|
27
27
|
(function (ParameterType) {
|
|
28
28
|
ParameterType[ParameterType["String"] = 0] = "String";
|
|
@@ -55,7 +55,7 @@ var ParameterType;
|
|
|
55
55
|
* An object with true/false flags
|
|
56
56
|
*/
|
|
57
57
|
ParameterType[ParameterType["Flags"] = 11] = "Flags";
|
|
58
|
-
})(ParameterType
|
|
58
|
+
})(ParameterType || (exports.ParameterType = ParameterType = {}));
|
|
59
59
|
const converters = {
|
|
60
60
|
[ParameterType.String](value, option) {
|
|
61
61
|
const stringValue = value == null ? "" : String(value);
|
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.24.
|
|
4
|
+
"version": "0.24.8",
|
|
5
5
|
"homepage": "https://typedoc.org",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./dist/index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"shiki": "^0.14.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x"
|
|
33
|
+
"typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/lunr": "^2.3.4",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"prettier": "2.8.7",
|
|
48
48
|
"puppeteer": "^13.5.2",
|
|
49
49
|
"ts-node": "^10.9.1",
|
|
50
|
-
"typescript": "5.
|
|
50
|
+
"typescript": "5.1.3"
|
|
51
51
|
},
|
|
52
52
|
"files": [
|
|
53
53
|
"/bin",
|