typedoc 0.24.0-beta.3 → 0.24.0-beta.5
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/README.md +1 -1
- package/dist/lib/cli.js +5 -2
- package/dist/lib/converter/comments/blockLexer.d.ts +2 -1
- package/dist/lib/converter/comments/blockLexer.js +45 -4
- package/dist/lib/converter/comments/discovery.d.ts +7 -2
- package/dist/lib/converter/comments/discovery.js +61 -20
- package/dist/lib/converter/comments/index.d.ts +3 -3
- package/dist/lib/converter/comments/index.js +18 -17
- package/dist/lib/converter/comments/lexer.d.ts +2 -0
- package/dist/lib/converter/comments/linkResolver.d.ts +2 -2
- package/dist/lib/converter/comments/linkResolver.js +25 -20
- package/dist/lib/converter/comments/parser.js +6 -2
- package/dist/lib/converter/context.d.ts +3 -11
- package/dist/lib/converter/context.js +13 -19
- package/dist/lib/converter/converter.d.ts +2 -0
- package/dist/lib/converter/converter.js +6 -3
- package/dist/lib/converter/factories/signature.js +16 -7
- package/dist/lib/converter/jsdoc.js +3 -3
- package/dist/lib/converter/plugins/CommentPlugin.js +18 -0
- package/dist/lib/converter/plugins/InheritDocPlugin.js +2 -1
- package/dist/lib/converter/plugins/SourcePlugin.js +3 -0
- package/dist/lib/converter/symbols.js +48 -6
- package/dist/lib/converter/types.js +2 -2
- package/dist/lib/models/comments/comment.d.ts +6 -6
- package/dist/lib/models/comments/comment.js +26 -10
- package/dist/lib/models/reflections/abstract.js +1 -1
- package/dist/lib/models/reflections/project.js +1 -1
- package/dist/lib/output/events.js +4 -4
- package/dist/lib/output/renderer.d.ts +3 -0
- package/dist/lib/output/renderer.js +6 -2
- package/dist/lib/output/themes/default/DefaultTheme.js +7 -1
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +1 -1
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +9 -3
- package/dist/lib/output/themes/default/layouts/default.js +5 -5
- package/dist/lib/output/themes/default/partials/typeParameters.js +1 -0
- package/dist/lib/output/themes/default/templates/reflection.js +2 -1
- package/dist/lib/output/themes/lib.js +1 -0
- package/dist/lib/serialization/schema.d.ts +8 -7
- package/dist/lib/serialization/serializer.js +1 -1
- package/dist/lib/utils/component.js +1 -1
- package/dist/lib/utils/entry-point.js +2 -2
- package/dist/lib/utils/options/declaration.d.ts +3 -0
- package/dist/lib/utils/options/sources/typedoc.js +24 -2
- package/dist/lib/utils/options/tsdoc-defaults.d.ts +2 -2
- package/dist/lib/utils/options/tsdoc-defaults.js +4 -0
- package/dist/lib/utils/package-manifest.js +4 -4
- package/package.json +8 -8
- package/static/style.css +4 -5
- package/tsdoc.json +24 -0
|
@@ -166,22 +166,23 @@ export interface Comment extends Partial<S<M.Comment, "blockTags" | "label">> {
|
|
|
166
166
|
export interface CommentTag extends S<M.CommentTag, "tag" | "name"> {
|
|
167
167
|
content: CommentDisplayPart[];
|
|
168
168
|
}
|
|
169
|
-
/**
|
|
170
|
-
* If `target` is a number, it is a reflection ID. If a string, it is a URL.
|
|
171
|
-
* `target` will only be set for `@link`, `@linkcode`, and `@linkplain` tags.
|
|
172
|
-
*/
|
|
173
169
|
export type CommentDisplayPart = {
|
|
174
170
|
kind: "text";
|
|
175
171
|
text: string;
|
|
176
172
|
} | {
|
|
177
173
|
kind: "code";
|
|
178
174
|
text: string;
|
|
179
|
-
} |
|
|
175
|
+
} | InlineTagDisplayPart;
|
|
176
|
+
/**
|
|
177
|
+
* If `target` is a number, it is a reflection ID. If a string, it is a URL.
|
|
178
|
+
* `target` will only be set for `@link`, `@linkcode`, and `@linkplain` tags.
|
|
179
|
+
*/
|
|
180
|
+
export interface InlineTagDisplayPart {
|
|
180
181
|
kind: "inline-tag";
|
|
181
182
|
tag: `@${string}`;
|
|
182
183
|
text: string;
|
|
183
|
-
target?: string | number;
|
|
184
|
-
}
|
|
184
|
+
target?: string | number | ReflectionSymbolId;
|
|
185
|
+
}
|
|
185
186
|
export interface SourceReference extends S<M.SourceReference, "fileName" | "line" | "character" | "url"> {
|
|
186
187
|
}
|
|
187
188
|
export {};
|
|
@@ -41,7 +41,6 @@ class Serializer extends utils_1.EventDispatcher {
|
|
|
41
41
|
return project;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
exports.Serializer = Serializer;
|
|
45
44
|
/**
|
|
46
45
|
* Triggered when the {@link Serializer} begins transforming a project.
|
|
47
46
|
* @event EVENT_BEGIN
|
|
@@ -52,3 +51,4 @@ Serializer.EVENT_BEGIN = "begin";
|
|
|
52
51
|
* @event EVENT_END
|
|
53
52
|
*/
|
|
54
53
|
Serializer.EVENT_END = "end";
|
|
54
|
+
exports.Serializer = Serializer;
|
|
@@ -49,9 +49,9 @@ class ComponentEvent extends events_1.Event {
|
|
|
49
49
|
this.component = component;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
exports.ComponentEvent = ComponentEvent;
|
|
53
52
|
ComponentEvent.ADDED = "componentAdded";
|
|
54
53
|
ComponentEvent.REMOVED = "componentRemoved";
|
|
54
|
+
exports.ComponentEvent = ComponentEvent;
|
|
55
55
|
/**
|
|
56
56
|
* Component base class. Has an owner (unless it's the application root component),
|
|
57
57
|
* can dispatch events to its children, and has access to the root Application component.
|
|
@@ -311,9 +311,9 @@ function getEntryPointsForLegacyPackages(logger, packageGlobPaths, options) {
|
|
|
311
311
|
logger.error(`Entry point "${packageEntryPoint}" does not appear to be built by/included in the tsconfig found at "${tsconfigFile}"`);
|
|
312
312
|
return;
|
|
313
313
|
}
|
|
314
|
+
const packageName = packageJson["name"];
|
|
314
315
|
results.push({
|
|
315
|
-
displayName: typedocPackageConfig?.displayName ??
|
|
316
|
-
packageJson["name"],
|
|
316
|
+
displayName: typedocPackageConfig?.displayName ?? packageName,
|
|
317
317
|
version: includeVersion
|
|
318
318
|
? packageJson["version"]
|
|
319
319
|
: void 0,
|
|
@@ -93,12 +93,14 @@ export interface TypeDocOptionMap {
|
|
|
93
93
|
githubPages: boolean;
|
|
94
94
|
gaID: string;
|
|
95
95
|
hideGenerator: boolean;
|
|
96
|
+
cacheBust: boolean;
|
|
96
97
|
searchInComments: boolean;
|
|
97
98
|
cleanOutputDir: boolean;
|
|
98
99
|
titleLink: string;
|
|
99
100
|
navigationLinks: ManuallyValidatedOption<Record<string, string>>;
|
|
100
101
|
sidebarLinks: ManuallyValidatedOption<Record<string, string>>;
|
|
101
102
|
commentStyle: typeof CommentStyle;
|
|
103
|
+
useTsLinkResolution: boolean;
|
|
102
104
|
blockTags: `@${string}`[];
|
|
103
105
|
inlineTags: `@${string}`[];
|
|
104
106
|
modifierTags: `@${string}`[];
|
|
@@ -125,6 +127,7 @@ export interface TypeDocOptionMap {
|
|
|
125
127
|
plugin: string[];
|
|
126
128
|
logLevel: typeof LogLevel;
|
|
127
129
|
treatWarningsAsErrors: boolean;
|
|
130
|
+
treatValidationWarningsAsErrors: boolean;
|
|
128
131
|
intentionallyNotExported: string[];
|
|
129
132
|
validation: ValidationOptions;
|
|
130
133
|
requiredToBeDocumented: ReflectionKind.KindString[];
|
|
@@ -291,7 +291,13 @@ function addTypeDocOptions(options) {
|
|
|
291
291
|
name: "excludeTags",
|
|
292
292
|
help: "Remove the listed block/modifier tags from doc comments.",
|
|
293
293
|
type: declaration_1.ParameterType.Array,
|
|
294
|
-
defaultValue: [
|
|
294
|
+
defaultValue: [
|
|
295
|
+
"@override",
|
|
296
|
+
"@virtual",
|
|
297
|
+
"@privateRemarks",
|
|
298
|
+
"@satisfies",
|
|
299
|
+
"@overload",
|
|
300
|
+
],
|
|
295
301
|
validate(value) {
|
|
296
302
|
if (!Validation.validate([Array, Validation.isTagString], value)) {
|
|
297
303
|
throw new Error(`excludeTags must be an array of valid tag names.`);
|
|
@@ -341,6 +347,11 @@ function addTypeDocOptions(options) {
|
|
|
341
347
|
help: "Do not print the TypeDoc link at the end of the page.",
|
|
342
348
|
type: declaration_1.ParameterType.Boolean,
|
|
343
349
|
});
|
|
350
|
+
options.addDeclaration({
|
|
351
|
+
name: "cacheBust",
|
|
352
|
+
help: "Include the generation time in links to static assets.",
|
|
353
|
+
type: declaration_1.ParameterType.Boolean,
|
|
354
|
+
});
|
|
344
355
|
options.addDeclaration({
|
|
345
356
|
name: "searchInComments",
|
|
346
357
|
help: "If set, the search index will also include comments. This will greatly increase the size of the search index.",
|
|
@@ -395,6 +406,12 @@ function addTypeDocOptions(options) {
|
|
|
395
406
|
map: declaration_1.CommentStyle,
|
|
396
407
|
defaultValue: declaration_1.CommentStyle.JSDoc,
|
|
397
408
|
});
|
|
409
|
+
options.addDeclaration({
|
|
410
|
+
name: "useTsLinkResolution",
|
|
411
|
+
help: "Use TypeScript's link resolution when determining where @link tags point. This only applies to JSDoc style comments.",
|
|
412
|
+
type: declaration_1.ParameterType.Boolean,
|
|
413
|
+
defaultValue: true,
|
|
414
|
+
});
|
|
398
415
|
options.addDeclaration({
|
|
399
416
|
name: "blockTags",
|
|
400
417
|
help: "Block tags which TypeDoc should recognize when parsing comments.",
|
|
@@ -582,7 +599,12 @@ function addTypeDocOptions(options) {
|
|
|
582
599
|
});
|
|
583
600
|
options.addDeclaration({
|
|
584
601
|
name: "treatWarningsAsErrors",
|
|
585
|
-
help: "If set, warnings will be treated as errors.",
|
|
602
|
+
help: "If set, all warnings will be treated as errors.",
|
|
603
|
+
type: declaration_1.ParameterType.Boolean,
|
|
604
|
+
});
|
|
605
|
+
options.addDeclaration({
|
|
606
|
+
name: "treatValidationWarningsAsErrors",
|
|
607
|
+
help: "If set, warnings emitted during validation will be treated as errors. This option cannot be used to disable treatWarningsAsErrors for validation warnings.",
|
|
586
608
|
type: declaration_1.ParameterType.Boolean,
|
|
587
609
|
});
|
|
588
610
|
options.addDeclaration({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const tsdocBlockTags: readonly ["@deprecated", "@param", "@remarks", "@returns", "@throws", "@privateRemarks", "@defaultValue", "@typeParam"];
|
|
2
|
-
export declare const blockTags: readonly ["@deprecated", "@param", "@remarks", "@returns", "@throws", "@privateRemarks", "@defaultValue", "@typeParam", "@module", "@inheritDoc", "@group", "@category", "@template", "@type", "@typedef", "@callback", "@prop", "@property"];
|
|
2
|
+
export declare const blockTags: readonly ["@deprecated", "@param", "@remarks", "@returns", "@throws", "@privateRemarks", "@defaultValue", "@typeParam", "@module", "@inheritDoc", "@group", "@category", "@template", "@type", "@typedef", "@callback", "@prop", "@property", "@satisfies"];
|
|
3
3
|
export declare const tsdocInlineTags: readonly ["@link", "@inheritDoc", "@label"];
|
|
4
4
|
export declare const inlineTags: string[];
|
|
5
5
|
export declare const tsdocModifierTags: readonly ["@public", "@private", "@protected", "@internal", "@readonly", "@packageDocumentation", "@eventProperty", "@alpha", "@beta", "@experimental", "@sealed", "@override", "@virtual"];
|
|
6
|
-
export declare const modifierTags: readonly ["@public", "@private", "@protected", "@internal", "@readonly", "@packageDocumentation", "@eventProperty", "@alpha", "@beta", "@experimental", "@sealed", "@override", "@virtual", "@hidden", "@ignore", "@enum", "@event"];
|
|
6
|
+
export declare const modifierTags: readonly ["@public", "@private", "@protected", "@internal", "@readonly", "@packageDocumentation", "@eventProperty", "@alpha", "@beta", "@experimental", "@sealed", "@override", "@virtual", "@hidden", "@ignore", "@enum", "@event", "@overload", "@namespace", "@interface"];
|
|
@@ -26,6 +26,7 @@ exports.blockTags = [
|
|
|
26
26
|
"@callback",
|
|
27
27
|
"@prop",
|
|
28
28
|
"@property",
|
|
29
|
+
"@satisfies",
|
|
29
30
|
];
|
|
30
31
|
exports.tsdocInlineTags = ["@link", "@inheritDoc", "@label"];
|
|
31
32
|
exports.inlineTags = [...exports.tsdocInlineTags, "@linkcode", "@linkplain"];
|
|
@@ -50,4 +51,7 @@ exports.modifierTags = [
|
|
|
50
51
|
"@ignore",
|
|
51
52
|
"@enum",
|
|
52
53
|
"@event",
|
|
54
|
+
"@overload",
|
|
55
|
+
"@namespace",
|
|
56
|
+
"@interface",
|
|
53
57
|
];
|
|
@@ -44,13 +44,13 @@ function extractTypedocConfigFromPackageManifest(logger, packageJsonPath) {
|
|
|
44
44
|
return undefined;
|
|
45
45
|
}
|
|
46
46
|
if (hasOwnProperty(packageJson, "typedoc") &&
|
|
47
|
-
typeof packageJson
|
|
48
|
-
packageJson
|
|
49
|
-
if (!(0, validation_1.validate)(typedocPackageManifestConfigSchema, packageJson
|
|
47
|
+
typeof packageJson["typedoc"] == "object" &&
|
|
48
|
+
packageJson["typedoc"]) {
|
|
49
|
+
if (!(0, validation_1.validate)(typedocPackageManifestConfigSchema, packageJson["typedoc"])) {
|
|
50
50
|
logger.error(`Typedoc config extracted from package manifest file ${packageJsonPath} is not valid`);
|
|
51
51
|
return undefined;
|
|
52
52
|
}
|
|
53
|
-
return packageJson
|
|
53
|
+
return packageJson["typedoc"];
|
|
54
54
|
}
|
|
55
55
|
return undefined;
|
|
56
56
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typedoc",
|
|
3
3
|
"description": "Create api documentation for TypeScript projects.",
|
|
4
|
-
"version": "0.24.0-beta.
|
|
4
|
+
"version": "0.24.0-beta.5",
|
|
5
5
|
"homepage": "https://typedoc.org",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./dist/index.js",
|
|
@@ -30,24 +30,24 @@
|
|
|
30
30
|
"shiki": "^0.14.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x"
|
|
33
|
+
"typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/lunr": "^2.3.4",
|
|
37
37
|
"@types/marked": "^4.0.8",
|
|
38
38
|
"@types/mocha": "^10.0.1",
|
|
39
39
|
"@types/node": "14",
|
|
40
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
41
|
-
"@typescript-eslint/parser": "^5.
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "^5.55.0",
|
|
41
|
+
"@typescript-eslint/parser": "^5.55.0",
|
|
42
42
|
"@typestrong/fs-fixture-builder": "github:TypeStrong/fs-fixture-builder#8abd1494280116ff5318dde2c50ad01e1663790c",
|
|
43
|
-
"c8": "^7.
|
|
44
|
-
"esbuild": "^0.17.
|
|
45
|
-
"eslint": "^8.
|
|
43
|
+
"c8": "^7.13.0",
|
|
44
|
+
"esbuild": "^0.17.12",
|
|
45
|
+
"eslint": "^8.36.0",
|
|
46
46
|
"mocha": "^10.2.0",
|
|
47
47
|
"prettier": "2.8.4",
|
|
48
48
|
"puppeteer": "^13.5.2",
|
|
49
49
|
"ts-node": "^10.9.1",
|
|
50
|
-
"typescript": "
|
|
50
|
+
"typescript": "5.0.2"
|
|
51
51
|
},
|
|
52
52
|
"files": [
|
|
53
53
|
"/bin",
|
package/static/style.css
CHANGED
|
@@ -483,10 +483,9 @@ blockquote {
|
|
|
483
483
|
.has-menu .col-menu {
|
|
484
484
|
visibility: visible;
|
|
485
485
|
transform: translate(0, 0);
|
|
486
|
-
display:
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
grid-gap: 1.5rem;
|
|
486
|
+
display: flex;
|
|
487
|
+
flex-direction: column;
|
|
488
|
+
gap: 1.5rem;
|
|
490
489
|
max-height: 100vh;
|
|
491
490
|
padding: 1rem 2rem;
|
|
492
491
|
}
|
|
@@ -911,7 +910,7 @@ a.tsd-index-link {
|
|
|
911
910
|
margin-right: 0.8rem;
|
|
912
911
|
}
|
|
913
912
|
|
|
914
|
-
@media (min-width:
|
|
913
|
+
@media (min-width: 1025px) {
|
|
915
914
|
.col-content {
|
|
916
915
|
margin: 2rem auto;
|
|
917
916
|
}
|
package/tsdoc.json
CHANGED
|
@@ -66,6 +66,30 @@
|
|
|
66
66
|
"tagName": "@linkplain",
|
|
67
67
|
"syntaxKind": "block",
|
|
68
68
|
"allowMultiple": true
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"tagName": "@private",
|
|
72
|
+
"syntaxKind": "modifier"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"tagName": "@protected",
|
|
76
|
+
"syntaxKind": "modifier"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"tagName": "@satisfies",
|
|
80
|
+
"syntaxKind": "block"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"tagName": "@overload",
|
|
84
|
+
"syntaxKind": "modifier"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"tagName": "@namespace",
|
|
88
|
+
"syntaxKind": "modifier"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"tagName": "@interface",
|
|
92
|
+
"syntaxKind": "modifier"
|
|
69
93
|
}
|
|
70
94
|
]
|
|
71
95
|
}
|