@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,60 @@
|
|
|
1
|
+
import { getSimilarValues } from "#utils";
|
|
2
|
+
/**
|
|
3
|
+
* Responsible for getting a unique anchor for elements within a page.
|
|
4
|
+
*/
|
|
5
|
+
export class Slugger {
|
|
6
|
+
options;
|
|
7
|
+
seen = new Map();
|
|
8
|
+
serialize(value) {
|
|
9
|
+
// There are quite a few trade-offs here. We used to remove HTML tags here,
|
|
10
|
+
// but TypeDoc now removes the HTML tags before passing text into the slug
|
|
11
|
+
// method, which allows us to skip doing that here. This improves the slugger
|
|
12
|
+
// generation for headers which look like the following:
|
|
13
|
+
// (html allowed in markdown)
|
|
14
|
+
// # test <t>
|
|
15
|
+
// (html disallowed in markdown)
|
|
16
|
+
// # test <t>
|
|
17
|
+
// both of the above should slug to test-t
|
|
18
|
+
const slug = value
|
|
19
|
+
.trim()
|
|
20
|
+
// remove unwanted chars
|
|
21
|
+
.replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, "")
|
|
22
|
+
// change whitespace to dash
|
|
23
|
+
.replace(/\s/g, "-")
|
|
24
|
+
// combine adjacent dashes
|
|
25
|
+
.replace(/--+/, "-");
|
|
26
|
+
// #3065 unfortunately some headers might result in a desired slug which is
|
|
27
|
+
// completely empty. In that case, we still need to return *something* so that
|
|
28
|
+
// we don't end up generating an empty anchor, which is invalid according to the
|
|
29
|
+
// spec. GitHub's slugger rules don't handle this, so I've somewhat arbitrarily
|
|
30
|
+
// chosen "_" here. If GitHub ever fixes that issue, this might need to be adjusted.
|
|
31
|
+
return slug || "_";
|
|
32
|
+
}
|
|
33
|
+
constructor(options) {
|
|
34
|
+
this.options = options;
|
|
35
|
+
}
|
|
36
|
+
slug(value) {
|
|
37
|
+
const originalSlug = this.serialize(value);
|
|
38
|
+
const lowerOriginalSlug = originalSlug.toLocaleLowerCase();
|
|
39
|
+
let count = 0;
|
|
40
|
+
let slug = lowerOriginalSlug;
|
|
41
|
+
if (this.seen.has(lowerOriginalSlug)) {
|
|
42
|
+
count = this.seen.get(lowerOriginalSlug);
|
|
43
|
+
do {
|
|
44
|
+
count++;
|
|
45
|
+
slug = `${lowerOriginalSlug}-${count}`;
|
|
46
|
+
} while (this.seen.has(slug));
|
|
47
|
+
}
|
|
48
|
+
this.seen.set(lowerOriginalSlug, count);
|
|
49
|
+
if (!this.options.lowercase) {
|
|
50
|
+
return count === 0 ? originalSlug : `${originalSlug}-${count}`;
|
|
51
|
+
}
|
|
52
|
+
return slug;
|
|
53
|
+
}
|
|
54
|
+
hasAnchor(anchor) {
|
|
55
|
+
return this.seen.has(anchor);
|
|
56
|
+
}
|
|
57
|
+
getSimilarAnchors(anchor) {
|
|
58
|
+
return getSimilarValues(this.seen.keys(), anchor);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { RenderTemplate } from "../../../index.js";
|
|
2
|
+
import type { Reflection } from "../../../../models/index.js";
|
|
3
|
+
import { JSX } from "#utils";
|
|
4
|
+
import type { PageEvent } from "../../../events.js";
|
|
5
|
+
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
|
|
6
|
+
export declare const defaultLayout: (context: DefaultThemeRenderContext, template: RenderTemplate<PageEvent<Reflection>>, props: PageEvent<Reflection>) => JSX.Element;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { JSX } from "#utils";
|
|
2
|
+
import { getDisplayName, getHierarchyRoots } from "../../lib.js";
|
|
3
|
+
import { extname } from "path";
|
|
4
|
+
function favicon(context) {
|
|
5
|
+
const fav = context.options.getValue("favicon");
|
|
6
|
+
if (!fav)
|
|
7
|
+
return null;
|
|
8
|
+
if (/^https?:\/\//i.test(fav)) {
|
|
9
|
+
return JSX.createElement("link", { rel: "icon", href: fav });
|
|
10
|
+
}
|
|
11
|
+
switch (extname(fav)) {
|
|
12
|
+
case ".ico":
|
|
13
|
+
return JSX.createElement("link", { rel: "icon", href: context.relativeURL("assets/favicon.ico", true) });
|
|
14
|
+
case ".png":
|
|
15
|
+
return JSX.createElement("link", { rel: "icon", href: context.relativeURL("assets/favicon.png", true), type: "image/png" });
|
|
16
|
+
case ".svg":
|
|
17
|
+
return JSX.createElement("link", { rel: "icon", href: context.relativeURL("assets/favicon.svg", true), type: "image/svg+xml" });
|
|
18
|
+
default:
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
// See #2760
|
|
23
|
+
function buildSiteMetadata(context) {
|
|
24
|
+
try {
|
|
25
|
+
// We have to know where we are hosted in order to generate this block
|
|
26
|
+
const url = new URL(context.options.getValue("hostedBaseUrl"));
|
|
27
|
+
// No point in generating this if we aren't the root page on the site
|
|
28
|
+
if (url.pathname !== "/") {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
return (JSX.createElement("script", { type: "application/ld+json" },
|
|
32
|
+
JSX.createElement(JSX.Raw, { html: JSON.stringify({
|
|
33
|
+
"@context": "https://schema.org",
|
|
34
|
+
"@type": "WebSite",
|
|
35
|
+
name: context.model.project.name,
|
|
36
|
+
url: url.toString(),
|
|
37
|
+
}) })));
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export const defaultLayout = (context, template, props) => (JSX.createElement("html", { class: "default", lang: context.options.getValue("lang"), "data-base": context.relativeURL("./") },
|
|
44
|
+
JSX.createElement("head", null,
|
|
45
|
+
JSX.createElement("meta", { charset: "utf-8" }),
|
|
46
|
+
context.hook("head.begin", context),
|
|
47
|
+
JSX.createElement("meta", { "http-equiv": "x-ua-compatible", content: "IE=edge" }),
|
|
48
|
+
JSX.createElement("title", null, props.model.isProject()
|
|
49
|
+
? getDisplayName(props.model)
|
|
50
|
+
: `${getDisplayName(props.model)} | ${getDisplayName(props.project)}`),
|
|
51
|
+
favicon(context),
|
|
52
|
+
props.url === "index.html" && buildSiteMetadata(context),
|
|
53
|
+
JSX.createElement("meta", { name: "description", content: "Documentation for " + props.project.name }),
|
|
54
|
+
JSX.createElement("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }),
|
|
55
|
+
JSX.createElement("link", { rel: "stylesheet", href: context.relativeURL("assets/style.css", true) }),
|
|
56
|
+
JSX.createElement("link", { rel: "stylesheet", href: context.relativeURL("assets/highlight.css", true) }),
|
|
57
|
+
context.options.getValue("customCss") && (JSX.createElement("link", { rel: "stylesheet", href: context.relativeURL("assets/custom.css", true) })),
|
|
58
|
+
JSX.createElement("script", { defer: true, src: context.relativeURL("assets/main.js", true) }),
|
|
59
|
+
context.options.getValue("customJs") && (JSX.createElement("script", { defer: true, src: context.relativeURL("assets/custom.js", true) })),
|
|
60
|
+
JSX.createElement("script", { async: true, src: context.relativeURL("assets/icons.js", true), id: "tsd-icons-script" }),
|
|
61
|
+
JSX.createElement("script", { async: true, src: context.relativeURL("assets/search.js", true), id: "tsd-search-script" }),
|
|
62
|
+
JSX.createElement("script", { async: true, src: context.relativeURL("assets/navigation.js", true), id: "tsd-nav-script" }),
|
|
63
|
+
!!getHierarchyRoots(props.project).length && (JSX.createElement("script", { async: true, src: context.relativeURL("assets/hierarchy.js", true), id: "tsd-hierarchy-script" })),
|
|
64
|
+
context.hook("head.end", context)),
|
|
65
|
+
JSX.createElement("body", null,
|
|
66
|
+
context.hook("body.begin", context),
|
|
67
|
+
JSX.createElement("script", null,
|
|
68
|
+
JSX.createElement(JSX.Raw, { html: 'document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";' }),
|
|
69
|
+
JSX.createElement(JSX.Raw, { html: 'document.body.style.display="none";' }),
|
|
70
|
+
JSX.createElement(JSX.Raw, { html: 'setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)' })),
|
|
71
|
+
context.toolbar(props),
|
|
72
|
+
JSX.createElement("div", { class: "container container-main" },
|
|
73
|
+
JSX.createElement("div", { class: "col-content" },
|
|
74
|
+
context.hook("content.begin", context),
|
|
75
|
+
context.header(props),
|
|
76
|
+
template(props),
|
|
77
|
+
context.hook("content.end", context)),
|
|
78
|
+
JSX.createElement("div", { class: "col-sidebar" },
|
|
79
|
+
JSX.createElement("div", { class: "page-menu" },
|
|
80
|
+
context.hook("pageSidebar.begin", context),
|
|
81
|
+
context.pageSidebar(props),
|
|
82
|
+
context.hook("pageSidebar.end", context)),
|
|
83
|
+
JSX.createElement("div", { class: "site-menu" },
|
|
84
|
+
context.hook("sidebar.begin", context),
|
|
85
|
+
context.sidebar(props),
|
|
86
|
+
context.hook("sidebar.end", context)))),
|
|
87
|
+
context.footer(),
|
|
88
|
+
JSX.createElement("div", { class: "overlay" }),
|
|
89
|
+
context.hook("body.end", context))));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Reflection } from "../../../../models/index.js";
|
|
2
|
+
import { JSX } from "#utils";
|
|
3
|
+
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
|
|
4
|
+
export declare function anchorIcon(context: DefaultThemeRenderContext, anchor: string | undefined): JSX.Element;
|
|
5
|
+
export declare function anchorTargetIfPresent(context: DefaultThemeRenderContext, refl: Reflection): string | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { i18n, JSX } from "#utils";
|
|
2
|
+
export function anchorIcon(context, anchor) {
|
|
3
|
+
if (!anchor)
|
|
4
|
+
return JSX.createElement(JSX.Fragment, null);
|
|
5
|
+
return (JSX.createElement("a", { href: `#${anchor}`, "aria-label": i18n.theme_permalink(), class: "tsd-anchor-icon" }, context.icons.anchor()));
|
|
6
|
+
}
|
|
7
|
+
export function anchorTargetIfPresent(context, refl) {
|
|
8
|
+
return context.router.hasUrl(refl) ? context.router.getAnchor(refl) : undefined;
|
|
9
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
|
|
2
|
+
import { JSX } from "#utils";
|
|
3
|
+
import type { Reflection } from "../../../../models/index.js";
|
|
4
|
+
export declare function breadcrumbs(context: DefaultThemeRenderContext, props: Reflection): JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { JSX } from "#utils";
|
|
2
|
+
export function breadcrumbs(context, props) {
|
|
3
|
+
const path = [];
|
|
4
|
+
let refl = props;
|
|
5
|
+
while (refl.parent) {
|
|
6
|
+
path.push(refl);
|
|
7
|
+
refl = refl.parent;
|
|
8
|
+
}
|
|
9
|
+
return (JSX.createElement("ul", { class: "tsd-breadcrumb", "aria-label": "Breadcrumb" }, path.reverse().map((r, index) => (JSX.createElement("li", null,
|
|
10
|
+
JSX.createElement("a", { href: context.urlTo(r), "aria-current": index === path.length - 1 ? "page" : undefined }, r.name))))));
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
|
|
2
|
+
import { JSX } from "#utils";
|
|
3
|
+
import { type CommentDisplayPart, type Reflection } from "../../../../models/index.js";
|
|
4
|
+
export declare function renderDisplayParts({ markdown }: DefaultThemeRenderContext, parts: readonly CommentDisplayPart[] | undefined): JSX.Element | undefined;
|
|
5
|
+
export declare function commentShortSummary(context: DefaultThemeRenderContext, props: Reflection): JSX.Element | undefined;
|
|
6
|
+
export declare function commentSummary(context: DefaultThemeRenderContext, props: Reflection): JSX.Element | undefined;
|
|
7
|
+
export declare function commentTags(context: DefaultThemeRenderContext, props: Reflection): JSX.Element | undefined;
|
|
8
|
+
export declare function reflectionFlags(context: DefaultThemeRenderContext, props: Reflection): JSX.Element;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { JSX, translateTagName } from "#utils";
|
|
2
|
+
import { ReflectionKind } from "../../../../models/index.js";
|
|
3
|
+
import { anchorIcon } from "./anchor-icon.js";
|
|
4
|
+
import { join } from "../../lib.js";
|
|
5
|
+
// Note: Comment modifiers are handled in `renderFlags`
|
|
6
|
+
export function renderDisplayParts({ markdown }, parts) {
|
|
7
|
+
if (!parts?.length)
|
|
8
|
+
return;
|
|
9
|
+
return (JSX.createElement("div", { class: "tsd-comment tsd-typography" },
|
|
10
|
+
JSX.createElement(JSX.Raw, { html: markdown(parts) })));
|
|
11
|
+
}
|
|
12
|
+
export function commentShortSummary(context, props) {
|
|
13
|
+
let shortSummary;
|
|
14
|
+
if (props.isDocument()) {
|
|
15
|
+
if (typeof props.frontmatter["summary"] === "string") {
|
|
16
|
+
shortSummary = [{ kind: "text", text: props.frontmatter["summary"] }];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
shortSummary = props.comment?.getShortSummary(context.options.getValue("useFirstParagraphOfCommentAsSummary"));
|
|
21
|
+
}
|
|
22
|
+
if (!shortSummary?.length && props.isDeclaration() && props.signatures?.length) {
|
|
23
|
+
return commentShortSummary(context, props.signatures[0]);
|
|
24
|
+
}
|
|
25
|
+
if (!shortSummary?.some((part) => part.text))
|
|
26
|
+
return;
|
|
27
|
+
return context.displayParts(shortSummary);
|
|
28
|
+
}
|
|
29
|
+
export function commentSummary(context, props) {
|
|
30
|
+
if (props.comment?.summary.some((part) => part.text)) {
|
|
31
|
+
return context.displayParts(props.comment.summary);
|
|
32
|
+
}
|
|
33
|
+
const target = (props.isDeclaration() || props.isParameter()) && props.type?.type === "reference"
|
|
34
|
+
? props.type.reflection
|
|
35
|
+
: undefined;
|
|
36
|
+
if (target?.comment?.hasModifier("@expand") && target?.comment?.summary.some((part) => part.text)) {
|
|
37
|
+
return context.displayParts(target.comment.summary);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export function commentTags(context, props) {
|
|
41
|
+
if (!props.comment)
|
|
42
|
+
return;
|
|
43
|
+
const skipSave = props.comment.blockTags.map((tag) => tag.skipRendering);
|
|
44
|
+
const skippedTags = context.options.getValue("notRenderedTags");
|
|
45
|
+
const beforeTags = context.hook("comment.beforeTags", context, props.comment, props);
|
|
46
|
+
const afterTags = context.hook("comment.afterTags", context, props.comment, props);
|
|
47
|
+
const tags = props.kindOf(ReflectionKind.SomeSignature)
|
|
48
|
+
? props.comment.blockTags.filter((tag) => tag.tag !== "@returns" && !tag.skipRendering && !skippedTags.includes(tag.tag))
|
|
49
|
+
: props.comment.blockTags.filter((tag) => !tag.skipRendering && !skippedTags.includes(tag.tag));
|
|
50
|
+
skipSave.forEach((skip, i) => (props.comment.blockTags[i].skipRendering = skip));
|
|
51
|
+
const tagsContents = tags.map((item) => {
|
|
52
|
+
const name = item.name
|
|
53
|
+
? `${translateTagName(item.tag)}: ${item.name}`
|
|
54
|
+
: translateTagName(item.tag);
|
|
55
|
+
const anchor = context.slugger.slug(name);
|
|
56
|
+
return (JSX.createElement(JSX.Fragment, null,
|
|
57
|
+
JSX.createElement("div", { class: `tsd-tag-${item.tag.substring(1)}` },
|
|
58
|
+
JSX.createElement("h4", { class: "tsd-anchor-link", id: anchor },
|
|
59
|
+
name,
|
|
60
|
+
anchorIcon(context, anchor)),
|
|
61
|
+
item.typeAnnotation && JSX.createElement("span", { class: "tsd-type-annotation" }, item.typeAnnotation),
|
|
62
|
+
JSX.createElement(JSX.Raw, { html: context.markdown(item.content) }))));
|
|
63
|
+
});
|
|
64
|
+
return (JSX.createElement(JSX.Fragment, null,
|
|
65
|
+
beforeTags,
|
|
66
|
+
tagsContents.length > 0 && (JSX.createElement("div", { class: "tsd-comment tsd-typography" }, tagsContents)),
|
|
67
|
+
afterTags));
|
|
68
|
+
}
|
|
69
|
+
export function reflectionFlags(context, props) {
|
|
70
|
+
const flagsNotRendered = context.options.getValue("notRenderedTags");
|
|
71
|
+
const allFlags = props.flags.getFlagStrings();
|
|
72
|
+
if (props.comment) {
|
|
73
|
+
for (const tag of props.comment.modifierTags) {
|
|
74
|
+
if (!flagsNotRendered.includes(tag)) {
|
|
75
|
+
allFlags.push(translateTagName(tag));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return join(" ", allFlags, (item) => JSX.createElement("code", { class: "tsd-tag" }, item));
|
|
80
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { i18n, JSX } from "#utils";
|
|
2
|
+
export function footer(context) {
|
|
3
|
+
const hideGenerator = context.options.getValue("hideGenerator");
|
|
4
|
+
let generatorDisplay = JSX.createElement(JSX.Fragment, null);
|
|
5
|
+
if (!hideGenerator) {
|
|
6
|
+
const message = i18n.theme_generated_using_typedoc();
|
|
7
|
+
// Only handles one occurrence, but that's all I expect...
|
|
8
|
+
const index = message.indexOf("TypeDoc");
|
|
9
|
+
if (index == -1) {
|
|
10
|
+
generatorDisplay = JSX.createElement("p", { class: "tsd-generator" }, message);
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
const pre = message.substring(0, index);
|
|
14
|
+
const post = message.substring(index + "TypeDoc".length);
|
|
15
|
+
generatorDisplay = (JSX.createElement("p", { class: "tsd-generator" },
|
|
16
|
+
pre,
|
|
17
|
+
JSX.createElement("a", { href: "https://typedoc.org/", target: "_blank" }, "TypeDoc"),
|
|
18
|
+
post));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
const customFooterHtml = context.options.getValue("customFooterHtml");
|
|
22
|
+
let customFooterDisplay = JSX.createElement(JSX.Fragment, null);
|
|
23
|
+
if (customFooterHtml) {
|
|
24
|
+
if (context.options.getValue("customFooterHtmlDisableWrapper")) {
|
|
25
|
+
customFooterDisplay = JSX.createElement(JSX.Raw, { html: customFooterHtml });
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
customFooterDisplay = (JSX.createElement("p", null,
|
|
29
|
+
JSX.createElement(JSX.Raw, { html: customFooterHtml })));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return (JSX.createElement("footer", null,
|
|
33
|
+
context.hook("footer.begin", context),
|
|
34
|
+
generatorDisplay,
|
|
35
|
+
customFooterDisplay,
|
|
36
|
+
context.hook("footer.end", context)));
|
|
37
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { JSX } from "#utils";
|
|
2
|
+
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
|
|
3
|
+
import type { PageEvent } from "../../../events.js";
|
|
4
|
+
import { type Reflection } from "../../../../models/index.js";
|
|
5
|
+
export declare const header: (context: DefaultThemeRenderContext, props: PageEvent<Reflection>) => JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { classNames, getDisplayName, hasTypeParameters, join } from "../../lib.js";
|
|
2
|
+
import { JSX } from "#utils";
|
|
3
|
+
import { ReflectionKind } from "../../../../models/index.js";
|
|
4
|
+
export const header = (context, props) => {
|
|
5
|
+
const opts = context.options.getValue("headings");
|
|
6
|
+
// Don't render on the index page or the class hierarchy page
|
|
7
|
+
// We should probably someday render on the class hierarchy page, but currently breadcrumbs
|
|
8
|
+
// are entirely dependent on the reflection hierarchy, so it doesn't make sense today.
|
|
9
|
+
const renderBreadcrumbs = props.url !== "index.html" && props.url !== "hierarchy.html";
|
|
10
|
+
// Titles are always rendered on DeclarationReflection pages and the modules page for the project.
|
|
11
|
+
// They are also rendered on the readme + document pages if configured to do so by the user.
|
|
12
|
+
let renderTitle;
|
|
13
|
+
let titleKindString = "";
|
|
14
|
+
if (props.model.isProject()) {
|
|
15
|
+
if (props.url === "index.html" && props.model.readme?.length) {
|
|
16
|
+
renderTitle = opts.readme;
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
renderTitle = true;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
else if (props.model.isDocument()) {
|
|
23
|
+
renderTitle = opts.document;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
renderTitle = true;
|
|
27
|
+
titleKindString = ReflectionKind.singularString(props.model.kind) + " ";
|
|
28
|
+
}
|
|
29
|
+
return (JSX.createElement("div", { class: "tsd-page-title" },
|
|
30
|
+
renderBreadcrumbs && context.breadcrumbs(props.model),
|
|
31
|
+
renderTitle && (JSX.createElement("h1", { class: classNames({ deprecated: props.model.isDeprecated() }) },
|
|
32
|
+
titleKindString,
|
|
33
|
+
getDisplayName(props.model),
|
|
34
|
+
hasTypeParameters(props.model) && (JSX.createElement(JSX.Fragment, null,
|
|
35
|
+
"<",
|
|
36
|
+
join(", ", props.model.typeParameters, (item) => item.name),
|
|
37
|
+
">")),
|
|
38
|
+
context.reflectionFlags(props.model)))));
|
|
39
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
|
|
2
|
+
import { JSX } from "#utils";
|
|
3
|
+
import type { DeclarationHierarchy } from "../../../../models/index.js";
|
|
4
|
+
export declare function hierarchy(context: DefaultThemeRenderContext, typeHierarchy: DeclarationHierarchy | undefined): JSX.Element | undefined;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { i18n, JSX } from "#utils";
|
|
2
|
+
const isLinkedReferenceType = (type) => type.visit({
|
|
3
|
+
reference: (ref) => ref.reflection !== undefined,
|
|
4
|
+
}) ?? false;
|
|
5
|
+
function hasAnyLinkedReferenceType(h) {
|
|
6
|
+
if (!h)
|
|
7
|
+
return false;
|
|
8
|
+
if (!h.isTarget && h.types.some(isLinkedReferenceType))
|
|
9
|
+
return true;
|
|
10
|
+
return hasAnyLinkedReferenceType(h.next);
|
|
11
|
+
}
|
|
12
|
+
export function hierarchy(context, typeHierarchy) {
|
|
13
|
+
if (!typeHierarchy)
|
|
14
|
+
return;
|
|
15
|
+
const summaryLink = context.options.getValue("includeHierarchySummary") && hasAnyLinkedReferenceType(typeHierarchy)
|
|
16
|
+
? (JSX.createElement(JSX.Fragment, null,
|
|
17
|
+
" ",
|
|
18
|
+
"(",
|
|
19
|
+
JSX.createElement("a", { href: context.relativeURL("hierarchy.html") + "#" + context.model.getFullName() }, i18n.theme_hierarchy_view_summary()),
|
|
20
|
+
")"))
|
|
21
|
+
: JSX.createElement(JSX.Fragment, null);
|
|
22
|
+
return (JSX.createElement("section", { class: "tsd-panel tsd-hierarchy", "data-refl": context.model.id },
|
|
23
|
+
JSX.createElement("h4", null,
|
|
24
|
+
i18n.theme_hierarchy(),
|
|
25
|
+
summaryLink),
|
|
26
|
+
hierarchyList(context, typeHierarchy)));
|
|
27
|
+
}
|
|
28
|
+
function hierarchyList(context, props) {
|
|
29
|
+
return (JSX.createElement("ul", { class: "tsd-hierarchy" }, props.types.map((item, i, l) => (JSX.createElement("li", { class: "tsd-hierarchy-item" },
|
|
30
|
+
props.isTarget ? JSX.createElement("span", { class: "tsd-hierarchy-target" }, item.toString()) : context.type(item),
|
|
31
|
+
i === l.length - 1 && !!props.next && hierarchyList(context, props.next))))));
|
|
32
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReflectionKind } from "../../../../models/index.js";
|
|
2
|
+
import { JSX } from "#utils";
|
|
3
|
+
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
|
|
4
|
+
export declare function buildRefIcons(icons: Icons, context: DefaultThemeRenderContext): Icons;
|
|
5
|
+
export interface Icons extends Record<ReflectionKind, () => JSX.Element> {
|
|
6
|
+
chevronDown(): JSX.Element;
|
|
7
|
+
checkbox(): JSX.Element;
|
|
8
|
+
menu(): JSX.Element;
|
|
9
|
+
search(): JSX.Element;
|
|
10
|
+
/** @deprecated */
|
|
11
|
+
chevronSmall(): JSX.Element;
|
|
12
|
+
anchor(): JSX.Element;
|
|
13
|
+
folder(): JSX.Element;
|
|
14
|
+
alertNote(): JSX.Element;
|
|
15
|
+
alertTip(): JSX.Element;
|
|
16
|
+
alertImportant(): JSX.Element;
|
|
17
|
+
alertWarning(): JSX.Element;
|
|
18
|
+
alertCaution(): JSX.Element;
|
|
19
|
+
}
|
|
20
|
+
export declare function getIcons(): Icons;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// The alert icons in this file were taken from https://github.com/primer/octicons
|
|
2
|
+
// which is under a MIT license https://github.com/primer/octicons/blob/main/LICENSE
|
|
3
|
+
import assert from "assert";
|
|
4
|
+
import { ReflectionKind } from "../../../../models/index.js";
|
|
5
|
+
import { i18n, JSX } from "#utils";
|
|
6
|
+
const kindIcon = (letterPath, color, label, circular = false) => (JSX.createElement("svg", { class: "tsd-kind-icon", viewBox: "0 0 24 24", "aria-label": label },
|
|
7
|
+
JSX.createElement("rect", { fill: "var(--color-icon-background)", stroke: color, "stroke-width": "1.5", x: "1", y: "1", width: "22", height: "22", rx: circular ? "12" : "6" }),
|
|
8
|
+
letterPath));
|
|
9
|
+
const textIcon = (letter, color, label, circular = false) => kindIcon(JSX.createElement("text", { fill: "var(--color-icon-text)", x: "50%", y: "50%", dy: "0.35em", "text-anchor": "middle" }, letter), color, label, circular);
|
|
10
|
+
export function buildRefIcons(icons, context) {
|
|
11
|
+
const refs = {};
|
|
12
|
+
for (const [name, builder] of Object.entries(icons)) {
|
|
13
|
+
const jsx = builder.call(icons);
|
|
14
|
+
assert(jsx.tag === "svg", "TypeDoc's frontend assumes that icons are written as svg elements");
|
|
15
|
+
// This one cannot be cached because the CSS selector depends on targeting SVG elements
|
|
16
|
+
// within it. Ick. Surely there's a nicer way?
|
|
17
|
+
if (name === "checkbox") {
|
|
18
|
+
refs[name] = () => jsx;
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
const ref = (JSX.createElement("svg", { ...jsx.props, id: undefined },
|
|
22
|
+
JSX.createElement("use", { href: `${context.relativeURL("assets/icons.svg")}#icon-${name}` })));
|
|
23
|
+
refs[name] = () => ref;
|
|
24
|
+
}
|
|
25
|
+
return refs;
|
|
26
|
+
}
|
|
27
|
+
export function getIcons() {
|
|
28
|
+
return {
|
|
29
|
+
[ReflectionKind.Accessor]: () => textIcon("A", "var(--color-ts-accessor)", i18n.kind_accessor(), true),
|
|
30
|
+
[ReflectionKind.CallSignature]() {
|
|
31
|
+
return this[ReflectionKind.Function]();
|
|
32
|
+
},
|
|
33
|
+
[ReflectionKind.Class]: () => textIcon("C", "var(--color-ts-class)", i18n.kind_class()),
|
|
34
|
+
[ReflectionKind.Constructor]: () => textIcon("C", "var(--color-ts-constructor)", i18n.kind_constructor(), true),
|
|
35
|
+
[ReflectionKind.ConstructorSignature]() {
|
|
36
|
+
return this[ReflectionKind.Constructor]();
|
|
37
|
+
},
|
|
38
|
+
[ReflectionKind.Enum]: () => textIcon("E", "var(--color-ts-enum)", i18n.kind_enum()),
|
|
39
|
+
[ReflectionKind.EnumMember]: () => textIcon("P", "var(--color-ts-property)", i18n.kind_enum_member(), true),
|
|
40
|
+
[ReflectionKind.Function]: () => textIcon("F", "var(--color-ts-function)", i18n.kind_function()),
|
|
41
|
+
[ReflectionKind.GetSignature]() {
|
|
42
|
+
return this[ReflectionKind.Accessor]();
|
|
43
|
+
},
|
|
44
|
+
[ReflectionKind.IndexSignature]: () => textIcon("P", "var(--color-ts-property)", i18n.kind_index_signature(), true),
|
|
45
|
+
[ReflectionKind.Interface]: () => textIcon("I", "var(--color-ts-interface)", i18n.kind_interface()),
|
|
46
|
+
[ReflectionKind.Method]: () => textIcon("M", "var(--color-ts-method)", i18n.kind_method(), true),
|
|
47
|
+
[ReflectionKind.Module]: () => textIcon("M", "var(--color-ts-module)", i18n.kind_module()),
|
|
48
|
+
[ReflectionKind.Namespace]: () => textIcon("N", "var(--color-ts-namespace)", i18n.kind_namespace()),
|
|
49
|
+
[ReflectionKind.Parameter]() {
|
|
50
|
+
return this[ReflectionKind.Property]();
|
|
51
|
+
},
|
|
52
|
+
[ReflectionKind.Project]() {
|
|
53
|
+
return this[ReflectionKind.Module]();
|
|
54
|
+
},
|
|
55
|
+
[ReflectionKind.Property]: () => textIcon("P", "var(--color-ts-property)", i18n.kind_property(), true),
|
|
56
|
+
[ReflectionKind.Reference]: () => textIcon("R", "var(--color-ts-reference)", i18n.kind_reference(), true),
|
|
57
|
+
[ReflectionKind.SetSignature]() {
|
|
58
|
+
return this[ReflectionKind.Accessor]();
|
|
59
|
+
},
|
|
60
|
+
[ReflectionKind.TypeAlias]: () => textIcon("T", "var(--color-ts-type-alias)", i18n.kind_type_alias()),
|
|
61
|
+
[ReflectionKind.TypeLiteral]() {
|
|
62
|
+
return this[ReflectionKind.TypeAlias]();
|
|
63
|
+
},
|
|
64
|
+
[ReflectionKind.TypeParameter]() {
|
|
65
|
+
return this[ReflectionKind.TypeAlias]();
|
|
66
|
+
},
|
|
67
|
+
[ReflectionKind.Variable]: () => textIcon("V", "var(--color-ts-variable)", i18n.kind_variable()),
|
|
68
|
+
[ReflectionKind.Document]: () => kindIcon(JSX.createElement("g", { stroke: "var(--color-icon-text)", fill: "none", "stroke-width": "1.5" },
|
|
69
|
+
JSX.createElement("polygon", { points: "6,5 6,19 18,19, 18,10 13,5" }),
|
|
70
|
+
JSX.createElement("line", { x1: "9", y1: "9", x2: "13", y2: "9" }),
|
|
71
|
+
JSX.createElement("line", { x1: "9", y1: "12", x2: "15", y2: "12" }),
|
|
72
|
+
JSX.createElement("line", { x1: "9", y1: "15", x2: "15", y2: "15" })), "var(--color-document)", i18n.kind_document()),
|
|
73
|
+
folder: () => kindIcon(JSX.createElement("g", { stroke: "var(--color-icon-text)", fill: "none", "stroke-width": "1.5" },
|
|
74
|
+
JSX.createElement("polygon", { points: "5,5 10,5 12,8 19,8 19,18 5,18" })), "var(--color-document)", i18n.theme_folder()),
|
|
75
|
+
chevronDown: () => (JSX.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true" },
|
|
76
|
+
JSX.createElement("path", { d: "M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z", fill: "var(--color-icon-text)" }))),
|
|
77
|
+
chevronSmall: () => (JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" },
|
|
78
|
+
JSX.createElement("path", { d: "M1.5 5.50969L8 11.6609L14.5 5.50969L12.5466 3.66086L8 7.96494L3.45341 3.66086L1.5 5.50969Z", fill: "var(--color-icon-text)" }))),
|
|
79
|
+
checkbox: () => (JSX.createElement("svg", { width: "32", height: "32", viewBox: "0 0 32 32", "aria-hidden": "true" },
|
|
80
|
+
JSX.createElement("rect", { class: "tsd-checkbox-background", width: "30", height: "30", x: "1", y: "1", rx: "6", fill: "none" }),
|
|
81
|
+
JSX.createElement("path", { class: "tsd-checkbox-checkmark", d: "M8.35422 16.8214L13.2143 21.75L24.6458 10.25", stroke: "none", "stroke-width": "3.5", "stroke-linejoin": "round", fill: "none" }))),
|
|
82
|
+
menu: () => (JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" }, ["3", "7", "11"].map((y) => JSX.createElement("rect", { x: "1", y: y, width: "14", height: "2", fill: "var(--color-icon-text)" })))),
|
|
83
|
+
search: () => (JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" },
|
|
84
|
+
JSX.createElement("path", { d: "M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z", fill: "var(--color-icon-text)" }))),
|
|
85
|
+
anchor: () => (JSX.createElement("svg", { viewBox: "0 0 24 24", "aria-hidden": "true" },
|
|
86
|
+
JSX.createElement("g", { "stroke-width": "2", stroke: "currentColor", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round" },
|
|
87
|
+
JSX.createElement("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
|
|
88
|
+
JSX.createElement("path", { d: "M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5" }),
|
|
89
|
+
JSX.createElement("path", { d: "M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5" })))),
|
|
90
|
+
alertNote: () => (JSX.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": "true" },
|
|
91
|
+
JSX.createElement("path", { fill: "var(--color-alert-note)", d: "M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z" }))),
|
|
92
|
+
alertTip: () => (JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": "true" },
|
|
93
|
+
JSX.createElement("path", { fill: "var(--color-alert-tip)", d: "M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z" }))),
|
|
94
|
+
alertImportant: () => (JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": "true" },
|
|
95
|
+
JSX.createElement("path", { fill: "var(--color-alert-important)", d: "M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z" }))),
|
|
96
|
+
alertWarning: () => (JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": "true" },
|
|
97
|
+
JSX.createElement("path", { fill: "var(--color-alert-warning)", d: "M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z" }))),
|
|
98
|
+
alertCaution: () => (JSX.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": "true" },
|
|
99
|
+
JSX.createElement("path", { fill: "var(--color-alert-caution)", d: "M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z" }))),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
|
|
2
|
+
import { JSX } from "#utils";
|
|
3
|
+
import type { ContainerReflection } from "../../../../models/index.js";
|
|
4
|
+
export declare function index(context: DefaultThemeRenderContext, props: ContainerReflection): JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { classNames, getMemberSections, isNoneSection, renderName } from "../../lib.js";
|
|
2
|
+
import { i18n, JSX } from "#utils";
|
|
3
|
+
function renderSection({ urlTo, reflectionIcon, getReflectionClasses, markdown }, item) {
|
|
4
|
+
return (JSX.createElement("section", { class: "tsd-index-section" },
|
|
5
|
+
!isNoneSection(item) && JSX.createElement("h3", { class: "tsd-index-heading" }, item.title),
|
|
6
|
+
item.description && (JSX.createElement("div", { class: "tsd-comment tsd-typography" },
|
|
7
|
+
JSX.createElement(JSX.Raw, { html: markdown(item.description) }))),
|
|
8
|
+
JSX.createElement("div", { class: "tsd-index-list" }, item.children.map((item) => (JSX.createElement(JSX.Fragment, null,
|
|
9
|
+
JSX.createElement("a", { href: urlTo(item), class: classNames({ "tsd-index-link": true, deprecated: item.isDeprecated() }, getReflectionClasses(item)) },
|
|
10
|
+
reflectionIcon(item),
|
|
11
|
+
JSX.createElement("span", null, renderName(item))),
|
|
12
|
+
"\n"))))));
|
|
13
|
+
}
|
|
14
|
+
export function index(context, props) {
|
|
15
|
+
const sections = getMemberSections(props);
|
|
16
|
+
return (JSX.createElement(JSX.Fragment, null,
|
|
17
|
+
JSX.createElement("section", { class: "tsd-panel-group tsd-index-group" },
|
|
18
|
+
JSX.createElement("section", { class: "tsd-panel tsd-index-panel" },
|
|
19
|
+
JSX.createElement("details", { class: "tsd-index-content tsd-accordion", open: true },
|
|
20
|
+
JSX.createElement("summary", { class: "tsd-accordion-summary tsd-index-summary" },
|
|
21
|
+
context.icons.chevronDown(),
|
|
22
|
+
JSX.createElement("h5", { class: "tsd-index-heading uppercase" }, i18n.theme_index())),
|
|
23
|
+
JSX.createElement("div", { class: "tsd-accordion-details" }, sections.map(s => renderSection(context, s))))))));
|
|
24
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
|
|
2
|
+
import { JSX } from "#utils";
|
|
3
|
+
import { type DeclarationReflection, type DocumentReflection } from "../../../../models/index.js";
|
|
4
|
+
export declare function member(context: DefaultThemeRenderContext, props: DeclarationReflection | DocumentReflection): JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DeclarationReflection } from "#models";
|
|
2
|
+
import { JSX } from "#utils";
|
|
3
|
+
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
|
|
4
|
+
export declare function memberDeclaration(context: DefaultThemeRenderContext, props: DeclarationReflection): JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { JSX } from "#utils";
|
|
2
|
+
import { FormattedCodeBuilder, FormattedCodeGenerator, Wrap } from "../../../formatter.js";
|
|
3
|
+
import { hasTypeParameters } from "../../lib.js";
|
|
4
|
+
function shouldRenderDefaultValue(props) {
|
|
5
|
+
const defaultValue = props.defaultValue;
|
|
6
|
+
if (defaultValue === undefined) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
/** Fix for #2717. If type is the same as value the default value is omitted */
|
|
10
|
+
if (props.type && props.type.type === "literal") {
|
|
11
|
+
const reflectionTypeString = props.type.toString();
|
|
12
|
+
if (reflectionTypeString === defaultValue) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
export function memberDeclaration(context, props) {
|
|
19
|
+
const builder = new FormattedCodeBuilder(context.router, context.model);
|
|
20
|
+
const content = [];
|
|
21
|
+
builder.member(content, props, { topLevelLinks: false });
|
|
22
|
+
const generator = new FormattedCodeGenerator(context.options.getValue("typePrintWidth"));
|
|
23
|
+
generator.node({ type: "nodes", content }, Wrap.Detect);
|
|
24
|
+
return (JSX.createElement(JSX.Fragment, null,
|
|
25
|
+
JSX.createElement("div", { class: "tsd-signature" },
|
|
26
|
+
generator.toElement(),
|
|
27
|
+
shouldRenderDefaultValue(props) && (JSX.createElement("span", { class: "tsd-signature-symbol" },
|
|
28
|
+
" = ",
|
|
29
|
+
props.defaultValue))),
|
|
30
|
+
context.commentSummary(props),
|
|
31
|
+
hasTypeParameters(props) && context.typeParameters(props.typeParameters),
|
|
32
|
+
props.type && context.typeDeclaration(props, props.type),
|
|
33
|
+
context.commentTags(props),
|
|
34
|
+
context.memberSources(props)));
|
|
35
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DeclarationReflection } from "../../../../models/index.js";
|
|
2
|
+
import { JSX } from "#utils";
|
|
3
|
+
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
|
|
4
|
+
export declare const memberGetterSetter: (context: DefaultThemeRenderContext, props: DeclarationReflection) => JSX.Element;
|