typedoc 0.26.11 → 0.27.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/package.json +3 -0
- package/bin/typedoc +1 -1
- package/dist/index.d.ts +23 -13
- package/dist/index.js +22 -81
- package/dist/lib/application-events.js +1 -4
- package/dist/lib/application.d.ts +26 -16
- package/dist/lib/application.js +222 -242
- package/dist/lib/cli.js +3 -40
- package/dist/lib/converter/comments/blockLexer.d.ts +1 -1
- package/dist/lib/converter/comments/blockLexer.js +24 -30
- package/dist/lib/converter/comments/declarationReference.js +10 -21
- package/dist/lib/converter/comments/declarationReferenceResolver.d.ts +2 -2
- package/dist/lib/converter/comments/declarationReferenceResolver.js +40 -36
- package/dist/lib/converter/comments/discovery.d.ts +4 -4
- package/dist/lib/converter/comments/discovery.js +154 -172
- package/dist/lib/converter/comments/index.d.ts +4 -4
- package/dist/lib/converter/comments/index.js +39 -50
- package/dist/lib/converter/comments/lexer.d.ts +1 -1
- package/dist/lib/converter/comments/lexer.js +2 -5
- package/dist/lib/converter/comments/lineLexer.d.ts +1 -1
- package/dist/lib/converter/comments/lineLexer.js +12 -15
- package/dist/lib/converter/comments/linkResolver.d.ts +2 -2
- package/dist/lib/converter/comments/linkResolver.js +14 -21
- package/dist/lib/converter/comments/parser.d.ts +6 -6
- package/dist/lib/converter/comments/parser.js +69 -96
- package/dist/lib/converter/comments/rawLexer.d.ts +1 -1
- package/dist/lib/converter/comments/rawLexer.js +13 -16
- package/dist/lib/converter/comments/tagName.js +1 -4
- package/dist/lib/converter/comments/textParser.d.ts +4 -4
- package/dist/lib/converter/comments/textParser.js +28 -30
- package/dist/lib/converter/components.d.ts +2 -3
- package/dist/lib/converter/components.js +2 -7
- package/dist/lib/converter/context.d.ts +9 -9
- package/dist/lib/converter/context.js +54 -44
- package/dist/lib/converter/convert-expression.js +16 -23
- package/dist/lib/converter/converter-events.d.ts +1 -0
- package/dist/lib/converter/converter-events.js +2 -4
- package/dist/lib/converter/converter.d.ts +16 -13
- package/dist/lib/converter/converter.js +212 -239
- package/dist/lib/converter/factories/index-signature.d.ts +3 -3
- package/dist/lib/converter/factories/index-signature.js +43 -26
- package/dist/lib/converter/factories/signature.d.ts +2 -2
- package/dist/lib/converter/factories/signature.js +95 -106
- package/dist/lib/converter/index.d.ts +6 -7
- package/dist/lib/converter/index.js +3 -11
- package/dist/lib/converter/jsdoc.d.ts +1 -1
- package/dist/lib/converter/jsdoc.js +34 -41
- package/dist/lib/converter/plugins/CategoryPlugin.d.ts +6 -21
- package/dist/lib/converter/plugins/CategoryPlugin.js +57 -139
- package/dist/lib/converter/plugins/CommentPlugin.d.ts +3 -5
- package/dist/lib/converter/plugins/CommentPlugin.js +153 -163
- package/dist/lib/converter/plugins/GroupPlugin.d.ts +10 -9
- package/dist/lib/converter/plugins/GroupPlugin.js +87 -124
- package/dist/lib/converter/plugins/ImplementsPlugin.d.ts +3 -5
- package/dist/lib/converter/plugins/ImplementsPlugin.js +255 -321
- package/dist/lib/converter/plugins/IncludePlugin.d.ts +11 -0
- package/dist/lib/converter/plugins/IncludePlugin.js +72 -0
- package/dist/lib/converter/plugins/InheritDocPlugin.d.ts +4 -3
- package/dist/lib/converter/plugins/InheritDocPlugin.js +41 -72
- package/dist/lib/converter/plugins/LinkResolverPlugin.d.ts +5 -5
- package/dist/lib/converter/plugins/LinkResolverPlugin.js +37 -58
- package/dist/lib/converter/plugins/MergeModuleWithPlugin.d.ts +12 -0
- package/dist/lib/converter/plugins/MergeModuleWithPlugin.js +49 -0
- package/dist/lib/converter/plugins/PackagePlugin.d.ts +4 -3
- package/dist/lib/converter/plugins/PackagePlugin.js +62 -111
- package/dist/lib/converter/plugins/SourcePlugin.d.ts +3 -5
- package/dist/lib/converter/plugins/SourcePlugin.js +69 -110
- package/dist/lib/converter/plugins/TypePlugin.d.ts +4 -6
- package/dist/lib/converter/plugins/TypePlugin.js +95 -158
- package/dist/lib/converter/plugins/index.d.ts +10 -9
- package/dist/lib/converter/plugins/index.js +10 -21
- package/dist/lib/converter/symbols.d.ts +1 -1
- package/dist/lib/converter/symbols.js +234 -227
- package/dist/lib/converter/types.d.ts +2 -2
- package/dist/lib/converter/types.js +252 -237
- package/dist/lib/converter/utils/nodes.js +5 -13
- package/dist/lib/converter/utils/reflections.d.ts +1 -1
- package/dist/lib/converter/utils/reflections.js +4 -7
- package/dist/lib/converter/utils/repository.d.ts +1 -1
- package/dist/lib/converter/utils/repository.js +103 -97
- package/dist/lib/converter/utils/symbols.js +3 -9
- package/dist/lib/internationalization/index.d.ts +3 -4
- package/dist/lib/internationalization/index.js +3 -8
- package/dist/lib/internationalization/internationalization.d.ts +5 -4
- package/dist/lib/internationalization/internationalization.js +97 -103
- package/dist/lib/internationalization/locale-utils.cjs +8 -0
- package/dist/lib/internationalization/locale-utils.d.cts +8 -0
- package/dist/lib/internationalization/locales/en.cjs +372 -2
- package/dist/lib/internationalization/locales/en.d.cts +343 -2
- package/dist/lib/internationalization/locales/jp.cjs +13 -14
- package/dist/lib/internationalization/locales/jp.d.cts +307 -1
- package/dist/lib/internationalization/locales/ko.cjs +12 -11
- package/dist/lib/internationalization/locales/ko.d.cts +221 -1
- package/dist/lib/internationalization/locales/zh.cjs +43 -19
- package/dist/lib/internationalization/locales/zh.d.cts +409 -1
- package/dist/lib/internationalization/translatable.d.ts +4 -327
- package/dist/lib/internationalization/translatable.js +2 -360
- package/dist/lib/models/FileRegistry.d.ts +20 -9
- package/dist/lib/models/FileRegistry.js +54 -45
- package/dist/lib/models/ReflectionCategory.d.ts +2 -2
- package/dist/lib/models/ReflectionCategory.js +16 -12
- package/dist/lib/models/ReflectionGroup.d.ts +3 -3
- package/dist/lib/models/ReflectionGroup.js +23 -14
- package/dist/lib/models/comments/comment.d.ts +23 -37
- package/dist/lib/models/comments/comment.js +388 -325
- package/dist/lib/models/comments/index.d.ts +2 -2
- package/dist/lib/models/comments/index.js +1 -6
- package/dist/lib/models/index.d.ts +7 -7
- package/dist/lib/models/index.js +7 -23
- package/dist/lib/models/reflections/ReflectionSymbolId.d.ts +2 -2
- package/dist/lib/models/reflections/ReflectionSymbolId.js +42 -34
- package/dist/lib/models/reflections/abstract.d.ts +17 -20
- package/dist/lib/models/reflections/abstract.js +249 -256
- package/dist/lib/models/reflections/container.d.ts +7 -7
- package/dist/lib/models/reflections/container.js +43 -16
- package/dist/lib/models/reflections/declaration.d.ts +15 -12
- package/dist/lib/models/reflections/declaration.js +150 -29
- package/dist/lib/models/reflections/document.d.ts +3 -3
- package/dist/lib/models/reflections/document.js +26 -13
- package/dist/lib/models/reflections/index.d.ts +15 -15
- package/dist/lib/models/reflections/index.js +12 -31
- package/dist/lib/models/reflections/kind.d.ts +1 -1
- package/dist/lib/models/reflections/kind.js +3 -6
- package/dist/lib/models/reflections/parameter.d.ts +5 -4
- package/dist/lib/models/reflections/parameter.js +11 -13
- package/dist/lib/models/reflections/project.d.ts +14 -9
- package/dist/lib/models/reflections/project.js +104 -56
- package/dist/lib/models/reflections/reference.d.ts +3 -3
- package/dist/lib/models/reflections/reference.js +6 -9
- package/dist/lib/models/reflections/signature.d.ts +8 -8
- package/dist/lib/models/reflections/signature.js +35 -14
- package/dist/lib/models/reflections/type-parameter.d.ts +5 -5
- package/dist/lib/models/reflections/type-parameter.js +9 -10
- package/dist/lib/models/reflections/utils.js +1 -4
- package/dist/lib/models/reflections/variant.d.ts +8 -7
- package/dist/lib/models/reflections/variant.js +1 -2
- package/dist/lib/models/sources/file.d.ts +2 -2
- package/dist/lib/models/sources/file.js +22 -5
- package/dist/lib/models/sources/index.d.ts +1 -1
- package/dist/lib/models/sources/index.js +1 -5
- package/dist/lib/models/types.d.ts +29 -16
- package/dist/lib/models/types.js +236 -151
- package/dist/lib/output/components.d.ts +5 -11
- package/dist/lib/output/components.js +84 -125
- package/dist/lib/output/events.d.ts +3 -3
- package/dist/lib/output/events.js +128 -94
- package/dist/lib/output/formatter.d.ts +84 -0
- package/dist/lib/output/formatter.js +624 -0
- package/dist/lib/output/index.d.ts +9 -8
- package/dist/lib/output/index.js +7 -19
- package/dist/lib/output/models/UrlMapping.d.ts +2 -2
- package/dist/lib/output/models/UrlMapping.js +4 -5
- package/dist/lib/output/output.d.ts +14 -0
- package/dist/lib/output/output.js +91 -0
- package/dist/lib/output/plugins/AssetsPlugin.d.ts +9 -8
- package/dist/lib/output/plugins/AssetsPlugin.js +64 -80
- package/dist/lib/output/plugins/HierarchyPlugin.d.ts +7 -0
- package/dist/lib/output/plugins/HierarchyPlugin.js +67 -0
- package/dist/lib/output/plugins/IconsPlugin.d.ts +3 -2
- package/dist/lib/output/plugins/IconsPlugin.js +28 -84
- package/dist/lib/output/plugins/JavascriptIndexPlugin.d.ts +9 -2
- package/dist/lib/output/plugins/JavascriptIndexPlugin.js +90 -96
- package/dist/lib/output/plugins/NavigationPlugin.d.ts +3 -2
- package/dist/lib/output/plugins/NavigationPlugin.js +22 -102
- package/dist/lib/output/plugins/SitemapPlugin.d.ts +3 -2
- package/dist/lib/output/plugins/SitemapPlugin.js +60 -120
- package/dist/lib/output/plugins/index.d.ts +7 -6
- package/dist/lib/output/plugins/index.js +7 -15
- package/dist/lib/output/renderer.d.ts +14 -13
- package/dist/lib/output/renderer.js +130 -185
- package/dist/lib/output/theme.d.ts +9 -5
- package/dist/lib/output/theme.js +14 -62
- package/dist/lib/output/themes/MarkedPlugin.d.ts +8 -9
- package/dist/lib/output/themes/MarkedPlugin.js +152 -117
- package/dist/lib/output/themes/default/DefaultTheme.d.ts +17 -29
- package/dist/lib/output/themes/default/DefaultTheme.js +334 -310
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +63 -48
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +119 -95
- package/dist/lib/output/themes/default/Slugger.d.ts +13 -0
- package/dist/lib/output/themes/default/Slugger.js +46 -0
- package/dist/lib/output/themes/default/layouts/default.d.ts +5 -5
- package/dist/lib/output/themes/default/layouts/default.js +48 -36
- package/dist/lib/output/themes/default/partials/anchor-icon.d.ts +2 -2
- package/dist/lib/output/themes/default/partials/anchor-icon.js +4 -7
- package/dist/lib/output/themes/default/partials/breadcrumb.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/breadcrumb.js +4 -8
- package/dist/lib/output/themes/default/partials/comment.d.ts +6 -4
- package/dist/lib/output/themes/default/partials/comment.js +52 -29
- package/dist/lib/output/themes/default/partials/footer.d.ts +2 -2
- package/dist/lib/output/themes/default/partials/footer.js +11 -14
- package/dist/lib/output/themes/default/partials/header.d.ts +4 -4
- package/dist/lib/output/themes/default/partials/header.js +9 -13
- package/dist/lib/output/themes/default/partials/hierarchy.d.ts +4 -4
- package/dist/lib/output/themes/default/partials/hierarchy.js +12 -15
- package/dist/lib/output/themes/default/partials/icon.d.ts +4 -4
- package/dist/lib/output/themes/default/partials/icon.js +78 -73
- package/dist/lib/output/themes/default/partials/index.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/index.js +19 -22
- package/dist/lib/output/themes/default/partials/member.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.declaration.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.declaration.js +18 -61
- package/dist/lib/output/themes/default/partials/member.getterSetter.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.getterSetter.js +10 -26
- package/dist/lib/output/themes/default/partials/member.js +19 -24
- package/dist/lib/output/themes/default/partials/member.signature.body.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.signature.body.js +17 -21
- package/dist/lib/output/themes/default/partials/member.signature.title.d.ts +4 -7
- package/dist/lib/output/themes/default/partials/member.signature.title.js +8 -35
- package/dist/lib/output/themes/default/partials/member.signatures.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.signatures.js +9 -13
- package/dist/lib/output/themes/default/partials/member.sources.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.sources.js +13 -17
- package/dist/lib/output/themes/default/partials/members.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/members.js +10 -42
- package/dist/lib/output/themes/default/partials/moduleReflection.d.ts +5 -0
- package/dist/lib/output/themes/default/partials/moduleReflection.js +62 -0
- package/dist/lib/output/themes/default/partials/navigation.d.ts +4 -4
- package/dist/lib/output/themes/default/partials/navigation.js +51 -62
- package/dist/lib/output/themes/default/partials/reflectionPreview.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/reflectionPreview.js +12 -15
- package/dist/lib/output/themes/default/partials/toolbar.d.ts +4 -4
- package/dist/lib/output/themes/default/partials/toolbar.js +16 -20
- package/dist/lib/output/themes/default/partials/type.d.ts +4 -6
- package/dist/lib/output/themes/default/partials/type.js +8 -388
- package/dist/lib/output/themes/default/partials/typeAndParent.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/typeAndParent.js +11 -15
- package/dist/lib/output/themes/default/partials/typeDetails.d.ts +8 -0
- package/dist/lib/output/themes/default/partials/typeDetails.js +222 -0
- package/dist/lib/output/themes/default/partials/typeParameters.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/typeParameters.js +14 -17
- package/dist/lib/output/themes/default/templates/document.d.ts +4 -4
- package/dist/lib/output/themes/default/templates/document.js +3 -7
- package/dist/lib/output/themes/default/templates/hierarchy.d.ts +4 -4
- package/dist/lib/output/themes/default/templates/hierarchy.js +24 -22
- package/dist/lib/output/themes/default/templates/index.d.ts +4 -4
- package/dist/lib/output/themes/default/templates/index.js +3 -7
- package/dist/lib/output/themes/default/templates/reflection.d.ts +4 -4
- package/dist/lib/output/themes/default/templates/reflection.js +32 -34
- package/dist/lib/output/themes/lib.d.ts +17 -3
- package/dist/lib/output/themes/lib.js +118 -50
- package/dist/lib/serialization/components.d.ts +2 -5
- package/dist/lib/serialization/components.js +1 -2
- package/dist/lib/serialization/deserializer.d.ts +21 -7
- package/dist/lib/serialization/deserializer.js +138 -123
- package/dist/lib/serialization/events.d.ts +2 -2
- package/dist/lib/serialization/events.js +6 -5
- package/dist/lib/serialization/index.d.ts +5 -5
- package/dist/lib/serialization/index.js +4 -33
- package/dist/lib/serialization/schema.d.ts +8 -2
- package/dist/lib/serialization/schema.js +2 -2
- package/dist/lib/serialization/serializer.d.ts +11 -5
- package/dist/lib/serialization/serializer.js +32 -25
- package/dist/lib/utils/array.d.ts +3 -0
- package/dist/lib/utils/array.js +26 -27
- package/dist/lib/utils/component.d.ts +2 -44
- package/dist/lib/utils/component.js +10 -102
- package/dist/lib/utils/entry-point.d.ts +3 -4
- package/dist/lib/utils/entry-point.js +114 -85
- package/dist/lib/utils/enum.js +6 -14
- package/dist/lib/utils/events.js +6 -12
- package/dist/lib/utils/fs.js +50 -91
- package/dist/lib/utils/general.d.ts +2 -1
- package/dist/lib/utils/general.js +50 -40
- package/dist/lib/utils/highlighter.js +30 -57
- package/dist/lib/utils/hooks.js +7 -13
- package/dist/lib/utils/html-entities.d.ts +8926 -0
- package/dist/lib/utils/html-entities.js +2329 -0
- package/dist/lib/utils/html.d.ts +8 -0
- package/dist/lib/utils/html.js +81 -34
- package/dist/lib/utils/index.d.ts +22 -22
- package/dist/lib/utils/index.js +20 -91
- package/dist/lib/utils/jsx.d.ts +12 -6
- package/dist/lib/utils/jsx.elements.d.ts +1 -1
- package/dist/lib/utils/jsx.elements.js +3 -4
- package/dist/lib/utils/jsx.js +82 -52
- package/dist/lib/utils/loggers.d.ts +3 -3
- package/dist/lib/utils/loggers.js +36 -46
- package/dist/lib/utils/map.js +6 -13
- package/dist/lib/utils/minimalSourceFile.js +5 -7
- package/dist/lib/utils/options/declaration.d.ts +35 -7
- package/dist/lib/utils/options/declaration.js +20 -22
- package/dist/lib/utils/options/defaults.d.ts +3 -2
- package/dist/lib/utils/options/defaults.js +18 -38
- package/dist/lib/utils/options/help.d.ts +2 -2
- package/dist/lib/utils/options/help.js +7 -10
- package/dist/lib/utils/options/index.d.ts +6 -6
- package/dist/lib/utils/options/index.js +4 -18
- package/dist/lib/utils/options/options.d.ts +8 -5
- package/dist/lib/utils/options/options.js +47 -71
- package/dist/lib/utils/options/readers/arguments.d.ts +2 -2
- package/dist/lib/utils/options/readers/arguments.js +15 -17
- package/dist/lib/utils/options/readers/index.d.ts +4 -4
- package/dist/lib/utils/options/readers/index.js +4 -11
- package/dist/lib/utils/options/readers/package-json.d.ts +3 -3
- package/dist/lib/utils/options/readers/package-json.js +15 -21
- package/dist/lib/utils/options/readers/tsconfig.d.ts +2 -2
- package/dist/lib/utils/options/readers/tsconfig.js +54 -63
- package/dist/lib/utils/options/readers/typedoc.d.ts +3 -3
- package/dist/lib/utils/options/readers/typedoc.js +44 -76
- package/dist/lib/utils/options/sources/index.d.ts +1 -1
- package/dist/lib/utils/options/sources/index.js +1 -5
- package/dist/lib/utils/options/sources/typedoc.d.ts +1 -1
- package/dist/lib/utils/options/sources/typedoc.js +232 -196
- package/dist/lib/utils/options/tsdoc-defaults.d.ts +3 -3
- package/dist/lib/utils/options/tsdoc-defaults.js +16 -12
- package/dist/lib/utils/package-manifest.d.ts +1 -1
- package/dist/lib/utils/package-manifest.js +15 -19
- package/dist/lib/utils/paths.js +9 -15
- package/dist/lib/utils/perf.js +6 -11
- package/dist/lib/utils/plugins.d.ts +1 -1
- package/dist/lib/utils/plugins.js +7 -10
- package/dist/lib/utils/reflections.d.ts +1 -1
- package/dist/lib/utils/reflections.js +9 -12
- package/dist/lib/utils/set.js +2 -6
- package/dist/lib/utils/sort.d.ts +3 -3
- package/dist/lib/utils/sort.js +20 -24
- package/dist/lib/utils/tsconfig.d.ts +1 -1
- package/dist/lib/utils/tsconfig.js +13 -21
- package/dist/lib/utils/tsutils.d.ts +1 -1
- package/dist/lib/utils/tsutils.js +3 -30
- package/dist/lib/utils/validation.js +6 -12
- package/dist/lib/validation/documentation.d.ts +2 -2
- package/dist/lib/validation/documentation.js +26 -29
- package/dist/lib/validation/exports.d.ts +2 -2
- package/dist/lib/validation/exports.js +9 -11
- package/dist/lib/validation/links.d.ts +2 -2
- package/dist/lib/validation/links.js +4 -7
- package/dist/lib/validation/unusedMergeModuleWith.d.ts +3 -0
- package/dist/lib/validation/unusedMergeModuleWith.js +11 -0
- package/package.json +17 -14
- package/static/main.js +4 -4
- package/static/style.css +109 -17
- package/tsdoc.json +30 -0
- package/dist/lib/output/themes/default/partials/member.reference.d.ts +0 -4
- package/dist/lib/output/themes/default/partials/member.reference.js +0 -30
- package/dist/lib/output/themes/default/partials/parameter.d.ts +0 -4
- package/dist/lib/output/themes/default/partials/parameter.js +0 -79
- package/dist/lib/utils/html-entities.json +0 -2326
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { ReflectionKind, } from "../../../../models/index.js";
|
|
2
|
+
import { JSX } from "../../../../utils/index.js";
|
|
3
|
+
import { classNames, getKindClass } from "../../lib.js";
|
|
4
|
+
const isUsefulVisitor = {
|
|
5
|
+
array(type) {
|
|
6
|
+
return renderingTypeDetailsIsUseful(type.elementType);
|
|
7
|
+
},
|
|
8
|
+
intersection(type) {
|
|
9
|
+
return type.types.some(renderingTypeDetailsIsUseful);
|
|
10
|
+
},
|
|
11
|
+
union(type) {
|
|
12
|
+
return !!type.elementSummaries || type.types.some(renderingTypeDetailsIsUseful);
|
|
13
|
+
},
|
|
14
|
+
reflection(type) {
|
|
15
|
+
return renderingChildIsUseful(type.declaration);
|
|
16
|
+
},
|
|
17
|
+
reference(type) {
|
|
18
|
+
return shouldExpandReference(type);
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
function renderingTypeDetailsIsUseful(type) {
|
|
22
|
+
return type.visit(isUsefulVisitor) ?? false;
|
|
23
|
+
}
|
|
24
|
+
export function typeDeclaration(context, type) {
|
|
25
|
+
if (renderingTypeDetailsIsUseful(type)) {
|
|
26
|
+
return (JSX.createElement("div", { class: "tsd-type-declaration" },
|
|
27
|
+
JSX.createElement("h4", null, context.i18n.theme_type_declaration()),
|
|
28
|
+
context.typeDetails(type, true)));
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
const expanded = new Set();
|
|
33
|
+
function shouldExpandReference(reference) {
|
|
34
|
+
const target = reference.reflection;
|
|
35
|
+
if (reference.highlightedProperties) {
|
|
36
|
+
return !target || expanded.has(target) === false;
|
|
37
|
+
}
|
|
38
|
+
if (!target?.kindOf(ReflectionKind.TypeAlias | ReflectionKind.Interface))
|
|
39
|
+
return false;
|
|
40
|
+
if (!target.comment?.hasModifier("@expand"))
|
|
41
|
+
return false;
|
|
42
|
+
return expanded.has(target) === false;
|
|
43
|
+
}
|
|
44
|
+
export function typeDetails(context, type, renderAnchors) {
|
|
45
|
+
return typeDetailsImpl(context, type, renderAnchors);
|
|
46
|
+
}
|
|
47
|
+
export function typeDetailsImpl(context, type, renderAnchors, highlighted) {
|
|
48
|
+
const result = type.visit({
|
|
49
|
+
array(type) {
|
|
50
|
+
return context.typeDetails(type.elementType, renderAnchors);
|
|
51
|
+
},
|
|
52
|
+
intersection(type) {
|
|
53
|
+
return type.types.map((t) => context.typeDetails(t, renderAnchors));
|
|
54
|
+
},
|
|
55
|
+
union(type) {
|
|
56
|
+
const result = [];
|
|
57
|
+
for (let i = 0; i < type.types.length; ++i) {
|
|
58
|
+
result.push(JSX.createElement("li", null,
|
|
59
|
+
context.type(type.types[i]),
|
|
60
|
+
context.displayParts(type.elementSummaries?.[i]),
|
|
61
|
+
context.typeDetailsIfUseful(type.types[i])));
|
|
62
|
+
}
|
|
63
|
+
return JSX.createElement("ul", null, result);
|
|
64
|
+
},
|
|
65
|
+
reflection(type) {
|
|
66
|
+
const declaration = type.declaration;
|
|
67
|
+
if (highlighted) {
|
|
68
|
+
return highlightedDeclarationDetails(context, declaration, renderAnchors, highlighted);
|
|
69
|
+
}
|
|
70
|
+
return declarationDetails(context, declaration, renderAnchors);
|
|
71
|
+
},
|
|
72
|
+
reference(reference) {
|
|
73
|
+
if (shouldExpandReference(reference)) {
|
|
74
|
+
const target = reference.reflection;
|
|
75
|
+
if (!target?.isDeclaration()) {
|
|
76
|
+
return highlightedPropertyDetails(context, reference.highlightedProperties);
|
|
77
|
+
}
|
|
78
|
+
// Ensure we don't go into an infinite loop here
|
|
79
|
+
expanded.add(target);
|
|
80
|
+
const details = target.type
|
|
81
|
+
? context.typeDetails(target.type, renderAnchors)
|
|
82
|
+
: declarationDetails(context, target, renderAnchors);
|
|
83
|
+
expanded.delete(target);
|
|
84
|
+
return details;
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
// tuple??
|
|
88
|
+
});
|
|
89
|
+
if (!result && highlighted) {
|
|
90
|
+
return highlightedPropertyDetails(context, highlighted);
|
|
91
|
+
}
|
|
92
|
+
return result;
|
|
93
|
+
}
|
|
94
|
+
export function typeDetailsIfUseful(context, type) {
|
|
95
|
+
if (type && renderingTypeDetailsIsUseful(type)) {
|
|
96
|
+
return context.typeDetails(type, false);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function highlightedPropertyDetails(context, highlighted) {
|
|
100
|
+
if (!highlighted?.size)
|
|
101
|
+
return;
|
|
102
|
+
return (JSX.createElement("ul", { class: "tsd-parameters" }, Array.from(highlighted.entries(), ([name, parts]) => {
|
|
103
|
+
return (JSX.createElement("li", { class: "tsd-parameter" },
|
|
104
|
+
JSX.createElement("h5", null,
|
|
105
|
+
JSX.createElement("span", null, name)),
|
|
106
|
+
context.displayParts(parts)));
|
|
107
|
+
})));
|
|
108
|
+
}
|
|
109
|
+
function highlightedDeclarationDetails(context, declaration, renderAnchors, highlightedProperties) {
|
|
110
|
+
return (JSX.createElement("ul", { class: "tsd-parameters" }, declaration
|
|
111
|
+
.getProperties()
|
|
112
|
+
?.map((child) => highlightedProperties?.has(child.name) &&
|
|
113
|
+
renderChild(context, child, renderAnchors, highlightedProperties.get(child.name)))));
|
|
114
|
+
}
|
|
115
|
+
function declarationDetails(context, declaration, renderAnchors) {
|
|
116
|
+
return (JSX.createElement(JSX.Fragment, null,
|
|
117
|
+
context.commentSummary(declaration),
|
|
118
|
+
JSX.createElement("ul", { class: "tsd-parameters" },
|
|
119
|
+
declaration.signatures && (JSX.createElement("li", { class: "tsd-parameter-signature" },
|
|
120
|
+
JSX.createElement("ul", { class: classNames({ "tsd-signatures": true }, context.getReflectionClasses(declaration)) }, declaration.signatures.map((item) => (JSX.createElement(JSX.Fragment, null,
|
|
121
|
+
JSX.createElement("li", { class: "tsd-signature", id: item.anchor }, context.memberSignatureTitle(item, {
|
|
122
|
+
hideName: true,
|
|
123
|
+
})),
|
|
124
|
+
JSX.createElement("li", { class: "tsd-description" }, context.memberSignatureBody(item, {
|
|
125
|
+
hideSources: true,
|
|
126
|
+
})))))))),
|
|
127
|
+
declaration.indexSignatures?.map((index) => renderIndexSignature(context, index)),
|
|
128
|
+
declaration.getProperties()?.map((child) => renderChild(context, child, renderAnchors)))));
|
|
129
|
+
}
|
|
130
|
+
function renderChild(context, child, renderAnchors, highlight) {
|
|
131
|
+
if (child.signatures) {
|
|
132
|
+
return (JSX.createElement("li", { class: "tsd-parameter" },
|
|
133
|
+
JSX.createElement("h5", null,
|
|
134
|
+
!!child.flags.isRest && JSX.createElement("span", { class: "tsd-signature-symbol" }, "..."),
|
|
135
|
+
JSX.createElement("span", { class: getKindClass(child) }, child.name),
|
|
136
|
+
JSX.createElement("a", { id: child.anchor, class: "tsd-anchor" }),
|
|
137
|
+
JSX.createElement("span", { class: "tsd-signature-symbol" },
|
|
138
|
+
!!child.flags.isOptional && "?",
|
|
139
|
+
":"),
|
|
140
|
+
"function"),
|
|
141
|
+
context.memberSignatures(child)));
|
|
142
|
+
}
|
|
143
|
+
function highlightOrComment(refl) {
|
|
144
|
+
if (highlight) {
|
|
145
|
+
return context.displayParts(highlight);
|
|
146
|
+
}
|
|
147
|
+
return (JSX.createElement(JSX.Fragment, null,
|
|
148
|
+
context.commentSummary(refl),
|
|
149
|
+
context.commentTags(refl)));
|
|
150
|
+
}
|
|
151
|
+
// standard type
|
|
152
|
+
if (child.type) {
|
|
153
|
+
return (JSX.createElement("li", { class: "tsd-parameter" },
|
|
154
|
+
JSX.createElement("h5", null,
|
|
155
|
+
context.reflectionFlags(child),
|
|
156
|
+
!!child.flags.isRest && JSX.createElement("span", { class: "tsd-signature-symbol" }, "..."),
|
|
157
|
+
JSX.createElement("span", { class: getKindClass(child) }, child.name),
|
|
158
|
+
JSX.createElement("a", { id: child.anchor, class: "tsd-anchor" }),
|
|
159
|
+
JSX.createElement("span", { class: "tsd-signature-symbol" },
|
|
160
|
+
!!child.flags.isOptional && "?",
|
|
161
|
+
": "),
|
|
162
|
+
context.type(child.type)),
|
|
163
|
+
highlightOrComment(child),
|
|
164
|
+
child.getProperties().some(renderingChildIsUseful) && (JSX.createElement("ul", { class: "tsd-parameters" }, child.getProperties().map((c) => renderChild(context, c, renderAnchors))))));
|
|
165
|
+
}
|
|
166
|
+
// getter/setter
|
|
167
|
+
return (JSX.createElement(JSX.Fragment, null,
|
|
168
|
+
child.getSignature && (JSX.createElement("li", { class: "tsd-parameter" },
|
|
169
|
+
JSX.createElement("h5", null,
|
|
170
|
+
context.reflectionFlags(child.getSignature),
|
|
171
|
+
JSX.createElement("span", { class: "tsd-signature-keyword" }, "get "),
|
|
172
|
+
JSX.createElement("span", { class: getKindClass(child) }, child.name),
|
|
173
|
+
JSX.createElement("a", { id: child.anchor, class: "tsd-anchor" }),
|
|
174
|
+
JSX.createElement("span", { class: "tsd-signature-symbol" }, "(): "),
|
|
175
|
+
context.type(child.getSignature.type)),
|
|
176
|
+
highlightOrComment(child.getSignature))),
|
|
177
|
+
child.setSignature && (JSX.createElement("li", { class: "tsd-parameter" },
|
|
178
|
+
JSX.createElement("h5", null,
|
|
179
|
+
context.reflectionFlags(child.setSignature),
|
|
180
|
+
JSX.createElement("span", { class: "tsd-signature-keyword" }, "set "),
|
|
181
|
+
JSX.createElement("span", { class: getKindClass(child) }, child.name),
|
|
182
|
+
!child.getSignature && JSX.createElement("a", { id: child.anchor, class: "tsd-anchor" }),
|
|
183
|
+
JSX.createElement("span", { class: "tsd-signature-symbol" }, "("),
|
|
184
|
+
child.setSignature.parameters?.map((item) => (JSX.createElement(JSX.Fragment, null,
|
|
185
|
+
item.name,
|
|
186
|
+
JSX.createElement("span", { class: "tsd-signature-symbol" }, ": "),
|
|
187
|
+
context.type(item.type)))),
|
|
188
|
+
JSX.createElement("span", { class: "tsd-signature-symbol" }, "): "),
|
|
189
|
+
context.type(child.setSignature.type)),
|
|
190
|
+
highlightOrComment(child.setSignature)))));
|
|
191
|
+
}
|
|
192
|
+
function renderIndexSignature(context, index) {
|
|
193
|
+
return (JSX.createElement("li", { class: "tsd-parameter-index-signature" },
|
|
194
|
+
JSX.createElement("h5", null,
|
|
195
|
+
index.flags.isReadonly && JSX.createElement("span", { class: "tsd-signature-keyword" }, "readonly "),
|
|
196
|
+
JSX.createElement("span", { class: "tsd-signature-symbol" }, "["),
|
|
197
|
+
index.parameters.map((item) => (JSX.createElement(JSX.Fragment, null,
|
|
198
|
+
JSX.createElement("span", { class: getKindClass(item) }, item.name),
|
|
199
|
+
": ",
|
|
200
|
+
context.type(item.type)))),
|
|
201
|
+
JSX.createElement("span", { class: "tsd-signature-symbol" }, "]: "),
|
|
202
|
+
context.type(index.type)),
|
|
203
|
+
context.commentSummary(index),
|
|
204
|
+
context.commentTags(index),
|
|
205
|
+
context.typeDeclaration(index.type)));
|
|
206
|
+
}
|
|
207
|
+
function renderingChildIsUseful(refl) {
|
|
208
|
+
if (renderingThisChildIsUseful(refl)) {
|
|
209
|
+
return true;
|
|
210
|
+
}
|
|
211
|
+
return refl.getProperties().some(renderingThisChildIsUseful);
|
|
212
|
+
}
|
|
213
|
+
function renderingThisChildIsUseful(refl) {
|
|
214
|
+
if (refl.hasComment())
|
|
215
|
+
return true;
|
|
216
|
+
const declaration = refl.type?.type === "reflection" ? refl.type.declaration : refl;
|
|
217
|
+
if (declaration.hasComment())
|
|
218
|
+
return true;
|
|
219
|
+
return declaration.getAllSignatures().some((sig) => {
|
|
220
|
+
return sig.hasComment() || sig.parameters?.some((p) => p.hasComment());
|
|
221
|
+
});
|
|
222
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
|
|
2
|
-
import type { TypeParameterReflection } from "../../../../models";
|
|
3
|
-
import { JSX } from "../../../../utils";
|
|
1
|
+
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
|
|
2
|
+
import type { TypeParameterReflection } from "../../../../models/index.js";
|
|
3
|
+
import { JSX } from "../../../../utils/index.js";
|
|
4
4
|
export declare function typeParameters(context: DefaultThemeRenderContext, typeParameters: TypeParameterReflection[]): JSX.Element;
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
utils_1.JSX.createElement("a", { id: item.anchor, class: "tsd-anchor" }),
|
|
12
|
-
item.flags.isConst && utils_1.JSX.createElement("span", { class: "tsd-signature-keyword" }, "const "),
|
|
13
|
-
item.varianceModifier && (utils_1.JSX.createElement("span", { class: "tsd-signature-keyword" },
|
|
1
|
+
import { JSX } from "../../../../utils/index.js";
|
|
2
|
+
export function typeParameters(context, typeParameters) {
|
|
3
|
+
return (JSX.createElement(JSX.Fragment, null,
|
|
4
|
+
JSX.createElement("section", { class: "tsd-panel" },
|
|
5
|
+
JSX.createElement("h4", null, context.i18n.kind_plural_type_parameter()),
|
|
6
|
+
JSX.createElement("ul", { class: "tsd-type-parameter-list" }, typeParameters.map((item) => (JSX.createElement("li", null,
|
|
7
|
+
JSX.createElement("span", null,
|
|
8
|
+
JSX.createElement("a", { id: item.anchor, class: "tsd-anchor" }),
|
|
9
|
+
item.flags.isConst && JSX.createElement("span", { class: "tsd-signature-keyword" }, "const "),
|
|
10
|
+
item.varianceModifier && (JSX.createElement("span", { class: "tsd-signature-keyword" },
|
|
14
11
|
item.varianceModifier,
|
|
15
12
|
" ")),
|
|
16
|
-
|
|
17
|
-
!!item.type && (
|
|
18
|
-
|
|
13
|
+
JSX.createElement("span", { class: "tsd-kind-type-parameter" }, item.name),
|
|
14
|
+
!!item.type && (JSX.createElement(JSX.Fragment, null,
|
|
15
|
+
JSX.createElement("span", { class: "tsd-signature-keyword" }, " extends "),
|
|
19
16
|
context.type(item.type))),
|
|
20
|
-
!!item.default && (
|
|
17
|
+
!!item.default && (JSX.createElement(JSX.Fragment, null,
|
|
21
18
|
" = ",
|
|
22
19
|
context.type(item.default)))),
|
|
23
20
|
context.commentSummary(item),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
|
|
2
|
-
import type { DocumentReflection } from "../../../../models";
|
|
3
|
-
import type { PageEvent } from "../../../events";
|
|
4
|
-
import { JSX } from "../../../../utils";
|
|
1
|
+
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
|
|
2
|
+
import type { DocumentReflection } from "../../../../models/index.js";
|
|
3
|
+
import type { PageEvent } from "../../../events.js";
|
|
4
|
+
import { JSX } from "../../../../utils/index.js";
|
|
5
5
|
export declare const documentTemplate: ({ markdown }: DefaultThemeRenderContext, props: PageEvent<DocumentReflection>) => JSX.Element;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const utils_1 = require("../../../../utils");
|
|
5
|
-
const documentTemplate = ({ markdown }, props) => (utils_1.JSX.createElement("div", { class: "tsd-panel tsd-typography" },
|
|
6
|
-
utils_1.JSX.createElement(utils_1.Raw, { html: markdown(props.model.content) })));
|
|
7
|
-
exports.documentTemplate = documentTemplate;
|
|
1
|
+
import { JSX, Raw } from "../../../../utils/index.js";
|
|
2
|
+
export const documentTemplate = ({ markdown }, props) => (JSX.createElement("div", { class: "tsd-panel tsd-typography" },
|
|
3
|
+
JSX.createElement(Raw, { html: markdown(props.model.content) })));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
|
|
2
|
-
import type { PageEvent } from "../../../events";
|
|
3
|
-
import { JSX } from "../../../../utils";
|
|
4
|
-
import type { ProjectReflection } from "../../../../models";
|
|
1
|
+
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
|
|
2
|
+
import type { PageEvent } from "../../../events.js";
|
|
3
|
+
import { JSX } from "../../../../utils/index.js";
|
|
4
|
+
import type { ProjectReflection } from "../../../../models/index.js";
|
|
5
5
|
export declare function hierarchyTemplate(context: DefaultThemeRenderContext, props: PageEvent<ProjectReflection>): JSX.Element;
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { JSX } from "../../../../utils/index.js";
|
|
2
|
+
import { getHierarchyRoots } from "../../lib.js";
|
|
3
|
+
function fullHierarchy(context, root, seen) {
|
|
4
|
+
if (seen.has(root)) {
|
|
5
|
+
return (JSX.createElement("li", { "data-refl": root.id },
|
|
6
|
+
JSX.createElement("a", { href: context.urlTo(root) },
|
|
7
|
+
context.icons[root.kind](),
|
|
8
|
+
root.name)));
|
|
9
|
+
}
|
|
9
10
|
seen.add(root);
|
|
11
|
+
const children = [];
|
|
12
|
+
for (const child of [...(root.implementedBy || []), ...(root.extendedBy || [])]) {
|
|
13
|
+
if (child.reflection) {
|
|
14
|
+
children.push(fullHierarchy(context, child.reflection, seen));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
10
17
|
// Note: We don't use root.anchor for the anchor, because those are built on a per page basis.
|
|
11
18
|
// And classes/interfaces get their own page, so all the anchors will be empty anyways.
|
|
12
19
|
// Full name should be safe here, since this list only includes classes/interfaces.
|
|
13
|
-
return (
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
return (JSX.createElement("li", { "data-refl": root.id },
|
|
21
|
+
JSX.createElement("a", { id: root.getFullName(), class: "tsd-anchor" }),
|
|
22
|
+
JSX.createElement("a", { href: context.urlTo(root) },
|
|
16
23
|
context.icons[root.kind](),
|
|
17
24
|
root.name),
|
|
18
|
-
|
|
19
|
-
root.implementedBy?.map((child) => {
|
|
20
|
-
return child.reflection && fullHierarchy(context, child.reflection, seen);
|
|
21
|
-
}),
|
|
22
|
-
root.extendedBy?.map((child) => {
|
|
23
|
-
return child.reflection && fullHierarchy(context, child.reflection, seen);
|
|
24
|
-
}))));
|
|
25
|
+
children.length && JSX.createElement("ul", null, children)));
|
|
25
26
|
}
|
|
26
|
-
function hierarchyTemplate(context, props) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
export function hierarchyTemplate(context, props) {
|
|
28
|
+
const seen = new Set();
|
|
29
|
+
return (JSX.createElement(JSX.Fragment, null,
|
|
30
|
+
JSX.createElement("h2", null, context.i18n.theme_hierarchy_summary()),
|
|
31
|
+
getHierarchyRoots(props.project).map((root) => (JSX.createElement("ul", { class: "tsd-full-hierarchy" }, fullHierarchy(context, root, seen))))));
|
|
30
32
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
|
|
2
|
-
import type { ProjectReflection } from "../../../../models";
|
|
3
|
-
import type { PageEvent } from "../../../events";
|
|
4
|
-
import { JSX } from "../../../../utils";
|
|
1
|
+
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
|
|
2
|
+
import type { ProjectReflection } from "../../../../models/index.js";
|
|
3
|
+
import type { PageEvent } from "../../../events.js";
|
|
4
|
+
import { JSX } from "../../../../utils/index.js";
|
|
5
5
|
export declare const indexTemplate: ({ markdown }: DefaultThemeRenderContext, props: PageEvent<ProjectReflection>) => JSX.Element;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const utils_1 = require("../../../../utils");
|
|
5
|
-
const indexTemplate = ({ markdown }, props) => (utils_1.JSX.createElement("div", { class: "tsd-panel tsd-typography" },
|
|
6
|
-
utils_1.JSX.createElement(utils_1.Raw, { html: markdown(props.model.readme || []) })));
|
|
7
|
-
exports.indexTemplate = indexTemplate;
|
|
1
|
+
import { JSX, Raw } from "../../../../utils/index.js";
|
|
2
|
+
export const indexTemplate = ({ markdown }, props) => (JSX.createElement("div", { class: "tsd-panel tsd-typography" },
|
|
3
|
+
JSX.createElement(Raw, { html: markdown(props.model.readme || []) })));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
|
|
2
|
-
import type { PageEvent } from "../../../events";
|
|
3
|
-
import { type ContainerReflection } from "../../../../models";
|
|
4
|
-
import { JSX } from "../../../../utils";
|
|
1
|
+
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
|
|
2
|
+
import type { PageEvent } from "../../../events.js";
|
|
3
|
+
import { type ContainerReflection } from "../../../../models/index.js";
|
|
4
|
+
import { JSX } from "../../../../utils/index.js";
|
|
5
5
|
export declare function reflectionTemplate(context: DefaultThemeRenderContext, props: PageEvent<ContainerReflection>): JSX.Element;
|
|
@@ -1,54 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function reflectionTemplate(context, props) {
|
|
8
|
-
if (props.model.kindOf(models_1.ReflectionKind.TypeAlias | models_1.ReflectionKind.Variable) &&
|
|
9
|
-
props.model instanceof models_1.DeclarationReflection) {
|
|
1
|
+
import { classNames, getKindClass, hasTypeParameters } from "../../lib.js";
|
|
2
|
+
import { DeclarationReflection, ReflectionKind, } from "../../../../models/index.js";
|
|
3
|
+
import { JSX } from "../../../../utils/index.js";
|
|
4
|
+
export function reflectionTemplate(context, props) {
|
|
5
|
+
if (props.model.kindOf(ReflectionKind.TypeAlias | ReflectionKind.Variable) &&
|
|
6
|
+
props.model instanceof DeclarationReflection) {
|
|
10
7
|
return context.memberDeclaration(props.model);
|
|
11
8
|
}
|
|
12
|
-
|
|
13
|
-
props.model.
|
|
9
|
+
if (props.model.kindOf(ReflectionKind.ExportContainer) &&
|
|
10
|
+
(props.model.isDeclaration() || props.model.isProject())) {
|
|
11
|
+
return context.moduleReflection(props.model);
|
|
12
|
+
}
|
|
13
|
+
return (JSX.createElement(JSX.Fragment, null,
|
|
14
|
+
props.model.hasComment() && (JSX.createElement("section", { class: "tsd-panel tsd-comment" },
|
|
14
15
|
context.commentSummary(props.model),
|
|
15
16
|
context.commentTags(props.model))),
|
|
16
|
-
props.model instanceof models_1.DeclarationReflection &&
|
|
17
|
-
props.model.kind === models_1.ReflectionKind.Module &&
|
|
18
|
-
props.model.readme?.length && (utils_1.JSX.createElement("section", { class: "tsd-panel tsd-typography" },
|
|
19
|
-
utils_1.JSX.createElement(utils_1.Raw, { html: context.markdown(props.model.readme) }))),
|
|
20
17
|
context.reflectionPreview(props.model),
|
|
21
|
-
|
|
18
|
+
hasTypeParameters(props.model) && JSX.createElement(JSX.Fragment, null,
|
|
22
19
|
" ",
|
|
23
20
|
context.typeParameters(props.model.typeParameters),
|
|
24
21
|
" "),
|
|
25
|
-
props.model instanceof
|
|
22
|
+
props.model instanceof DeclarationReflection && (JSX.createElement(JSX.Fragment, null,
|
|
26
23
|
context.hierarchy(props.model.typeHierarchy),
|
|
27
|
-
!!props.model.implementedTypes && (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
!!props.model.implementedBy && (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
!!props.model.signatures?.length && (
|
|
34
|
-
!!props.model.indexSignatures?.length && (
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
!!props.model.implementedTypes && (JSX.createElement("section", { class: "tsd-panel" },
|
|
25
|
+
JSX.createElement("h4", null, context.i18n.theme_implements()),
|
|
26
|
+
JSX.createElement("ul", { class: "tsd-hierarchy" }, props.model.implementedTypes.map((item) => (JSX.createElement("li", null, context.type(item))))))),
|
|
27
|
+
!!props.model.implementedBy && (JSX.createElement("section", { class: "tsd-panel" },
|
|
28
|
+
JSX.createElement("h4", null, context.i18n.theme_implemented_by()),
|
|
29
|
+
JSX.createElement("ul", { class: "tsd-hierarchy" }, props.model.implementedBy.map((item) => (JSX.createElement("li", null, context.type(item))))))),
|
|
30
|
+
!!props.model.signatures?.length && (JSX.createElement("section", { class: "tsd-panel" }, context.memberSignatures(props.model))),
|
|
31
|
+
!!props.model.indexSignatures?.length && (JSX.createElement("section", { class: classNames({ "tsd-panel": true }, context.getReflectionClasses(props.model)) },
|
|
32
|
+
JSX.createElement("h4", { class: "tsd-before-signature" }, context.i18n.theme_indexable()),
|
|
33
|
+
JSX.createElement("ul", { class: "tsd-signatures" }, props.model.indexSignatures.map((index) => renderIndexSignature(context, index))))),
|
|
37
34
|
!props.model.signatures && context.memberSources(props.model))),
|
|
38
35
|
!!props.model.childrenIncludingDocuments?.length && context.index(props.model),
|
|
39
36
|
context.members(props.model)));
|
|
40
37
|
}
|
|
41
38
|
function renderIndexSignature(context, index) {
|
|
42
|
-
return (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
return (JSX.createElement("li", { class: "tsd-index-signature" },
|
|
40
|
+
JSX.createElement("div", { class: "tsd-signature" },
|
|
41
|
+
index.flags.isReadonly && JSX.createElement("span", { class: "tsd-signature-keyword" }, "readonly "),
|
|
42
|
+
JSX.createElement("span", { class: "tsd-signature-symbol" }, "["),
|
|
43
|
+
index.parameters.map((item) => (JSX.createElement(JSX.Fragment, null,
|
|
44
|
+
JSX.createElement("span", { class: getKindClass(item) }, item.name),
|
|
47
45
|
": ",
|
|
48
46
|
context.type(item.type)))),
|
|
49
|
-
|
|
47
|
+
JSX.createElement("span", { class: "tsd-signature-symbol" }, "]: "),
|
|
50
48
|
context.type(index.type)),
|
|
51
49
|
context.commentSummary(index),
|
|
52
50
|
context.commentTags(index),
|
|
53
|
-
|
|
51
|
+
context.typeDetailsIfUseful(index.type)));
|
|
54
52
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { DefaultThemeRenderContext } from "
|
|
2
|
-
import { DeclarationReflection, ProjectReflection, type Reflection, type TypeParameterReflection } from "../../models";
|
|
3
|
-
import { JSX } from "../../utils";
|
|
1
|
+
import type { DefaultThemeRenderContext } from "../index.js";
|
|
2
|
+
import { type ContainerReflection, DeclarationReflection, ProjectReflection, type Reflection, type TypeParameterReflection } from "../../models/index.js";
|
|
3
|
+
import { JSX } from "../../utils/index.js";
|
|
4
4
|
export declare function stringify(data: unknown): string;
|
|
5
5
|
export declare function getDisplayName(refl: Reflection): string;
|
|
6
6
|
export declare function toStyleClass(str: string): string;
|
|
@@ -25,3 +25,17 @@ export declare function renderTypeParametersSignature(context: DefaultThemeRende
|
|
|
25
25
|
*/
|
|
26
26
|
export declare function renderName(refl: Reflection): JSX.Element | (string | JSX.Element)[];
|
|
27
27
|
export declare function getHierarchyRoots(project: ProjectReflection): DeclarationReflection[];
|
|
28
|
+
export declare function getMemberSections(parent: ContainerReflection, childFilter?: (refl: Reflection) => boolean): {
|
|
29
|
+
title: string;
|
|
30
|
+
children: (DeclarationReflection | import("../../models/index.js").DocumentReflection)[];
|
|
31
|
+
}[];
|
|
32
|
+
/**
|
|
33
|
+
* Returns a (hopefully) globally unique path for the given reflection.
|
|
34
|
+
*
|
|
35
|
+
* This only works for exportable symbols, so e.g. methods are not affected by this.
|
|
36
|
+
*
|
|
37
|
+
* If the given reflection has a globally unique name already, then it will be returned as is. If the name is
|
|
38
|
+
* ambiguous (i.e. there are two classes with the same name in different namespaces), then the namespaces path of the
|
|
39
|
+
* reflection will be returned.
|
|
40
|
+
*/
|
|
41
|
+
export declare function getUniquePath(reflection: Reflection): Reflection[];
|