typedoc 0.26.11 → 0.27.0-beta.1
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 +212 -239
- package/dist/lib/converter/factories/index-signature.d.ts +3 -3
- package/dist/lib/converter/factories/index-signature.js +43 -26
- 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 +372 -2
- package/dist/lib/internationalization/locales/en.d.cts +343 -2
- package/dist/lib/internationalization/locales/jp.cjs +13 -14
- package/dist/lib/internationalization/locales/jp.d.cts +307 -1
- package/dist/lib/internationalization/locales/ko.cjs +12 -11
- package/dist/lib/internationalization/locales/ko.d.cts +221 -1
- package/dist/lib/internationalization/locales/zh.cjs +43 -19
- package/dist/lib/internationalization/locales/zh.d.cts +409 -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 +29 -16
- 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 +624 -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 +14 -0
- package/dist/lib/output/output.js +91 -0
- package/dist/lib/output/plugins/AssetsPlugin.d.ts +9 -8
- package/dist/lib/output/plugins/AssetsPlugin.js +64 -80
- package/dist/lib/output/plugins/HierarchyPlugin.d.ts +7 -0
- package/dist/lib/output/plugins/HierarchyPlugin.js +67 -0
- 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 +7 -6
- package/dist/lib/output/plugins/index.js +7 -15
- package/dist/lib/output/renderer.d.ts +14 -13
- package/dist/lib/output/renderer.js +130 -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 +48 -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 +4 -4
- package/dist/lib/output/themes/default/partials/hierarchy.js +12 -15
- 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 +222 -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 +24 -22
- 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 +32 -34
- package/dist/lib/output/themes/lib.d.ts +17 -3
- package/dist/lib/output/themes/lib.js +118 -50
- 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 -6
- package/dist/lib/utils/jsx.elements.d.ts +1 -1
- package/dist/lib/utils/jsx.elements.js +3 -4
- package/dist/lib/utils/jsx.js +82 -52
- 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 +35 -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 +232 -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 +17 -14
- package/static/main.js +4 -4
- package/static/style.css +109 -17
- 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,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const array_1 = require("../utils/array");
|
|
13
|
-
const converter_events_1 = require("./converter-events");
|
|
14
|
-
const index_signature_1 = require("./factories/index-signature");
|
|
15
|
-
const signature_1 = require("./factories/signature");
|
|
16
|
-
const symbols_1 = require("./symbols");
|
|
17
|
-
const nodes_1 = require("./utils/nodes");
|
|
18
|
-
const reflections_1 = require("./utils/reflections");
|
|
1
|
+
import assert from "assert";
|
|
2
|
+
import ts from "typescript";
|
|
3
|
+
import { ArrayType, ConditionalType, DeclarationReflection, IndexedAccessType, InferredType, IntersectionType, IntrinsicType, NamedTupleMember, PredicateType, QueryType, ReferenceType, ReflectionKind, ReflectionType, LiteralType, TupleType, TypeOperatorType, UnionType, UnknownType, MappedType, SignatureReflection, ReflectionFlag, OptionalType, RestType, TemplateLiteralType, } from "../models/index.js";
|
|
4
|
+
import { ReflectionSymbolId } from "../models/reflections/ReflectionSymbolId.js";
|
|
5
|
+
import { zip } from "../utils/array.js";
|
|
6
|
+
import { ConverterEvents } from "./converter-events.js";
|
|
7
|
+
import { convertIndexSignatures } from "./factories/index-signature.js";
|
|
8
|
+
import { convertParameterNodes, convertTypeParameterNodes, createSignature, } from "./factories/signature.js";
|
|
9
|
+
import { convertSymbol } from "./symbols.js";
|
|
10
|
+
import { isObjectType } from "./utils/nodes.js";
|
|
11
|
+
import { removeUndefined } from "./utils/reflections.js";
|
|
19
12
|
const converters = new Map();
|
|
20
|
-
function loadConverters() {
|
|
13
|
+
export function loadConverters() {
|
|
21
14
|
if (converters.size)
|
|
22
15
|
return;
|
|
23
16
|
for (const actor of [
|
|
@@ -57,7 +50,7 @@ function loadConverters() {
|
|
|
57
50
|
// Might happen if running on an older TS version.
|
|
58
51
|
continue;
|
|
59
52
|
}
|
|
60
|
-
(
|
|
53
|
+
assert(!converters.has(key));
|
|
61
54
|
converters.set(key, actor);
|
|
62
55
|
}
|
|
63
56
|
}
|
|
@@ -72,12 +65,12 @@ function maybeConvertType(context, typeOrNode) {
|
|
|
72
65
|
return convertType(context, typeOrNode);
|
|
73
66
|
}
|
|
74
67
|
let typeConversionDepth = 0;
|
|
75
|
-
function convertType(context, typeOrNode) {
|
|
68
|
+
export function convertType(context, typeOrNode) {
|
|
76
69
|
if (!typeOrNode) {
|
|
77
|
-
return new
|
|
70
|
+
return new IntrinsicType("any");
|
|
78
71
|
}
|
|
79
72
|
if (typeConversionDepth > context.converter.maxTypeConversionDepth) {
|
|
80
|
-
return new
|
|
73
|
+
return new UnknownType("...");
|
|
81
74
|
}
|
|
82
75
|
loadConverters();
|
|
83
76
|
if ("kind" in typeOrNode) {
|
|
@@ -99,12 +92,12 @@ function convertType(context, typeOrNode) {
|
|
|
99
92
|
return convertType(context, typeOrNode.origin);
|
|
100
93
|
}
|
|
101
94
|
// IgnoreErrors is important, without it, we can't assert that we will get a node.
|
|
102
|
-
const node = context.checker.typeToTypeNode(typeOrNode, void 0,
|
|
103
|
-
(
|
|
95
|
+
const node = context.checker.typeToTypeNode(typeOrNode, void 0, ts.NodeBuilderFlags.IgnoreErrors);
|
|
96
|
+
assert(node); // According to the TS source of typeToString, this is a bug if it does not hold.
|
|
104
97
|
if (seenTypes.has(typeOrNode.id)) {
|
|
105
98
|
const typeString = context.checker.typeToString(typeOrNode);
|
|
106
99
|
context.logger.verbose(`Refusing to recurse when converting type: ${typeString}`);
|
|
107
|
-
return new
|
|
100
|
+
return new UnknownType(typeString);
|
|
108
101
|
}
|
|
109
102
|
let converter = converters.get(node.kind);
|
|
110
103
|
if (converter) {
|
|
@@ -123,70 +116,70 @@ function convertType(context, typeOrNode) {
|
|
|
123
116
|
return requestBugReport(context, typeOrNode);
|
|
124
117
|
}
|
|
125
118
|
const arrayConverter = {
|
|
126
|
-
kind: [
|
|
119
|
+
kind: [ts.SyntaxKind.ArrayType],
|
|
127
120
|
convert(context, node) {
|
|
128
|
-
return new
|
|
121
|
+
return new ArrayType(convertType(context, node.elementType));
|
|
129
122
|
},
|
|
130
123
|
convertType(context, type) {
|
|
131
124
|
const params = context.checker.getTypeArguments(type);
|
|
132
125
|
// This is *almost* always true... except for when this type is in the constraint of a type parameter see GH#1408
|
|
133
126
|
// assert(params.length === 1);
|
|
134
|
-
(
|
|
135
|
-
return new
|
|
127
|
+
assert(params.length > 0);
|
|
128
|
+
return new ArrayType(convertType(context, params[0]));
|
|
136
129
|
},
|
|
137
130
|
};
|
|
138
131
|
const conditionalConverter = {
|
|
139
|
-
kind: [
|
|
132
|
+
kind: [ts.SyntaxKind.ConditionalType],
|
|
140
133
|
convert(context, node) {
|
|
141
|
-
return new
|
|
134
|
+
return new ConditionalType(convertType(context, node.checkType), convertType(context, node.extendsType), convertType(context, node.trueType), convertType(context, node.falseType));
|
|
142
135
|
},
|
|
143
136
|
convertType(context, type) {
|
|
144
|
-
return new
|
|
137
|
+
return new ConditionalType(convertType(context, type.checkType), convertType(context, type.extendsType), convertType(context, type.resolvedTrueType), convertType(context, type.resolvedFalseType));
|
|
145
138
|
},
|
|
146
139
|
};
|
|
147
140
|
const constructorConverter = {
|
|
148
|
-
kind: [
|
|
141
|
+
kind: [ts.SyntaxKind.ConstructorType],
|
|
149
142
|
convert(context, node) {
|
|
150
143
|
const symbol = context.getSymbolAtLocation(node) ?? node.symbol;
|
|
151
144
|
const type = context.getTypeAtLocation(node);
|
|
152
145
|
if (!symbol || !type) {
|
|
153
|
-
return new
|
|
146
|
+
return new IntrinsicType("Function");
|
|
154
147
|
}
|
|
155
|
-
const reflection = new
|
|
148
|
+
const reflection = new DeclarationReflection("__type", ReflectionKind.Constructor, context.scope);
|
|
156
149
|
const rc = context.withScope(reflection);
|
|
157
150
|
rc.convertingTypeNode = true;
|
|
158
151
|
context.registerReflection(reflection, symbol);
|
|
159
|
-
context.converter.trigger(
|
|
160
|
-
const signature = new
|
|
152
|
+
context.converter.trigger(ConverterEvents.CREATE_DECLARATION, context, reflection);
|
|
153
|
+
const signature = new SignatureReflection("__type", ReflectionKind.ConstructorSignature, reflection);
|
|
161
154
|
// This is unfortunate... but seems the obvious place to put this with the current
|
|
162
155
|
// architecture. Ideally, this would be a property on a "ConstructorType"... but that
|
|
163
156
|
// needs to wait until TypeDoc 0.22 when making other breaking changes.
|
|
164
|
-
if (node.modifiers?.some((m) => m.kind ===
|
|
165
|
-
signature.setFlag(
|
|
157
|
+
if (node.modifiers?.some((m) => m.kind === ts.SyntaxKind.AbstractKeyword)) {
|
|
158
|
+
signature.setFlag(ReflectionFlag.Abstract);
|
|
166
159
|
}
|
|
167
|
-
context.project.registerSymbolId(signature, new
|
|
160
|
+
context.project.registerSymbolId(signature, new ReflectionSymbolId(symbol, node));
|
|
168
161
|
context.registerReflection(signature, void 0);
|
|
169
162
|
const signatureCtx = rc.withScope(signature);
|
|
170
163
|
reflection.signatures = [signature];
|
|
171
164
|
signature.type = convertType(signatureCtx, node.type);
|
|
172
|
-
signature.parameters =
|
|
173
|
-
signature.typeParameters =
|
|
174
|
-
return new
|
|
165
|
+
signature.parameters = convertParameterNodes(signatureCtx, signature, node.parameters);
|
|
166
|
+
signature.typeParameters = convertTypeParameterNodes(signatureCtx, node.typeParameters);
|
|
167
|
+
return new ReflectionType(reflection);
|
|
175
168
|
},
|
|
176
169
|
convertType(context, type) {
|
|
177
170
|
const symbol = type.getSymbol();
|
|
178
171
|
if (!symbol) {
|
|
179
|
-
return new
|
|
172
|
+
return new IntrinsicType("Function");
|
|
180
173
|
}
|
|
181
|
-
const reflection = new
|
|
174
|
+
const reflection = new DeclarationReflection("__type", ReflectionKind.Constructor, context.scope);
|
|
182
175
|
context.registerReflection(reflection, symbol);
|
|
183
|
-
context.converter.trigger(
|
|
184
|
-
|
|
185
|
-
return new
|
|
176
|
+
context.converter.trigger(ConverterEvents.CREATE_DECLARATION, context, reflection);
|
|
177
|
+
createSignature(context.withScope(reflection), ReflectionKind.ConstructorSignature, type.getConstructSignatures()[0], symbol);
|
|
178
|
+
return new ReflectionType(reflection);
|
|
186
179
|
},
|
|
187
180
|
};
|
|
188
181
|
const exprWithTypeArgsConverter = {
|
|
189
|
-
kind: [
|
|
182
|
+
kind: [ts.SyntaxKind.ExpressionWithTypeArguments],
|
|
190
183
|
convert(context, node) {
|
|
191
184
|
const targetSymbol = context.getSymbolAtLocation(node.expression);
|
|
192
185
|
// Mixins... we might not have a symbol here.
|
|
@@ -194,149 +187,149 @@ const exprWithTypeArgsConverter = {
|
|
|
194
187
|
return convertType(context, context.checker.getTypeAtLocation(node));
|
|
195
188
|
}
|
|
196
189
|
const parameters = node.typeArguments?.map((type) => convertType(context, type)) ?? [];
|
|
197
|
-
const ref =
|
|
190
|
+
const ref = ReferenceType.createSymbolReference(context.resolveAliasedSymbol(targetSymbol), context);
|
|
198
191
|
ref.typeArguments = parameters;
|
|
199
192
|
return ref;
|
|
200
193
|
},
|
|
201
194
|
convertType: requestBugReport,
|
|
202
195
|
};
|
|
203
196
|
const functionTypeConverter = {
|
|
204
|
-
kind: [
|
|
197
|
+
kind: [ts.SyntaxKind.FunctionType],
|
|
205
198
|
convert(context, node) {
|
|
206
199
|
const symbol = context.getSymbolAtLocation(node) ?? node.symbol;
|
|
207
200
|
const type = context.getTypeAtLocation(node);
|
|
208
201
|
if (!symbol || !type) {
|
|
209
|
-
return new
|
|
202
|
+
return new IntrinsicType("Function");
|
|
210
203
|
}
|
|
211
|
-
const reflection = new
|
|
204
|
+
const reflection = new DeclarationReflection("__type", ReflectionKind.TypeLiteral, context.scope);
|
|
212
205
|
const rc = context.withScope(reflection);
|
|
213
206
|
context.registerReflection(reflection, symbol);
|
|
214
|
-
context.converter.trigger(
|
|
215
|
-
const signature = new
|
|
216
|
-
context.project.registerSymbolId(signature, new
|
|
207
|
+
context.converter.trigger(ConverterEvents.CREATE_DECLARATION, context, reflection);
|
|
208
|
+
const signature = new SignatureReflection("__type", ReflectionKind.CallSignature, reflection);
|
|
209
|
+
context.project.registerSymbolId(signature, new ReflectionSymbolId(symbol, node));
|
|
217
210
|
context.registerReflection(signature, undefined);
|
|
218
211
|
const signatureCtx = rc.withScope(signature);
|
|
219
212
|
reflection.signatures = [signature];
|
|
220
213
|
signature.type = convertType(signatureCtx, node.type);
|
|
221
|
-
signature.parameters =
|
|
222
|
-
signature.typeParameters =
|
|
223
|
-
return new
|
|
214
|
+
signature.parameters = convertParameterNodes(signatureCtx, signature, node.parameters);
|
|
215
|
+
signature.typeParameters = convertTypeParameterNodes(signatureCtx, node.typeParameters);
|
|
216
|
+
return new ReflectionType(reflection);
|
|
224
217
|
},
|
|
225
218
|
convertType(context, type) {
|
|
226
219
|
const symbol = type.getSymbol();
|
|
227
220
|
if (!symbol) {
|
|
228
|
-
return new
|
|
221
|
+
return new IntrinsicType("Function");
|
|
229
222
|
}
|
|
230
|
-
const reflection = new
|
|
223
|
+
const reflection = new DeclarationReflection("__type", ReflectionKind.TypeLiteral, context.scope);
|
|
231
224
|
context.registerReflection(reflection, symbol);
|
|
232
|
-
context.converter.trigger(
|
|
233
|
-
|
|
234
|
-
return new
|
|
225
|
+
context.converter.trigger(ConverterEvents.CREATE_DECLARATION, context, reflection);
|
|
226
|
+
createSignature(context.withScope(reflection), ReflectionKind.CallSignature, type.getCallSignatures()[0], type.getSymbol());
|
|
227
|
+
return new ReflectionType(reflection);
|
|
235
228
|
},
|
|
236
229
|
};
|
|
237
230
|
const importType = {
|
|
238
|
-
kind: [
|
|
231
|
+
kind: [ts.SyntaxKind.ImportType],
|
|
239
232
|
convert(context, node) {
|
|
240
233
|
const name = node.qualifier?.getText() ?? "__module";
|
|
241
234
|
const symbol = context.checker.getSymbolAtLocation(node);
|
|
242
|
-
(
|
|
243
|
-
return
|
|
235
|
+
assert(symbol, "Missing symbol when converting import type node");
|
|
236
|
+
return ReferenceType.createSymbolReference(context.resolveAliasedSymbol(symbol), context, name);
|
|
244
237
|
},
|
|
245
238
|
convertType(context, type) {
|
|
246
239
|
const symbol = type.getSymbol();
|
|
247
|
-
(
|
|
248
|
-
return
|
|
240
|
+
assert(symbol, "Missing symbol when converting import type"); // Should be a compiler error
|
|
241
|
+
return ReferenceType.createSymbolReference(context.resolveAliasedSymbol(symbol), context, "__module");
|
|
249
242
|
},
|
|
250
243
|
};
|
|
251
244
|
const indexedAccessConverter = {
|
|
252
|
-
kind: [
|
|
245
|
+
kind: [ts.SyntaxKind.IndexedAccessType],
|
|
253
246
|
convert(context, node) {
|
|
254
|
-
return new
|
|
247
|
+
return new IndexedAccessType(convertType(context, node.objectType), convertType(context, node.indexType));
|
|
255
248
|
},
|
|
256
249
|
convertType(context, type) {
|
|
257
|
-
return new
|
|
250
|
+
return new IndexedAccessType(convertType(context, type.objectType), convertType(context, type.indexType));
|
|
258
251
|
},
|
|
259
252
|
};
|
|
260
253
|
const inferredConverter = {
|
|
261
|
-
kind: [
|
|
254
|
+
kind: [ts.SyntaxKind.InferType],
|
|
262
255
|
convert(context, node) {
|
|
263
|
-
return new
|
|
256
|
+
return new InferredType(node.typeParameter.name.text, maybeConvertType(context, node.typeParameter.constraint));
|
|
264
257
|
},
|
|
265
258
|
convertType(context, type) {
|
|
266
|
-
return new
|
|
259
|
+
return new InferredType(type.getSymbol().name, maybeConvertType(context, type.getConstraint()));
|
|
267
260
|
},
|
|
268
261
|
};
|
|
269
262
|
const intersectionConverter = {
|
|
270
|
-
kind: [
|
|
263
|
+
kind: [ts.SyntaxKind.IntersectionType],
|
|
271
264
|
convert(context, node) {
|
|
272
|
-
return new
|
|
265
|
+
return new IntersectionType(node.types.map((type) => convertType(context, type)));
|
|
273
266
|
},
|
|
274
267
|
convertType(context, type) {
|
|
275
|
-
return new
|
|
268
|
+
return new IntersectionType(type.types.map((type) => convertType(context, type)));
|
|
276
269
|
},
|
|
277
270
|
};
|
|
278
271
|
const intrinsicConverter = {
|
|
279
|
-
kind: [
|
|
272
|
+
kind: [ts.SyntaxKind.IntrinsicKeyword],
|
|
280
273
|
convert() {
|
|
281
|
-
return new
|
|
274
|
+
return new IntrinsicType("intrinsic");
|
|
282
275
|
},
|
|
283
276
|
convertType() {
|
|
284
|
-
return new
|
|
277
|
+
return new IntrinsicType("intrinsic");
|
|
285
278
|
},
|
|
286
279
|
};
|
|
287
280
|
const jsDocVariadicTypeConverter = {
|
|
288
|
-
kind: [
|
|
281
|
+
kind: [ts.SyntaxKind.JSDocVariadicType],
|
|
289
282
|
convert(context, node) {
|
|
290
|
-
return new
|
|
283
|
+
return new ArrayType(convertType(context, node.type));
|
|
291
284
|
},
|
|
292
285
|
// Should just be an ArrayType
|
|
293
286
|
convertType: requestBugReport,
|
|
294
287
|
};
|
|
295
288
|
const keywordNames = {
|
|
296
|
-
[
|
|
297
|
-
[
|
|
298
|
-
[
|
|
299
|
-
[
|
|
300
|
-
[
|
|
301
|
-
[
|
|
302
|
-
[
|
|
303
|
-
[
|
|
304
|
-
[
|
|
305
|
-
[
|
|
306
|
-
[
|
|
307
|
-
[
|
|
289
|
+
[ts.SyntaxKind.AnyKeyword]: "any",
|
|
290
|
+
[ts.SyntaxKind.BigIntKeyword]: "bigint",
|
|
291
|
+
[ts.SyntaxKind.BooleanKeyword]: "boolean",
|
|
292
|
+
[ts.SyntaxKind.NeverKeyword]: "never",
|
|
293
|
+
[ts.SyntaxKind.NumberKeyword]: "number",
|
|
294
|
+
[ts.SyntaxKind.ObjectKeyword]: "object",
|
|
295
|
+
[ts.SyntaxKind.StringKeyword]: "string",
|
|
296
|
+
[ts.SyntaxKind.SymbolKeyword]: "symbol",
|
|
297
|
+
[ts.SyntaxKind.UndefinedKeyword]: "undefined",
|
|
298
|
+
[ts.SyntaxKind.UnknownKeyword]: "unknown",
|
|
299
|
+
[ts.SyntaxKind.VoidKeyword]: "void",
|
|
300
|
+
[ts.SyntaxKind.IntrinsicKeyword]: "intrinsic",
|
|
308
301
|
};
|
|
309
302
|
const keywordConverter = {
|
|
310
303
|
kind: [
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
304
|
+
ts.SyntaxKind.AnyKeyword,
|
|
305
|
+
ts.SyntaxKind.BigIntKeyword,
|
|
306
|
+
ts.SyntaxKind.BooleanKeyword,
|
|
307
|
+
ts.SyntaxKind.NeverKeyword,
|
|
308
|
+
ts.SyntaxKind.NumberKeyword,
|
|
309
|
+
ts.SyntaxKind.ObjectKeyword,
|
|
310
|
+
ts.SyntaxKind.StringKeyword,
|
|
311
|
+
ts.SyntaxKind.SymbolKeyword,
|
|
312
|
+
ts.SyntaxKind.UndefinedKeyword,
|
|
313
|
+
ts.SyntaxKind.UnknownKeyword,
|
|
314
|
+
ts.SyntaxKind.VoidKeyword,
|
|
322
315
|
],
|
|
323
316
|
convert(_context, node) {
|
|
324
|
-
return new
|
|
317
|
+
return new IntrinsicType(keywordNames[node.kind]);
|
|
325
318
|
},
|
|
326
319
|
convertType(_context, _type, node) {
|
|
327
|
-
return new
|
|
320
|
+
return new IntrinsicType(keywordNames[node.kind]);
|
|
328
321
|
},
|
|
329
322
|
};
|
|
330
323
|
const optionalConverter = {
|
|
331
|
-
kind: [
|
|
324
|
+
kind: [ts.SyntaxKind.OptionalType],
|
|
332
325
|
convert(context, node) {
|
|
333
|
-
return new
|
|
326
|
+
return new OptionalType(removeUndefined(convertType(context, node.type)));
|
|
334
327
|
},
|
|
335
328
|
// Handled by the tuple converter
|
|
336
329
|
convertType: requestBugReport,
|
|
337
330
|
};
|
|
338
331
|
const parensConverter = {
|
|
339
|
-
kind: [
|
|
332
|
+
kind: [ts.SyntaxKind.ParenthesizedType],
|
|
340
333
|
convert(context, node) {
|
|
341
334
|
return convertType(context, node.type);
|
|
342
335
|
},
|
|
@@ -344,14 +337,14 @@ const parensConverter = {
|
|
|
344
337
|
convertType: requestBugReport,
|
|
345
338
|
};
|
|
346
339
|
const predicateConverter = {
|
|
347
|
-
kind: [
|
|
340
|
+
kind: [ts.SyntaxKind.TypePredicate],
|
|
348
341
|
convert(context, node) {
|
|
349
|
-
const name =
|
|
342
|
+
const name = ts.isThisTypeNode(node.parameterName)
|
|
350
343
|
? "this"
|
|
351
344
|
: node.parameterName.getText();
|
|
352
345
|
const asserts = !!node.assertsModifier;
|
|
353
346
|
const targetType = node.type ? convertType(context, node.type) : void 0;
|
|
354
|
-
return new
|
|
347
|
+
return new PredicateType(name, asserts, targetType);
|
|
355
348
|
},
|
|
356
349
|
// Never inferred by TS 4.0, could potentially change in a future TS version.
|
|
357
350
|
convertType: requestBugReport,
|
|
@@ -359,85 +352,98 @@ const predicateConverter = {
|
|
|
359
352
|
// This is a horrible thing... we're going to want to split this into converters
|
|
360
353
|
// for different types at some point.
|
|
361
354
|
const typeLiteralConverter = {
|
|
362
|
-
kind: [
|
|
355
|
+
kind: [ts.SyntaxKind.TypeLiteral],
|
|
363
356
|
convert(context, node) {
|
|
364
357
|
const symbol = context.getSymbolAtLocation(node) ?? node.symbol;
|
|
365
358
|
const type = context.getTypeAtLocation(node);
|
|
366
359
|
if (!symbol || !type) {
|
|
367
|
-
return new
|
|
360
|
+
return new IntrinsicType("Object");
|
|
368
361
|
}
|
|
369
|
-
const reflection = new
|
|
362
|
+
const reflection = new DeclarationReflection("__type", ReflectionKind.TypeLiteral, context.scope);
|
|
370
363
|
const rc = context.withScope(reflection);
|
|
371
364
|
rc.convertingTypeNode = true;
|
|
372
365
|
context.registerReflection(reflection, symbol);
|
|
373
|
-
context.converter.trigger(
|
|
366
|
+
context.converter.trigger(ConverterEvents.CREATE_DECLARATION, context, reflection);
|
|
374
367
|
for (const prop of context.checker.getPropertiesOfType(type)) {
|
|
375
|
-
|
|
368
|
+
convertSymbol(rc, prop);
|
|
376
369
|
}
|
|
377
370
|
for (const signature of type.getCallSignatures()) {
|
|
378
|
-
|
|
371
|
+
createSignature(rc, ReflectionKind.CallSignature, signature, symbol);
|
|
379
372
|
}
|
|
380
373
|
for (const signature of type.getConstructSignatures()) {
|
|
381
|
-
|
|
374
|
+
createSignature(rc, ReflectionKind.ConstructorSignature, signature, symbol);
|
|
382
375
|
}
|
|
383
|
-
|
|
384
|
-
return new
|
|
376
|
+
convertIndexSignatures(rc, type);
|
|
377
|
+
return new ReflectionType(reflection);
|
|
385
378
|
},
|
|
386
379
|
convertType(context, type) {
|
|
387
380
|
const symbol = type.getSymbol();
|
|
388
|
-
const reflection = new
|
|
381
|
+
const reflection = new DeclarationReflection("__type", ReflectionKind.TypeLiteral, context.scope);
|
|
389
382
|
context.registerReflection(reflection, symbol);
|
|
390
|
-
context.converter.trigger(
|
|
383
|
+
context.converter.trigger(ConverterEvents.CREATE_DECLARATION, context, reflection);
|
|
391
384
|
for (const prop of context.checker.getPropertiesOfType(type)) {
|
|
392
|
-
|
|
385
|
+
convertSymbol(context.withScope(reflection), prop);
|
|
393
386
|
}
|
|
394
387
|
for (const signature of type.getCallSignatures()) {
|
|
395
|
-
|
|
388
|
+
createSignature(context.withScope(reflection), ReflectionKind.CallSignature, signature, symbol);
|
|
396
389
|
}
|
|
397
390
|
for (const signature of type.getConstructSignatures()) {
|
|
398
|
-
|
|
391
|
+
createSignature(context.withScope(reflection), ReflectionKind.ConstructorSignature, signature, symbol);
|
|
399
392
|
}
|
|
400
393
|
if (symbol) {
|
|
401
|
-
|
|
394
|
+
convertIndexSignatures(context.withScope(reflection), type);
|
|
402
395
|
}
|
|
403
|
-
return new
|
|
396
|
+
return new ReflectionType(reflection);
|
|
404
397
|
},
|
|
405
398
|
};
|
|
406
399
|
const queryConverter = {
|
|
407
|
-
kind: [
|
|
400
|
+
kind: [ts.SyntaxKind.TypeQuery],
|
|
408
401
|
convert(context, node) {
|
|
409
402
|
const querySymbol = context.getSymbolAtLocation(node.exprName);
|
|
410
403
|
if (!querySymbol) {
|
|
411
404
|
// This can happen if someone uses `typeof` on some property
|
|
412
405
|
// on a variable typed as `any` with a name that doesn't exist.
|
|
413
|
-
return new
|
|
406
|
+
return new QueryType(ReferenceType.createBrokenReference(node.exprName.getText(), context.project));
|
|
414
407
|
}
|
|
415
|
-
const ref =
|
|
408
|
+
const ref = ReferenceType.createSymbolReference(context.resolveAliasedSymbol(querySymbol), context, node.exprName.getText());
|
|
416
409
|
ref.preferValues = true;
|
|
417
|
-
return new
|
|
410
|
+
return new QueryType(ref);
|
|
418
411
|
},
|
|
419
412
|
convertType(context, type, node) {
|
|
420
413
|
// Order matters here - check the node location first so that if the typeof is targeting
|
|
421
414
|
// an instantiation expression we get the user's exprName.
|
|
422
415
|
const symbol = context.getSymbolAtLocation(node.exprName) || type.getSymbol();
|
|
423
|
-
(
|
|
424
|
-
const ref =
|
|
416
|
+
assert(symbol, `Query type failed to get a symbol for: ${context.checker.typeToString(type)}. This is a bug.`);
|
|
417
|
+
const ref = ReferenceType.createSymbolReference(context.resolveAliasedSymbol(symbol), context);
|
|
425
418
|
ref.preferValues = true;
|
|
426
|
-
return new
|
|
419
|
+
return new QueryType(ref);
|
|
427
420
|
},
|
|
428
421
|
};
|
|
429
422
|
const referenceConverter = {
|
|
430
|
-
kind: [
|
|
423
|
+
kind: [ts.SyntaxKind.TypeReference],
|
|
431
424
|
convert(context, node) {
|
|
432
|
-
const
|
|
425
|
+
const type = context.checker.getTypeAtLocation(node.typeName);
|
|
426
|
+
const isArray = context.checker.typeToTypeNode(type, void 0, ts.NodeBuilderFlags.IgnoreErrors)?.kind === ts.SyntaxKind.ArrayType;
|
|
433
427
|
if (isArray) {
|
|
434
|
-
return new
|
|
428
|
+
return new ArrayType(convertType(context, node.typeArguments?.[0]));
|
|
435
429
|
}
|
|
436
430
|
const symbol = context.expectSymbolAtLocation(node.typeName);
|
|
431
|
+
// Ignore @inline if there are type arguments, as they won't be resolved
|
|
432
|
+
// in the type we just retrieved from node.typeName.
|
|
433
|
+
if (!node.typeArguments &&
|
|
434
|
+
context
|
|
435
|
+
.getComment(symbol, ReflectionKind.Interface)
|
|
436
|
+
?.hasModifier("@inline")) {
|
|
437
|
+
// typeLiteralConverter doesn't use the node, so we can get away with lying here.
|
|
438
|
+
// This might not actually be safe, it appears that it is in the relatively small
|
|
439
|
+
// amount of testing I've done with it, but I wouldn't be surprised if someone manages
|
|
440
|
+
// to find a crash.
|
|
441
|
+
return typeLiteralConverter.convertType(context, type, null);
|
|
442
|
+
}
|
|
437
443
|
const name = node.typeName.getText();
|
|
438
|
-
const
|
|
439
|
-
|
|
440
|
-
return
|
|
444
|
+
const ref = ReferenceType.createSymbolReference(context.resolveAliasedSymbol(symbol), context, name);
|
|
445
|
+
ref.typeArguments = node.typeArguments?.map((type) => convertType(context, type));
|
|
446
|
+
return ref;
|
|
441
447
|
},
|
|
442
448
|
convertType(context, type, node) {
|
|
443
449
|
// typeName.symbol handles the case where this is a union which happens to refer
|
|
@@ -447,25 +453,34 @@ const referenceConverter = {
|
|
|
447
453
|
if (!symbol) {
|
|
448
454
|
// This happens when we get a reference to a type parameter
|
|
449
455
|
// created within a mapped type, `K` in: `{ [K in T]: string }`
|
|
450
|
-
const ref =
|
|
456
|
+
const ref = ReferenceType.createBrokenReference(context.checker.typeToString(type), context.project);
|
|
451
457
|
ref.refersToTypeParameter = true;
|
|
452
458
|
return ref;
|
|
453
459
|
}
|
|
460
|
+
if (context
|
|
461
|
+
.getComment(symbol, ReflectionKind.Interface)
|
|
462
|
+
?.hasModifier("@inline")) {
|
|
463
|
+
// typeLiteralConverter doesn't use the node, so we can get away with lying here.
|
|
464
|
+
// This might not actually be safe, it appears that it is in the relatively small
|
|
465
|
+
// amount of testing I've done with it, but I wouldn't be surprised if someone manages
|
|
466
|
+
// to find a crash.
|
|
467
|
+
return typeLiteralConverter.convertType(context, type, null);
|
|
468
|
+
}
|
|
454
469
|
let name;
|
|
455
|
-
if (
|
|
470
|
+
if (ts.isIdentifier(node.typeName)) {
|
|
456
471
|
name = node.typeName.text;
|
|
457
472
|
}
|
|
458
473
|
else {
|
|
459
474
|
name = node.typeName.right.text;
|
|
460
475
|
}
|
|
461
|
-
const ref =
|
|
462
|
-
if (type.flags &
|
|
476
|
+
const ref = ReferenceType.createSymbolReference(context.resolveAliasedSymbol(symbol), context, name);
|
|
477
|
+
if (type.flags & ts.TypeFlags.Substitution) {
|
|
463
478
|
// NoInfer<T>
|
|
464
479
|
ref.typeArguments = [
|
|
465
480
|
convertType(context, type.baseType),
|
|
466
481
|
];
|
|
467
482
|
}
|
|
468
|
-
else if (type.flags &
|
|
483
|
+
else if (type.flags & ts.TypeFlags.StringMapping) {
|
|
469
484
|
ref.typeArguments = [
|
|
470
485
|
convertType(context, type.type),
|
|
471
486
|
];
|
|
@@ -479,18 +494,18 @@ const referenceConverter = {
|
|
|
479
494
|
},
|
|
480
495
|
};
|
|
481
496
|
const restConverter = {
|
|
482
|
-
kind: [
|
|
497
|
+
kind: [ts.SyntaxKind.RestType],
|
|
483
498
|
convert(context, node) {
|
|
484
|
-
return new
|
|
499
|
+
return new RestType(convertType(context, node.type));
|
|
485
500
|
},
|
|
486
501
|
// This is handled in the tuple converter
|
|
487
502
|
convertType: requestBugReport,
|
|
488
503
|
};
|
|
489
504
|
const namedTupleMemberConverter = {
|
|
490
|
-
kind: [
|
|
505
|
+
kind: [ts.SyntaxKind.NamedTupleMember],
|
|
491
506
|
convert(context, node) {
|
|
492
507
|
const innerType = convertType(context, node.type);
|
|
493
|
-
return new
|
|
508
|
+
return new NamedTupleMember(node.name.getText(), !!node.questionToken, innerType);
|
|
494
509
|
},
|
|
495
510
|
// This ought to be impossible.
|
|
496
511
|
convertType: requestBugReport,
|
|
@@ -502,103 +517,103 @@ const namedTupleMemberConverter = {
|
|
|
502
517
|
// ^ questionToken
|
|
503
518
|
// ^^^^^^ type
|
|
504
519
|
const mappedConverter = {
|
|
505
|
-
kind: [
|
|
520
|
+
kind: [ts.SyntaxKind.MappedType],
|
|
506
521
|
convert(context, node) {
|
|
507
522
|
const optionalModifier = kindToModifier(node.questionToken?.kind);
|
|
508
523
|
const templateType = convertType(context, node.type);
|
|
509
|
-
return new
|
|
510
|
-
?
|
|
524
|
+
return new MappedType(node.typeParameter.name.text, convertType(context, node.typeParameter.constraint), optionalModifier === "+"
|
|
525
|
+
? removeUndefined(templateType)
|
|
511
526
|
: templateType, kindToModifier(node.readonlyToken?.kind), optionalModifier, node.nameType ? convertType(context, node.nameType) : void 0);
|
|
512
527
|
},
|
|
513
528
|
convertType(context, type, node) {
|
|
514
529
|
// This can happen if a generic function does not have a return type annotated.
|
|
515
530
|
const optionalModifier = kindToModifier(node.questionToken?.kind);
|
|
516
531
|
const templateType = convertType(context, type.templateType);
|
|
517
|
-
return new
|
|
518
|
-
?
|
|
532
|
+
return new MappedType(type.typeParameter.symbol.name || "__type", convertType(context, type.typeParameter.getConstraint()), optionalModifier === "+"
|
|
533
|
+
? removeUndefined(templateType)
|
|
519
534
|
: templateType, kindToModifier(node.readonlyToken?.kind), optionalModifier, type.nameType ? convertType(context, type.nameType) : void 0);
|
|
520
535
|
},
|
|
521
536
|
};
|
|
522
537
|
const literalTypeConverter = {
|
|
523
|
-
kind: [
|
|
538
|
+
kind: [ts.SyntaxKind.LiteralType],
|
|
524
539
|
convert(context, node) {
|
|
525
540
|
switch (node.literal.kind) {
|
|
526
|
-
case
|
|
527
|
-
case
|
|
528
|
-
return new
|
|
529
|
-
case
|
|
530
|
-
return new
|
|
531
|
-
case
|
|
532
|
-
return new
|
|
533
|
-
case
|
|
534
|
-
return new
|
|
535
|
-
case
|
|
541
|
+
case ts.SyntaxKind.TrueKeyword:
|
|
542
|
+
case ts.SyntaxKind.FalseKeyword:
|
|
543
|
+
return new LiteralType(node.literal.kind === ts.SyntaxKind.TrueKeyword);
|
|
544
|
+
case ts.SyntaxKind.StringLiteral:
|
|
545
|
+
return new LiteralType(node.literal.text);
|
|
546
|
+
case ts.SyntaxKind.NumericLiteral:
|
|
547
|
+
return new LiteralType(Number(node.literal.text));
|
|
548
|
+
case ts.SyntaxKind.NullKeyword:
|
|
549
|
+
return new LiteralType(null);
|
|
550
|
+
case ts.SyntaxKind.PrefixUnaryExpression: {
|
|
536
551
|
const operand = node.literal
|
|
537
552
|
.operand;
|
|
538
553
|
switch (operand.kind) {
|
|
539
|
-
case
|
|
540
|
-
return new
|
|
541
|
-
case
|
|
542
|
-
return new
|
|
554
|
+
case ts.SyntaxKind.NumericLiteral:
|
|
555
|
+
return new LiteralType(Number(node.literal.getText()));
|
|
556
|
+
case ts.SyntaxKind.BigIntLiteral:
|
|
557
|
+
return new LiteralType(BigInt(node.literal.getText().replace("n", "")));
|
|
543
558
|
default:
|
|
544
559
|
return requestBugReport(context, node.literal);
|
|
545
560
|
}
|
|
546
561
|
}
|
|
547
|
-
case
|
|
548
|
-
return new
|
|
549
|
-
case
|
|
550
|
-
return new
|
|
562
|
+
case ts.SyntaxKind.BigIntLiteral:
|
|
563
|
+
return new LiteralType(BigInt(node.literal.getText().replace("n", "")));
|
|
564
|
+
case ts.SyntaxKind.NoSubstitutionTemplateLiteral:
|
|
565
|
+
return new LiteralType(node.literal.text);
|
|
551
566
|
}
|
|
552
567
|
return requestBugReport(context, node.literal);
|
|
553
568
|
},
|
|
554
569
|
convertType(_context, type, node) {
|
|
555
570
|
switch (node.literal.kind) {
|
|
556
|
-
case
|
|
557
|
-
return new
|
|
558
|
-
case
|
|
559
|
-
return new
|
|
560
|
-
case
|
|
561
|
-
case
|
|
562
|
-
return new
|
|
563
|
-
case
|
|
564
|
-
return new
|
|
571
|
+
case ts.SyntaxKind.StringLiteral:
|
|
572
|
+
return new LiteralType(node.literal.text);
|
|
573
|
+
case ts.SyntaxKind.NumericLiteral:
|
|
574
|
+
return new LiteralType(+node.literal.text);
|
|
575
|
+
case ts.SyntaxKind.TrueKeyword:
|
|
576
|
+
case ts.SyntaxKind.FalseKeyword:
|
|
577
|
+
return new LiteralType(node.literal.kind === ts.SyntaxKind.TrueKeyword);
|
|
578
|
+
case ts.SyntaxKind.NullKeyword:
|
|
579
|
+
return new LiteralType(null);
|
|
565
580
|
}
|
|
566
581
|
if (typeof type.value === "object") {
|
|
567
|
-
return new
|
|
582
|
+
return new LiteralType(BigInt(`${type.value.negative ? "-" : ""}${type.value.base10Value}`));
|
|
568
583
|
}
|
|
569
|
-
return new
|
|
584
|
+
return new LiteralType(type.value);
|
|
570
585
|
},
|
|
571
586
|
};
|
|
572
587
|
const templateLiteralConverter = {
|
|
573
|
-
kind: [
|
|
588
|
+
kind: [ts.SyntaxKind.TemplateLiteralType],
|
|
574
589
|
convert(context, node) {
|
|
575
|
-
return new
|
|
590
|
+
return new TemplateLiteralType(node.head.text, node.templateSpans.map((span) => {
|
|
576
591
|
return [convertType(context, span.type), span.literal.text];
|
|
577
592
|
}));
|
|
578
593
|
},
|
|
579
594
|
convertType(context, type) {
|
|
580
|
-
(
|
|
595
|
+
assert(type.texts.length === type.types.length + 1);
|
|
581
596
|
const parts = [];
|
|
582
|
-
for (const [a, b] of
|
|
597
|
+
for (const [a, b] of zip(type.types, type.texts.slice(1))) {
|
|
583
598
|
parts.push([convertType(context, a), b]);
|
|
584
599
|
}
|
|
585
|
-
return new
|
|
600
|
+
return new TemplateLiteralType(type.texts[0], parts);
|
|
586
601
|
},
|
|
587
602
|
};
|
|
588
603
|
const thisConverter = {
|
|
589
|
-
kind: [
|
|
604
|
+
kind: [ts.SyntaxKind.ThisType],
|
|
590
605
|
convert() {
|
|
591
|
-
return new
|
|
606
|
+
return new IntrinsicType("this");
|
|
592
607
|
},
|
|
593
608
|
convertType() {
|
|
594
|
-
return new
|
|
609
|
+
return new IntrinsicType("this");
|
|
595
610
|
},
|
|
596
611
|
};
|
|
597
612
|
const tupleConverter = {
|
|
598
|
-
kind: [
|
|
613
|
+
kind: [ts.SyntaxKind.TupleType],
|
|
599
614
|
convert(context, node) {
|
|
600
615
|
const elements = node.elements.map((node) => convertType(context, node));
|
|
601
|
-
return new
|
|
616
|
+
return new TupleType(elements);
|
|
602
617
|
},
|
|
603
618
|
convertType(context, type, node) {
|
|
604
619
|
const types = type.typeArguments?.slice(0, node.elements.length);
|
|
@@ -608,56 +623,56 @@ const tupleConverter = {
|
|
|
608
623
|
elements = elements?.map((el, i) => {
|
|
609
624
|
const namedDecl = namedDeclarations[i];
|
|
610
625
|
return namedDecl
|
|
611
|
-
? new
|
|
626
|
+
? new NamedTupleMember(namedDecl.name.getText(), !!namedDecl.questionToken, removeUndefined(el))
|
|
612
627
|
: el;
|
|
613
628
|
});
|
|
614
629
|
}
|
|
615
630
|
elements = elements?.map((el, i) => {
|
|
616
|
-
if (type.target.elementFlags[i] &
|
|
631
|
+
if (type.target.elementFlags[i] & ts.ElementFlags.Variable) {
|
|
617
632
|
// In the node case, we don't need to add the wrapping Array type... but we do here.
|
|
618
|
-
if (el instanceof
|
|
619
|
-
return new
|
|
633
|
+
if (el instanceof NamedTupleMember) {
|
|
634
|
+
return new RestType(new NamedTupleMember(el.name, el.isOptional, new ArrayType(el.element)));
|
|
620
635
|
}
|
|
621
|
-
return new
|
|
636
|
+
return new RestType(new ArrayType(el));
|
|
622
637
|
}
|
|
623
|
-
if (type.target.elementFlags[i] &
|
|
624
|
-
!(el instanceof
|
|
625
|
-
return new
|
|
638
|
+
if (type.target.elementFlags[i] & ts.ElementFlags.Optional &&
|
|
639
|
+
!(el instanceof NamedTupleMember)) {
|
|
640
|
+
return new OptionalType(removeUndefined(el));
|
|
626
641
|
}
|
|
627
642
|
return el;
|
|
628
643
|
});
|
|
629
|
-
return new
|
|
644
|
+
return new TupleType(elements ?? []);
|
|
630
645
|
},
|
|
631
646
|
};
|
|
632
647
|
const supportedOperatorNames = {
|
|
633
|
-
[
|
|
634
|
-
[
|
|
635
|
-
[
|
|
648
|
+
[ts.SyntaxKind.KeyOfKeyword]: "keyof",
|
|
649
|
+
[ts.SyntaxKind.UniqueKeyword]: "unique",
|
|
650
|
+
[ts.SyntaxKind.ReadonlyKeyword]: "readonly",
|
|
636
651
|
};
|
|
637
652
|
const typeOperatorConverter = {
|
|
638
|
-
kind: [
|
|
653
|
+
kind: [ts.SyntaxKind.TypeOperator],
|
|
639
654
|
convert(context, node) {
|
|
640
|
-
return new
|
|
655
|
+
return new TypeOperatorType(convertType(context, node.type), supportedOperatorNames[node.operator]);
|
|
641
656
|
},
|
|
642
657
|
convertType(context, type, node) {
|
|
643
658
|
// readonly is only valid on array and tuple literal types.
|
|
644
|
-
if (node.operator ===
|
|
659
|
+
if (node.operator === ts.SyntaxKind.ReadonlyKeyword) {
|
|
645
660
|
const resolved = resolveReference(type);
|
|
646
|
-
(
|
|
661
|
+
assert(isObjectType(resolved));
|
|
647
662
|
const args = context.checker
|
|
648
663
|
.getTypeArguments(type)
|
|
649
664
|
.map((type) => convertType(context, type));
|
|
650
|
-
const inner = resolved.objectFlags &
|
|
651
|
-
? new
|
|
652
|
-
: new
|
|
653
|
-
return new
|
|
665
|
+
const inner = resolved.objectFlags & ts.ObjectFlags.Tuple
|
|
666
|
+
? new TupleType(args)
|
|
667
|
+
: new ArrayType(args[0]);
|
|
668
|
+
return new TypeOperatorType(inner, "readonly");
|
|
654
669
|
}
|
|
655
670
|
// keyof will only show up with generic functions, otherwise it gets eagerly
|
|
656
671
|
// resolved to a union of strings.
|
|
657
|
-
if (node.operator ===
|
|
672
|
+
if (node.operator === ts.SyntaxKind.KeyOfKeyword) {
|
|
658
673
|
// There's probably an interface for this somewhere... I couldn't find it.
|
|
659
674
|
const targetType = type.type;
|
|
660
|
-
return new
|
|
675
|
+
return new TypeOperatorType(convertType(context, targetType), "keyof");
|
|
661
676
|
}
|
|
662
677
|
// TS drops `unique` in `unique symbol` everywhere. If someone used it, we ought
|
|
663
678
|
// to have a type node. This shouldn't ever happen.
|
|
@@ -665,30 +680,30 @@ const typeOperatorConverter = {
|
|
|
665
680
|
},
|
|
666
681
|
};
|
|
667
682
|
const unionConverter = {
|
|
668
|
-
kind: [
|
|
683
|
+
kind: [ts.SyntaxKind.UnionType],
|
|
669
684
|
convert(context, node) {
|
|
670
|
-
return new
|
|
685
|
+
return new UnionType(node.types.map((type) => convertType(context, type)));
|
|
671
686
|
},
|
|
672
687
|
convertType(context, type) {
|
|
673
688
|
const types = type.types.map((type) => convertType(context, type));
|
|
674
689
|
normalizeUnion(types);
|
|
675
690
|
sortLiteralUnion(types);
|
|
676
|
-
return new
|
|
691
|
+
return new UnionType(types);
|
|
677
692
|
},
|
|
678
693
|
};
|
|
679
694
|
const jsDocNullableTypeConverter = {
|
|
680
|
-
kind: [
|
|
695
|
+
kind: [ts.SyntaxKind.JSDocNullableType],
|
|
681
696
|
convert(context, node) {
|
|
682
|
-
return new
|
|
697
|
+
return new UnionType([
|
|
683
698
|
convertType(context, node.type),
|
|
684
|
-
new
|
|
699
|
+
new LiteralType(null),
|
|
685
700
|
]);
|
|
686
701
|
},
|
|
687
702
|
// Should be a UnionType
|
|
688
703
|
convertType: requestBugReport,
|
|
689
704
|
};
|
|
690
705
|
const jsDocNonNullableTypeConverter = {
|
|
691
|
-
kind: [
|
|
706
|
+
kind: [ts.SyntaxKind.JSDocNonNullableType],
|
|
692
707
|
convert(context, node) {
|
|
693
708
|
return convertType(context, node.type);
|
|
694
709
|
},
|
|
@@ -697,29 +712,29 @@ const jsDocNonNullableTypeConverter = {
|
|
|
697
712
|
};
|
|
698
713
|
function requestBugReport(context, nodeOrType) {
|
|
699
714
|
if ("kind" in nodeOrType) {
|
|
700
|
-
const kindName =
|
|
715
|
+
const kindName = ts.SyntaxKind[nodeOrType.kind];
|
|
701
716
|
context.logger.warn(`Failed to convert type node with kind: ${kindName} and text ${nodeOrType.getText()}. Please report a bug.`, nodeOrType);
|
|
702
|
-
return new
|
|
717
|
+
return new UnknownType(nodeOrType.getText());
|
|
703
718
|
}
|
|
704
719
|
else {
|
|
705
720
|
const typeString = context.checker.typeToString(nodeOrType);
|
|
706
721
|
context.logger.warn(`Failed to convert type: ${typeString} when converting ${context.scope.getFullName()}. Please report a bug.`);
|
|
707
|
-
return new
|
|
722
|
+
return new UnknownType(typeString);
|
|
708
723
|
}
|
|
709
724
|
}
|
|
710
725
|
function resolveReference(type) {
|
|
711
|
-
if (
|
|
726
|
+
if (isObjectType(type) && type.objectFlags & ts.ObjectFlags.Reference) {
|
|
712
727
|
return type.target;
|
|
713
728
|
}
|
|
714
729
|
return type;
|
|
715
730
|
}
|
|
716
731
|
function kindToModifier(kind) {
|
|
717
732
|
switch (kind) {
|
|
718
|
-
case
|
|
719
|
-
case
|
|
720
|
-
case
|
|
733
|
+
case ts.SyntaxKind.ReadonlyKeyword:
|
|
734
|
+
case ts.SyntaxKind.QuestionToken:
|
|
735
|
+
case ts.SyntaxKind.PlusToken:
|
|
721
736
|
return "+";
|
|
722
|
-
case
|
|
737
|
+
case ts.SyntaxKind.MinusToken:
|
|
723
738
|
return "-";
|
|
724
739
|
default:
|
|
725
740
|
return undefined;
|
|
@@ -740,7 +755,7 @@ function normalizeUnion(types) {
|
|
|
740
755
|
let falseIndex = -1;
|
|
741
756
|
for (let i = 0; i < types.length && (trueIndex === -1 || falseIndex === -1); i++) {
|
|
742
757
|
const t = types[i];
|
|
743
|
-
if (t instanceof
|
|
758
|
+
if (t instanceof LiteralType) {
|
|
744
759
|
if (t.value === true) {
|
|
745
760
|
trueIndex = i;
|
|
746
761
|
}
|
|
@@ -751,6 +766,6 @@ function normalizeUnion(types) {
|
|
|
751
766
|
}
|
|
752
767
|
if (trueIndex !== -1 && falseIndex !== -1) {
|
|
753
768
|
types.splice(Math.max(trueIndex, falseIndex), 1);
|
|
754
|
-
types.splice(Math.min(trueIndex, falseIndex), 1, new
|
|
769
|
+
types.splice(Math.min(trueIndex, falseIndex), 1, new IntrinsicType("boolean"));
|
|
755
770
|
}
|
|
756
771
|
}
|