typedoc 0.26.10 → 0.27.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/package.json +3 -0
- package/bin/typedoc +1 -1
- package/dist/index.d.ts +23 -13
- package/dist/index.js +22 -81
- package/dist/lib/application-events.js +1 -4
- package/dist/lib/application.d.ts +26 -16
- package/dist/lib/application.js +222 -242
- package/dist/lib/cli.js +3 -40
- package/dist/lib/converter/comments/blockLexer.d.ts +1 -1
- package/dist/lib/converter/comments/blockLexer.js +24 -30
- package/dist/lib/converter/comments/declarationReference.js +10 -21
- package/dist/lib/converter/comments/declarationReferenceResolver.d.ts +2 -2
- package/dist/lib/converter/comments/declarationReferenceResolver.js +40 -36
- package/dist/lib/converter/comments/discovery.d.ts +4 -4
- package/dist/lib/converter/comments/discovery.js +172 -148
- package/dist/lib/converter/comments/index.d.ts +4 -4
- package/dist/lib/converter/comments/index.js +39 -50
- package/dist/lib/converter/comments/lexer.d.ts +1 -1
- package/dist/lib/converter/comments/lexer.js +2 -5
- package/dist/lib/converter/comments/lineLexer.d.ts +1 -1
- package/dist/lib/converter/comments/lineLexer.js +12 -15
- package/dist/lib/converter/comments/linkResolver.d.ts +2 -2
- package/dist/lib/converter/comments/linkResolver.js +14 -21
- package/dist/lib/converter/comments/parser.d.ts +6 -6
- package/dist/lib/converter/comments/parser.js +69 -96
- package/dist/lib/converter/comments/rawLexer.d.ts +1 -1
- package/dist/lib/converter/comments/rawLexer.js +13 -16
- package/dist/lib/converter/comments/tagName.js +1 -4
- package/dist/lib/converter/comments/textParser.d.ts +4 -4
- package/dist/lib/converter/comments/textParser.js +28 -30
- package/dist/lib/converter/components.d.ts +2 -3
- package/dist/lib/converter/components.js +2 -7
- package/dist/lib/converter/context.d.ts +9 -9
- package/dist/lib/converter/context.js +54 -44
- package/dist/lib/converter/convert-expression.js +16 -23
- package/dist/lib/converter/converter-events.d.ts +1 -0
- package/dist/lib/converter/converter-events.js +2 -4
- package/dist/lib/converter/converter.d.ts +16 -13
- package/dist/lib/converter/converter.js +210 -238
- package/dist/lib/converter/factories/index-signature.d.ts +1 -1
- package/dist/lib/converter/factories/index-signature.js +11 -17
- package/dist/lib/converter/factories/signature.d.ts +2 -2
- package/dist/lib/converter/factories/signature.js +95 -106
- package/dist/lib/converter/index.d.ts +6 -7
- package/dist/lib/converter/index.js +3 -11
- package/dist/lib/converter/jsdoc.d.ts +1 -1
- package/dist/lib/converter/jsdoc.js +34 -41
- package/dist/lib/converter/plugins/CategoryPlugin.d.ts +6 -21
- package/dist/lib/converter/plugins/CategoryPlugin.js +57 -139
- package/dist/lib/converter/plugins/CommentPlugin.d.ts +3 -5
- package/dist/lib/converter/plugins/CommentPlugin.js +153 -163
- package/dist/lib/converter/plugins/GroupPlugin.d.ts +10 -9
- package/dist/lib/converter/plugins/GroupPlugin.js +87 -124
- package/dist/lib/converter/plugins/ImplementsPlugin.d.ts +3 -5
- package/dist/lib/converter/plugins/ImplementsPlugin.js +255 -321
- package/dist/lib/converter/plugins/IncludePlugin.d.ts +11 -0
- package/dist/lib/converter/plugins/IncludePlugin.js +72 -0
- package/dist/lib/converter/plugins/InheritDocPlugin.d.ts +4 -3
- package/dist/lib/converter/plugins/InheritDocPlugin.js +41 -72
- package/dist/lib/converter/plugins/LinkResolverPlugin.d.ts +5 -5
- package/dist/lib/converter/plugins/LinkResolverPlugin.js +37 -58
- package/dist/lib/converter/plugins/MergeModuleWithPlugin.d.ts +12 -0
- package/dist/lib/converter/plugins/MergeModuleWithPlugin.js +49 -0
- package/dist/lib/converter/plugins/PackagePlugin.d.ts +4 -3
- package/dist/lib/converter/plugins/PackagePlugin.js +62 -111
- package/dist/lib/converter/plugins/SourcePlugin.d.ts +3 -5
- package/dist/lib/converter/plugins/SourcePlugin.js +69 -110
- package/dist/lib/converter/plugins/TypePlugin.d.ts +4 -6
- package/dist/lib/converter/plugins/TypePlugin.js +95 -158
- package/dist/lib/converter/plugins/index.d.ts +10 -9
- package/dist/lib/converter/plugins/index.js +10 -21
- package/dist/lib/converter/symbols.d.ts +1 -1
- package/dist/lib/converter/symbols.js +234 -227
- package/dist/lib/converter/types.d.ts +2 -2
- package/dist/lib/converter/types.js +252 -237
- package/dist/lib/converter/utils/nodes.js +5 -13
- package/dist/lib/converter/utils/reflections.d.ts +1 -1
- package/dist/lib/converter/utils/reflections.js +4 -7
- package/dist/lib/converter/utils/repository.d.ts +1 -1
- package/dist/lib/converter/utils/repository.js +103 -97
- package/dist/lib/converter/utils/symbols.js +3 -9
- package/dist/lib/internationalization/index.d.ts +3 -4
- package/dist/lib/internationalization/index.js +3 -8
- package/dist/lib/internationalization/internationalization.d.ts +5 -4
- package/dist/lib/internationalization/internationalization.js +97 -103
- package/dist/lib/internationalization/locale-utils.cjs +8 -0
- package/dist/lib/internationalization/locale-utils.d.cts +8 -0
- package/dist/lib/internationalization/locales/en.cjs +366 -2
- package/dist/lib/internationalization/locales/en.d.cts +339 -2
- package/dist/lib/internationalization/locales/jp.cjs +8 -11
- package/dist/lib/internationalization/locales/jp.d.cts +310 -1
- package/dist/lib/internationalization/locales/ko.cjs +7 -9
- package/dist/lib/internationalization/locales/ko.d.cts +223 -1
- package/dist/lib/internationalization/locales/zh.cjs +7 -10
- package/dist/lib/internationalization/locales/zh.d.cts +381 -1
- package/dist/lib/internationalization/translatable.d.ts +4 -327
- package/dist/lib/internationalization/translatable.js +2 -360
- package/dist/lib/models/FileRegistry.d.ts +20 -9
- package/dist/lib/models/FileRegistry.js +54 -45
- package/dist/lib/models/ReflectionCategory.d.ts +2 -2
- package/dist/lib/models/ReflectionCategory.js +16 -12
- package/dist/lib/models/ReflectionGroup.d.ts +3 -3
- package/dist/lib/models/ReflectionGroup.js +23 -14
- package/dist/lib/models/comments/comment.d.ts +23 -37
- package/dist/lib/models/comments/comment.js +388 -325
- package/dist/lib/models/comments/index.d.ts +2 -2
- package/dist/lib/models/comments/index.js +1 -6
- package/dist/lib/models/index.d.ts +7 -7
- package/dist/lib/models/index.js +7 -23
- package/dist/lib/models/reflections/ReflectionSymbolId.d.ts +2 -2
- package/dist/lib/models/reflections/ReflectionSymbolId.js +42 -34
- package/dist/lib/models/reflections/abstract.d.ts +17 -20
- package/dist/lib/models/reflections/abstract.js +249 -256
- package/dist/lib/models/reflections/container.d.ts +7 -7
- package/dist/lib/models/reflections/container.js +43 -16
- package/dist/lib/models/reflections/declaration.d.ts +15 -12
- package/dist/lib/models/reflections/declaration.js +150 -29
- package/dist/lib/models/reflections/document.d.ts +3 -3
- package/dist/lib/models/reflections/document.js +26 -13
- package/dist/lib/models/reflections/index.d.ts +15 -15
- package/dist/lib/models/reflections/index.js +12 -31
- package/dist/lib/models/reflections/kind.d.ts +1 -1
- package/dist/lib/models/reflections/kind.js +3 -6
- package/dist/lib/models/reflections/parameter.d.ts +5 -4
- package/dist/lib/models/reflections/parameter.js +11 -13
- package/dist/lib/models/reflections/project.d.ts +14 -9
- package/dist/lib/models/reflections/project.js +104 -56
- package/dist/lib/models/reflections/reference.d.ts +3 -3
- package/dist/lib/models/reflections/reference.js +6 -9
- package/dist/lib/models/reflections/signature.d.ts +8 -8
- package/dist/lib/models/reflections/signature.js +35 -14
- package/dist/lib/models/reflections/type-parameter.d.ts +5 -5
- package/dist/lib/models/reflections/type-parameter.js +9 -10
- package/dist/lib/models/reflections/utils.js +1 -4
- package/dist/lib/models/reflections/variant.d.ts +8 -7
- package/dist/lib/models/reflections/variant.js +1 -2
- package/dist/lib/models/sources/file.d.ts +2 -2
- package/dist/lib/models/sources/file.js +22 -5
- package/dist/lib/models/sources/index.d.ts +1 -1
- package/dist/lib/models/sources/index.js +1 -5
- package/dist/lib/models/types.d.ts +26 -13
- package/dist/lib/models/types.js +236 -151
- package/dist/lib/output/components.d.ts +5 -11
- package/dist/lib/output/components.js +84 -125
- package/dist/lib/output/events.d.ts +3 -3
- package/dist/lib/output/events.js +128 -94
- package/dist/lib/output/formatter.d.ts +84 -0
- package/dist/lib/output/formatter.js +619 -0
- package/dist/lib/output/index.d.ts +9 -8
- package/dist/lib/output/index.js +7 -19
- package/dist/lib/output/models/UrlMapping.d.ts +2 -2
- package/dist/lib/output/models/UrlMapping.js +4 -5
- package/dist/lib/output/output.d.ts +13 -0
- package/dist/lib/output/output.js +72 -0
- package/dist/lib/output/plugins/AssetsPlugin.d.ts +7 -8
- package/dist/lib/output/plugins/AssetsPlugin.js +62 -80
- package/dist/lib/output/plugins/IconsPlugin.d.ts +3 -2
- package/dist/lib/output/plugins/IconsPlugin.js +28 -84
- package/dist/lib/output/plugins/JavascriptIndexPlugin.d.ts +9 -2
- package/dist/lib/output/plugins/JavascriptIndexPlugin.js +90 -96
- package/dist/lib/output/plugins/NavigationPlugin.d.ts +3 -2
- package/dist/lib/output/plugins/NavigationPlugin.js +22 -102
- package/dist/lib/output/plugins/SitemapPlugin.d.ts +3 -2
- package/dist/lib/output/plugins/SitemapPlugin.js +60 -120
- package/dist/lib/output/plugins/index.d.ts +6 -6
- package/dist/lib/output/plugins/index.js +6 -15
- package/dist/lib/output/renderer.d.ts +14 -13
- package/dist/lib/output/renderer.js +129 -185
- package/dist/lib/output/theme.d.ts +9 -5
- package/dist/lib/output/theme.js +14 -62
- package/dist/lib/output/themes/MarkedPlugin.d.ts +8 -9
- package/dist/lib/output/themes/MarkedPlugin.js +152 -117
- package/dist/lib/output/themes/default/DefaultTheme.d.ts +17 -29
- package/dist/lib/output/themes/default/DefaultTheme.js +334 -310
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +63 -48
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +119 -95
- package/dist/lib/output/themes/default/Slugger.d.ts +13 -0
- package/dist/lib/output/themes/default/Slugger.js +46 -0
- package/dist/lib/output/themes/default/layouts/default.d.ts +5 -5
- package/dist/lib/output/themes/default/layouts/default.js +67 -34
- package/dist/lib/output/themes/default/partials/anchor-icon.d.ts +2 -2
- package/dist/lib/output/themes/default/partials/anchor-icon.js +4 -7
- package/dist/lib/output/themes/default/partials/breadcrumb.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/breadcrumb.js +4 -8
- package/dist/lib/output/themes/default/partials/comment.d.ts +6 -4
- package/dist/lib/output/themes/default/partials/comment.js +52 -29
- package/dist/lib/output/themes/default/partials/footer.d.ts +2 -2
- package/dist/lib/output/themes/default/partials/footer.js +11 -14
- package/dist/lib/output/themes/default/partials/header.d.ts +4 -4
- package/dist/lib/output/themes/default/partials/header.js +9 -13
- package/dist/lib/output/themes/default/partials/hierarchy.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/hierarchy.js +9 -12
- package/dist/lib/output/themes/default/partials/icon.d.ts +4 -4
- package/dist/lib/output/themes/default/partials/icon.js +78 -73
- package/dist/lib/output/themes/default/partials/index.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/index.js +19 -22
- package/dist/lib/output/themes/default/partials/member.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.declaration.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.declaration.js +18 -61
- package/dist/lib/output/themes/default/partials/member.getterSetter.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.getterSetter.js +10 -26
- package/dist/lib/output/themes/default/partials/member.js +19 -24
- package/dist/lib/output/themes/default/partials/member.signature.body.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.signature.body.js +17 -21
- package/dist/lib/output/themes/default/partials/member.signature.title.d.ts +4 -7
- package/dist/lib/output/themes/default/partials/member.signature.title.js +8 -35
- package/dist/lib/output/themes/default/partials/member.signatures.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.signatures.js +9 -13
- package/dist/lib/output/themes/default/partials/member.sources.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.sources.js +13 -17
- package/dist/lib/output/themes/default/partials/members.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/members.js +10 -42
- package/dist/lib/output/themes/default/partials/moduleReflection.d.ts +5 -0
- package/dist/lib/output/themes/default/partials/moduleReflection.js +62 -0
- package/dist/lib/output/themes/default/partials/navigation.d.ts +4 -4
- package/dist/lib/output/themes/default/partials/navigation.js +51 -62
- package/dist/lib/output/themes/default/partials/reflectionPreview.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/reflectionPreview.js +12 -15
- package/dist/lib/output/themes/default/partials/toolbar.d.ts +4 -4
- package/dist/lib/output/themes/default/partials/toolbar.js +16 -20
- package/dist/lib/output/themes/default/partials/type.d.ts +4 -6
- package/dist/lib/output/themes/default/partials/type.js +8 -388
- package/dist/lib/output/themes/default/partials/typeAndParent.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/typeAndParent.js +11 -15
- package/dist/lib/output/themes/default/partials/typeDetails.d.ts +8 -0
- package/dist/lib/output/themes/default/partials/typeDetails.js +221 -0
- package/dist/lib/output/themes/default/partials/typeParameters.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/typeParameters.js +14 -17
- package/dist/lib/output/themes/default/templates/document.d.ts +4 -4
- package/dist/lib/output/themes/default/templates/document.js +3 -7
- package/dist/lib/output/themes/default/templates/hierarchy.d.ts +4 -4
- package/dist/lib/output/themes/default/templates/hierarchy.js +10 -13
- package/dist/lib/output/themes/default/templates/index.d.ts +4 -4
- package/dist/lib/output/themes/default/templates/index.js +3 -7
- package/dist/lib/output/themes/default/templates/reflection.d.ts +4 -4
- package/dist/lib/output/themes/default/templates/reflection.js +31 -34
- package/dist/lib/output/themes/lib.d.ts +17 -3
- package/dist/lib/output/themes/lib.js +110 -49
- package/dist/lib/serialization/components.d.ts +2 -5
- package/dist/lib/serialization/components.js +1 -2
- package/dist/lib/serialization/deserializer.d.ts +21 -7
- package/dist/lib/serialization/deserializer.js +138 -123
- package/dist/lib/serialization/events.d.ts +2 -2
- package/dist/lib/serialization/events.js +6 -5
- package/dist/lib/serialization/index.d.ts +5 -5
- package/dist/lib/serialization/index.js +4 -33
- package/dist/lib/serialization/schema.d.ts +8 -2
- package/dist/lib/serialization/schema.js +2 -2
- package/dist/lib/serialization/serializer.d.ts +11 -5
- package/dist/lib/serialization/serializer.js +32 -25
- package/dist/lib/utils/array.d.ts +3 -0
- package/dist/lib/utils/array.js +26 -27
- package/dist/lib/utils/component.d.ts +2 -44
- package/dist/lib/utils/component.js +10 -102
- package/dist/lib/utils/entry-point.d.ts +3 -4
- package/dist/lib/utils/entry-point.js +114 -85
- package/dist/lib/utils/enum.js +6 -14
- package/dist/lib/utils/events.js +6 -12
- package/dist/lib/utils/fs.js +50 -91
- package/dist/lib/utils/general.d.ts +2 -1
- package/dist/lib/utils/general.js +50 -40
- package/dist/lib/utils/highlighter.js +30 -57
- package/dist/lib/utils/hooks.js +7 -13
- package/dist/lib/utils/html-entities.d.ts +8926 -0
- package/dist/lib/utils/html-entities.js +2329 -0
- package/dist/lib/utils/html.d.ts +8 -0
- package/dist/lib/utils/html.js +81 -34
- package/dist/lib/utils/index.d.ts +22 -22
- package/dist/lib/utils/index.js +20 -91
- package/dist/lib/utils/jsx.d.ts +12 -5
- package/dist/lib/utils/jsx.elements.js +1 -4
- package/dist/lib/utils/jsx.js +53 -20
- package/dist/lib/utils/loggers.d.ts +3 -3
- package/dist/lib/utils/loggers.js +36 -46
- package/dist/lib/utils/map.d.ts +1 -1
- package/dist/lib/utils/map.js +6 -13
- package/dist/lib/utils/minimalSourceFile.js +5 -7
- package/dist/lib/utils/options/declaration.d.ts +33 -7
- package/dist/lib/utils/options/declaration.js +20 -22
- package/dist/lib/utils/options/defaults.d.ts +3 -2
- package/dist/lib/utils/options/defaults.js +18 -38
- package/dist/lib/utils/options/help.d.ts +2 -2
- package/dist/lib/utils/options/help.js +7 -10
- package/dist/lib/utils/options/index.d.ts +6 -6
- package/dist/lib/utils/options/index.js +4 -18
- package/dist/lib/utils/options/options.d.ts +8 -5
- package/dist/lib/utils/options/options.js +47 -71
- package/dist/lib/utils/options/readers/arguments.d.ts +2 -2
- package/dist/lib/utils/options/readers/arguments.js +15 -17
- package/dist/lib/utils/options/readers/index.d.ts +4 -4
- package/dist/lib/utils/options/readers/index.js +4 -11
- package/dist/lib/utils/options/readers/package-json.d.ts +3 -3
- package/dist/lib/utils/options/readers/package-json.js +15 -21
- package/dist/lib/utils/options/readers/tsconfig.d.ts +2 -2
- package/dist/lib/utils/options/readers/tsconfig.js +54 -63
- package/dist/lib/utils/options/readers/typedoc.d.ts +3 -3
- package/dist/lib/utils/options/readers/typedoc.js +47 -90
- package/dist/lib/utils/options/sources/index.d.ts +1 -1
- package/dist/lib/utils/options/sources/index.js +1 -5
- package/dist/lib/utils/options/sources/typedoc.d.ts +1 -1
- package/dist/lib/utils/options/sources/typedoc.js +220 -196
- package/dist/lib/utils/options/tsdoc-defaults.d.ts +3 -3
- package/dist/lib/utils/options/tsdoc-defaults.js +16 -12
- package/dist/lib/utils/package-manifest.d.ts +1 -1
- package/dist/lib/utils/package-manifest.js +15 -19
- package/dist/lib/utils/paths.js +9 -15
- package/dist/lib/utils/perf.js +6 -11
- package/dist/lib/utils/plugins.d.ts +1 -1
- package/dist/lib/utils/plugins.js +16 -17
- package/dist/lib/utils/reflections.d.ts +1 -1
- package/dist/lib/utils/reflections.js +9 -12
- package/dist/lib/utils/set.js +2 -6
- package/dist/lib/utils/sort.d.ts +3 -3
- package/dist/lib/utils/sort.js +20 -24
- package/dist/lib/utils/tsconfig.d.ts +1 -1
- package/dist/lib/utils/tsconfig.js +13 -21
- package/dist/lib/utils/tsutils.d.ts +1 -1
- package/dist/lib/utils/tsutils.js +3 -30
- package/dist/lib/utils/validation.js +6 -12
- package/dist/lib/validation/documentation.d.ts +2 -2
- package/dist/lib/validation/documentation.js +26 -29
- package/dist/lib/validation/exports.d.ts +2 -2
- package/dist/lib/validation/exports.js +9 -11
- package/dist/lib/validation/links.d.ts +2 -2
- package/dist/lib/validation/links.js +4 -7
- package/dist/lib/validation/unusedMergeModuleWith.d.ts +3 -0
- package/dist/lib/validation/unusedMergeModuleWith.js +11 -0
- package/package.json +14 -11
- package/static/main.js +4 -4
- package/static/style.css +91 -2
- package/tsdoc.json +30 -0
- package/dist/lib/output/themes/default/partials/member.reference.d.ts +0 -4
- package/dist/lib/output/themes/default/partials/member.reference.js +0 -30
- package/dist/lib/output/themes/default/partials/parameter.d.ts +0 -4
- package/dist/lib/output/themes/default/partials/parameter.js +0 -79
- package/dist/lib/utils/html-entities.json +0 -2326
package/dist/lib/cli.js
CHANGED
|
@@ -1,29 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* eslint-disable no-console */
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
-
if (mod && mod.__esModule) return mod;
|
|
21
|
-
var result = {};
|
|
22
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
-
__setModuleDefault(result, mod);
|
|
24
|
-
return result;
|
|
25
|
-
};
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
2
|
const ExitCodes = {
|
|
28
3
|
Ok: 0,
|
|
29
4
|
OptionError: 1,
|
|
@@ -33,7 +8,7 @@ const ExitCodes = {
|
|
|
33
8
|
ExceptionThrown: 6,
|
|
34
9
|
Watching: 7,
|
|
35
10
|
};
|
|
36
|
-
|
|
11
|
+
import * as td from "../index.js";
|
|
37
12
|
void main();
|
|
38
13
|
async function main() {
|
|
39
14
|
let app;
|
|
@@ -85,13 +60,7 @@ async function run(app) {
|
|
|
85
60
|
if (app.options.getValue("watch")) {
|
|
86
61
|
app.convertAndWatch(async (project) => {
|
|
87
62
|
app.validate(project);
|
|
88
|
-
|
|
89
|
-
if (!json || app.options.isSet("out")) {
|
|
90
|
-
await app.generateDocs(project, app.options.getValue("out"));
|
|
91
|
-
}
|
|
92
|
-
if (json) {
|
|
93
|
-
await app.generateJson(project, json);
|
|
94
|
-
}
|
|
63
|
+
await app.generateOutputs(project);
|
|
95
64
|
});
|
|
96
65
|
return ExitCodes.Watching;
|
|
97
66
|
}
|
|
@@ -115,13 +84,7 @@ async function run(app) {
|
|
|
115
84
|
return ExitCodes.ValidationError;
|
|
116
85
|
}
|
|
117
86
|
if (app.options.getValue("emit") !== "none") {
|
|
118
|
-
|
|
119
|
-
if (!json || app.options.isSet("out")) {
|
|
120
|
-
await app.generateDocs(project, app.options.getValue("out"));
|
|
121
|
-
}
|
|
122
|
-
if (json) {
|
|
123
|
-
await app.generateJson(project, json);
|
|
124
|
-
}
|
|
87
|
+
await app.generateOutputs(project);
|
|
125
88
|
if (app.logger.hasErrors()) {
|
|
126
89
|
return ExitCodes.OutputError;
|
|
127
90
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
-
import { type Token } from "./lexer";
|
|
2
|
+
import { type Token } from "./lexer.js";
|
|
3
3
|
export declare function lexBlockComment(file: string, pos?: number, end?: number, jsDoc?: ts.JSDoc | undefined, checker?: ts.TypeChecker | undefined): Generator<Token, undefined, undefined>;
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
exports.lexBlockComment = lexBlockComment;
|
|
7
|
-
const typescript_1 = __importDefault(require("typescript"));
|
|
8
|
-
const lexer_1 = require("./lexer");
|
|
9
|
-
const ReflectionSymbolId_1 = require("../../models/reflections/ReflectionSymbolId");
|
|
10
|
-
const symbols_1 = require("../utils/symbols");
|
|
11
|
-
function* lexBlockComment(file, pos = 0, end = file.length, jsDoc = undefined, checker = undefined) {
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { TokenSyntaxKind } from "./lexer.js";
|
|
3
|
+
import { ReflectionSymbolId } from "../../models/reflections/ReflectionSymbolId.js";
|
|
4
|
+
import { resolveAliasedSymbol } from "../utils/symbols.js";
|
|
5
|
+
export function* lexBlockComment(file, pos = 0, end = file.length, jsDoc = undefined, checker = undefined) {
|
|
12
6
|
// Wrapper around our real lex function to collapse adjacent text tokens.
|
|
13
7
|
let textToken;
|
|
14
8
|
for (const token of lexBlockComment2(file, pos, end, getLinkTags(jsDoc), checker)) {
|
|
15
|
-
if (token.kind ===
|
|
9
|
+
if (token.kind === TokenSyntaxKind.Text) {
|
|
16
10
|
if (textToken) {
|
|
17
11
|
textToken.text += token.text;
|
|
18
12
|
}
|
|
@@ -38,9 +32,9 @@ function getLinkTags(jsDoc) {
|
|
|
38
32
|
if (jsDoc?.comment && typeof jsDoc.comment !== "string") {
|
|
39
33
|
for (const part of jsDoc.comment) {
|
|
40
34
|
switch (part.kind) {
|
|
41
|
-
case
|
|
42
|
-
case
|
|
43
|
-
case
|
|
35
|
+
case ts.SyntaxKind.JSDocLink:
|
|
36
|
+
case ts.SyntaxKind.JSDocLinkCode:
|
|
37
|
+
case ts.SyntaxKind.JSDocLinkPlain:
|
|
44
38
|
result.push(part);
|
|
45
39
|
}
|
|
46
40
|
}
|
|
@@ -50,9 +44,9 @@ function getLinkTags(jsDoc) {
|
|
|
50
44
|
continue;
|
|
51
45
|
for (const part of block.comment) {
|
|
52
46
|
switch (part.kind) {
|
|
53
|
-
case
|
|
54
|
-
case
|
|
55
|
-
case
|
|
47
|
+
case ts.SyntaxKind.JSDocLink:
|
|
48
|
+
case ts.SyntaxKind.JSDocLinkCode:
|
|
49
|
+
case ts.SyntaxKind.JSDocLinkPlain:
|
|
56
50
|
result.push(part);
|
|
57
51
|
}
|
|
58
52
|
}
|
|
@@ -95,20 +89,20 @@ function* lexBlockComment2(file, pos, end, linkTags, checker) {
|
|
|
95
89
|
}
|
|
96
90
|
switch (file[pos]) {
|
|
97
91
|
case "\n":
|
|
98
|
-
yield makeToken(
|
|
92
|
+
yield makeToken(TokenSyntaxKind.NewLine, 1);
|
|
99
93
|
lineStart = true;
|
|
100
94
|
break;
|
|
101
95
|
case "{":
|
|
102
96
|
if (braceStartsType && nextNonWs(pos + 1) !== "@") {
|
|
103
|
-
yield makeToken(
|
|
97
|
+
yield makeToken(TokenSyntaxKind.TypeAnnotation, findEndOfType(pos) - pos);
|
|
104
98
|
braceStartsType = false;
|
|
105
99
|
}
|
|
106
100
|
else {
|
|
107
|
-
yield makeToken(
|
|
101
|
+
yield makeToken(TokenSyntaxKind.OpenBrace, 1);
|
|
108
102
|
}
|
|
109
103
|
break;
|
|
110
104
|
case "}":
|
|
111
|
-
yield makeToken(
|
|
105
|
+
yield makeToken(TokenSyntaxKind.CloseBrace, 1);
|
|
112
106
|
braceStartsType = false;
|
|
113
107
|
break;
|
|
114
108
|
case "`": {
|
|
@@ -132,7 +126,7 @@ function* lexBlockComment2(file, pos, end, linkTags, checker) {
|
|
|
132
126
|
lookahead += tickCount;
|
|
133
127
|
codeText.push(file.substring(lookaheadStart, lookahead));
|
|
134
128
|
yield {
|
|
135
|
-
kind:
|
|
129
|
+
kind: TokenSyntaxKind.Code,
|
|
136
130
|
text: codeText.join(""),
|
|
137
131
|
pos,
|
|
138
132
|
};
|
|
@@ -177,14 +171,14 @@ function* lexBlockComment2(file, pos, end, linkTags, checker) {
|
|
|
177
171
|
file.substring(pos, end).includes("\n")) {
|
|
178
172
|
codeText.push(file.substring(lookaheadStart, end));
|
|
179
173
|
yield {
|
|
180
|
-
kind:
|
|
174
|
+
kind: TokenSyntaxKind.Code,
|
|
181
175
|
text: codeText.join(""),
|
|
182
176
|
pos,
|
|
183
177
|
};
|
|
184
178
|
pos = lookahead;
|
|
185
179
|
}
|
|
186
180
|
else {
|
|
187
|
-
yield makeToken(
|
|
181
|
+
yield makeToken(TokenSyntaxKind.Text, tickCount);
|
|
188
182
|
}
|
|
189
183
|
}
|
|
190
184
|
break;
|
|
@@ -203,7 +197,7 @@ function* lexBlockComment2(file, pos, end, linkTags, checker) {
|
|
|
203
197
|
if (lookahead !== pos + 1 &&
|
|
204
198
|
(lookahead === end || /[\s}]/.test(file[lookahead]))) {
|
|
205
199
|
braceStartsType = true;
|
|
206
|
-
const token = makeToken(
|
|
200
|
+
const token = makeToken(TokenSyntaxKind.Tag, lookahead - pos);
|
|
207
201
|
attachLinkTagResult(token);
|
|
208
202
|
yield token;
|
|
209
203
|
break;
|
|
@@ -238,7 +232,7 @@ function* lexBlockComment2(file, pos, end, linkTags, checker) {
|
|
|
238
232
|
}
|
|
239
233
|
// This piece of text had line continuations or escaped text
|
|
240
234
|
yield {
|
|
241
|
-
kind:
|
|
235
|
+
kind: TokenSyntaxKind.Text,
|
|
242
236
|
text: textParts.join(""),
|
|
243
237
|
pos,
|
|
244
238
|
};
|
|
@@ -260,7 +254,7 @@ function* lexBlockComment2(file, pos, end, linkTags, checker) {
|
|
|
260
254
|
if (link.name) {
|
|
261
255
|
const tsTarget = checker?.getSymbolAtLocation(getRightmostName(link.name));
|
|
262
256
|
if (tsTarget) {
|
|
263
|
-
token.tsLinkTarget = new
|
|
257
|
+
token.tsLinkTarget = new ReflectionSymbolId(resolveAliasedSymbol(tsTarget, checker));
|
|
264
258
|
token.tsLinkText = link.text.replace(/^\s*\|\s*/, "");
|
|
265
259
|
}
|
|
266
260
|
}
|
|
@@ -368,10 +362,10 @@ function discoverIndent(file, pos, end) {
|
|
|
368
362
|
return [commentHasStars, indent];
|
|
369
363
|
}
|
|
370
364
|
function getRightmostName(name) {
|
|
371
|
-
if (
|
|
365
|
+
if (ts.isJSDocMemberName(name)) {
|
|
372
366
|
return name.right;
|
|
373
367
|
}
|
|
374
|
-
if (
|
|
368
|
+
if (ts.isQualifiedName(name)) {
|
|
375
369
|
return name.right;
|
|
376
370
|
}
|
|
377
371
|
return name;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Parser for declaration references, see the [TSDoc grammar](https://github.com/microsoft/tsdoc/blob/main/tsdoc/src/beta/DeclarationReference.grammarkdown)
|
|
4
3
|
* for reference. TypeDoc **does not** support the full grammar today. This is intentional, since the TSDoc
|
|
@@ -6,17 +5,7 @@
|
|
|
6
5
|
*
|
|
7
6
|
* @module
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
|
-
exports.MeaningKeywords = void 0;
|
|
11
|
-
exports.meaningToString = meaningToString;
|
|
12
|
-
exports.parseString = parseString;
|
|
13
|
-
exports.parseModuleSource = parseModuleSource;
|
|
14
|
-
exports.parseSymbolReference = parseSymbolReference;
|
|
15
|
-
exports.parseComponent = parseComponent;
|
|
16
|
-
exports.parseComponentPath = parseComponentPath;
|
|
17
|
-
exports.parseMeaning = parseMeaning;
|
|
18
|
-
exports.parseDeclarationReference = parseDeclarationReference;
|
|
19
|
-
exports.MeaningKeywords = [
|
|
8
|
+
export const MeaningKeywords = [
|
|
20
9
|
"class", // SymbolFlags.Class
|
|
21
10
|
"interface", // SymbolFlags.Interface
|
|
22
11
|
"type", // SymbolFlags.TypeAlias
|
|
@@ -35,7 +24,7 @@ exports.MeaningKeywords = [
|
|
|
35
24
|
"getter",
|
|
36
25
|
"setter",
|
|
37
26
|
];
|
|
38
|
-
function meaningToString(meaning) {
|
|
27
|
+
export function meaningToString(meaning) {
|
|
39
28
|
let result = "";
|
|
40
29
|
if (meaning.keyword) {
|
|
41
30
|
result += meaning.keyword;
|
|
@@ -144,7 +133,7 @@ function parseUnicodeEscapeSequence(source, pos, end) {
|
|
|
144
133
|
// StringCharacter::
|
|
145
134
|
// SourceCharacter but not one of `"` or `\` or LineTerminator
|
|
146
135
|
// `\` EscapeSequence
|
|
147
|
-
function parseString(source, pos, end) {
|
|
136
|
+
export function parseString(source, pos, end) {
|
|
148
137
|
let result = "";
|
|
149
138
|
if (source[pos++] !== '"')
|
|
150
139
|
return;
|
|
@@ -166,7 +155,7 @@ function parseString(source, pos, end) {
|
|
|
166
155
|
}
|
|
167
156
|
}
|
|
168
157
|
// ModuleSource:: String | ModuleSourceCharacters
|
|
169
|
-
function parseModuleSource(source, pos, end) {
|
|
158
|
+
export function parseModuleSource(source, pos, end) {
|
|
170
159
|
if (pos >= end)
|
|
171
160
|
return;
|
|
172
161
|
if (source[pos] === '"') {
|
|
@@ -184,7 +173,7 @@ function parseModuleSource(source, pos, end) {
|
|
|
184
173
|
// SymbolReference:
|
|
185
174
|
// ComponentPath Meaning?
|
|
186
175
|
// Meaning
|
|
187
|
-
function parseSymbolReference(source, pos, end) {
|
|
176
|
+
export function parseSymbolReference(source, pos, end) {
|
|
188
177
|
const path = parseComponentPath(source, pos, end);
|
|
189
178
|
pos = path?.[1] ?? pos;
|
|
190
179
|
const meaning = parseMeaning(source, pos, end);
|
|
@@ -197,7 +186,7 @@ function parseSymbolReference(source, pos, end) {
|
|
|
197
186
|
// String
|
|
198
187
|
// ComponentCharacters
|
|
199
188
|
// `[` DeclarationReference `]` <--- THIS ONE IS NOT IMPLEMENTED.
|
|
200
|
-
function parseComponent(source, pos, end) {
|
|
189
|
+
export function parseComponent(source, pos, end) {
|
|
201
190
|
if (pos < end && source[pos] === '"') {
|
|
202
191
|
return parseString(source, pos, end);
|
|
203
192
|
}
|
|
@@ -219,7 +208,7 @@ function parseComponent(source, pos, end) {
|
|
|
219
208
|
// ComponentPath `.` Component // Navigate via 'exports' of |ComponentPath|
|
|
220
209
|
// ComponentPath `#` Component // Navigate via 'members' of |ComponentPath|
|
|
221
210
|
// ComponentPath `~` Component // Navigate via 'locals' of |ComponentPath|
|
|
222
|
-
function parseComponentPath(source, pos, end) {
|
|
211
|
+
export function parseComponentPath(source, pos, end) {
|
|
223
212
|
const components = [];
|
|
224
213
|
let component = parseComponent(source, pos, end);
|
|
225
214
|
if (!component)
|
|
@@ -249,10 +238,10 @@ function parseComponentPath(source, pos, end) {
|
|
|
249
238
|
//
|
|
250
239
|
// UserLabel:
|
|
251
240
|
// UserLabelStart UserLabelCharacter*
|
|
252
|
-
function parseMeaning(source, pos, end) {
|
|
241
|
+
export function parseMeaning(source, pos, end) {
|
|
253
242
|
if (source[pos++] !== ":")
|
|
254
243
|
return;
|
|
255
|
-
const keyword =
|
|
244
|
+
const keyword = MeaningKeywords.find((kw) => pos + kw.length <= end && source.startsWith(kw, pos));
|
|
256
245
|
if (keyword) {
|
|
257
246
|
pos += keyword.length;
|
|
258
247
|
}
|
|
@@ -307,7 +296,7 @@ function parseMeaning(source, pos, end) {
|
|
|
307
296
|
// ModuleSource `!` SymbolReference // Reference to an export of a module
|
|
308
297
|
// ModuleSource `!` `~` SymbolReference // Reference to a local of a module
|
|
309
298
|
// `!` SymbolReference // Reference to global symbol
|
|
310
|
-
function parseDeclarationReference(source, pos, end) {
|
|
299
|
+
export function parseDeclarationReference(source, pos, end) {
|
|
311
300
|
let moduleSource;
|
|
312
301
|
let symbolReference;
|
|
313
302
|
let resolutionStart = "local";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { type Reflection } from "../../models";
|
|
2
|
-
import type { DeclarationReference } from "./declarationReference";
|
|
1
|
+
import { type Reflection } from "../../models/index.js";
|
|
2
|
+
import type { DeclarationReference } from "./declarationReference.js";
|
|
3
3
|
export declare function resolveDeclarationReference(reflection: Reflection, ref: DeclarationReference): Reflection | undefined;
|
|
@@ -1,55 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const assert_1 = require("assert");
|
|
5
|
-
const models_1 = require("../../models");
|
|
6
|
-
const utils_1 = require("../../utils");
|
|
1
|
+
import { ok } from "assert";
|
|
2
|
+
import { ContainerReflection, DeclarationReflection, ReferenceReflection, ReflectionKind, } from "../../models/index.js";
|
|
3
|
+
import { assertNever, filterMap } from "../../utils/index.js";
|
|
7
4
|
function resolveReferenceReflection(ref) {
|
|
8
|
-
if (ref instanceof
|
|
5
|
+
if (ref instanceof ReferenceReflection) {
|
|
9
6
|
return ref.getTargetReflectionDeep();
|
|
10
7
|
}
|
|
11
8
|
return ref;
|
|
12
9
|
}
|
|
13
|
-
function resolveDeclarationReference(reflection, ref) {
|
|
10
|
+
export function resolveDeclarationReference(reflection, ref) {
|
|
14
11
|
let high = [];
|
|
15
12
|
let low = [];
|
|
16
13
|
if (ref.moduleSource) {
|
|
17
14
|
high =
|
|
18
|
-
reflection.project.children?.filter((c) => c.kindOf(
|
|
15
|
+
reflection.project.children?.filter((c) => c.kindOf(ReflectionKind.SomeModule) &&
|
|
19
16
|
c.name === ref.moduleSource) || [];
|
|
20
17
|
}
|
|
21
18
|
else if (ref.resolutionStart === "global") {
|
|
22
19
|
high.push(reflection.project);
|
|
20
|
+
if (reflection.project.children?.length === 1) {
|
|
21
|
+
high.push(reflection.project.children[0]);
|
|
22
|
+
}
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
25
25
|
// Work around no-unnecessary-condition, should be unnecessary... want a trap if it ever becomes false.
|
|
26
|
-
|
|
26
|
+
ok(ref.resolutionStart.startsWith("local") &&
|
|
27
27
|
ref.resolutionStart.length === 5);
|
|
28
28
|
// TypeScript's behavior is to first try to resolve links via variable scope, and then
|
|
29
29
|
// if the link still hasn't been found, check either siblings (if comment belongs to a member)
|
|
30
30
|
// or otherwise children.
|
|
31
31
|
let refl = reflection;
|
|
32
|
-
if (refl.kindOf(
|
|
32
|
+
if (refl.kindOf(ReflectionKind.ExportContainer)) {
|
|
33
33
|
high.push(refl);
|
|
34
34
|
}
|
|
35
35
|
while (refl.parent) {
|
|
36
36
|
refl = refl.parent;
|
|
37
|
-
if (refl.kindOf(
|
|
37
|
+
if (refl.kindOf(ReflectionKind.ExportContainer)) {
|
|
38
38
|
high.push(refl);
|
|
39
39
|
}
|
|
40
40
|
else {
|
|
41
41
|
low.push(refl);
|
|
42
42
|
}
|
|
43
|
+
if (refl.kindOf(ReflectionKind.Project) &&
|
|
44
|
+
refl.children?.length === 1) {
|
|
45
|
+
high.push(refl.children[0]);
|
|
46
|
+
}
|
|
43
47
|
}
|
|
44
|
-
if (reflection.kindOf(
|
|
48
|
+
if (reflection.kindOf(ReflectionKind.SomeMember)) {
|
|
45
49
|
high.push(reflection.parent);
|
|
46
50
|
}
|
|
47
|
-
else if (reflection.kindOf(
|
|
48
|
-
reflection.parent.kindOf(
|
|
51
|
+
else if (reflection.kindOf(ReflectionKind.SomeSignature) &&
|
|
52
|
+
reflection.parent.kindOf(ReflectionKind.SomeMember)) {
|
|
49
53
|
high.push(reflection.parent.parent);
|
|
50
54
|
}
|
|
51
55
|
else if (high[0] !== reflection) {
|
|
52
|
-
if (reflection.parent instanceof
|
|
56
|
+
if (reflection.parent instanceof ContainerReflection) {
|
|
53
57
|
high.push(...(reflection.parent.childrenIncludingDocuments?.filter((c) => c.name === reflection.name) || []));
|
|
54
58
|
}
|
|
55
59
|
else {
|
|
@@ -82,7 +86,7 @@ function resolveDeclarationReference(reflection, ref) {
|
|
|
82
86
|
return high[0] || low[0];
|
|
83
87
|
}
|
|
84
88
|
function filterMapByMeaning(reflections, meaning) {
|
|
85
|
-
return
|
|
89
|
+
return filterMap(reflections, (refl) => {
|
|
86
90
|
const kwResolved = resolveKeyword(refl, meaning.keyword) || [];
|
|
87
91
|
if (meaning.label) {
|
|
88
92
|
return kwResolved.find((r) => r.comment?.label === meaning.label);
|
|
@@ -93,48 +97,48 @@ function filterMapByMeaning(reflections, meaning) {
|
|
|
93
97
|
function resolveKeyword(refl, kw) {
|
|
94
98
|
switch (kw) {
|
|
95
99
|
case undefined:
|
|
96
|
-
return refl instanceof
|
|
100
|
+
return refl instanceof DeclarationReflection && refl.signatures
|
|
97
101
|
? refl.signatures
|
|
98
102
|
: [refl];
|
|
99
103
|
case "class":
|
|
100
|
-
if (refl.kindOf(
|
|
104
|
+
if (refl.kindOf(ReflectionKind.Class))
|
|
101
105
|
return [refl];
|
|
102
106
|
break;
|
|
103
107
|
case "interface":
|
|
104
|
-
if (refl.kindOf(
|
|
108
|
+
if (refl.kindOf(ReflectionKind.Interface))
|
|
105
109
|
return [refl];
|
|
106
110
|
break;
|
|
107
111
|
case "type":
|
|
108
|
-
if (refl.kindOf(
|
|
112
|
+
if (refl.kindOf(ReflectionKind.SomeType))
|
|
109
113
|
return [refl];
|
|
110
114
|
break;
|
|
111
115
|
case "enum":
|
|
112
|
-
if (refl.kindOf(
|
|
116
|
+
if (refl.kindOf(ReflectionKind.Enum))
|
|
113
117
|
return [refl];
|
|
114
118
|
break;
|
|
115
119
|
case "namespace":
|
|
116
|
-
if (refl.kindOf(
|
|
120
|
+
if (refl.kindOf(ReflectionKind.SomeModule))
|
|
117
121
|
return [refl];
|
|
118
122
|
break;
|
|
119
123
|
case "function":
|
|
120
|
-
if (refl.kindOf(
|
|
124
|
+
if (refl.kindOf(ReflectionKind.FunctionOrMethod)) {
|
|
121
125
|
return refl.signatures;
|
|
122
126
|
}
|
|
123
127
|
break;
|
|
124
128
|
case "var":
|
|
125
|
-
if (refl.kindOf(
|
|
129
|
+
if (refl.kindOf(ReflectionKind.Variable))
|
|
126
130
|
return [refl];
|
|
127
131
|
break;
|
|
128
132
|
case "new":
|
|
129
133
|
case "constructor":
|
|
130
|
-
if (refl.kindOf(
|
|
131
|
-
|
|
132
|
-
const ctor = refl.children?.find((c) => c.kindOf(
|
|
134
|
+
if (refl.kindOf(ReflectionKind.ClassOrInterface |
|
|
135
|
+
ReflectionKind.TypeLiteral)) {
|
|
136
|
+
const ctor = refl.children?.find((c) => c.kindOf(ReflectionKind.Constructor));
|
|
133
137
|
return ctor.signatures;
|
|
134
138
|
}
|
|
135
139
|
break;
|
|
136
140
|
case "member":
|
|
137
|
-
if (refl.kindOf(
|
|
141
|
+
if (refl.kindOf(ReflectionKind.SomeMember))
|
|
138
142
|
return [refl];
|
|
139
143
|
break;
|
|
140
144
|
case "event":
|
|
@@ -150,7 +154,7 @@ function resolveKeyword(refl, kw) {
|
|
|
150
154
|
}
|
|
151
155
|
break;
|
|
152
156
|
case "complex":
|
|
153
|
-
if (refl.kindOf(
|
|
157
|
+
if (refl.kindOf(ReflectionKind.SomeType))
|
|
154
158
|
return [refl];
|
|
155
159
|
break;
|
|
156
160
|
case "getter":
|
|
@@ -164,13 +168,13 @@ function resolveKeyword(refl, kw) {
|
|
|
164
168
|
}
|
|
165
169
|
break;
|
|
166
170
|
default:
|
|
167
|
-
|
|
171
|
+
assertNever(kw);
|
|
168
172
|
}
|
|
169
173
|
}
|
|
170
174
|
function resolveSymbolReferencePart(refl, path) {
|
|
171
175
|
let high = [];
|
|
172
176
|
let low = [];
|
|
173
|
-
if (!(refl instanceof
|
|
177
|
+
if (!(refl instanceof ContainerReflection) ||
|
|
174
178
|
!refl.childrenIncludingDocuments) {
|
|
175
179
|
return { high, low };
|
|
176
180
|
}
|
|
@@ -181,9 +185,9 @@ function resolveSymbolReferencePart(refl, path) {
|
|
|
181
185
|
// Also is more consistent with how TypeScript resolves link tags.
|
|
182
186
|
case ".":
|
|
183
187
|
high = refl.childrenIncludingDocuments.filter((r) => r.name === path.path &&
|
|
184
|
-
(r.kindOf(
|
|
188
|
+
(r.kindOf(ReflectionKind.SomeExport) || r.flags.isStatic));
|
|
185
189
|
low = refl.childrenIncludingDocuments.filter((r) => r.name === path.path &&
|
|
186
|
-
(!r.kindOf(
|
|
190
|
+
(!r.kindOf(ReflectionKind.SomeExport) || !r.flags.isStatic));
|
|
187
191
|
break;
|
|
188
192
|
// Resolve via "members", interface children, class instance properties/accessors/methods,
|
|
189
193
|
// enum members, type literal properties
|
|
@@ -191,14 +195,14 @@ function resolveSymbolReferencePart(refl, path) {
|
|
|
191
195
|
high =
|
|
192
196
|
refl.children?.filter((r) => {
|
|
193
197
|
return (r.name === path.path &&
|
|
194
|
-
r.kindOf(
|
|
198
|
+
r.kindOf(ReflectionKind.SomeMember) &&
|
|
195
199
|
!r.flags.isStatic);
|
|
196
200
|
}) || [];
|
|
197
201
|
break;
|
|
198
202
|
// Resolve via "locals"... treat this as a stricter `.` which only supports traversing
|
|
199
203
|
// module/namespace exports since TypeDoc doesn't support documenting locals.
|
|
200
204
|
case "~":
|
|
201
|
-
if (refl.kindOf(
|
|
205
|
+
if (refl.kindOf(ReflectionKind.SomeModule | ReflectionKind.Project)) {
|
|
202
206
|
high = refl.children?.filter((r) => r.name === path.path) || [];
|
|
203
207
|
}
|
|
204
208
|
break;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
-
import { ReflectionKind } from "../../models";
|
|
3
|
-
import { type Logger } from "../../utils";
|
|
4
|
-
import { CommentStyle } from "../../utils/options/declaration";
|
|
2
|
+
import { ReflectionKind } from "../../models/index.js";
|
|
3
|
+
import { type Logger } from "../../utils/index.js";
|
|
4
|
+
import { CommentStyle } from "../../utils/options/declaration.js";
|
|
5
5
|
export interface DiscoveredComment {
|
|
6
6
|
file: ts.SourceFile;
|
|
7
7
|
ranges: ts.CommentRange[];
|
|
@@ -10,5 +10,5 @@ export interface DiscoveredComment {
|
|
|
10
10
|
}
|
|
11
11
|
export declare function discoverFileComments(node: ts.SourceFile, commentStyle: CommentStyle): DiscoveredComment[];
|
|
12
12
|
export declare function discoverNodeComment(node: ts.Node, commentStyle: CommentStyle): DiscoveredComment | undefined;
|
|
13
|
-
export declare function discoverComment(symbol: ts.Symbol, kind: ReflectionKind, logger: Logger, commentStyle: CommentStyle, checker: ts.TypeChecker): DiscoveredComment | undefined;
|
|
13
|
+
export declare function discoverComment(symbol: ts.Symbol, kind: ReflectionKind, logger: Logger, commentStyle: CommentStyle, checker: ts.TypeChecker, declarationWarnings: boolean): DiscoveredComment | undefined;
|
|
14
14
|
export declare function discoverSignatureComment(declaration: ts.SignatureDeclaration | ts.JSDocSignature, checker: ts.TypeChecker, commentStyle: CommentStyle): DiscoveredComment | undefined;
|