@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,199 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import type { Application } from "../../../index.js";
|
|
3
|
+
import { type DeclarationOption, type KeyToDeclaration, type TypeDocOptionMap, type TypeDocOptions, type TypeDocOptionValues } from "./declaration.js";
|
|
4
|
+
import { type Logger, type NeverIfInternal } from "#utils";
|
|
5
|
+
/**
|
|
6
|
+
* Describes an option reader that discovers user configuration and converts it to the
|
|
7
|
+
* TypeDoc format.
|
|
8
|
+
*/
|
|
9
|
+
export interface OptionsReader {
|
|
10
|
+
/**
|
|
11
|
+
* Readers will be processed according to their orders.
|
|
12
|
+
* A higher order indicates that the reader should be called *later*.
|
|
13
|
+
*
|
|
14
|
+
* Note that to preserve expected behavior, the argv reader must have both the lowest
|
|
15
|
+
* order so that it may set the location of config files used by other readers and
|
|
16
|
+
* the highest order so that it can override settings from lower order readers.
|
|
17
|
+
*/
|
|
18
|
+
readonly order: number;
|
|
19
|
+
/**
|
|
20
|
+
* The name of this reader so that it may be removed by plugins without the plugin
|
|
21
|
+
* accessing the instance performing the read. Multiple readers may have the same
|
|
22
|
+
* name.
|
|
23
|
+
*/
|
|
24
|
+
readonly name: string;
|
|
25
|
+
/**
|
|
26
|
+
* Flag to indicate that this reader should be included in sub-options objects created
|
|
27
|
+
* to read options for packages mode.
|
|
28
|
+
*/
|
|
29
|
+
readonly supportsPackages: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Read options from the reader's source and place them in the options parameter.
|
|
32
|
+
* Options without a declared name may be treated as if they were declared with type
|
|
33
|
+
* {@link ParameterType.Mixed}. Options which have been declared must be converted to the
|
|
34
|
+
* correct type. As an alternative to doing this conversion in the reader,
|
|
35
|
+
* the reader may use {@link Options.setValue}, which will correctly convert values.
|
|
36
|
+
* @param container the options container that provides declarations
|
|
37
|
+
* @param logger logger to be used to report errors
|
|
38
|
+
* @param cwd the directory which should be treated as the current working directory for option file discovery
|
|
39
|
+
* @param usedFile a callback to track files that were read or whose existence was checked, for purposes of restarting a build when watching files
|
|
40
|
+
*/
|
|
41
|
+
read(container: Options, logger: Logger, cwd: string, usedFile: (file: string) => void): void | Promise<void>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Maintains a collection of option declarations split into TypeDoc options
|
|
45
|
+
* and TypeScript options. Ensures options are of the correct type for calling
|
|
46
|
+
* code.
|
|
47
|
+
*
|
|
48
|
+
* ### Option Discovery
|
|
49
|
+
*
|
|
50
|
+
* Since plugins commonly add custom options, and TypeDoc does not permit options which have
|
|
51
|
+
* not been declared to be set, options must be read twice. The first time options are read,
|
|
52
|
+
* a noop logger is passed so that any errors are ignored. Then, after loading plugins, options
|
|
53
|
+
* are read again, this time with the logger specified by the application.
|
|
54
|
+
*
|
|
55
|
+
* Options are read in a specific order.
|
|
56
|
+
* 1. argv (0) - Must be read first since it should change the files read when
|
|
57
|
+
* passing --options or --tsconfig.
|
|
58
|
+
* 2. typedoc-json (100) - Read next so that it can specify the tsconfig.json file to read.
|
|
59
|
+
* 3. tsconfig-json (200) - Last config file reader, cannot specify the typedoc.json file to read.
|
|
60
|
+
* 4. argv (300) - Read argv again since any options set there should override those set in config
|
|
61
|
+
* files.
|
|
62
|
+
*
|
|
63
|
+
* @group None
|
|
64
|
+
* @summary Contains all of TypeDoc's option declarations & values
|
|
65
|
+
*/
|
|
66
|
+
export declare class Options {
|
|
67
|
+
private _readers;
|
|
68
|
+
private _declarations;
|
|
69
|
+
private _values;
|
|
70
|
+
private _setOptions;
|
|
71
|
+
private _compilerOptions;
|
|
72
|
+
private _fileNames;
|
|
73
|
+
private _projectReferences;
|
|
74
|
+
/**
|
|
75
|
+
* In packages mode, the directory of the package being converted.
|
|
76
|
+
*/
|
|
77
|
+
packageDir?: string;
|
|
78
|
+
constructor();
|
|
79
|
+
/**
|
|
80
|
+
* Clones the options, intended for use in packages mode.
|
|
81
|
+
*/
|
|
82
|
+
copyForPackage(packageDir: string): Options;
|
|
83
|
+
/**
|
|
84
|
+
* Take a snapshot of option values now, used in tests only.
|
|
85
|
+
* @internal
|
|
86
|
+
*/
|
|
87
|
+
snapshot(): {
|
|
88
|
+
__optionSnapshot: never;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Take a snapshot of option values now, used in tests only.
|
|
92
|
+
* @internal
|
|
93
|
+
*/
|
|
94
|
+
restore(snapshot: {
|
|
95
|
+
__optionSnapshot: never;
|
|
96
|
+
}): void;
|
|
97
|
+
/**
|
|
98
|
+
* Resets the option bag to all default values.
|
|
99
|
+
* If a name is provided, will only reset that name.
|
|
100
|
+
*/
|
|
101
|
+
reset(name?: keyof TypeDocOptions): void;
|
|
102
|
+
reset(name?: NeverIfInternal<string>): void;
|
|
103
|
+
/**
|
|
104
|
+
* Adds an option reader that will be used to read configuration values
|
|
105
|
+
* from the command line, configuration files, or other locations.
|
|
106
|
+
* @param reader
|
|
107
|
+
*/
|
|
108
|
+
addReader(reader: OptionsReader): void;
|
|
109
|
+
read(logger: Logger, cwd?: string, usedFile?: (path: string) => void): Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* Adds an option declaration to the container with extra type checking to ensure that
|
|
112
|
+
* the runtime type is consistent with the declared type.
|
|
113
|
+
* @param declaration The option declaration that should be added.
|
|
114
|
+
*/
|
|
115
|
+
addDeclaration<K extends keyof TypeDocOptions>(declaration: {
|
|
116
|
+
name: K;
|
|
117
|
+
} & KeyToDeclaration<K>): void;
|
|
118
|
+
/**
|
|
119
|
+
* Adds an option declaration to the container.
|
|
120
|
+
* @param declaration The option declaration that should be added.
|
|
121
|
+
*/
|
|
122
|
+
addDeclaration(declaration: NeverIfInternal<Readonly<DeclarationOption>>): void;
|
|
123
|
+
/**
|
|
124
|
+
* Gets a declaration by one of its names.
|
|
125
|
+
* @param name
|
|
126
|
+
*/
|
|
127
|
+
getDeclaration(name: string): Readonly<DeclarationOption> | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* Gets all declared options.
|
|
130
|
+
*/
|
|
131
|
+
getDeclarations(): Readonly<DeclarationOption>[];
|
|
132
|
+
/**
|
|
133
|
+
* Checks if the given option's value is deeply strict equal to the default.
|
|
134
|
+
* @param name
|
|
135
|
+
*/
|
|
136
|
+
isSet(name: keyof TypeDocOptions): boolean;
|
|
137
|
+
isSet(name: NeverIfInternal<string>): boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Gets all of the TypeDoc option values defined in this option container.
|
|
140
|
+
*/
|
|
141
|
+
getRawValues(): Readonly<Partial<TypeDocOptionValues>>;
|
|
142
|
+
/**
|
|
143
|
+
* Gets a value for the given option key, throwing if the option has not been declared.
|
|
144
|
+
* @param name
|
|
145
|
+
*/
|
|
146
|
+
getValue<K extends keyof TypeDocOptions>(name: K): TypeDocOptionValues[K];
|
|
147
|
+
getValue(name: NeverIfInternal<string>): unknown;
|
|
148
|
+
/**
|
|
149
|
+
* Sets the given declared option. Throws if setting the option fails.
|
|
150
|
+
* @param name
|
|
151
|
+
* @param value
|
|
152
|
+
* @param configPath the directory to resolve Path type values against
|
|
153
|
+
*/
|
|
154
|
+
setValue<K extends keyof TypeDocOptions>(name: K, value: Exclude<TypeDocOptions[K], undefined>, configPath?: string): void;
|
|
155
|
+
setValue(name: NeverIfInternal<string>, value: NeverIfInternal<unknown>, configPath?: NeverIfInternal<string>): void;
|
|
156
|
+
/**
|
|
157
|
+
* Gets the set compiler options.
|
|
158
|
+
*/
|
|
159
|
+
getCompilerOptions(logger: Logger): ts.CompilerOptions;
|
|
160
|
+
/** @internal */
|
|
161
|
+
fixCompilerOptions(options: Readonly<ts.CompilerOptions>, logger: Logger): ts.CompilerOptions;
|
|
162
|
+
/**
|
|
163
|
+
* Gets the file names discovered through reading a tsconfig file.
|
|
164
|
+
*/
|
|
165
|
+
getFileNames(): readonly string[];
|
|
166
|
+
/**
|
|
167
|
+
* Gets the project references - used in solution style tsconfig setups.
|
|
168
|
+
*/
|
|
169
|
+
getProjectReferences(): readonly ts.ProjectReference[];
|
|
170
|
+
/**
|
|
171
|
+
* Sets the compiler options that will be used to get a TS program.
|
|
172
|
+
*/
|
|
173
|
+
setCompilerOptions(fileNames: readonly string[], options: ts.CompilerOptions, projectReferences: readonly ts.ProjectReference[] | undefined): void;
|
|
174
|
+
/**
|
|
175
|
+
* Discover similar option names to the given name, for use in error reporting.
|
|
176
|
+
*/
|
|
177
|
+
getSimilarOptions(missingName: string): string[];
|
|
178
|
+
/**
|
|
179
|
+
* Get the help message to be displayed to the user if `--help` is passed.
|
|
180
|
+
*/
|
|
181
|
+
getHelp(): string;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Binds an option to an accessor. Does not register the option.
|
|
185
|
+
*
|
|
186
|
+
* Note: This is a standard ES decorator. It will not work with pre-TS 5.0 experimental decorators enabled.
|
|
187
|
+
*/
|
|
188
|
+
export declare function Option<K extends keyof TypeDocOptionMap>(name: K): (_: unknown, _context: ClassAccessorDecoratorContext<{
|
|
189
|
+
application: Application;
|
|
190
|
+
} | {
|
|
191
|
+
options: Options;
|
|
192
|
+
}, TypeDocOptionValues[K]>) => {
|
|
193
|
+
get(this: {
|
|
194
|
+
application: Application;
|
|
195
|
+
} | {
|
|
196
|
+
options: Options;
|
|
197
|
+
}): TypeDocOptionValues[K];
|
|
198
|
+
set(_value: never): never;
|
|
199
|
+
};
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { resolve } from "path";
|
|
3
|
+
import { ParameterType } from "./declaration.js";
|
|
4
|
+
import { normalizePath } from "../paths.js";
|
|
5
|
+
import { convert, getDefaultValue, } from "./declaration.js";
|
|
6
|
+
import { addTypeDocOptions } from "./sources/index.js";
|
|
7
|
+
import { getOptionsHelp } from "./help.js";
|
|
8
|
+
import { getSimilarValues, i18n, insertOrderSorted, unique } from "#utils";
|
|
9
|
+
const optionSnapshots = new WeakMap();
|
|
10
|
+
/**
|
|
11
|
+
* Maintains a collection of option declarations split into TypeDoc options
|
|
12
|
+
* and TypeScript options. Ensures options are of the correct type for calling
|
|
13
|
+
* code.
|
|
14
|
+
*
|
|
15
|
+
* ### Option Discovery
|
|
16
|
+
*
|
|
17
|
+
* Since plugins commonly add custom options, and TypeDoc does not permit options which have
|
|
18
|
+
* not been declared to be set, options must be read twice. The first time options are read,
|
|
19
|
+
* a noop logger is passed so that any errors are ignored. Then, after loading plugins, options
|
|
20
|
+
* are read again, this time with the logger specified by the application.
|
|
21
|
+
*
|
|
22
|
+
* Options are read in a specific order.
|
|
23
|
+
* 1. argv (0) - Must be read first since it should change the files read when
|
|
24
|
+
* passing --options or --tsconfig.
|
|
25
|
+
* 2. typedoc-json (100) - Read next so that it can specify the tsconfig.json file to read.
|
|
26
|
+
* 3. tsconfig-json (200) - Last config file reader, cannot specify the typedoc.json file to read.
|
|
27
|
+
* 4. argv (300) - Read argv again since any options set there should override those set in config
|
|
28
|
+
* files.
|
|
29
|
+
*
|
|
30
|
+
* @group None
|
|
31
|
+
* @summary Contains all of TypeDoc's option declarations & values
|
|
32
|
+
*/
|
|
33
|
+
export class Options {
|
|
34
|
+
_readers = [];
|
|
35
|
+
_declarations = new Map();
|
|
36
|
+
_values = {};
|
|
37
|
+
_setOptions = new Set();
|
|
38
|
+
_compilerOptions = {};
|
|
39
|
+
_fileNames = [];
|
|
40
|
+
_projectReferences = [];
|
|
41
|
+
/**
|
|
42
|
+
* In packages mode, the directory of the package being converted.
|
|
43
|
+
*/
|
|
44
|
+
packageDir;
|
|
45
|
+
constructor() {
|
|
46
|
+
addTypeDocOptions(this);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Clones the options, intended for use in packages mode.
|
|
50
|
+
*/
|
|
51
|
+
copyForPackage(packageDir) {
|
|
52
|
+
const options = new Options();
|
|
53
|
+
options.packageDir = packageDir;
|
|
54
|
+
options._readers = this._readers.filter((reader) => reader.supportsPackages);
|
|
55
|
+
options._declarations = new Map(this._declarations);
|
|
56
|
+
options.reset();
|
|
57
|
+
for (const [key, val] of Object.entries(this.getValue("packageOptions"))) {
|
|
58
|
+
options.setValue(key, val, packageDir);
|
|
59
|
+
}
|
|
60
|
+
return options;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Take a snapshot of option values now, used in tests only.
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
snapshot() {
|
|
67
|
+
const key = {};
|
|
68
|
+
optionSnapshots.set(key, {
|
|
69
|
+
values: { ...this._values },
|
|
70
|
+
set: new Set(this._setOptions),
|
|
71
|
+
});
|
|
72
|
+
return key;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Take a snapshot of option values now, used in tests only.
|
|
76
|
+
* @internal
|
|
77
|
+
*/
|
|
78
|
+
restore(snapshot) {
|
|
79
|
+
const data = optionSnapshots.get(snapshot);
|
|
80
|
+
this._values = { ...data.values };
|
|
81
|
+
this._setOptions = new Set(data.set);
|
|
82
|
+
}
|
|
83
|
+
reset(name) {
|
|
84
|
+
if (name != null) {
|
|
85
|
+
const declaration = this.getDeclaration(name);
|
|
86
|
+
if (!declaration) {
|
|
87
|
+
throw new Error(`Cannot reset an option (${name}) which has not been declared.`);
|
|
88
|
+
}
|
|
89
|
+
this._values[declaration.name] = getDefaultValue(declaration);
|
|
90
|
+
this._setOptions.delete(declaration.name);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
for (const declaration of this.getDeclarations()) {
|
|
94
|
+
this._values[declaration.name] = getDefaultValue(declaration);
|
|
95
|
+
}
|
|
96
|
+
this._setOptions.clear();
|
|
97
|
+
this._compilerOptions = {};
|
|
98
|
+
this._fileNames = [];
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Adds an option reader that will be used to read configuration values
|
|
103
|
+
* from the command line, configuration files, or other locations.
|
|
104
|
+
* @param reader
|
|
105
|
+
*/
|
|
106
|
+
addReader(reader) {
|
|
107
|
+
insertOrderSorted(this._readers, reader);
|
|
108
|
+
}
|
|
109
|
+
async read(logger, cwd = process.cwd(), usedFile = () => { }) {
|
|
110
|
+
for (const reader of this._readers) {
|
|
111
|
+
await reader.read(this, logger, cwd, usedFile);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
addDeclaration(declaration) {
|
|
115
|
+
const decl = this.getDeclaration(declaration.name);
|
|
116
|
+
if (decl) {
|
|
117
|
+
throw new Error(`The option ${declaration.name} has already been registered`);
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
this._declarations.set(declaration.name, declaration);
|
|
121
|
+
}
|
|
122
|
+
this._values[declaration.name] = getDefaultValue(declaration);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Gets a declaration by one of its names.
|
|
126
|
+
* @param name
|
|
127
|
+
*/
|
|
128
|
+
getDeclaration(name) {
|
|
129
|
+
return this._declarations.get(name);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Gets all declared options.
|
|
133
|
+
*/
|
|
134
|
+
getDeclarations() {
|
|
135
|
+
return unique(this._declarations.values());
|
|
136
|
+
}
|
|
137
|
+
isSet(name) {
|
|
138
|
+
if (!this._declarations.has(name)) {
|
|
139
|
+
throw new Error(`Tried to check if an undefined option (${name}) was set`);
|
|
140
|
+
}
|
|
141
|
+
return this._setOptions.has(name);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Gets all of the TypeDoc option values defined in this option container.
|
|
145
|
+
*/
|
|
146
|
+
getRawValues() {
|
|
147
|
+
return this._values;
|
|
148
|
+
}
|
|
149
|
+
getValue(name) {
|
|
150
|
+
const declaration = this.getDeclaration(name);
|
|
151
|
+
if (!declaration) {
|
|
152
|
+
const nearNames = this.getSimilarOptions(name);
|
|
153
|
+
throw new Error(i18n.unknown_option_0_you_may_have_meant_1(name, nearNames.join("\n\t")));
|
|
154
|
+
}
|
|
155
|
+
return this._values[declaration.name];
|
|
156
|
+
}
|
|
157
|
+
setValue(name, value, configPath) {
|
|
158
|
+
const declaration = this.getDeclaration(name);
|
|
159
|
+
if (!declaration) {
|
|
160
|
+
const nearNames = this.getSimilarOptions(name);
|
|
161
|
+
throw new Error(i18n.unknown_option_0_you_may_have_meant_1(name, nearNames.join("\n\t")));
|
|
162
|
+
}
|
|
163
|
+
let oldValue = this._values[declaration.name];
|
|
164
|
+
if (typeof oldValue === "undefined") {
|
|
165
|
+
oldValue = getDefaultValue(declaration);
|
|
166
|
+
}
|
|
167
|
+
const converted = convert(value, declaration, configPath ?? process.cwd(), oldValue);
|
|
168
|
+
if (declaration.type === ParameterType.Flags) {
|
|
169
|
+
this._values[declaration.name] = Object.assign({}, this._values[declaration.name], converted);
|
|
170
|
+
}
|
|
171
|
+
else if (declaration.name === "outputs") {
|
|
172
|
+
// This is very unfortunate... there's probably some smarter way to define options
|
|
173
|
+
// so that this can be done intelligently via the convert function.
|
|
174
|
+
this._values[declaration.name] = converted.map((c) => {
|
|
175
|
+
return {
|
|
176
|
+
...c,
|
|
177
|
+
path: normalizePath(resolve(configPath ?? process.cwd(), c.path)),
|
|
178
|
+
};
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
this._values[declaration.name] = converted;
|
|
183
|
+
}
|
|
184
|
+
this._setOptions.add(name);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Gets the set compiler options.
|
|
188
|
+
*/
|
|
189
|
+
getCompilerOptions(logger) {
|
|
190
|
+
return this.fixCompilerOptions(this._compilerOptions, logger);
|
|
191
|
+
}
|
|
192
|
+
/** @internal */
|
|
193
|
+
fixCompilerOptions(options, logger) {
|
|
194
|
+
const overrides = this.getValue("compilerOptions");
|
|
195
|
+
const result = { ...options };
|
|
196
|
+
if (overrides) {
|
|
197
|
+
const tsOptions = ts.convertCompilerOptionsFromJson(overrides, ".", "typedoc-overrides.json");
|
|
198
|
+
if (tsOptions.errors.length) {
|
|
199
|
+
for (const error of tsOptions.errors) {
|
|
200
|
+
logger.error(i18n.failed_to_apply_compilerOptions_overrides_0(ts.flattenDiagnosticMessageText(error.messageText, "\n")));
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
for (const key in overrides) {
|
|
205
|
+
result[key] = tsOptions.options[key];
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (this.getValue("emit") !== "both") {
|
|
210
|
+
result.noEmit = true;
|
|
211
|
+
delete result.emitDeclarationOnly;
|
|
212
|
+
}
|
|
213
|
+
return result;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Gets the file names discovered through reading a tsconfig file.
|
|
217
|
+
*/
|
|
218
|
+
getFileNames() {
|
|
219
|
+
return this._fileNames;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Gets the project references - used in solution style tsconfig setups.
|
|
223
|
+
*/
|
|
224
|
+
getProjectReferences() {
|
|
225
|
+
return this._projectReferences;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Sets the compiler options that will be used to get a TS program.
|
|
229
|
+
*/
|
|
230
|
+
setCompilerOptions(fileNames, options, projectReferences) {
|
|
231
|
+
// We do this here instead of in the tsconfig reader so that API consumers which
|
|
232
|
+
// supply a program to `Converter.convert` instead of letting TypeDoc create one
|
|
233
|
+
// can just set the compiler options, and not need to know about this mapping.
|
|
234
|
+
// It feels a bit like a hack... but it's better to have it here than to put it
|
|
235
|
+
// in Application or Converter.
|
|
236
|
+
if (options.stripInternal && !this.isSet("excludeInternal")) {
|
|
237
|
+
this.setValue("excludeInternal", true);
|
|
238
|
+
}
|
|
239
|
+
this._fileNames = fileNames;
|
|
240
|
+
this._compilerOptions = { ...options };
|
|
241
|
+
this._projectReferences = projectReferences ?? [];
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Discover similar option names to the given name, for use in error reporting.
|
|
245
|
+
*/
|
|
246
|
+
getSimilarOptions(missingName) {
|
|
247
|
+
return getSimilarValues(this._declarations.keys(), missingName);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Get the help message to be displayed to the user if `--help` is passed.
|
|
251
|
+
*/
|
|
252
|
+
getHelp() {
|
|
253
|
+
return getOptionsHelp(this);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Binds an option to an accessor. Does not register the option.
|
|
258
|
+
*
|
|
259
|
+
* Note: This is a standard ES decorator. It will not work with pre-TS 5.0 experimental decorators enabled.
|
|
260
|
+
*/
|
|
261
|
+
export function Option(name) {
|
|
262
|
+
return (_, _context) => {
|
|
263
|
+
return {
|
|
264
|
+
get() {
|
|
265
|
+
const options = "options" in this ? this.options : this.application.options;
|
|
266
|
+
return options.getValue(name);
|
|
267
|
+
},
|
|
268
|
+
set(_value) {
|
|
269
|
+
throw new Error(`Options may not be set via the Option decorator when setting ${name}`);
|
|
270
|
+
},
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Options, OptionsReader } from "../index.js";
|
|
2
|
+
import { type Logger } from "#utils";
|
|
3
|
+
/**
|
|
4
|
+
* Obtains option values from command-line arguments
|
|
5
|
+
*/
|
|
6
|
+
export declare class ArgumentsReader implements OptionsReader {
|
|
7
|
+
readonly name = "arguments";
|
|
8
|
+
readonly order: number;
|
|
9
|
+
readonly supportsPackages = false;
|
|
10
|
+
private args;
|
|
11
|
+
private skipErrorReporting;
|
|
12
|
+
constructor(priority: number, args?: string[]);
|
|
13
|
+
ignoreErrors(): this;
|
|
14
|
+
read(container: Options, logger: Logger): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { ok } from "assert";
|
|
2
|
+
import { ParameterType } from "../declaration.js";
|
|
3
|
+
import { i18n } from "#utils";
|
|
4
|
+
const ARRAY_OPTION_TYPES = new Set([
|
|
5
|
+
ParameterType.Array,
|
|
6
|
+
ParameterType.PathArray,
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
8
|
+
ParameterType.ModuleArray,
|
|
9
|
+
ParameterType.PluginArray,
|
|
10
|
+
ParameterType.GlobArray,
|
|
11
|
+
]);
|
|
12
|
+
/**
|
|
13
|
+
* Obtains option values from command-line arguments
|
|
14
|
+
*/
|
|
15
|
+
export class ArgumentsReader {
|
|
16
|
+
name = "arguments";
|
|
17
|
+
order;
|
|
18
|
+
supportsPackages = false;
|
|
19
|
+
args;
|
|
20
|
+
skipErrorReporting = false;
|
|
21
|
+
constructor(priority, args = process.argv.slice(2)) {
|
|
22
|
+
this.order = priority;
|
|
23
|
+
this.args = args;
|
|
24
|
+
}
|
|
25
|
+
ignoreErrors() {
|
|
26
|
+
this.skipErrorReporting = true;
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
read(container, logger) {
|
|
30
|
+
// Make container's type more lax, we do the appropriate checks manually.
|
|
31
|
+
const options = container;
|
|
32
|
+
const seen = new Set();
|
|
33
|
+
let index = 0;
|
|
34
|
+
const trySet = (name, value) => {
|
|
35
|
+
try {
|
|
36
|
+
options.setValue(name, value);
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
ok(err instanceof Error);
|
|
40
|
+
if (!this.skipErrorReporting) {
|
|
41
|
+
logger.error(err.message);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
while (index < this.args.length) {
|
|
46
|
+
const name = this.args[index];
|
|
47
|
+
const decl = name.startsWith("-")
|
|
48
|
+
? (index++, options.getDeclaration(name.replace(/^--?/, "")))
|
|
49
|
+
: options.getDeclaration("entryPoints");
|
|
50
|
+
if (decl) {
|
|
51
|
+
if (decl.configFileOnly) {
|
|
52
|
+
if (!this.skipErrorReporting) {
|
|
53
|
+
logger.error(i18n.option_0_can_only_be_specified_by_config_file(decl.name));
|
|
54
|
+
}
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (seen.has(decl.name) && ARRAY_OPTION_TYPES.has(decl.type)) {
|
|
58
|
+
trySet(decl.name, options.getValue(decl.name).concat(this.args[index]));
|
|
59
|
+
}
|
|
60
|
+
else if (decl.type === ParameterType.Boolean ||
|
|
61
|
+
decl.type === ParameterType.Flags) {
|
|
62
|
+
const value = String(this.args.at(index)).toLowerCase();
|
|
63
|
+
if (value === "true" || value === "false") {
|
|
64
|
+
trySet(decl.name, value === "true");
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
trySet(decl.name, true);
|
|
68
|
+
// Bool option didn't consume the next argument as expected.
|
|
69
|
+
index--;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
if (index === this.args.length) {
|
|
74
|
+
// Only boolean values have optional values.
|
|
75
|
+
if (!this.skipErrorReporting) {
|
|
76
|
+
logger.warn(i18n.option_0_expected_a_value_but_none_provided(decl.name));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
trySet(decl.name, this.args[index]);
|
|
80
|
+
}
|
|
81
|
+
seen.add(decl.name);
|
|
82
|
+
index++;
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
if (name.includes(".")) {
|
|
86
|
+
const actualName = name.split(".")[0].replace(/^--?/, "");
|
|
87
|
+
const decl = options.getDeclaration(actualName);
|
|
88
|
+
if (decl && decl.type === ParameterType.Flags) {
|
|
89
|
+
const flagName = name.split(".", 2)[1];
|
|
90
|
+
const value = String(this.args.at(index)).toLowerCase();
|
|
91
|
+
if (value === "true" || value === "false") {
|
|
92
|
+
trySet(decl.name, { [flagName]: value === "true" });
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
trySet(decl.name, { [flagName]: true });
|
|
96
|
+
// Bool option didn't consume the next argument as expected.
|
|
97
|
+
index--;
|
|
98
|
+
}
|
|
99
|
+
index++;
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (!this.skipErrorReporting) {
|
|
104
|
+
logger.error(i18n.unknown_option_0_may_have_meant_1(name, options.getSimilarOptions(name).join("\n\t")));
|
|
105
|
+
}
|
|
106
|
+
index++;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { OptionsReader } from "../index.js";
|
|
2
|
+
import type { Options } from "../options.js";
|
|
3
|
+
import { type Logger } from "#utils";
|
|
4
|
+
export declare class PackageJsonReader implements OptionsReader {
|
|
5
|
+
order: number;
|
|
6
|
+
supportsPackages: boolean;
|
|
7
|
+
name: string;
|
|
8
|
+
read(container: Options, logger: Logger, cwd: string, usedFile: (path: string) => void): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ok } from "assert";
|
|
2
|
+
import { nicePath } from "../../paths.js";
|
|
3
|
+
import { discoverPackageJson } from "../../fs.js";
|
|
4
|
+
import { dirname } from "path";
|
|
5
|
+
import { i18n } from "#utils";
|
|
6
|
+
export class PackageJsonReader {
|
|
7
|
+
// Should run after the TypeDoc config reader but before the TS config
|
|
8
|
+
// reader, so that it can still specify a path to a `tsconfig.json` file.
|
|
9
|
+
order = 150;
|
|
10
|
+
supportsPackages = true;
|
|
11
|
+
name = "package-json";
|
|
12
|
+
read(container, logger, cwd, usedFile) {
|
|
13
|
+
const result = discoverPackageJson(cwd, usedFile);
|
|
14
|
+
if (!result) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const { file, content } = result;
|
|
18
|
+
if ("typedoc" in content) {
|
|
19
|
+
logger.warn(i18n.typedoc_key_in_0_ignored(nicePath(file)));
|
|
20
|
+
}
|
|
21
|
+
const optsKey = "typedocOptions";
|
|
22
|
+
if (!(optsKey in content)) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const opts = content[optsKey];
|
|
26
|
+
if (opts === null || typeof opts !== "object") {
|
|
27
|
+
logger.error(i18n.typedoc_options_must_be_object_in_0(nicePath(file)));
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
for (const [opt, val] of Object.entries(opts)) {
|
|
31
|
+
try {
|
|
32
|
+
container.setValue(opt, val, dirname(file));
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
ok(err instanceof Error);
|
|
36
|
+
logger.error(err.message);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Options, OptionsReader } from "../options.js";
|
|
2
|
+
import { type Logger } from "#utils";
|
|
3
|
+
export declare class TSConfigReader implements OptionsReader {
|
|
4
|
+
/**
|
|
5
|
+
* Note: Runs after the {@link TypeDocReader}.
|
|
6
|
+
*/
|
|
7
|
+
order: number;
|
|
8
|
+
name: string;
|
|
9
|
+
supportsPackages: boolean;
|
|
10
|
+
private seenTsdocPaths;
|
|
11
|
+
read(container: Options, logger: Logger, cwd: string, usedFile?: (path: string) => void): void;
|
|
12
|
+
private addTagsFromTsdocJson;
|
|
13
|
+
private readTsDoc;
|
|
14
|
+
}
|