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
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ConverterComponent } from "../components.js";
|
|
2
|
+
import type { Converter } from "../converter.js";
|
|
3
|
+
/**
|
|
4
|
+
* Handles `@include` and `@includeCode` within comments/documents.
|
|
5
|
+
*/
|
|
6
|
+
export declare class IncludePlugin extends ConverterComponent {
|
|
7
|
+
get logger(): import("../../utils/loggers.js").Logger;
|
|
8
|
+
constructor(owner: Converter);
|
|
9
|
+
private onCreate;
|
|
10
|
+
private checkIncludeTagsParts;
|
|
11
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import { ConverterComponent } from "../components.js";
|
|
4
|
+
import { ConverterEvents } from "../converter-events.js";
|
|
5
|
+
import { MinimalSourceFile } from "../../utils/minimalSourceFile.js";
|
|
6
|
+
import { isFile } from "../../utils/fs.js";
|
|
7
|
+
/**
|
|
8
|
+
* Handles `@include` and `@includeCode` within comments/documents.
|
|
9
|
+
*/
|
|
10
|
+
export class IncludePlugin extends ConverterComponent {
|
|
11
|
+
get logger() {
|
|
12
|
+
return this.application.logger;
|
|
13
|
+
}
|
|
14
|
+
constructor(owner) {
|
|
15
|
+
super(owner);
|
|
16
|
+
const onCreate = this.onCreate.bind(this);
|
|
17
|
+
owner.on(ConverterEvents.CREATE_DOCUMENT, onCreate);
|
|
18
|
+
owner.on(ConverterEvents.CREATE_DECLARATION, onCreate);
|
|
19
|
+
owner.on(ConverterEvents.CREATE_PARAMETER, onCreate);
|
|
20
|
+
owner.on(ConverterEvents.CREATE_SIGNATURE, onCreate);
|
|
21
|
+
owner.on(ConverterEvents.CREATE_TYPE_PARAMETER, onCreate);
|
|
22
|
+
}
|
|
23
|
+
onCreate(_context, refl) {
|
|
24
|
+
if (refl.isDocument()) {
|
|
25
|
+
// We know it must be present as documents are always associated with a file.
|
|
26
|
+
const relative = this.application.files.getReflectionPath(refl);
|
|
27
|
+
this.checkIncludeTagsParts(refl, path.dirname(relative), refl.content);
|
|
28
|
+
}
|
|
29
|
+
if (!refl.comment?.sourcePath)
|
|
30
|
+
return;
|
|
31
|
+
const relative = path.dirname(refl.comment.sourcePath);
|
|
32
|
+
this.checkIncludeTagsParts(refl, relative, refl.comment.summary);
|
|
33
|
+
for (const tag of refl.comment.blockTags) {
|
|
34
|
+
this.checkIncludeTagsParts(refl, relative, tag.content);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
checkIncludeTagsParts(refl, relative, parts, included = []) {
|
|
38
|
+
for (let i = 0; i < parts.length; ++i) {
|
|
39
|
+
const part = parts[i];
|
|
40
|
+
if (part.kind !== "inline-tag" ||
|
|
41
|
+
!["@include", "@includeCode"].includes(part.tag)) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
const file = path.resolve(relative, part.text.trim());
|
|
45
|
+
if (included.includes(file) && part.tag === "@include") {
|
|
46
|
+
this.logger.error(this.logger.i18n.include_0_in_1_specified_2_circular_include_3(part.tag, refl.getFriendlyFullName(), part.text, included.join("\n\t")));
|
|
47
|
+
}
|
|
48
|
+
else if (isFile(file)) {
|
|
49
|
+
const text = fs.readFileSync(file, "utf-8");
|
|
50
|
+
if (part.tag === "@include") {
|
|
51
|
+
const sf = new MinimalSourceFile(text, file);
|
|
52
|
+
const { content } = this.owner.parseRawComment(sf, refl.project.files);
|
|
53
|
+
this.checkIncludeTagsParts(refl, path.dirname(file), content, [...included, file]);
|
|
54
|
+
parts.splice(i, 1, ...content);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
parts[i] = {
|
|
58
|
+
kind: "code",
|
|
59
|
+
text: makeCodeBlock(path.extname(file).substring(1), text),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
this.logger.warn(this.logger.i18n.include_0_in_1_specified_2_resolved_to_3_does_not_exist(part.tag, refl.getFriendlyFullName(), part.text, file));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function makeCodeBlock(lang, code) {
|
|
70
|
+
const escaped = code.replace(/`(?=`)/g, "`\u200B");
|
|
71
|
+
return "\n\n```" + lang + "\n" + escaped.trimEnd() + "\n```";
|
|
72
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ConverterComponent } from "../components";
|
|
2
|
-
import { type ValidationOptions } from "../../utils";
|
|
1
|
+
import { ConverterComponent } from "../components.js";
|
|
2
|
+
import { type ValidationOptions } from "../../utils/index.js";
|
|
3
|
+
import type { Converter } from "../converter.js";
|
|
3
4
|
/**
|
|
4
5
|
* A plugin that handles `@inheritDoc` tags by copying documentation from another API item.
|
|
5
6
|
* It is NOT responsible for handling bare JSDoc style `@inheritDoc` tags which do not specify
|
|
@@ -19,7 +20,7 @@ export declare class InheritDocPlugin extends ConverterComponent {
|
|
|
19
20
|
/**
|
|
20
21
|
* Create a new InheritDocPlugin instance.
|
|
21
22
|
*/
|
|
22
|
-
|
|
23
|
+
constructor(owner: Converter);
|
|
23
24
|
/**
|
|
24
25
|
* Traverse through reflection descendant to check for `inheritDoc` tag.
|
|
25
26
|
* If encountered, the parameter of the tag is used to determine a source reflection
|
|
@@ -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,31 +32,14 @@ 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
|
-
|
|
43
|
-
|
|
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.InheritDocPlugin = void 0;
|
|
53
|
-
const models_1 = require("../../models");
|
|
54
|
-
const components_1 = require("../components");
|
|
55
|
-
const converter_1 = require("../converter");
|
|
56
|
-
const utils_1 = require("../../utils");
|
|
57
|
-
const array_1 = require("../../utils/array");
|
|
58
|
-
const declarationReference_1 = require("../comments/declarationReference");
|
|
59
|
-
const declarationReferenceResolver_1 = require("../comments/declarationReferenceResolver");
|
|
60
|
-
const application_events_1 = require("../../application-events");
|
|
35
|
+
import { Comment, DeclarationReflection, ReflectionKind, ReflectionType, SignatureReflection, } from "../../models/index.js";
|
|
36
|
+
import { ConverterComponent } from "../components.js";
|
|
37
|
+
import { Option, DefaultMap, } from "../../utils/index.js";
|
|
38
|
+
import { zip } from "../../utils/array.js";
|
|
39
|
+
import { parseDeclarationReference } from "../comments/declarationReference.js";
|
|
40
|
+
import { resolveDeclarationReference } from "../comments/declarationReferenceResolver.js";
|
|
41
|
+
import { ApplicationEvents } from "../../application-events.js";
|
|
42
|
+
import { ConverterEvents } from "../converter-events.js";
|
|
61
43
|
/**
|
|
62
44
|
* A plugin that handles `@inheritDoc` tags by copying documentation from another API item.
|
|
63
45
|
* It is NOT responsible for handling bare JSDoc style `@inheritDoc` tags which do not specify
|
|
@@ -72,30 +54,29 @@ const application_events_1 = require("../../application-events");
|
|
|
72
54
|
* - `@return` block
|
|
73
55
|
*/
|
|
74
56
|
let InheritDocPlugin = (() => {
|
|
75
|
-
|
|
76
|
-
let _classDecorators = [(0, components_1.Component)({ name: "inheritDoc" })];
|
|
77
|
-
let _classDescriptor;
|
|
78
|
-
let _classExtraInitializers = [];
|
|
79
|
-
let _classThis;
|
|
80
|
-
let _classSuper = components_1.ConverterComponent;
|
|
57
|
+
let _classSuper = ConverterComponent;
|
|
81
58
|
let _validation_decorators;
|
|
82
59
|
let _validation_initializers = [];
|
|
83
60
|
let _validation_extraInitializers = [];
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
61
|
+
return class InheritDocPlugin extends _classSuper {
|
|
62
|
+
static {
|
|
63
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
64
|
+
_validation_decorators = [Option("validation")];
|
|
65
|
+
__esDecorate(this, null, _validation_decorators, { kind: "accessor", name: "validation", static: false, private: false, access: { has: obj => "validation" in obj, get: obj => obj.validation, set: (obj, value) => { obj.validation = value; } }, metadata: _metadata }, _validation_initializers, _validation_extraInitializers);
|
|
66
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
90
67
|
}
|
|
91
|
-
|
|
92
|
-
|
|
68
|
+
#validation_accessor_storage = __runInitializers(this, _validation_initializers, void 0);
|
|
69
|
+
get validation() { return this.#validation_accessor_storage; }
|
|
70
|
+
set validation(value) { this.#validation_accessor_storage = value; }
|
|
71
|
+
// Key is depended on by Values
|
|
72
|
+
dependencies = (__runInitializers(this, _validation_extraInitializers), new DefaultMap(() => []));
|
|
93
73
|
/**
|
|
94
74
|
* Create a new InheritDocPlugin instance.
|
|
95
75
|
*/
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
this.
|
|
76
|
+
constructor(owner) {
|
|
77
|
+
super(owner);
|
|
78
|
+
this.owner.on(ConverterEvents.RESOLVE_END, (context) => this.processInheritDoc(context.project));
|
|
79
|
+
this.application.on(ApplicationEvents.REVIVE, this.processInheritDoc.bind(this));
|
|
99
80
|
}
|
|
100
81
|
/**
|
|
101
82
|
* Traverse through reflection descendant to check for `inheritDoc` tag.
|
|
@@ -108,18 +89,18 @@ let InheritDocPlugin = (() => {
|
|
|
108
89
|
const source = extractInheritDocTagReference(reflection);
|
|
109
90
|
if (!source)
|
|
110
91
|
continue;
|
|
111
|
-
const declRef =
|
|
92
|
+
const declRef = parseDeclarationReference(source, 0, source.length);
|
|
112
93
|
if (!declRef || /\S/.test(source.substring(declRef[1]))) {
|
|
113
94
|
this.application.logger.warn(this.application.i18n.declaration_reference_in_inheritdoc_for_0_not_fully_parsed(reflection.getFriendlyFullName()));
|
|
114
95
|
}
|
|
115
|
-
let sourceRefl = declRef &&
|
|
116
|
-
if (reflection instanceof
|
|
96
|
+
let sourceRefl = declRef && resolveDeclarationReference(reflection, declRef[0]);
|
|
97
|
+
if (reflection instanceof SignatureReflection) {
|
|
117
98
|
// Assumes that if there are overloads, they are declared in the same order as the parent.
|
|
118
99
|
// TS doesn't check this, but if a user messes this up then they are almost
|
|
119
100
|
// guaranteed to run into bugs where they can't call a method on a child class
|
|
120
101
|
// but if they assign (without a type assertion) that child to a variable of the parent class
|
|
121
102
|
// then they can call the method.
|
|
122
|
-
if (sourceRefl instanceof
|
|
103
|
+
if (sourceRefl instanceof DeclarationReflection) {
|
|
123
104
|
const index = reflection.parent
|
|
124
105
|
.getAllSignatures()
|
|
125
106
|
.indexOf(reflection);
|
|
@@ -127,8 +108,8 @@ let InheritDocPlugin = (() => {
|
|
|
127
108
|
sourceRefl.getAllSignatures()[index] || sourceRefl;
|
|
128
109
|
}
|
|
129
110
|
}
|
|
130
|
-
if (sourceRefl instanceof
|
|
131
|
-
sourceRefl.kindOf(
|
|
111
|
+
if (sourceRefl instanceof DeclarationReflection &&
|
|
112
|
+
sourceRefl.kindOf(ReflectionKind.Accessor)) {
|
|
132
113
|
// Accessors, like functions, never have comments on their actual root reflection.
|
|
133
114
|
// If the user didn't specify whether to inherit from the getter or setter, then implicitly
|
|
134
115
|
// try to inherit from the getter, #1968.
|
|
@@ -149,13 +130,13 @@ let InheritDocPlugin = (() => {
|
|
|
149
130
|
if (!target.comment)
|
|
150
131
|
return;
|
|
151
132
|
if (!source.comment &&
|
|
152
|
-
source instanceof
|
|
133
|
+
source instanceof DeclarationReflection &&
|
|
153
134
|
source.signatures) {
|
|
154
135
|
source = source.signatures[0];
|
|
155
136
|
}
|
|
156
137
|
if (!source.comment &&
|
|
157
|
-
source instanceof
|
|
158
|
-
source.type instanceof
|
|
138
|
+
source instanceof DeclarationReflection &&
|
|
139
|
+
source.type instanceof ReflectionType &&
|
|
159
140
|
source.type.declaration.signatures) {
|
|
160
141
|
source = source.type.declaration.signatures[0];
|
|
161
142
|
}
|
|
@@ -170,7 +151,7 @@ let InheritDocPlugin = (() => {
|
|
|
170
151
|
return;
|
|
171
152
|
}
|
|
172
153
|
target.comment.removeTags("@inheritDoc");
|
|
173
|
-
target.comment.summary =
|
|
154
|
+
target.comment.summary = Comment.cloneDisplayParts(source.comment.summary);
|
|
174
155
|
const remarks = source.comment.getTag("@remarks");
|
|
175
156
|
if (remarks) {
|
|
176
157
|
target.comment.blockTags.unshift(remarks.clone());
|
|
@@ -179,13 +160,13 @@ let InheritDocPlugin = (() => {
|
|
|
179
160
|
if (returns) {
|
|
180
161
|
target.comment.blockTags.push(returns.clone());
|
|
181
162
|
}
|
|
182
|
-
if (source instanceof
|
|
183
|
-
target instanceof
|
|
163
|
+
if (source instanceof SignatureReflection &&
|
|
164
|
+
target instanceof SignatureReflection) {
|
|
184
165
|
copySummaries(source.parameters, target.parameters);
|
|
185
166
|
copySummaries(source.typeParameters, target.typeParameters);
|
|
186
167
|
}
|
|
187
|
-
else if (source instanceof
|
|
188
|
-
target instanceof
|
|
168
|
+
else if (source instanceof DeclarationReflection &&
|
|
169
|
+
target instanceof DeclarationReflection) {
|
|
189
170
|
copySummaries(source.typeParameters, target.typeParameters);
|
|
190
171
|
}
|
|
191
172
|
// Now copy the comment for anyone who depends on me.
|
|
@@ -216,23 +197,11 @@ let InheritDocPlugin = (() => {
|
|
|
216
197
|
}
|
|
217
198
|
}
|
|
218
199
|
};
|
|
219
|
-
_InheritDocPlugin_validation_accessor_storage = new WeakMap();
|
|
220
|
-
__setFunctionName(_classThis, "InheritDocPlugin");
|
|
221
|
-
(() => {
|
|
222
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
223
|
-
_validation_decorators = [(0, utils_1.Option)("validation")];
|
|
224
|
-
__esDecorate(_classThis, null, _validation_decorators, { kind: "accessor", name: "validation", static: false, private: false, access: { has: obj => "validation" in obj, get: obj => obj.validation, set: (obj, value) => { obj.validation = value; } }, metadata: _metadata }, _validation_initializers, _validation_extraInitializers);
|
|
225
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
226
|
-
InheritDocPlugin = _classThis = _classDescriptor.value;
|
|
227
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
228
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
229
|
-
})();
|
|
230
|
-
return InheritDocPlugin = _classThis;
|
|
231
200
|
})();
|
|
232
|
-
|
|
201
|
+
export { InheritDocPlugin };
|
|
233
202
|
function copySummaries(source, target) {
|
|
234
|
-
for (const [s, t] of
|
|
235
|
-
t.comment = new
|
|
203
|
+
for (const [s, t] of zip(source || [], target || [])) {
|
|
204
|
+
t.comment = new Comment(s.comment?.summary);
|
|
236
205
|
t.comment.sourcePath = s.comment?.sourcePath;
|
|
237
206
|
}
|
|
238
207
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ConverterComponent } from "../components";
|
|
2
|
-
import type { Context } from "../../converter";
|
|
3
|
-
import { type ValidationOptions } from "../../utils";
|
|
4
|
-
import { type ProjectReflection } from "../../models";
|
|
1
|
+
import { ConverterComponent } from "../components.js";
|
|
2
|
+
import type { Context, Converter } from "../../converter/index.js";
|
|
3
|
+
import { type ValidationOptions } from "../../utils/index.js";
|
|
4
|
+
import { type ProjectReflection } from "../../models/index.js";
|
|
5
5
|
/**
|
|
6
6
|
* A plugin that resolves `{@link Foo}` tags.
|
|
7
7
|
*/
|
|
8
8
|
export declare class LinkResolverPlugin extends ConverterComponent {
|
|
9
9
|
accessor validation: ValidationOptions;
|
|
10
|
-
|
|
10
|
+
constructor(owner: Converter);
|
|
11
11
|
onResolve(context: Context): void;
|
|
12
12
|
resolveLinks(project: ProjectReflection): void;
|
|
13
13
|
private resolveCategoryLinks;
|
|
@@ -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,49 +32,35 @@ 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.LinkResolverPlugin = void 0;
|
|
53
|
-
const components_1 = require("../components");
|
|
54
|
-
const converter_events_1 = require("../converter-events");
|
|
55
|
-
const utils_1 = require("../../utils");
|
|
56
|
-
const models_1 = require("../../models");
|
|
57
|
-
const reflections_1 = require("../../utils/reflections");
|
|
58
|
-
const application_events_1 = require("../../application-events");
|
|
35
|
+
import { ConverterComponent } from "../components.js";
|
|
36
|
+
import { ConverterEvents } from "../converter-events.js";
|
|
37
|
+
import { Option } from "../../utils/index.js";
|
|
38
|
+
import { ContainerReflection, makeRecursiveVisitor, } from "../../models/index.js";
|
|
39
|
+
import { discoverAllReferenceTypes } from "../../utils/reflections.js";
|
|
40
|
+
import { ApplicationEvents } from "../../application-events.js";
|
|
59
41
|
/**
|
|
60
42
|
* A plugin that resolves `{@link Foo}` tags.
|
|
61
43
|
*/
|
|
62
44
|
let LinkResolverPlugin = (() => {
|
|
63
|
-
|
|
64
|
-
let _classDecorators = [(0, components_1.Component)({ name: "link-resolver" })];
|
|
65
|
-
let _classDescriptor;
|
|
66
|
-
let _classExtraInitializers = [];
|
|
67
|
-
let _classThis;
|
|
68
|
-
let _classSuper = components_1.ConverterComponent;
|
|
45
|
+
let _classSuper = ConverterComponent;
|
|
69
46
|
let _validation_decorators;
|
|
70
47
|
let _validation_initializers = [];
|
|
71
48
|
let _validation_extraInitializers = [];
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
49
|
+
return class LinkResolverPlugin extends _classSuper {
|
|
50
|
+
static {
|
|
51
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
52
|
+
_validation_decorators = [Option("validation")];
|
|
53
|
+
__esDecorate(this, null, _validation_decorators, { kind: "accessor", name: "validation", static: false, private: false, access: { has: obj => "validation" in obj, get: obj => obj.validation, set: (obj, value) => { obj.validation = value; } }, metadata: _metadata }, _validation_initializers, _validation_extraInitializers);
|
|
54
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
55
|
+
}
|
|
56
|
+
#validation_accessor_storage = __runInitializers(this, _validation_initializers, void 0);
|
|
57
|
+
get validation() { return this.#validation_accessor_storage; }
|
|
58
|
+
set validation(value) { this.#validation_accessor_storage = value; }
|
|
59
|
+
constructor(owner) {
|
|
60
|
+
super(owner);
|
|
61
|
+
__runInitializers(this, _validation_extraInitializers);
|
|
62
|
+
this.owner.on(ConverterEvents.RESOLVE_END, this.onResolve.bind(this), -300);
|
|
63
|
+
this.application.on(ApplicationEvents.REVIVE, this.resolveLinks.bind(this), -300);
|
|
79
64
|
}
|
|
80
65
|
onResolve(context) {
|
|
81
66
|
this.resolveLinks(context.project);
|
|
@@ -87,7 +72,7 @@ let LinkResolverPlugin = (() => {
|
|
|
87
72
|
this.owner.resolveLinks(reflection.comment, reflection);
|
|
88
73
|
}
|
|
89
74
|
if (reflection.isDeclaration()) {
|
|
90
|
-
reflection.type?.visit(
|
|
75
|
+
reflection.type?.visit(makeRecursiveVisitor({
|
|
91
76
|
union: (type) => {
|
|
92
77
|
type.elementSummaries = type.elementSummaries?.map((parts) => this.owner.resolveLinks(parts, reflection));
|
|
93
78
|
},
|
|
@@ -99,7 +84,18 @@ let LinkResolverPlugin = (() => {
|
|
|
99
84
|
if (reflection.isDocument()) {
|
|
100
85
|
reflection.content = this.owner.resolveLinks(reflection.content, reflection);
|
|
101
86
|
}
|
|
102
|
-
if (reflection
|
|
87
|
+
if (reflection.isParameter() &&
|
|
88
|
+
reflection.type?.type === "reference" &&
|
|
89
|
+
reflection.type.highlightedProperties) {
|
|
90
|
+
const resolved = new Map(Array.from(reflection.type.highlightedProperties, ([name, parts]) => {
|
|
91
|
+
return [
|
|
92
|
+
name,
|
|
93
|
+
this.owner.resolveLinks(parts, reflection),
|
|
94
|
+
];
|
|
95
|
+
}));
|
|
96
|
+
reflection.type.highlightedProperties = resolved;
|
|
97
|
+
}
|
|
98
|
+
if (reflection instanceof ContainerReflection) {
|
|
103
99
|
if (reflection.groups) {
|
|
104
100
|
for (const group of reflection.groups) {
|
|
105
101
|
if (group.description) {
|
|
@@ -122,7 +118,7 @@ let LinkResolverPlugin = (() => {
|
|
|
122
118
|
if (project.readme) {
|
|
123
119
|
project.readme = this.owner.resolveLinks(project.readme, project);
|
|
124
120
|
}
|
|
125
|
-
for (const { type, owner } of
|
|
121
|
+
for (const { type, owner } of discoverAllReferenceTypes(project, false)) {
|
|
126
122
|
if (!type.reflection) {
|
|
127
123
|
const resolveResult = this.owner.resolveExternalLink(type.toDeclarationReference(), owner, undefined, type.symbolId);
|
|
128
124
|
switch (typeof resolveResult) {
|
|
@@ -141,23 +137,6 @@ let LinkResolverPlugin = (() => {
|
|
|
141
137
|
category.description = this.owner.resolveLinks(category.description, owner);
|
|
142
138
|
}
|
|
143
139
|
}
|
|
144
|
-
constructor() {
|
|
145
|
-
super(...arguments);
|
|
146
|
-
_LinkResolverPlugin_validation_accessor_storage.set(this, __runInitializers(this, _validation_initializers, void 0));
|
|
147
|
-
__runInitializers(this, _validation_extraInitializers);
|
|
148
|
-
}
|
|
149
140
|
};
|
|
150
|
-
_LinkResolverPlugin_validation_accessor_storage = new WeakMap();
|
|
151
|
-
__setFunctionName(_classThis, "LinkResolverPlugin");
|
|
152
|
-
(() => {
|
|
153
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
154
|
-
_validation_decorators = [(0, utils_1.Option)("validation")];
|
|
155
|
-
__esDecorate(_classThis, null, _validation_decorators, { kind: "accessor", name: "validation", static: false, private: false, access: { has: obj => "validation" in obj, get: obj => obj.validation, set: (obj, value) => { obj.validation = value; } }, metadata: _metadata }, _validation_initializers, _validation_extraInitializers);
|
|
156
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
157
|
-
LinkResolverPlugin = _classThis = _classDescriptor.value;
|
|
158
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
159
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
160
|
-
})();
|
|
161
|
-
return LinkResolverPlugin = _classThis;
|
|
162
141
|
})();
|
|
163
|
-
|
|
142
|
+
export { LinkResolverPlugin };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ConverterComponent } from "../components.js";
|
|
2
|
+
import type { Converter } from "../converter.js";
|
|
3
|
+
/**
|
|
4
|
+
* Handles `@mergeModuleWith` tags in comments
|
|
5
|
+
* Warnings if resolution failed are emitted during the validation step, not here.
|
|
6
|
+
*/
|
|
7
|
+
export declare class MergeModuleWithPlugin extends ConverterComponent {
|
|
8
|
+
constructor(owner: Converter);
|
|
9
|
+
private onResolveBegin;
|
|
10
|
+
private onRevive;
|
|
11
|
+
private checkAndMerge;
|
|
12
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ok } from "assert";
|
|
2
|
+
import { ApplicationEvents } from "../../application-events.js";
|
|
3
|
+
import { Comment, ReflectionKind, } from "../../models/index.js";
|
|
4
|
+
import { ConverterComponent } from "../components.js";
|
|
5
|
+
import { ConverterEvents } from "../converter-events.js";
|
|
6
|
+
/**
|
|
7
|
+
* Handles `@mergeModuleWith` tags in comments
|
|
8
|
+
* Warnings if resolution failed are emitted during the validation step, not here.
|
|
9
|
+
*/
|
|
10
|
+
export class MergeModuleWithPlugin extends ConverterComponent {
|
|
11
|
+
constructor(owner) {
|
|
12
|
+
super(owner);
|
|
13
|
+
// Note: This happens before grouping/categorizing
|
|
14
|
+
this.owner.on(ConverterEvents.RESOLVE_BEGIN, this.onResolveBegin.bind(this), 10000);
|
|
15
|
+
this.application.on(ApplicationEvents.REVIVE, this.onRevive.bind(this), 10000);
|
|
16
|
+
}
|
|
17
|
+
onResolveBegin(context) {
|
|
18
|
+
this.onRevive(context.project);
|
|
19
|
+
}
|
|
20
|
+
onRevive(project) {
|
|
21
|
+
const mods = project.getReflectionsByKind(ReflectionKind.SomeModule);
|
|
22
|
+
for (const refl of mods) {
|
|
23
|
+
this.checkAndMerge(refl);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
checkAndMerge(refl) {
|
|
27
|
+
ok(refl.isDeclaration());
|
|
28
|
+
const tag = refl.comment?.getTag("@mergeModuleWith");
|
|
29
|
+
if (!tag)
|
|
30
|
+
return;
|
|
31
|
+
const project = refl.project;
|
|
32
|
+
const targetStr = Comment.combineDisplayParts(tag.content);
|
|
33
|
+
const target = targetStr === "<project>"
|
|
34
|
+
? project
|
|
35
|
+
: project.getChildByName(targetStr);
|
|
36
|
+
if (!target?.isDeclaration() && !target?.isProject()) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
let tempRefl = refl;
|
|
40
|
+
while (tempRefl !== project) {
|
|
41
|
+
if (tempRefl === target) {
|
|
42
|
+
this.application.logger.warn(this.application.i18n.reflection_0_tried_to_merge_into_child_1(refl.getFriendlyFullName(), target.getFriendlyFullName()));
|
|
43
|
+
}
|
|
44
|
+
tempRefl = refl.parent;
|
|
45
|
+
}
|
|
46
|
+
this.application.logger.verbose(`Merging ${refl.getFullName()} into ${target.getFullName()}`);
|
|
47
|
+
project.mergeModules(refl, target);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ConverterComponent } from "../components";
|
|
2
|
-
import { EntryPointStrategy } from "../../utils";
|
|
1
|
+
import { ConverterComponent } from "../components.js";
|
|
2
|
+
import { EntryPointStrategy } from "../../utils/index.js";
|
|
3
|
+
import type { Converter } from "../converter.js";
|
|
3
4
|
/**
|
|
4
5
|
* A handler that tries to find the package.json and readme.md files of the
|
|
5
6
|
* current project.
|
|
@@ -21,7 +22,7 @@ export declare class PackagePlugin extends ConverterComponent {
|
|
|
21
22
|
* Contents of package.json for the active project
|
|
22
23
|
*/
|
|
23
24
|
private packageJson?;
|
|
24
|
-
|
|
25
|
+
constructor(owner: Converter);
|
|
25
26
|
private onRevive;
|
|
26
27
|
private onBegin;
|
|
27
28
|
private onBeginResolve;
|