typedoc 0.28.13 → 0.28.15
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/dist/lib/cli.js +2 -1
- package/dist/lib/converter/comments/index.d.ts +3 -1
- package/dist/lib/converter/comments/parser.js +61 -23
- package/dist/lib/converter/comments/textParser.d.ts +13 -9
- package/dist/lib/converter/comments/textParser.js +21 -16
- package/dist/lib/converter/converter.js +2 -0
- package/dist/lib/converter/factories/signature.js +5 -4
- package/dist/lib/converter/plugins/CommentPlugin.d.ts +1 -0
- package/dist/lib/converter/plugins/CommentPlugin.js +48 -11
- package/dist/lib/converter/symbols.js +15 -8
- package/dist/lib/converter/types.js +18 -6
- package/dist/lib/converter/utils/repository.js +3 -0
- package/dist/lib/internationalization/locales/de.cjs +0 -1
- package/dist/lib/internationalization/locales/de.d.cts +0 -1
- package/dist/lib/internationalization/locales/en.cjs +3 -1
- package/dist/lib/internationalization/locales/en.d.cts +3 -1
- package/dist/lib/internationalization/locales/ja.cjs +0 -1
- package/dist/lib/internationalization/locales/ja.d.cts +0 -1
- package/dist/lib/internationalization/locales/ko.cjs +0 -1
- package/dist/lib/internationalization/locales/ko.d.cts +0 -1
- package/dist/lib/internationalization/locales/zh.cjs +0 -1
- package/dist/lib/internationalization/locales/zh.d.cts +0 -1
- package/dist/lib/models/Comment.d.ts +5 -0
- package/dist/lib/models/Comment.js +10 -0
- package/dist/lib/models/DeclarationReflection.d.ts +7 -0
- package/dist/lib/models/DeclarationReflection.js +9 -0
- package/dist/lib/output/events.d.ts +2 -0
- package/dist/lib/output/events.js +1 -0
- package/dist/lib/output/plugins/JavascriptIndexPlugin.js +1 -1
- package/dist/lib/output/themes/MarkedPlugin.js +8 -1
- package/dist/lib/output/themes/default/Slugger.d.ts +1 -1
- package/dist/lib/output/themes/default/Slugger.js +13 -5
- package/dist/lib/output/themes/default/partials/comment.js +1 -0
- package/dist/lib/output/themes/default/partials/member.js +1 -0
- package/dist/lib/output/themes/default/partials/moduleReflection.js +1 -0
- package/dist/lib/output/themes/default/partials/navigation.js +1 -1
- package/dist/lib/serialization/schema.d.ts +2 -2
- package/dist/lib/utils/options/declaration.d.ts +6 -0
- package/dist/lib/utils/options/defaults.d.ts +1 -0
- package/dist/lib/utils/options/defaults.js +1 -0
- package/dist/lib/utils/options/sources/typedoc.js +14 -0
- package/dist/lib/utils/options/tsdoc-defaults.d.ts +2 -2
- package/dist/lib/utils/options/tsdoc-defaults.js +2 -1
- package/dist/lib/utils-common/general.js +2 -0
- package/dist/lib/utils-common/logger.d.ts +12 -1
- package/dist/lib/utils-common/logger.js +9 -0
- package/dist/lib/validation/documentation.js +2 -2
- package/dist/lib/validation/exports.js +2 -2
- package/dist/lib/validation/links.js +7 -7
- package/package.json +14 -14
- package/static/style.css +3 -3
- package/tsdoc.json +5 -4
|
@@ -150,7 +150,6 @@ declare const _default: {
|
|
|
150
150
|
help_excludeNotDocumentedKinds: string;
|
|
151
151
|
help_excludeInternal: string;
|
|
152
152
|
help_excludeCategories: string;
|
|
153
|
-
help_excludePrivate: string;
|
|
154
153
|
help_excludeProtected: string;
|
|
155
154
|
help_excludeReferences: string;
|
|
156
155
|
help_externalSymbolLinkMappings: string;
|
|
@@ -168,7 +168,8 @@ module.exports = {
|
|
|
168
168
|
help_excludeNotDocumentedKinds: "Specify the type of reflections that can be removed by excludeNotDocumented",
|
|
169
169
|
help_excludeInternal: "Prevent symbols that are marked with @internal from being documented",
|
|
170
170
|
help_excludeCategories: "Exclude symbols within this category from the documentation",
|
|
171
|
-
help_excludePrivate: "Ignore private
|
|
171
|
+
help_excludePrivate: "Ignore members marked with the private keyword and #private class fields, defaults to true.",
|
|
172
|
+
help_excludePrivateClassFields: "Ignore #private class fields, defaults to true.",
|
|
172
173
|
help_excludeProtected: "Ignore protected variables and methods",
|
|
173
174
|
help_excludeReferences: "If a symbol is exported multiple times, ignore all but the first export",
|
|
174
175
|
help_externalSymbolLinkMappings: "Define custom links for symbols not included in the documentation",
|
|
@@ -200,6 +201,7 @@ module.exports = {
|
|
|
200
201
|
help_excludeTags: "Remove the listed block/modifier tags from doc comments",
|
|
201
202
|
help_notRenderedTags: "Tags which will be preserved in doc comments, but not rendered when creating output",
|
|
202
203
|
help_cascadedModifierTags: "Modifier tags which should be copied to all children of the parent reflection",
|
|
204
|
+
help_preservedTypeAnnotationTags: "Block tags whose type annotations should be preserved in the output.",
|
|
203
205
|
help_readme: "Path to the readme file that should be displayed on the index page. Pass `none` to disable the index page and start the documentation on the globals page",
|
|
204
206
|
help_basePath: "Specifies a path which links may be resolved relative to.",
|
|
205
207
|
help_cname: "Set the CNAME file text, it's useful for custom domains on GitHub Pages",
|
|
@@ -155,7 +155,8 @@ declare const _default: {
|
|
|
155
155
|
readonly help_excludeNotDocumentedKinds: "Specify the type of reflections that can be removed by excludeNotDocumented";
|
|
156
156
|
readonly help_excludeInternal: "Prevent symbols that are marked with @internal from being documented";
|
|
157
157
|
readonly help_excludeCategories: "Exclude symbols within this category from the documentation";
|
|
158
|
-
readonly help_excludePrivate: "Ignore private
|
|
158
|
+
readonly help_excludePrivate: "Ignore members marked with the private keyword and #private class fields, defaults to true.";
|
|
159
|
+
readonly help_excludePrivateClassFields: "Ignore #private class fields, defaults to true.";
|
|
159
160
|
readonly help_excludeProtected: "Ignore protected variables and methods";
|
|
160
161
|
readonly help_excludeReferences: "If a symbol is exported multiple times, ignore all but the first export";
|
|
161
162
|
readonly help_externalSymbolLinkMappings: "Define custom links for symbols not included in the documentation";
|
|
@@ -187,6 +188,7 @@ declare const _default: {
|
|
|
187
188
|
readonly help_excludeTags: "Remove the listed block/modifier tags from doc comments";
|
|
188
189
|
readonly help_notRenderedTags: "Tags which will be preserved in doc comments, but not rendered when creating output";
|
|
189
190
|
readonly help_cascadedModifierTags: "Modifier tags which should be copied to all children of the parent reflection";
|
|
191
|
+
readonly help_preservedTypeAnnotationTags: "Block tags whose type annotations should be preserved in the output.";
|
|
190
192
|
readonly help_readme: "Path to the readme file that should be displayed on the index page. Pass `none` to disable the index page and start the documentation on the globals page";
|
|
191
193
|
readonly help_basePath: "Specifies a path which links may be resolved relative to.";
|
|
192
194
|
readonly help_cname: "Set the CNAME file text, it's useful for custom domains on GitHub Pages";
|
|
@@ -129,7 +129,6 @@ module.exports = localeUtils.buildIncompleteTranslation({
|
|
|
129
129
|
help_excludeNotDocumentedKinds: "excludeNotDocumented によって削除できる反射の種類を指定します",
|
|
130
130
|
help_excludeInternal: "@internal でマークされたシンボルがドキュメント化されないようにする",
|
|
131
131
|
help_excludeCategories: "このカテゴリ内のシンボルをドキュメントから除外する",
|
|
132
|
-
help_excludePrivate: "プライベート変数とメソッドを無視します。デフォルトは true です。",
|
|
133
132
|
help_excludeProtected: "保護された変数とメソッドを無視する",
|
|
134
133
|
help_excludeReferences: "シンボルが複数回エクスポートされた場合、最初のエクスポート以外はすべて無視されます。",
|
|
135
134
|
help_externalSymbolLinkMappings: "ドキュメントに含まれていないシンボルのカスタムリンクを定義する",
|
|
@@ -119,7 +119,6 @@ declare const _default: {
|
|
|
119
119
|
help_excludeNotDocumentedKinds: string;
|
|
120
120
|
help_excludeInternal: string;
|
|
121
121
|
help_excludeCategories: string;
|
|
122
|
-
help_excludePrivate: string;
|
|
123
122
|
help_excludeProtected: string;
|
|
124
123
|
help_excludeReferences: string;
|
|
125
124
|
help_externalSymbolLinkMappings: string;
|
|
@@ -47,7 +47,6 @@ module.exports = localeUtils.buildIncompleteTranslation({
|
|
|
47
47
|
help_excludeNotDocumentedKinds: "excludeNotDocumented로 제거될 리플렉션 유형을 지정합니다",
|
|
48
48
|
help_excludeInternal: "@internal로 표시된 심볼이 문서화되지 않도록 방지합니다",
|
|
49
49
|
help_excludeCategories: "문서에서 제외할 카테고리 내의 심볼을 제외합니다",
|
|
50
|
-
help_excludePrivate: "비공개 변수와 메서드를 무시합니다. 기본값은 true입니다.",
|
|
51
50
|
help_excludeProtected: "보호된 변수와 메서드를 무시합니다",
|
|
52
51
|
help_excludeReferences: "심볼이 여러 번 내보내진 경우 첫 번째 내보내기를 제외하고 모두 무시합니다",
|
|
53
52
|
help_externalSymbolLinkMappings: "문서에 포함되지 않은 심볼에 대한 사용자 정의 링크를 정의합니다",
|
|
@@ -39,7 +39,6 @@ declare const _default: {
|
|
|
39
39
|
help_excludeNotDocumentedKinds: string;
|
|
40
40
|
help_excludeInternal: string;
|
|
41
41
|
help_excludeCategories: string;
|
|
42
|
-
help_excludePrivate: string;
|
|
43
42
|
help_excludeProtected: string;
|
|
44
43
|
help_excludeReferences: string;
|
|
45
44
|
help_externalSymbolLinkMappings: string;
|
|
@@ -167,7 +167,6 @@ module.exports = localeUtils.buildIncompleteTranslation({
|
|
|
167
167
|
help_excludeNotDocumentedKinds: "指定可以通过 excludeNotDocumented 删除的反射类型",
|
|
168
168
|
help_excludeInternal: "防止标有 @internal 的符号被记录",
|
|
169
169
|
help_excludeCategories: "从文档中排除此类别中的符号",
|
|
170
|
-
help_excludePrivate: "忽略私有变量和方法,默认为 true。",
|
|
171
170
|
help_excludeProtected: "忽略受保护的变量和方法",
|
|
172
171
|
help_excludeReferences: "如果一个符号被导出多次,则忽略除第一次导出之外的所有导出",
|
|
173
172
|
help_externalSymbolLinkMappings: "为文档中未包含的符号定义自定义链接",
|
|
@@ -152,7 +152,6 @@ declare const _default: {
|
|
|
152
152
|
help_excludeNotDocumentedKinds: string;
|
|
153
153
|
help_excludeInternal: string;
|
|
154
154
|
help_excludeCategories: string;
|
|
155
|
-
help_excludePrivate: string;
|
|
156
155
|
help_excludeProtected: string;
|
|
157
156
|
help_excludeReferences: string;
|
|
158
157
|
help_externalSymbolLinkMappings: string;
|
|
@@ -85,6 +85,11 @@ export declare class CommentTag {
|
|
|
85
85
|
* If this tag is one of those, it will be parsed out and included here.
|
|
86
86
|
*/
|
|
87
87
|
name?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Optional type annotation associated with this tag. TypeDoc will remove type annotations unless explicitly
|
|
90
|
+
* requested by the user with the `preservedTypeAnnotationTags` option.
|
|
91
|
+
*/
|
|
92
|
+
typeAnnotation?: string;
|
|
88
93
|
/**
|
|
89
94
|
* The actual body text of this tag.
|
|
90
95
|
*/
|
|
@@ -50,6 +50,11 @@ export class CommentTag {
|
|
|
50
50
|
* If this tag is one of those, it will be parsed out and included here.
|
|
51
51
|
*/
|
|
52
52
|
name;
|
|
53
|
+
/**
|
|
54
|
+
* Optional type annotation associated with this tag. TypeDoc will remove type annotations unless explicitly
|
|
55
|
+
* requested by the user with the `preservedTypeAnnotationTags` option.
|
|
56
|
+
*/
|
|
57
|
+
typeAnnotation;
|
|
53
58
|
/**
|
|
54
59
|
* The actual body text of this tag.
|
|
55
60
|
*/
|
|
@@ -83,6 +88,9 @@ export class CommentTag {
|
|
|
83
88
|
if (this.name) {
|
|
84
89
|
tag.name = this.name;
|
|
85
90
|
}
|
|
91
|
+
if (this.typeAnnotation) {
|
|
92
|
+
tag.typeAnnotation = this.typeAnnotation;
|
|
93
|
+
}
|
|
86
94
|
return tag;
|
|
87
95
|
}
|
|
88
96
|
toObject() {
|
|
@@ -90,11 +98,13 @@ export class CommentTag {
|
|
|
90
98
|
tag: this.tag,
|
|
91
99
|
name: this.name,
|
|
92
100
|
content: Comment.serializeDisplayParts(this.content),
|
|
101
|
+
typeAnnotation: this.typeAnnotation,
|
|
93
102
|
};
|
|
94
103
|
}
|
|
95
104
|
fromObject(de, obj) {
|
|
96
105
|
// tag already set by Comment.fromObject
|
|
97
106
|
this.name = obj.name;
|
|
107
|
+
this.typeAnnotation = obj.typeAnnotation;
|
|
98
108
|
this.content = Comment.deserializeDisplayParts(de, obj.content);
|
|
99
109
|
}
|
|
100
110
|
}
|
|
@@ -38,6 +38,13 @@ export declare class DeclarationReflection extends ContainerReflection {
|
|
|
38
38
|
* A list of all source files that contributed to this reflection.
|
|
39
39
|
*/
|
|
40
40
|
sources?: SourceReference[];
|
|
41
|
+
/**
|
|
42
|
+
* Precomputed boost for search results, may be less than 1 to de-emphasize this member in search results.
|
|
43
|
+
* Does NOT include group/category values as they are computed when building the JS index.
|
|
44
|
+
*
|
|
45
|
+
* This is exposed purely for plugin use, see #3036 for details.
|
|
46
|
+
*/
|
|
47
|
+
relevanceBoost?: number;
|
|
41
48
|
/**
|
|
42
49
|
* The escaped name of this declaration assigned by the TS compiler if there is an associated symbol.
|
|
43
50
|
* This is used to retrieve properties for analyzing inherited members.
|
|
@@ -19,6 +19,13 @@ export class DeclarationReflection extends ContainerReflection {
|
|
|
19
19
|
* A list of all source files that contributed to this reflection.
|
|
20
20
|
*/
|
|
21
21
|
sources;
|
|
22
|
+
/**
|
|
23
|
+
* Precomputed boost for search results, may be less than 1 to de-emphasize this member in search results.
|
|
24
|
+
* Does NOT include group/category values as they are computed when building the JS index.
|
|
25
|
+
*
|
|
26
|
+
* This is exposed purely for plugin use, see #3036 for details.
|
|
27
|
+
*/
|
|
28
|
+
relevanceBoost;
|
|
22
29
|
/**
|
|
23
30
|
* The escaped name of this declaration assigned by the TS compiler if there is an associated symbol.
|
|
24
31
|
* This is used to retrieve properties for analyzing inherited members.
|
|
@@ -217,6 +224,7 @@ export class DeclarationReflection extends ContainerReflection {
|
|
|
217
224
|
variant: this.variant,
|
|
218
225
|
packageVersion: this.packageVersion,
|
|
219
226
|
sources: serializer.toObjectsOptional(this.sources),
|
|
227
|
+
relevanceBoost: this.relevanceBoost === 1 ? undefined : this.relevanceBoost,
|
|
220
228
|
typeParameters: serializer.toObjectsOptional(this.typeParameters),
|
|
221
229
|
type: serializer.toObject(this.type),
|
|
222
230
|
signatures: serializer.toObjectsOptional(this.signatures),
|
|
@@ -260,6 +268,7 @@ export class DeclarationReflection extends ContainerReflection {
|
|
|
260
268
|
}
|
|
261
269
|
this.packageVersion = obj.packageVersion;
|
|
262
270
|
this.sources = de.reviveMany(obj.sources, (src) => new SourceReference(src.fileName, src.line, src.character));
|
|
271
|
+
this.relevanceBoost = obj.relevanceBoost;
|
|
263
272
|
this.typeParameters = de.reviveMany(obj.typeParameters, (tp) => de.constructReflection(tp));
|
|
264
273
|
this.type = de.revive(obj.type, (t) => de.constructType(t));
|
|
265
274
|
this.signatures = de.reviveMany(obj.signatures, (r) => de.constructReflection(r));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ProjectReflection } from "../models/ProjectReflection.js";
|
|
2
2
|
import { type DeclarationReflection, type DocumentReflection, Reflection, type ReflectionKind } from "../models/index.js";
|
|
3
3
|
import type { PageDefinition, PageKind, RouterTarget } from "./router.js";
|
|
4
|
+
import { type Icons } from "./themes/default/partials/icon.js";
|
|
4
5
|
/**
|
|
5
6
|
* An event emitted by the {@link Renderer} class at the very beginning and
|
|
6
7
|
* ending of the entire rendering process.
|
|
@@ -39,6 +40,7 @@ export interface PageHeading {
|
|
|
39
40
|
level?: number;
|
|
40
41
|
kind?: ReflectionKind;
|
|
41
42
|
classes?: string;
|
|
43
|
+
icon?: keyof Icons & (string | number);
|
|
42
44
|
}
|
|
43
45
|
/**
|
|
44
46
|
* An event emitted by the {@link Renderer} class before and after the
|
|
@@ -174,7 +174,7 @@ let JavascriptIndexPlugin = (() => {
|
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
getBoost(refl) {
|
|
177
|
-
let boost = 1;
|
|
177
|
+
let boost = refl.relevanceBoost ?? 1;
|
|
178
178
|
for (const group of GroupPlugin.getGroups(refl, this.groupReferencesByType)) {
|
|
179
179
|
boost *= this.searchGroupBoosts[group] ?? 1;
|
|
180
180
|
this.unusedGroupBoosts.delete(group);
|
|
@@ -387,10 +387,17 @@ let MarkedPlugin = (() => {
|
|
|
387
387
|
})();
|
|
388
388
|
export { MarkedPlugin };
|
|
389
389
|
function getTokenTextContent(token) {
|
|
390
|
+
// If there are children, we want their text content, not the full text content
|
|
390
391
|
if (token.children) {
|
|
391
392
|
return token.children.map(getTokenTextContent).join("");
|
|
392
393
|
}
|
|
393
|
-
|
|
394
|
+
// If this is a simple text fragment, use its content
|
|
395
|
+
if (token.type === "text") {
|
|
396
|
+
return token.content;
|
|
397
|
+
}
|
|
398
|
+
// Otherwise this is some type of metadata token (e.g. header_open)
|
|
399
|
+
// or a HTML tag token. Don't include it in the text content.
|
|
400
|
+
return "";
|
|
394
401
|
}
|
|
395
402
|
const kindNames = ["note", "tip", "important", "warning", "caution"];
|
|
396
403
|
const iconNames = ["alertNote", "alertTip", "alertImportant", "alertWarning", "alertCaution"];
|
|
@@ -6,15 +6,23 @@ export class Slugger {
|
|
|
6
6
|
options;
|
|
7
7
|
seen = new Map();
|
|
8
8
|
serialize(value) {
|
|
9
|
-
//
|
|
10
|
-
//
|
|
9
|
+
// There are quite a few trade-offs here. We used to remove HTML tags here,
|
|
10
|
+
// but TypeDoc now removes the HTML tags before passing text into the slug
|
|
11
|
+
// method, which allows us to skip doing that here. This improves the slugger
|
|
12
|
+
// generation for headers which look like the following:
|
|
13
|
+
// (html allowed in markdown)
|
|
14
|
+
// # test <t>
|
|
15
|
+
// (html disallowed in markdown)
|
|
16
|
+
// # test <t>
|
|
17
|
+
// both of the above should slug to test-t
|
|
11
18
|
return (value
|
|
12
19
|
.trim()
|
|
13
|
-
// remove html tags
|
|
14
|
-
.replace(/<[!/a-z].*?>/gi, "")
|
|
15
20
|
// remove unwanted chars
|
|
16
21
|
.replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, "")
|
|
17
|
-
|
|
22
|
+
// change whitespace to dash
|
|
23
|
+
.replace(/\s/g, "-")
|
|
24
|
+
// combine adjacent dashes
|
|
25
|
+
.replace(/--+/, "-"));
|
|
18
26
|
}
|
|
19
27
|
constructor(options) {
|
|
20
28
|
this.options = options;
|
|
@@ -58,6 +58,7 @@ export function commentTags(context, props) {
|
|
|
58
58
|
JSX.createElement("h4", { class: "tsd-anchor-link", id: anchor },
|
|
59
59
|
name,
|
|
60
60
|
anchorIcon(context, anchor)),
|
|
61
|
+
item.typeAnnotation && JSX.createElement("span", { class: "tsd-type-annotation" }, item.typeAnnotation),
|
|
61
62
|
JSX.createElement(JSX.Raw, { html: context.markdown(item.content) }))));
|
|
62
63
|
});
|
|
63
64
|
return (JSX.createElement(JSX.Fragment, null,
|
|
@@ -9,6 +9,7 @@ export function member(context, props) {
|
|
|
9
9
|
text: getDisplayName(props),
|
|
10
10
|
kind: props.kind,
|
|
11
11
|
classes: context.getReflectionClasses(props),
|
|
12
|
+
icon: context.theme.getReflectionIcon(props),
|
|
12
13
|
});
|
|
13
14
|
// With the default url derivation, we'll never hit this case as documents are always placed into their
|
|
14
15
|
// own pages. Handle it here in case someone creates a custom url scheme which embeds guides within the page.
|
|
@@ -35,6 +35,7 @@ export function moduleMemberSummary(context, member) {
|
|
|
35
35
|
text: getDisplayName(member),
|
|
36
36
|
kind: member instanceof ReferenceReflection ? member.getTargetReflectionDeep().kind : member.kind,
|
|
37
37
|
classes: context.getReflectionClasses(member),
|
|
38
|
+
icon: context.theme.getReflectionIcon(member),
|
|
38
39
|
});
|
|
39
40
|
let name;
|
|
40
41
|
if (member instanceof ReferenceReflection) {
|
|
@@ -109,7 +109,7 @@ function buildSectionNavigation(context, headings) {
|
|
|
109
109
|
levels.push([]);
|
|
110
110
|
}
|
|
111
111
|
levels[levels.length - 1].push(JSX.createElement("a", { href: heading.link, class: classNames({}, heading.classes) },
|
|
112
|
-
heading.
|
|
112
|
+
heading.icon && context.icons[heading.icon](),
|
|
113
113
|
JSX.createElement("span", null, wbr(heading.text))));
|
|
114
114
|
}
|
|
115
115
|
while (levels.length > 1) {
|
|
@@ -97,7 +97,7 @@ export interface ParameterReflection extends Omit<Reflection, "variant">, S<M.Pa
|
|
|
97
97
|
variant: "param";
|
|
98
98
|
}
|
|
99
99
|
/** @category Reflections */
|
|
100
|
-
export interface DeclarationReflection extends Omit<ContainerReflection, "variant">, S<M.DeclarationReflection, "variant" | "packageVersion" | "sources" | "type" | "signatures" | "indexSignatures" | "defaultValue" | "overwrites" | "inheritedFrom" | "implementationOf" | "extendedTypes" | "extendedBy" | "implementedTypes" | "implementedBy" | "getSignature" | "setSignature" | "typeParameters" | "readme"> {
|
|
100
|
+
export interface DeclarationReflection extends Omit<ContainerReflection, "variant">, S<M.DeclarationReflection, "variant" | "packageVersion" | "sources" | "relevanceBoost" | "type" | "signatures" | "indexSignatures" | "defaultValue" | "overwrites" | "inheritedFrom" | "implementationOf" | "extendedTypes" | "extendedBy" | "implementedTypes" | "implementedBy" | "getSignature" | "setSignature" | "typeParameters" | "readme"> {
|
|
101
101
|
}
|
|
102
102
|
/** @category Reflections */
|
|
103
103
|
export interface TypeParameterReflection extends Omit<Reflection, "variant">, S<M.TypeParameterReflection, "variant" | "type" | "default" | "varianceModifier"> {
|
|
@@ -226,7 +226,7 @@ export interface Comment extends Partial<S<M.Comment, "blockTags" | "label">> {
|
|
|
226
226
|
modifierTags?: TagString[];
|
|
227
227
|
}
|
|
228
228
|
/** @category Comments */
|
|
229
|
-
export interface CommentTag extends S<M.CommentTag, "tag" | "name"> {
|
|
229
|
+
export interface CommentTag extends S<M.CommentTag, "tag" | "name" | "typeAnnotation"> {
|
|
230
230
|
content: CommentDisplayPart[];
|
|
231
231
|
}
|
|
232
232
|
/**
|
|
@@ -93,6 +93,7 @@ export interface TypeDocOptionMap {
|
|
|
93
93
|
excludeNotDocumented: boolean;
|
|
94
94
|
excludeNotDocumentedKinds: ReflectionKind.KindString[];
|
|
95
95
|
excludeInternal: boolean;
|
|
96
|
+
excludePrivateClassFields: boolean;
|
|
96
97
|
excludePrivate: boolean;
|
|
97
98
|
excludeProtected: boolean;
|
|
98
99
|
excludeReferences: boolean;
|
|
@@ -200,6 +201,7 @@ export interface TypeDocOptionMap {
|
|
|
200
201
|
notRenderedTags: TagString[];
|
|
201
202
|
externalSymbolLinkMappings: ManuallyValidatedOption<Record<string, Record<string, string>>>;
|
|
202
203
|
cascadedModifierTags: TagString[];
|
|
204
|
+
preservedTypeAnnotationTags: TagString[];
|
|
203
205
|
categorizeByGroup: boolean;
|
|
204
206
|
groupReferencesByType: boolean;
|
|
205
207
|
defaultCategory: string;
|
|
@@ -240,6 +242,10 @@ export type ValidationOptions = {
|
|
|
240
242
|
* If set, TypeDoc will produce warnings about \{\@link\} tags which will produce broken links.
|
|
241
243
|
*/
|
|
242
244
|
invalidLink: boolean;
|
|
245
|
+
/**
|
|
246
|
+
* If set, TypeDoc will produce warnings about relative paths within the documentation which could not be resolved.
|
|
247
|
+
*/
|
|
248
|
+
invalidPath: boolean;
|
|
243
249
|
/**
|
|
244
250
|
* If set, TypeDoc will produce warnings about \{\@link\} tags which do not link directly to their target.
|
|
245
251
|
*/
|
|
@@ -11,6 +11,7 @@ export declare const blockTags: readonly TagString[];
|
|
|
11
11
|
export declare const inlineTags: readonly TagString[];
|
|
12
12
|
export declare const modifierTags: readonly TagString[];
|
|
13
13
|
export declare const cascadedModifierTags: readonly TagString[];
|
|
14
|
+
export declare const preservedTypeAnnotationTags: readonly TagString[];
|
|
14
15
|
export declare const notRenderedTags: readonly TagString[];
|
|
15
16
|
export declare const highlightLanguages: readonly BundledLanguage[];
|
|
16
17
|
export declare const ignoredHighlightLanguages: readonly string[];
|
|
@@ -167,6 +167,12 @@ export function addTypeDocOptions(options) {
|
|
|
167
167
|
type: ParameterType.Boolean,
|
|
168
168
|
defaultValue: true,
|
|
169
169
|
});
|
|
170
|
+
options.addDeclaration({
|
|
171
|
+
name: "excludePrivateClassFields",
|
|
172
|
+
help: () => i18n.help_excludePrivateClassFields(),
|
|
173
|
+
type: ParameterType.Boolean,
|
|
174
|
+
defaultValue: true,
|
|
175
|
+
});
|
|
170
176
|
options.addDeclaration({
|
|
171
177
|
name: "excludeProtected",
|
|
172
178
|
help: () => i18n.help_excludeProtected(),
|
|
@@ -700,6 +706,13 @@ export function addTypeDocOptions(options) {
|
|
|
700
706
|
defaultValue: OptionDefaults.cascadedModifierTags,
|
|
701
707
|
validate: makeTagArrayValidator("cascadedModifierTags"),
|
|
702
708
|
});
|
|
709
|
+
options.addDeclaration({
|
|
710
|
+
name: "preservedTypeAnnotationTags",
|
|
711
|
+
help: () => i18n.help_preservedTypeAnnotationTags(),
|
|
712
|
+
type: ParameterType.Array,
|
|
713
|
+
defaultValue: OptionDefaults.preservedTypeAnnotationTags,
|
|
714
|
+
validate: makeTagArrayValidator("preservedTypeAnnotationTags"),
|
|
715
|
+
});
|
|
703
716
|
// MARK: Organization Options
|
|
704
717
|
options.addDeclaration({
|
|
705
718
|
name: "categorizeByGroup",
|
|
@@ -851,6 +864,7 @@ export function addTypeDocOptions(options) {
|
|
|
851
864
|
defaults: {
|
|
852
865
|
notExported: true,
|
|
853
866
|
invalidLink: true,
|
|
867
|
+
invalidPath: true,
|
|
854
868
|
rewrittenLink: true,
|
|
855
869
|
notDocumented: false,
|
|
856
870
|
unusedMergeModuleWith: true,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const tsdocBlockTags: readonly ["@defaultValue", "@deprecated", "@example", "@param", "@privateRemarks", "@remarks", "@returns", "@see", "@throws", "@typeParam"];
|
|
2
|
-
export declare const blockTags: readonly ["@defaultValue", "@deprecated", "@example", "@param", "@privateRemarks", "@remarks", "@returns", "@see", "@throws", "@typeParam", "@author", "@callback", "@category", "@categoryDescription", "@default", "@document", "@extends", "@augments", "@yields", "@group", "@groupDescription", "@import", "@inheritDoc", "@
|
|
1
|
+
export declare const tsdocBlockTags: readonly ["@defaultValue", "@deprecated", "@example", "@jsx", "@param", "@privateRemarks", "@remarks", "@returns", "@see", "@throws", "@typeParam"];
|
|
2
|
+
export declare const blockTags: readonly ["@defaultValue", "@deprecated", "@example", "@jsx", "@param", "@privateRemarks", "@remarks", "@returns", "@see", "@throws", "@typeParam", "@author", "@callback", "@category", "@categoryDescription", "@default", "@document", "@extends", "@augments", "@yields", "@group", "@groupDescription", "@import", "@inheritDoc", "@license", "@module", "@mergeModuleWith", "@prop", "@property", "@return", "@satisfies", "@since", "@sortStrategy", "@template", "@this", "@type", "@typedef", "@summary", "@preventInline", "@inlineType", "@preventExpand", "@expandType"];
|
|
3
3
|
export declare const tsdocInlineTags: readonly ["@link", "@inheritDoc", "@label"];
|
|
4
4
|
export declare const inlineTags: readonly ["@link", "@inheritDoc", "@label", "@linkcode", "@linkplain", "@include", "@includeCode"];
|
|
5
5
|
export declare const tsdocModifierTags: readonly ["@alpha", "@beta", "@eventProperty", "@experimental", "@internal", "@override", "@packageDocumentation", "@public", "@readonly", "@sealed", "@virtual"];
|
|
@@ -3,6 +3,7 @@ export const tsdocBlockTags = [
|
|
|
3
3
|
"@defaultValue",
|
|
4
4
|
"@deprecated",
|
|
5
5
|
"@example",
|
|
6
|
+
"@jsx",
|
|
6
7
|
"@param",
|
|
7
8
|
"@privateRemarks",
|
|
8
9
|
"@remarks",
|
|
@@ -26,7 +27,6 @@ export const blockTags = [
|
|
|
26
27
|
"@groupDescription",
|
|
27
28
|
"@import",
|
|
28
29
|
"@inheritDoc",
|
|
29
|
-
"@jsx",
|
|
30
30
|
"@license",
|
|
31
31
|
"@module",
|
|
32
32
|
"@mergeModuleWith",
|
|
@@ -37,6 +37,7 @@ export const blockTags = [
|
|
|
37
37
|
"@since",
|
|
38
38
|
"@sortStrategy",
|
|
39
39
|
"@template", // Alias for @typeParam
|
|
40
|
+
"@this",
|
|
40
41
|
"@type",
|
|
41
42
|
"@typedef",
|
|
42
43
|
"@summary",
|
|
@@ -26,6 +26,10 @@ export declare class Logger {
|
|
|
26
26
|
* How many warning messages have been logged?
|
|
27
27
|
*/
|
|
28
28
|
warningCount: number;
|
|
29
|
+
/**
|
|
30
|
+
* How many validation warning messages have been logged?
|
|
31
|
+
*/
|
|
32
|
+
validationWarningCount: number;
|
|
29
33
|
/**
|
|
30
34
|
* The minimum logging level to print.
|
|
31
35
|
*/
|
|
@@ -57,10 +61,17 @@ export declare class Logger {
|
|
|
57
61
|
/**
|
|
58
62
|
* Log the given warning.
|
|
59
63
|
*
|
|
60
|
-
* @param text
|
|
64
|
+
* @param text The warning that should be logged.
|
|
61
65
|
*/
|
|
62
66
|
warn(text: IfInternal<TranslatedString, string>, node?: MinimalNode): void;
|
|
63
67
|
warn(text: IfInternal<TranslatedString, string>, pos: number, file: MinimalSourceFile): void;
|
|
68
|
+
/**
|
|
69
|
+
* Log the given warning and records that a validation warning has occurred.
|
|
70
|
+
*
|
|
71
|
+
* @param text The warning that should be logged.
|
|
72
|
+
*/
|
|
73
|
+
validationWarning(text: IfInternal<TranslatedString, string>, node?: MinimalNode): void;
|
|
74
|
+
validationWarning(text: IfInternal<TranslatedString, string>, pos: number, file: MinimalSourceFile): void;
|
|
64
75
|
/**
|
|
65
76
|
* Log the given error.
|
|
66
77
|
*
|
|
@@ -30,6 +30,10 @@ export class Logger {
|
|
|
30
30
|
* How many warning messages have been logged?
|
|
31
31
|
*/
|
|
32
32
|
warningCount = 0;
|
|
33
|
+
/**
|
|
34
|
+
* How many validation warning messages have been logged?
|
|
35
|
+
*/
|
|
36
|
+
validationWarningCount = 0;
|
|
33
37
|
/**
|
|
34
38
|
* The minimum logging level to print.
|
|
35
39
|
*/
|
|
@@ -57,6 +61,7 @@ export class Logger {
|
|
|
57
61
|
*/
|
|
58
62
|
resetWarnings() {
|
|
59
63
|
this.warningCount = 0;
|
|
64
|
+
this.validationWarningCount = 0;
|
|
60
65
|
}
|
|
61
66
|
/**
|
|
62
67
|
* Log the given verbose message.
|
|
@@ -74,6 +79,10 @@ export class Logger {
|
|
|
74
79
|
const text2 = this.addContext(text, LogLevel.Warn, ...args);
|
|
75
80
|
this.log(text2, LogLevel.Warn);
|
|
76
81
|
}
|
|
82
|
+
validationWarning(...args) {
|
|
83
|
+
this.validationWarningCount += 1;
|
|
84
|
+
this.warn(...args);
|
|
85
|
+
}
|
|
77
86
|
error(text, ...args) {
|
|
78
87
|
const text2 = this.addContext(text, LogLevel.Error, ...args);
|
|
79
88
|
this.log(text2, LogLevel.Error);
|
|
@@ -81,11 +81,11 @@ export function validateDocumentation(project, logger, requiredToBeDocumented, i
|
|
|
81
81
|
intentionalUsage.add(intentionalIndex);
|
|
82
82
|
continue;
|
|
83
83
|
}
|
|
84
|
-
logger.
|
|
84
|
+
logger.validationWarning(i18n.reflection_0_kind_1_defined_in_2_does_not_have_any_documentation(ref.getFriendlyFullName(), ReflectionKind[ref.kind], `${symbolId.packageName}/${symbolId.packagePath}`));
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
const unusedIntentional = intentionallyNotDocumented.filter((_, i) => !intentionalUsage.has(i));
|
|
88
88
|
if (unusedIntentional.length) {
|
|
89
|
-
logger.
|
|
89
|
+
logger.validationWarning(i18n.invalid_intentionally_not_documented_names_0(unusedIntentional.join("\n\t")));
|
|
90
90
|
}
|
|
91
91
|
}
|
|
@@ -55,11 +55,11 @@ export function validateExports(project, logger, intentionallyNotExported) {
|
|
|
55
55
|
!warned.has(uniqueId) &&
|
|
56
56
|
!project.symbolIdHasBeenRemoved(type.symbolId)) {
|
|
57
57
|
warned.add(uniqueId);
|
|
58
|
-
logger.
|
|
58
|
+
logger.validationWarning(i18n.type_0_defined_in_1_is_referenced_by_2_but_not_included_in_docs(type.qualifiedName, `${type.symbolId.packageName}/${type.symbolId.packagePath}`, owner.getFriendlyFullName()));
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
const unusedIntentional = intentional.getUnused();
|
|
62
62
|
if (unusedIntentional.length) {
|
|
63
|
-
logger.
|
|
63
|
+
logger.validationWarning(i18n.invalid_intentionally_not_exported_symbols_0(unusedIntentional.join("\n\t")));
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -34,10 +34,10 @@ function checkReflection(reflection, logger) {
|
|
|
34
34
|
// If a link starts with it, and doesn't include a module source indicator "!"
|
|
35
35
|
// then the user probably is trying to link to a package containing "@" with an absolute link.
|
|
36
36
|
if (linkText.startsWith("@") && !linkText.includes("!")) {
|
|
37
|
-
logger.
|
|
37
|
+
logger.validationWarning(i18n.failed_to_resolve_link_to_0_in_readme_for_1_may_have_meant_2(linkText, reflection.getFriendlyFullName(), linkText.replace(/[.#~]/, "!")));
|
|
38
38
|
}
|
|
39
39
|
else {
|
|
40
|
-
logger.
|
|
40
|
+
logger.validationWarning(i18n.failed_to_resolve_link_to_0_in_readme_for_1(linkText, reflection.getFriendlyFullName()));
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -45,10 +45,10 @@ function checkReflection(reflection, logger) {
|
|
|
45
45
|
for (const broken of getBrokenPartLinks(reflection.content)) {
|
|
46
46
|
const linkText = broken.text.trim();
|
|
47
47
|
if (linkText.startsWith("@") && !linkText.includes("!")) {
|
|
48
|
-
logger.
|
|
48
|
+
logger.validationWarning(i18n.failed_to_resolve_link_to_0_in_document_1_may_have_meant_2(linkText, reflection.getFriendlyFullName(), linkText.replace(/[.#~]/, "!")));
|
|
49
49
|
}
|
|
50
50
|
else {
|
|
51
|
-
logger.
|
|
51
|
+
logger.validationWarning(i18n.failed_to_resolve_link_to_0_in_document_1(linkText, reflection.getFriendlyFullName()));
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -67,12 +67,12 @@ function checkReflection(reflection, logger) {
|
|
|
67
67
|
function reportBrokenCommentLink(broken, reflection, logger) {
|
|
68
68
|
const linkText = broken.text.trim();
|
|
69
69
|
if (broken.target instanceof ReflectionSymbolId) {
|
|
70
|
-
logger.
|
|
70
|
+
logger.validationWarning(i18n.comment_for_0_links_to_1_not_included_in_docs_use_external_link_2(reflection.getFriendlyFullName(), linkText, `{ "${broken.target.packageName}": { "${broken.target.qualifiedName}": "#" }}`));
|
|
71
71
|
}
|
|
72
72
|
else if (linkText.startsWith("@") && !linkText.includes("!")) {
|
|
73
|
-
logger.
|
|
73
|
+
logger.validationWarning(i18n.failed_to_resolve_link_to_0_in_comment_for_1_may_have_meant_2(linkText, reflection.getFriendlyFullName(), linkText.replace(/[.#~]/, "!")));
|
|
74
74
|
}
|
|
75
75
|
else {
|
|
76
|
-
logger.
|
|
76
|
+
logger.validationWarning(i18n.failed_to_resolve_link_to_0_in_comment_for_1(linkText, reflection.getFriendlyFullName()));
|
|
77
77
|
}
|
|
78
78
|
}
|