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,2 +1,2 @@
|
|
|
1
|
-
export { Comment, CommentTag } from "./comment";
|
|
2
|
-
export type { CommentDisplayPart, InlineTagDisplayPart, RelativeLinkDisplayPart, } from "./comment";
|
|
1
|
+
export { Comment, CommentTag } from "./comment.js";
|
|
2
|
+
export type { CommentDisplayPart, InlineTagDisplayPart, RelativeLinkDisplayPart, } from "./comment.js";
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CommentTag = exports.Comment = void 0;
|
|
4
|
-
var comment_1 = require("./comment");
|
|
5
|
-
Object.defineProperty(exports, "Comment", { enumerable: true, get: function () { return comment_1.Comment; } });
|
|
6
|
-
Object.defineProperty(exports, "CommentTag", { enumerable: true, get: function () { return comment_1.CommentTag; } });
|
|
1
|
+
export { Comment, CommentTag } from "./comment.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from "./reflections/index";
|
|
2
|
-
export * from "./types";
|
|
3
|
-
export * from "./comments/index";
|
|
4
|
-
export * from "./sources/index";
|
|
5
|
-
export * from "./ReflectionGroup";
|
|
6
|
-
export * from "./ReflectionCategory";
|
|
7
|
-
export * from "./FileRegistry";
|
|
1
|
+
export * from "./reflections/index.js";
|
|
2
|
+
export * from "./types.js";
|
|
3
|
+
export * from "./comments/index.js";
|
|
4
|
+
export * from "./sources/index.js";
|
|
5
|
+
export * from "./ReflectionGroup.js";
|
|
6
|
+
export * from "./ReflectionCategory.js";
|
|
7
|
+
export * from "./FileRegistry.js";
|
package/dist/lib/models/index.js
CHANGED
|
@@ -1,23 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./reflections/index"), exports);
|
|
18
|
-
__exportStar(require("./types"), exports);
|
|
19
|
-
__exportStar(require("./comments/index"), exports);
|
|
20
|
-
__exportStar(require("./sources/index"), exports);
|
|
21
|
-
__exportStar(require("./ReflectionGroup"), exports);
|
|
22
|
-
__exportStar(require("./ReflectionCategory"), exports);
|
|
23
|
-
__exportStar(require("./FileRegistry"), exports);
|
|
1
|
+
export * from "./reflections/index.js";
|
|
2
|
+
export * from "./types.js";
|
|
3
|
+
export * from "./comments/index.js";
|
|
4
|
+
export * from "./sources/index.js";
|
|
5
|
+
export * from "./ReflectionGroup.js";
|
|
6
|
+
export * from "./ReflectionCategory.js";
|
|
7
|
+
export * from "./FileRegistry.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
-
import type { JSONOutput, Serializer } from "../../serialization/index";
|
|
3
|
-
import type { DeclarationReference } from "../../converter/
|
|
2
|
+
import type { JSONOutput, Serializer } from "../../serialization/index.js";
|
|
3
|
+
import type { DeclarationReference } from "../../converter/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* See {@link ReflectionSymbolId}
|
|
6
6
|
*/
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const path_1 = require("path");
|
|
10
|
-
const typescript_1 = __importDefault(require("typescript"));
|
|
11
|
-
const fs_2 = require("../../utils/fs");
|
|
12
|
-
const paths_1 = require("../../utils/paths");
|
|
13
|
-
const tsutils_1 = require("../../utils/tsutils");
|
|
14
|
-
const validation_1 = require("../../utils/validation");
|
|
15
|
-
const utils_1 = require("./utils");
|
|
1
|
+
import { existsSync } from "fs";
|
|
2
|
+
import { isAbsolute, join, relative, resolve } from "path";
|
|
3
|
+
import ts from "typescript";
|
|
4
|
+
import { findPackageForPath, getCommonDirectory, readFile, } from "../../utils/fs.js";
|
|
5
|
+
import { normalizePath } from "../../utils/paths.js";
|
|
6
|
+
import { getQualifiedName } from "../../utils/tsutils.js";
|
|
7
|
+
import { optional, validate } from "../../utils/validation.js";
|
|
8
|
+
import { splitUnquotedString } from "./utils.js";
|
|
16
9
|
let transientCount = 0;
|
|
17
10
|
const transientIds = new WeakMap();
|
|
18
11
|
/**
|
|
@@ -20,19 +13,34 @@ const transientIds = new WeakMap();
|
|
|
20
13
|
* keeping a reference to the `ts.Symbol` itself. This identifier should be stable across
|
|
21
14
|
* runs so long as the symbol is exported from the same file.
|
|
22
15
|
*/
|
|
23
|
-
class ReflectionSymbolId {
|
|
16
|
+
export class ReflectionSymbolId {
|
|
17
|
+
fileName;
|
|
18
|
+
qualifiedName;
|
|
19
|
+
/**
|
|
20
|
+
* Note: This is **not** serialized. It exists for sorting by declaration order, but
|
|
21
|
+
* should not be needed when deserializing from JSON.
|
|
22
|
+
* Will be set to `Infinity` if the ID was deserialized from JSON.
|
|
23
|
+
*/
|
|
24
|
+
pos;
|
|
25
|
+
/**
|
|
26
|
+
* Note: This is **not** serialized. It exists to support detection of the differences between
|
|
27
|
+
* symbols which share declarations, but are instantiated with different type parameters.
|
|
28
|
+
* This will be `NaN` if the symbol reference is not transient.
|
|
29
|
+
* Note: This can only be non-NaN if {@link pos} is finite.
|
|
30
|
+
*/
|
|
31
|
+
transientId;
|
|
24
32
|
constructor(symbol, declaration) {
|
|
25
33
|
if ("name" in symbol) {
|
|
26
34
|
declaration ??= symbol.declarations?.[0];
|
|
27
|
-
this.fileName =
|
|
28
|
-
if (symbol.declarations?.some(
|
|
35
|
+
this.fileName = normalizePath(declaration?.getSourceFile().fileName ?? "");
|
|
36
|
+
if (symbol.declarations?.some(ts.isSourceFile)) {
|
|
29
37
|
this.qualifiedName = "";
|
|
30
38
|
}
|
|
31
39
|
else {
|
|
32
|
-
this.qualifiedName =
|
|
40
|
+
this.qualifiedName = getQualifiedName(symbol, symbol.name);
|
|
33
41
|
}
|
|
34
42
|
this.pos = declaration?.getStart() ?? Infinity;
|
|
35
|
-
if (symbol.flags &
|
|
43
|
+
if (symbol.flags & ts.SymbolFlags.Transient) {
|
|
36
44
|
this.transientId = transientIds.get(symbol) ?? ++transientCount;
|
|
37
45
|
transientIds.set(symbol, this.transientId);
|
|
38
46
|
}
|
|
@@ -58,9 +66,9 @@ class ReflectionSymbolId {
|
|
|
58
66
|
toDeclarationReference() {
|
|
59
67
|
return {
|
|
60
68
|
resolutionStart: "global",
|
|
61
|
-
moduleSource:
|
|
69
|
+
moduleSource: findPackageForPath(this.fileName),
|
|
62
70
|
symbolReference: {
|
|
63
|
-
path:
|
|
71
|
+
path: splitUnquotedString(this.qualifiedName, ".").map((path) => ({
|
|
64
72
|
navigation: ".",
|
|
65
73
|
path,
|
|
66
74
|
})),
|
|
@@ -68,8 +76,8 @@ class ReflectionSymbolId {
|
|
|
68
76
|
};
|
|
69
77
|
}
|
|
70
78
|
toObject(serializer) {
|
|
71
|
-
const sourceFileName =
|
|
72
|
-
?
|
|
79
|
+
const sourceFileName = isAbsolute(this.fileName)
|
|
80
|
+
? normalizePath(relative(serializer.projectRoot, resolveDeclarationMaps(this.fileName)))
|
|
73
81
|
: this.fileName;
|
|
74
82
|
return {
|
|
75
83
|
sourceFileName,
|
|
@@ -77,7 +85,6 @@ class ReflectionSymbolId {
|
|
|
77
85
|
};
|
|
78
86
|
}
|
|
79
87
|
}
|
|
80
|
-
exports.ReflectionSymbolId = ReflectionSymbolId;
|
|
81
88
|
const declarationMapCache = new Map();
|
|
82
89
|
function resolveDeclarationMaps(file) {
|
|
83
90
|
if (!/\.d\.[cm]?ts$/.test(file))
|
|
@@ -85,18 +92,18 @@ function resolveDeclarationMaps(file) {
|
|
|
85
92
|
if (declarationMapCache.has(file))
|
|
86
93
|
return declarationMapCache.get(file);
|
|
87
94
|
const mapFile = file + ".map";
|
|
88
|
-
if (!
|
|
95
|
+
if (!existsSync(mapFile))
|
|
89
96
|
return file;
|
|
90
97
|
let sourceMap;
|
|
91
98
|
try {
|
|
92
|
-
sourceMap = JSON.parse(
|
|
99
|
+
sourceMap = JSON.parse(readFile(mapFile));
|
|
93
100
|
}
|
|
94
101
|
catch {
|
|
95
102
|
return file;
|
|
96
103
|
}
|
|
97
|
-
if (
|
|
104
|
+
if (validate({
|
|
98
105
|
file: String,
|
|
99
|
-
sourceRoot:
|
|
106
|
+
sourceRoot: optional(String),
|
|
100
107
|
sources: [Array, String],
|
|
101
108
|
}, sourceMap)) {
|
|
102
109
|
// There's a pretty large assumption in here that we only have
|
|
@@ -107,19 +114,20 @@ function resolveDeclarationMaps(file) {
|
|
|
107
114
|
// Similar to how it's done at https://github.com/mozilla/source-map/blob/58819f09018d56ef84dc41ba9c93f554e0645169/lib/util.js#L412
|
|
108
115
|
if (sourceMap.sourceRoot !== undefined) {
|
|
109
116
|
source = source.replace(/^\//, "");
|
|
110
|
-
source =
|
|
117
|
+
source = join(sourceMap.sourceRoot, source);
|
|
111
118
|
}
|
|
112
|
-
const result =
|
|
119
|
+
const result = resolve(mapFile, "..", source);
|
|
113
120
|
declarationMapCache.set(file, result);
|
|
114
121
|
return result;
|
|
115
122
|
}
|
|
116
123
|
return file;
|
|
117
124
|
}
|
|
118
|
-
|
|
119
|
-
|
|
125
|
+
// See also: inferEntryPoints in entry-point.ts
|
|
126
|
+
export function addInferredDeclarationMapPaths(opts, files) {
|
|
127
|
+
const rootDir = opts.rootDir || getCommonDirectory(files);
|
|
120
128
|
const declDir = opts.declarationDir || opts.outDir || rootDir;
|
|
121
129
|
for (const file of files) {
|
|
122
|
-
const mapFile =
|
|
130
|
+
const mapFile = normalizePath(resolve(declDir, relative(rootDir, file)).replace(/\.([cm]?[tj]s)x?$/, ".d.$1"));
|
|
123
131
|
declarationMapCache.set(mapFile, file);
|
|
124
132
|
}
|
|
125
133
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { Comment } from "../comments/comment";
|
|
2
|
-
import type { ProjectReflection } from "./project";
|
|
3
|
-
import type { NeverIfInternal } from "../../utils";
|
|
4
|
-
import { ReflectionKind } from "./kind";
|
|
5
|
-
import type { Serializer, Deserializer, JSONOutput } from "../../serialization";
|
|
6
|
-
import type { ReflectionVariant } from "./variant";
|
|
7
|
-
import type { DeclarationReflection } from "./declaration";
|
|
8
|
-
import type { DocumentReflection } from "./document";
|
|
9
|
-
import type { Internationalization, TranslatedString } from "../../internationalization";
|
|
1
|
+
import { Comment } from "../comments/comment.js";
|
|
2
|
+
import type { ProjectReflection } from "./project.js";
|
|
3
|
+
import type { NeverIfInternal } from "../../utils/index.js";
|
|
4
|
+
import { ReflectionKind } from "./kind.js";
|
|
5
|
+
import type { Serializer, Deserializer, JSONOutput } from "../../serialization/index.js";
|
|
6
|
+
import type { ReflectionVariant } from "./variant.js";
|
|
7
|
+
import type { DeclarationReflection } from "./declaration.js";
|
|
8
|
+
import type { DocumentReflection } from "./document.js";
|
|
9
|
+
import type { Internationalization, TranslatedString } from "../../internationalization/index.js";
|
|
10
|
+
import type { ParameterReflection } from "./parameter.js";
|
|
11
|
+
import type { ReferenceReflection } from "./reference.js";
|
|
10
12
|
/**
|
|
11
13
|
* Reset the reflection id.
|
|
12
14
|
*
|
|
@@ -95,6 +97,9 @@ export interface TraverseCallback {
|
|
|
95
97
|
export type ReflectionVisitor = {
|
|
96
98
|
[K in keyof ReflectionVariant]?: (refl: ReflectionVariant[K]) => void;
|
|
97
99
|
};
|
|
100
|
+
export type ReflectionId = number & {
|
|
101
|
+
__reflectionIdBrand: never;
|
|
102
|
+
};
|
|
98
103
|
/**
|
|
99
104
|
* Base class for all reflection classes.
|
|
100
105
|
*
|
|
@@ -115,7 +120,7 @@ export declare abstract class Reflection {
|
|
|
115
120
|
/**
|
|
116
121
|
* Unique id of this reflection.
|
|
117
122
|
*/
|
|
118
|
-
id:
|
|
123
|
+
id: ReflectionId;
|
|
119
124
|
/**
|
|
120
125
|
* The symbol name of this reflection.
|
|
121
126
|
*/
|
|
@@ -151,11 +156,6 @@ export declare abstract class Reflection {
|
|
|
151
156
|
* TODO: Reflections shouldn't know how they are rendered. Move this to the correct serializer.
|
|
152
157
|
*/
|
|
153
158
|
hasOwnDocument?: boolean;
|
|
154
|
-
/**
|
|
155
|
-
* Url safe alias for this reflection.
|
|
156
|
-
*/
|
|
157
|
-
private _alias?;
|
|
158
|
-
private _aliases?;
|
|
159
159
|
constructor(name: string, kind: ReflectionKind, parent?: Reflection);
|
|
160
160
|
/**
|
|
161
161
|
* Test whether this reflection is of the given kind.
|
|
@@ -180,11 +180,6 @@ export declare abstract class Reflection {
|
|
|
180
180
|
* Set a flag on this reflection.
|
|
181
181
|
*/
|
|
182
182
|
setFlag(flag: ReflectionFlag, value?: boolean): void;
|
|
183
|
-
/**
|
|
184
|
-
* Return an url safe alias for this reflection.
|
|
185
|
-
*/
|
|
186
|
-
getAlias(): string;
|
|
187
|
-
getUniqueAliasInPage(heading: string): string;
|
|
188
183
|
/**
|
|
189
184
|
* Has this reflection a visible comment?
|
|
190
185
|
*
|
|
@@ -204,7 +199,9 @@ export declare abstract class Reflection {
|
|
|
204
199
|
*/
|
|
205
200
|
isProject(): this is ProjectReflection;
|
|
206
201
|
isDeclaration(): this is DeclarationReflection;
|
|
202
|
+
isParameter(): this is ParameterReflection;
|
|
207
203
|
isDocument(): this is DocumentReflection;
|
|
204
|
+
isReference(): this is ReferenceReflection;
|
|
208
205
|
/**
|
|
209
206
|
* Check if this reflection or any of its parents have been marked with the `@deprecated` tag.
|
|
210
207
|
*/
|