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
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { ProjectReflection, Reflection } from "../models/reflections/index";
|
|
3
|
-
import type { Renderer } from "./renderer";
|
|
4
|
-
import { RendererEvent, PageEvent } from "./events";
|
|
5
|
-
export { Component };
|
|
1
|
+
import { AbstractComponent } from "../utils/component.js";
|
|
2
|
+
import type { ProjectReflection, Reflection } from "../models/reflections/index.js";
|
|
3
|
+
import type { Renderer } from "./renderer.js";
|
|
4
|
+
import { RendererEvent, PageEvent } from "./events.js";
|
|
6
5
|
export declare abstract class RendererComponent extends AbstractComponent<Renderer, {}> {
|
|
7
6
|
}
|
|
8
7
|
/**
|
|
@@ -30,12 +29,7 @@ export declare abstract class ContextAwareRendererComponent extends RendererComp
|
|
|
30
29
|
protected urlPrefix: RegExp;
|
|
31
30
|
private get hostedBaseUrl();
|
|
32
31
|
private accessor useHostedBaseUrlForAbsoluteLinks;
|
|
33
|
-
|
|
34
|
-
* Create a new ContextAwareRendererPlugin instance.
|
|
35
|
-
*
|
|
36
|
-
* @param renderer The renderer this plugin should be attached to.
|
|
37
|
-
*/
|
|
38
|
-
protected initialize(): void;
|
|
32
|
+
constructor(owner: Renderer);
|
|
39
33
|
private absoluteToRelativePathMap;
|
|
40
34
|
/**
|
|
41
35
|
* Transform the given absolute path into a relative path.
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
1
|
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
19
2
|
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
20
3
|
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
@@ -49,126 +32,102 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
49
32
|
}
|
|
50
33
|
return useValue ? value : void 0;
|
|
51
34
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return result;
|
|
58
|
-
};
|
|
59
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
60
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
61
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
62
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
63
|
-
};
|
|
64
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
65
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
66
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
67
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
68
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
69
|
-
};
|
|
70
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
71
|
-
exports.ContextAwareRendererComponent = exports.RendererComponent = exports.Component = void 0;
|
|
72
|
-
const Path = __importStar(require("path"));
|
|
73
|
-
const component_1 = require("../utils/component");
|
|
74
|
-
Object.defineProperty(exports, "Component", { enumerable: true, get: function () { return component_1.Component; } });
|
|
75
|
-
const events_1 = require("./events");
|
|
76
|
-
const utils_1 = require("../utils");
|
|
77
|
-
class RendererComponent extends component_1.AbstractComponent {
|
|
35
|
+
import * as Path from "path";
|
|
36
|
+
import { AbstractComponent } from "../utils/component.js";
|
|
37
|
+
import { RendererEvent, PageEvent } from "./events.js";
|
|
38
|
+
import { Option } from "../utils/index.js";
|
|
39
|
+
export class RendererComponent extends AbstractComponent {
|
|
78
40
|
}
|
|
79
|
-
exports.RendererComponent = RendererComponent;
|
|
80
41
|
/**
|
|
81
42
|
* A plugin for the renderer that reads the current render context.
|
|
82
43
|
*/
|
|
83
44
|
let ContextAwareRendererComponent = (() => {
|
|
84
|
-
var _a, _ContextAwareRendererComponent_useHostedBaseUrlForAbsoluteLinks_accessor_storage;
|
|
85
45
|
let _classSuper = RendererComponent;
|
|
86
46
|
let _useHostedBaseUrlForAbsoluteLinks_decorators;
|
|
87
47
|
let _useHostedBaseUrlForAbsoluteLinks_initializers = [];
|
|
88
48
|
let _useHostedBaseUrlForAbsoluteLinks_extraInitializers = [];
|
|
89
|
-
return
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
49
|
+
return class ContextAwareRendererComponent extends _classSuper {
|
|
50
|
+
static {
|
|
51
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
52
|
+
_useHostedBaseUrlForAbsoluteLinks_decorators = [Option("useHostedBaseUrlForAbsoluteLinks")];
|
|
53
|
+
__esDecorate(this, null, _useHostedBaseUrlForAbsoluteLinks_decorators, { kind: "accessor", name: "useHostedBaseUrlForAbsoluteLinks", static: false, private: false, access: { has: obj => "useHostedBaseUrlForAbsoluteLinks" in obj, get: obj => obj.useHostedBaseUrlForAbsoluteLinks, set: (obj, value) => { obj.useHostedBaseUrlForAbsoluteLinks = value; } }, metadata: _metadata }, _useHostedBaseUrlForAbsoluteLinks_initializers, _useHostedBaseUrlForAbsoluteLinks_extraInitializers);
|
|
54
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The project that is currently processed.
|
|
58
|
+
*/
|
|
59
|
+
project;
|
|
60
|
+
/**
|
|
61
|
+
* The reflection that is currently processed.
|
|
62
|
+
*/
|
|
63
|
+
page;
|
|
64
|
+
/**
|
|
65
|
+
* The url of the document that is being currently generated.
|
|
66
|
+
* Set when a page begins rendering.
|
|
67
|
+
*
|
|
68
|
+
* Defaulted to '.' so that tests don't have to set up events.
|
|
69
|
+
*/
|
|
70
|
+
location = ".";
|
|
71
|
+
/**
|
|
72
|
+
* Regular expression to test if a string looks like an external url.
|
|
73
|
+
*/
|
|
74
|
+
urlPrefix = /^(http|ftp)s?:\/\//;
|
|
75
|
+
get hostedBaseUrl() {
|
|
76
|
+
const url = this.application.options.getValue("hostedBaseUrl");
|
|
77
|
+
return !url || url.endsWith("/") ? url : url + "/";
|
|
78
|
+
}
|
|
79
|
+
#useHostedBaseUrlForAbsoluteLinks_accessor_storage = __runInitializers(this, _useHostedBaseUrlForAbsoluteLinks_initializers, void 0);
|
|
80
|
+
get useHostedBaseUrlForAbsoluteLinks() { return this.#useHostedBaseUrlForAbsoluteLinks_accessor_storage; }
|
|
81
|
+
set useHostedBaseUrlForAbsoluteLinks(value) { this.#useHostedBaseUrlForAbsoluteLinks_accessor_storage = value; }
|
|
82
|
+
constructor(owner) {
|
|
83
|
+
super(owner);
|
|
84
|
+
this.owner.on(RendererEvent.BEGIN, this.onBeginRenderer.bind(this));
|
|
85
|
+
this.owner.on(PageEvent.BEGIN, this.onBeginPage.bind(this));
|
|
86
|
+
this.owner.on(RendererEvent.END, () => this.absoluteToRelativePathMap.clear());
|
|
87
|
+
}
|
|
88
|
+
absoluteToRelativePathMap = (__runInitializers(this, _useHostedBaseUrlForAbsoluteLinks_extraInitializers), new Map());
|
|
89
|
+
/**
|
|
90
|
+
* Transform the given absolute path into a relative path.
|
|
91
|
+
*
|
|
92
|
+
* @param absolute The absolute path to transform.
|
|
93
|
+
* @returns A path relative to the document currently processed.
|
|
94
|
+
*/
|
|
95
|
+
getRelativeUrl(absolute) {
|
|
96
|
+
if (this.urlPrefix.test(absolute)) {
|
|
97
|
+
return absolute;
|
|
121
98
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
if (this.urlPrefix.test(absolute)) {
|
|
130
|
-
return absolute;
|
|
99
|
+
else {
|
|
100
|
+
const key = `${this.location}:${absolute}`;
|
|
101
|
+
let path = this.absoluteToRelativePathMap.get(key);
|
|
102
|
+
if (path)
|
|
103
|
+
return path;
|
|
104
|
+
if (this.useHostedBaseUrlForAbsoluteLinks) {
|
|
105
|
+
path = new URL(absolute, this.hostedBaseUrl).toString();
|
|
131
106
|
}
|
|
132
107
|
else {
|
|
133
|
-
|
|
134
|
-
let path = this.absoluteToRelativePathMap.get(key);
|
|
135
|
-
if (path)
|
|
136
|
-
return path;
|
|
137
|
-
if (this.useHostedBaseUrlForAbsoluteLinks) {
|
|
138
|
-
path = new URL(absolute, this.hostedBaseUrl).toString();
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
path = Path.posix.relative(this.location, absolute) || ".";
|
|
142
|
-
}
|
|
143
|
-
this.absoluteToRelativePathMap.set(key, path);
|
|
144
|
-
return path;
|
|
108
|
+
path = Path.posix.relative(this.location, absolute) || ".";
|
|
145
109
|
}
|
|
110
|
+
this.absoluteToRelativePathMap.set(key, path);
|
|
111
|
+
return path;
|
|
146
112
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
(() => {
|
|
167
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
168
|
-
_useHostedBaseUrlForAbsoluteLinks_decorators = [(0, utils_1.Option)("useHostedBaseUrlForAbsoluteLinks")];
|
|
169
|
-
__esDecorate(_a, null, _useHostedBaseUrlForAbsoluteLinks_decorators, { kind: "accessor", name: "useHostedBaseUrlForAbsoluteLinks", static: false, private: false, access: { has: obj => "useHostedBaseUrlForAbsoluteLinks" in obj, get: obj => obj.useHostedBaseUrlForAbsoluteLinks, set: (obj, value) => { obj.useHostedBaseUrlForAbsoluteLinks = value; } }, metadata: _metadata }, _useHostedBaseUrlForAbsoluteLinks_initializers, _useHostedBaseUrlForAbsoluteLinks_extraInitializers);
|
|
170
|
-
if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
171
|
-
})(),
|
|
172
|
-
_a;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Triggered before the renderer starts rendering a project.
|
|
116
|
+
*
|
|
117
|
+
* @param event An event object describing the current render operation.
|
|
118
|
+
*/
|
|
119
|
+
onBeginRenderer(event) {
|
|
120
|
+
this.project = event.project;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Triggered before a document will be rendered.
|
|
124
|
+
*
|
|
125
|
+
* @param page An event object describing the current render operation.
|
|
126
|
+
*/
|
|
127
|
+
onBeginPage(page) {
|
|
128
|
+
this.location = Path.posix.dirname(page.url);
|
|
129
|
+
this.page = page;
|
|
130
|
+
}
|
|
131
|
+
};
|
|
173
132
|
})();
|
|
174
|
-
|
|
133
|
+
export { ContextAwareRendererComponent };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ProjectReflection } from "../models/reflections/project";
|
|
2
|
-
import type { RenderTemplate, UrlMapping } from "./models/UrlMapping";
|
|
3
|
-
import type { DeclarationReflection, DocumentReflection, Reflection, ReflectionKind } from "../models";
|
|
1
|
+
import type { ProjectReflection } from "../models/reflections/project.js";
|
|
2
|
+
import type { RenderTemplate, UrlMapping } from "./models/UrlMapping.js";
|
|
3
|
+
import type { DeclarationReflection, DocumentReflection, Reflection, ReflectionKind } from "../models/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* An event emitted by the {@link Renderer} class at the very beginning and
|
|
6
6
|
* ending of the entire rendering process.
|
|
@@ -1,30 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.IndexEvent = exports.MarkdownEvent = exports.PageEvent = exports.RendererEvent = void 0;
|
|
27
|
-
const Path = __importStar(require("path"));
|
|
1
|
+
import * as Path from "path";
|
|
28
2
|
/**
|
|
29
3
|
* An event emitted by the {@link Renderer} class at the very beginning and
|
|
30
4
|
* ending of the entire rendering process.
|
|
@@ -32,7 +6,31 @@ const Path = __importStar(require("path"));
|
|
|
32
6
|
* @see {@link Renderer.EVENT_BEGIN}
|
|
33
7
|
* @see {@link Renderer.EVENT_END}
|
|
34
8
|
*/
|
|
35
|
-
class RendererEvent {
|
|
9
|
+
export class RendererEvent {
|
|
10
|
+
/**
|
|
11
|
+
* The project the renderer is currently processing.
|
|
12
|
+
*/
|
|
13
|
+
project;
|
|
14
|
+
/**
|
|
15
|
+
* The path of the directory the documentation should be written to.
|
|
16
|
+
*/
|
|
17
|
+
outputDirectory;
|
|
18
|
+
/**
|
|
19
|
+
* A list of all pages that should be generated.
|
|
20
|
+
*
|
|
21
|
+
* This list can be altered during the {@link Renderer.EVENT_BEGIN} event.
|
|
22
|
+
*/
|
|
23
|
+
urls;
|
|
24
|
+
/**
|
|
25
|
+
* Triggered before the renderer starts rendering a project.
|
|
26
|
+
* @event
|
|
27
|
+
*/
|
|
28
|
+
static BEGIN = "beginRender";
|
|
29
|
+
/**
|
|
30
|
+
* Triggered after the renderer has written all documents.
|
|
31
|
+
* @event
|
|
32
|
+
*/
|
|
33
|
+
static END = "endRender";
|
|
36
34
|
constructor(outputDirectory, project) {
|
|
37
35
|
this.outputDirectory = outputDirectory;
|
|
38
36
|
this.project = project;
|
|
@@ -52,17 +50,6 @@ class RendererEvent {
|
|
|
52
50
|
return [mapping.template, event];
|
|
53
51
|
}
|
|
54
52
|
}
|
|
55
|
-
exports.RendererEvent = RendererEvent;
|
|
56
|
-
/**
|
|
57
|
-
* Triggered before the renderer starts rendering a project.
|
|
58
|
-
* @event
|
|
59
|
-
*/
|
|
60
|
-
RendererEvent.BEGIN = "beginRender";
|
|
61
|
-
/**
|
|
62
|
-
* Triggered after the renderer has written all documents.
|
|
63
|
-
* @event
|
|
64
|
-
*/
|
|
65
|
-
RendererEvent.END = "endRender";
|
|
66
53
|
/**
|
|
67
54
|
* An event emitted by the {@link Renderer} class before and after the
|
|
68
55
|
* markup of a page is rendered.
|
|
@@ -70,7 +57,43 @@ RendererEvent.END = "endRender";
|
|
|
70
57
|
* @see {@link Renderer.EVENT_BEGIN_PAGE}
|
|
71
58
|
* @see {@link Renderer.EVENT_END_PAGE}
|
|
72
59
|
*/
|
|
73
|
-
class PageEvent {
|
|
60
|
+
export class PageEvent {
|
|
61
|
+
/**
|
|
62
|
+
* The project the renderer is currently processing.
|
|
63
|
+
*/
|
|
64
|
+
project;
|
|
65
|
+
/**
|
|
66
|
+
* The filename the page will be written to.
|
|
67
|
+
*/
|
|
68
|
+
filename;
|
|
69
|
+
/**
|
|
70
|
+
* The url this page will be located at.
|
|
71
|
+
*/
|
|
72
|
+
url;
|
|
73
|
+
/**
|
|
74
|
+
* The model that should be rendered on this page.
|
|
75
|
+
*/
|
|
76
|
+
model;
|
|
77
|
+
/**
|
|
78
|
+
* The final html content of this page.
|
|
79
|
+
*
|
|
80
|
+
* Should be rendered by layout templates and can be modified by plugins.
|
|
81
|
+
*/
|
|
82
|
+
contents;
|
|
83
|
+
/**
|
|
84
|
+
* Links to content within this page that should be rendered in the page navigation.
|
|
85
|
+
* This is built when rendering the document content.
|
|
86
|
+
*/
|
|
87
|
+
pageHeadings = [];
|
|
88
|
+
/**
|
|
89
|
+
* Sections of the page, generally set by `@group`s
|
|
90
|
+
*/
|
|
91
|
+
pageSections = [
|
|
92
|
+
{
|
|
93
|
+
title: "",
|
|
94
|
+
headings: this.pageHeadings,
|
|
95
|
+
},
|
|
96
|
+
];
|
|
74
97
|
/**
|
|
75
98
|
* Start a new section of the page. Sections are collapsible within
|
|
76
99
|
* the "On This Page" sidebar.
|
|
@@ -82,21 +105,17 @@ class PageEvent {
|
|
|
82
105
|
headings: this.pageHeadings,
|
|
83
106
|
});
|
|
84
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Triggered before a document will be rendered.
|
|
110
|
+
* @event
|
|
111
|
+
*/
|
|
112
|
+
static BEGIN = "beginPage";
|
|
113
|
+
/**
|
|
114
|
+
* Triggered after a document has been rendered, just before it is written to disc.
|
|
115
|
+
* @event
|
|
116
|
+
*/
|
|
117
|
+
static END = "endPage";
|
|
85
118
|
constructor(nameOrModel, model) {
|
|
86
|
-
/**
|
|
87
|
-
* Links to content within this page that should be rendered in the page navigation.
|
|
88
|
-
* This is built when rendering the document content.
|
|
89
|
-
*/
|
|
90
|
-
this.pageHeadings = [];
|
|
91
|
-
/**
|
|
92
|
-
* Sections of the page, generally set by `@group`s
|
|
93
|
-
*/
|
|
94
|
-
this.pageSections = [
|
|
95
|
-
{
|
|
96
|
-
title: "",
|
|
97
|
-
headings: this.pageHeadings,
|
|
98
|
-
},
|
|
99
|
-
];
|
|
100
119
|
if (typeof nameOrModel === "string") {
|
|
101
120
|
this.model = model;
|
|
102
121
|
}
|
|
@@ -105,39 +124,75 @@ class PageEvent {
|
|
|
105
124
|
}
|
|
106
125
|
}
|
|
107
126
|
}
|
|
108
|
-
exports.PageEvent = PageEvent;
|
|
109
|
-
/**
|
|
110
|
-
* Triggered before a document will be rendered.
|
|
111
|
-
* @event
|
|
112
|
-
*/
|
|
113
|
-
PageEvent.BEGIN = "beginPage";
|
|
114
|
-
/**
|
|
115
|
-
* Triggered after a document has been rendered, just before it is written to disc.
|
|
116
|
-
* @event
|
|
117
|
-
*/
|
|
118
|
-
PageEvent.END = "endPage";
|
|
119
127
|
/**
|
|
120
128
|
* An event emitted when markdown is being parsed. Allows other plugins to manipulate the result.
|
|
121
129
|
*
|
|
122
130
|
* @see {@link MarkdownEvent.PARSE}
|
|
123
131
|
*/
|
|
124
|
-
class MarkdownEvent {
|
|
132
|
+
export class MarkdownEvent {
|
|
133
|
+
/**
|
|
134
|
+
* The unparsed original text.
|
|
135
|
+
*/
|
|
136
|
+
originalText;
|
|
137
|
+
/**
|
|
138
|
+
* The parsed output.
|
|
139
|
+
*/
|
|
140
|
+
parsedText;
|
|
141
|
+
/**
|
|
142
|
+
* The page that this markdown is being parsed for.
|
|
143
|
+
*/
|
|
144
|
+
page;
|
|
145
|
+
/**
|
|
146
|
+
* Triggered on the renderer when this plugin parses a markdown string.
|
|
147
|
+
* @event
|
|
148
|
+
*/
|
|
149
|
+
static PARSE = "parseMarkdown";
|
|
125
150
|
constructor(page, originalText, parsedText) {
|
|
126
151
|
this.page = page;
|
|
127
152
|
this.originalText = originalText;
|
|
128
153
|
this.parsedText = parsedText;
|
|
129
154
|
}
|
|
130
155
|
}
|
|
131
|
-
exports.MarkdownEvent = MarkdownEvent;
|
|
132
|
-
/**
|
|
133
|
-
* Triggered on the renderer when this plugin parses a markdown string.
|
|
134
|
-
* @event
|
|
135
|
-
*/
|
|
136
|
-
MarkdownEvent.PARSE = "parseMarkdown";
|
|
137
156
|
/**
|
|
138
157
|
* An event emitted when the search index is being prepared.
|
|
139
158
|
*/
|
|
140
|
-
class IndexEvent {
|
|
159
|
+
export class IndexEvent {
|
|
160
|
+
/**
|
|
161
|
+
* Triggered on the renderer when the search index is being prepared.
|
|
162
|
+
* @event
|
|
163
|
+
*/
|
|
164
|
+
static PREPARE_INDEX = "prepareIndex";
|
|
165
|
+
/**
|
|
166
|
+
* May be filtered by plugins to reduce the results available.
|
|
167
|
+
* Additional items *should not* be added to this array.
|
|
168
|
+
*
|
|
169
|
+
* If you remove an index from this array, you must also remove the
|
|
170
|
+
* same index from {@link searchFields}. The {@link removeResult} helper
|
|
171
|
+
* will do this for you.
|
|
172
|
+
*/
|
|
173
|
+
searchResults;
|
|
174
|
+
/**
|
|
175
|
+
* Additional search fields to be used when creating the search index.
|
|
176
|
+
* `name`, `comment` and `document` may be specified to overwrite TypeDoc's search fields.
|
|
177
|
+
*
|
|
178
|
+
* Do not use `id` as a custom search field.
|
|
179
|
+
*/
|
|
180
|
+
searchFields;
|
|
181
|
+
/**
|
|
182
|
+
* Weights for the fields defined in `searchFields`. The default will weight
|
|
183
|
+
* `name` as 10x more important than comment and document content.
|
|
184
|
+
*
|
|
185
|
+
* If a field added to {@link searchFields} is not added to this object, it
|
|
186
|
+
* will **not** be searchable.
|
|
187
|
+
*
|
|
188
|
+
* Do not replace this object, instead, set new properties on it for custom search
|
|
189
|
+
* fields added by your plugin.
|
|
190
|
+
*/
|
|
191
|
+
searchFieldWeights = {
|
|
192
|
+
name: 10,
|
|
193
|
+
comment: 1,
|
|
194
|
+
document: 1,
|
|
195
|
+
};
|
|
141
196
|
/**
|
|
142
197
|
* Remove a search result by index.
|
|
143
198
|
*/
|
|
@@ -146,28 +201,7 @@ class IndexEvent {
|
|
|
146
201
|
this.searchFields.splice(index, 1);
|
|
147
202
|
}
|
|
148
203
|
constructor(searchResults) {
|
|
149
|
-
/**
|
|
150
|
-
* Weights for the fields defined in `searchFields`. The default will weight
|
|
151
|
-
* `name` as 10x more important than comment and document content.
|
|
152
|
-
*
|
|
153
|
-
* If a field added to {@link searchFields} is not added to this object, it
|
|
154
|
-
* will **not** be searchable.
|
|
155
|
-
*
|
|
156
|
-
* Do not replace this object, instead, set new properties on it for custom search
|
|
157
|
-
* fields added by your plugin.
|
|
158
|
-
*/
|
|
159
|
-
this.searchFieldWeights = {
|
|
160
|
-
name: 10,
|
|
161
|
-
comment: 1,
|
|
162
|
-
document: 1,
|
|
163
|
-
};
|
|
164
204
|
this.searchResults = searchResults;
|
|
165
205
|
this.searchFields = Array.from({ length: this.searchResults.length }, () => ({}));
|
|
166
206
|
}
|
|
167
207
|
}
|
|
168
|
-
exports.IndexEvent = IndexEvent;
|
|
169
|
-
/**
|
|
170
|
-
* Triggered on the renderer when the search index is being prepared.
|
|
171
|
-
* @event
|
|
172
|
-
*/
|
|
173
|
-
IndexEvent.PREPARE_INDEX = "prepareIndex";
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { TypeContext, type SomeType } from "../models/types.js";
|
|
2
|
+
import { JSX } from "../utils/index.js";
|
|
3
|
+
import { type Reflection, type DeclarationReflection, type SignatureReflection } from "../models/index.js";
|
|
4
|
+
export type FormatterNode = {
|
|
5
|
+
type: "text";
|
|
6
|
+
content: string;
|
|
7
|
+
} | {
|
|
8
|
+
type: "element";
|
|
9
|
+
content: JSX.Element;
|
|
10
|
+
length: number;
|
|
11
|
+
} | {
|
|
12
|
+
type: "line";
|
|
13
|
+
} | {
|
|
14
|
+
type: "space_or_line";
|
|
15
|
+
} | {
|
|
16
|
+
type: "indent";
|
|
17
|
+
content: FormatterNode[];
|
|
18
|
+
} | {
|
|
19
|
+
type: "group";
|
|
20
|
+
id: number;
|
|
21
|
+
content: FormatterNode[];
|
|
22
|
+
} | {
|
|
23
|
+
type: "nodes";
|
|
24
|
+
content: FormatterNode[];
|
|
25
|
+
} | {
|
|
26
|
+
type: "if_wrap";
|
|
27
|
+
id: number;
|
|
28
|
+
true: FormatterNode;
|
|
29
|
+
false: FormatterNode;
|
|
30
|
+
};
|
|
31
|
+
export declare enum Wrap {
|
|
32
|
+
Detect = 0,
|
|
33
|
+
Enable = 1
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Responsible for rendering nodes
|
|
37
|
+
*/
|
|
38
|
+
export declare class FormattedCodeGenerator {
|
|
39
|
+
private buffer;
|
|
40
|
+
/** Indentation level, not number of chars */
|
|
41
|
+
private indent;
|
|
42
|
+
/** The number of characters on the current line */
|
|
43
|
+
private size;
|
|
44
|
+
/** Maximum number of characters allowed per line */
|
|
45
|
+
private max;
|
|
46
|
+
/** Groups which need to be wrapped */
|
|
47
|
+
private wrapped;
|
|
48
|
+
constructor(maxWidth?: number, startWidth?: number);
|
|
49
|
+
forceWrap(wrapped: Set<number>): void;
|
|
50
|
+
toElement(): JSX.Element;
|
|
51
|
+
node(node: FormatterNode, wrap: Wrap): void;
|
|
52
|
+
private text;
|
|
53
|
+
private newLine;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Responsible for generating Nodes from a type tree.
|
|
57
|
+
*/
|
|
58
|
+
export declare class FormattedCodeBuilder {
|
|
59
|
+
readonly urlTo: (refl: Reflection) => string;
|
|
60
|
+
forceWrap: Set<number>;
|
|
61
|
+
id: number;
|
|
62
|
+
constructor(urlTo: (refl: Reflection) => string);
|
|
63
|
+
newId(): number;
|
|
64
|
+
type(type: SomeType | undefined, where: TypeContext, options?: {
|
|
65
|
+
topLevelLinks: boolean;
|
|
66
|
+
}): FormatterNode;
|
|
67
|
+
reflection(reflection: DeclarationReflection, options: {
|
|
68
|
+
topLevelLinks: boolean;
|
|
69
|
+
}): FormatterNode;
|
|
70
|
+
interface(item: DeclarationReflection): FormatterNode;
|
|
71
|
+
member(members: FormatterNode[], item: DeclarationReflection, options: {
|
|
72
|
+
topLevelLinks: boolean;
|
|
73
|
+
}): void;
|
|
74
|
+
signature(sig: SignatureReflection, options: {
|
|
75
|
+
topLevelLinks?: boolean;
|
|
76
|
+
hideName?: boolean;
|
|
77
|
+
arrowStyle?: boolean;
|
|
78
|
+
}): FormatterNode;
|
|
79
|
+
private typeParameters;
|
|
80
|
+
private typeParameter;
|
|
81
|
+
private parameters;
|
|
82
|
+
private parameter;
|
|
83
|
+
private propertyName;
|
|
84
|
+
}
|