typedoc 0.26.10 → 0.27.0-beta.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/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 +172 -148
- 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 +210 -238
- package/dist/lib/converter/factories/index-signature.d.ts +1 -1
- package/dist/lib/converter/factories/index-signature.js +11 -17
- 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 +366 -2
- package/dist/lib/internationalization/locales/en.d.cts +339 -2
- package/dist/lib/internationalization/locales/jp.cjs +8 -11
- package/dist/lib/internationalization/locales/jp.d.cts +310 -1
- package/dist/lib/internationalization/locales/ko.cjs +7 -9
- package/dist/lib/internationalization/locales/ko.d.cts +223 -1
- package/dist/lib/internationalization/locales/zh.cjs +7 -10
- package/dist/lib/internationalization/locales/zh.d.cts +381 -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 +26 -13
- 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 +619 -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 +13 -0
- package/dist/lib/output/output.js +72 -0
- package/dist/lib/output/plugins/AssetsPlugin.d.ts +7 -8
- package/dist/lib/output/plugins/AssetsPlugin.js +62 -80
- 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 +6 -6
- package/dist/lib/output/plugins/index.js +6 -15
- package/dist/lib/output/renderer.d.ts +14 -13
- package/dist/lib/output/renderer.js +129 -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 +67 -34
- 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 +3 -3
- package/dist/lib/output/themes/default/partials/hierarchy.js +9 -12
- 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 +221 -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 +10 -13
- 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 +31 -34
- package/dist/lib/output/themes/lib.d.ts +17 -3
- package/dist/lib/output/themes/lib.js +110 -49
- 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 -5
- package/dist/lib/utils/jsx.elements.js +1 -4
- package/dist/lib/utils/jsx.js +53 -20
- package/dist/lib/utils/loggers.d.ts +3 -3
- package/dist/lib/utils/loggers.js +36 -46
- package/dist/lib/utils/map.d.ts +1 -1
- package/dist/lib/utils/map.js +6 -13
- package/dist/lib/utils/minimalSourceFile.js +5 -7
- package/dist/lib/utils/options/declaration.d.ts +33 -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 +47 -90
- 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 +220 -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 +16 -17
- 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 +14 -11
- package/static/main.js +4 -4
- package/static/style.css +91 -2
- 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
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { PageEvent, Renderer } from "
|
|
2
|
-
import type { Internationalization, TranslationProxy } from "../../../internationalization/internationalization";
|
|
3
|
-
import type { DocumentReflection, CommentDisplayPart, DeclarationReflection, Reflection } from "../../../models";
|
|
4
|
-
import { type NeverIfInternal, type Options } from "../../../utils";
|
|
5
|
-
import type { DefaultTheme } from "./DefaultTheme";
|
|
6
|
-
import { type icons } from "./partials/icon";
|
|
1
|
+
import type { PageEvent, Renderer } from "../../index.js";
|
|
2
|
+
import type { Internationalization, TranslationProxy } from "../../../internationalization/internationalization.js";
|
|
3
|
+
import type { DocumentReflection, CommentDisplayPart, DeclarationReflection, Reflection } from "../../../models/index.js";
|
|
4
|
+
import { type NeverIfInternal, type Options } from "../../../utils/index.js";
|
|
5
|
+
import type { DefaultTheme } from "./DefaultTheme.js";
|
|
6
|
+
import { type icons } from "./partials/icon.js";
|
|
7
7
|
export declare class DefaultThemeRenderContext {
|
|
8
8
|
readonly theme: DefaultTheme;
|
|
9
9
|
page: PageEvent<Reflection>;
|
|
@@ -19,18 +19,21 @@ export declare class DefaultThemeRenderContext {
|
|
|
19
19
|
* to customize icons, that object must be modified instead.
|
|
20
20
|
*/
|
|
21
21
|
get icons(): Readonly<typeof icons>;
|
|
22
|
+
get slugger(): import("./Slugger.js").Slugger;
|
|
22
23
|
hook: Renderer["hooks"]["emit"];
|
|
23
24
|
/** Avoid this in favor of urlTo if possible */
|
|
24
25
|
relativeURL: (url: string, cacheBust?: boolean) => string;
|
|
25
26
|
urlTo: (reflection: Reflection) => string;
|
|
26
27
|
markdown: (md: readonly CommentDisplayPart[] | NeverIfInternal<string | undefined>) => string;
|
|
27
|
-
|
|
28
|
+
/** Renders user comment markdown wrapped in a tsd-comment div */
|
|
29
|
+
displayParts: (parts: readonly CommentDisplayPart[] | undefined) => import("../../../utils/jsx.elements.js").JsxElement | undefined;
|
|
30
|
+
getNavigation: () => import("./DefaultTheme.js").NavigationElement[];
|
|
28
31
|
getReflectionClasses: (refl: DeclarationReflection | DocumentReflection) => string;
|
|
29
|
-
documentTemplate: (props: PageEvent<DocumentReflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
30
|
-
reflectionTemplate: (props: PageEvent<import("../../../models").ContainerReflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
31
|
-
indexTemplate: (props: PageEvent<import("../../../models").ProjectReflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
32
|
-
hierarchyTemplate: (props: PageEvent<import("../../../models").ProjectReflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
33
|
-
defaultLayout: (template: import("
|
|
32
|
+
documentTemplate: (props: PageEvent<DocumentReflection>) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
33
|
+
reflectionTemplate: (props: PageEvent<import("../../../models/index.js").ContainerReflection>) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
34
|
+
indexTemplate: (props: PageEvent<import("../../../models/index.js").ProjectReflection>) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
35
|
+
hierarchyTemplate: (props: PageEvent<import("../../../models/index.js").ProjectReflection>) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
36
|
+
defaultLayout: (template: import("../../index.js").RenderTemplate<PageEvent<Reflection>>, props: PageEvent<Reflection>) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
34
37
|
/**
|
|
35
38
|
* Rendered just after the description for a reflection.
|
|
36
39
|
* This can be used to render a shortened type display of a reflection that the
|
|
@@ -39,43 +42,55 @@ export declare class DefaultThemeRenderContext {
|
|
|
39
42
|
* Note: Will not be called for variables/type aliases, as they are summarized
|
|
40
43
|
* by their type declaration, which is already rendered by {@link DefaultThemeRenderContext.memberDeclaration}
|
|
41
44
|
*/
|
|
42
|
-
reflectionPreview: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
reflectionPreview: (props: Reflection) => import("../../../utils/jsx.elements.js").JsxElement | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Used to render additional details about a type. This is used to implement
|
|
48
|
+
* the `@expand` tag, comments on union members, comments on object type members...
|
|
49
|
+
*/
|
|
50
|
+
typeDetails: (type: import("../../../models/types.js").SomeType, renderAnchors: boolean) => import("../../../utils/jsx.elements.js").JsxChildren;
|
|
51
|
+
/**
|
|
52
|
+
* Should call the {@link typeDetails} helper if rendering additional details
|
|
53
|
+
* about the type will provide the user with more information about the type.
|
|
54
|
+
*/
|
|
55
|
+
typeDetailsIfUseful: (type: import("../../../models/types.js").SomeType | undefined) => import("../../../utils/jsx.elements.js").JsxChildren;
|
|
56
|
+
/**
|
|
57
|
+
* Wrapper around {@link typeDetails} which checks if it is useful
|
|
58
|
+
* and includes a "Type Declaration" header.
|
|
59
|
+
*/
|
|
60
|
+
typeDeclaration: (type: import("../../../models/types.js").SomeType) => import("../../../utils/jsx.elements.js").JsxChildren;
|
|
61
|
+
breadcrumb: (props: Reflection) => import("../../../utils/jsx.elements.js").JsxElement | undefined;
|
|
62
|
+
commentShortSummary: (props: Reflection) => import("../../../utils/jsx.elements.js").JsxElement | undefined;
|
|
63
|
+
commentSummary: (props: Reflection) => import("../../../utils/jsx.elements.js").JsxElement | undefined;
|
|
64
|
+
commentTags: (props: Reflection) => import("../../../utils/jsx.elements.js").JsxElement | undefined;
|
|
65
|
+
reflectionFlags: (props: Reflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
66
|
+
footer: () => import("../../../utils/jsx.elements.js").JsxElement;
|
|
67
|
+
header: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
68
|
+
hierarchy: (props: import("../../../models/index.js").DeclarationHierarchy | undefined) => import("../../../utils/jsx.elements.js").JsxElement | undefined;
|
|
69
|
+
index: (props: import("../../../models/index.js").ContainerReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
70
|
+
member: (props: DeclarationReflection | DocumentReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
71
|
+
moduleReflection: (mod: DeclarationReflection | import("../../../models/index.js").ProjectReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
72
|
+
moduleMemberSummary: (member: DeclarationReflection | DocumentReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
73
|
+
memberDeclaration: (props: DeclarationReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
74
|
+
memberGetterSetter: (props: DeclarationReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
75
|
+
memberSignatureBody: (props: import("../../../models/index.js").SignatureReflection, r_1?: {
|
|
56
76
|
hideSources?: boolean;
|
|
57
|
-
} | undefined) => import("../../../utils/jsx.elements").JsxElement;
|
|
58
|
-
memberSignatureTitle: (props: import("../../../models").SignatureReflection,
|
|
77
|
+
} | undefined) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
78
|
+
memberSignatureTitle: (props: import("../../../models/index.js").SignatureReflection, options?: {
|
|
59
79
|
hideName?: boolean;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
navigation: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
73
|
-
pageNavigation: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
74
|
-
parameter: (props: DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
|
|
75
|
-
toolbar: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
76
|
-
type: (type: import("../../../models").Type | undefined, options?: {
|
|
80
|
+
} | undefined) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
81
|
+
memberSignatures: (props: DeclarationReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
82
|
+
memberSources: (props: DeclarationReflection | import("../../../models/index.js").SignatureReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
83
|
+
members: (props: import("../../../models/index.js").ContainerReflection) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
84
|
+
sidebar: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
85
|
+
pageSidebar: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
86
|
+
sidebarLinks: () => import("../../../utils/jsx.elements.js").JsxElement | null;
|
|
87
|
+
settings: () => import("../../../utils/jsx.elements.js").JsxElement;
|
|
88
|
+
navigation: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
89
|
+
pageNavigation: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
90
|
+
toolbar: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
91
|
+
type: (type: import("../../../models/types.js").SomeType | undefined, options?: {
|
|
77
92
|
topLevelLinks: boolean;
|
|
78
|
-
} | undefined) => import("../../../utils/jsx.elements").JsxElement;
|
|
79
|
-
typeAndParent: (props: import("../../../models").Type) => import("../../../utils/jsx.elements").JsxElement;
|
|
80
|
-
typeParameters: (typeParameters: import("../../../models").TypeParameterReflection[]) => import("../../../utils/jsx.elements").JsxElement;
|
|
93
|
+
} | undefined) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
94
|
+
typeAndParent: (props: import("../../../models/types.js").Type) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
95
|
+
typeParameters: (typeParameters: import("../../../models/index.js").TypeParameterReflection[]) => import("../../../utils/jsx.elements.js").JsxElement;
|
|
81
96
|
}
|
|
@@ -1,106 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const hierarchy_2 = require("./templates/hierarchy");
|
|
31
|
-
const reflection_1 = require("./templates/reflection");
|
|
1
|
+
import {} from "../../../utils/index.js";
|
|
2
|
+
import { defaultLayout } from "./layouts/default.js";
|
|
3
|
+
import { index } from "./partials/index.js";
|
|
4
|
+
import { breadcrumb } from "./partials/breadcrumb.js";
|
|
5
|
+
import { commentShortSummary, commentSummary, commentTags, reflectionFlags, renderDisplayParts, } from "./partials/comment.js";
|
|
6
|
+
import { footer } from "./partials/footer.js";
|
|
7
|
+
import { header } from "./partials/header.js";
|
|
8
|
+
import { hierarchy } from "./partials/hierarchy.js";
|
|
9
|
+
import { buildRefIcons } from "./partials/icon.js";
|
|
10
|
+
import { member } from "./partials/member.js";
|
|
11
|
+
import { memberDeclaration } from "./partials/member.declaration.js";
|
|
12
|
+
import { memberGetterSetter } from "./partials/member.getterSetter.js";
|
|
13
|
+
import { memberSignatureBody } from "./partials/member.signature.body.js";
|
|
14
|
+
import { memberSignatureTitle } from "./partials/member.signature.title.js";
|
|
15
|
+
import { memberSignatures } from "./partials/member.signatures.js";
|
|
16
|
+
import { memberSources } from "./partials/member.sources.js";
|
|
17
|
+
import { members } from "./partials/members.js";
|
|
18
|
+
import { sidebar, pageSidebar, navigation, pageNavigation, settings, sidebarLinks, } from "./partials/navigation.js";
|
|
19
|
+
import { reflectionPreview } from "./partials/reflectionPreview.js";
|
|
20
|
+
import { toolbar } from "./partials/toolbar.js";
|
|
21
|
+
import { type } from "./partials/type.js";
|
|
22
|
+
import { typeAndParent } from "./partials/typeAndParent.js";
|
|
23
|
+
import { typeParameters } from "./partials/typeParameters.js";
|
|
24
|
+
import { indexTemplate } from "./templates/index.js";
|
|
25
|
+
import { documentTemplate } from "./templates/document.js";
|
|
26
|
+
import { hierarchyTemplate } from "./templates/hierarchy.js";
|
|
27
|
+
import { reflectionTemplate } from "./templates/reflection.js";
|
|
28
|
+
import { typeDeclaration, typeDetails, typeDetailsIfUseful, } from "./partials/typeDetails.js";
|
|
29
|
+
import { moduleMemberSummary, moduleReflection, } from "./partials/moduleReflection.js";
|
|
32
30
|
function bind(fn, first) {
|
|
33
31
|
return (...r) => fn(first, ...r);
|
|
34
32
|
}
|
|
35
|
-
class DefaultThemeRenderContext {
|
|
33
|
+
export class DefaultThemeRenderContext {
|
|
34
|
+
theme;
|
|
35
|
+
page;
|
|
36
|
+
_refIcons;
|
|
37
|
+
options;
|
|
38
|
+
internationalization;
|
|
39
|
+
i18n;
|
|
36
40
|
constructor(theme, page, options) {
|
|
37
41
|
this.theme = theme;
|
|
38
42
|
this.page = page;
|
|
39
|
-
this.hook = (...params) => {
|
|
40
|
-
return this.theme.owner.hooks.emit(...params);
|
|
41
|
-
};
|
|
42
|
-
/** Avoid this in favor of urlTo if possible */
|
|
43
|
-
this.relativeURL = (url, cacheBust = false) => {
|
|
44
|
-
const result = this.theme.markedPlugin.getRelativeUrl(url);
|
|
45
|
-
if (cacheBust && this.theme.owner.cacheBust) {
|
|
46
|
-
return result + `?cache=${this.theme.owner.renderStartTime}`;
|
|
47
|
-
}
|
|
48
|
-
return result;
|
|
49
|
-
};
|
|
50
|
-
this.urlTo = (reflection) => {
|
|
51
|
-
return reflection.url ? this.relativeURL(reflection.url) : "";
|
|
52
|
-
};
|
|
53
|
-
this.markdown = (md) => {
|
|
54
|
-
return this.theme.markedPlugin.parseMarkdown(md || "", this.page, this);
|
|
55
|
-
};
|
|
56
|
-
this.getNavigation = () => this.theme.getNavigation(this.page.project);
|
|
57
|
-
this.getReflectionClasses = (refl) => this.theme.getReflectionClasses(refl);
|
|
58
|
-
this.documentTemplate = bind(document_1.documentTemplate, this);
|
|
59
|
-
this.reflectionTemplate = bind(reflection_1.reflectionTemplate, this);
|
|
60
|
-
this.indexTemplate = bind(templates_1.indexTemplate, this);
|
|
61
|
-
this.hierarchyTemplate = bind(hierarchy_2.hierarchyTemplate, this);
|
|
62
|
-
this.defaultLayout = bind(default_1.defaultLayout, this);
|
|
63
|
-
/**
|
|
64
|
-
* Rendered just after the description for a reflection.
|
|
65
|
-
* This can be used to render a shortened type display of a reflection that the
|
|
66
|
-
* rest of the page expands on.
|
|
67
|
-
*
|
|
68
|
-
* Note: Will not be called for variables/type aliases, as they are summarized
|
|
69
|
-
* by their type declaration, which is already rendered by {@link DefaultThemeRenderContext.memberDeclaration}
|
|
70
|
-
*/
|
|
71
|
-
this.reflectionPreview = bind(reflectionPreview_1.reflectionPreview, this);
|
|
72
|
-
this.breadcrumb = bind(breadcrumb_1.breadcrumb, this);
|
|
73
|
-
this.commentSummary = bind(comment_1.commentSummary, this);
|
|
74
|
-
this.commentTags = bind(comment_1.commentTags, this);
|
|
75
|
-
this.reflectionFlags = bind(comment_1.reflectionFlags, this);
|
|
76
|
-
this.footer = bind(footer_1.footer, this);
|
|
77
|
-
this.header = bind(header_1.header, this);
|
|
78
|
-
this.hierarchy = bind(hierarchy_1.hierarchy, this);
|
|
79
|
-
this.index = bind(partials_1.index, this);
|
|
80
|
-
this.member = bind(member_1.member, this);
|
|
81
|
-
this.memberDeclaration = bind(member_declaration_1.memberDeclaration, this);
|
|
82
|
-
this.memberGetterSetter = bind(member_getterSetter_1.memberGetterSetter, this);
|
|
83
|
-
this.memberReference = bind(member_reference_1.memberReference, this);
|
|
84
|
-
this.memberSignatureBody = bind(member_signature_body_1.memberSignatureBody, this);
|
|
85
|
-
this.memberSignatureTitle = bind(member_signature_title_1.memberSignatureTitle, this);
|
|
86
|
-
this.memberSignatures = bind(member_signatures_1.memberSignatures, this);
|
|
87
|
-
this.memberSources = bind(member_sources_1.memberSources, this);
|
|
88
|
-
this.members = bind(members_1.members, this);
|
|
89
|
-
this.sidebar = bind(navigation_1.sidebar, this);
|
|
90
|
-
this.pageSidebar = bind(navigation_1.pageSidebar, this);
|
|
91
|
-
this.sidebarLinks = bind(navigation_1.sidebarLinks, this);
|
|
92
|
-
this.settings = bind(navigation_1.settings, this);
|
|
93
|
-
this.navigation = bind(navigation_1.navigation, this);
|
|
94
|
-
this.pageNavigation = bind(navigation_1.pageNavigation, this);
|
|
95
|
-
this.parameter = bind(parameter_1.parameter, this);
|
|
96
|
-
this.toolbar = bind(toolbar_1.toolbar, this);
|
|
97
|
-
this.type = bind(type_1.type, this);
|
|
98
|
-
this.typeAndParent = bind(typeAndParent_1.typeAndParent, this);
|
|
99
|
-
this.typeParameters = bind(typeParameters_1.typeParameters, this);
|
|
100
43
|
this.options = options;
|
|
101
44
|
this.internationalization = theme.application.internationalization;
|
|
102
45
|
this.i18n = this.internationalization.proxy;
|
|
103
|
-
this._refIcons =
|
|
46
|
+
this._refIcons = buildRefIcons(theme.icons, this);
|
|
104
47
|
}
|
|
105
48
|
/**
|
|
106
49
|
* Icons available for use within the page.
|
|
@@ -111,5 +54,86 @@ class DefaultThemeRenderContext {
|
|
|
111
54
|
get icons() {
|
|
112
55
|
return this._refIcons;
|
|
113
56
|
}
|
|
57
|
+
get slugger() {
|
|
58
|
+
return this.theme.getSlugger(this.page.model);
|
|
59
|
+
}
|
|
60
|
+
hook = (...params) => {
|
|
61
|
+
return this.theme.owner.hooks.emit(...params);
|
|
62
|
+
};
|
|
63
|
+
/** Avoid this in favor of urlTo if possible */
|
|
64
|
+
relativeURL = (url, cacheBust = false) => {
|
|
65
|
+
const result = this.theme.markedPlugin.getRelativeUrl(url);
|
|
66
|
+
if (cacheBust && this.theme.owner.cacheBust) {
|
|
67
|
+
return result + `?cache=${this.theme.owner.renderStartTime}`;
|
|
68
|
+
}
|
|
69
|
+
return result;
|
|
70
|
+
};
|
|
71
|
+
urlTo = (reflection) => {
|
|
72
|
+
return reflection.url ? this.relativeURL(reflection.url) : "";
|
|
73
|
+
};
|
|
74
|
+
markdown = (md) => {
|
|
75
|
+
return this.theme.markedPlugin.parseMarkdown(md || "", this.page, this);
|
|
76
|
+
};
|
|
77
|
+
/** Renders user comment markdown wrapped in a tsd-comment div */
|
|
78
|
+
displayParts = bind(renderDisplayParts, this);
|
|
79
|
+
getNavigation = () => this.theme.getNavigation(this.page.project);
|
|
80
|
+
getReflectionClasses = (refl) => this.theme.getReflectionClasses(refl);
|
|
81
|
+
documentTemplate = bind(documentTemplate, this);
|
|
82
|
+
reflectionTemplate = bind(reflectionTemplate, this);
|
|
83
|
+
indexTemplate = bind(indexTemplate, this);
|
|
84
|
+
hierarchyTemplate = bind(hierarchyTemplate, this);
|
|
85
|
+
defaultLayout = bind(defaultLayout, this);
|
|
86
|
+
/**
|
|
87
|
+
* Rendered just after the description for a reflection.
|
|
88
|
+
* This can be used to render a shortened type display of a reflection that the
|
|
89
|
+
* rest of the page expands on.
|
|
90
|
+
*
|
|
91
|
+
* Note: Will not be called for variables/type aliases, as they are summarized
|
|
92
|
+
* by their type declaration, which is already rendered by {@link DefaultThemeRenderContext.memberDeclaration}
|
|
93
|
+
*/
|
|
94
|
+
reflectionPreview = bind(reflectionPreview, this);
|
|
95
|
+
/**
|
|
96
|
+
* Used to render additional details about a type. This is used to implement
|
|
97
|
+
* the `@expand` tag, comments on union members, comments on object type members...
|
|
98
|
+
*/
|
|
99
|
+
typeDetails = bind(typeDetails, this);
|
|
100
|
+
/**
|
|
101
|
+
* Should call the {@link typeDetails} helper if rendering additional details
|
|
102
|
+
* about the type will provide the user with more information about the type.
|
|
103
|
+
*/
|
|
104
|
+
typeDetailsIfUseful = bind(typeDetailsIfUseful, this);
|
|
105
|
+
/**
|
|
106
|
+
* Wrapper around {@link typeDetails} which checks if it is useful
|
|
107
|
+
* and includes a "Type Declaration" header.
|
|
108
|
+
*/
|
|
109
|
+
typeDeclaration = bind(typeDeclaration, this);
|
|
110
|
+
breadcrumb = bind(breadcrumb, this);
|
|
111
|
+
commentShortSummary = bind(commentShortSummary, this);
|
|
112
|
+
commentSummary = bind(commentSummary, this);
|
|
113
|
+
commentTags = bind(commentTags, this);
|
|
114
|
+
reflectionFlags = bind(reflectionFlags, this);
|
|
115
|
+
footer = bind(footer, this);
|
|
116
|
+
header = bind(header, this);
|
|
117
|
+
hierarchy = bind(hierarchy, this);
|
|
118
|
+
index = bind(index, this);
|
|
119
|
+
member = bind(member, this);
|
|
120
|
+
moduleReflection = bind(moduleReflection, this);
|
|
121
|
+
moduleMemberSummary = bind(moduleMemberSummary, this);
|
|
122
|
+
memberDeclaration = bind(memberDeclaration, this);
|
|
123
|
+
memberGetterSetter = bind(memberGetterSetter, this);
|
|
124
|
+
memberSignatureBody = bind(memberSignatureBody, this);
|
|
125
|
+
memberSignatureTitle = bind(memberSignatureTitle, this);
|
|
126
|
+
memberSignatures = bind(memberSignatures, this);
|
|
127
|
+
memberSources = bind(memberSources, this);
|
|
128
|
+
members = bind(members, this);
|
|
129
|
+
sidebar = bind(sidebar, this);
|
|
130
|
+
pageSidebar = bind(pageSidebar, this);
|
|
131
|
+
sidebarLinks = bind(sidebarLinks, this);
|
|
132
|
+
settings = bind(settings, this);
|
|
133
|
+
navigation = bind(navigation, this);
|
|
134
|
+
pageNavigation = bind(pageNavigation, this);
|
|
135
|
+
toolbar = bind(toolbar, this);
|
|
136
|
+
type = bind(type, this);
|
|
137
|
+
typeAndParent = bind(typeAndParent, this);
|
|
138
|
+
typeParameters = bind(typeParameters, this);
|
|
114
139
|
}
|
|
115
|
-
exports.DefaultThemeRenderContext = DefaultThemeRenderContext;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { TypeDocOptionMap } from "../../../utils/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Responsible for getting a unique anchor for elements within a page.
|
|
4
|
+
*/
|
|
5
|
+
export declare class Slugger {
|
|
6
|
+
private options;
|
|
7
|
+
private seen;
|
|
8
|
+
private serialize;
|
|
9
|
+
constructor(options: TypeDocOptionMap["sluggerConfiguration"]);
|
|
10
|
+
slug(value: string): string;
|
|
11
|
+
hasAnchor(anchor: string): boolean;
|
|
12
|
+
getSimilarAnchors(anchor: string): string[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { getSimilarValues } from "../../../utils/general.js";
|
|
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
|
+
// Notes:
|
|
10
|
+
// There are quite a few trade-offs here.
|
|
11
|
+
return (value
|
|
12
|
+
.trim()
|
|
13
|
+
// remove html tags
|
|
14
|
+
.replace(/<[!/a-z].*?>/gi, "")
|
|
15
|
+
// remove unwanted chars
|
|
16
|
+
.replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, "")
|
|
17
|
+
.replace(/\s/g, "-"));
|
|
18
|
+
}
|
|
19
|
+
constructor(options) {
|
|
20
|
+
this.options = options;
|
|
21
|
+
}
|
|
22
|
+
slug(value) {
|
|
23
|
+
const originalSlug = this.serialize(value);
|
|
24
|
+
const lowerOriginalSlug = originalSlug.toLocaleLowerCase();
|
|
25
|
+
let count = 0;
|
|
26
|
+
let slug = lowerOriginalSlug;
|
|
27
|
+
if (this.seen.has(lowerOriginalSlug)) {
|
|
28
|
+
count = this.seen.get(lowerOriginalSlug);
|
|
29
|
+
do {
|
|
30
|
+
count++;
|
|
31
|
+
slug = `${lowerOriginalSlug}-${count}`;
|
|
32
|
+
} while (this.seen.has(slug));
|
|
33
|
+
}
|
|
34
|
+
this.seen.set(lowerOriginalSlug, count);
|
|
35
|
+
if (!this.options.lowercase) {
|
|
36
|
+
return count === 0 ? originalSlug : `${originalSlug}-${count}`;
|
|
37
|
+
}
|
|
38
|
+
return slug;
|
|
39
|
+
}
|
|
40
|
+
hasAnchor(anchor) {
|
|
41
|
+
return this.seen.has(anchor);
|
|
42
|
+
}
|
|
43
|
+
getSimilarAnchors(anchor) {
|
|
44
|
+
return getSimilarValues(this.seen.keys(), anchor);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { RenderTemplate } from "
|
|
2
|
-
import type { Reflection } from "../../../../models";
|
|
3
|
-
import { JSX } from "../../../../utils";
|
|
4
|
-
import type { PageEvent } from "../../../events";
|
|
5
|
-
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
|
|
1
|
+
import type { RenderTemplate } from "../../../index.js";
|
|
2
|
+
import type { Reflection } from "../../../../models/index.js";
|
|
3
|
+
import { JSX } from "../../../../utils/index.js";
|
|
4
|
+
import type { PageEvent } from "../../../events.js";
|
|
5
|
+
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
|
|
6
6
|
export declare const defaultLayout: (context: DefaultThemeRenderContext, template: RenderTemplate<PageEvent<Reflection>>, props: PageEvent<Reflection>) => JSX.Element;
|
|
@@ -1,50 +1,83 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { JSX, Raw } from "../../../../utils/index.js";
|
|
2
|
+
import { getDisplayName } 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
|
+
switch (extname(fav)) {
|
|
9
|
+
case ".ico":
|
|
10
|
+
return JSX.createElement("link", { rel: "icon", href: context.relativeURL("assets/favicon.ico", true) });
|
|
11
|
+
case ".svg":
|
|
12
|
+
return JSX.createElement("link", { rel: "icon", href: context.relativeURL("assets/favicon.svg", true), type: "image/svg+xml" });
|
|
13
|
+
default:
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
// See #2760
|
|
18
|
+
function buildSiteMetadata(context) {
|
|
19
|
+
try {
|
|
20
|
+
// We have to know where we are hosted in order to generate this block
|
|
21
|
+
const url = new URL(context.options.getValue("hostedBaseUrl"));
|
|
22
|
+
// No point in generating this if we aren't the root page on the site
|
|
23
|
+
if (url.pathname !== "/") {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return (JSX.createElement("script", { type: "application/ld+json" },
|
|
27
|
+
JSX.createElement(Raw, { html: JSON.stringify({
|
|
28
|
+
"@context": "https://schema.org",
|
|
29
|
+
"@type": "WebSite",
|
|
30
|
+
name: context.page.project.name,
|
|
31
|
+
url: url.toString(),
|
|
32
|
+
}) })));
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export const defaultLayout = (context, template, props) => (JSX.createElement("html", { class: "default", lang: context.options.getValue("lang") },
|
|
39
|
+
JSX.createElement("head", null,
|
|
40
|
+
JSX.createElement("meta", { charset: "utf-8" }),
|
|
9
41
|
context.hook("head.begin", context),
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
?
|
|
13
|
-
: `${
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
context.options.getValue("
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
42
|
+
JSX.createElement("meta", { "http-equiv": "x-ua-compatible", content: "IE=edge" }),
|
|
43
|
+
JSX.createElement("title", null, props.model.isProject()
|
|
44
|
+
? getDisplayName(props.model)
|
|
45
|
+
: `${getDisplayName(props.model)} | ${getDisplayName(props.project)}`),
|
|
46
|
+
favicon(context),
|
|
47
|
+
props.url === "index.html" && buildSiteMetadata(context),
|
|
48
|
+
JSX.createElement("meta", { name: "description", content: "Documentation for " + props.project.name }),
|
|
49
|
+
JSX.createElement("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }),
|
|
50
|
+
JSX.createElement("link", { rel: "stylesheet", href: context.relativeURL("assets/style.css", true) }),
|
|
51
|
+
JSX.createElement("link", { rel: "stylesheet", href: context.relativeURL("assets/highlight.css", true) }),
|
|
52
|
+
context.options.getValue("customCss") && (JSX.createElement("link", { rel: "stylesheet", href: context.relativeURL("assets/custom.css", true) })),
|
|
53
|
+
JSX.createElement("script", { defer: true, src: context.relativeURL("assets/main.js", true) }),
|
|
54
|
+
context.options.getValue("customJs") && (JSX.createElement("script", { defer: true, src: context.relativeURL("assets/custom.js", true) })),
|
|
55
|
+
JSX.createElement("script", { async: true, src: context.relativeURL("assets/icons.js", true), id: "tsd-icons-script" }),
|
|
56
|
+
JSX.createElement("script", { async: true, src: context.relativeURL("assets/search.js", true), id: "tsd-search-script" }),
|
|
57
|
+
JSX.createElement("script", { async: true, src: context.relativeURL("assets/navigation.js", true), id: "tsd-nav-script" }),
|
|
24
58
|
context.hook("head.end", context)),
|
|
25
|
-
|
|
59
|
+
JSX.createElement("body", null,
|
|
26
60
|
context.hook("body.begin", context),
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
61
|
+
JSX.createElement("script", null,
|
|
62
|
+
JSX.createElement(Raw, { html: 'document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";' }),
|
|
63
|
+
JSX.createElement(Raw, { html: 'document.body.style.display="none";' }),
|
|
64
|
+
JSX.createElement(Raw, { html: 'setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)' })),
|
|
31
65
|
context.toolbar(props),
|
|
32
|
-
|
|
33
|
-
|
|
66
|
+
JSX.createElement("div", { class: "container container-main" },
|
|
67
|
+
JSX.createElement("div", { class: "col-content" },
|
|
34
68
|
context.hook("content.begin", context),
|
|
35
69
|
context.header(props),
|
|
36
70
|
template(props),
|
|
37
71
|
context.hook("content.end", context)),
|
|
38
|
-
|
|
39
|
-
|
|
72
|
+
JSX.createElement("div", { class: "col-sidebar" },
|
|
73
|
+
JSX.createElement("div", { class: "page-menu" },
|
|
40
74
|
context.hook("pageSidebar.begin", context),
|
|
41
75
|
context.pageSidebar(props),
|
|
42
76
|
context.hook("pageSidebar.end", context)),
|
|
43
|
-
|
|
77
|
+
JSX.createElement("div", { class: "site-menu" },
|
|
44
78
|
context.hook("sidebar.begin", context),
|
|
45
79
|
context.sidebar(props),
|
|
46
80
|
context.hook("sidebar.end", context)))),
|
|
47
81
|
context.footer(),
|
|
48
|
-
|
|
82
|
+
JSX.createElement("div", { class: "overlay" }),
|
|
49
83
|
context.hook("body.end", context))));
|
|
50
|
-
exports.defaultLayout = defaultLayout;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { JSX } from "../../../../utils";
|
|
2
|
-
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
|
|
1
|
+
import { JSX } from "../../../../utils/index.js";
|
|
2
|
+
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
|
|
3
3
|
export declare function anchorIcon(context: DefaultThemeRenderContext, anchor: string | undefined): JSX.Element;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.anchorIcon = anchorIcon;
|
|
4
|
-
const utils_1 = require("../../../../utils");
|
|
5
|
-
function anchorIcon(context, anchor) {
|
|
1
|
+
import { JSX } from "../../../../utils/index.js";
|
|
2
|
+
export function anchorIcon(context, anchor) {
|
|
6
3
|
if (!anchor)
|
|
7
|
-
return
|
|
8
|
-
return (
|
|
4
|
+
return JSX.createElement(JSX.Fragment, null);
|
|
5
|
+
return (JSX.createElement("a", { href: `#${anchor}`, "aria-label": context.i18n.theme_permalink(), class: "tsd-anchor-icon" }, context.icons.anchor()));
|
|
9
6
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
|
|
2
|
-
import { JSX } from "../../../../utils";
|
|
3
|
-
import type { Reflection } from "../../../../models";
|
|
1
|
+
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
|
|
2
|
+
import { JSX } from "../../../../utils/index.js";
|
|
3
|
+
import type { Reflection } from "../../../../models/index.js";
|
|
4
4
|
export declare const breadcrumb: (context: DefaultThemeRenderContext, props: Reflection) => JSX.Element | undefined;
|