typedoc 0.26.10 → 0.27.0-beta.0
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/bin/package.json +3 -0
- package/bin/typedoc +1 -1
- package/dist/index.d.ts +23 -13
- package/dist/index.js +22 -81
- package/dist/lib/application-events.js +1 -4
- package/dist/lib/application.d.ts +26 -16
- package/dist/lib/application.js +222 -242
- package/dist/lib/cli.js +3 -40
- package/dist/lib/converter/comments/blockLexer.d.ts +1 -1
- package/dist/lib/converter/comments/blockLexer.js +24 -30
- package/dist/lib/converter/comments/declarationReference.js +10 -21
- package/dist/lib/converter/comments/declarationReferenceResolver.d.ts +2 -2
- package/dist/lib/converter/comments/declarationReferenceResolver.js +40 -36
- package/dist/lib/converter/comments/discovery.d.ts +4 -4
- package/dist/lib/converter/comments/discovery.js +172 -148
- package/dist/lib/converter/comments/index.d.ts +4 -4
- package/dist/lib/converter/comments/index.js +39 -50
- package/dist/lib/converter/comments/lexer.d.ts +1 -1
- package/dist/lib/converter/comments/lexer.js +2 -5
- package/dist/lib/converter/comments/lineLexer.d.ts +1 -1
- package/dist/lib/converter/comments/lineLexer.js +12 -15
- package/dist/lib/converter/comments/linkResolver.d.ts +2 -2
- package/dist/lib/converter/comments/linkResolver.js +14 -21
- package/dist/lib/converter/comments/parser.d.ts +6 -6
- package/dist/lib/converter/comments/parser.js +69 -96
- package/dist/lib/converter/comments/rawLexer.d.ts +1 -1
- package/dist/lib/converter/comments/rawLexer.js +13 -16
- package/dist/lib/converter/comments/tagName.js +1 -4
- package/dist/lib/converter/comments/textParser.d.ts +4 -4
- package/dist/lib/converter/comments/textParser.js +28 -30
- package/dist/lib/converter/components.d.ts +2 -3
- package/dist/lib/converter/components.js +2 -7
- package/dist/lib/converter/context.d.ts +9 -9
- package/dist/lib/converter/context.js +54 -44
- package/dist/lib/converter/convert-expression.js +16 -23
- package/dist/lib/converter/converter-events.d.ts +1 -0
- package/dist/lib/converter/converter-events.js +2 -4
- package/dist/lib/converter/converter.d.ts +16 -13
- package/dist/lib/converter/converter.js +210 -238
- package/dist/lib/converter/factories/index-signature.d.ts +1 -1
- package/dist/lib/converter/factories/index-signature.js +11 -17
- package/dist/lib/converter/factories/signature.d.ts +2 -2
- package/dist/lib/converter/factories/signature.js +95 -106
- package/dist/lib/converter/index.d.ts +6 -7
- package/dist/lib/converter/index.js +3 -11
- package/dist/lib/converter/jsdoc.d.ts +1 -1
- package/dist/lib/converter/jsdoc.js +34 -41
- package/dist/lib/converter/plugins/CategoryPlugin.d.ts +6 -21
- package/dist/lib/converter/plugins/CategoryPlugin.js +57 -139
- package/dist/lib/converter/plugins/CommentPlugin.d.ts +3 -5
- package/dist/lib/converter/plugins/CommentPlugin.js +153 -163
- package/dist/lib/converter/plugins/GroupPlugin.d.ts +10 -9
- package/dist/lib/converter/plugins/GroupPlugin.js +87 -124
- package/dist/lib/converter/plugins/ImplementsPlugin.d.ts +3 -5
- package/dist/lib/converter/plugins/ImplementsPlugin.js +255 -321
- package/dist/lib/converter/plugins/IncludePlugin.d.ts +11 -0
- package/dist/lib/converter/plugins/IncludePlugin.js +72 -0
- package/dist/lib/converter/plugins/InheritDocPlugin.d.ts +4 -3
- package/dist/lib/converter/plugins/InheritDocPlugin.js +41 -72
- package/dist/lib/converter/plugins/LinkResolverPlugin.d.ts +5 -5
- package/dist/lib/converter/plugins/LinkResolverPlugin.js +37 -58
- package/dist/lib/converter/plugins/MergeModuleWithPlugin.d.ts +12 -0
- package/dist/lib/converter/plugins/MergeModuleWithPlugin.js +49 -0
- package/dist/lib/converter/plugins/PackagePlugin.d.ts +4 -3
- package/dist/lib/converter/plugins/PackagePlugin.js +62 -111
- package/dist/lib/converter/plugins/SourcePlugin.d.ts +3 -5
- package/dist/lib/converter/plugins/SourcePlugin.js +69 -110
- package/dist/lib/converter/plugins/TypePlugin.d.ts +4 -6
- package/dist/lib/converter/plugins/TypePlugin.js +95 -158
- package/dist/lib/converter/plugins/index.d.ts +10 -9
- package/dist/lib/converter/plugins/index.js +10 -21
- package/dist/lib/converter/symbols.d.ts +1 -1
- package/dist/lib/converter/symbols.js +234 -227
- package/dist/lib/converter/types.d.ts +2 -2
- package/dist/lib/converter/types.js +252 -237
- package/dist/lib/converter/utils/nodes.js +5 -13
- package/dist/lib/converter/utils/reflections.d.ts +1 -1
- package/dist/lib/converter/utils/reflections.js +4 -7
- package/dist/lib/converter/utils/repository.d.ts +1 -1
- package/dist/lib/converter/utils/repository.js +103 -97
- package/dist/lib/converter/utils/symbols.js +3 -9
- package/dist/lib/internationalization/index.d.ts +3 -4
- package/dist/lib/internationalization/index.js +3 -8
- package/dist/lib/internationalization/internationalization.d.ts +5 -4
- package/dist/lib/internationalization/internationalization.js +97 -103
- package/dist/lib/internationalization/locale-utils.cjs +8 -0
- package/dist/lib/internationalization/locale-utils.d.cts +8 -0
- package/dist/lib/internationalization/locales/en.cjs +366 -2
- package/dist/lib/internationalization/locales/en.d.cts +339 -2
- package/dist/lib/internationalization/locales/jp.cjs +8 -11
- package/dist/lib/internationalization/locales/jp.d.cts +310 -1
- package/dist/lib/internationalization/locales/ko.cjs +7 -9
- package/dist/lib/internationalization/locales/ko.d.cts +223 -1
- package/dist/lib/internationalization/locales/zh.cjs +7 -10
- package/dist/lib/internationalization/locales/zh.d.cts +381 -1
- package/dist/lib/internationalization/translatable.d.ts +4 -327
- package/dist/lib/internationalization/translatable.js +2 -360
- package/dist/lib/models/FileRegistry.d.ts +20 -9
- package/dist/lib/models/FileRegistry.js +54 -45
- package/dist/lib/models/ReflectionCategory.d.ts +2 -2
- package/dist/lib/models/ReflectionCategory.js +16 -12
- package/dist/lib/models/ReflectionGroup.d.ts +3 -3
- package/dist/lib/models/ReflectionGroup.js +23 -14
- package/dist/lib/models/comments/comment.d.ts +23 -37
- package/dist/lib/models/comments/comment.js +388 -325
- package/dist/lib/models/comments/index.d.ts +2 -2
- package/dist/lib/models/comments/index.js +1 -6
- package/dist/lib/models/index.d.ts +7 -7
- package/dist/lib/models/index.js +7 -23
- package/dist/lib/models/reflections/ReflectionSymbolId.d.ts +2 -2
- package/dist/lib/models/reflections/ReflectionSymbolId.js +42 -34
- package/dist/lib/models/reflections/abstract.d.ts +17 -20
- package/dist/lib/models/reflections/abstract.js +249 -256
- package/dist/lib/models/reflections/container.d.ts +7 -7
- package/dist/lib/models/reflections/container.js +43 -16
- package/dist/lib/models/reflections/declaration.d.ts +15 -12
- package/dist/lib/models/reflections/declaration.js +150 -29
- package/dist/lib/models/reflections/document.d.ts +3 -3
- package/dist/lib/models/reflections/document.js +26 -13
- package/dist/lib/models/reflections/index.d.ts +15 -15
- package/dist/lib/models/reflections/index.js +12 -31
- package/dist/lib/models/reflections/kind.d.ts +1 -1
- package/dist/lib/models/reflections/kind.js +3 -6
- package/dist/lib/models/reflections/parameter.d.ts +5 -4
- package/dist/lib/models/reflections/parameter.js +11 -13
- package/dist/lib/models/reflections/project.d.ts +14 -9
- package/dist/lib/models/reflections/project.js +104 -56
- package/dist/lib/models/reflections/reference.d.ts +3 -3
- package/dist/lib/models/reflections/reference.js +6 -9
- package/dist/lib/models/reflections/signature.d.ts +8 -8
- package/dist/lib/models/reflections/signature.js +35 -14
- package/dist/lib/models/reflections/type-parameter.d.ts +5 -5
- package/dist/lib/models/reflections/type-parameter.js +9 -10
- package/dist/lib/models/reflections/utils.js +1 -4
- package/dist/lib/models/reflections/variant.d.ts +8 -7
- package/dist/lib/models/reflections/variant.js +1 -2
- package/dist/lib/models/sources/file.d.ts +2 -2
- package/dist/lib/models/sources/file.js +22 -5
- package/dist/lib/models/sources/index.d.ts +1 -1
- package/dist/lib/models/sources/index.js +1 -5
- package/dist/lib/models/types.d.ts +26 -13
- package/dist/lib/models/types.js +236 -151
- package/dist/lib/output/components.d.ts +5 -11
- package/dist/lib/output/components.js +84 -125
- package/dist/lib/output/events.d.ts +3 -3
- package/dist/lib/output/events.js +128 -94
- package/dist/lib/output/formatter.d.ts +84 -0
- package/dist/lib/output/formatter.js +619 -0
- package/dist/lib/output/index.d.ts +9 -8
- package/dist/lib/output/index.js +7 -19
- package/dist/lib/output/models/UrlMapping.d.ts +2 -2
- package/dist/lib/output/models/UrlMapping.js +4 -5
- package/dist/lib/output/output.d.ts +13 -0
- package/dist/lib/output/output.js +72 -0
- package/dist/lib/output/plugins/AssetsPlugin.d.ts +7 -8
- package/dist/lib/output/plugins/AssetsPlugin.js +62 -80
- package/dist/lib/output/plugins/IconsPlugin.d.ts +3 -2
- package/dist/lib/output/plugins/IconsPlugin.js +28 -84
- package/dist/lib/output/plugins/JavascriptIndexPlugin.d.ts +9 -2
- package/dist/lib/output/plugins/JavascriptIndexPlugin.js +90 -96
- package/dist/lib/output/plugins/NavigationPlugin.d.ts +3 -2
- package/dist/lib/output/plugins/NavigationPlugin.js +22 -102
- package/dist/lib/output/plugins/SitemapPlugin.d.ts +3 -2
- package/dist/lib/output/plugins/SitemapPlugin.js +60 -120
- package/dist/lib/output/plugins/index.d.ts +6 -6
- package/dist/lib/output/plugins/index.js +6 -15
- package/dist/lib/output/renderer.d.ts +14 -13
- package/dist/lib/output/renderer.js +129 -185
- package/dist/lib/output/theme.d.ts +9 -5
- package/dist/lib/output/theme.js +14 -62
- package/dist/lib/output/themes/MarkedPlugin.d.ts +8 -9
- package/dist/lib/output/themes/MarkedPlugin.js +152 -117
- package/dist/lib/output/themes/default/DefaultTheme.d.ts +17 -29
- package/dist/lib/output/themes/default/DefaultTheme.js +334 -310
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +63 -48
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +119 -95
- package/dist/lib/output/themes/default/Slugger.d.ts +13 -0
- package/dist/lib/output/themes/default/Slugger.js +46 -0
- package/dist/lib/output/themes/default/layouts/default.d.ts +5 -5
- package/dist/lib/output/themes/default/layouts/default.js +67 -34
- package/dist/lib/output/themes/default/partials/anchor-icon.d.ts +2 -2
- package/dist/lib/output/themes/default/partials/anchor-icon.js +4 -7
- package/dist/lib/output/themes/default/partials/breadcrumb.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/breadcrumb.js +4 -8
- package/dist/lib/output/themes/default/partials/comment.d.ts +6 -4
- package/dist/lib/output/themes/default/partials/comment.js +52 -29
- package/dist/lib/output/themes/default/partials/footer.d.ts +2 -2
- package/dist/lib/output/themes/default/partials/footer.js +11 -14
- package/dist/lib/output/themes/default/partials/header.d.ts +4 -4
- package/dist/lib/output/themes/default/partials/header.js +9 -13
- package/dist/lib/output/themes/default/partials/hierarchy.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/hierarchy.js +9 -12
- package/dist/lib/output/themes/default/partials/icon.d.ts +4 -4
- package/dist/lib/output/themes/default/partials/icon.js +78 -73
- package/dist/lib/output/themes/default/partials/index.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/index.js +19 -22
- package/dist/lib/output/themes/default/partials/member.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.declaration.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.declaration.js +18 -61
- package/dist/lib/output/themes/default/partials/member.getterSetter.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.getterSetter.js +10 -26
- package/dist/lib/output/themes/default/partials/member.js +19 -24
- package/dist/lib/output/themes/default/partials/member.signature.body.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.signature.body.js +17 -21
- package/dist/lib/output/themes/default/partials/member.signature.title.d.ts +4 -7
- package/dist/lib/output/themes/default/partials/member.signature.title.js +8 -35
- package/dist/lib/output/themes/default/partials/member.signatures.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.signatures.js +9 -13
- package/dist/lib/output/themes/default/partials/member.sources.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.sources.js +13 -17
- package/dist/lib/output/themes/default/partials/members.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/members.js +10 -42
- package/dist/lib/output/themes/default/partials/moduleReflection.d.ts +5 -0
- package/dist/lib/output/themes/default/partials/moduleReflection.js +62 -0
- package/dist/lib/output/themes/default/partials/navigation.d.ts +4 -4
- package/dist/lib/output/themes/default/partials/navigation.js +51 -62
- package/dist/lib/output/themes/default/partials/reflectionPreview.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/reflectionPreview.js +12 -15
- package/dist/lib/output/themes/default/partials/toolbar.d.ts +4 -4
- package/dist/lib/output/themes/default/partials/toolbar.js +16 -20
- package/dist/lib/output/themes/default/partials/type.d.ts +4 -6
- package/dist/lib/output/themes/default/partials/type.js +8 -388
- package/dist/lib/output/themes/default/partials/typeAndParent.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/typeAndParent.js +11 -15
- package/dist/lib/output/themes/default/partials/typeDetails.d.ts +8 -0
- package/dist/lib/output/themes/default/partials/typeDetails.js +221 -0
- package/dist/lib/output/themes/default/partials/typeParameters.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/typeParameters.js +14 -17
- package/dist/lib/output/themes/default/templates/document.d.ts +4 -4
- package/dist/lib/output/themes/default/templates/document.js +3 -7
- package/dist/lib/output/themes/default/templates/hierarchy.d.ts +4 -4
- package/dist/lib/output/themes/default/templates/hierarchy.js +10 -13
- package/dist/lib/output/themes/default/templates/index.d.ts +4 -4
- package/dist/lib/output/themes/default/templates/index.js +3 -7
- package/dist/lib/output/themes/default/templates/reflection.d.ts +4 -4
- package/dist/lib/output/themes/default/templates/reflection.js +31 -34
- package/dist/lib/output/themes/lib.d.ts +17 -3
- package/dist/lib/output/themes/lib.js +110 -49
- package/dist/lib/serialization/components.d.ts +2 -5
- package/dist/lib/serialization/components.js +1 -2
- package/dist/lib/serialization/deserializer.d.ts +21 -7
- package/dist/lib/serialization/deserializer.js +138 -123
- package/dist/lib/serialization/events.d.ts +2 -2
- package/dist/lib/serialization/events.js +6 -5
- package/dist/lib/serialization/index.d.ts +5 -5
- package/dist/lib/serialization/index.js +4 -33
- package/dist/lib/serialization/schema.d.ts +8 -2
- package/dist/lib/serialization/schema.js +2 -2
- package/dist/lib/serialization/serializer.d.ts +11 -5
- package/dist/lib/serialization/serializer.js +32 -25
- package/dist/lib/utils/array.d.ts +3 -0
- package/dist/lib/utils/array.js +26 -27
- package/dist/lib/utils/component.d.ts +2 -44
- package/dist/lib/utils/component.js +10 -102
- package/dist/lib/utils/entry-point.d.ts +3 -4
- package/dist/lib/utils/entry-point.js +114 -85
- package/dist/lib/utils/enum.js +6 -14
- package/dist/lib/utils/events.js +6 -12
- package/dist/lib/utils/fs.js +50 -91
- package/dist/lib/utils/general.d.ts +2 -1
- package/dist/lib/utils/general.js +50 -40
- package/dist/lib/utils/highlighter.js +30 -57
- package/dist/lib/utils/hooks.js +7 -13
- package/dist/lib/utils/html-entities.d.ts +8926 -0
- package/dist/lib/utils/html-entities.js +2329 -0
- package/dist/lib/utils/html.d.ts +8 -0
- package/dist/lib/utils/html.js +81 -34
- package/dist/lib/utils/index.d.ts +22 -22
- package/dist/lib/utils/index.js +20 -91
- package/dist/lib/utils/jsx.d.ts +12 -5
- package/dist/lib/utils/jsx.elements.js +1 -4
- package/dist/lib/utils/jsx.js +53 -20
- package/dist/lib/utils/loggers.d.ts +3 -3
- package/dist/lib/utils/loggers.js +36 -46
- package/dist/lib/utils/map.d.ts +1 -1
- package/dist/lib/utils/map.js +6 -13
- package/dist/lib/utils/minimalSourceFile.js +5 -7
- package/dist/lib/utils/options/declaration.d.ts +33 -7
- package/dist/lib/utils/options/declaration.js +20 -22
- package/dist/lib/utils/options/defaults.d.ts +3 -2
- package/dist/lib/utils/options/defaults.js +18 -38
- package/dist/lib/utils/options/help.d.ts +2 -2
- package/dist/lib/utils/options/help.js +7 -10
- package/dist/lib/utils/options/index.d.ts +6 -6
- package/dist/lib/utils/options/index.js +4 -18
- package/dist/lib/utils/options/options.d.ts +8 -5
- package/dist/lib/utils/options/options.js +47 -71
- package/dist/lib/utils/options/readers/arguments.d.ts +2 -2
- package/dist/lib/utils/options/readers/arguments.js +15 -17
- package/dist/lib/utils/options/readers/index.d.ts +4 -4
- package/dist/lib/utils/options/readers/index.js +4 -11
- package/dist/lib/utils/options/readers/package-json.d.ts +3 -3
- package/dist/lib/utils/options/readers/package-json.js +15 -21
- package/dist/lib/utils/options/readers/tsconfig.d.ts +2 -2
- package/dist/lib/utils/options/readers/tsconfig.js +54 -63
- package/dist/lib/utils/options/readers/typedoc.d.ts +3 -3
- package/dist/lib/utils/options/readers/typedoc.js +47 -90
- package/dist/lib/utils/options/sources/index.d.ts +1 -1
- package/dist/lib/utils/options/sources/index.js +1 -5
- package/dist/lib/utils/options/sources/typedoc.d.ts +1 -1
- package/dist/lib/utils/options/sources/typedoc.js +220 -196
- package/dist/lib/utils/options/tsdoc-defaults.d.ts +3 -3
- package/dist/lib/utils/options/tsdoc-defaults.js +16 -12
- package/dist/lib/utils/package-manifest.d.ts +1 -1
- package/dist/lib/utils/package-manifest.js +15 -19
- package/dist/lib/utils/paths.js +9 -15
- package/dist/lib/utils/perf.js +6 -11
- package/dist/lib/utils/plugins.d.ts +1 -1
- package/dist/lib/utils/plugins.js +16 -17
- package/dist/lib/utils/reflections.d.ts +1 -1
- package/dist/lib/utils/reflections.js +9 -12
- package/dist/lib/utils/set.js +2 -6
- package/dist/lib/utils/sort.d.ts +3 -3
- package/dist/lib/utils/sort.js +20 -24
- package/dist/lib/utils/tsconfig.d.ts +1 -1
- package/dist/lib/utils/tsconfig.js +13 -21
- package/dist/lib/utils/tsutils.d.ts +1 -1
- package/dist/lib/utils/tsutils.js +3 -30
- package/dist/lib/utils/validation.js +6 -12
- package/dist/lib/validation/documentation.d.ts +2 -2
- package/dist/lib/validation/documentation.js +26 -29
- package/dist/lib/validation/exports.d.ts +2 -2
- package/dist/lib/validation/exports.js +9 -11
- package/dist/lib/validation/links.d.ts +2 -2
- package/dist/lib/validation/links.js +4 -7
- package/dist/lib/validation/unusedMergeModuleWith.d.ts +3 -0
- package/dist/lib/validation/unusedMergeModuleWith.js +11 -0
- package/package.json +14 -11
- package/static/main.js +4 -4
- package/static/style.css +91 -2
- package/tsdoc.json +30 -0
- package/dist/lib/output/themes/default/partials/member.reference.d.ts +0 -4
- package/dist/lib/output/themes/default/partials/member.reference.js +0 -30
- package/dist/lib/output/themes/default/partials/parameter.d.ts +0 -4
- package/dist/lib/output/themes/default/partials/parameter.js +0 -79
- package/dist/lib/utils/html-entities.json +0 -2326
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
2
|
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
3
|
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
@@ -33,29 +32,12 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
33
32
|
}
|
|
34
33
|
return useValue ? value : void 0;
|
|
35
34
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
43
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
44
|
-
};
|
|
45
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
46
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
47
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
48
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
49
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
50
|
-
};
|
|
51
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
-
exports.CommentPlugin = void 0;
|
|
53
|
-
const components_1 = require("../components");
|
|
54
|
-
const converter_1 = require("../converter");
|
|
55
|
-
const models_1 = require("../../models");
|
|
56
|
-
const utils_1 = require("../../utils");
|
|
57
|
-
const CategoryPlugin_1 = require("./CategoryPlugin");
|
|
58
|
-
const set_1 = require("../../utils/set");
|
|
35
|
+
import { Comment, CommentTag, DeclarationReflection, ParameterReflection, ReflectionFlag, ReflectionKind, ReflectionType, SignatureReflection, } from "../../models/index.js";
|
|
36
|
+
import { Option, filterMap, partition, removeIf, removeIfPresent, unique, } from "../../utils/index.js";
|
|
37
|
+
import { setIntersection } from "../../utils/set.js";
|
|
38
|
+
import { ConverterComponent } from "../components.js";
|
|
39
|
+
import { ConverterEvents } from "../converter-events.js";
|
|
40
|
+
import { CategoryPlugin } from "./CategoryPlugin.js";
|
|
59
41
|
/**
|
|
60
42
|
* These tags are not useful to display in the generated documentation.
|
|
61
43
|
* They should be ignored when parsing comments. Any relevant type information
|
|
@@ -146,12 +128,7 @@ const MUTUALLY_EXCLUSIVE_MODIFIERS = [
|
|
|
146
128
|
*
|
|
147
129
|
*/
|
|
148
130
|
let CommentPlugin = (() => {
|
|
149
|
-
|
|
150
|
-
let _classDecorators = [(0, components_1.Component)({ name: "comment" })];
|
|
151
|
-
let _classDescriptor;
|
|
152
|
-
let _classExtraInitializers = [];
|
|
153
|
-
let _classThis;
|
|
154
|
-
let _classSuper = components_1.ConverterComponent;
|
|
131
|
+
let _classSuper = ConverterComponent;
|
|
155
132
|
let _excludeTags_decorators;
|
|
156
133
|
let _excludeTags_initializers = [];
|
|
157
134
|
let _excludeTags_extraInitializers = [];
|
|
@@ -176,51 +153,66 @@ let CommentPlugin = (() => {
|
|
|
176
153
|
let _defaultCategory_decorators;
|
|
177
154
|
let _defaultCategory_initializers = [];
|
|
178
155
|
let _defaultCategory_extraInitializers = [];
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
this.
|
|
156
|
+
return class CommentPlugin extends _classSuper {
|
|
157
|
+
static {
|
|
158
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
159
|
+
_excludeTags_decorators = [Option("excludeTags")];
|
|
160
|
+
_cascadedModifierTags_decorators = [Option("cascadedModifierTags")];
|
|
161
|
+
_excludeInternal_decorators = [Option("excludeInternal")];
|
|
162
|
+
_excludePrivate_decorators = [Option("excludePrivate")];
|
|
163
|
+
_excludeProtected_decorators = [Option("excludeProtected")];
|
|
164
|
+
_excludeNotDocumented_decorators = [Option("excludeNotDocumented")];
|
|
165
|
+
_excludeCategories_decorators = [Option("excludeCategories")];
|
|
166
|
+
_defaultCategory_decorators = [Option("defaultCategory")];
|
|
167
|
+
__esDecorate(this, null, _excludeTags_decorators, { kind: "accessor", name: "excludeTags", static: false, private: false, access: { has: obj => "excludeTags" in obj, get: obj => obj.excludeTags, set: (obj, value) => { obj.excludeTags = value; } }, metadata: _metadata }, _excludeTags_initializers, _excludeTags_extraInitializers);
|
|
168
|
+
__esDecorate(this, null, _cascadedModifierTags_decorators, { kind: "accessor", name: "cascadedModifierTags", static: false, private: false, access: { has: obj => "cascadedModifierTags" in obj, get: obj => obj.cascadedModifierTags, set: (obj, value) => { obj.cascadedModifierTags = value; } }, metadata: _metadata }, _cascadedModifierTags_initializers, _cascadedModifierTags_extraInitializers);
|
|
169
|
+
__esDecorate(this, null, _excludeInternal_decorators, { kind: "accessor", name: "excludeInternal", static: false, private: false, access: { has: obj => "excludeInternal" in obj, get: obj => obj.excludeInternal, set: (obj, value) => { obj.excludeInternal = value; } }, metadata: _metadata }, _excludeInternal_initializers, _excludeInternal_extraInitializers);
|
|
170
|
+
__esDecorate(this, null, _excludePrivate_decorators, { kind: "accessor", name: "excludePrivate", static: false, private: false, access: { has: obj => "excludePrivate" in obj, get: obj => obj.excludePrivate, set: (obj, value) => { obj.excludePrivate = value; } }, metadata: _metadata }, _excludePrivate_initializers, _excludePrivate_extraInitializers);
|
|
171
|
+
__esDecorate(this, null, _excludeProtected_decorators, { kind: "accessor", name: "excludeProtected", static: false, private: false, access: { has: obj => "excludeProtected" in obj, get: obj => obj.excludeProtected, set: (obj, value) => { obj.excludeProtected = value; } }, metadata: _metadata }, _excludeProtected_initializers, _excludeProtected_extraInitializers);
|
|
172
|
+
__esDecorate(this, null, _excludeNotDocumented_decorators, { kind: "accessor", name: "excludeNotDocumented", static: false, private: false, access: { has: obj => "excludeNotDocumented" in obj, get: obj => obj.excludeNotDocumented, set: (obj, value) => { obj.excludeNotDocumented = value; } }, metadata: _metadata }, _excludeNotDocumented_initializers, _excludeNotDocumented_extraInitializers);
|
|
173
|
+
__esDecorate(this, null, _excludeCategories_decorators, { kind: "accessor", name: "excludeCategories", static: false, private: false, access: { has: obj => "excludeCategories" in obj, get: obj => obj.excludeCategories, set: (obj, value) => { obj.excludeCategories = value; } }, metadata: _metadata }, _excludeCategories_initializers, _excludeCategories_extraInitializers);
|
|
174
|
+
__esDecorate(this, null, _defaultCategory_decorators, { kind: "accessor", name: "defaultCategory", static: false, private: false, access: { has: obj => "defaultCategory" in obj, get: obj => obj.defaultCategory, set: (obj, value) => { obj.defaultCategory = value; } }, metadata: _metadata }, _defaultCategory_initializers, _defaultCategory_extraInitializers);
|
|
175
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
191
176
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
get
|
|
197
|
-
set
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
get
|
|
203
|
-
set
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
177
|
+
#excludeTags_accessor_storage = __runInitializers(this, _excludeTags_initializers, void 0);
|
|
178
|
+
get excludeTags() { return this.#excludeTags_accessor_storage; }
|
|
179
|
+
set excludeTags(value) { this.#excludeTags_accessor_storage = value; }
|
|
180
|
+
#cascadedModifierTags_accessor_storage = (__runInitializers(this, _excludeTags_extraInitializers), __runInitializers(this, _cascadedModifierTags_initializers, void 0));
|
|
181
|
+
get cascadedModifierTags() { return this.#cascadedModifierTags_accessor_storage; }
|
|
182
|
+
set cascadedModifierTags(value) { this.#cascadedModifierTags_accessor_storage = value; }
|
|
183
|
+
#excludeInternal_accessor_storage = (__runInitializers(this, _cascadedModifierTags_extraInitializers), __runInitializers(this, _excludeInternal_initializers, void 0));
|
|
184
|
+
get excludeInternal() { return this.#excludeInternal_accessor_storage; }
|
|
185
|
+
set excludeInternal(value) { this.#excludeInternal_accessor_storage = value; }
|
|
186
|
+
#excludePrivate_accessor_storage = (__runInitializers(this, _excludeInternal_extraInitializers), __runInitializers(this, _excludePrivate_initializers, void 0));
|
|
187
|
+
get excludePrivate() { return this.#excludePrivate_accessor_storage; }
|
|
188
|
+
set excludePrivate(value) { this.#excludePrivate_accessor_storage = value; }
|
|
189
|
+
#excludeProtected_accessor_storage = (__runInitializers(this, _excludePrivate_extraInitializers), __runInitializers(this, _excludeProtected_initializers, void 0));
|
|
190
|
+
get excludeProtected() { return this.#excludeProtected_accessor_storage; }
|
|
191
|
+
set excludeProtected(value) { this.#excludeProtected_accessor_storage = value; }
|
|
192
|
+
#excludeNotDocumented_accessor_storage = (__runInitializers(this, _excludeProtected_extraInitializers), __runInitializers(this, _excludeNotDocumented_initializers, void 0));
|
|
193
|
+
get excludeNotDocumented() { return this.#excludeNotDocumented_accessor_storage; }
|
|
194
|
+
set excludeNotDocumented(value) { this.#excludeNotDocumented_accessor_storage = value; }
|
|
195
|
+
#excludeCategories_accessor_storage = (__runInitializers(this, _excludeNotDocumented_extraInitializers), __runInitializers(this, _excludeCategories_initializers, void 0));
|
|
196
|
+
get excludeCategories() { return this.#excludeCategories_accessor_storage; }
|
|
197
|
+
set excludeCategories(value) { this.#excludeCategories_accessor_storage = value; }
|
|
198
|
+
#defaultCategory_accessor_storage = (__runInitializers(this, _excludeCategories_extraInitializers), __runInitializers(this, _defaultCategory_initializers, void 0));
|
|
199
|
+
get defaultCategory() { return this.#defaultCategory_accessor_storage; }
|
|
200
|
+
set defaultCategory(value) { this.#defaultCategory_accessor_storage = value; }
|
|
201
|
+
_excludeKinds = __runInitializers(this, _defaultCategory_extraInitializers);
|
|
208
202
|
get excludeNotDocumentedKinds() {
|
|
209
203
|
this._excludeKinds ??= this.application.options
|
|
210
204
|
.getValue("excludeNotDocumentedKinds")
|
|
211
|
-
.reduce((a, b) => a |
|
|
205
|
+
.reduce((a, b) => a | ReflectionKind[b], 0);
|
|
212
206
|
return this._excludeKinds;
|
|
213
207
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
this.owner.on(
|
|
219
|
-
this.owner.on(
|
|
220
|
-
this.owner.on(
|
|
221
|
-
this.owner.on(
|
|
222
|
-
this.owner.on(converter_1.Converter.EVENT_RESOLVE, this.onResolve.bind(this));
|
|
223
|
-
this.owner.on(converter_1.Converter.EVENT_END, () => {
|
|
208
|
+
constructor(owner) {
|
|
209
|
+
super(owner);
|
|
210
|
+
this.owner.on(ConverterEvents.CREATE_DECLARATION, this.onDeclaration.bind(this));
|
|
211
|
+
this.owner.on(ConverterEvents.CREATE_SIGNATURE, this.onDeclaration.bind(this));
|
|
212
|
+
this.owner.on(ConverterEvents.CREATE_TYPE_PARAMETER, this.onCreateTypeParameter.bind(this));
|
|
213
|
+
this.owner.on(ConverterEvents.RESOLVE_BEGIN, this.onBeginResolve.bind(this));
|
|
214
|
+
this.owner.on(ConverterEvents.RESOLVE, this.onResolve.bind(this));
|
|
215
|
+
this.owner.on(ConverterEvents.END, () => {
|
|
224
216
|
this._excludeKinds = undefined;
|
|
225
217
|
});
|
|
226
218
|
}
|
|
@@ -231,56 +223,56 @@ let CommentPlugin = (() => {
|
|
|
231
223
|
* @param comment The comment that should be searched for modifiers.
|
|
232
224
|
*/
|
|
233
225
|
applyModifiers(reflection, comment) {
|
|
234
|
-
if (reflection.kindOf(
|
|
226
|
+
if (reflection.kindOf(ReflectionKind.SomeModule)) {
|
|
235
227
|
comment.removeModifier("@namespace");
|
|
236
228
|
}
|
|
237
|
-
if (reflection.kindOf(
|
|
229
|
+
if (reflection.kindOf(ReflectionKind.Interface)) {
|
|
238
230
|
comment.removeModifier("@interface");
|
|
239
231
|
}
|
|
240
232
|
if (comment.hasModifier("@abstract")) {
|
|
241
|
-
if (reflection.kindOf(
|
|
242
|
-
reflection.parent.setFlag(
|
|
233
|
+
if (reflection.kindOf(ReflectionKind.SomeSignature)) {
|
|
234
|
+
reflection.parent.setFlag(ReflectionFlag.Abstract);
|
|
243
235
|
}
|
|
244
236
|
else {
|
|
245
|
-
reflection.setFlag(
|
|
237
|
+
reflection.setFlag(ReflectionFlag.Abstract);
|
|
246
238
|
}
|
|
247
239
|
comment.removeModifier("@abstract");
|
|
248
240
|
}
|
|
249
241
|
if (comment.hasModifier("@private")) {
|
|
250
|
-
reflection.setFlag(
|
|
251
|
-
if (reflection.kindOf(
|
|
252
|
-
reflection.parent?.setFlag(
|
|
242
|
+
reflection.setFlag(ReflectionFlag.Private);
|
|
243
|
+
if (reflection.kindOf(ReflectionKind.CallSignature)) {
|
|
244
|
+
reflection.parent?.setFlag(ReflectionFlag.Private);
|
|
253
245
|
}
|
|
254
246
|
comment.removeModifier("@private");
|
|
255
247
|
}
|
|
256
248
|
if (comment.hasModifier("@protected")) {
|
|
257
|
-
reflection.setFlag(
|
|
258
|
-
if (reflection.kindOf(
|
|
259
|
-
reflection.parent?.setFlag(
|
|
249
|
+
reflection.setFlag(ReflectionFlag.Protected);
|
|
250
|
+
if (reflection.kindOf(ReflectionKind.CallSignature)) {
|
|
251
|
+
reflection.parent?.setFlag(ReflectionFlag.Protected);
|
|
260
252
|
}
|
|
261
253
|
comment.removeModifier("@protected");
|
|
262
254
|
}
|
|
263
255
|
if (comment.hasModifier("@public")) {
|
|
264
|
-
reflection.setFlag(
|
|
265
|
-
if (reflection.kindOf(
|
|
266
|
-
reflection.parent?.setFlag(
|
|
256
|
+
reflection.setFlag(ReflectionFlag.Public);
|
|
257
|
+
if (reflection.kindOf(ReflectionKind.CallSignature)) {
|
|
258
|
+
reflection.parent?.setFlag(ReflectionFlag.Public);
|
|
267
259
|
}
|
|
268
260
|
comment.removeModifier("@public");
|
|
269
261
|
}
|
|
270
262
|
if (comment.hasModifier("@readonly")) {
|
|
271
|
-
const target = reflection.kindOf(
|
|
263
|
+
const target = reflection.kindOf(ReflectionKind.GetSignature)
|
|
272
264
|
? reflection.parent
|
|
273
265
|
: reflection;
|
|
274
|
-
target.setFlag(
|
|
266
|
+
target.setFlag(ReflectionFlag.Readonly);
|
|
275
267
|
comment.removeModifier("@readonly");
|
|
276
268
|
}
|
|
277
269
|
if (comment.hasModifier("@event") ||
|
|
278
270
|
comment.hasModifier("@eventProperty")) {
|
|
279
|
-
comment.blockTags.push(new
|
|
271
|
+
comment.blockTags.push(new CommentTag("@group", [{ kind: "text", text: "Events" }]));
|
|
280
272
|
comment.removeModifier("@event");
|
|
281
273
|
comment.removeModifier("@eventProperty");
|
|
282
274
|
}
|
|
283
|
-
if (reflection.kindOf(
|
|
275
|
+
if (reflection.kindOf(ReflectionKind.Project | ReflectionKind.SomeModule)) {
|
|
284
276
|
comment.removeTags("@module");
|
|
285
277
|
comment.removeModifier("@packageDocumentation");
|
|
286
278
|
}
|
|
@@ -305,9 +297,9 @@ let CommentPlugin = (() => {
|
|
|
305
297
|
tag = comment.getIdentifiedTag(reflection.name, "@param");
|
|
306
298
|
}
|
|
307
299
|
if (tag) {
|
|
308
|
-
reflection.comment = new
|
|
300
|
+
reflection.comment = new Comment(tag.content);
|
|
309
301
|
reflection.comment.sourcePath = comment.sourcePath;
|
|
310
|
-
|
|
302
|
+
removeIfPresent(comment.blockTags, tag);
|
|
311
303
|
}
|
|
312
304
|
}
|
|
313
305
|
}
|
|
@@ -325,16 +317,16 @@ let CommentPlugin = (() => {
|
|
|
325
317
|
const comment = reflection.comment;
|
|
326
318
|
if (!comment)
|
|
327
319
|
return;
|
|
328
|
-
if (reflection.kindOf(
|
|
320
|
+
if (reflection.kindOf(ReflectionKind.SomeModule)) {
|
|
329
321
|
const tag = comment.getTag("@module");
|
|
330
322
|
if (tag) {
|
|
331
323
|
// If no name is specified, this is a flag to mark a comment as a module comment
|
|
332
324
|
// and should not result in a reflection rename.
|
|
333
|
-
const newName =
|
|
325
|
+
const newName = Comment.combineDisplayParts(tag.content).trim();
|
|
334
326
|
if (newName.length && !newName.includes("\n")) {
|
|
335
327
|
reflection.name = newName;
|
|
336
328
|
}
|
|
337
|
-
|
|
329
|
+
removeIfPresent(comment.blockTags, tag);
|
|
338
330
|
}
|
|
339
331
|
}
|
|
340
332
|
this.applyModifiers(reflection, comment);
|
|
@@ -355,13 +347,13 @@ let CommentPlugin = (() => {
|
|
|
355
347
|
// Remove hidden reflections
|
|
356
348
|
const hidden = new Set();
|
|
357
349
|
for (const ref of reflections) {
|
|
358
|
-
if (ref.kindOf(
|
|
350
|
+
if (ref.kindOf(ReflectionKind.Accessor) && ref.flags.isReadonly) {
|
|
359
351
|
const decl = ref;
|
|
360
352
|
if (decl.setSignature) {
|
|
361
353
|
hidden.add(decl.setSignature);
|
|
362
354
|
}
|
|
363
355
|
// Clear flag set by @readonly since it shouldn't be rendered.
|
|
364
|
-
ref.setFlag(
|
|
356
|
+
ref.setFlag(ReflectionFlag.Readonly, false);
|
|
365
357
|
}
|
|
366
358
|
if (this.isHidden(ref)) {
|
|
367
359
|
hidden.add(ref);
|
|
@@ -369,7 +361,7 @@ let CommentPlugin = (() => {
|
|
|
369
361
|
}
|
|
370
362
|
hidden.forEach((reflection) => project.removeReflection(reflection));
|
|
371
363
|
// remove functions with empty signatures after their signatures have been removed
|
|
372
|
-
const [allRemoved, someRemoved] =
|
|
364
|
+
const [allRemoved, someRemoved] = partition(unique(filterMap(hidden, (reflection) => reflection.parent?.kindOf(ReflectionKind.SignatureContainer)
|
|
373
365
|
? reflection.parent
|
|
374
366
|
: void 0)), (method) => method.getNonIndexSignatures().length === 0);
|
|
375
367
|
allRemoved.forEach((reflection) => {
|
|
@@ -400,7 +392,7 @@ let CommentPlugin = (() => {
|
|
|
400
392
|
context.logger.warn(context.i18n.label_0_for_1_cannot_be_referenced(reflection.comment.label, reflection.getFriendlyFullName()));
|
|
401
393
|
}
|
|
402
394
|
for (const group of MUTUALLY_EXCLUSIVE_MODIFIERS) {
|
|
403
|
-
const intersect =
|
|
395
|
+
const intersect = setIntersection(group, reflection.comment.modifierTags);
|
|
404
396
|
if (intersect.size > 1) {
|
|
405
397
|
const [a, b] = intersect;
|
|
406
398
|
context.logger.warn(context.i18n.modifier_tag_0_is_mutually_exclusive_with_1_in_comment_for_2(a, b, reflection.getFriendlyFullName()));
|
|
@@ -411,18 +403,18 @@ let CommentPlugin = (() => {
|
|
|
411
403
|
// Unlike other modifiers, this one has to wait until resolution to be removed
|
|
412
404
|
// as it needs to remain present so that it can be checked when `@hidden` tags are
|
|
413
405
|
// being processed.
|
|
414
|
-
if (reflection.kindOf(
|
|
406
|
+
if (reflection.kindOf(ReflectionKind.Class)) {
|
|
415
407
|
reflection.comment.removeModifier("@hideconstructor");
|
|
416
408
|
}
|
|
417
409
|
}
|
|
418
|
-
if ((reflection instanceof
|
|
419
|
-
reflection instanceof
|
|
410
|
+
if ((reflection instanceof DeclarationReflection ||
|
|
411
|
+
reflection instanceof ParameterReflection) &&
|
|
420
412
|
reflection.comment) {
|
|
421
413
|
let sigs = [];
|
|
422
|
-
if (reflection.type instanceof
|
|
414
|
+
if (reflection.type instanceof ReflectionType) {
|
|
423
415
|
sigs = reflection.type.declaration.getNonIndexSignatures();
|
|
424
416
|
}
|
|
425
|
-
else if (reflection instanceof
|
|
417
|
+
else if (reflection instanceof DeclarationReflection) {
|
|
426
418
|
sigs = reflection.getNonIndexSignatures();
|
|
427
419
|
}
|
|
428
420
|
// For variables and properties, the symbol might own the comment but we might also
|
|
@@ -432,7 +424,7 @@ let CommentPlugin = (() => {
|
|
|
432
424
|
this.moveSignatureParamComments(sigs[0], reflection.comment);
|
|
433
425
|
const returnsTag = reflection.comment.getTag("@returns");
|
|
434
426
|
if (returnsTag) {
|
|
435
|
-
sigs[0].comment = new
|
|
427
|
+
sigs[0].comment = new Comment();
|
|
436
428
|
sigs[0].comment.sourcePath = reflection.comment.sourcePath;
|
|
437
429
|
sigs[0].comment.blockTags.push(returnsTag);
|
|
438
430
|
reflection.comment.removeTags("@returns");
|
|
@@ -446,7 +438,7 @@ let CommentPlugin = (() => {
|
|
|
446
438
|
}
|
|
447
439
|
}
|
|
448
440
|
}
|
|
449
|
-
if (reflection instanceof
|
|
441
|
+
if (reflection instanceof SignatureReflection) {
|
|
450
442
|
this.moveSignatureParamComments(reflection);
|
|
451
443
|
}
|
|
452
444
|
}
|
|
@@ -463,7 +455,7 @@ let CommentPlugin = (() => {
|
|
|
463
455
|
}
|
|
464
456
|
const tag = comment.getIdentifiedTag(parameter.name, "@param");
|
|
465
457
|
if (tag) {
|
|
466
|
-
parameter.comment = new
|
|
458
|
+
parameter.comment = new Comment(Comment.cloneDisplayParts(tag.content));
|
|
467
459
|
parameter.comment.sourcePath = comment.sourcePath;
|
|
468
460
|
}
|
|
469
461
|
});
|
|
@@ -472,7 +464,7 @@ let CommentPlugin = (() => {
|
|
|
472
464
|
comment.getIdentifiedTag(parameter.name, "@template") ||
|
|
473
465
|
comment.getIdentifiedTag(`<${parameter.name}>`, "@param");
|
|
474
466
|
if (tag) {
|
|
475
|
-
parameter.comment = new
|
|
467
|
+
parameter.comment = new Comment(Comment.cloneDisplayParts(tag.content));
|
|
476
468
|
parameter.comment.sourcePath = comment.sourcePath;
|
|
477
469
|
}
|
|
478
470
|
}
|
|
@@ -501,7 +493,7 @@ let CommentPlugin = (() => {
|
|
|
501
493
|
const exclusiveSet = MUTUALLY_EXCLUSIVE_MODIFIERS.find((tags) => tags.has(mod));
|
|
502
494
|
if (!exclusiveSet ||
|
|
503
495
|
Array.from(exclusiveSet).every((tag) => !childMods.has(tag))) {
|
|
504
|
-
reflection.comment ||= new
|
|
496
|
+
reflection.comment ||= new Comment();
|
|
505
497
|
reflection.comment.modifierTags.add(mod);
|
|
506
498
|
}
|
|
507
499
|
}
|
|
@@ -514,24 +506,24 @@ let CommentPlugin = (() => {
|
|
|
514
506
|
*/
|
|
515
507
|
isHidden(reflection) {
|
|
516
508
|
const comment = reflection.comment;
|
|
517
|
-
if (reflection.flags.hasFlag(
|
|
509
|
+
if (reflection.flags.hasFlag(ReflectionFlag.Private) &&
|
|
518
510
|
this.excludePrivate) {
|
|
519
511
|
return true;
|
|
520
512
|
}
|
|
521
|
-
if (reflection.flags.hasFlag(
|
|
513
|
+
if (reflection.flags.hasFlag(ReflectionFlag.Protected) &&
|
|
522
514
|
this.excludeProtected) {
|
|
523
515
|
return true;
|
|
524
516
|
}
|
|
525
517
|
if (this.excludedByCategory(reflection)) {
|
|
526
518
|
return true;
|
|
527
519
|
}
|
|
528
|
-
if (reflection.kindOf(
|
|
529
|
-
|
|
520
|
+
if (reflection.kindOf(ReflectionKind.ConstructorSignature |
|
|
521
|
+
ReflectionKind.Constructor)) {
|
|
530
522
|
if (comment?.hasModifier("@hideconstructor"))
|
|
531
523
|
return true;
|
|
532
|
-
const cls = reflection.parent?.kindOf(
|
|
524
|
+
const cls = reflection.parent?.kindOf(ReflectionKind.Class)
|
|
533
525
|
? reflection.parent
|
|
534
|
-
: reflection.parent?.parent?.kindOf(
|
|
526
|
+
: reflection.parent?.parent?.kindOf(ReflectionKind.Class)
|
|
535
527
|
? reflection.parent.parent
|
|
536
528
|
: undefined;
|
|
537
529
|
if (cls?.comment?.hasModifier("@hideconstructor")) {
|
|
@@ -541,29 +533,29 @@ let CommentPlugin = (() => {
|
|
|
541
533
|
if (!comment) {
|
|
542
534
|
// We haven't moved comments from the parent for signatures without a direct
|
|
543
535
|
// comment, so don't exclude those due to not being documented.
|
|
544
|
-
if (reflection.kindOf(
|
|
545
|
-
|
|
536
|
+
if (reflection.kindOf(ReflectionKind.CallSignature |
|
|
537
|
+
ReflectionKind.ConstructorSignature) &&
|
|
546
538
|
reflection.parent?.comment) {
|
|
547
539
|
return false;
|
|
548
540
|
}
|
|
549
541
|
if (this.excludeNotDocumented) {
|
|
550
542
|
// Don't let excludeNotDocumented remove parameters.
|
|
551
|
-
if (!(reflection instanceof
|
|
552
|
-
!(reflection instanceof
|
|
543
|
+
if (!(reflection instanceof DeclarationReflection) &&
|
|
544
|
+
!(reflection instanceof SignatureReflection)) {
|
|
553
545
|
return false;
|
|
554
546
|
}
|
|
555
547
|
if (!reflection.kindOf(this.excludeNotDocumentedKinds)) {
|
|
556
548
|
return false;
|
|
557
549
|
}
|
|
558
550
|
// excludeNotDocumented should hide a module only if it has no visible children
|
|
559
|
-
if (reflection.kindOf(
|
|
551
|
+
if (reflection.kindOf(ReflectionKind.SomeModule)) {
|
|
560
552
|
if (!reflection.children) {
|
|
561
553
|
return true;
|
|
562
554
|
}
|
|
563
555
|
return reflection.children.every((child) => this.isHidden(child));
|
|
564
556
|
}
|
|
565
557
|
// signature containers should only be hidden if all their signatures are hidden
|
|
566
|
-
if (reflection.kindOf(
|
|
558
|
+
if (reflection.kindOf(ReflectionKind.SignatureContainer)) {
|
|
567
559
|
return reflection
|
|
568
560
|
.getAllSignatures()
|
|
569
561
|
.every((child) => this.isHidden(child));
|
|
@@ -577,7 +569,7 @@ let CommentPlugin = (() => {
|
|
|
577
569
|
comment.hasModifier("@ignore") ||
|
|
578
570
|
(comment.hasModifier("@internal") && this.excludeInternal);
|
|
579
571
|
if (!isHidden &&
|
|
580
|
-
reflection.kindOf(
|
|
572
|
+
reflection.kindOf(ReflectionKind.ContainsCallSignatures)) {
|
|
581
573
|
return reflection
|
|
582
574
|
.getNonIndexSignatures()
|
|
583
575
|
.every((sig) => this.isHidden(sig));
|
|
@@ -587,15 +579,15 @@ let CommentPlugin = (() => {
|
|
|
587
579
|
excludedByCategory(reflection) {
|
|
588
580
|
const excludeCategories = this.excludeCategories;
|
|
589
581
|
let target;
|
|
590
|
-
if (reflection instanceof
|
|
582
|
+
if (reflection instanceof DeclarationReflection) {
|
|
591
583
|
target = reflection;
|
|
592
584
|
}
|
|
593
|
-
else if (reflection instanceof
|
|
585
|
+
else if (reflection instanceof SignatureReflection) {
|
|
594
586
|
target = reflection.parent;
|
|
595
587
|
}
|
|
596
588
|
if (!target || !excludeCategories.length)
|
|
597
589
|
return false;
|
|
598
|
-
const categories =
|
|
590
|
+
const categories = CategoryPlugin.getCategories(target);
|
|
599
591
|
if (categories.size === 0) {
|
|
600
592
|
categories.add(this.defaultCategory);
|
|
601
593
|
}
|
|
@@ -603,7 +595,7 @@ let CommentPlugin = (() => {
|
|
|
603
595
|
}
|
|
604
596
|
validateParamTags(signature, comment, params) {
|
|
605
597
|
const paramTags = comment.blockTags.filter((tag) => tag.tag === "@param");
|
|
606
|
-
|
|
598
|
+
removeIf(paramTags, (tag) => params.some((param) => param.name === tag.name));
|
|
607
599
|
moveNestedParamTags(/* in-out */ paramTags, params, comment.sourcePath);
|
|
608
600
|
if (!comment.inheritedFromParentDeclaration) {
|
|
609
601
|
for (const tag of paramTags) {
|
|
@@ -612,50 +604,33 @@ let CommentPlugin = (() => {
|
|
|
612
604
|
}
|
|
613
605
|
}
|
|
614
606
|
};
|
|
615
|
-
_CommentPlugin_excludeTags_accessor_storage = new WeakMap();
|
|
616
|
-
_CommentPlugin_cascadedModifierTags_accessor_storage = new WeakMap();
|
|
617
|
-
_CommentPlugin_excludeInternal_accessor_storage = new WeakMap();
|
|
618
|
-
_CommentPlugin_excludePrivate_accessor_storage = new WeakMap();
|
|
619
|
-
_CommentPlugin_excludeProtected_accessor_storage = new WeakMap();
|
|
620
|
-
_CommentPlugin_excludeNotDocumented_accessor_storage = new WeakMap();
|
|
621
|
-
_CommentPlugin_excludeCategories_accessor_storage = new WeakMap();
|
|
622
|
-
_CommentPlugin_defaultCategory_accessor_storage = new WeakMap();
|
|
623
|
-
__setFunctionName(_classThis, "CommentPlugin");
|
|
624
|
-
(() => {
|
|
625
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
626
|
-
_excludeTags_decorators = [(0, utils_1.Option)("excludeTags")];
|
|
627
|
-
_cascadedModifierTags_decorators = [(0, utils_1.Option)("cascadedModifierTags")];
|
|
628
|
-
_excludeInternal_decorators = [(0, utils_1.Option)("excludeInternal")];
|
|
629
|
-
_excludePrivate_decorators = [(0, utils_1.Option)("excludePrivate")];
|
|
630
|
-
_excludeProtected_decorators = [(0, utils_1.Option)("excludeProtected")];
|
|
631
|
-
_excludeNotDocumented_decorators = [(0, utils_1.Option)("excludeNotDocumented")];
|
|
632
|
-
_excludeCategories_decorators = [(0, utils_1.Option)("excludeCategories")];
|
|
633
|
-
_defaultCategory_decorators = [(0, utils_1.Option)("defaultCategory")];
|
|
634
|
-
__esDecorate(_classThis, null, _excludeTags_decorators, { kind: "accessor", name: "excludeTags", static: false, private: false, access: { has: obj => "excludeTags" in obj, get: obj => obj.excludeTags, set: (obj, value) => { obj.excludeTags = value; } }, metadata: _metadata }, _excludeTags_initializers, _excludeTags_extraInitializers);
|
|
635
|
-
__esDecorate(_classThis, null, _cascadedModifierTags_decorators, { kind: "accessor", name: "cascadedModifierTags", static: false, private: false, access: { has: obj => "cascadedModifierTags" in obj, get: obj => obj.cascadedModifierTags, set: (obj, value) => { obj.cascadedModifierTags = value; } }, metadata: _metadata }, _cascadedModifierTags_initializers, _cascadedModifierTags_extraInitializers);
|
|
636
|
-
__esDecorate(_classThis, null, _excludeInternal_decorators, { kind: "accessor", name: "excludeInternal", static: false, private: false, access: { has: obj => "excludeInternal" in obj, get: obj => obj.excludeInternal, set: (obj, value) => { obj.excludeInternal = value; } }, metadata: _metadata }, _excludeInternal_initializers, _excludeInternal_extraInitializers);
|
|
637
|
-
__esDecorate(_classThis, null, _excludePrivate_decorators, { kind: "accessor", name: "excludePrivate", static: false, private: false, access: { has: obj => "excludePrivate" in obj, get: obj => obj.excludePrivate, set: (obj, value) => { obj.excludePrivate = value; } }, metadata: _metadata }, _excludePrivate_initializers, _excludePrivate_extraInitializers);
|
|
638
|
-
__esDecorate(_classThis, null, _excludeProtected_decorators, { kind: "accessor", name: "excludeProtected", static: false, private: false, access: { has: obj => "excludeProtected" in obj, get: obj => obj.excludeProtected, set: (obj, value) => { obj.excludeProtected = value; } }, metadata: _metadata }, _excludeProtected_initializers, _excludeProtected_extraInitializers);
|
|
639
|
-
__esDecorate(_classThis, null, _excludeNotDocumented_decorators, { kind: "accessor", name: "excludeNotDocumented", static: false, private: false, access: { has: obj => "excludeNotDocumented" in obj, get: obj => obj.excludeNotDocumented, set: (obj, value) => { obj.excludeNotDocumented = value; } }, metadata: _metadata }, _excludeNotDocumented_initializers, _excludeNotDocumented_extraInitializers);
|
|
640
|
-
__esDecorate(_classThis, null, _excludeCategories_decorators, { kind: "accessor", name: "excludeCategories", static: false, private: false, access: { has: obj => "excludeCategories" in obj, get: obj => obj.excludeCategories, set: (obj, value) => { obj.excludeCategories = value; } }, metadata: _metadata }, _excludeCategories_initializers, _excludeCategories_extraInitializers);
|
|
641
|
-
__esDecorate(_classThis, null, _defaultCategory_decorators, { kind: "accessor", name: "defaultCategory", static: false, private: false, access: { has: obj => "defaultCategory" in obj, get: obj => obj.defaultCategory, set: (obj, value) => { obj.defaultCategory = value; } }, metadata: _metadata }, _defaultCategory_initializers, _defaultCategory_extraInitializers);
|
|
642
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
643
|
-
CommentPlugin = _classThis = _classDescriptor.value;
|
|
644
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
645
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
646
|
-
})();
|
|
647
|
-
return CommentPlugin = _classThis;
|
|
648
607
|
})();
|
|
649
|
-
|
|
608
|
+
export { CommentPlugin };
|
|
650
609
|
function inTypeLiteral(refl) {
|
|
651
610
|
while (refl) {
|
|
652
|
-
if (refl.kind ===
|
|
611
|
+
if (refl.kind === ReflectionKind.TypeLiteral) {
|
|
653
612
|
return true;
|
|
654
613
|
}
|
|
655
614
|
refl = refl.parent;
|
|
656
615
|
}
|
|
657
616
|
return false;
|
|
658
617
|
}
|
|
618
|
+
function validHighlightedName(ref, name) {
|
|
619
|
+
const refl = ref.reflection;
|
|
620
|
+
// Assume external types are documented properly
|
|
621
|
+
if (!refl)
|
|
622
|
+
return true;
|
|
623
|
+
// If it is a direct child, it is valid.
|
|
624
|
+
if (refl.getChildByName([name]))
|
|
625
|
+
return true;
|
|
626
|
+
// Or if it is the child of the referenced reflection's type
|
|
627
|
+
if (refl.isDeclaration() && refl.type?.type === "reflection") {
|
|
628
|
+
if (refl.type.declaration.getChildByName([name])) {
|
|
629
|
+
return true;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
return false;
|
|
633
|
+
}
|
|
659
634
|
// Moves tags like `@param foo.bar docs for bar` into the `bar` property of the `foo` parameter.
|
|
660
635
|
function moveNestedParamTags(
|
|
661
636
|
/* in-out */ paramTags, parameters, sourcePath) {
|
|
@@ -667,9 +642,9 @@ function moveNestedParamTags(
|
|
|
667
642
|
for (const tag of tags) {
|
|
668
643
|
const path = tag.name.split(".");
|
|
669
644
|
path.shift();
|
|
670
|
-
const child = target.declaration.
|
|
645
|
+
const child = target.declaration.getChildOrTypePropertyByName(path);
|
|
671
646
|
if (child && !child.comment) {
|
|
672
|
-
child.comment = new
|
|
647
|
+
child.comment = new Comment(Comment.cloneDisplayParts(tag.content));
|
|
673
648
|
child.comment.sourcePath = sourcePath;
|
|
674
649
|
used.add(paramTags.indexOf(tag));
|
|
675
650
|
}
|
|
@@ -682,6 +657,21 @@ function moveNestedParamTags(
|
|
|
682
657
|
intersection(i) {
|
|
683
658
|
i.types.forEach((t) => t.visit(visitor));
|
|
684
659
|
},
|
|
660
|
+
// #2147, support highlighting parts of a referenced type
|
|
661
|
+
reference(ref) {
|
|
662
|
+
for (let i = 0; i < paramTags.length; ++i) {
|
|
663
|
+
const tag = paramTags[i];
|
|
664
|
+
if (tag.name?.startsWith(`${param.name}.`)) {
|
|
665
|
+
const childName = tag.name.substring(param.name.length + 1);
|
|
666
|
+
if (!validHighlightedName(ref, childName)) {
|
|
667
|
+
continue;
|
|
668
|
+
}
|
|
669
|
+
ref.highlightedProperties ??= new Map();
|
|
670
|
+
ref.highlightedProperties.set(childName, paramTags[i].content);
|
|
671
|
+
used.add(i);
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
},
|
|
685
675
|
};
|
|
686
676
|
param.type?.visit(visitor);
|
|
687
677
|
}
|
|
@@ -701,11 +691,11 @@ function movePropertyTags(comment, container) {
|
|
|
701
691
|
continue;
|
|
702
692
|
const child = container.getChildByName(prop.name);
|
|
703
693
|
if (child) {
|
|
704
|
-
child.comment = new
|
|
694
|
+
child.comment = new Comment(Comment.cloneDisplayParts(prop.content));
|
|
705
695
|
child.comment.sourcePath = comment.sourcePath;
|
|
706
|
-
if (child instanceof
|
|
696
|
+
if (child instanceof DeclarationReflection && child.signatures) {
|
|
707
697
|
for (const sig of child.signatures) {
|
|
708
|
-
sig.comment = new
|
|
698
|
+
sig.comment = new Comment(Comment.cloneDisplayParts(prop.content));
|
|
709
699
|
sig.comment.sourcePath = comment.sourcePath;
|
|
710
700
|
}
|
|
711
701
|
}
|