@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,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Module which handles sorting reflections according to a user specified strategy.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
import { ReflectionKind } from "../models/kind.js";
|
|
6
|
+
import * as OptionDefaults from "./options/defaults.js";
|
|
7
|
+
export const SORT_STRATEGIES = [
|
|
8
|
+
"source-order",
|
|
9
|
+
"alphabetical",
|
|
10
|
+
"alphabetical-ignoring-documents",
|
|
11
|
+
"enum-value-ascending",
|
|
12
|
+
"enum-value-descending",
|
|
13
|
+
"enum-member-source-order",
|
|
14
|
+
"static-first",
|
|
15
|
+
"instance-first",
|
|
16
|
+
"visibility",
|
|
17
|
+
"required-first",
|
|
18
|
+
"kind",
|
|
19
|
+
"external-last",
|
|
20
|
+
"documents-first",
|
|
21
|
+
"documents-last",
|
|
22
|
+
];
|
|
23
|
+
// Return true if a < b
|
|
24
|
+
const sorts = {
|
|
25
|
+
"source-order"(a, b) {
|
|
26
|
+
// This is going to be somewhat ambiguous. No way around that. Treat the first
|
|
27
|
+
// declaration of a symbol as its ordering declaration.
|
|
28
|
+
const aSymbol = a.project.getSymbolIdFromReflection(a);
|
|
29
|
+
const bSymbol = b.project.getSymbolIdFromReflection(b);
|
|
30
|
+
if (aSymbol && bSymbol) {
|
|
31
|
+
if (aSymbol.packageName < bSymbol.packageName) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
if (aSymbol.packageName === bSymbol.packageName &&
|
|
35
|
+
aSymbol.packagePath < bSymbol.packagePath) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
if (aSymbol.packageName === bSymbol.packageName &&
|
|
39
|
+
aSymbol.packagePath === bSymbol.packagePath &&
|
|
40
|
+
aSymbol.pos < bSymbol.pos) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
// Someone is doing something weird. Fail to re-order. This could happen if someone
|
|
46
|
+
// tries to sort with a reflection that has been removed from the project.
|
|
47
|
+
return false;
|
|
48
|
+
},
|
|
49
|
+
alphabetical(a, b) {
|
|
50
|
+
return a.name.localeCompare(b.name) < 0;
|
|
51
|
+
},
|
|
52
|
+
"alphabetical-ignoring-documents"(a, b) {
|
|
53
|
+
if (a.kindOf(ReflectionKind.Document) ||
|
|
54
|
+
b.kindOf(ReflectionKind.Document)) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
return a.name.localeCompare(b.name) < 0;
|
|
58
|
+
},
|
|
59
|
+
"enum-value-ascending"(a, b) {
|
|
60
|
+
if (a.kind == ReflectionKind.EnumMember &&
|
|
61
|
+
b.kind == ReflectionKind.EnumMember) {
|
|
62
|
+
const aRefl = a;
|
|
63
|
+
const bRefl = b;
|
|
64
|
+
const aValue = aRefl.type?.type === "literal" ? aRefl.type.value : -Infinity;
|
|
65
|
+
const bValue = bRefl.type?.type === "literal" ? bRefl.type.value : -Infinity;
|
|
66
|
+
return aValue < bValue;
|
|
67
|
+
}
|
|
68
|
+
return false;
|
|
69
|
+
},
|
|
70
|
+
"enum-value-descending"(a, b) {
|
|
71
|
+
if (a.kind == ReflectionKind.EnumMember &&
|
|
72
|
+
b.kind == ReflectionKind.EnumMember) {
|
|
73
|
+
const aRefl = a;
|
|
74
|
+
const bRefl = b;
|
|
75
|
+
const aValue = aRefl.type?.type === "literal" ? aRefl.type.value : -Infinity;
|
|
76
|
+
const bValue = bRefl.type?.type === "literal" ? bRefl.type.value : -Infinity;
|
|
77
|
+
return bValue < aValue;
|
|
78
|
+
}
|
|
79
|
+
return false;
|
|
80
|
+
},
|
|
81
|
+
"enum-member-source-order"(a, b, data) {
|
|
82
|
+
if (a.kind === ReflectionKind.EnumMember &&
|
|
83
|
+
b.kind === ReflectionKind.EnumMember) {
|
|
84
|
+
return sorts["source-order"](a, b, data);
|
|
85
|
+
}
|
|
86
|
+
return false;
|
|
87
|
+
},
|
|
88
|
+
"static-first"(a, b) {
|
|
89
|
+
return a.flags.isStatic && !b.flags.isStatic;
|
|
90
|
+
},
|
|
91
|
+
"instance-first"(a, b) {
|
|
92
|
+
return !a.flags.isStatic && b.flags.isStatic;
|
|
93
|
+
},
|
|
94
|
+
visibility(a, b) {
|
|
95
|
+
// Note: flags.isPublic may not be set on public members. It will only be set
|
|
96
|
+
// if the user explicitly marks members as public. Therefore, we can't use it
|
|
97
|
+
// here to get a reliable sort order.
|
|
98
|
+
if (a.flags.isPrivate) {
|
|
99
|
+
return false; // Not sorted before anything
|
|
100
|
+
}
|
|
101
|
+
if (a.flags.isProtected) {
|
|
102
|
+
return b.flags.isPrivate; // Sorted before privates
|
|
103
|
+
}
|
|
104
|
+
if (b.flags.isPrivate || b.flags.isProtected) {
|
|
105
|
+
return true; // We are public, sort before b if b is less visible
|
|
106
|
+
}
|
|
107
|
+
return false;
|
|
108
|
+
},
|
|
109
|
+
"required-first"(a, b) {
|
|
110
|
+
return !a.flags.isOptional && b.flags.isOptional;
|
|
111
|
+
},
|
|
112
|
+
kind(a, b, { kindSortOrder }) {
|
|
113
|
+
return kindSortOrder.indexOf(a.kind) < kindSortOrder.indexOf(b.kind);
|
|
114
|
+
},
|
|
115
|
+
"external-last"(a, b) {
|
|
116
|
+
return !a.flags.isExternal && b.flags.isExternal;
|
|
117
|
+
},
|
|
118
|
+
"documents-first"(a, b) {
|
|
119
|
+
return (a.kindOf(ReflectionKind.Document) &&
|
|
120
|
+
!b.kindOf(ReflectionKind.Document));
|
|
121
|
+
},
|
|
122
|
+
"documents-last"(a, b) {
|
|
123
|
+
return (!a.kindOf(ReflectionKind.Document) &&
|
|
124
|
+
b.kindOf(ReflectionKind.Document));
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
export function isValidSortStrategy(strategy) {
|
|
128
|
+
return SORT_STRATEGIES.includes(strategy);
|
|
129
|
+
}
|
|
130
|
+
export function getSortFunction(opts, strategies = opts.getValue("sort")) {
|
|
131
|
+
const kindSortOrder = opts
|
|
132
|
+
.getValue("kindSortOrder")
|
|
133
|
+
.map((k) => ReflectionKind[k]);
|
|
134
|
+
for (const kind of OptionDefaults.kindSortOrder) {
|
|
135
|
+
if (!kindSortOrder.includes(ReflectionKind[kind])) {
|
|
136
|
+
kindSortOrder.push(ReflectionKind[kind]);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const data = { kindSortOrder };
|
|
140
|
+
return function sortReflections(reflections) {
|
|
141
|
+
reflections.sort((a, b) => {
|
|
142
|
+
for (const s of strategies) {
|
|
143
|
+
if (sorts[s](a, b, data)) {
|
|
144
|
+
return -1;
|
|
145
|
+
}
|
|
146
|
+
if (sorts[s](b, a, data)) {
|
|
147
|
+
return 1;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return 0;
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import type { Logger } from "#utils";
|
|
3
|
+
export declare function findTsConfigFile(path: string, usedFile?: (path: string) => void): string | undefined;
|
|
4
|
+
export declare function getTypeDocOptionsFromTsConfig(file: string): any;
|
|
5
|
+
export declare function readTsConfig(path: string, logger: Logger): ts.ParsedCommandLine | undefined;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { isDir, isFile, readFile } from "./fs.js";
|
|
3
|
+
import { createRequire } from "module";
|
|
4
|
+
import { diagnostic, diagnostics } from "./loggers.js";
|
|
5
|
+
export function findTsConfigFile(path, usedFile) {
|
|
6
|
+
let fileToRead = path;
|
|
7
|
+
if (isDir(fileToRead)) {
|
|
8
|
+
fileToRead = ts.findConfigFile(path, (file) => (usedFile?.(file), isFile(file)));
|
|
9
|
+
}
|
|
10
|
+
if (!fileToRead || !isFile(fileToRead)) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
return fileToRead;
|
|
14
|
+
}
|
|
15
|
+
// We don't need recursive read checks because that would cause a diagnostic
|
|
16
|
+
// when reading the tsconfig for compiler options, which happens first, and we bail before
|
|
17
|
+
// doing this in that case.
|
|
18
|
+
export function getTypeDocOptionsFromTsConfig(file) {
|
|
19
|
+
const readResult = ts.readConfigFile(file, readFile);
|
|
20
|
+
const result = {};
|
|
21
|
+
if (readResult.error) {
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
if ("extends" in readResult.config) {
|
|
25
|
+
const resolver = createRequire(file);
|
|
26
|
+
const extended = Array.isArray(readResult.config.extends)
|
|
27
|
+
? readResult.config.extends.map(String)
|
|
28
|
+
: [String(readResult.config.extends)];
|
|
29
|
+
for (const extendedFile of extended) {
|
|
30
|
+
let resolvedParent;
|
|
31
|
+
try {
|
|
32
|
+
resolvedParent = resolver.resolve(extendedFile);
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
Object.assign(result, getTypeDocOptionsFromTsConfig(resolvedParent));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if ("typedocOptions" in readResult.config) {
|
|
41
|
+
Object.assign(result, readResult.config.typedocOptions);
|
|
42
|
+
}
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
const tsConfigCache = {};
|
|
46
|
+
export function readTsConfig(path, logger) {
|
|
47
|
+
if (tsConfigCache[path]) {
|
|
48
|
+
return tsConfigCache[path];
|
|
49
|
+
}
|
|
50
|
+
const parsed = ts.getParsedCommandLineOfConfigFile(path, {}, {
|
|
51
|
+
...ts.sys,
|
|
52
|
+
onUnRecoverableConfigFileDiagnostic: diagnostic.bind(null, logger),
|
|
53
|
+
});
|
|
54
|
+
if (!parsed) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
diagnostics(logger, parsed.errors);
|
|
58
|
+
tsConfigCache[path] = parsed;
|
|
59
|
+
return parsed;
|
|
60
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
export function getQualifiedName(symbol, defaultName) {
|
|
3
|
+
// Two implementation options for this one:
|
|
4
|
+
// 1. Use the internal symbol.parent, to walk up until we hit a source file symbol (if in a module)
|
|
5
|
+
// or undefined (if in a global file)
|
|
6
|
+
// 2. Use checker.getFullyQualifiedName and parse out the name from the returned string.
|
|
7
|
+
// The symbol.parent method is easier to check for now.
|
|
8
|
+
let sym = symbol;
|
|
9
|
+
const parts = [];
|
|
10
|
+
while (sym && !sym.declarations?.some(ts.isSourceFile)) {
|
|
11
|
+
parts.unshift(getHumanName(sym.name));
|
|
12
|
+
sym = sym.parent;
|
|
13
|
+
}
|
|
14
|
+
return parts.join(".") || defaultName;
|
|
15
|
+
}
|
|
16
|
+
export function getHumanName(name) {
|
|
17
|
+
// Unique symbols get a name that will change between runs of the compiler.
|
|
18
|
+
const match = /^__@(.*)@\d+$/.exec(name);
|
|
19
|
+
if (match) {
|
|
20
|
+
return `[${match[1]}]`;
|
|
21
|
+
}
|
|
22
|
+
return name;
|
|
23
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare const emptyArray: readonly [];
|
|
2
|
+
/**
|
|
3
|
+
* Inserts an item into an array sorted by priority. If two items have the same priority,
|
|
4
|
+
* the item will be inserted later will be placed later in the array.
|
|
5
|
+
* Higher priority is placed earlier in the array.
|
|
6
|
+
* @param arr modified by inserting item.
|
|
7
|
+
* @param item
|
|
8
|
+
*/
|
|
9
|
+
export declare function insertPrioritySorted<T extends {
|
|
10
|
+
priority: number;
|
|
11
|
+
}>(arr: T[], item: T): T[];
|
|
12
|
+
/**
|
|
13
|
+
* Inserts an item into an array sorted by order. If two items have the same order,
|
|
14
|
+
* the item inserted later will be placed later in the array.
|
|
15
|
+
* The array will be sorted with lower order being placed sooner.
|
|
16
|
+
* @param arr modified by inserting item.
|
|
17
|
+
* @param item
|
|
18
|
+
*/
|
|
19
|
+
export declare function insertOrderSorted<T extends {
|
|
20
|
+
order: number;
|
|
21
|
+
}>(arr: T[], item: T): T[];
|
|
22
|
+
/**
|
|
23
|
+
* Performs a binary search of a given array, returning the index of the first item
|
|
24
|
+
* for which `partition` returns true. Returns the -1 if there are no items in `arr`
|
|
25
|
+
* such that `partition(item)` is true.
|
|
26
|
+
* @param arr
|
|
27
|
+
* @param partition should return true while less than the partition point.
|
|
28
|
+
*/
|
|
29
|
+
export declare function binaryFindPartition<T>(arr: readonly T[], partition: (item: T) => boolean): number;
|
|
30
|
+
/**
|
|
31
|
+
* Removes an item from the array if the array exists and the item is included
|
|
32
|
+
* within it.
|
|
33
|
+
* @param arr
|
|
34
|
+
* @param item
|
|
35
|
+
*/
|
|
36
|
+
export declare function removeIfPresent<T>(arr: T[] | undefined, item: T): void;
|
|
37
|
+
/**
|
|
38
|
+
* Remove items in an array which match a predicate.
|
|
39
|
+
* @param arr
|
|
40
|
+
* @param predicate
|
|
41
|
+
*/
|
|
42
|
+
export declare function removeIf<T>(arr: T[], predicate: (item: T) => boolean): void;
|
|
43
|
+
/**
|
|
44
|
+
* Filters out duplicate values from the given iterable.
|
|
45
|
+
* @param arr
|
|
46
|
+
*/
|
|
47
|
+
export declare function unique<T>(arr: Iterable<T> | undefined): T[];
|
|
48
|
+
export declare function partition<T>(iter: Iterable<T>, predicate: (item: T) => boolean): [T[], T[]];
|
|
49
|
+
export declare function zip<T extends Iterable<any>[]>(...args: T): Iterable<{
|
|
50
|
+
[K in keyof T]: T[K] extends Iterable<infer U> ? U : T[K];
|
|
51
|
+
}>;
|
|
52
|
+
export declare function filterMap<T, U>(iter: Iterable<T> | undefined, fn: (item: T) => U | undefined): U[];
|
|
53
|
+
export declare function firstDefined<T, U>(array: readonly T[], callback: (element: T, index: number) => U | undefined): U | undefined;
|
|
54
|
+
export declare function filter<T>(array: readonly T[] | undefined, predicate: (value: T, index: number, array: readonly T[]) => boolean): readonly T[];
|
|
55
|
+
export declare function aggregate<T>(arr: T[], fn: (item: T) => number): number;
|
|
56
|
+
export declare function joinArray<T>(arr: readonly T[] | undefined, joiner: string, mapper: (item: T) => string): string;
|
|
57
|
+
export declare function maxElementByScore<T>(arr: readonly T[], score: (a: T) => number): T | undefined;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
export const emptyArray = [];
|
|
2
|
+
/**
|
|
3
|
+
* Inserts an item into an array sorted by priority. If two items have the same priority,
|
|
4
|
+
* the item will be inserted later will be placed later in the array.
|
|
5
|
+
* Higher priority is placed earlier in the array.
|
|
6
|
+
* @param arr modified by inserting item.
|
|
7
|
+
* @param item
|
|
8
|
+
*/
|
|
9
|
+
export function insertPrioritySorted(arr, item) {
|
|
10
|
+
const index = binaryFindPartition(arr, (v) => v.priority < item.priority);
|
|
11
|
+
arr.splice(index === -1 ? arr.length : index, 0, item);
|
|
12
|
+
return arr;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Inserts an item into an array sorted by order. If two items have the same order,
|
|
16
|
+
* the item inserted later will be placed later in the array.
|
|
17
|
+
* The array will be sorted with lower order being placed sooner.
|
|
18
|
+
* @param arr modified by inserting item.
|
|
19
|
+
* @param item
|
|
20
|
+
*/
|
|
21
|
+
export function insertOrderSorted(arr, item) {
|
|
22
|
+
const index = binaryFindPartition(arr, (v) => v.order > item.order);
|
|
23
|
+
arr.splice(index === -1 ? arr.length : index, 0, item);
|
|
24
|
+
return arr;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Performs a binary search of a given array, returning the index of the first item
|
|
28
|
+
* for which `partition` returns true. Returns the -1 if there are no items in `arr`
|
|
29
|
+
* such that `partition(item)` is true.
|
|
30
|
+
* @param arr
|
|
31
|
+
* @param partition should return true while less than the partition point.
|
|
32
|
+
*/
|
|
33
|
+
export function binaryFindPartition(arr, partition) {
|
|
34
|
+
if (arr.length === 0) {
|
|
35
|
+
return -1;
|
|
36
|
+
}
|
|
37
|
+
let low = 0, high = arr.length - 1;
|
|
38
|
+
while (high > low) {
|
|
39
|
+
const mid = low + Math.floor((high - low) / 2);
|
|
40
|
+
if (partition(arr[mid])) {
|
|
41
|
+
high = mid;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
low = mid + 1;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return partition(arr[low]) ? low : -1;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Removes an item from the array if the array exists and the item is included
|
|
51
|
+
* within it.
|
|
52
|
+
* @param arr
|
|
53
|
+
* @param item
|
|
54
|
+
*/
|
|
55
|
+
export function removeIfPresent(arr, item) {
|
|
56
|
+
if (!arr) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const index = arr.indexOf(item);
|
|
60
|
+
if (index !== -1) {
|
|
61
|
+
arr.splice(index, 1);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Remove items in an array which match a predicate.
|
|
66
|
+
* @param arr
|
|
67
|
+
* @param predicate
|
|
68
|
+
*/
|
|
69
|
+
export function removeIf(arr, predicate) {
|
|
70
|
+
for (let i = 0; i < arr.length; i++) {
|
|
71
|
+
if (predicate(arr[i])) {
|
|
72
|
+
arr.splice(i, 1);
|
|
73
|
+
i--;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Filters out duplicate values from the given iterable.
|
|
79
|
+
* @param arr
|
|
80
|
+
*/
|
|
81
|
+
export function unique(arr) {
|
|
82
|
+
return Array.from(new Set(arr));
|
|
83
|
+
}
|
|
84
|
+
export function partition(iter, predicate) {
|
|
85
|
+
const left = [];
|
|
86
|
+
const right = [];
|
|
87
|
+
for (const item of iter) {
|
|
88
|
+
if (predicate(item)) {
|
|
89
|
+
left.push(item);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
right.push(item);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return [left, right];
|
|
96
|
+
}
|
|
97
|
+
export function* zip(...args) {
|
|
98
|
+
const iterators = args.map((x) => x[Symbol.iterator]());
|
|
99
|
+
for (;;) {
|
|
100
|
+
const next = iterators.map((i) => i.next());
|
|
101
|
+
if (next.some((v) => v.done)) {
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
yield next.map((v) => v.value);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
export function filterMap(iter, fn) {
|
|
108
|
+
const result = [];
|
|
109
|
+
for (const item of iter || []) {
|
|
110
|
+
const newItem = fn(item);
|
|
111
|
+
if (newItem !== void 0) {
|
|
112
|
+
result.push(newItem);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return result;
|
|
116
|
+
}
|
|
117
|
+
export function firstDefined(array, callback) {
|
|
118
|
+
for (let i = 0; i < array.length; i++) {
|
|
119
|
+
const result = callback(array[i], i);
|
|
120
|
+
if (result !== undefined) {
|
|
121
|
+
return result;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return undefined;
|
|
125
|
+
}
|
|
126
|
+
export function filter(array, predicate) {
|
|
127
|
+
return array ? array.filter(predicate) : emptyArray;
|
|
128
|
+
}
|
|
129
|
+
export function aggregate(arr, fn) {
|
|
130
|
+
return arr.reduce((sum, it) => sum + fn(it), 0);
|
|
131
|
+
}
|
|
132
|
+
export function joinArray(arr, joiner, mapper) {
|
|
133
|
+
if (arr?.length) {
|
|
134
|
+
return arr.map(mapper).join(joiner);
|
|
135
|
+
}
|
|
136
|
+
return "";
|
|
137
|
+
}
|
|
138
|
+
export function maxElementByScore(arr, score) {
|
|
139
|
+
if (arr.length === 0) {
|
|
140
|
+
return undefined;
|
|
141
|
+
}
|
|
142
|
+
let largest = arr[0];
|
|
143
|
+
let largestScore = score(arr[0]);
|
|
144
|
+
for (let i = 1; i < arr.length; ++i) {
|
|
145
|
+
const itemScore = score(arr[i]);
|
|
146
|
+
if (itemScore > largestScore) {
|
|
147
|
+
largest = arr[i];
|
|
148
|
+
largestScore = itemScore;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return largest;
|
|
152
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parser for declaration references, see the [TSDoc grammar](https://github.com/microsoft/tsdoc/blob/main/tsdoc/src/beta/DeclarationReference.grammarkdown)
|
|
3
|
+
* for reference. TypeDoc **does not** support the full grammar today. This is intentional, since the TSDoc
|
|
4
|
+
* specified grammar allows the user to construct nonsensical declaration references such as `abc![def!ghi]`
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
export declare const MeaningKeywords: readonly ["class", "interface", "type", "enum", "namespace", "function", "var", "constructor", "member", "event", "call", "new", "index", "complex", "getter", "setter"];
|
|
9
|
+
export type MeaningKeyword = (typeof MeaningKeywords)[number];
|
|
10
|
+
export interface DeclarationReference {
|
|
11
|
+
resolutionStart: "global" | "local";
|
|
12
|
+
moduleSource?: string;
|
|
13
|
+
symbolReference?: SymbolReference;
|
|
14
|
+
}
|
|
15
|
+
export interface Meaning {
|
|
16
|
+
keyword?: MeaningKeyword;
|
|
17
|
+
label?: string;
|
|
18
|
+
index?: number;
|
|
19
|
+
}
|
|
20
|
+
export declare function meaningToString(meaning: Meaning): string;
|
|
21
|
+
export interface SymbolReference {
|
|
22
|
+
path?: ComponentPath[];
|
|
23
|
+
meaning?: Meaning;
|
|
24
|
+
}
|
|
25
|
+
export interface ComponentPath {
|
|
26
|
+
/**
|
|
27
|
+
* How to resolve the `path`
|
|
28
|
+
* - `.` - Navigate via `exports` of symbol
|
|
29
|
+
* - `#` - Navigate via `members` of symbol
|
|
30
|
+
* - `~` - Navigate via `locals` of symbol (note: TypeDoc does not support
|
|
31
|
+
* locals, see the declaration reference docs)
|
|
32
|
+
*/
|
|
33
|
+
navigation: "." | "#" | "~";
|
|
34
|
+
path: string;
|
|
35
|
+
}
|
|
36
|
+
export declare function parseString(source: string, pos: number, end: number): [string, number] | undefined;
|
|
37
|
+
export declare function parseModuleSource(source: string, pos: number, end: number): [string, number] | undefined;
|
|
38
|
+
export declare function parseSymbolReference(source: string, pos: number, end: number): [SymbolReference, number] | undefined;
|
|
39
|
+
export declare function parseComponent(source: string, pos: number, end: number): [string, number] | undefined;
|
|
40
|
+
export declare function parseComponentPath(source: string, pos: number, end: number): readonly [ComponentPath[], number] | undefined;
|
|
41
|
+
export declare function parseMeaning(source: string, pos: number, end: number): [Meaning, number] | undefined;
|
|
42
|
+
export declare function parseDeclarationReference(source: string, pos: number, end: number): [DeclarationReference, number] | undefined;
|