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,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
2
|
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
3
|
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
@@ -33,56 +32,40 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
33
32
|
}
|
|
34
33
|
return useValue ? value : void 0;
|
|
35
34
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const types_1 = require("./types");
|
|
63
|
-
const converter_events_1 = require("./converter-events");
|
|
64
|
-
const symbols_1 = require("./symbols");
|
|
65
|
-
const paths_1 = require("../utils/paths");
|
|
66
|
-
const enum_1 = require("../utils/enum");
|
|
67
|
-
const parser_1 = require("./comments/parser");
|
|
68
|
-
const rawLexer_1 = require("./comments/rawLexer");
|
|
69
|
-
const linkResolver_1 = require("./comments/linkResolver");
|
|
70
|
-
const declarationReference_1 = require("./comments/declarationReference");
|
|
71
|
-
const path_1 = require("path");
|
|
35
|
+
import ts from "typescript";
|
|
36
|
+
import { Comment, DocumentReflection, ProjectReflection, ReflectionKind, } from "../models/index.js";
|
|
37
|
+
import { Context } from "./context.js";
|
|
38
|
+
import { AbstractComponent } from "../utils/component.js";
|
|
39
|
+
import { Option, MinimalSourceFile, readFile, unique, getDocumentEntryPoints, } from "../utils/index.js";
|
|
40
|
+
import { convertType } from "./types.js";
|
|
41
|
+
import { ConverterEvents } from "./converter-events.js";
|
|
42
|
+
import { convertSymbol } from "./symbols.js";
|
|
43
|
+
import { createMinimatch, matchesAny, nicePath } from "../utils/paths.js";
|
|
44
|
+
import { hasAllFlags, hasAnyFlag } from "../utils/enum.js";
|
|
45
|
+
import { parseCommentString } from "./comments/parser.js";
|
|
46
|
+
import { lexCommentString } from "./comments/rawLexer.js";
|
|
47
|
+
import { resolvePartLinks, resolveLinks, } from "./comments/linkResolver.js";
|
|
48
|
+
import { meaningToString, } from "./comments/declarationReference.js";
|
|
49
|
+
import { basename, dirname, resolve } from "path";
|
|
50
|
+
import { GroupPlugin } from "./plugins/GroupPlugin.js";
|
|
51
|
+
import { CategoryPlugin } from "./plugins/CategoryPlugin.js";
|
|
52
|
+
import { CommentPlugin } from "./plugins/CommentPlugin.js";
|
|
53
|
+
import { ImplementsPlugin } from "./plugins/ImplementsPlugin.js";
|
|
54
|
+
import { InheritDocPlugin } from "./plugins/InheritDocPlugin.js";
|
|
55
|
+
import { LinkResolverPlugin } from "./plugins/LinkResolverPlugin.js";
|
|
56
|
+
import { PackagePlugin } from "./plugins/PackagePlugin.js";
|
|
57
|
+
import { SourcePlugin } from "./plugins/SourcePlugin.js";
|
|
58
|
+
import { TypePlugin } from "./plugins/TypePlugin.js";
|
|
59
|
+
import { IncludePlugin } from "./plugins/IncludePlugin.js";
|
|
60
|
+
import { MergeModuleWithPlugin } from "./plugins/MergeModuleWithPlugin.js";
|
|
72
61
|
/**
|
|
73
62
|
* Compiles source files using TypeScript and converts compiler symbols to reflections.
|
|
63
|
+
*
|
|
64
|
+
* @group Common
|
|
65
|
+
* @summary Responsible for converting TypeScript symbols into {@link Reflection}s and {@link Type}s.
|
|
74
66
|
*/
|
|
75
67
|
let Converter = (() => {
|
|
76
|
-
|
|
77
|
-
let _classDecorators = [(0, component_1.Component)({
|
|
78
|
-
name: "converter",
|
|
79
|
-
internal: true,
|
|
80
|
-
childClass: components_1.ConverterComponent,
|
|
81
|
-
})];
|
|
82
|
-
let _classDescriptor;
|
|
83
|
-
let _classExtraInitializers = [];
|
|
84
|
-
let _classThis;
|
|
85
|
-
let _classSuper = component_1.ChildableComponent;
|
|
68
|
+
let _classSuper = AbstractComponent;
|
|
86
69
|
let _externalPattern_decorators;
|
|
87
70
|
let _externalPattern_initializers = [];
|
|
88
71
|
let _externalPattern_extraInitializers = [];
|
|
@@ -116,59 +99,151 @@ let Converter = (() => {
|
|
|
116
99
|
let _maxTypeConversionDepth_decorators;
|
|
117
100
|
let _maxTypeConversionDepth_initializers = [];
|
|
118
101
|
let _maxTypeConversionDepth_extraInitializers = [];
|
|
119
|
-
|
|
102
|
+
return class Converter extends _classSuper {
|
|
103
|
+
static {
|
|
104
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
105
|
+
_externalPattern_decorators = [Option("externalPattern")];
|
|
106
|
+
_excludeExternals_decorators = [Option("excludeExternals")];
|
|
107
|
+
_excludeNotDocumented_decorators = [Option("excludeNotDocumented")];
|
|
108
|
+
_excludePrivate_decorators = [Option("excludePrivate")];
|
|
109
|
+
_excludeProtected_decorators = [Option("excludeProtected")];
|
|
110
|
+
_excludeReferences_decorators = [Option("excludeReferences")];
|
|
111
|
+
_commentStyle_decorators = [Option("commentStyle")];
|
|
112
|
+
_validation_decorators = [Option("validation")];
|
|
113
|
+
_externalSymbolLinkMappings_decorators = [Option("externalSymbolLinkMappings")];
|
|
114
|
+
_preserveLinkText_decorators = [Option("preserveLinkText")];
|
|
115
|
+
_maxTypeConversionDepth_decorators = [Option("maxTypeConversionDepth")];
|
|
116
|
+
__esDecorate(this, null, _externalPattern_decorators, { kind: "accessor", name: "externalPattern", static: false, private: false, access: { has: obj => "externalPattern" in obj, get: obj => obj.externalPattern, set: (obj, value) => { obj.externalPattern = value; } }, metadata: _metadata }, _externalPattern_initializers, _externalPattern_extraInitializers);
|
|
117
|
+
__esDecorate(this, null, _excludeExternals_decorators, { kind: "accessor", name: "excludeExternals", static: false, private: false, access: { has: obj => "excludeExternals" in obj, get: obj => obj.excludeExternals, set: (obj, value) => { obj.excludeExternals = value; } }, metadata: _metadata }, _excludeExternals_initializers, _excludeExternals_extraInitializers);
|
|
118
|
+
__esDecorate(this, null, _excludeNotDocumented_decorators, { kind: "accessor", name: "excludeNotDocumented", static: false, private: false, access: { has: obj => "excludeNotDocumented" in obj, get: obj => obj.excludeNotDocumented, set: (obj, value) => { obj.excludeNotDocumented = value; } }, metadata: _metadata }, _excludeNotDocumented_initializers, _excludeNotDocumented_extraInitializers);
|
|
119
|
+
__esDecorate(this, null, _excludePrivate_decorators, { kind: "accessor", name: "excludePrivate", static: false, private: false, access: { has: obj => "excludePrivate" in obj, get: obj => obj.excludePrivate, set: (obj, value) => { obj.excludePrivate = value; } }, metadata: _metadata }, _excludePrivate_initializers, _excludePrivate_extraInitializers);
|
|
120
|
+
__esDecorate(this, null, _excludeProtected_decorators, { kind: "accessor", name: "excludeProtected", static: false, private: false, access: { has: obj => "excludeProtected" in obj, get: obj => obj.excludeProtected, set: (obj, value) => { obj.excludeProtected = value; } }, metadata: _metadata }, _excludeProtected_initializers, _excludeProtected_extraInitializers);
|
|
121
|
+
__esDecorate(this, null, _excludeReferences_decorators, { kind: "accessor", name: "excludeReferences", static: false, private: false, access: { has: obj => "excludeReferences" in obj, get: obj => obj.excludeReferences, set: (obj, value) => { obj.excludeReferences = value; } }, metadata: _metadata }, _excludeReferences_initializers, _excludeReferences_extraInitializers);
|
|
122
|
+
__esDecorate(this, null, _commentStyle_decorators, { kind: "accessor", name: "commentStyle", static: false, private: false, access: { has: obj => "commentStyle" in obj, get: obj => obj.commentStyle, set: (obj, value) => { obj.commentStyle = value; } }, metadata: _metadata }, _commentStyle_initializers, _commentStyle_extraInitializers);
|
|
123
|
+
__esDecorate(this, null, _validation_decorators, { kind: "accessor", name: "validation", static: false, private: false, access: { has: obj => "validation" in obj, get: obj => obj.validation, set: (obj, value) => { obj.validation = value; } }, metadata: _metadata }, _validation_initializers, _validation_extraInitializers);
|
|
124
|
+
__esDecorate(this, null, _externalSymbolLinkMappings_decorators, { kind: "accessor", name: "externalSymbolLinkMappings", static: false, private: false, access: { has: obj => "externalSymbolLinkMappings" in obj, get: obj => obj.externalSymbolLinkMappings, set: (obj, value) => { obj.externalSymbolLinkMappings = value; } }, metadata: _metadata }, _externalSymbolLinkMappings_initializers, _externalSymbolLinkMappings_extraInitializers);
|
|
125
|
+
__esDecorate(this, null, _preserveLinkText_decorators, { kind: "accessor", name: "preserveLinkText", static: false, private: false, access: { has: obj => "preserveLinkText" in obj, get: obj => obj.preserveLinkText, set: (obj, value) => { obj.preserveLinkText = value; } }, metadata: _metadata }, _preserveLinkText_initializers, _preserveLinkText_extraInitializers);
|
|
126
|
+
__esDecorate(this, null, _maxTypeConversionDepth_decorators, { kind: "accessor", name: "maxTypeConversionDepth", static: false, private: false, access: { has: obj => "maxTypeConversionDepth" in obj, get: obj => obj.maxTypeConversionDepth, set: (obj, value) => { obj.maxTypeConversionDepth = value; } }, metadata: _metadata }, _maxTypeConversionDepth_initializers, _maxTypeConversionDepth_extraInitializers);
|
|
127
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
128
|
+
}
|
|
129
|
+
#externalPattern_accessor_storage = __runInitializers(this, _externalPattern_initializers, void 0);
|
|
120
130
|
/** @internal */
|
|
121
|
-
get externalPattern() { return
|
|
122
|
-
set externalPattern(value) {
|
|
131
|
+
get externalPattern() { return this.#externalPattern_accessor_storage; }
|
|
132
|
+
set externalPattern(value) { this.#externalPattern_accessor_storage = value; }
|
|
133
|
+
externalPatternCache = __runInitializers(this, _externalPattern_extraInitializers);
|
|
134
|
+
excludeCache;
|
|
135
|
+
#excludeExternals_accessor_storage = __runInitializers(this, _excludeExternals_initializers, void 0);
|
|
123
136
|
/** @internal */
|
|
124
|
-
get excludeExternals() { return
|
|
125
|
-
set excludeExternals(value) {
|
|
137
|
+
get excludeExternals() { return this.#excludeExternals_accessor_storage; }
|
|
138
|
+
set excludeExternals(value) { this.#excludeExternals_accessor_storage = value; }
|
|
139
|
+
#excludeNotDocumented_accessor_storage = (__runInitializers(this, _excludeExternals_extraInitializers), __runInitializers(this, _excludeNotDocumented_initializers, void 0));
|
|
126
140
|
/** @internal */
|
|
127
|
-
get excludeNotDocumented() { return
|
|
128
|
-
set excludeNotDocumented(value) {
|
|
141
|
+
get excludeNotDocumented() { return this.#excludeNotDocumented_accessor_storage; }
|
|
142
|
+
set excludeNotDocumented(value) { this.#excludeNotDocumented_accessor_storage = value; }
|
|
143
|
+
#excludePrivate_accessor_storage = (__runInitializers(this, _excludeNotDocumented_extraInitializers), __runInitializers(this, _excludePrivate_initializers, void 0));
|
|
129
144
|
/** @internal */
|
|
130
|
-
get excludePrivate() { return
|
|
131
|
-
set excludePrivate(value) {
|
|
145
|
+
get excludePrivate() { return this.#excludePrivate_accessor_storage; }
|
|
146
|
+
set excludePrivate(value) { this.#excludePrivate_accessor_storage = value; }
|
|
147
|
+
#excludeProtected_accessor_storage = (__runInitializers(this, _excludePrivate_extraInitializers), __runInitializers(this, _excludeProtected_initializers, void 0));
|
|
132
148
|
/** @internal */
|
|
133
|
-
get excludeProtected() { return
|
|
134
|
-
set excludeProtected(value) {
|
|
149
|
+
get excludeProtected() { return this.#excludeProtected_accessor_storage; }
|
|
150
|
+
set excludeProtected(value) { this.#excludeProtected_accessor_storage = value; }
|
|
151
|
+
#excludeReferences_accessor_storage = (__runInitializers(this, _excludeProtected_extraInitializers), __runInitializers(this, _excludeReferences_initializers, void 0));
|
|
135
152
|
/** @internal */
|
|
136
|
-
get excludeReferences() { return
|
|
137
|
-
set excludeReferences(value) {
|
|
153
|
+
get excludeReferences() { return this.#excludeReferences_accessor_storage; }
|
|
154
|
+
set excludeReferences(value) { this.#excludeReferences_accessor_storage = value; }
|
|
155
|
+
#commentStyle_accessor_storage = (__runInitializers(this, _excludeReferences_extraInitializers), __runInitializers(this, _commentStyle_initializers, void 0));
|
|
138
156
|
/** @internal */
|
|
139
|
-
get commentStyle() { return
|
|
140
|
-
set commentStyle(value) {
|
|
157
|
+
get commentStyle() { return this.#commentStyle_accessor_storage; }
|
|
158
|
+
set commentStyle(value) { this.#commentStyle_accessor_storage = value; }
|
|
159
|
+
#validation_accessor_storage = (__runInitializers(this, _commentStyle_extraInitializers), __runInitializers(this, _validation_initializers, void 0));
|
|
141
160
|
/** @internal */
|
|
142
|
-
get validation() { return
|
|
143
|
-
set validation(value) {
|
|
161
|
+
get validation() { return this.#validation_accessor_storage; }
|
|
162
|
+
set validation(value) { this.#validation_accessor_storage = value; }
|
|
163
|
+
#externalSymbolLinkMappings_accessor_storage = (__runInitializers(this, _validation_extraInitializers), __runInitializers(this, _externalSymbolLinkMappings_initializers, void 0));
|
|
144
164
|
/** @internal */
|
|
145
|
-
get externalSymbolLinkMappings() { return
|
|
146
|
-
set externalSymbolLinkMappings(value) {
|
|
165
|
+
get externalSymbolLinkMappings() { return this.#externalSymbolLinkMappings_accessor_storage; }
|
|
166
|
+
set externalSymbolLinkMappings(value) { this.#externalSymbolLinkMappings_accessor_storage = value; }
|
|
167
|
+
#preserveLinkText_accessor_storage = (__runInitializers(this, _externalSymbolLinkMappings_extraInitializers), __runInitializers(this, _preserveLinkText_initializers, void 0));
|
|
147
168
|
/** @internal */
|
|
148
|
-
get preserveLinkText() { return
|
|
149
|
-
set preserveLinkText(value) {
|
|
169
|
+
get preserveLinkText() { return this.#preserveLinkText_accessor_storage; }
|
|
170
|
+
set preserveLinkText(value) { this.#preserveLinkText_accessor_storage = value; }
|
|
171
|
+
#maxTypeConversionDepth_accessor_storage = (__runInitializers(this, _preserveLinkText_extraInitializers), __runInitializers(this, _maxTypeConversionDepth_initializers, void 0));
|
|
150
172
|
/** @internal */
|
|
151
|
-
get maxTypeConversionDepth() { return
|
|
152
|
-
set maxTypeConversionDepth(value) {
|
|
173
|
+
get maxTypeConversionDepth() { return this.#maxTypeConversionDepth_accessor_storage; }
|
|
174
|
+
set maxTypeConversionDepth(value) { this.#maxTypeConversionDepth_accessor_storage = value; }
|
|
175
|
+
_config = __runInitializers(this, _maxTypeConversionDepth_extraInitializers);
|
|
176
|
+
_externalSymbolResolvers = [];
|
|
153
177
|
get config() {
|
|
154
178
|
return this._config || this._buildCommentParserConfig();
|
|
155
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* General events
|
|
182
|
+
*/
|
|
183
|
+
/**
|
|
184
|
+
* Triggered when the converter begins converting a project.
|
|
185
|
+
* The listener will be given a {@link Context} object.
|
|
186
|
+
* @event
|
|
187
|
+
*/
|
|
188
|
+
static EVENT_BEGIN = ConverterEvents.BEGIN;
|
|
189
|
+
/**
|
|
190
|
+
* Triggered when the converter has finished converting a project.
|
|
191
|
+
* The listener will be given a {@link Context} object.
|
|
192
|
+
* @event
|
|
193
|
+
*/
|
|
194
|
+
static EVENT_END = ConverterEvents.END;
|
|
195
|
+
/**
|
|
196
|
+
* Factory events
|
|
197
|
+
*/
|
|
198
|
+
/**
|
|
199
|
+
* Triggered when the converter has created a declaration reflection.
|
|
200
|
+
* The listener will be given {@link Context} and a {@link Models.DeclarationReflection}.
|
|
201
|
+
* @event
|
|
202
|
+
*/
|
|
203
|
+
static EVENT_CREATE_DECLARATION = ConverterEvents.CREATE_DECLARATION;
|
|
204
|
+
/**
|
|
205
|
+
* Triggered when the converter has created a signature reflection.
|
|
206
|
+
* The listener will be given {@link Context}, {@link Models.SignatureReflection} | {@link Models.ProjectReflection} the declaration,
|
|
207
|
+
* `ts.SignatureDeclaration | ts.IndexSignatureDeclaration | ts.JSDocSignature | undefined`,
|
|
208
|
+
* and `ts.Signature | undefined`. The signature will be undefined if the created signature is an index signature.
|
|
209
|
+
* @event
|
|
210
|
+
*/
|
|
211
|
+
static EVENT_CREATE_SIGNATURE = ConverterEvents.CREATE_SIGNATURE;
|
|
212
|
+
/**
|
|
213
|
+
* Triggered when the converter has created a parameter reflection.
|
|
214
|
+
* The listener will be given {@link Context}, {@link Models.ParameterReflection} and a `ts.Node?`
|
|
215
|
+
* @event
|
|
216
|
+
*/
|
|
217
|
+
static EVENT_CREATE_PARAMETER = ConverterEvents.CREATE_PARAMETER;
|
|
218
|
+
/**
|
|
219
|
+
* Triggered when the converter has created a type parameter reflection.
|
|
220
|
+
* The listener will be given {@link Context} and a {@link Models.TypeParameterReflection}
|
|
221
|
+
* @event
|
|
222
|
+
*/
|
|
223
|
+
static EVENT_CREATE_TYPE_PARAMETER = ConverterEvents.CREATE_TYPE_PARAMETER;
|
|
224
|
+
/**
|
|
225
|
+
* Resolve events
|
|
226
|
+
*/
|
|
227
|
+
/**
|
|
228
|
+
* Triggered when the converter begins resolving a project.
|
|
229
|
+
* The listener will be given {@link Context}.
|
|
230
|
+
* @event
|
|
231
|
+
*/
|
|
232
|
+
static EVENT_RESOLVE_BEGIN = ConverterEvents.RESOLVE_BEGIN;
|
|
233
|
+
/**
|
|
234
|
+
* Triggered when the converter resolves a reflection.
|
|
235
|
+
* The listener will be given {@link Context} and a {@link Reflection}.
|
|
236
|
+
* @event
|
|
237
|
+
*/
|
|
238
|
+
static EVENT_RESOLVE = ConverterEvents.RESOLVE;
|
|
239
|
+
/**
|
|
240
|
+
* Triggered when the converter has finished resolving a project.
|
|
241
|
+
* The listener will be given {@link Context}.
|
|
242
|
+
* @event
|
|
243
|
+
*/
|
|
244
|
+
static EVENT_RESOLVE_END = ConverterEvents.RESOLVE_END;
|
|
156
245
|
constructor(owner) {
|
|
157
246
|
super(owner);
|
|
158
|
-
_Converter_externalPattern_accessor_storage.set(this, __runInitializers(this, _externalPattern_initializers, void 0));
|
|
159
|
-
this.externalPatternCache = __runInitializers(this, _externalPattern_extraInitializers);
|
|
160
|
-
_Converter_excludeExternals_accessor_storage.set(this, __runInitializers(this, _excludeExternals_initializers, void 0));
|
|
161
|
-
_Converter_excludeNotDocumented_accessor_storage.set(this, (__runInitializers(this, _excludeExternals_extraInitializers), __runInitializers(this, _excludeNotDocumented_initializers, void 0)));
|
|
162
|
-
_Converter_excludePrivate_accessor_storage.set(this, (__runInitializers(this, _excludeNotDocumented_extraInitializers), __runInitializers(this, _excludePrivate_initializers, void 0)));
|
|
163
|
-
_Converter_excludeProtected_accessor_storage.set(this, (__runInitializers(this, _excludePrivate_extraInitializers), __runInitializers(this, _excludeProtected_initializers, void 0)));
|
|
164
|
-
_Converter_excludeReferences_accessor_storage.set(this, (__runInitializers(this, _excludeProtected_extraInitializers), __runInitializers(this, _excludeReferences_initializers, void 0)));
|
|
165
|
-
_Converter_commentStyle_accessor_storage.set(this, (__runInitializers(this, _excludeReferences_extraInitializers), __runInitializers(this, _commentStyle_initializers, void 0)));
|
|
166
|
-
_Converter_validation_accessor_storage.set(this, (__runInitializers(this, _commentStyle_extraInitializers), __runInitializers(this, _validation_initializers, void 0)));
|
|
167
|
-
_Converter_externalSymbolLinkMappings_accessor_storage.set(this, (__runInitializers(this, _validation_extraInitializers), __runInitializers(this, _externalSymbolLinkMappings_initializers, void 0)));
|
|
168
|
-
_Converter_preserveLinkText_accessor_storage.set(this, (__runInitializers(this, _externalSymbolLinkMappings_extraInitializers), __runInitializers(this, _preserveLinkText_initializers, void 0)));
|
|
169
|
-
_Converter_maxTypeConversionDepth_accessor_storage.set(this, (__runInitializers(this, _preserveLinkText_extraInitializers), __runInitializers(this, _maxTypeConversionDepth_initializers, void 0)));
|
|
170
|
-
this._config = __runInitializers(this, _maxTypeConversionDepth_extraInitializers);
|
|
171
|
-
this._externalSymbolResolvers = [];
|
|
172
247
|
const userConfiguredSymbolResolver = (ref, refl, _part, symbolId) => {
|
|
173
248
|
if (symbolId) {
|
|
174
249
|
return userConfiguredSymbolResolver(symbolId.toDeclarationReference(), refl, undefined, undefined);
|
|
@@ -187,7 +262,7 @@ let Converter = (() => {
|
|
|
187
262
|
name += ref.symbolReference.path.map((p) => p.path).join(".");
|
|
188
263
|
}
|
|
189
264
|
if (ref.symbolReference.meaning) {
|
|
190
|
-
name +=
|
|
265
|
+
name += meaningToString(ref.symbolReference.meaning);
|
|
191
266
|
}
|
|
192
267
|
if (typeof modLinks[name] === "string") {
|
|
193
268
|
return modLinks[name];
|
|
@@ -197,15 +272,26 @@ let Converter = (() => {
|
|
|
197
272
|
}
|
|
198
273
|
};
|
|
199
274
|
this.addUnknownSymbolResolver(userConfiguredSymbolResolver);
|
|
275
|
+
new CategoryPlugin(this);
|
|
276
|
+
new CommentPlugin(this);
|
|
277
|
+
new GroupPlugin(this);
|
|
278
|
+
new ImplementsPlugin(this);
|
|
279
|
+
new InheritDocPlugin(this);
|
|
280
|
+
new LinkResolverPlugin(this);
|
|
281
|
+
new PackagePlugin(this);
|
|
282
|
+
new SourcePlugin(this);
|
|
283
|
+
new TypePlugin(this);
|
|
284
|
+
new IncludePlugin(this);
|
|
285
|
+
new MergeModuleWithPlugin(this);
|
|
200
286
|
}
|
|
201
287
|
/**
|
|
202
288
|
* Compile the given source files and create a project reflection for them.
|
|
203
289
|
*/
|
|
204
290
|
convert(entryPoints) {
|
|
205
|
-
const programs =
|
|
291
|
+
const programs = unique(entryPoints.map((e) => e.program));
|
|
206
292
|
this.externalPatternCache = void 0;
|
|
207
|
-
const project = new
|
|
208
|
-
const context = new
|
|
293
|
+
const project = new ProjectReflection(this.application.options.getValue("name"), this.application.files);
|
|
294
|
+
const context = new Context(this, programs, project);
|
|
209
295
|
this.trigger(Converter.EVENT_BEGIN, context);
|
|
210
296
|
this.addProjectDocuments(project);
|
|
211
297
|
this.compile(entryPoints, context);
|
|
@@ -216,11 +302,11 @@ let Converter = (() => {
|
|
|
216
302
|
}
|
|
217
303
|
/** @internal */
|
|
218
304
|
addProjectDocuments(project) {
|
|
219
|
-
const projectDocuments =
|
|
305
|
+
const projectDocuments = getDocumentEntryPoints(this.application.logger, this.application.options);
|
|
220
306
|
for (const { displayName, path } of projectDocuments) {
|
|
221
307
|
let file;
|
|
222
308
|
try {
|
|
223
|
-
file = new
|
|
309
|
+
file = new MinimalSourceFile(readFile(path), path);
|
|
224
310
|
}
|
|
225
311
|
catch (error) {
|
|
226
312
|
this.application.logger.error(this.application.logger.i18n.failed_to_read_0_when_processing_project_document(path));
|
|
@@ -231,7 +317,7 @@ let Converter = (() => {
|
|
|
231
317
|
}
|
|
232
318
|
/** @internal */
|
|
233
319
|
convertSymbol(context, symbol, exportSymbol) {
|
|
234
|
-
|
|
320
|
+
convertSymbol(context, symbol, exportSymbol);
|
|
235
321
|
}
|
|
236
322
|
/**
|
|
237
323
|
* Convert the given TypeScript type into its TypeDoc type reflection.
|
|
@@ -241,13 +327,13 @@ let Converter = (() => {
|
|
|
241
327
|
* @internal
|
|
242
328
|
*/
|
|
243
329
|
convertType(context, node) {
|
|
244
|
-
return
|
|
330
|
+
return convertType(context, node);
|
|
245
331
|
}
|
|
246
332
|
/**
|
|
247
333
|
* Parse the given file into a comment. Intended to be used with markdown files.
|
|
248
334
|
*/
|
|
249
335
|
parseRawComment(file, files) {
|
|
250
|
-
return
|
|
336
|
+
return parseCommentString(lexCommentString(file.text), this.config, file, this.application.logger, files);
|
|
251
337
|
}
|
|
252
338
|
/**
|
|
253
339
|
* Adds a new resolver that the theme can use to try to figure out how to link to a symbol declared
|
|
@@ -273,11 +359,11 @@ let Converter = (() => {
|
|
|
273
359
|
}
|
|
274
360
|
}
|
|
275
361
|
resolveLinks(comment, owner) {
|
|
276
|
-
if (comment instanceof
|
|
277
|
-
|
|
362
|
+
if (comment instanceof Comment) {
|
|
363
|
+
resolveLinks(comment, owner, (ref, part, refl, id) => this.resolveExternalLink(ref, part, refl, id), { preserveLinkText: this.preserveLinkText });
|
|
278
364
|
}
|
|
279
365
|
else {
|
|
280
|
-
return
|
|
366
|
+
return resolvePartLinks(owner, comment, (ref, part, refl, id) => this.resolveExternalLink(ref, part, refl, id), { preserveLinkText: this.preserveLinkText });
|
|
281
367
|
}
|
|
282
368
|
}
|
|
283
369
|
/**
|
|
@@ -329,16 +415,10 @@ let Converter = (() => {
|
|
|
329
415
|
moduleContext = context;
|
|
330
416
|
}
|
|
331
417
|
else {
|
|
332
|
-
const reflection = context.createDeclarationReflection(
|
|
418
|
+
const reflection = context.createDeclarationReflection(ReflectionKind.Module, symbol, void 0, entryName);
|
|
333
419
|
if (!reflection.comment && !symbol) {
|
|
334
420
|
reflection.comment = context.getFileComment(node);
|
|
335
421
|
}
|
|
336
|
-
if (entryPoint.readmeFile) {
|
|
337
|
-
const readme = (0, utils_1.readFile)(entryPoint.readmeFile);
|
|
338
|
-
const { content } = this.parseRawComment(new utils_1.MinimalSourceFile(readme, entryPoint.readmeFile), context.project.files);
|
|
339
|
-
reflection.readme = content;
|
|
340
|
-
}
|
|
341
|
-
reflection.packageVersion = entryPoint.version;
|
|
342
422
|
context.finalizeDeclarationReflection(reflection);
|
|
343
423
|
moduleContext = context.withScope(reflection);
|
|
344
424
|
}
|
|
@@ -380,34 +460,34 @@ let Converter = (() => {
|
|
|
380
460
|
return this.excludeExternals && this.isExternal(symbol);
|
|
381
461
|
}
|
|
382
462
|
isExcluded(symbol) {
|
|
383
|
-
this.excludeCache ??=
|
|
463
|
+
this.excludeCache ??= createMinimatch(this.application.options.getValue("exclude"));
|
|
384
464
|
const cache = this.excludeCache;
|
|
385
|
-
return (symbol.getDeclarations() ?? []).some((node) =>
|
|
465
|
+
return (symbol.getDeclarations() ?? []).some((node) => matchesAny(cache, node.getSourceFile().fileName));
|
|
386
466
|
}
|
|
387
467
|
/** @internal */
|
|
388
468
|
isExternal(symbol) {
|
|
389
|
-
this.externalPatternCache ??=
|
|
469
|
+
this.externalPatternCache ??= createMinimatch(this.externalPattern);
|
|
390
470
|
const cache = this.externalPatternCache;
|
|
391
|
-
return (symbol.getDeclarations() ?? []).some((node) =>
|
|
471
|
+
return (symbol.getDeclarations() ?? []).some((node) => matchesAny(cache, node.getSourceFile().fileName));
|
|
392
472
|
}
|
|
393
473
|
processDocumentTags(reflection, parent) {
|
|
394
474
|
let relativeTo = reflection.comment?.sourcePath;
|
|
395
475
|
if (relativeTo) {
|
|
396
|
-
relativeTo =
|
|
476
|
+
relativeTo = dirname(relativeTo);
|
|
397
477
|
const tags = reflection.comment?.getTags("@document") || [];
|
|
398
478
|
reflection.comment?.removeTags("@document");
|
|
399
479
|
for (const tag of tags) {
|
|
400
|
-
const path =
|
|
480
|
+
const path = Comment.combineDisplayParts(tag.content);
|
|
401
481
|
let file;
|
|
402
482
|
try {
|
|
403
|
-
const resolved =
|
|
404
|
-
file = new
|
|
483
|
+
const resolved = resolve(relativeTo, path);
|
|
484
|
+
file = new MinimalSourceFile(readFile(resolved), resolved);
|
|
405
485
|
}
|
|
406
486
|
catch {
|
|
407
|
-
this.application.logger.warn(this.application.logger.i18n.failed_to_read_0_when_processing_document_tag_in_1(
|
|
487
|
+
this.application.logger.warn(this.application.logger.i18n.failed_to_read_0_when_processing_document_tag_in_1(nicePath(path), nicePath(reflection.comment.sourcePath)));
|
|
408
488
|
continue;
|
|
409
489
|
}
|
|
410
|
-
this.addDocument(parent, file,
|
|
490
|
+
this.addDocument(parent, file, basename(file.fileName).replace(/\.[^.]+$/, ""));
|
|
411
491
|
}
|
|
412
492
|
}
|
|
413
493
|
}
|
|
@@ -415,21 +495,22 @@ let Converter = (() => {
|
|
|
415
495
|
const { content, frontmatter } = this.parseRawComment(file, parent.project.files);
|
|
416
496
|
const children = frontmatter["children"];
|
|
417
497
|
delete frontmatter["children"];
|
|
418
|
-
const docRefl = new
|
|
498
|
+
const docRefl = new DocumentReflection(displayName, parent, content, frontmatter);
|
|
419
499
|
parent.addChild(docRefl);
|
|
420
500
|
parent.project.registerReflection(docRefl, undefined, file.fileName);
|
|
501
|
+
this.trigger(ConverterEvents.CREATE_DOCUMENT, undefined, docRefl);
|
|
421
502
|
const childrenToAdd = [];
|
|
422
503
|
if (children && typeof children === "object") {
|
|
423
504
|
if (Array.isArray(children)) {
|
|
424
505
|
for (const child of children) {
|
|
425
506
|
if (typeof child === "string") {
|
|
426
507
|
childrenToAdd.push([
|
|
427
|
-
|
|
508
|
+
basename(child).replace(/\.[^.]+$/, ""),
|
|
428
509
|
child,
|
|
429
510
|
]);
|
|
430
511
|
}
|
|
431
512
|
else {
|
|
432
|
-
this.application.logger.error(this.application.i18n.frontmatter_children_0_should_be_an_array_of_strings_or_object_with_string_values(
|
|
513
|
+
this.application.logger.error(this.application.i18n.frontmatter_children_0_should_be_an_array_of_strings_or_object_with_string_values(nicePath(file.fileName)));
|
|
433
514
|
return;
|
|
434
515
|
}
|
|
435
516
|
}
|
|
@@ -440,20 +521,20 @@ let Converter = (() => {
|
|
|
440
521
|
childrenToAdd.push([name, path]);
|
|
441
522
|
}
|
|
442
523
|
else {
|
|
443
|
-
this.application.logger.error(this.application.i18n.frontmatter_children_0_should_be_an_array_of_strings_or_object_with_string_values(
|
|
524
|
+
this.application.logger.error(this.application.i18n.frontmatter_children_0_should_be_an_array_of_strings_or_object_with_string_values(nicePath(file.fileName)));
|
|
444
525
|
return;
|
|
445
526
|
}
|
|
446
527
|
}
|
|
447
528
|
}
|
|
448
529
|
}
|
|
449
530
|
for (const [displayName, path] of childrenToAdd) {
|
|
450
|
-
const absPath =
|
|
531
|
+
const absPath = resolve(dirname(file.fileName), path);
|
|
451
532
|
let childFile;
|
|
452
533
|
try {
|
|
453
|
-
childFile = new
|
|
534
|
+
childFile = new MinimalSourceFile(readFile(absPath), absPath);
|
|
454
535
|
}
|
|
455
536
|
catch (error) {
|
|
456
|
-
this.application.logger.error(this.application.logger.i18n.failed_to_read_0_when_processing_document_child_in_1(path,
|
|
537
|
+
this.application.logger.error(this.application.logger.i18n.failed_to_read_0_when_processing_document_child_in_1(path, nicePath(file.fileName)));
|
|
457
538
|
continue;
|
|
458
539
|
}
|
|
459
540
|
this.addDocument(docRefl, childFile, displayName);
|
|
@@ -475,117 +556,8 @@ let Converter = (() => {
|
|
|
475
556
|
return this._config;
|
|
476
557
|
}
|
|
477
558
|
};
|
|
478
|
-
_Converter_externalPattern_accessor_storage = new WeakMap();
|
|
479
|
-
_Converter_excludeExternals_accessor_storage = new WeakMap();
|
|
480
|
-
_Converter_excludeNotDocumented_accessor_storage = new WeakMap();
|
|
481
|
-
_Converter_excludePrivate_accessor_storage = new WeakMap();
|
|
482
|
-
_Converter_excludeProtected_accessor_storage = new WeakMap();
|
|
483
|
-
_Converter_excludeReferences_accessor_storage = new WeakMap();
|
|
484
|
-
_Converter_commentStyle_accessor_storage = new WeakMap();
|
|
485
|
-
_Converter_validation_accessor_storage = new WeakMap();
|
|
486
|
-
_Converter_externalSymbolLinkMappings_accessor_storage = new WeakMap();
|
|
487
|
-
_Converter_preserveLinkText_accessor_storage = new WeakMap();
|
|
488
|
-
_Converter_maxTypeConversionDepth_accessor_storage = new WeakMap();
|
|
489
|
-
__setFunctionName(_classThis, "Converter");
|
|
490
|
-
(() => {
|
|
491
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
492
|
-
_externalPattern_decorators = [(0, utils_1.Option)("externalPattern")];
|
|
493
|
-
_excludeExternals_decorators = [(0, utils_1.Option)("excludeExternals")];
|
|
494
|
-
_excludeNotDocumented_decorators = [(0, utils_1.Option)("excludeNotDocumented")];
|
|
495
|
-
_excludePrivate_decorators = [(0, utils_1.Option)("excludePrivate")];
|
|
496
|
-
_excludeProtected_decorators = [(0, utils_1.Option)("excludeProtected")];
|
|
497
|
-
_excludeReferences_decorators = [(0, utils_1.Option)("excludeReferences")];
|
|
498
|
-
_commentStyle_decorators = [(0, utils_1.Option)("commentStyle")];
|
|
499
|
-
_validation_decorators = [(0, utils_1.Option)("validation")];
|
|
500
|
-
_externalSymbolLinkMappings_decorators = [(0, utils_1.Option)("externalSymbolLinkMappings")];
|
|
501
|
-
_preserveLinkText_decorators = [(0, utils_1.Option)("preserveLinkText")];
|
|
502
|
-
_maxTypeConversionDepth_decorators = [(0, utils_1.Option)("maxTypeConversionDepth")];
|
|
503
|
-
__esDecorate(_classThis, null, _externalPattern_decorators, { kind: "accessor", name: "externalPattern", static: false, private: false, access: { has: obj => "externalPattern" in obj, get: obj => obj.externalPattern, set: (obj, value) => { obj.externalPattern = value; } }, metadata: _metadata }, _externalPattern_initializers, _externalPattern_extraInitializers);
|
|
504
|
-
__esDecorate(_classThis, null, _excludeExternals_decorators, { kind: "accessor", name: "excludeExternals", static: false, private: false, access: { has: obj => "excludeExternals" in obj, get: obj => obj.excludeExternals, set: (obj, value) => { obj.excludeExternals = value; } }, metadata: _metadata }, _excludeExternals_initializers, _excludeExternals_extraInitializers);
|
|
505
|
-
__esDecorate(_classThis, null, _excludeNotDocumented_decorators, { kind: "accessor", name: "excludeNotDocumented", static: false, private: false, access: { has: obj => "excludeNotDocumented" in obj, get: obj => obj.excludeNotDocumented, set: (obj, value) => { obj.excludeNotDocumented = value; } }, metadata: _metadata }, _excludeNotDocumented_initializers, _excludeNotDocumented_extraInitializers);
|
|
506
|
-
__esDecorate(_classThis, null, _excludePrivate_decorators, { kind: "accessor", name: "excludePrivate", static: false, private: false, access: { has: obj => "excludePrivate" in obj, get: obj => obj.excludePrivate, set: (obj, value) => { obj.excludePrivate = value; } }, metadata: _metadata }, _excludePrivate_initializers, _excludePrivate_extraInitializers);
|
|
507
|
-
__esDecorate(_classThis, null, _excludeProtected_decorators, { kind: "accessor", name: "excludeProtected", static: false, private: false, access: { has: obj => "excludeProtected" in obj, get: obj => obj.excludeProtected, set: (obj, value) => { obj.excludeProtected = value; } }, metadata: _metadata }, _excludeProtected_initializers, _excludeProtected_extraInitializers);
|
|
508
|
-
__esDecorate(_classThis, null, _excludeReferences_decorators, { kind: "accessor", name: "excludeReferences", static: false, private: false, access: { has: obj => "excludeReferences" in obj, get: obj => obj.excludeReferences, set: (obj, value) => { obj.excludeReferences = value; } }, metadata: _metadata }, _excludeReferences_initializers, _excludeReferences_extraInitializers);
|
|
509
|
-
__esDecorate(_classThis, null, _commentStyle_decorators, { kind: "accessor", name: "commentStyle", static: false, private: false, access: { has: obj => "commentStyle" in obj, get: obj => obj.commentStyle, set: (obj, value) => { obj.commentStyle = value; } }, metadata: _metadata }, _commentStyle_initializers, _commentStyle_extraInitializers);
|
|
510
|
-
__esDecorate(_classThis, null, _validation_decorators, { kind: "accessor", name: "validation", static: false, private: false, access: { has: obj => "validation" in obj, get: obj => obj.validation, set: (obj, value) => { obj.validation = value; } }, metadata: _metadata }, _validation_initializers, _validation_extraInitializers);
|
|
511
|
-
__esDecorate(_classThis, null, _externalSymbolLinkMappings_decorators, { kind: "accessor", name: "externalSymbolLinkMappings", static: false, private: false, access: { has: obj => "externalSymbolLinkMappings" in obj, get: obj => obj.externalSymbolLinkMappings, set: (obj, value) => { obj.externalSymbolLinkMappings = value; } }, metadata: _metadata }, _externalSymbolLinkMappings_initializers, _externalSymbolLinkMappings_extraInitializers);
|
|
512
|
-
__esDecorate(_classThis, null, _preserveLinkText_decorators, { kind: "accessor", name: "preserveLinkText", static: false, private: false, access: { has: obj => "preserveLinkText" in obj, get: obj => obj.preserveLinkText, set: (obj, value) => { obj.preserveLinkText = value; } }, metadata: _metadata }, _preserveLinkText_initializers, _preserveLinkText_extraInitializers);
|
|
513
|
-
__esDecorate(_classThis, null, _maxTypeConversionDepth_decorators, { kind: "accessor", name: "maxTypeConversionDepth", static: false, private: false, access: { has: obj => "maxTypeConversionDepth" in obj, get: obj => obj.maxTypeConversionDepth, set: (obj, value) => { obj.maxTypeConversionDepth = value; } }, metadata: _metadata }, _maxTypeConversionDepth_initializers, _maxTypeConversionDepth_extraInitializers);
|
|
514
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
515
|
-
Converter = _classThis = _classDescriptor.value;
|
|
516
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
517
|
-
})();
|
|
518
|
-
/**
|
|
519
|
-
* General events
|
|
520
|
-
*/
|
|
521
|
-
/**
|
|
522
|
-
* Triggered when the converter begins converting a project.
|
|
523
|
-
* The listener will be given a {@link Context} object.
|
|
524
|
-
* @event
|
|
525
|
-
*/
|
|
526
|
-
_classThis.EVENT_BEGIN = converter_events_1.ConverterEvents.BEGIN;
|
|
527
|
-
/**
|
|
528
|
-
* Triggered when the converter has finished converting a project.
|
|
529
|
-
* The listener will be given a {@link Context} object.
|
|
530
|
-
* @event
|
|
531
|
-
*/
|
|
532
|
-
_classThis.EVENT_END = converter_events_1.ConverterEvents.END;
|
|
533
|
-
/**
|
|
534
|
-
* Factory events
|
|
535
|
-
*/
|
|
536
|
-
/**
|
|
537
|
-
* Triggered when the converter has created a declaration reflection.
|
|
538
|
-
* The listener will be given {@link Context} and a {@link Models.DeclarationReflection}.
|
|
539
|
-
* @event
|
|
540
|
-
*/
|
|
541
|
-
_classThis.EVENT_CREATE_DECLARATION = converter_events_1.ConverterEvents.CREATE_DECLARATION;
|
|
542
|
-
/**
|
|
543
|
-
* Triggered when the converter has created a signature reflection.
|
|
544
|
-
* The listener will be given {@link Context}, {@link Models.SignatureReflection} | {@link Models.ProjectReflection} the declaration,
|
|
545
|
-
* `ts.SignatureDeclaration | ts.IndexSignatureDeclaration | ts.JSDocSignature | undefined`,
|
|
546
|
-
* and `ts.Signature | undefined`. The signature will be undefined if the created signature is an index signature.
|
|
547
|
-
* @event
|
|
548
|
-
*/
|
|
549
|
-
_classThis.EVENT_CREATE_SIGNATURE = converter_events_1.ConverterEvents.CREATE_SIGNATURE;
|
|
550
|
-
/**
|
|
551
|
-
* Triggered when the converter has created a parameter reflection.
|
|
552
|
-
* The listener will be given {@link Context}, {@link Models.ParameterReflection} and a `ts.Node?`
|
|
553
|
-
* @event
|
|
554
|
-
*/
|
|
555
|
-
_classThis.EVENT_CREATE_PARAMETER = converter_events_1.ConverterEvents.CREATE_PARAMETER;
|
|
556
|
-
/**
|
|
557
|
-
* Triggered when the converter has created a type parameter reflection.
|
|
558
|
-
* The listener will be given {@link Context} and a {@link Models.TypeParameterReflection}
|
|
559
|
-
* @event
|
|
560
|
-
*/
|
|
561
|
-
_classThis.EVENT_CREATE_TYPE_PARAMETER = converter_events_1.ConverterEvents.CREATE_TYPE_PARAMETER;
|
|
562
|
-
/**
|
|
563
|
-
* Resolve events
|
|
564
|
-
*/
|
|
565
|
-
/**
|
|
566
|
-
* Triggered when the converter begins resolving a project.
|
|
567
|
-
* The listener will be given {@link Context}.
|
|
568
|
-
* @event
|
|
569
|
-
*/
|
|
570
|
-
_classThis.EVENT_RESOLVE_BEGIN = converter_events_1.ConverterEvents.RESOLVE_BEGIN;
|
|
571
|
-
/**
|
|
572
|
-
* Triggered when the converter resolves a reflection.
|
|
573
|
-
* The listener will be given {@link Context} and a {@link Reflection}.
|
|
574
|
-
* @event
|
|
575
|
-
*/
|
|
576
|
-
_classThis.EVENT_RESOLVE = converter_events_1.ConverterEvents.RESOLVE;
|
|
577
|
-
/**
|
|
578
|
-
* Triggered when the converter has finished resolving a project.
|
|
579
|
-
* The listener will be given {@link Context}.
|
|
580
|
-
* @event
|
|
581
|
-
*/
|
|
582
|
-
_classThis.EVENT_RESOLVE_END = converter_events_1.ConverterEvents.RESOLVE_END;
|
|
583
|
-
(() => {
|
|
584
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
585
|
-
})();
|
|
586
|
-
return Converter = _classThis;
|
|
587
559
|
})();
|
|
588
|
-
|
|
560
|
+
export { Converter };
|
|
589
561
|
function getSymbolForModuleLike(context, node) {
|
|
590
562
|
const symbol = context.checker.getSymbolAtLocation(node) ?? node.symbol;
|
|
591
563
|
if (symbol) {
|
|
@@ -596,15 +568,15 @@ function getSymbolForModuleLike(context, node) {
|
|
|
596
568
|
// "globals" file, but this is uncommon enough that I'm skipping it for now.
|
|
597
569
|
const sourceFile = node.getSourceFile();
|
|
598
570
|
const globalSymbols = context.checker
|
|
599
|
-
.getSymbolsInScope(node,
|
|
571
|
+
.getSymbolsInScope(node, ts.SymbolFlags.ModuleMember)
|
|
600
572
|
.filter((s) => s.getDeclarations()?.some((d) => d.getSourceFile() === sourceFile));
|
|
601
573
|
// Detect declaration files with declare module "foo" as their only export
|
|
602
574
|
// and lift that up one level as the source file symbol
|
|
603
575
|
if (globalSymbols.length === 1 &&
|
|
604
576
|
globalSymbols[0]
|
|
605
577
|
.getDeclarations()
|
|
606
|
-
?.every((declaration) =>
|
|
607
|
-
|
|
578
|
+
?.every((declaration) => ts.isModuleDeclaration(declaration) &&
|
|
579
|
+
ts.isStringLiteral(declaration.name))) {
|
|
608
580
|
return globalSymbols[0];
|
|
609
581
|
}
|
|
610
582
|
}
|
|
@@ -619,21 +591,22 @@ function getExports(context, node, symbol) {
|
|
|
619
591
|
// members of the export= class and as functions if a class is directly exported.
|
|
620
592
|
result = [exportEq].concat(context.checker
|
|
621
593
|
.getExportsOfModule(symbol)
|
|
622
|
-
.filter((s) => !
|
|
594
|
+
.filter((s) => !hasAnyFlag(s.flags, ts.SymbolFlags.Prototype | ts.SymbolFlags.Value)));
|
|
623
595
|
}
|
|
624
596
|
else if (symbol) {
|
|
625
597
|
result = context.checker
|
|
626
598
|
.getExportsOfModule(symbol)
|
|
627
|
-
.filter((s) => !
|
|
599
|
+
.filter((s) => !hasAllFlags(s.flags, ts.SymbolFlags.Prototype));
|
|
628
600
|
if (result.length === 0) {
|
|
629
|
-
const globalDecl = node.statements.find((s) =>
|
|
630
|
-
s.flags &
|
|
601
|
+
const globalDecl = node.statements.find((s) => ts.isModuleDeclaration(s) &&
|
|
602
|
+
s.flags & ts.NodeFlags.GlobalAugmentation);
|
|
631
603
|
if (globalDecl) {
|
|
632
604
|
const globalSymbol = context.getSymbolAtLocation(globalDecl);
|
|
633
605
|
if (globalSymbol) {
|
|
634
606
|
result = context.checker
|
|
635
607
|
.getExportsOfModule(globalSymbol)
|
|
636
|
-
.filter((exp) => exp.declarations?.some((d) => d.getSourceFile() === node))
|
|
608
|
+
.filter((exp) => exp.declarations?.some((d) => d.getSourceFile() === node))
|
|
609
|
+
.map((s) => context.checker.getMergedSymbol(s));
|
|
637
610
|
}
|
|
638
611
|
}
|
|
639
612
|
}
|
|
@@ -642,7 +615,7 @@ function getExports(context, node, symbol) {
|
|
|
642
615
|
// Global file with no inferred top level symbol, get all symbols declared in this file.
|
|
643
616
|
const sourceFile = node.getSourceFile();
|
|
644
617
|
result = context.checker
|
|
645
|
-
.getSymbolsInScope(node,
|
|
618
|
+
.getSymbolsInScope(node, ts.SymbolFlags.ModuleMember)
|
|
646
619
|
.filter((s) => s
|
|
647
620
|
.getDeclarations()
|
|
648
621
|
?.some((d) => d.getSourceFile() === sourceFile));
|