typedoc 0.22.11 → 0.22.12
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/application.js +4 -0
- package/dist/lib/converter/symbols.js +4 -5
- package/dist/lib/models/ReflectionGroup.d.ts +1 -1
- package/dist/lib/models/reflections/abstract.d.ts +1 -44
- package/dist/lib/models/reflections/abstract.js +3 -64
- package/dist/lib/models/reflections/container.d.ts +2 -1
- package/dist/lib/models/reflections/index.d.ts +2 -1
- package/dist/lib/models/reflections/index.js +4 -3
- package/dist/lib/models/reflections/kind.d.ts +44 -0
- package/dist/lib/models/reflections/kind.js +65 -0
- package/dist/lib/models/reflections/project.d.ts +2 -1
- package/dist/lib/models/reflections/project.js +2 -1
- package/dist/lib/models/reflections/reference.js +2 -1
- package/dist/lib/models/reflections/signature.d.ts +2 -1
- package/dist/lib/models/reflections/type-parameter.js +2 -1
- package/dist/lib/utils/options/declaration.d.ts +6 -0
- package/dist/lib/utils/options/sources/typedoc.js +29 -0
- package/dist/lib/utils/sort.js +30 -30
- package/dist/lib/validation/documentation.d.ts +3 -0
- package/dist/lib/validation/documentation.js +25 -0
- package/dist/lib/validation/exports.js +1 -1
- package/package.json +4 -3
- package/dist/lib/ts-internal.d.ts +0 -43
- package/dist/lib/ts-internal.js +0 -2
package/dist/lib/application.js
CHANGED
|
@@ -22,6 +22,7 @@ const assert_1 = require("assert");
|
|
|
22
22
|
const entry_point_1 = require("./utils/entry-point");
|
|
23
23
|
const paths_1 = require("./utils/paths");
|
|
24
24
|
const general_1 = require("./utils/general");
|
|
25
|
+
const documentation_1 = require("./validation/documentation");
|
|
25
26
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
26
27
|
const packageInfo = require("../../package.json");
|
|
27
28
|
const supportedVersionMajorMinor = packageInfo.peerDependencies.typescript
|
|
@@ -248,6 +249,9 @@ let Application = Application_1 = class Application extends component_1.Childabl
|
|
|
248
249
|
if (checks.notExported) {
|
|
249
250
|
(0, exports_1.validateExports)(project, this.logger, this.options.getValue("intentionallyNotExported"));
|
|
250
251
|
}
|
|
252
|
+
if (checks.notDocumented) {
|
|
253
|
+
(0, documentation_1.validateDocumentation)(project, this.logger, this.options.getValue("requiredToBeDocumented"));
|
|
254
|
+
}
|
|
251
255
|
// checks.invalidLink is currently handled when rendering by the MarkedLinksPlugin.
|
|
252
256
|
// It should really move here, but I'm putting that off until done refactoring the comment
|
|
253
257
|
// parsing so that we don't have duplicate parse logic all over the place.
|
|
@@ -492,11 +492,6 @@ function convertVariableAsFunction(context, symbol, exportSymbol) {
|
|
|
492
492
|
: context.checker.getDeclaredTypeOfSymbol(symbol);
|
|
493
493
|
const reflection = context.createDeclarationReflection(models_1.ReflectionKind.Function, symbol, exportSymbol);
|
|
494
494
|
setModifiers(symbol, accessDeclaration, reflection);
|
|
495
|
-
// Does anyone care about this? I doubt it...
|
|
496
|
-
if (declaration &&
|
|
497
|
-
(0, enum_1.hasAllFlags)(symbol.flags, ts.SymbolFlags.BlockScopedVariable)) {
|
|
498
|
-
reflection.setFlag(models_1.ReflectionFlag.Const, (0, enum_1.hasAllFlags)((declaration || symbol.valueDeclaration).parent.flags, ts.NodeFlags.Const));
|
|
499
|
-
}
|
|
500
495
|
context.finalizeDeclarationReflection(reflection, symbol, exportSymbol);
|
|
501
496
|
const reflectionContext = context.withScope(reflection);
|
|
502
497
|
(_b = reflection.signatures) !== null && _b !== void 0 ? _b : (reflection.signatures = []);
|
|
@@ -561,6 +556,10 @@ function setModifiers(symbol, declaration, reflection) {
|
|
|
561
556
|
reflection.setFlag(models_1.ReflectionFlag.Readonly, (0, enum_1.hasAllFlags)((_a = symbol.checkFlags) !== null && _a !== void 0 ? _a : 0, ts.CheckFlags.Readonly) ||
|
|
562
557
|
(0, enum_1.hasAllFlags)(modifiers, ts.ModifierFlags.Readonly));
|
|
563
558
|
reflection.setFlag(models_1.ReflectionFlag.Abstract, (0, enum_1.hasAllFlags)(modifiers, ts.ModifierFlags.Abstract));
|
|
559
|
+
if (reflection.kindOf(models_1.ReflectionKind.Variable) &&
|
|
560
|
+
(0, enum_1.hasAllFlags)(symbol.flags, ts.SymbolFlags.BlockScopedVariable)) {
|
|
561
|
+
reflection.setFlag(models_1.ReflectionFlag.Const, (0, enum_1.hasAllFlags)(declaration.parent.flags, ts.NodeFlags.Const));
|
|
562
|
+
}
|
|
564
563
|
// ReflectionFlag.Static happens when constructing the reflection.
|
|
565
564
|
// We don't have sufficient information here to determine if it ought to be static.
|
|
566
565
|
}
|
|
@@ -3,56 +3,13 @@ import type { Type } from "../types";
|
|
|
3
3
|
import type { Comment } from "../comments/comment";
|
|
4
4
|
import type { ProjectReflection } from "./project";
|
|
5
5
|
import type { NeverIfInternal } from "../../utils";
|
|
6
|
+
import { ReflectionKind } from "./kind";
|
|
6
7
|
/**
|
|
7
8
|
* Reset the reflection id.
|
|
8
9
|
*
|
|
9
10
|
* Used by the test cases to ensure the reflection ids won't change between runs.
|
|
10
11
|
*/
|
|
11
12
|
export declare function resetReflectionID(): void;
|
|
12
|
-
/**
|
|
13
|
-
* Defines the available reflection kinds.
|
|
14
|
-
*/
|
|
15
|
-
export declare enum ReflectionKind {
|
|
16
|
-
Project = 1,
|
|
17
|
-
Module = 2,
|
|
18
|
-
Namespace = 4,
|
|
19
|
-
Enum = 8,
|
|
20
|
-
EnumMember = 16,
|
|
21
|
-
Variable = 32,
|
|
22
|
-
Function = 64,
|
|
23
|
-
Class = 128,
|
|
24
|
-
Interface = 256,
|
|
25
|
-
Constructor = 512,
|
|
26
|
-
Property = 1024,
|
|
27
|
-
Method = 2048,
|
|
28
|
-
CallSignature = 4096,
|
|
29
|
-
IndexSignature = 8192,
|
|
30
|
-
ConstructorSignature = 16384,
|
|
31
|
-
Parameter = 32768,
|
|
32
|
-
TypeLiteral = 65536,
|
|
33
|
-
TypeParameter = 131072,
|
|
34
|
-
Accessor = 262144,
|
|
35
|
-
GetSignature = 524288,
|
|
36
|
-
SetSignature = 1048576,
|
|
37
|
-
ObjectLiteral = 2097152,
|
|
38
|
-
TypeAlias = 4194304,
|
|
39
|
-
Event = 8388608,
|
|
40
|
-
Reference = 16777216
|
|
41
|
-
}
|
|
42
|
-
/** @hidden */
|
|
43
|
-
export declare namespace ReflectionKind {
|
|
44
|
-
const All: number;
|
|
45
|
-
const ClassOrInterface: number;
|
|
46
|
-
const VariableOrProperty: number;
|
|
47
|
-
const FunctionOrMethod: number;
|
|
48
|
-
const ClassMember: number;
|
|
49
|
-
const SomeSignature: number;
|
|
50
|
-
const SomeModule: number;
|
|
51
|
-
const SomeType: number;
|
|
52
|
-
const SomeValue: number;
|
|
53
|
-
/** @internal */
|
|
54
|
-
const Inheritable: number;
|
|
55
|
-
}
|
|
56
13
|
export declare enum ReflectionFlag {
|
|
57
14
|
None = 0,
|
|
58
15
|
Private = 1,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Reflection = exports.TraverseProperty = exports.ReflectionFlags = exports.ReflectionFlag = exports.
|
|
3
|
+
exports.Reflection = exports.TraverseProperty = exports.ReflectionFlags = exports.ReflectionFlag = exports.resetReflectionID = void 0;
|
|
4
4
|
const assert_1 = require("assert");
|
|
5
5
|
const utils_1 = require("./utils");
|
|
6
|
+
const kind_1 = require("./kind");
|
|
6
7
|
/**
|
|
7
8
|
* Holds all data models used by TypeDoc.
|
|
8
9
|
*
|
|
@@ -27,68 +28,6 @@ function resetReflectionID() {
|
|
|
27
28
|
REFLECTION_ID = 0;
|
|
28
29
|
}
|
|
29
30
|
exports.resetReflectionID = resetReflectionID;
|
|
30
|
-
/**
|
|
31
|
-
* Defines the available reflection kinds.
|
|
32
|
-
*/
|
|
33
|
-
var ReflectionKind;
|
|
34
|
-
(function (ReflectionKind) {
|
|
35
|
-
ReflectionKind[ReflectionKind["Project"] = 1] = "Project";
|
|
36
|
-
ReflectionKind[ReflectionKind["Module"] = 2] = "Module";
|
|
37
|
-
ReflectionKind[ReflectionKind["Namespace"] = 4] = "Namespace";
|
|
38
|
-
ReflectionKind[ReflectionKind["Enum"] = 8] = "Enum";
|
|
39
|
-
ReflectionKind[ReflectionKind["EnumMember"] = 16] = "EnumMember";
|
|
40
|
-
ReflectionKind[ReflectionKind["Variable"] = 32] = "Variable";
|
|
41
|
-
ReflectionKind[ReflectionKind["Function"] = 64] = "Function";
|
|
42
|
-
ReflectionKind[ReflectionKind["Class"] = 128] = "Class";
|
|
43
|
-
ReflectionKind[ReflectionKind["Interface"] = 256] = "Interface";
|
|
44
|
-
ReflectionKind[ReflectionKind["Constructor"] = 512] = "Constructor";
|
|
45
|
-
ReflectionKind[ReflectionKind["Property"] = 1024] = "Property";
|
|
46
|
-
ReflectionKind[ReflectionKind["Method"] = 2048] = "Method";
|
|
47
|
-
ReflectionKind[ReflectionKind["CallSignature"] = 4096] = "CallSignature";
|
|
48
|
-
ReflectionKind[ReflectionKind["IndexSignature"] = 8192] = "IndexSignature";
|
|
49
|
-
ReflectionKind[ReflectionKind["ConstructorSignature"] = 16384] = "ConstructorSignature";
|
|
50
|
-
ReflectionKind[ReflectionKind["Parameter"] = 32768] = "Parameter";
|
|
51
|
-
ReflectionKind[ReflectionKind["TypeLiteral"] = 65536] = "TypeLiteral";
|
|
52
|
-
ReflectionKind[ReflectionKind["TypeParameter"] = 131072] = "TypeParameter";
|
|
53
|
-
ReflectionKind[ReflectionKind["Accessor"] = 262144] = "Accessor";
|
|
54
|
-
ReflectionKind[ReflectionKind["GetSignature"] = 524288] = "GetSignature";
|
|
55
|
-
ReflectionKind[ReflectionKind["SetSignature"] = 1048576] = "SetSignature";
|
|
56
|
-
ReflectionKind[ReflectionKind["ObjectLiteral"] = 2097152] = "ObjectLiteral";
|
|
57
|
-
ReflectionKind[ReflectionKind["TypeAlias"] = 4194304] = "TypeAlias";
|
|
58
|
-
ReflectionKind[ReflectionKind["Event"] = 8388608] = "Event";
|
|
59
|
-
ReflectionKind[ReflectionKind["Reference"] = 16777216] = "Reference";
|
|
60
|
-
})(ReflectionKind = exports.ReflectionKind || (exports.ReflectionKind = {}));
|
|
61
|
-
/** @hidden */
|
|
62
|
-
(function (ReflectionKind) {
|
|
63
|
-
ReflectionKind.All = ReflectionKind.Reference * 2 - 1;
|
|
64
|
-
ReflectionKind.ClassOrInterface = ReflectionKind.Class | ReflectionKind.Interface;
|
|
65
|
-
ReflectionKind.VariableOrProperty = ReflectionKind.Variable | ReflectionKind.Property;
|
|
66
|
-
ReflectionKind.FunctionOrMethod = ReflectionKind.Function | ReflectionKind.Method;
|
|
67
|
-
ReflectionKind.ClassMember = ReflectionKind.Accessor |
|
|
68
|
-
ReflectionKind.Constructor |
|
|
69
|
-
ReflectionKind.Method |
|
|
70
|
-
ReflectionKind.Property |
|
|
71
|
-
ReflectionKind.Event;
|
|
72
|
-
ReflectionKind.SomeSignature = ReflectionKind.CallSignature |
|
|
73
|
-
ReflectionKind.IndexSignature |
|
|
74
|
-
ReflectionKind.ConstructorSignature |
|
|
75
|
-
ReflectionKind.GetSignature |
|
|
76
|
-
ReflectionKind.SetSignature;
|
|
77
|
-
ReflectionKind.SomeModule = ReflectionKind.Namespace | ReflectionKind.Module;
|
|
78
|
-
ReflectionKind.SomeType = ReflectionKind.Interface |
|
|
79
|
-
ReflectionKind.TypeLiteral |
|
|
80
|
-
ReflectionKind.TypeParameter |
|
|
81
|
-
ReflectionKind.TypeAlias;
|
|
82
|
-
ReflectionKind.SomeValue = ReflectionKind.Variable |
|
|
83
|
-
ReflectionKind.Function |
|
|
84
|
-
ReflectionKind.ObjectLiteral;
|
|
85
|
-
/** @internal */
|
|
86
|
-
ReflectionKind.Inheritable = ReflectionKind.Accessor |
|
|
87
|
-
ReflectionKind.IndexSignature |
|
|
88
|
-
ReflectionKind.Property |
|
|
89
|
-
ReflectionKind.Method |
|
|
90
|
-
ReflectionKind.Constructor;
|
|
91
|
-
})(ReflectionKind = exports.ReflectionKind || (exports.ReflectionKind = {}));
|
|
92
31
|
var ReflectionFlag;
|
|
93
32
|
(function (ReflectionFlag) {
|
|
94
33
|
ReflectionFlag[ReflectionFlag["None"] = 0] = "None";
|
|
@@ -409,7 +348,7 @@ class Reflection {
|
|
|
409
348
|
* Return a string representation of this reflection.
|
|
410
349
|
*/
|
|
411
350
|
toString() {
|
|
412
|
-
return ReflectionKind[this.kind] + " " + this.name;
|
|
351
|
+
return kind_1.ReflectionKind[this.kind] + " " + this.name;
|
|
413
352
|
}
|
|
414
353
|
/**
|
|
415
354
|
* Return a string representation of this reflection and all of its children.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Reflection,
|
|
1
|
+
import { Reflection, TraverseCallback } from "./abstract";
|
|
2
2
|
import type { ReflectionCategory } from "../ReflectionCategory";
|
|
3
3
|
import type { ReflectionGroup } from "../ReflectionGroup";
|
|
4
4
|
import type { DeclarationReflection } from "./declaration";
|
|
5
|
+
import type { ReflectionKind } from "./kind";
|
|
5
6
|
export declare class ContainerReflection extends Reflection {
|
|
6
7
|
/**
|
|
7
8
|
* The children of this reflection.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export { Reflection,
|
|
1
|
+
export { Reflection, ReflectionFlag, ReflectionFlags, TraverseProperty, } from "./abstract";
|
|
2
2
|
export type { Decorator, TraverseCallback } from "./abstract";
|
|
3
3
|
export { ContainerReflection } from "./container";
|
|
4
4
|
export { DeclarationReflection } from "./declaration";
|
|
5
5
|
export type { DeclarationHierarchy } from "./declaration";
|
|
6
|
+
export { ReflectionKind } from "./kind";
|
|
6
7
|
export { ParameterReflection } from "./parameter";
|
|
7
8
|
export { ProjectReflection } from "./project";
|
|
8
9
|
export { ReferenceReflection } from "./reference";
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.splitUnquotedString = exports.TypeParameterReflection = exports.SignatureReflection = exports.ReferenceReflection = exports.ProjectReflection = exports.ParameterReflection = exports.
|
|
3
|
+
exports.splitUnquotedString = exports.TypeParameterReflection = exports.SignatureReflection = exports.ReferenceReflection = exports.ProjectReflection = exports.ParameterReflection = exports.ReflectionKind = exports.DeclarationReflection = exports.ContainerReflection = exports.TraverseProperty = exports.ReflectionFlags = exports.ReflectionFlag = exports.Reflection = void 0;
|
|
4
4
|
var abstract_1 = require("./abstract");
|
|
5
5
|
Object.defineProperty(exports, "Reflection", { enumerable: true, get: function () { return abstract_1.Reflection; } });
|
|
6
|
-
Object.defineProperty(exports, "ReflectionKind", { enumerable: true, get: function () { return abstract_1.ReflectionKind; } });
|
|
7
6
|
Object.defineProperty(exports, "ReflectionFlag", { enumerable: true, get: function () { return abstract_1.ReflectionFlag; } });
|
|
8
|
-
Object.defineProperty(exports, "TraverseProperty", { enumerable: true, get: function () { return abstract_1.TraverseProperty; } });
|
|
9
7
|
Object.defineProperty(exports, "ReflectionFlags", { enumerable: true, get: function () { return abstract_1.ReflectionFlags; } });
|
|
8
|
+
Object.defineProperty(exports, "TraverseProperty", { enumerable: true, get: function () { return abstract_1.TraverseProperty; } });
|
|
10
9
|
var container_1 = require("./container");
|
|
11
10
|
Object.defineProperty(exports, "ContainerReflection", { enumerable: true, get: function () { return container_1.ContainerReflection; } });
|
|
12
11
|
var declaration_1 = require("./declaration");
|
|
13
12
|
Object.defineProperty(exports, "DeclarationReflection", { enumerable: true, get: function () { return declaration_1.DeclarationReflection; } });
|
|
13
|
+
var kind_1 = require("./kind");
|
|
14
|
+
Object.defineProperty(exports, "ReflectionKind", { enumerable: true, get: function () { return kind_1.ReflectionKind; } });
|
|
14
15
|
var parameter_1 = require("./parameter");
|
|
15
16
|
Object.defineProperty(exports, "ParameterReflection", { enumerable: true, get: function () { return parameter_1.ParameterReflection; } });
|
|
16
17
|
var project_1 = require("./project");
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines the available reflection kinds.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum ReflectionKind {
|
|
5
|
+
Project = 1,
|
|
6
|
+
Module = 2,
|
|
7
|
+
Namespace = 4,
|
|
8
|
+
Enum = 8,
|
|
9
|
+
EnumMember = 16,
|
|
10
|
+
Variable = 32,
|
|
11
|
+
Function = 64,
|
|
12
|
+
Class = 128,
|
|
13
|
+
Interface = 256,
|
|
14
|
+
Constructor = 512,
|
|
15
|
+
Property = 1024,
|
|
16
|
+
Method = 2048,
|
|
17
|
+
CallSignature = 4096,
|
|
18
|
+
IndexSignature = 8192,
|
|
19
|
+
ConstructorSignature = 16384,
|
|
20
|
+
Parameter = 32768,
|
|
21
|
+
TypeLiteral = 65536,
|
|
22
|
+
TypeParameter = 131072,
|
|
23
|
+
Accessor = 262144,
|
|
24
|
+
GetSignature = 524288,
|
|
25
|
+
SetSignature = 1048576,
|
|
26
|
+
ObjectLiteral = 2097152,
|
|
27
|
+
TypeAlias = 4194304,
|
|
28
|
+
Event = 8388608,
|
|
29
|
+
Reference = 16777216
|
|
30
|
+
}
|
|
31
|
+
/** @hidden */
|
|
32
|
+
export declare namespace ReflectionKind {
|
|
33
|
+
const All: number;
|
|
34
|
+
const ClassOrInterface: number;
|
|
35
|
+
const VariableOrProperty: number;
|
|
36
|
+
const FunctionOrMethod: number;
|
|
37
|
+
const ClassMember: number;
|
|
38
|
+
const SomeSignature: number;
|
|
39
|
+
const SomeModule: number;
|
|
40
|
+
const SomeType: number;
|
|
41
|
+
const SomeValue: number;
|
|
42
|
+
/** @internal */
|
|
43
|
+
const Inheritable: number;
|
|
44
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReflectionKind = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Defines the available reflection kinds.
|
|
6
|
+
*/
|
|
7
|
+
var ReflectionKind;
|
|
8
|
+
(function (ReflectionKind) {
|
|
9
|
+
ReflectionKind[ReflectionKind["Project"] = 1] = "Project";
|
|
10
|
+
ReflectionKind[ReflectionKind["Module"] = 2] = "Module";
|
|
11
|
+
ReflectionKind[ReflectionKind["Namespace"] = 4] = "Namespace";
|
|
12
|
+
ReflectionKind[ReflectionKind["Enum"] = 8] = "Enum";
|
|
13
|
+
ReflectionKind[ReflectionKind["EnumMember"] = 16] = "EnumMember";
|
|
14
|
+
ReflectionKind[ReflectionKind["Variable"] = 32] = "Variable";
|
|
15
|
+
ReflectionKind[ReflectionKind["Function"] = 64] = "Function";
|
|
16
|
+
ReflectionKind[ReflectionKind["Class"] = 128] = "Class";
|
|
17
|
+
ReflectionKind[ReflectionKind["Interface"] = 256] = "Interface";
|
|
18
|
+
ReflectionKind[ReflectionKind["Constructor"] = 512] = "Constructor";
|
|
19
|
+
ReflectionKind[ReflectionKind["Property"] = 1024] = "Property";
|
|
20
|
+
ReflectionKind[ReflectionKind["Method"] = 2048] = "Method";
|
|
21
|
+
ReflectionKind[ReflectionKind["CallSignature"] = 4096] = "CallSignature";
|
|
22
|
+
ReflectionKind[ReflectionKind["IndexSignature"] = 8192] = "IndexSignature";
|
|
23
|
+
ReflectionKind[ReflectionKind["ConstructorSignature"] = 16384] = "ConstructorSignature";
|
|
24
|
+
ReflectionKind[ReflectionKind["Parameter"] = 32768] = "Parameter";
|
|
25
|
+
ReflectionKind[ReflectionKind["TypeLiteral"] = 65536] = "TypeLiteral";
|
|
26
|
+
ReflectionKind[ReflectionKind["TypeParameter"] = 131072] = "TypeParameter";
|
|
27
|
+
ReflectionKind[ReflectionKind["Accessor"] = 262144] = "Accessor";
|
|
28
|
+
ReflectionKind[ReflectionKind["GetSignature"] = 524288] = "GetSignature";
|
|
29
|
+
ReflectionKind[ReflectionKind["SetSignature"] = 1048576] = "SetSignature";
|
|
30
|
+
ReflectionKind[ReflectionKind["ObjectLiteral"] = 2097152] = "ObjectLiteral";
|
|
31
|
+
ReflectionKind[ReflectionKind["TypeAlias"] = 4194304] = "TypeAlias";
|
|
32
|
+
ReflectionKind[ReflectionKind["Event"] = 8388608] = "Event";
|
|
33
|
+
ReflectionKind[ReflectionKind["Reference"] = 16777216] = "Reference";
|
|
34
|
+
})(ReflectionKind = exports.ReflectionKind || (exports.ReflectionKind = {}));
|
|
35
|
+
/** @hidden */
|
|
36
|
+
(function (ReflectionKind) {
|
|
37
|
+
ReflectionKind.All = ReflectionKind.Reference * 2 - 1;
|
|
38
|
+
ReflectionKind.ClassOrInterface = ReflectionKind.Class | ReflectionKind.Interface;
|
|
39
|
+
ReflectionKind.VariableOrProperty = ReflectionKind.Variable | ReflectionKind.Property;
|
|
40
|
+
ReflectionKind.FunctionOrMethod = ReflectionKind.Function | ReflectionKind.Method;
|
|
41
|
+
ReflectionKind.ClassMember = ReflectionKind.Accessor |
|
|
42
|
+
ReflectionKind.Constructor |
|
|
43
|
+
ReflectionKind.Method |
|
|
44
|
+
ReflectionKind.Property |
|
|
45
|
+
ReflectionKind.Event;
|
|
46
|
+
ReflectionKind.SomeSignature = ReflectionKind.CallSignature |
|
|
47
|
+
ReflectionKind.IndexSignature |
|
|
48
|
+
ReflectionKind.ConstructorSignature |
|
|
49
|
+
ReflectionKind.GetSignature |
|
|
50
|
+
ReflectionKind.SetSignature;
|
|
51
|
+
ReflectionKind.SomeModule = ReflectionKind.Namespace | ReflectionKind.Module;
|
|
52
|
+
ReflectionKind.SomeType = ReflectionKind.Interface |
|
|
53
|
+
ReflectionKind.TypeLiteral |
|
|
54
|
+
ReflectionKind.TypeParameter |
|
|
55
|
+
ReflectionKind.TypeAlias;
|
|
56
|
+
ReflectionKind.SomeValue = ReflectionKind.Variable |
|
|
57
|
+
ReflectionKind.Function |
|
|
58
|
+
ReflectionKind.ObjectLiteral;
|
|
59
|
+
/** @internal */
|
|
60
|
+
ReflectionKind.Inheritable = ReflectionKind.Accessor |
|
|
61
|
+
ReflectionKind.IndexSignature |
|
|
62
|
+
ReflectionKind.Property |
|
|
63
|
+
ReflectionKind.Method |
|
|
64
|
+
ReflectionKind.Constructor;
|
|
65
|
+
})(ReflectionKind = exports.ReflectionKind || (exports.ReflectionKind = {}));
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { SourceFile, SourceDirectory } from "../sources/index";
|
|
2
|
-
import { Reflection
|
|
2
|
+
import { Reflection } from "./abstract";
|
|
3
3
|
import { ContainerReflection } from "./container";
|
|
4
4
|
import type * as ts from "typescript";
|
|
5
|
+
import { ReflectionKind } from "./kind";
|
|
5
6
|
/**
|
|
6
7
|
* A reflection that represents the root of the project.
|
|
7
8
|
*
|
|
@@ -8,6 +8,7 @@ const utils_1 = require("./utils");
|
|
|
8
8
|
const reference_1 = require("./reference");
|
|
9
9
|
const types_1 = require("../types");
|
|
10
10
|
const utils_2 = require("../../utils");
|
|
11
|
+
const kind_1 = require("./kind");
|
|
11
12
|
/**
|
|
12
13
|
* A reflection that represents the root of the project.
|
|
13
14
|
*
|
|
@@ -21,7 +22,7 @@ class ProjectReflection extends container_1.ContainerReflection {
|
|
|
21
22
|
* @param name The name of the project.
|
|
22
23
|
*/
|
|
23
24
|
constructor(name) {
|
|
24
|
-
super(name,
|
|
25
|
+
super(name, kind_1.ReflectionKind.Project);
|
|
25
26
|
// Used to resolve references.
|
|
26
27
|
this.symbolToReflectionIdMap = new Map();
|
|
27
28
|
this.reflectionIdToSymbolMap = new Map();
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ReferenceReflection = void 0;
|
|
4
4
|
const abstract_1 = require("./abstract");
|
|
5
5
|
const declaration_1 = require("./declaration");
|
|
6
|
+
const kind_1 = require("./kind");
|
|
6
7
|
/**
|
|
7
8
|
* Describes a reflection which does not exist at this location, but is referenced. Used for imported reflections.
|
|
8
9
|
*
|
|
@@ -26,7 +27,7 @@ class ReferenceReflection extends declaration_1.DeclarationReflection {
|
|
|
26
27
|
* @internal
|
|
27
28
|
*/
|
|
28
29
|
constructor(name, state, parent) {
|
|
29
|
-
super(name,
|
|
30
|
+
super(name, kind_1.ReflectionKind.Reference, parent);
|
|
30
31
|
this._target = state;
|
|
31
32
|
}
|
|
32
33
|
/**
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Type, ReferenceType } from "../types";
|
|
2
|
-
import { Reflection, TraverseCallback
|
|
2
|
+
import { Reflection, TraverseCallback } from "./abstract";
|
|
3
3
|
import type { ParameterReflection } from "./parameter";
|
|
4
4
|
import type { TypeParameterReflection } from "./type-parameter";
|
|
5
5
|
import type { DeclarationReflection } from "./declaration";
|
|
6
|
+
import type { ReflectionKind } from "./kind";
|
|
6
7
|
export declare class SignatureReflection extends Reflection {
|
|
7
8
|
/**
|
|
8
9
|
* Create a new SignatureReflection to contain a specific type of signature.
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TypeParameterReflection = void 0;
|
|
4
4
|
const abstract_1 = require("./abstract");
|
|
5
|
+
const kind_1 = require("./kind");
|
|
5
6
|
class TypeParameterReflection extends abstract_1.Reflection {
|
|
6
7
|
/**
|
|
7
8
|
* Create a new TypeParameterReflection instance.
|
|
8
9
|
*/
|
|
9
10
|
constructor(name, constraint, defaultType, parent) {
|
|
10
|
-
super(name,
|
|
11
|
+
super(name, kind_1.ReflectionKind.TypeParameter, parent);
|
|
11
12
|
this.type = constraint;
|
|
12
13
|
this.default = defaultType;
|
|
13
14
|
}
|
|
@@ -2,6 +2,7 @@ import type { Theme as ShikiTheme } from "shiki";
|
|
|
2
2
|
import type { LogLevel } from "../loggers";
|
|
3
3
|
import type { SortStrategy } from "../sort";
|
|
4
4
|
import type { EntryPointStrategy } from "../entry-point";
|
|
5
|
+
import type { ReflectionKind } from "../../models/reflections/kind";
|
|
5
6
|
export declare const EmitStrategy: {
|
|
6
7
|
readonly true: true;
|
|
7
8
|
readonly false: false;
|
|
@@ -85,6 +86,7 @@ export interface TypeDocOptionMap {
|
|
|
85
86
|
/** @deprecated use validation.invalidLink */
|
|
86
87
|
listInvalidSymbolLinks: boolean;
|
|
87
88
|
validation: ValidationOptions;
|
|
89
|
+
requiredToBeDocumented: (keyof typeof ReflectionKind)[];
|
|
88
90
|
}
|
|
89
91
|
export declare type ValidationOptions = {
|
|
90
92
|
/**
|
|
@@ -96,6 +98,10 @@ export declare type ValidationOptions = {
|
|
|
96
98
|
* If set, TypeDoc will produce warnings about \{&link\} tags which will produce broken links.
|
|
97
99
|
*/
|
|
98
100
|
invalidLink: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* If set, TypeDoc will produce warnings about declarations that do not have doc comments
|
|
103
|
+
*/
|
|
104
|
+
notDocumented: boolean;
|
|
99
105
|
};
|
|
100
106
|
/**
|
|
101
107
|
* Converts a given TypeDoc option key to the type of the declaration expected.
|
|
@@ -6,6 +6,7 @@ const declaration_1 = require("../declaration");
|
|
|
6
6
|
const shiki_1 = require("shiki");
|
|
7
7
|
const sort_1 = require("../../sort");
|
|
8
8
|
const entry_point_1 = require("../../entry-point");
|
|
9
|
+
const kind_1 = require("../../../models/reflections/kind");
|
|
9
10
|
function addTypeDocOptions(options) {
|
|
10
11
|
options.addDeclaration({
|
|
11
12
|
type: declaration_1.ParameterType.Path,
|
|
@@ -311,6 +312,33 @@ function addTypeDocOptions(options) {
|
|
|
311
312
|
help: "A list of types which should not produce 'referenced but not documented' warnings.",
|
|
312
313
|
type: declaration_1.ParameterType.Array,
|
|
313
314
|
});
|
|
315
|
+
options.addDeclaration({
|
|
316
|
+
name: "requiredToBeDocumented",
|
|
317
|
+
help: "A list of reflection kinds that must be documented",
|
|
318
|
+
type: declaration_1.ParameterType.Array,
|
|
319
|
+
validate(values) {
|
|
320
|
+
// this is good enough because the values of the ReflectionKind enum are all numbers
|
|
321
|
+
const validValues = Object.values(kind_1.ReflectionKind).filter((v) => typeof v === "string");
|
|
322
|
+
for (const kind of values) {
|
|
323
|
+
if (validValues.includes(kind)) {
|
|
324
|
+
throw new Error(`'${kind}' is an invalid value for 'requiredToBeDocumented'. Must be one of: ${validValues.join(", ")}`);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
defaultValue: [
|
|
329
|
+
"Enum",
|
|
330
|
+
"EnumMember",
|
|
331
|
+
"Variable",
|
|
332
|
+
"Function",
|
|
333
|
+
"Class",
|
|
334
|
+
"Interface",
|
|
335
|
+
"Property",
|
|
336
|
+
"Method",
|
|
337
|
+
"GetSignature",
|
|
338
|
+
"SetSignature",
|
|
339
|
+
"TypeAlias",
|
|
340
|
+
],
|
|
341
|
+
});
|
|
314
342
|
options.addDeclaration({
|
|
315
343
|
name: "validation",
|
|
316
344
|
help: "Specify which validation steps TypeDoc should perform on your generated documentation.",
|
|
@@ -318,6 +346,7 @@ function addTypeDocOptions(options) {
|
|
|
318
346
|
defaults: {
|
|
319
347
|
notExported: true,
|
|
320
348
|
invalidLink: false,
|
|
349
|
+
notDocumented: false,
|
|
321
350
|
},
|
|
322
351
|
});
|
|
323
352
|
}
|
package/dist/lib/utils/sort.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.sortReflections = exports.SORT_STRATEGIES = void 0;
|
|
8
|
-
const
|
|
8
|
+
const kind_1 = require("../models/reflections/kind");
|
|
9
9
|
exports.SORT_STRATEGIES = [
|
|
10
10
|
"source-order",
|
|
11
11
|
"alphabetical",
|
|
@@ -47,8 +47,8 @@ const sorts = {
|
|
|
47
47
|
},
|
|
48
48
|
"enum-value-ascending"(a, b) {
|
|
49
49
|
var _a, _b;
|
|
50
|
-
if (a.kind ==
|
|
51
|
-
b.kind ==
|
|
50
|
+
if (a.kind == kind_1.ReflectionKind.EnumMember &&
|
|
51
|
+
b.kind == kind_1.ReflectionKind.EnumMember) {
|
|
52
52
|
return (parseFloat((_a = a.defaultValue) !== null && _a !== void 0 ? _a : "0") <
|
|
53
53
|
parseFloat((_b = b.defaultValue) !== null && _b !== void 0 ? _b : "0"));
|
|
54
54
|
}
|
|
@@ -56,8 +56,8 @@ const sorts = {
|
|
|
56
56
|
},
|
|
57
57
|
"enum-value-descending"(a, b) {
|
|
58
58
|
var _a, _b;
|
|
59
|
-
if (a.kind ==
|
|
60
|
-
b.kind ==
|
|
59
|
+
if (a.kind == kind_1.ReflectionKind.EnumMember &&
|
|
60
|
+
b.kind == kind_1.ReflectionKind.EnumMember) {
|
|
61
61
|
return (parseFloat((_a = b.defaultValue) !== null && _a !== void 0 ? _a : "0") <
|
|
62
62
|
parseFloat((_b = a.defaultValue) !== null && _b !== void 0 ? _b : "0"));
|
|
63
63
|
}
|
|
@@ -89,31 +89,31 @@ const sorts = {
|
|
|
89
89
|
},
|
|
90
90
|
kind(a, b) {
|
|
91
91
|
const weights = [
|
|
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
|
-
|
|
92
|
+
kind_1.ReflectionKind.Reference,
|
|
93
|
+
kind_1.ReflectionKind.Project,
|
|
94
|
+
kind_1.ReflectionKind.Module,
|
|
95
|
+
kind_1.ReflectionKind.Namespace,
|
|
96
|
+
kind_1.ReflectionKind.Enum,
|
|
97
|
+
kind_1.ReflectionKind.EnumMember,
|
|
98
|
+
kind_1.ReflectionKind.Class,
|
|
99
|
+
kind_1.ReflectionKind.Interface,
|
|
100
|
+
kind_1.ReflectionKind.TypeAlias,
|
|
101
|
+
kind_1.ReflectionKind.Constructor,
|
|
102
|
+
kind_1.ReflectionKind.Event,
|
|
103
|
+
kind_1.ReflectionKind.Property,
|
|
104
|
+
kind_1.ReflectionKind.Variable,
|
|
105
|
+
kind_1.ReflectionKind.Function,
|
|
106
|
+
kind_1.ReflectionKind.Accessor,
|
|
107
|
+
kind_1.ReflectionKind.Method,
|
|
108
|
+
kind_1.ReflectionKind.ObjectLiteral,
|
|
109
|
+
kind_1.ReflectionKind.Parameter,
|
|
110
|
+
kind_1.ReflectionKind.TypeParameter,
|
|
111
|
+
kind_1.ReflectionKind.TypeLiteral,
|
|
112
|
+
kind_1.ReflectionKind.CallSignature,
|
|
113
|
+
kind_1.ReflectionKind.ConstructorSignature,
|
|
114
|
+
kind_1.ReflectionKind.IndexSignature,
|
|
115
|
+
kind_1.ReflectionKind.GetSignature,
|
|
116
|
+
kind_1.ReflectionKind.SetSignature,
|
|
117
117
|
];
|
|
118
118
|
return weights.indexOf(a.kind) < weights.indexOf(b.kind);
|
|
119
119
|
},
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateDocumentation = void 0;
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const ts = require("typescript");
|
|
6
|
+
const models_1 = require("../models");
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
function validateDocumentation(project, logger, requiredToBeDocumented) {
|
|
9
|
+
const kinds = requiredToBeDocumented.reduce((prev, cur) => (prev |= models_1.ReflectionKind[cur]), 0);
|
|
10
|
+
for (const ref of project.getReflectionsByKind(kinds)) {
|
|
11
|
+
const symbol = project.getSymbolFromReflection(ref);
|
|
12
|
+
if (!ref.comment && (symbol === null || symbol === void 0 ? void 0 : symbol.declarations)) {
|
|
13
|
+
const decl = symbol.declarations[0];
|
|
14
|
+
const sourceFile = decl.getSourceFile();
|
|
15
|
+
const { line } = ts.getLineAndCharacterOfPosition(sourceFile, decl.getStart());
|
|
16
|
+
const file = (0, utils_1.normalizePath)(path.relative(process.cwd(), sourceFile.fileName));
|
|
17
|
+
if (file.includes("node_modules")) {
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
const loc = `${file}:${line + 1}`;
|
|
21
|
+
logger.warn(`${ref.name}, defined at ${loc}, does not have any documentation.`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.validateDocumentation = validateDocumentation;
|
|
@@ -65,7 +65,7 @@ function validateExports(project, logger, intentionallyNotExported) {
|
|
|
65
65
|
const decl = symbol.declarations[0];
|
|
66
66
|
const { line } = ts.getLineAndCharacterOfPosition(decl.getSourceFile(), decl.getStart());
|
|
67
67
|
const file = (0, utils_1.normalizePath)((0, path_1.relative)(process.cwd(), decl.getSourceFile().fileName));
|
|
68
|
-
logger.warn(`${type.name}, defined at ${file}:${line}, is referenced by ${current.getFullName()} but not included in the documentation.`);
|
|
68
|
+
logger.warn(`${type.name}, defined at ${file}:${line + 1}, is referenced by ${current.getFullName()} but not included in the documentation.`);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
},
|
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.22.
|
|
4
|
+
"version": "0.22.12",
|
|
5
5
|
"homepage": "https://typedoc.org",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"exports": "./dist/index.js",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"reg-suit": "^0.11.1",
|
|
51
51
|
"reg-suit-core": "^0.11.1",
|
|
52
52
|
"reg-suit-interface": "^0.11.0",
|
|
53
|
+
"ts-node": "^10.4.0",
|
|
53
54
|
"typescript": "^4.5.4"
|
|
54
55
|
},
|
|
55
56
|
"files": [
|
|
@@ -63,9 +64,9 @@
|
|
|
63
64
|
],
|
|
64
65
|
"scripts": {
|
|
65
66
|
"pretest": "node scripts/copy_test_files.js",
|
|
66
|
-
"test": "mocha --config .config/mocha.fast.json",
|
|
67
|
+
"test": "mocha -r ts-node/register --config .config/mocha.fast.json",
|
|
67
68
|
"pretest:full": "npm run pretest",
|
|
68
|
-
"test:full": "nyc mocha --config .config/mocha.full.json",
|
|
69
|
+
"test:full": "nyc mocha -r ts-node/register --config .config/mocha.full.json",
|
|
69
70
|
"test:visual": "node ./dist/test/capture-screenshots.js && reg-suit -c .config/regconfig.json compare",
|
|
70
71
|
"test:visual:accept": "node scripts/accept_visual_regression.js",
|
|
71
72
|
"prerebuild_specs": "npm run pretest",
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type * as ts from "typescript";
|
|
2
|
-
/**
|
|
3
|
-
* Expose the internal TypeScript APIs that are used by TypeDoc
|
|
4
|
-
*/
|
|
5
|
-
declare module "typescript" {
|
|
6
|
-
interface Node {
|
|
7
|
-
symbol?: ts.Symbol;
|
|
8
|
-
}
|
|
9
|
-
interface Symbol {
|
|
10
|
-
checkFlags?: CheckFlags;
|
|
11
|
-
}
|
|
12
|
-
interface TypeChecker {
|
|
13
|
-
getTypePredicateOfSignature(signature: ts.Signature): ts.TypePredicate | undefined;
|
|
14
|
-
}
|
|
15
|
-
interface UnionType {
|
|
16
|
-
origin?: ts.Type;
|
|
17
|
-
}
|
|
18
|
-
enum CheckFlags {
|
|
19
|
-
Instantiated = 1,
|
|
20
|
-
SyntheticProperty = 2,
|
|
21
|
-
SyntheticMethod = 4,
|
|
22
|
-
Readonly = 8,
|
|
23
|
-
ReadPartial = 16,
|
|
24
|
-
WritePartial = 32,
|
|
25
|
-
HasNonUniformType = 64,
|
|
26
|
-
HasLiteralType = 128,
|
|
27
|
-
ContainsPublic = 256,
|
|
28
|
-
ContainsProtected = 512,
|
|
29
|
-
ContainsPrivate = 1024,
|
|
30
|
-
ContainsStatic = 2048,
|
|
31
|
-
Late = 4096,
|
|
32
|
-
ReverseMapped = 8192,
|
|
33
|
-
OptionalParameter = 16384,
|
|
34
|
-
RestParameter = 32768,
|
|
35
|
-
DeferredType = 65536,
|
|
36
|
-
HasNeverType = 131072,
|
|
37
|
-
Mapped = 262144,
|
|
38
|
-
StripOptional = 524288,
|
|
39
|
-
Synthetic = 6,
|
|
40
|
-
Discriminant = 192,
|
|
41
|
-
Partial = 48
|
|
42
|
-
}
|
|
43
|
-
}
|
package/dist/lib/ts-internal.js
DELETED