typedoc 0.26.11 → 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 +154 -172
- 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 +47 -36
- 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.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 +44 -76
- 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 +7 -10
- 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,23 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.ParameterReflection = void 0;
|
|
4
|
-
const types_1 = require("../types");
|
|
5
|
-
const abstract_1 = require("./abstract");
|
|
1
|
+
import { ReflectionType } from "../types.js";
|
|
2
|
+
import { Reflection, TraverseProperty, } from "./abstract.js";
|
|
6
3
|
/**
|
|
7
4
|
* @category Reflections
|
|
8
5
|
*/
|
|
9
|
-
class ParameterReflection extends
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
6
|
+
export class ParameterReflection extends Reflection {
|
|
7
|
+
variant = "param";
|
|
8
|
+
defaultValue;
|
|
9
|
+
type;
|
|
14
10
|
traverse(callback) {
|
|
15
|
-
if (this.type instanceof
|
|
16
|
-
if (callback(this.type.declaration,
|
|
11
|
+
if (this.type instanceof ReflectionType) {
|
|
12
|
+
if (callback(this.type.declaration, TraverseProperty.TypeLiteral) === false) {
|
|
17
13
|
return;
|
|
18
14
|
}
|
|
19
15
|
}
|
|
20
16
|
}
|
|
17
|
+
isParameter() {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
21
20
|
/**
|
|
22
21
|
* Return a string representation of this reflection.
|
|
23
22
|
*/
|
|
@@ -38,4 +37,3 @@ class ParameterReflection extends abstract_1.Reflection {
|
|
|
38
37
|
this.defaultValue = obj.defaultValue;
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
|
-
exports.ParameterReflection = ParameterReflection;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { type Reflection } from "./abstract";
|
|
2
|
-
import { ContainerReflection } from "./container";
|
|
3
|
-
import { type Type } from "../types";
|
|
4
1
|
import type * as ts from "typescript";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import type
|
|
9
|
-
import
|
|
10
|
-
import type
|
|
2
|
+
import { type Reflection } from "./abstract.js";
|
|
3
|
+
import { ContainerReflection } from "./container.js";
|
|
4
|
+
import type { DeclarationReflection } from "./declaration.js";
|
|
5
|
+
import { type Type } from "../types.js";
|
|
6
|
+
import { ReflectionKind } from "./kind.js";
|
|
7
|
+
import { type CommentDisplayPart } from "../comments/index.js";
|
|
8
|
+
import { ReflectionSymbolId } from "./ReflectionSymbolId.js";
|
|
9
|
+
import type { Serializer } from "../../serialization/serializer.js";
|
|
10
|
+
import type { Deserializer, JSONOutput } from "../../serialization/index.js";
|
|
11
|
+
import type { FileRegistry } from "../FileRegistry.js";
|
|
11
12
|
/**
|
|
12
13
|
* A reflection that represents the root of the project.
|
|
13
14
|
*
|
|
@@ -20,6 +21,7 @@ export declare class ProjectReflection extends ContainerReflection {
|
|
|
20
21
|
private symbolToReflectionIdMap;
|
|
21
22
|
private reflectionIdToSymbolIdMap;
|
|
22
23
|
private reflectionIdToSymbolMap;
|
|
24
|
+
private removedSymbolIds;
|
|
23
25
|
private referenceGraph?;
|
|
24
26
|
private reflectionChildren;
|
|
25
27
|
/**
|
|
@@ -78,6 +80,8 @@ export declare class ProjectReflection extends ContainerReflection {
|
|
|
78
80
|
* project.
|
|
79
81
|
*/
|
|
80
82
|
removeReflection(reflection: Reflection): void;
|
|
83
|
+
/** @internal */
|
|
84
|
+
mergeModules(source: DeclarationReflection, target: DeclarationReflection | ProjectReflection): void;
|
|
81
85
|
/**
|
|
82
86
|
* Remove a reflection without updating the parent reflection to remove references to the removed reflection.
|
|
83
87
|
*/
|
|
@@ -104,6 +108,7 @@ export declare class ProjectReflection extends ContainerReflection {
|
|
|
104
108
|
getSymbolIdFromReflection(reflection: Reflection): ReflectionSymbolId | undefined;
|
|
105
109
|
/** @internal */
|
|
106
110
|
registerSymbolId(reflection: Reflection, id: ReflectionSymbolId): void;
|
|
111
|
+
symbolIdHasBeenRemoved(id: ReflectionSymbolId): boolean;
|
|
107
112
|
/**
|
|
108
113
|
* THIS MAY NOT BE USED AFTER CONVERSION HAS FINISHED.
|
|
109
114
|
* @internal
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const comments_1 = require("../comments");
|
|
11
|
-
const ReflectionSymbolId_1 = require("./ReflectionSymbolId");
|
|
12
|
-
const map_1 = require("../../utils/map");
|
|
1
|
+
import { TraverseProperty } from "./abstract.js";
|
|
2
|
+
import { ContainerReflection } from "./container.js";
|
|
3
|
+
import { ReferenceReflection } from "./reference.js";
|
|
4
|
+
import { IntrinsicType, makeRecursiveVisitor } from "../types.js";
|
|
5
|
+
import { assertNever, removeIf, removeIfPresent } from "../../utils/index.js";
|
|
6
|
+
import { ReflectionKind } from "./kind.js";
|
|
7
|
+
import { Comment } from "../comments/index.js";
|
|
8
|
+
import { ReflectionSymbolId } from "./ReflectionSymbolId.js";
|
|
9
|
+
import { DefaultMap, StableKeyMap } from "../../utils/map.js";
|
|
13
10
|
/**
|
|
14
11
|
* A reflection that represents the root of the project.
|
|
15
12
|
*
|
|
@@ -17,24 +14,43 @@ const map_1 = require("../../utils/map");
|
|
|
17
14
|
* and source files of the processed project through this reflection.
|
|
18
15
|
* @category Reflections
|
|
19
16
|
*/
|
|
20
|
-
class ProjectReflection extends
|
|
17
|
+
export class ProjectReflection extends ContainerReflection {
|
|
18
|
+
variant = "project";
|
|
19
|
+
// Used to resolve references.
|
|
20
|
+
symbolToReflectionIdMap = new StableKeyMap();
|
|
21
|
+
reflectionIdToSymbolIdMap = new Map();
|
|
22
|
+
reflectionIdToSymbolMap = new Map();
|
|
23
|
+
removedSymbolIds = new StableKeyMap();
|
|
24
|
+
// Maps a reflection ID to all references eventually referring to it.
|
|
25
|
+
referenceGraph;
|
|
26
|
+
// Maps a reflection ID to all reflections with it as their parent.
|
|
27
|
+
reflectionChildren = new DefaultMap(() => []);
|
|
28
|
+
/**
|
|
29
|
+
* A list of all reflections within the project. DO NOT MUTATE THIS OBJECT.
|
|
30
|
+
* All mutation should be done via {@link registerReflection} and {@link removeReflection}
|
|
31
|
+
* to ensure that links to reflections remain valid.
|
|
32
|
+
*
|
|
33
|
+
* This may be replaced with a `Map<number, Reflection>` someday.
|
|
34
|
+
*/
|
|
35
|
+
reflections = { [this.id]: this };
|
|
36
|
+
/**
|
|
37
|
+
* The name of the package that this reflection documents according to package.json.
|
|
38
|
+
*/
|
|
39
|
+
packageName;
|
|
40
|
+
/**
|
|
41
|
+
* The version of the package that this reflection documents according to package.json.
|
|
42
|
+
*/
|
|
43
|
+
packageVersion;
|
|
44
|
+
/**
|
|
45
|
+
* The contents of the readme.md file of the project when found.
|
|
46
|
+
*/
|
|
47
|
+
readme;
|
|
48
|
+
/**
|
|
49
|
+
* Object which describes where to find content for relative links.
|
|
50
|
+
*/
|
|
51
|
+
files;
|
|
21
52
|
constructor(name, registry) {
|
|
22
|
-
super(name,
|
|
23
|
-
this.variant = "project";
|
|
24
|
-
// Used to resolve references.
|
|
25
|
-
this.symbolToReflectionIdMap = new map_1.StableKeyMap();
|
|
26
|
-
this.reflectionIdToSymbolIdMap = new Map();
|
|
27
|
-
this.reflectionIdToSymbolMap = new Map();
|
|
28
|
-
// Maps a reflection ID to all reflections with it as their parent.
|
|
29
|
-
this.reflectionChildren = new map_1.DefaultMap(() => []);
|
|
30
|
-
/**
|
|
31
|
-
* A list of all reflections within the project. DO NOT MUTATE THIS OBJECT.
|
|
32
|
-
* All mutation should be done via {@link registerReflection} and {@link removeReflection}
|
|
33
|
-
* to ensure that links to reflections remain valid.
|
|
34
|
-
*
|
|
35
|
-
* This may be replaced with a `Map<number, Reflection>` someday.
|
|
36
|
-
*/
|
|
37
|
-
this.reflections = { [this.id]: this };
|
|
53
|
+
super(name, ReflectionKind.Project);
|
|
38
54
|
this.reflections[this.id] = this;
|
|
39
55
|
this.files = registry;
|
|
40
56
|
}
|
|
@@ -67,7 +83,7 @@ class ProjectReflection extends container_1.ContainerReflection {
|
|
|
67
83
|
this.reflections[reflection.id] = reflection;
|
|
68
84
|
if (symbol) {
|
|
69
85
|
this.reflectionIdToSymbolMap.set(reflection.id, symbol);
|
|
70
|
-
const id = new
|
|
86
|
+
const id = new ReflectionSymbolId(symbol);
|
|
71
87
|
this.registerSymbolId(reflection, id);
|
|
72
88
|
// #2466
|
|
73
89
|
// If we just registered a member of a class or interface, then we need to check if
|
|
@@ -75,15 +91,15 @@ class ProjectReflection extends container_1.ContainerReflection {
|
|
|
75
91
|
// This can happen because the compiler API will use non-dependently-typed symbols
|
|
76
92
|
// for properties of classes/interfaces which inherit them, so we can't rely on the
|
|
77
93
|
// property being unique for each class.
|
|
78
|
-
if (reflection.parent?.kindOf(
|
|
79
|
-
reflection.kindOf(
|
|
94
|
+
if (reflection.parent?.kindOf(ReflectionKind.ClassOrInterface) &&
|
|
95
|
+
reflection.kindOf(ReflectionKind.SomeMember)) {
|
|
80
96
|
const saved = this.symbolToReflectionIdMap.get(id);
|
|
81
97
|
const parentSymbolReflection = symbol.parent &&
|
|
82
98
|
this.getReflectionFromSymbol(symbol.parent);
|
|
83
99
|
if (typeof saved === "object" &&
|
|
84
100
|
saved.length > 1 &&
|
|
85
101
|
parentSymbolReflection) {
|
|
86
|
-
|
|
102
|
+
removeIf(saved, (item) => this.getReflectionById(item)?.parent !==
|
|
87
103
|
parentSymbolReflection);
|
|
88
104
|
}
|
|
89
105
|
}
|
|
@@ -99,7 +115,7 @@ class ProjectReflection extends container_1.ContainerReflection {
|
|
|
99
115
|
* @since 0.26.6
|
|
100
116
|
*/
|
|
101
117
|
removeTypeReflections(type) {
|
|
102
|
-
type?.visit(
|
|
118
|
+
type?.visit(makeRecursiveVisitor({
|
|
103
119
|
reflection: (type) => {
|
|
104
120
|
this.removeReflection(type.declaration);
|
|
105
121
|
},
|
|
@@ -124,51 +140,77 @@ class ProjectReflection extends container_1.ContainerReflection {
|
|
|
124
140
|
return true; // Continue iteration
|
|
125
141
|
}
|
|
126
142
|
switch (property) {
|
|
127
|
-
case
|
|
128
|
-
case
|
|
143
|
+
case TraverseProperty.Children:
|
|
144
|
+
case TraverseProperty.Documents:
|
|
129
145
|
parent.removeChild(reflection);
|
|
130
146
|
break;
|
|
131
|
-
case
|
|
147
|
+
case TraverseProperty.GetSignature:
|
|
132
148
|
delete parent.getSignature;
|
|
133
149
|
break;
|
|
134
|
-
case
|
|
135
|
-
|
|
150
|
+
case TraverseProperty.IndexSignature:
|
|
151
|
+
removeIfPresent(parent.indexSignatures, reflection);
|
|
136
152
|
if (!parent.indexSignatures?.length) {
|
|
137
153
|
delete parent.indexSignatures;
|
|
138
154
|
}
|
|
139
155
|
break;
|
|
140
|
-
case
|
|
141
|
-
|
|
156
|
+
case TraverseProperty.Parameters:
|
|
157
|
+
removeIfPresent(reflection.parent.parameters, reflection);
|
|
142
158
|
if (!reflection.parent.parameters
|
|
143
159
|
?.length) {
|
|
144
160
|
delete reflection.parent
|
|
145
161
|
.parameters;
|
|
146
162
|
}
|
|
147
163
|
break;
|
|
148
|
-
case
|
|
164
|
+
case TraverseProperty.SetSignature:
|
|
149
165
|
delete parent.setSignature;
|
|
150
166
|
break;
|
|
151
|
-
case
|
|
152
|
-
|
|
167
|
+
case TraverseProperty.Signatures:
|
|
168
|
+
removeIfPresent(parent.signatures, reflection);
|
|
153
169
|
if (!parent.signatures?.length) {
|
|
154
170
|
delete parent.signatures;
|
|
155
171
|
}
|
|
156
172
|
break;
|
|
157
|
-
case
|
|
158
|
-
parent.type = new
|
|
173
|
+
case TraverseProperty.TypeLiteral:
|
|
174
|
+
parent.type = new IntrinsicType("Object");
|
|
159
175
|
break;
|
|
160
|
-
case
|
|
161
|
-
|
|
176
|
+
case TraverseProperty.TypeParameter:
|
|
177
|
+
removeIfPresent(parent.typeParameters, reflection);
|
|
162
178
|
if (!parent.typeParameters?.length) {
|
|
163
179
|
delete parent.typeParameters;
|
|
164
180
|
}
|
|
165
181
|
break;
|
|
166
182
|
default:
|
|
167
|
-
|
|
183
|
+
assertNever(property);
|
|
168
184
|
}
|
|
169
185
|
return false; // Stop iteration
|
|
170
186
|
});
|
|
171
187
|
}
|
|
188
|
+
/** @internal */
|
|
189
|
+
mergeModules(source, target) {
|
|
190
|
+
// First, tell the children about their new parent
|
|
191
|
+
delete this.referenceGraph;
|
|
192
|
+
const oldChildrenIds = this.reflectionChildren.getNoInsert(source.id) || [];
|
|
193
|
+
const newChildren = this.reflectionChildren.get(target.id);
|
|
194
|
+
for (const childId of oldChildrenIds) {
|
|
195
|
+
const childRefl = this.getReflectionById(childId);
|
|
196
|
+
// To avoid conflicting with some plugins which do this surgery somewhat incorrectly
|
|
197
|
+
// (typedoc-plugin-merge-modules and likely others I'm not aware of) only move children
|
|
198
|
+
// which are still children
|
|
199
|
+
if (childRefl?.parent === source) {
|
|
200
|
+
childRefl.parent = target;
|
|
201
|
+
newChildren.push(childId);
|
|
202
|
+
target.addChild(childRefl);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
// Then remove the now-empty parent
|
|
206
|
+
this.reflectionChildren.delete(source.id);
|
|
207
|
+
this.removeReflection(source);
|
|
208
|
+
// And remove any outdated collections of children on the new parent.
|
|
209
|
+
// So long as this is used before REVIVE(-100) or EVENT_BEGIN_RESOLVE(-100)
|
|
210
|
+
// this will make the appropriate plugin rebuild the lists.
|
|
211
|
+
delete target.groups;
|
|
212
|
+
delete target.categories;
|
|
213
|
+
}
|
|
172
214
|
/**
|
|
173
215
|
* Remove a reflection without updating the parent reflection to remove references to the removed reflection.
|
|
174
216
|
*/
|
|
@@ -200,9 +242,13 @@ class ProjectReflection extends container_1.ContainerReflection {
|
|
|
200
242
|
const saved = this.symbolToReflectionIdMap.get(symbolId);
|
|
201
243
|
if (saved === reflection.id) {
|
|
202
244
|
this.symbolToReflectionIdMap.delete(symbolId);
|
|
245
|
+
this.removedSymbolIds.set(symbolId, true);
|
|
203
246
|
}
|
|
204
247
|
else if (typeof saved === "object") {
|
|
205
|
-
|
|
248
|
+
removeIfPresent(saved, reflection.id);
|
|
249
|
+
if (saved.length === 0) {
|
|
250
|
+
this.removedSymbolIds.set(symbolId, true);
|
|
251
|
+
}
|
|
206
252
|
}
|
|
207
253
|
}
|
|
208
254
|
this.reflectionIdToSymbolMap.delete(reflection.id);
|
|
@@ -221,7 +267,7 @@ class ProjectReflection extends container_1.ContainerReflection {
|
|
|
221
267
|
* @internal
|
|
222
268
|
*/
|
|
223
269
|
getReflectionFromSymbol(symbol) {
|
|
224
|
-
return this.getReflectionFromSymbolId(new
|
|
270
|
+
return this.getReflectionFromSymbolId(new ReflectionSymbolId(symbol));
|
|
225
271
|
}
|
|
226
272
|
/**
|
|
227
273
|
* Gets the reflection associated with the given symbol id, if it exists.
|
|
@@ -262,6 +308,9 @@ class ProjectReflection extends container_1.ContainerReflection {
|
|
|
262
308
|
this.symbolToReflectionIdMap.set(id, reflection.id);
|
|
263
309
|
}
|
|
264
310
|
}
|
|
311
|
+
symbolIdHasBeenRemoved(id) {
|
|
312
|
+
return this.removedSymbolIds.has(id);
|
|
313
|
+
}
|
|
265
314
|
/**
|
|
266
315
|
* THIS MAY NOT BE USED AFTER CONVERSION HAS FINISHED.
|
|
267
316
|
* @internal
|
|
@@ -274,7 +323,7 @@ class ProjectReflection extends container_1.ContainerReflection {
|
|
|
274
323
|
this.referenceGraph = new Map();
|
|
275
324
|
for (const id in this.reflections) {
|
|
276
325
|
const ref = this.reflections[id];
|
|
277
|
-
if (ref instanceof
|
|
326
|
+
if (ref instanceof ReferenceReflection) {
|
|
278
327
|
const target = ref.tryGetTargetReflection();
|
|
279
328
|
if (target) {
|
|
280
329
|
const refs = this.referenceGraph.get(target.id) ?? [];
|
|
@@ -296,7 +345,7 @@ class ProjectReflection extends container_1.ContainerReflection {
|
|
|
296
345
|
variant: this.variant,
|
|
297
346
|
packageName: this.packageName,
|
|
298
347
|
packageVersion: this.packageVersion,
|
|
299
|
-
readme:
|
|
348
|
+
readme: Comment.serializeDisplayParts(serializer, this.readme),
|
|
300
349
|
symbolIdMap,
|
|
301
350
|
files: serializer.toObject(this.files),
|
|
302
351
|
};
|
|
@@ -307,7 +356,7 @@ class ProjectReflection extends container_1.ContainerReflection {
|
|
|
307
356
|
this.packageName = obj.packageName;
|
|
308
357
|
this.packageVersion = obj.packageVersion;
|
|
309
358
|
if (obj.readme) {
|
|
310
|
-
this.readme =
|
|
359
|
+
this.readme = Comment.deserializeDisplayParts(de, obj.readme);
|
|
311
360
|
}
|
|
312
361
|
this.files.fromObject(de, obj.files || {});
|
|
313
362
|
de.defer(() => {
|
|
@@ -315,7 +364,7 @@ class ProjectReflection extends container_1.ContainerReflection {
|
|
|
315
364
|
for (const [id, sid] of Object.entries(obj.symbolIdMap || {})) {
|
|
316
365
|
const refl = this.getReflectionById(de.oldIdToNewId[+id] ?? -1);
|
|
317
366
|
if (refl) {
|
|
318
|
-
this.registerSymbolId(refl, new
|
|
367
|
+
this.registerSymbolId(refl, new ReflectionSymbolId(sid));
|
|
319
368
|
}
|
|
320
369
|
else {
|
|
321
370
|
de.logger.warn(de.application.i18n.serialized_project_referenced_0_not_part_of_project(id.toString()));
|
|
@@ -324,4 +373,3 @@ class ProjectReflection extends container_1.ContainerReflection {
|
|
|
324
373
|
});
|
|
325
374
|
}
|
|
326
375
|
}
|
|
327
|
-
exports.ProjectReflection = ProjectReflection;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DeclarationReflection } from "./declaration";
|
|
2
|
-
import type { Serializer, JSONOutput, Deserializer } from "../../serialization";
|
|
3
|
-
import type { Reflection } from "./abstract";
|
|
1
|
+
import { DeclarationReflection } from "./declaration.js";
|
|
2
|
+
import type { Serializer, JSONOutput, Deserializer } from "../../serialization/index.js";
|
|
3
|
+
import type { Reflection } from "./abstract.js";
|
|
4
4
|
/**
|
|
5
5
|
* Describes a reflection which does not exist at this location, but is referenced. Used for imported reflections.
|
|
6
6
|
*
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.ReferenceReflection = void 0;
|
|
4
|
-
const declaration_1 = require("./declaration");
|
|
5
|
-
const kind_1 = require("./kind");
|
|
1
|
+
import { DeclarationReflection } from "./declaration.js";
|
|
2
|
+
import { ReflectionKind } from "./kind.js";
|
|
6
3
|
/**
|
|
7
4
|
* Describes a reflection which does not exist at this location, but is referenced. Used for imported reflections.
|
|
8
5
|
*
|
|
@@ -17,14 +14,15 @@ const kind_1 = require("./kind");
|
|
|
17
14
|
* ```
|
|
18
15
|
* @category Reflections
|
|
19
16
|
*/
|
|
20
|
-
class ReferenceReflection extends
|
|
17
|
+
export class ReferenceReflection extends DeclarationReflection {
|
|
18
|
+
variant = "reference";
|
|
19
|
+
_target;
|
|
21
20
|
/**
|
|
22
21
|
* Creates a reference reflection. Should only be used within the factory function.
|
|
23
22
|
* @internal
|
|
24
23
|
*/
|
|
25
24
|
constructor(name, reflection, parent) {
|
|
26
|
-
super(name,
|
|
27
|
-
this.variant = "reference";
|
|
25
|
+
super(name, ReflectionKind.Reference, parent);
|
|
28
26
|
this._target = reflection.id;
|
|
29
27
|
}
|
|
30
28
|
/**
|
|
@@ -86,4 +84,3 @@ class ReferenceReflection extends declaration_1.DeclarationReflection {
|
|
|
86
84
|
});
|
|
87
85
|
}
|
|
88
86
|
}
|
|
89
|
-
exports.ReferenceReflection = ReferenceReflection;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type SomeType, type ReferenceType } from "../types";
|
|
2
|
-
import { Reflection, type TraverseCallback } from "./abstract";
|
|
3
|
-
import type { ParameterReflection } from "./parameter";
|
|
4
|
-
import type { TypeParameterReflection } from "./type-parameter";
|
|
5
|
-
import type { DeclarationReflection } from "./declaration";
|
|
6
|
-
import type { ReflectionKind } from "./kind";
|
|
7
|
-
import type { Serializer, JSONOutput, Deserializer } from "../../serialization";
|
|
8
|
-
import { SourceReference } from "../sources/file";
|
|
1
|
+
import { type SomeType, type ReferenceType } from "../types.js";
|
|
2
|
+
import { Reflection, type TraverseCallback } from "./abstract.js";
|
|
3
|
+
import type { ParameterReflection } from "./parameter.js";
|
|
4
|
+
import type { TypeParameterReflection } from "./type-parameter.js";
|
|
5
|
+
import type { DeclarationReflection } from "./declaration.js";
|
|
6
|
+
import type { ReflectionKind } from "./kind.js";
|
|
7
|
+
import type { Serializer, JSONOutput, Deserializer } from "../../serialization/index.js";
|
|
8
|
+
import { SourceReference } from "../sources/file.js";
|
|
9
9
|
/**
|
|
10
10
|
* @category Reflections
|
|
11
11
|
*/
|
|
@@ -1,32 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const types_1 = require("../types");
|
|
5
|
-
const abstract_1 = require("./abstract");
|
|
6
|
-
const file_1 = require("../sources/file");
|
|
1
|
+
import { ReflectionType } from "../types.js";
|
|
2
|
+
import { Reflection, TraverseProperty, } from "./abstract.js";
|
|
3
|
+
import { SourceReference } from "../sources/file.js";
|
|
7
4
|
/**
|
|
8
5
|
* @category Reflections
|
|
9
6
|
*/
|
|
10
|
-
class SignatureReflection extends
|
|
7
|
+
export class SignatureReflection extends Reflection {
|
|
8
|
+
variant = "signature";
|
|
11
9
|
// ESLint is wrong, we're restricting types to be more narrow.
|
|
12
10
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
13
11
|
constructor(name, kind, parent) {
|
|
14
12
|
super(name, kind, parent);
|
|
15
|
-
this.variant = "signature";
|
|
16
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* A list of all source files that contributed to this reflection.
|
|
16
|
+
*/
|
|
17
|
+
sources;
|
|
18
|
+
parameters;
|
|
19
|
+
typeParameters;
|
|
20
|
+
type;
|
|
21
|
+
/**
|
|
22
|
+
* A type that points to the reflection that has been overwritten by this reflection.
|
|
23
|
+
*
|
|
24
|
+
* Applies to interface and class members.
|
|
25
|
+
*/
|
|
26
|
+
overwrites;
|
|
27
|
+
/**
|
|
28
|
+
* A type that points to the reflection this reflection has been inherited from.
|
|
29
|
+
*
|
|
30
|
+
* Applies to interface and class members.
|
|
31
|
+
*/
|
|
32
|
+
inheritedFrom;
|
|
33
|
+
/**
|
|
34
|
+
* A type that points to the reflection this reflection is the implementation of.
|
|
35
|
+
*
|
|
36
|
+
* Applies to class members.
|
|
37
|
+
*/
|
|
38
|
+
implementationOf;
|
|
17
39
|
traverse(callback) {
|
|
18
|
-
if (this.type instanceof
|
|
19
|
-
if (callback(this.type.declaration,
|
|
40
|
+
if (this.type instanceof ReflectionType) {
|
|
41
|
+
if (callback(this.type.declaration, TraverseProperty.TypeLiteral) === false) {
|
|
20
42
|
return;
|
|
21
43
|
}
|
|
22
44
|
}
|
|
23
45
|
for (const parameter of this.typeParameters?.slice() || []) {
|
|
24
|
-
if (callback(parameter,
|
|
46
|
+
if (callback(parameter, TraverseProperty.TypeParameter) === false) {
|
|
25
47
|
return;
|
|
26
48
|
}
|
|
27
49
|
}
|
|
28
50
|
for (const parameter of this.parameters?.slice() || []) {
|
|
29
|
-
if (callback(parameter,
|
|
51
|
+
if (callback(parameter, TraverseProperty.Parameters) === false) {
|
|
30
52
|
return;
|
|
31
53
|
}
|
|
32
54
|
}
|
|
@@ -60,7 +82,7 @@ class SignatureReflection extends abstract_1.Reflection {
|
|
|
60
82
|
}
|
|
61
83
|
fromObject(de, obj) {
|
|
62
84
|
super.fromObject(de, obj);
|
|
63
|
-
this.sources = de.reviveMany(obj.sources, (t) => new
|
|
85
|
+
this.sources = de.reviveMany(obj.sources, (t) => new SourceReference(t.fileName, t.line, t.character));
|
|
64
86
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
65
87
|
if (obj.typeParameter) {
|
|
66
88
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
@@ -76,4 +98,3 @@ class SignatureReflection extends abstract_1.Reflection {
|
|
|
76
98
|
this.implementationOf = de.reviveType(obj.implementationOf);
|
|
77
99
|
}
|
|
78
100
|
}
|
|
79
|
-
exports.SignatureReflection = SignatureReflection;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { SomeType } from "../types";
|
|
2
|
-
import { Reflection, type TraverseCallback } from "./abstract";
|
|
3
|
-
import type { DeclarationReflection } from "./declaration";
|
|
4
|
-
import type { Serializer, JSONOutput, Deserializer } from "../../serialization";
|
|
5
|
-
import type { SignatureReflection } from "./signature";
|
|
1
|
+
import type { SomeType } from "../types.js";
|
|
2
|
+
import { Reflection, type TraverseCallback } from "./abstract.js";
|
|
3
|
+
import type { DeclarationReflection } from "./declaration.js";
|
|
4
|
+
import type { Serializer, JSONOutput, Deserializer } from "../../serialization/index.js";
|
|
5
|
+
import type { SignatureReflection } from "./signature.js";
|
|
6
6
|
/**
|
|
7
7
|
* Modifier flags for type parameters, added in TS 4.7
|
|
8
8
|
* @enum
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.TypeParameterReflection = exports.VarianceModifier = void 0;
|
|
4
|
-
const abstract_1 = require("./abstract");
|
|
5
|
-
const kind_1 = require("./kind");
|
|
1
|
+
import { Reflection } from "./abstract.js";
|
|
2
|
+
import { ReflectionKind } from "./kind.js";
|
|
6
3
|
/**
|
|
7
4
|
* Modifier flags for type parameters, added in TS 4.7
|
|
8
5
|
* @enum
|
|
9
6
|
*/
|
|
10
|
-
|
|
7
|
+
export const VarianceModifier = {
|
|
11
8
|
in: "in",
|
|
12
9
|
out: "out",
|
|
13
10
|
inOut: "in out",
|
|
@@ -15,10 +12,13 @@ exports.VarianceModifier = {
|
|
|
15
12
|
/**
|
|
16
13
|
* @category Reflections
|
|
17
14
|
*/
|
|
18
|
-
class TypeParameterReflection extends
|
|
15
|
+
export class TypeParameterReflection extends Reflection {
|
|
16
|
+
variant = "typeParam";
|
|
17
|
+
type;
|
|
18
|
+
default;
|
|
19
|
+
varianceModifier;
|
|
19
20
|
constructor(name, parent, varianceModifier) {
|
|
20
|
-
super(name,
|
|
21
|
-
this.variant = "typeParam";
|
|
21
|
+
super(name, ReflectionKind.TypeParameter, parent);
|
|
22
22
|
this.varianceModifier = varianceModifier;
|
|
23
23
|
}
|
|
24
24
|
toObject(serializer) {
|
|
@@ -40,4 +40,3 @@ class TypeParameterReflection extends abstract_1.Reflection {
|
|
|
40
40
|
// do nothing, no child reflections.
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
exports.TypeParameterReflection = TypeParameterReflection;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.splitUnquotedString = splitUnquotedString;
|
|
4
|
-
function splitUnquotedString(input, delimiter) {
|
|
1
|
+
export function splitUnquotedString(input, delimiter) {
|
|
5
2
|
if (input.startsWith(delimiter)) {
|
|
6
3
|
return splitUnquotedString(input.substring(delimiter.length), delimiter);
|
|
7
4
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { DeclarationReflection } from "./declaration";
|
|
2
|
-
import type { DocumentReflection } from "./document";
|
|
3
|
-
import type { ParameterReflection } from "./parameter";
|
|
4
|
-
import type { ProjectReflection } from "./project";
|
|
5
|
-
import type { ReferenceReflection } from "./reference";
|
|
6
|
-
import type { SignatureReflection } from "./signature";
|
|
7
|
-
import type { TypeParameterReflection } from "./type-parameter";
|
|
1
|
+
import type { DeclarationReflection } from "./declaration.js";
|
|
2
|
+
import type { DocumentReflection } from "./document.js";
|
|
3
|
+
import type { ParameterReflection } from "./parameter.js";
|
|
4
|
+
import type { ProjectReflection } from "./project.js";
|
|
5
|
+
import type { ReferenceReflection } from "./reference.js";
|
|
6
|
+
import type { SignatureReflection } from "./signature.js";
|
|
7
|
+
import type { TypeParameterReflection } from "./type-parameter.js";
|
|
8
8
|
/**
|
|
9
9
|
* A map of known {@link Reflection} concrete subclasses.
|
|
10
10
|
* This is used during deserialization to reconstruct serialized objects.
|
|
@@ -18,3 +18,4 @@ export interface ReflectionVariant {
|
|
|
18
18
|
typeParam: TypeParameterReflection;
|
|
19
19
|
document: DocumentReflection;
|
|
20
20
|
}
|
|
21
|
+
export type SomeReflection = ReflectionVariant[keyof ReflectionVariant];
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Deserializer } from "../../serialization/deserializer";
|
|
2
|
-
import type { SourceReference as JSONSourceReference } from "../../serialization/schema";
|
|
1
|
+
import type { Deserializer } from "../../serialization/deserializer.js";
|
|
2
|
+
import type { SourceReference as JSONSourceReference } from "../../serialization/schema.js";
|
|
3
3
|
/**
|
|
4
4
|
* Represents references of reflections to their defining source files.
|
|
5
5
|
*
|