@depup/typedoc 0.28.17-depup.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/LICENSE +201 -0
- package/README.md +34 -0
- package/bin/package.json +3 -0
- package/bin/typedoc +24 -0
- package/changes.json +22 -0
- package/dist/browser-locales/de.d.ts +2 -0
- package/dist/browser-locales/de.js +62 -0
- package/dist/browser-locales/en.d.ts +2 -0
- package/dist/browser-locales/en.js +62 -0
- package/dist/browser-locales/ja.d.ts +2 -0
- package/dist/browser-locales/ja.js +62 -0
- package/dist/browser-locales/ko.d.ts +2 -0
- package/dist/browser-locales/ko.js +62 -0
- package/dist/browser-locales/zh.d.ts +2 -0
- package/dist/browser-locales/zh.js +62 -0
- package/dist/browser-utils.d.ts +3 -0
- package/dist/browser-utils.js +3 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.js +46 -0
- package/dist/lib/application-events.d.ts +5 -0
- package/dist/lib/application-events.js +5 -0
- package/dist/lib/application.d.ts +195 -0
- package/dist/lib/application.js +715 -0
- package/dist/lib/cli.d.ts +1 -0
- package/dist/lib/cli.js +111 -0
- package/dist/lib/converter/comments/blockLexer.d.ts +4 -0
- package/dist/lib/converter/comments/blockLexer.js +391 -0
- package/dist/lib/converter/comments/declarationReferenceResolver.d.ts +3 -0
- package/dist/lib/converter/comments/declarationReferenceResolver.js +218 -0
- package/dist/lib/converter/comments/discovery.d.ts +14 -0
- package/dist/lib/converter/comments/discovery.js +563 -0
- package/dist/lib/converter/comments/index.d.ts +37 -0
- package/dist/lib/converter/comments/index.js +241 -0
- package/dist/lib/converter/comments/lexer.d.ts +17 -0
- package/dist/lib/converter/comments/lexer.js +10 -0
- package/dist/lib/converter/comments/lineLexer.d.ts +3 -0
- package/dist/lib/converter/comments/lineLexer.js +279 -0
- package/dist/lib/converter/comments/linkResolver.d.ts +20 -0
- package/dist/lib/converter/comments/linkResolver.js +186 -0
- package/dist/lib/converter/comments/parser.d.ts +18 -0
- package/dist/lib/converter/comments/parser.js +538 -0
- package/dist/lib/converter/comments/rawLexer.d.ts +8 -0
- package/dist/lib/converter/comments/rawLexer.js +218 -0
- package/dist/lib/converter/comments/tagName.d.ts +8 -0
- package/dist/lib/converter/comments/tagName.js +58 -0
- package/dist/lib/converter/comments/textParser.d.ts +33 -0
- package/dist/lib/converter/comments/textParser.js +372 -0
- package/dist/lib/converter/components.d.ts +4 -0
- package/dist/lib/converter/components.js +3 -0
- package/dist/lib/converter/context.d.ts +101 -0
- package/dist/lib/converter/context.js +311 -0
- package/dist/lib/converter/convert-expression.d.ts +9 -0
- package/dist/lib/converter/convert-expression.js +58 -0
- package/dist/lib/converter/converter-events.d.ts +13 -0
- package/dist/lib/converter/converter-events.js +13 -0
- package/dist/lib/converter/converter.d.ts +238 -0
- package/dist/lib/converter/converter.js +705 -0
- package/dist/lib/converter/factories/index-signature.d.ts +3 -0
- package/dist/lib/converter/factories/index-signature.js +50 -0
- package/dist/lib/converter/factories/signature.d.ts +14 -0
- package/dist/lib/converter/factories/signature.js +353 -0
- package/dist/lib/converter/factories/symbol-id.d.ts +3 -0
- package/dist/lib/converter/factories/symbol-id.js +47 -0
- package/dist/lib/converter/index.d.ts +5 -0
- package/dist/lib/converter/index.js +3 -0
- package/dist/lib/converter/jsdoc.d.ts +4 -0
- package/dist/lib/converter/jsdoc.js +135 -0
- package/dist/lib/converter/plugins/CategoryPlugin.d.ts +48 -0
- package/dist/lib/converter/plugins/CategoryPlugin.js +278 -0
- package/dist/lib/converter/plugins/CommentPlugin.d.ts +128 -0
- package/dist/lib/converter/plugins/CommentPlugin.js +770 -0
- package/dist/lib/converter/plugins/GroupPlugin.d.ts +48 -0
- package/dist/lib/converter/plugins/GroupPlugin.js +281 -0
- package/dist/lib/converter/plugins/ImplementsPlugin.d.ts +42 -0
- package/dist/lib/converter/plugins/ImplementsPlugin.js +438 -0
- package/dist/lib/converter/plugins/IncludePlugin.d.ts +14 -0
- package/dist/lib/converter/plugins/IncludePlugin.js +254 -0
- package/dist/lib/converter/plugins/InheritDocPlugin.d.ts +32 -0
- package/dist/lib/converter/plugins/InheritDocPlugin.js +220 -0
- package/dist/lib/converter/plugins/LinkResolverPlugin.d.ts +13 -0
- package/dist/lib/converter/plugins/LinkResolverPlugin.js +88 -0
- package/dist/lib/converter/plugins/MergeModuleWithPlugin.d.ts +12 -0
- package/dist/lib/converter/plugins/MergeModuleWithPlugin.js +50 -0
- package/dist/lib/converter/plugins/PackagePlugin.d.ts +31 -0
- package/dist/lib/converter/plugins/PackagePlugin.js +188 -0
- package/dist/lib/converter/plugins/SourcePlugin.d.ts +36 -0
- package/dist/lib/converter/plugins/SourcePlugin.js +215 -0
- package/dist/lib/converter/plugins/TypePlugin.d.ts +16 -0
- package/dist/lib/converter/plugins/TypePlugin.js +108 -0
- package/dist/lib/converter/plugins/index.d.ts +10 -0
- package/dist/lib/converter/plugins/index.js +10 -0
- package/dist/lib/converter/symbols.d.ts +3 -0
- package/dist/lib/converter/symbols.js +861 -0
- package/dist/lib/converter/types.d.ts +10 -0
- package/dist/lib/converter/types.js +833 -0
- package/dist/lib/converter/utils/nodes.d.ts +7 -0
- package/dist/lib/converter/utils/nodes.js +26 -0
- package/dist/lib/converter/utils/reflections.d.ts +2 -0
- package/dist/lib/converter/utils/reflections.js +17 -0
- package/dist/lib/converter/utils/repository.d.ts +96 -0
- package/dist/lib/converter/utils/repository.js +295 -0
- package/dist/lib/converter/utils/symbols.d.ts +2 -0
- package/dist/lib/converter/utils/symbols.js +12 -0
- package/dist/lib/debug/index.d.ts +2 -0
- package/dist/lib/debug/index.js +2 -0
- package/dist/lib/debug/reflectionLifetimes.d.ts +3 -0
- package/dist/lib/debug/reflectionLifetimes.js +27 -0
- package/dist/lib/debug/rendererUrls.d.ts +6 -0
- package/dist/lib/debug/rendererUrls.js +68 -0
- package/dist/lib/internationalization/index.d.ts +7 -0
- package/dist/lib/internationalization/index.js +7 -0
- package/dist/lib/internationalization/internationalization.d.ts +65 -0
- package/dist/lib/internationalization/internationalization.js +64 -0
- package/dist/lib/internationalization/locale-utils.cjs +8 -0
- package/dist/lib/internationalization/locale-utils.d.cts +8 -0
- package/dist/lib/internationalization/locales/de.cjs +401 -0
- package/dist/lib/internationalization/locales/de.d.cts +368 -0
- package/dist/lib/internationalization/locales/en.cjs +411 -0
- package/dist/lib/internationalization/locales/en.d.cts +380 -0
- package/dist/lib/internationalization/locales/ja.cjs +320 -0
- package/dist/lib/internationalization/locales/ja.d.cts +307 -0
- package/dist/lib/internationalization/locales/ko.cjs +233 -0
- package/dist/lib/internationalization/locales/ko.d.cts +221 -0
- package/dist/lib/internationalization/locales/zh.cjs +488 -0
- package/dist/lib/internationalization/locales/zh.d.cts +452 -0
- package/dist/lib/internationalization/translatable.d.ts +21 -0
- package/dist/lib/internationalization/translatable.js +8 -0
- package/dist/lib/models/Comment.d.ts +241 -0
- package/dist/lib/models/Comment.js +534 -0
- package/dist/lib/models/ContainerReflection.d.ts +56 -0
- package/dist/lib/models/ContainerReflection.js +159 -0
- package/dist/lib/models/DeclarationReflection.d.ts +149 -0
- package/dist/lib/models/DeclarationReflection.js +287 -0
- package/dist/lib/models/DocumentReflection.d.ts +32 -0
- package/dist/lib/models/DocumentReflection.js +66 -0
- package/dist/lib/models/FileRegistry.d.ts +46 -0
- package/dist/lib/models/FileRegistry.js +133 -0
- package/dist/lib/models/ParameterReflection.d.ts +21 -0
- package/dist/lib/models/ParameterReflection.js +39 -0
- package/dist/lib/models/ProjectReflection.d.ts +112 -0
- package/dist/lib/models/ProjectReflection.js +417 -0
- package/dist/lib/models/ReferenceReflection.d.ts +49 -0
- package/dist/lib/models/ReferenceReflection.js +85 -0
- package/dist/lib/models/Reflection.d.ts +229 -0
- package/dist/lib/models/Reflection.js +495 -0
- package/dist/lib/models/ReflectionCategory.d.ts +31 -0
- package/dist/lib/models/ReflectionCategory.js +56 -0
- package/dist/lib/models/ReflectionGroup.d.ts +38 -0
- package/dist/lib/models/ReflectionGroup.js +72 -0
- package/dist/lib/models/ReflectionSymbolId.d.ts +63 -0
- package/dist/lib/models/ReflectionSymbolId.js +85 -0
- package/dist/lib/models/SignatureReflection.d.ts +50 -0
- package/dist/lib/models/SignatureReflection.js +96 -0
- package/dist/lib/models/SourceReference.d.ts +33 -0
- package/dist/lib/models/SourceReference.js +50 -0
- package/dist/lib/models/TypeParameterReflection.d.ts +30 -0
- package/dist/lib/models/TypeParameterReflection.js +45 -0
- package/dist/lib/models/index.d.ts +19 -0
- package/dist/lib/models/index.js +19 -0
- package/dist/lib/models/kind.d.ts +84 -0
- package/dist/lib/models/kind.js +231 -0
- package/dist/lib/models/types.d.ts +553 -0
- package/dist/lib/models/types.js +1296 -0
- package/dist/lib/models/utils.d.ts +1 -0
- package/dist/lib/models/utils.js +26 -0
- package/dist/lib/models/variant.d.ts +21 -0
- package/dist/lib/models/variant.js +1 -0
- package/dist/lib/output/components.d.ts +53 -0
- package/dist/lib/output/components.js +133 -0
- package/dist/lib/output/events.d.ts +175 -0
- package/dist/lib/output/events.js +195 -0
- package/dist/lib/output/formatter.d.ts +88 -0
- package/dist/lib/output/formatter.js +660 -0
- package/dist/lib/output/index.d.ts +9 -0
- package/dist/lib/output/index.js +7 -0
- package/dist/lib/output/output.d.ts +14 -0
- package/dist/lib/output/output.js +92 -0
- package/dist/lib/output/plugins/AssetsPlugin.d.ts +20 -0
- package/dist/lib/output/plugins/AssetsPlugin.js +160 -0
- package/dist/lib/output/plugins/HierarchyPlugin.d.ts +7 -0
- package/dist/lib/output/plugins/HierarchyPlugin.js +65 -0
- package/dist/lib/output/plugins/IconsPlugin.d.ts +12 -0
- package/dist/lib/output/plugins/IconsPlugin.js +54 -0
- package/dist/lib/output/plugins/JavascriptIndexPlugin.d.ts +22 -0
- package/dist/lib/output/plugins/JavascriptIndexPlugin.js +222 -0
- package/dist/lib/output/plugins/NavigationPlugin.d.ts +7 -0
- package/dist/lib/output/plugins/NavigationPlugin.js +23 -0
- package/dist/lib/output/plugins/SitemapPlugin.d.ts +8 -0
- package/dist/lib/output/plugins/SitemapPlugin.js +82 -0
- package/dist/lib/output/plugins/index.d.ts +7 -0
- package/dist/lib/output/plugins/index.js +7 -0
- package/dist/lib/output/renderer.d.ts +227 -0
- package/dist/lib/output/renderer.js +387 -0
- package/dist/lib/output/router.d.ts +187 -0
- package/dist/lib/output/router.js +520 -0
- package/dist/lib/output/theme.d.ts +22 -0
- package/dist/lib/output/theme.js +17 -0
- package/dist/lib/output/themes/MarkedPlugin.d.ts +62 -0
- package/dist/lib/output/themes/MarkedPlugin.js +461 -0
- package/dist/lib/output/themes/default/DefaultTheme.d.ts +72 -0
- package/dist/lib/output/themes/default/DefaultTheme.js +367 -0
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +105 -0
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +151 -0
- package/dist/lib/output/themes/default/Slugger.d.ts +13 -0
- package/dist/lib/output/themes/default/Slugger.js +60 -0
- package/dist/lib/output/themes/default/layouts/default.d.ts +6 -0
- package/dist/lib/output/themes/default/layouts/default.js +89 -0
- package/dist/lib/output/themes/default/partials/anchor-icon.d.ts +5 -0
- package/dist/lib/output/themes/default/partials/anchor-icon.js +9 -0
- package/dist/lib/output/themes/default/partials/breadcrumb.d.ts +4 -0
- package/dist/lib/output/themes/default/partials/breadcrumb.js +11 -0
- package/dist/lib/output/themes/default/partials/comment.d.ts +8 -0
- package/dist/lib/output/themes/default/partials/comment.js +80 -0
- package/dist/lib/output/themes/default/partials/footer.d.ts +3 -0
- package/dist/lib/output/themes/default/partials/footer.js +37 -0
- package/dist/lib/output/themes/default/partials/header.d.ts +5 -0
- package/dist/lib/output/themes/default/partials/header.js +39 -0
- package/dist/lib/output/themes/default/partials/hierarchy.d.ts +4 -0
- package/dist/lib/output/themes/default/partials/hierarchy.js +32 -0
- package/dist/lib/output/themes/default/partials/icon.d.ts +20 -0
- package/dist/lib/output/themes/default/partials/icon.js +101 -0
- package/dist/lib/output/themes/default/partials/index.d.ts +4 -0
- package/dist/lib/output/themes/default/partials/index.js +24 -0
- package/dist/lib/output/themes/default/partials/member.d.ts +4 -0
- package/dist/lib/output/themes/default/partials/member.declaration.d.ts +4 -0
- package/dist/lib/output/themes/default/partials/member.declaration.js +35 -0
- package/dist/lib/output/themes/default/partials/member.getterSetter.d.ts +4 -0
- package/dist/lib/output/themes/default/partials/member.getterSetter.js +12 -0
- package/dist/lib/output/themes/default/partials/member.js +36 -0
- package/dist/lib/output/themes/default/partials/member.signature.body.d.ts +6 -0
- package/dist/lib/output/themes/default/partials/member.signature.body.js +33 -0
- package/dist/lib/output/themes/default/partials/member.signature.title.d.ts +5 -0
- package/dist/lib/output/themes/default/partials/member.signature.title.js +9 -0
- package/dist/lib/output/themes/default/partials/member.signatures.d.ts +4 -0
- package/dist/lib/output/themes/default/partials/member.signatures.js +9 -0
- package/dist/lib/output/themes/default/partials/member.sources.d.ts +4 -0
- package/dist/lib/output/themes/default/partials/member.sources.js +55 -0
- package/dist/lib/output/themes/default/partials/members.d.ts +4 -0
- package/dist/lib/output/themes/default/partials/members.js +17 -0
- package/dist/lib/output/themes/default/partials/moduleReflection.d.ts +5 -0
- package/dist/lib/output/themes/default/partials/moduleReflection.js +68 -0
- package/dist/lib/output/themes/default/partials/navigation.d.ts +10 -0
- package/dist/lib/output/themes/default/partials/navigation.js +144 -0
- package/dist/lib/output/themes/default/partials/reflectionPreview.d.ts +4 -0
- package/dist/lib/output/themes/default/partials/reflectionPreview.js +26 -0
- package/dist/lib/output/themes/default/partials/toolbar.d.ts +5 -0
- package/dist/lib/output/themes/default/partials/toolbar.js +13 -0
- package/dist/lib/output/themes/default/partials/type.d.ts +5 -0
- package/dist/lib/output/themes/default/partials/type.js +9 -0
- package/dist/lib/output/themes/default/partials/typeAndParent.d.ts +4 -0
- package/dist/lib/output/themes/default/partials/typeAndParent.js +28 -0
- package/dist/lib/output/themes/default/partials/typeDetails.d.ts +8 -0
- package/dist/lib/output/themes/default/partials/typeDetails.js +284 -0
- package/dist/lib/output/themes/default/partials/typeParameters.d.ts +4 -0
- package/dist/lib/output/themes/default/partials/typeParameters.js +26 -0
- package/dist/lib/output/themes/default/templates/document.d.ts +5 -0
- package/dist/lib/output/themes/default/templates/document.js +3 -0
- package/dist/lib/output/themes/default/templates/hierarchy.d.ts +5 -0
- package/dist/lib/output/themes/default/templates/hierarchy.js +31 -0
- package/dist/lib/output/themes/default/templates/index.d.ts +5 -0
- package/dist/lib/output/themes/default/templates/index.js +3 -0
- package/dist/lib/output/themes/default/templates/reflection.d.ts +5 -0
- package/dist/lib/output/themes/default/templates/reflection.js +53 -0
- package/dist/lib/output/themes/lib.d.ts +44 -0
- package/dist/lib/output/themes/lib.js +218 -0
- package/dist/lib/serialization/components.d.ts +22 -0
- package/dist/lib/serialization/components.js +1 -0
- package/dist/lib/serialization/deserializer.d.ts +70 -0
- package/dist/lib/serialization/deserializer.js +235 -0
- package/dist/lib/serialization/events.d.ts +17 -0
- package/dist/lib/serialization/events.js +18 -0
- package/dist/lib/serialization/index.d.ts +5 -0
- package/dist/lib/serialization/index.js +4 -0
- package/dist/lib/serialization/schema.d.ts +283 -0
- package/dist/lib/serialization/schema.js +32 -0
- package/dist/lib/serialization/serializer.d.ts +52 -0
- package/dist/lib/serialization/serializer.js +65 -0
- package/dist/lib/utils/ValidatingFileRegistry.d.ts +12 -0
- package/dist/lib/utils/ValidatingFileRegistry.js +52 -0
- package/dist/lib/utils/component.d.ts +38 -0
- package/dist/lib/utils/component.js +41 -0
- package/dist/lib/utils/compress.d.ts +7 -0
- package/dist/lib/utils/compress.js +13 -0
- package/dist/lib/utils/declaration-maps.d.ts +3 -0
- package/dist/lib/utils/declaration-maps.js +51 -0
- package/dist/lib/utils/entry-point.d.ts +50 -0
- package/dist/lib/utils/entry-point.js +330 -0
- package/dist/lib/utils/fs.d.ts +65 -0
- package/dist/lib/utils/fs.js +372 -0
- package/dist/lib/utils/general.d.ts +4 -0
- package/dist/lib/utils/general.js +25 -0
- package/dist/lib/utils/highlighter.d.ts +9 -0
- package/dist/lib/utils/highlighter.js +150 -0
- 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 +67 -0
- package/dist/lib/utils/html.js +635 -0
- package/dist/lib/utils/index.d.ts +17 -0
- package/dist/lib/utils/index.js +15 -0
- package/dist/lib/utils/loggers.d.ts +10 -0
- package/dist/lib/utils/loggers.js +71 -0
- package/dist/lib/utils/options/declaration.d.ts +514 -0
- package/dist/lib/utils/options/declaration.js +443 -0
- package/dist/lib/utils/options/defaults.d.ts +20 -0
- package/dist/lib/utils/options/defaults.js +104 -0
- package/dist/lib/utils/options/help.d.ts +7 -0
- package/dist/lib/utils/options/help.js +63 -0
- package/dist/lib/utils/options/index.d.ts +6 -0
- package/dist/lib/utils/options/index.js +4 -0
- package/dist/lib/utils/options/options.d.ts +199 -0
- package/dist/lib/utils/options/options.js +273 -0
- package/dist/lib/utils/options/readers/arguments.d.ts +15 -0
- package/dist/lib/utils/options/readers/arguments.js +109 -0
- package/dist/lib/utils/options/readers/index.d.ts +4 -0
- package/dist/lib/utils/options/readers/index.js +4 -0
- package/dist/lib/utils/options/readers/package-json.d.ts +9 -0
- package/dist/lib/utils/options/readers/package-json.js +40 -0
- package/dist/lib/utils/options/readers/tsconfig.d.ts +14 -0
- package/dist/lib/utils/options/readers/tsconfig.js +172 -0
- package/dist/lib/utils/options/readers/typedoc.d.ts +33 -0
- package/dist/lib/utils/options/readers/typedoc.js +136 -0
- package/dist/lib/utils/options/sources/index.d.ts +1 -0
- package/dist/lib/utils/options/sources/index.js +1 -0
- package/dist/lib/utils/options/sources/typedoc.d.ts +2 -0
- package/dist/lib/utils/options/sources/typedoc.js +876 -0
- package/dist/lib/utils/options/tsdoc-defaults.d.ts +6 -0
- package/dist/lib/utils/options/tsdoc-defaults.js +94 -0
- package/dist/lib/utils/package-manifest.d.ts +11 -0
- package/dist/lib/utils/package-manifest.js +84 -0
- package/dist/lib/utils/paths.d.ts +27 -0
- package/dist/lib/utils/paths.js +127 -0
- package/dist/lib/utils/perf.d.ts +6 -0
- package/dist/lib/utils/perf.js +86 -0
- package/dist/lib/utils/plugins.d.ts +3 -0
- package/dist/lib/utils/plugins.js +61 -0
- package/dist/lib/utils/reflections.d.ts +5 -0
- package/dist/lib/utils/reflections.js +64 -0
- package/dist/lib/utils/sort.d.ts +11 -0
- package/dist/lib/utils/sort.js +153 -0
- package/dist/lib/utils/tsconfig.d.ts +5 -0
- package/dist/lib/utils/tsconfig.js +60 -0
- package/dist/lib/utils/tsutils.d.ts +3 -0
- package/dist/lib/utils/tsutils.js +23 -0
- package/dist/lib/utils-common/array.d.ts +57 -0
- package/dist/lib/utils-common/array.js +152 -0
- package/dist/lib/utils-common/declarationReference.d.ts +42 -0
- package/dist/lib/utils-common/declarationReference.js +341 -0
- package/dist/lib/utils-common/enum.d.ts +9 -0
- package/dist/lib/utils-common/enum.js +27 -0
- package/dist/lib/utils-common/events.d.ts +29 -0
- package/dist/lib/utils-common/events.js +49 -0
- package/dist/lib/utils-common/general.d.ts +40 -0
- package/dist/lib/utils-common/general.js +22 -0
- package/dist/lib/utils-common/hooks.d.ts +51 -0
- package/dist/lib/utils-common/hooks.js +90 -0
- package/dist/lib/utils-common/i18n.d.ts +18 -0
- package/dist/lib/utils-common/i18n.js +39 -0
- package/dist/lib/utils-common/index.d.ts +16 -0
- package/dist/lib/utils-common/index.js +17 -0
- package/dist/lib/utils-common/jsx.d.ts +53 -0
- package/dist/lib/utils-common/jsx.elements.d.ts +949 -0
- package/dist/lib/utils-common/jsx.elements.js +3 -0
- package/dist/lib/utils-common/jsx.js +187 -0
- package/dist/lib/utils-common/logger.d.ts +97 -0
- package/dist/lib/utils-common/logger.js +129 -0
- package/dist/lib/utils-common/map.d.ts +23 -0
- package/dist/lib/utils-common/map.js +63 -0
- package/dist/lib/utils-common/minimalSourceFile.d.ts +12 -0
- package/dist/lib/utils-common/minimalSourceFile.js +43 -0
- package/dist/lib/utils-common/path.d.ts +42 -0
- package/dist/lib/utils-common/path.js +130 -0
- package/dist/lib/utils-common/set.d.ts +3 -0
- package/dist/lib/utils-common/set.js +23 -0
- package/dist/lib/utils-common/string.d.ts +11 -0
- package/dist/lib/utils-common/string.js +84 -0
- package/dist/lib/utils-common/validation.d.ts +33 -0
- package/dist/lib/utils-common/validation.js +50 -0
- package/dist/lib/validation/documentation.d.ts +3 -0
- package/dist/lib/validation/documentation.js +91 -0
- package/dist/lib/validation/exports.d.ts +3 -0
- package/dist/lib/validation/exports.js +65 -0
- package/dist/lib/validation/links.d.ts +3 -0
- package/dist/lib/validation/links.js +78 -0
- package/dist/lib/validation/unusedMergeModuleWith.d.ts +3 -0
- package/dist/lib/validation/unusedMergeModuleWith.js +12 -0
- package/package.json +161 -0
- package/static/main.js +58 -0
- package/static/style.css +1633 -0
- package/tsdoc.json +247 -0
- package/typedoc-config.schema.json +941 -0
|
@@ -0,0 +1,705 @@
|
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
34
|
+
};
|
|
35
|
+
import ts from "typescript";
|
|
36
|
+
import { ok } from "assert";
|
|
37
|
+
import { Comment, DocumentReflection, ProjectReflection, Reflection, ReflectionKind, } from "../models/index.js";
|
|
38
|
+
import { Context } from "./context.js";
|
|
39
|
+
import { AbstractComponent } from "../utils/component.js";
|
|
40
|
+
import { getDocumentEntryPoints, Option, readFile } from "../utils/index.js";
|
|
41
|
+
import { convertType } from "./types.js";
|
|
42
|
+
import { ConverterEvents } from "./converter-events.js";
|
|
43
|
+
import { convertSymbol } from "./symbols.js";
|
|
44
|
+
import { MinimatchSet, nicePath, normalizePath } from "../utils/paths.js";
|
|
45
|
+
import { hasAllFlags, hasAnyFlag, i18n, MinimalSourceFile, NormalizedPathUtils, partition, unique, } from "#utils";
|
|
46
|
+
import { clearCommentCache } from "./comments/index.js";
|
|
47
|
+
import { parseCommentString } from "./comments/parser.js";
|
|
48
|
+
import { lexCommentString } from "./comments/rawLexer.js";
|
|
49
|
+
import { resolveLinks, resolvePartLinks, } from "./comments/linkResolver.js";
|
|
50
|
+
import { meaningToString } from "#utils";
|
|
51
|
+
import { basename, dirname, resolve } from "path";
|
|
52
|
+
import { GroupPlugin } from "./plugins/GroupPlugin.js";
|
|
53
|
+
import { CategoryPlugin } from "./plugins/CategoryPlugin.js";
|
|
54
|
+
import { CommentPlugin } from "./plugins/CommentPlugin.js";
|
|
55
|
+
import { ImplementsPlugin } from "./plugins/ImplementsPlugin.js";
|
|
56
|
+
import { InheritDocPlugin } from "./plugins/InheritDocPlugin.js";
|
|
57
|
+
import { LinkResolverPlugin } from "./plugins/LinkResolverPlugin.js";
|
|
58
|
+
import { PackagePlugin } from "./plugins/PackagePlugin.js";
|
|
59
|
+
import { SourcePlugin } from "./plugins/SourcePlugin.js";
|
|
60
|
+
import { TypePlugin } from "./plugins/TypePlugin.js";
|
|
61
|
+
import { IncludePlugin } from "./plugins/IncludePlugin.js";
|
|
62
|
+
import { MergeModuleWithPlugin } from "./plugins/MergeModuleWithPlugin.js";
|
|
63
|
+
import { resolveAliasedSymbol } from "./utils/symbols.js";
|
|
64
|
+
/**
|
|
65
|
+
* Compiles source files using TypeScript and converts compiler symbols to reflections.
|
|
66
|
+
*
|
|
67
|
+
* @group None
|
|
68
|
+
* @summary Responsible for converting TypeScript symbols into {@link Reflection}s and {@link Type}s.
|
|
69
|
+
*/
|
|
70
|
+
let Converter = (() => {
|
|
71
|
+
let _classSuper = AbstractComponent;
|
|
72
|
+
let _externalPattern_decorators;
|
|
73
|
+
let _externalPattern_initializers = [];
|
|
74
|
+
let _externalPattern_extraInitializers = [];
|
|
75
|
+
let _excludeExternals_decorators;
|
|
76
|
+
let _excludeExternals_initializers = [];
|
|
77
|
+
let _excludeExternals_extraInitializers = [];
|
|
78
|
+
let _excludePrivate_decorators;
|
|
79
|
+
let _excludePrivate_initializers = [];
|
|
80
|
+
let _excludePrivate_extraInitializers = [];
|
|
81
|
+
let _excludeProtected_decorators;
|
|
82
|
+
let _excludeProtected_initializers = [];
|
|
83
|
+
let _excludeProtected_extraInitializers = [];
|
|
84
|
+
let _excludeReferences_decorators;
|
|
85
|
+
let _excludeReferences_initializers = [];
|
|
86
|
+
let _excludeReferences_extraInitializers = [];
|
|
87
|
+
let _commentStyle_decorators;
|
|
88
|
+
let _commentStyle_initializers = [];
|
|
89
|
+
let _commentStyle_extraInitializers = [];
|
|
90
|
+
let _validation_decorators;
|
|
91
|
+
let _validation_initializers = [];
|
|
92
|
+
let _validation_extraInitializers = [];
|
|
93
|
+
let _externalSymbolLinkMappings_decorators;
|
|
94
|
+
let _externalSymbolLinkMappings_initializers = [];
|
|
95
|
+
let _externalSymbolLinkMappings_extraInitializers = [];
|
|
96
|
+
let _preserveLinkText_decorators;
|
|
97
|
+
let _preserveLinkText_initializers = [];
|
|
98
|
+
let _preserveLinkText_extraInitializers = [];
|
|
99
|
+
let _maxTypeConversionDepth_decorators;
|
|
100
|
+
let _maxTypeConversionDepth_initializers = [];
|
|
101
|
+
let _maxTypeConversionDepth_extraInitializers = [];
|
|
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
|
+
_excludePrivate_decorators = [Option("excludePrivate")];
|
|
108
|
+
_excludeProtected_decorators = [Option("excludeProtected")];
|
|
109
|
+
_excludeReferences_decorators = [Option("excludeReferences")];
|
|
110
|
+
_commentStyle_decorators = [Option("commentStyle")];
|
|
111
|
+
_validation_decorators = [Option("validation")];
|
|
112
|
+
_externalSymbolLinkMappings_decorators = [Option("externalSymbolLinkMappings")];
|
|
113
|
+
_preserveLinkText_decorators = [Option("preserveLinkText")];
|
|
114
|
+
_maxTypeConversionDepth_decorators = [Option("maxTypeConversionDepth")];
|
|
115
|
+
__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);
|
|
116
|
+
__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);
|
|
117
|
+
__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);
|
|
118
|
+
__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);
|
|
119
|
+
__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);
|
|
120
|
+
__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);
|
|
121
|
+
__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);
|
|
122
|
+
__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);
|
|
123
|
+
__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);
|
|
124
|
+
__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);
|
|
125
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
126
|
+
}
|
|
127
|
+
#externalPattern_accessor_storage = __runInitializers(this, _externalPattern_initializers, void 0);
|
|
128
|
+
/** @internal */
|
|
129
|
+
get externalPattern() { return this.#externalPattern_accessor_storage; }
|
|
130
|
+
set externalPattern(value) { this.#externalPattern_accessor_storage = value; }
|
|
131
|
+
externalPatternCache = __runInitializers(this, _externalPattern_extraInitializers);
|
|
132
|
+
excludeCache;
|
|
133
|
+
#excludeExternals_accessor_storage = __runInitializers(this, _excludeExternals_initializers, void 0);
|
|
134
|
+
/** @internal */
|
|
135
|
+
get excludeExternals() { return this.#excludeExternals_accessor_storage; }
|
|
136
|
+
set excludeExternals(value) { this.#excludeExternals_accessor_storage = value; }
|
|
137
|
+
#excludePrivate_accessor_storage = (__runInitializers(this, _excludeExternals_extraInitializers), __runInitializers(this, _excludePrivate_initializers, void 0));
|
|
138
|
+
/** @internal */
|
|
139
|
+
get excludePrivate() { return this.#excludePrivate_accessor_storage; }
|
|
140
|
+
set excludePrivate(value) { this.#excludePrivate_accessor_storage = value; }
|
|
141
|
+
#excludeProtected_accessor_storage = (__runInitializers(this, _excludePrivate_extraInitializers), __runInitializers(this, _excludeProtected_initializers, void 0));
|
|
142
|
+
/** @internal */
|
|
143
|
+
get excludeProtected() { return this.#excludeProtected_accessor_storage; }
|
|
144
|
+
set excludeProtected(value) { this.#excludeProtected_accessor_storage = value; }
|
|
145
|
+
#excludeReferences_accessor_storage = (__runInitializers(this, _excludeProtected_extraInitializers), __runInitializers(this, _excludeReferences_initializers, void 0));
|
|
146
|
+
/** @internal */
|
|
147
|
+
get excludeReferences() { return this.#excludeReferences_accessor_storage; }
|
|
148
|
+
set excludeReferences(value) { this.#excludeReferences_accessor_storage = value; }
|
|
149
|
+
#commentStyle_accessor_storage = (__runInitializers(this, _excludeReferences_extraInitializers), __runInitializers(this, _commentStyle_initializers, void 0));
|
|
150
|
+
/** @internal */
|
|
151
|
+
get commentStyle() { return this.#commentStyle_accessor_storage; }
|
|
152
|
+
set commentStyle(value) { this.#commentStyle_accessor_storage = value; }
|
|
153
|
+
#validation_accessor_storage = (__runInitializers(this, _commentStyle_extraInitializers), __runInitializers(this, _validation_initializers, void 0));
|
|
154
|
+
/** @internal */
|
|
155
|
+
get validation() { return this.#validation_accessor_storage; }
|
|
156
|
+
set validation(value) { this.#validation_accessor_storage = value; }
|
|
157
|
+
#externalSymbolLinkMappings_accessor_storage = (__runInitializers(this, _validation_extraInitializers), __runInitializers(this, _externalSymbolLinkMappings_initializers, void 0));
|
|
158
|
+
/** @internal */
|
|
159
|
+
get externalSymbolLinkMappings() { return this.#externalSymbolLinkMappings_accessor_storage; }
|
|
160
|
+
set externalSymbolLinkMappings(value) { this.#externalSymbolLinkMappings_accessor_storage = value; }
|
|
161
|
+
#preserveLinkText_accessor_storage = (__runInitializers(this, _externalSymbolLinkMappings_extraInitializers), __runInitializers(this, _preserveLinkText_initializers, void 0));
|
|
162
|
+
/** @internal */
|
|
163
|
+
get preserveLinkText() { return this.#preserveLinkText_accessor_storage; }
|
|
164
|
+
set preserveLinkText(value) { this.#preserveLinkText_accessor_storage = value; }
|
|
165
|
+
#maxTypeConversionDepth_accessor_storage = (__runInitializers(this, _preserveLinkText_extraInitializers), __runInitializers(this, _maxTypeConversionDepth_initializers, void 0));
|
|
166
|
+
/** @internal */
|
|
167
|
+
get maxTypeConversionDepth() { return this.#maxTypeConversionDepth_accessor_storage; }
|
|
168
|
+
set maxTypeConversionDepth(value) { this.#maxTypeConversionDepth_accessor_storage = value; }
|
|
169
|
+
_config = __runInitializers(this, _maxTypeConversionDepth_extraInitializers);
|
|
170
|
+
_externalSymbolResolvers = [];
|
|
171
|
+
// We try to document symbols which are exported from multiple locations
|
|
172
|
+
// in modules/namespaces which declare them, rather than those which re-export them.
|
|
173
|
+
// To do this, when converting a symbol, that might be re-exported, we first defer it
|
|
174
|
+
// to the second conversion pass.
|
|
175
|
+
_deferPermitted = false;
|
|
176
|
+
_defer = [];
|
|
177
|
+
get config() {
|
|
178
|
+
return this._config || this._buildCommentParserConfig();
|
|
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 project reflection.
|
|
200
|
+
* The listener will be given {@link Context} and a {@link Models.ProjectReflection}.
|
|
201
|
+
* @event
|
|
202
|
+
*/
|
|
203
|
+
static EVENT_CREATE_PROJECT = ConverterEvents.CREATE_PROJECT;
|
|
204
|
+
/**
|
|
205
|
+
* Triggered when the converter has created a declaration reflection.
|
|
206
|
+
* The listener will be given {@link Context} and a {@link Models.DeclarationReflection}.
|
|
207
|
+
* @event
|
|
208
|
+
*/
|
|
209
|
+
static EVENT_CREATE_DECLARATION = ConverterEvents.CREATE_DECLARATION;
|
|
210
|
+
/**
|
|
211
|
+
* Triggered when the converter has created a document reflection.
|
|
212
|
+
* The listener will be given `undefined` (for consistency with the
|
|
213
|
+
* other create events) and a {@link Models.DocumentReflection}.
|
|
214
|
+
* @event
|
|
215
|
+
*/
|
|
216
|
+
static EVENT_CREATE_DOCUMENT = ConverterEvents.CREATE_DOCUMENT;
|
|
217
|
+
/**
|
|
218
|
+
* Triggered when the converter has created a signature reflection.
|
|
219
|
+
* The listener will be given {@link Context}, {@link Models.SignatureReflection} | {@link Models.ProjectReflection} the declaration,
|
|
220
|
+
* `ts.SignatureDeclaration | ts.IndexSignatureDeclaration | ts.JSDocSignature | undefined`,
|
|
221
|
+
* and `ts.Signature | undefined`. The signature will be undefined if the created signature is an index signature.
|
|
222
|
+
* @event
|
|
223
|
+
*/
|
|
224
|
+
static EVENT_CREATE_SIGNATURE = ConverterEvents.CREATE_SIGNATURE;
|
|
225
|
+
/**
|
|
226
|
+
* Triggered when the converter has created a parameter reflection.
|
|
227
|
+
* The listener will be given {@link Context}, {@link Models.ParameterReflection} and a `ts.Node?`
|
|
228
|
+
* @event
|
|
229
|
+
*/
|
|
230
|
+
static EVENT_CREATE_PARAMETER = ConverterEvents.CREATE_PARAMETER;
|
|
231
|
+
/**
|
|
232
|
+
* Triggered when the converter has created a type parameter reflection.
|
|
233
|
+
* The listener will be given {@link Context} and a {@link Models.TypeParameterReflection}
|
|
234
|
+
* @event
|
|
235
|
+
*/
|
|
236
|
+
static EVENT_CREATE_TYPE_PARAMETER = ConverterEvents.CREATE_TYPE_PARAMETER;
|
|
237
|
+
/**
|
|
238
|
+
* Resolve events
|
|
239
|
+
*/
|
|
240
|
+
/**
|
|
241
|
+
* Triggered when the converter begins resolving a project.
|
|
242
|
+
* The listener will be given {@link Context}.
|
|
243
|
+
* @event
|
|
244
|
+
*/
|
|
245
|
+
static EVENT_RESOLVE_BEGIN = ConverterEvents.RESOLVE_BEGIN;
|
|
246
|
+
/**
|
|
247
|
+
* Triggered when the converter resolves a reflection.
|
|
248
|
+
* The listener will be given {@link Context} and a {@link Reflection}.
|
|
249
|
+
* @event
|
|
250
|
+
*/
|
|
251
|
+
static EVENT_RESOLVE = ConverterEvents.RESOLVE;
|
|
252
|
+
/**
|
|
253
|
+
* Triggered when the converter has finished resolving a project.
|
|
254
|
+
* The listener will be given {@link Context}.
|
|
255
|
+
* @event
|
|
256
|
+
*/
|
|
257
|
+
static EVENT_RESOLVE_END = ConverterEvents.RESOLVE_END;
|
|
258
|
+
/** @internal @hidden */
|
|
259
|
+
includePlugin;
|
|
260
|
+
constructor(owner) {
|
|
261
|
+
super(owner);
|
|
262
|
+
const userConfiguredSymbolResolver = (ref, refl, _part, symbolId) => {
|
|
263
|
+
if (symbolId) {
|
|
264
|
+
return userConfiguredSymbolResolver(symbolId.toDeclarationReference(), refl, undefined, undefined);
|
|
265
|
+
}
|
|
266
|
+
// Require global links, matching local ones will likely hide mistakes where the
|
|
267
|
+
// user meant to link to a local type.
|
|
268
|
+
if (ref.resolutionStart !== "global" || !ref.symbolReference) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
const modLinks = this.externalSymbolLinkMappings[ref.moduleSource ?? "global"];
|
|
272
|
+
if (typeof modLinks !== "object") {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
let name = "";
|
|
276
|
+
if (ref.symbolReference.path) {
|
|
277
|
+
name += ref.symbolReference.path.map((p) => p.path).join(".");
|
|
278
|
+
}
|
|
279
|
+
if (ref.symbolReference.meaning) {
|
|
280
|
+
name += meaningToString(ref.symbolReference.meaning);
|
|
281
|
+
}
|
|
282
|
+
if (typeof modLinks[name] === "string") {
|
|
283
|
+
return modLinks[name];
|
|
284
|
+
}
|
|
285
|
+
if (typeof modLinks["*"] === "string") {
|
|
286
|
+
return modLinks["*"];
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
this.addUnknownSymbolResolver(userConfiguredSymbolResolver);
|
|
290
|
+
new CategoryPlugin(this);
|
|
291
|
+
new CommentPlugin(this);
|
|
292
|
+
new GroupPlugin(this);
|
|
293
|
+
new ImplementsPlugin(this);
|
|
294
|
+
new InheritDocPlugin(this);
|
|
295
|
+
new LinkResolverPlugin(this);
|
|
296
|
+
new PackagePlugin(this);
|
|
297
|
+
new SourcePlugin(this);
|
|
298
|
+
new TypePlugin(this);
|
|
299
|
+
this.includePlugin = new IncludePlugin(this);
|
|
300
|
+
new MergeModuleWithPlugin(this);
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Compile the given source files and create a project reflection for them.
|
|
304
|
+
*/
|
|
305
|
+
convert(entryPoints) {
|
|
306
|
+
const programs = unique(entryPoints.map((e) => e.program));
|
|
307
|
+
this.externalPatternCache = void 0;
|
|
308
|
+
const project = new ProjectReflection(this.application.options.getValue("name"), this.application.files);
|
|
309
|
+
if (this.owner.options.packageDir) {
|
|
310
|
+
project.files.registerReflectionPath(normalizePath(this.owner.options.packageDir), project);
|
|
311
|
+
}
|
|
312
|
+
const context = new Context(this, programs, project);
|
|
313
|
+
this.trigger(Converter.EVENT_BEGIN, context);
|
|
314
|
+
this.addProjectDocuments(project);
|
|
315
|
+
this.compile(entryPoints, context);
|
|
316
|
+
this.resolve(context);
|
|
317
|
+
this.trigger(Converter.EVENT_END, context);
|
|
318
|
+
// Delete caches of options so that test usage which changes options
|
|
319
|
+
// doesn't have confusing behavior where tests run in isolation work
|
|
320
|
+
// but break when run as a batch.
|
|
321
|
+
delete this._config;
|
|
322
|
+
delete this.excludeCache;
|
|
323
|
+
delete this.externalPatternCache;
|
|
324
|
+
// Also clear the comment cache so if we convert this ts.Program again
|
|
325
|
+
// later we will re-parse comments.
|
|
326
|
+
clearCommentCache();
|
|
327
|
+
return project;
|
|
328
|
+
}
|
|
329
|
+
/** @internal */
|
|
330
|
+
addProjectDocuments(project) {
|
|
331
|
+
const projectDocuments = getDocumentEntryPoints(this.application.logger, this.application.options);
|
|
332
|
+
for (const { displayName, path } of projectDocuments) {
|
|
333
|
+
let file;
|
|
334
|
+
try {
|
|
335
|
+
file = new MinimalSourceFile(readFile(path), path);
|
|
336
|
+
}
|
|
337
|
+
catch (error) {
|
|
338
|
+
this.application.logger.error(i18n.failed_to_read_0_when_processing_project_document(path));
|
|
339
|
+
continue;
|
|
340
|
+
}
|
|
341
|
+
this.addDocument(project, file, displayName);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
/** @internal */
|
|
345
|
+
convertSymbol(context, symbol, exportSymbol) {
|
|
346
|
+
convertSymbol(context, symbol, exportSymbol);
|
|
347
|
+
}
|
|
348
|
+
convertType(context, typeOrNode, maybeNode) {
|
|
349
|
+
return convertType(context, typeOrNode, maybeNode);
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Parse the given file into a comment. Intended to be used with markdown files.
|
|
353
|
+
*/
|
|
354
|
+
parseRawComment(file, files) {
|
|
355
|
+
return parseCommentString(lexCommentString(file.text), this.config, file, this.application.logger, files);
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Adds a new resolver that the theme can use to try to figure out how to link to a symbol declared
|
|
359
|
+
* by a third-party library which is not included in the documentation.
|
|
360
|
+
*
|
|
361
|
+
* The resolver function will be passed a declaration reference which it can attempt to resolve. If
|
|
362
|
+
* resolution fails, the function should return undefined.
|
|
363
|
+
*
|
|
364
|
+
* Note: This will be used for both references to types declared in node_modules (in which case the
|
|
365
|
+
* reference passed will have the `moduleSource` set and the `symbolReference` will navigate via `.`)
|
|
366
|
+
* and user defined \{\@link\} tags which cannot be resolved. If the link being resolved is inferred
|
|
367
|
+
* from a type, then no `part` will be passed to the resolver function.
|
|
368
|
+
*/
|
|
369
|
+
addUnknownSymbolResolver(resolver) {
|
|
370
|
+
this._externalSymbolResolvers.push(resolver);
|
|
371
|
+
}
|
|
372
|
+
/** @internal */
|
|
373
|
+
resolveExternalLink(ref, refl, part, symbolId) {
|
|
374
|
+
for (const resolver of this._externalSymbolResolvers) {
|
|
375
|
+
const resolved = resolver(ref, refl, part, symbolId);
|
|
376
|
+
if (resolved)
|
|
377
|
+
return resolved;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
resolveLinks(comment, owner) {
|
|
381
|
+
if (comment instanceof Reflection) {
|
|
382
|
+
resolveLinks(comment, (ref, part, refl, id) => this.resolveExternalLink(ref, part, refl, id), { preserveLinkText: this.preserveLinkText });
|
|
383
|
+
}
|
|
384
|
+
else if (comment instanceof Comment) {
|
|
385
|
+
resolveLinks(owner, (ref, part, refl, id) => this.resolveExternalLink(ref, part, refl, id), { preserveLinkText: this.preserveLinkText });
|
|
386
|
+
}
|
|
387
|
+
else {
|
|
388
|
+
return resolvePartLinks(owner, comment, (ref, part, refl, id) => this.resolveExternalLink(ref, part, refl, id), { preserveLinkText: this.preserveLinkText });
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Permit deferred conversion steps to take place. Until this is called, {@link deferConversion}
|
|
393
|
+
* will throw if used.
|
|
394
|
+
* @since 0.28.1
|
|
395
|
+
*/
|
|
396
|
+
permitDeferredConversion() {
|
|
397
|
+
ok(!this._deferPermitted, "Attempted to allow deferred conversion when already permitted");
|
|
398
|
+
this._deferPermitted = true;
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Finalize deferred conversion, must be called by the caller of {@link permitDeferredConversion}
|
|
402
|
+
* @since 0.28.1
|
|
403
|
+
*/
|
|
404
|
+
finalizeDeferredConversion() {
|
|
405
|
+
this.application.logger.verbose(`Have ${this._defer.length} initial deferred tasks`);
|
|
406
|
+
let count = 0;
|
|
407
|
+
while (this._defer.length) {
|
|
408
|
+
++count;
|
|
409
|
+
const first = this._defer.shift();
|
|
410
|
+
first();
|
|
411
|
+
}
|
|
412
|
+
this.application.logger.verbose(`Ran ${count} total deferred tasks`);
|
|
413
|
+
this._deferPermitted = false;
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Defer a conversion step until later. This may only be called during conversion.
|
|
417
|
+
* @since 0.28.0
|
|
418
|
+
*/
|
|
419
|
+
deferConversion(cb) {
|
|
420
|
+
ok(this._deferPermitted, "Attempted to defer conversion when not permitted");
|
|
421
|
+
this._defer.push(cb);
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Compile the files within the given context and convert the compiler symbols to reflections.
|
|
425
|
+
*
|
|
426
|
+
* @param context The context object describing the current state the converter is in.
|
|
427
|
+
* @returns An array containing all errors generated by the TypeScript compiler.
|
|
428
|
+
*/
|
|
429
|
+
compile(entryPoints, context) {
|
|
430
|
+
this.permitDeferredConversion();
|
|
431
|
+
let createModuleReflections = entryPoints.length > 1;
|
|
432
|
+
if (!createModuleReflections) {
|
|
433
|
+
const opts = this.application.options;
|
|
434
|
+
createModuleReflections = opts.isSet("alwaysCreateEntryPointModule")
|
|
435
|
+
? opts.getValue("alwaysCreateEntryPointModule")
|
|
436
|
+
: !!context.scope.documents;
|
|
437
|
+
}
|
|
438
|
+
if (createModuleReflections) {
|
|
439
|
+
this.trigger(ConverterEvents.CREATE_PROJECT, context, context.project);
|
|
440
|
+
}
|
|
441
|
+
for (const entry of entryPoints) {
|
|
442
|
+
// Clone context in case deferred conversion uses different programs
|
|
443
|
+
const entryContext = context.withScope(context.scope);
|
|
444
|
+
entryContext.setActiveProgram(entry.program);
|
|
445
|
+
this.convertExports(entryContext, entry, createModuleReflections);
|
|
446
|
+
}
|
|
447
|
+
this.finalizeDeferredConversion();
|
|
448
|
+
}
|
|
449
|
+
convertExports(context, entryPoint, createModuleReflections) {
|
|
450
|
+
const node = entryPoint.sourceFile;
|
|
451
|
+
const entryName = entryPoint.displayName;
|
|
452
|
+
const symbol = getSymbolForModuleLike(context, node);
|
|
453
|
+
let moduleContext;
|
|
454
|
+
if (createModuleReflections === false) {
|
|
455
|
+
// Special case for when we're giving a single entry point, we don't need to
|
|
456
|
+
// create modules for each entry. Register the project as this module.
|
|
457
|
+
context.registerReflection(context.project, symbol, normalizePath(entryPoint.sourceFile.fileName));
|
|
458
|
+
context.project.comment = symbol
|
|
459
|
+
? context.getComment(symbol, context.project.kind)
|
|
460
|
+
: context.getFileComment(node);
|
|
461
|
+
this.processDocumentTags(context.project, context.project);
|
|
462
|
+
this.trigger(ConverterEvents.CREATE_PROJECT, context, context.project);
|
|
463
|
+
moduleContext = context;
|
|
464
|
+
}
|
|
465
|
+
else {
|
|
466
|
+
const reflection = context.createDeclarationReflection(ReflectionKind.Module, symbol, void 0, entryName);
|
|
467
|
+
if (!reflection.comment && !symbol) {
|
|
468
|
+
reflection.comment = context.getFileComment(node);
|
|
469
|
+
}
|
|
470
|
+
context.finalizeDeclarationReflection(reflection);
|
|
471
|
+
moduleContext = context.withScope(reflection);
|
|
472
|
+
}
|
|
473
|
+
const allExports = getExports(context, node, symbol);
|
|
474
|
+
const [directExport, indirectExports] = partition(allExports, exp => isDirectExport(context.resolveAliasedSymbol(exp), node));
|
|
475
|
+
for (const exp of directExport) {
|
|
476
|
+
this.convertSymbol(moduleContext, exp);
|
|
477
|
+
}
|
|
478
|
+
if (indirectExports.length) {
|
|
479
|
+
this.deferConversion(() => {
|
|
480
|
+
for (const exp of indirectExports) {
|
|
481
|
+
this.convertSymbol(moduleContext, exp);
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Resolve the project within the given context.
|
|
488
|
+
*
|
|
489
|
+
* @param context The context object describing the current state the converter is in.
|
|
490
|
+
* @returns The final project reflection.
|
|
491
|
+
*/
|
|
492
|
+
resolve(context) {
|
|
493
|
+
this.trigger(Converter.EVENT_RESOLVE_BEGIN, context);
|
|
494
|
+
const project = context.project;
|
|
495
|
+
for (const id in project.reflections) {
|
|
496
|
+
this.trigger(Converter.EVENT_RESOLVE, context, project.reflections[id]);
|
|
497
|
+
}
|
|
498
|
+
this.trigger(Converter.EVENT_RESOLVE_END, context);
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Used to determine if we should immediately bail when creating a reflection.
|
|
502
|
+
* Note: This should not be used for excludeNotDocumented because we don't have enough
|
|
503
|
+
* information at this point since comment discovery hasn't happened.
|
|
504
|
+
* @internal
|
|
505
|
+
*/
|
|
506
|
+
shouldIgnore(symbol, checker) {
|
|
507
|
+
symbol = resolveAliasedSymbol(symbol, checker);
|
|
508
|
+
if (this.isExcluded(symbol)) {
|
|
509
|
+
return true;
|
|
510
|
+
}
|
|
511
|
+
return this.excludeExternals && this.isExternal(symbol, checker);
|
|
512
|
+
}
|
|
513
|
+
isExcluded(symbol) {
|
|
514
|
+
this.excludeCache ??= new MinimatchSet(this.application.options.getValue("exclude"));
|
|
515
|
+
const cache = this.excludeCache;
|
|
516
|
+
return (symbol.getDeclarations() ?? []).some((node) => cache.matchesAny(node.getSourceFile().fileName));
|
|
517
|
+
}
|
|
518
|
+
/** @internal */
|
|
519
|
+
isExternal(symbol, checker) {
|
|
520
|
+
this.externalPatternCache ??= new MinimatchSet(this.externalPattern);
|
|
521
|
+
const cache = this.externalPatternCache;
|
|
522
|
+
const declarations = resolveAliasedSymbol(symbol, checker).getDeclarations();
|
|
523
|
+
// `undefined` has no declarations, if someone does `export default undefined`
|
|
524
|
+
// the symbol ends up as having no declarations (the export symbol does, but
|
|
525
|
+
// not the source symbol)
|
|
526
|
+
if (!declarations?.length) {
|
|
527
|
+
return false;
|
|
528
|
+
}
|
|
529
|
+
// If there are any non-external declarations, treat it as non-external
|
|
530
|
+
// This is possible with declaration merging against external namespaces
|
|
531
|
+
// (e.g. merging with HTMLElementTagNameMap)
|
|
532
|
+
return declarations.every((node) => cache.matchesAny(node.getSourceFile().fileName));
|
|
533
|
+
}
|
|
534
|
+
processDocumentTags(reflection, parent) {
|
|
535
|
+
let relativeTo = reflection.comment?.sourcePath;
|
|
536
|
+
if (relativeTo) {
|
|
537
|
+
relativeTo = NormalizedPathUtils.dirname(relativeTo);
|
|
538
|
+
const tags = reflection.comment?.getTags("@document") || [];
|
|
539
|
+
reflection.comment?.removeTags("@document");
|
|
540
|
+
for (const tag of tags) {
|
|
541
|
+
const path = Comment.combineDisplayParts(tag.content);
|
|
542
|
+
let file;
|
|
543
|
+
try {
|
|
544
|
+
const resolved = normalizePath(resolve(relativeTo, path));
|
|
545
|
+
file = new MinimalSourceFile(readFile(resolved), resolved);
|
|
546
|
+
}
|
|
547
|
+
catch {
|
|
548
|
+
this.application.logger.warn(i18n.failed_to_read_0_when_processing_document_tag_in_1(nicePath(path), nicePath(reflection.comment.sourcePath)));
|
|
549
|
+
continue;
|
|
550
|
+
}
|
|
551
|
+
this.addDocument(parent, file, basename(file.fileName).replace(/\.[^.]+$/, ""));
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
addDocument(parent, file, displayName) {
|
|
556
|
+
const { content, frontmatter } = this.parseRawComment(file, parent.project.files);
|
|
557
|
+
const children = frontmatter["children"];
|
|
558
|
+
delete frontmatter["children"];
|
|
559
|
+
const docRefl = new DocumentReflection(displayName, parent, content, frontmatter);
|
|
560
|
+
this.application.watchFile(file.fileName);
|
|
561
|
+
parent.addChild(docRefl);
|
|
562
|
+
parent.project.registerReflection(docRefl, undefined, file.fileName);
|
|
563
|
+
this.trigger(ConverterEvents.CREATE_DOCUMENT, undefined, docRefl);
|
|
564
|
+
const childrenToAdd = [];
|
|
565
|
+
if (children && typeof children === "object") {
|
|
566
|
+
if (Array.isArray(children)) {
|
|
567
|
+
for (const child of children) {
|
|
568
|
+
if (typeof child === "string") {
|
|
569
|
+
childrenToAdd.push([
|
|
570
|
+
basename(child).replace(/\.[^.]+$/, ""),
|
|
571
|
+
child,
|
|
572
|
+
]);
|
|
573
|
+
}
|
|
574
|
+
else {
|
|
575
|
+
this.application.logger.error(i18n
|
|
576
|
+
.frontmatter_children_0_should_be_an_array_of_strings_or_object_with_string_values(nicePath(file.fileName)));
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
else {
|
|
582
|
+
for (const [name, path] of Object.entries(children)) {
|
|
583
|
+
if (typeof path === "string") {
|
|
584
|
+
childrenToAdd.push([name, path]);
|
|
585
|
+
}
|
|
586
|
+
else {
|
|
587
|
+
this.application.logger.error(i18n
|
|
588
|
+
.frontmatter_children_0_should_be_an_array_of_strings_or_object_with_string_values(nicePath(file.fileName)));
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
for (const [displayName, path] of childrenToAdd) {
|
|
595
|
+
const absPath = normalizePath(resolve(dirname(file.fileName), path));
|
|
596
|
+
let childFile;
|
|
597
|
+
try {
|
|
598
|
+
childFile = new MinimalSourceFile(readFile(absPath), absPath);
|
|
599
|
+
}
|
|
600
|
+
catch (error) {
|
|
601
|
+
this.application.logger.error(i18n.failed_to_read_0_when_processing_document_child_in_1(path, nicePath(file.fileName)));
|
|
602
|
+
continue;
|
|
603
|
+
}
|
|
604
|
+
this.addDocument(docRefl, childFile, displayName);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
_buildCommentParserConfig() {
|
|
608
|
+
this._config = {
|
|
609
|
+
blockTags: new Set(this.application.options.getValue("blockTags")),
|
|
610
|
+
inlineTags: new Set(this.application.options.getValue("inlineTags")),
|
|
611
|
+
modifierTags: new Set(this.application.options.getValue("modifierTags")),
|
|
612
|
+
preservedTypeAnnotationTags: new Set(this.application.options.getValue("preservedTypeAnnotationTags")),
|
|
613
|
+
jsDocCompatibility: this.application.options.getValue("jsDocCompatibility"),
|
|
614
|
+
suppressCommentWarningsInDeclarationFiles: this.application.options.getValue("suppressCommentWarningsInDeclarationFiles"),
|
|
615
|
+
useTsLinkResolution: this.application.options.getValue("useTsLinkResolution"),
|
|
616
|
+
commentStyle: this.application.options.getValue("commentStyle"),
|
|
617
|
+
validationOptions: this.application.options.getValue("validation"),
|
|
618
|
+
};
|
|
619
|
+
// Can't be included in options because the TSDoc parser blows up if we do.
|
|
620
|
+
// TypeDoc supports it as one, so it should always be included here.
|
|
621
|
+
this._config.blockTags.add("@inheritDoc");
|
|
622
|
+
return this._config;
|
|
623
|
+
}
|
|
624
|
+
};
|
|
625
|
+
})();
|
|
626
|
+
export { Converter };
|
|
627
|
+
function getSymbolForModuleLike(context, node) {
|
|
628
|
+
const symbol = context.checker.getSymbolAtLocation(node) ?? node.symbol;
|
|
629
|
+
if (symbol) {
|
|
630
|
+
return symbol;
|
|
631
|
+
}
|
|
632
|
+
// This is a global file, get all symbols declared in this file...
|
|
633
|
+
// this isn't the best solution, it would be nice to have all globals given to a special
|
|
634
|
+
// "globals" file, but this is uncommon enough that I'm skipping it for now.
|
|
635
|
+
const sourceFile = node.getSourceFile();
|
|
636
|
+
const globalSymbols = context.checker
|
|
637
|
+
.getSymbolsInScope(node, ts.SymbolFlags.ModuleMember)
|
|
638
|
+
.filter((s) => s.getDeclarations()?.some((d) => d.getSourceFile() === sourceFile));
|
|
639
|
+
// Detect declaration files with declare module "foo" as their only export
|
|
640
|
+
// and lift that up one level as the source file symbol
|
|
641
|
+
if (globalSymbols.length === 1 &&
|
|
642
|
+
globalSymbols[0]
|
|
643
|
+
.getDeclarations()
|
|
644
|
+
?.every((declaration) => ts.isModuleDeclaration(declaration) &&
|
|
645
|
+
ts.isStringLiteral(declaration.name))) {
|
|
646
|
+
return globalSymbols[0];
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
function getExports(context, node, symbol) {
|
|
650
|
+
let result;
|
|
651
|
+
// The generated docs aren't great, but you really ought not be using
|
|
652
|
+
// this in the first place... so it's better than nothing.
|
|
653
|
+
const exportEq = symbol?.exports?.get("export=");
|
|
654
|
+
if (exportEq) {
|
|
655
|
+
// JS users might also have exported types here.
|
|
656
|
+
// We need to filter for types because otherwise static methods can show up as both
|
|
657
|
+
// members of the export= class and as functions if a class is directly exported.
|
|
658
|
+
result = [exportEq].concat(context.checker
|
|
659
|
+
.getExportsOfModule(symbol)
|
|
660
|
+
.filter((s) => !hasAnyFlag(s.flags, ts.SymbolFlags.Prototype | ts.SymbolFlags.Value)));
|
|
661
|
+
}
|
|
662
|
+
else if (symbol) {
|
|
663
|
+
result = context.checker
|
|
664
|
+
.getExportsOfModule(symbol)
|
|
665
|
+
.filter((s) => !hasAllFlags(s.flags, ts.SymbolFlags.Prototype));
|
|
666
|
+
if (result.length === 0) {
|
|
667
|
+
const globalDecl = node.statements.find((s) => ts.isModuleDeclaration(s) &&
|
|
668
|
+
s.flags & ts.NodeFlags.GlobalAugmentation);
|
|
669
|
+
if (globalDecl) {
|
|
670
|
+
const globalSymbol = context.getSymbolAtLocation(globalDecl);
|
|
671
|
+
if (globalSymbol) {
|
|
672
|
+
result = context.checker
|
|
673
|
+
.getExportsOfModule(globalSymbol)
|
|
674
|
+
.filter((exp) => exp.declarations?.some((d) => d.getSourceFile() === node))
|
|
675
|
+
.map((s) => context.checker.getMergedSymbol(s));
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
else {
|
|
681
|
+
// Global file with no inferred top level symbol, get all symbols declared in this file.
|
|
682
|
+
const sourceFile = node.getSourceFile();
|
|
683
|
+
result = context.checker
|
|
684
|
+
.getSymbolsInScope(node, ts.SymbolFlags.ModuleMember)
|
|
685
|
+
.filter((s) => s
|
|
686
|
+
.getDeclarations()
|
|
687
|
+
?.some((d) => d.getSourceFile() === sourceFile));
|
|
688
|
+
}
|
|
689
|
+
// Put symbols named "default" last, #1795
|
|
690
|
+
result.sort((a, b) => {
|
|
691
|
+
if (a.name === "default") {
|
|
692
|
+
return 1;
|
|
693
|
+
}
|
|
694
|
+
else if (b.name === "default") {
|
|
695
|
+
return -1;
|
|
696
|
+
}
|
|
697
|
+
return 0;
|
|
698
|
+
});
|
|
699
|
+
return result;
|
|
700
|
+
}
|
|
701
|
+
function isDirectExport(symbol, file) {
|
|
702
|
+
return (symbol
|
|
703
|
+
.getDeclarations()
|
|
704
|
+
?.every((decl) => decl.getSourceFile() === file) ?? false);
|
|
705
|
+
}
|