typedoc 0.22.5 → 0.22.6
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 +16 -9
- package/dist/lib/converter/convert-expression.js +14 -0
- package/dist/lib/converter/plugins/CategoryPlugin.d.ts +2 -2
- package/dist/lib/converter/plugins/CommentPlugin.js +3 -1
- package/dist/lib/converter/plugins/GroupPlugin.d.ts +2 -2
- package/dist/lib/converter/plugins/SourcePlugin.js +0 -1
- package/dist/lib/converter/symbols.js +18 -21
- package/dist/lib/models/ReflectionCategory.d.ts +3 -10
- package/dist/lib/models/ReflectionCategory.js +2 -7
- package/dist/lib/models/ReflectionGroup.d.ts +4 -10
- package/dist/lib/models/ReflectionGroup.js +1 -8
- package/dist/lib/models/comments/comment.d.ts +1 -1
- package/dist/lib/models/comments/comment.js +1 -1
- package/dist/lib/models/sources/directory.d.ts +2 -2
- package/dist/lib/models/sources/directory.js +2 -6
- package/dist/lib/models/sources/file.d.ts +2 -2
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +25 -25
- package/dist/lib/output/themes/default/layouts/default.js +2 -1
- package/dist/lib/output/themes/default/partials/member.js +2 -2
- package/dist/lib/output/themes/default/partials/members.group.js +2 -3
- package/dist/lib/output/themes/default/partials/members.js +1 -2
- package/dist/lib/output/themes/lib.d.ts +1 -2
- package/dist/lib/output/themes/lib.js +1 -7
- package/dist/lib/utils/entry-point.d.ts +1 -0
- package/dist/lib/utils/entry-point.js +24 -1
- package/dist/lib/utils/general.d.ts +0 -22
- package/dist/lib/utils/jsx.d.ts +8 -35
- package/dist/lib/utils/jsx.elements.d.ts +819 -0
- package/dist/lib/utils/jsx.elements.js +4 -0
- package/dist/lib/utils/jsx.js +7 -6
- package/dist/lib/utils/options/readers/tsconfig.d.ts +5 -0
- package/dist/lib/utils/options/readers/tsconfig.js +14 -3
- package/dist/lib/validation/exports.d.ts +1 -1
- package/dist/lib/validation/exports.js +2 -1
- package/package.json +1 -1
package/dist/lib/application.js
CHANGED
|
@@ -17,7 +17,6 @@ const index_2 = require("./utils/index");
|
|
|
17
17
|
const component_1 = require("./utils/component");
|
|
18
18
|
const utils_1 = require("./utils");
|
|
19
19
|
const array_1 = require("./utils/array");
|
|
20
|
-
const path_1 = require("path");
|
|
21
20
|
const exports_1 = require("./validation/exports");
|
|
22
21
|
const assert_1 = require("assert");
|
|
23
22
|
const entry_point_1 = require("./utils/entry-point");
|
|
@@ -183,16 +182,11 @@ let Application = Application_1 = class Application extends component_1.Childabl
|
|
|
183
182
|
this.logger.error("The packages option of entryPointStrategy is not supported in watch mode.");
|
|
184
183
|
return;
|
|
185
184
|
}
|
|
186
|
-
|
|
187
|
-
let tsconfigFile = this.options.getValue("tsconfig");
|
|
188
|
-
tsconfigFile =
|
|
189
|
-
(_c = ts.findConfigFile(tsconfigFile, ts.sys.fileExists, tsconfigFile.toLowerCase().endsWith(".json")
|
|
190
|
-
? (0, path_1.basename)(tsconfigFile)
|
|
191
|
-
: undefined)) !== null && _c !== void 0 ? _c : "tsconfig.json";
|
|
185
|
+
const tsconfigFile = (_c = index_2.TSConfigReader.findConfigFile(this.options.getValue("tsconfig"))) !== null && _c !== void 0 ? _c : "tsconfig.json";
|
|
192
186
|
// We don't want to do it the first time to preserve initial debug status messages. They'll be lost
|
|
193
187
|
// after the user saves a file, but better than nothing...
|
|
194
188
|
let firstStatusReport = true;
|
|
195
|
-
const host = ts.createWatchCompilerHost(tsconfigFile,
|
|
189
|
+
const host = ts.createWatchCompilerHost(tsconfigFile, {}, ts.sys, ts.createEmitAndSemanticDiagnosticsBuilderProgram, (diagnostic) => this.logger.diagnostic(diagnostic), (status, newLine, _options, errorCount) => {
|
|
196
190
|
var _a, _b;
|
|
197
191
|
if (!firstStatusReport &&
|
|
198
192
|
errorCount === void 0 &&
|
|
@@ -210,8 +204,13 @@ let Application = Application_1 = class Application extends component_1.Childabl
|
|
|
210
204
|
return;
|
|
211
205
|
}
|
|
212
206
|
if (successFinished) {
|
|
207
|
+
if (this.options.getValue("emit") === "both" ||
|
|
208
|
+
this.options.getValue("emit") === true) {
|
|
209
|
+
currentProgram.emit();
|
|
210
|
+
}
|
|
213
211
|
this.logger.resetErrors();
|
|
214
|
-
|
|
212
|
+
this.logger.resetWarnings();
|
|
213
|
+
const entryPoints = (0, entry_point_1.getWatchEntryPoints)(this.logger, this.options, currentProgram);
|
|
215
214
|
if (!entryPoints) {
|
|
216
215
|
return;
|
|
217
216
|
}
|
|
@@ -224,6 +223,14 @@ let Application = Application_1 = class Application extends component_1.Childabl
|
|
|
224
223
|
});
|
|
225
224
|
}
|
|
226
225
|
};
|
|
226
|
+
const origCreateProgram = host.createProgram;
|
|
227
|
+
host.createProgram = (rootNames, options, host, oldProgram, configDiagnostics, references) => {
|
|
228
|
+
// If we always do this, we'll get a crash the second time a program is created.
|
|
229
|
+
if (rootNames !== undefined) {
|
|
230
|
+
options = this.options.fixCompilerOptions(options || {});
|
|
231
|
+
}
|
|
232
|
+
return origCreateProgram(rootNames, options, host, oldProgram, configDiagnostics, references);
|
|
233
|
+
};
|
|
227
234
|
const origAfterProgramCreate = host.afterProgramCreate;
|
|
228
235
|
host.afterProgramCreate = (program) => {
|
|
229
236
|
if (ts.getPreEmitDiagnostics(program.getProgram()).length === 0) {
|
|
@@ -26,6 +26,7 @@ function convertExpression(expression) {
|
|
|
26
26
|
case ts.SyntaxKind.NullKeyword:
|
|
27
27
|
case ts.SyntaxKind.NumericLiteral:
|
|
28
28
|
case ts.SyntaxKind.PrefixUnaryExpression:
|
|
29
|
+
case ts.SyntaxKind.Identifier:
|
|
29
30
|
return expression.getText();
|
|
30
31
|
}
|
|
31
32
|
if (ts.isArrayLiteralExpression(expression) &&
|
|
@@ -36,6 +37,19 @@ function convertExpression(expression) {
|
|
|
36
37
|
expression.properties.length === 0) {
|
|
37
38
|
return "{}";
|
|
38
39
|
}
|
|
40
|
+
// a.b.c.d
|
|
41
|
+
if (ts.isPropertyAccessExpression(expression)) {
|
|
42
|
+
const parts = [expression.name.getText()];
|
|
43
|
+
let iter = expression.expression;
|
|
44
|
+
while (ts.isPropertyAccessExpression(iter)) {
|
|
45
|
+
parts.unshift(iter.name.getText());
|
|
46
|
+
iter = iter.expression;
|
|
47
|
+
}
|
|
48
|
+
if (ts.isIdentifier(iter)) {
|
|
49
|
+
parts.unshift(iter.text);
|
|
50
|
+
return parts.join(".");
|
|
51
|
+
}
|
|
52
|
+
}
|
|
39
53
|
// More complex expressions are generally not useful in the documentation.
|
|
40
54
|
// Show that there was a value, but not specifics.
|
|
41
55
|
return "...";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Reflection } from "../../models";
|
|
1
|
+
import { Reflection, DeclarationReflection } from "../../models";
|
|
2
2
|
import { ReflectionCategory } from "../../models/ReflectionCategory";
|
|
3
3
|
import { ConverterComponent } from "../components";
|
|
4
4
|
/**
|
|
@@ -42,7 +42,7 @@ export declare class CategoryPlugin extends ConverterComponent {
|
|
|
42
42
|
* @param reflections The reflections that should be categorized.
|
|
43
43
|
* @returns An array containing all children of the given reflection categorized
|
|
44
44
|
*/
|
|
45
|
-
static getReflectionCategories(reflections:
|
|
45
|
+
static getReflectionCategories(reflections: DeclarationReflection[]): ReflectionCategory[];
|
|
46
46
|
/**
|
|
47
47
|
* Return the category of a given reflection.
|
|
48
48
|
*
|
|
@@ -259,7 +259,9 @@ let CommentPlugin = CommentPlugin_1 = class CommentPlugin extends components_1.C
|
|
|
259
259
|
childComment.shortText || (childComment.shortText = comment.shortText);
|
|
260
260
|
childComment.text || (childComment.text = comment.text);
|
|
261
261
|
childComment.returns || (childComment.returns = comment.returns);
|
|
262
|
-
childComment.tags
|
|
262
|
+
childComment.tags = childComment.tags.length
|
|
263
|
+
? childComment.tags
|
|
264
|
+
: [...comment.tags];
|
|
263
265
|
}
|
|
264
266
|
(_a = signature.parameters) === null || _a === void 0 ? void 0 : _a.forEach((parameter, index) => {
|
|
265
267
|
var _a;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReflectionKind, DeclarationReflection } from "../../models/reflections/index";
|
|
2
2
|
import { ReflectionGroup } from "../../models/ReflectionGroup";
|
|
3
3
|
import { ConverterComponent } from "../components";
|
|
4
4
|
import { SortStrategy } from "../../utils/sort";
|
|
@@ -53,7 +53,7 @@ export declare class GroupPlugin extends ConverterComponent {
|
|
|
53
53
|
* @param reflections The reflections that should be grouped.
|
|
54
54
|
* @returns An array containing all children of the given reflection grouped by their kind.
|
|
55
55
|
*/
|
|
56
|
-
static getReflectionGroups(reflections:
|
|
56
|
+
static getReflectionGroups(reflections: DeclarationReflection[]): ReflectionGroup[];
|
|
57
57
|
/**
|
|
58
58
|
* Transform the internal typescript kind identifier into a human readable version.
|
|
59
59
|
*
|
|
@@ -169,8 +169,11 @@ function convertTypeAlias(context, symbol, exportSymbol) {
|
|
|
169
169
|
if (ts.isTypeAliasDeclaration(declaration)) {
|
|
170
170
|
const reflection = context.createDeclarationReflection(models_1.ReflectionKind.TypeAlias, symbol, exportSymbol);
|
|
171
171
|
reflection.type = context.converter.convertType(context.withScope(reflection), declaration.type);
|
|
172
|
-
reflection.typeParameters = (_b = declaration.typeParameters) === null || _b === void 0 ? void 0 : _b.map((param) => createTypeParamReflection(param, context.withScope(reflection)));
|
|
173
172
|
context.finalizeDeclarationReflection(reflection, symbol, exportSymbol);
|
|
173
|
+
// Do this after finalization so that the CommentPlugin can get @typeParam tags
|
|
174
|
+
// from the parent comment. Ugly, but works for now. Should be cleaned up with TSDoc
|
|
175
|
+
// support.
|
|
176
|
+
reflection.typeParameters = (_b = declaration.typeParameters) === null || _b === void 0 ? void 0 : _b.map((param) => createTypeParamReflection(param, context.withScope(reflection)));
|
|
174
177
|
}
|
|
175
178
|
else if (ts.isJSDocTypedefTag(declaration) ||
|
|
176
179
|
ts.isJSDocEnumTag(declaration)) {
|
|
@@ -433,7 +436,7 @@ function convertVariable(context, symbol, exportSymbol) {
|
|
|
433
436
|
const declaration = (_a = symbol.getDeclarations()) === null || _a === void 0 ? void 0 : _a[0];
|
|
434
437
|
assert(declaration);
|
|
435
438
|
const type = context.checker.getTypeOfSymbolAtLocation(symbol, declaration);
|
|
436
|
-
if (
|
|
439
|
+
if (isEnumLike(context.checker, type, declaration) &&
|
|
437
440
|
symbol.getJsDocTags().some((tag) => tag.name === "enum")) {
|
|
438
441
|
return convertVariableAsEnum(context, symbol, exportSymbol);
|
|
439
442
|
}
|
|
@@ -451,33 +454,27 @@ function convertVariable(context, symbol, exportSymbol) {
|
|
|
451
454
|
reflection.defaultValue = (0, convert_expression_1.convertDefaultValue)(declaration);
|
|
452
455
|
context.finalizeDeclarationReflection(reflection, symbol, exportSymbol);
|
|
453
456
|
}
|
|
454
|
-
function
|
|
455
|
-
if (!(0, enum_1.hasAllFlags)(
|
|
456
|
-
!declaration.initializer ||
|
|
457
|
-
!ts.isAsExpression(declaration.initializer) ||
|
|
458
|
-
declaration.initializer.type.getText() !== "const") {
|
|
459
|
-
// Not an as-const expression
|
|
457
|
+
function isEnumLike(checker, type, location) {
|
|
458
|
+
if (!(0, enum_1.hasAllFlags)(type.flags, ts.TypeFlags.Object)) {
|
|
460
459
|
return false;
|
|
461
460
|
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
return
|
|
465
|
-
}
|
|
466
|
-
return body.properties.every((prop) => ts.isPropertyAssignment(prop) &&
|
|
467
|
-
ts.isStringLiteral(prop.initializer));
|
|
461
|
+
return type.getProperties().every((prop) => {
|
|
462
|
+
const propType = checker.getTypeOfSymbolAtLocation(prop, location);
|
|
463
|
+
return propType.isStringLiteral();
|
|
464
|
+
});
|
|
468
465
|
}
|
|
469
466
|
function convertVariableAsEnum(context, symbol, exportSymbol) {
|
|
470
467
|
const reflection = context.createDeclarationReflection(models_1.ReflectionKind.Enum, symbol, exportSymbol);
|
|
471
468
|
context.finalizeDeclarationReflection(reflection, symbol, exportSymbol);
|
|
472
469
|
const rc = context.withScope(reflection);
|
|
473
470
|
const declaration = symbol.declarations[0];
|
|
474
|
-
const
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
const
|
|
478
|
-
|
|
479
|
-
reflection.defaultValue =
|
|
480
|
-
rc.finalizeDeclarationReflection(reflection,
|
|
471
|
+
const type = context.checker.getTypeAtLocation(declaration);
|
|
472
|
+
for (const prop of type.getProperties()) {
|
|
473
|
+
const reflection = rc.createDeclarationReflection(models_1.ReflectionKind.EnumMember, prop, void 0);
|
|
474
|
+
const propType = context.checker.getTypeOfSymbolAtLocation(prop, declaration);
|
|
475
|
+
assert(propType.isStringLiteral());
|
|
476
|
+
reflection.defaultValue = JSON.stringify(propType.value);
|
|
477
|
+
rc.finalizeDeclarationReflection(reflection, prop, void 0);
|
|
481
478
|
}
|
|
482
479
|
// Skip converting the type alias, if there is one
|
|
483
480
|
return ts.SymbolFlags.TypeAlias;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DeclarationReflection } from ".";
|
|
2
2
|
/**
|
|
3
3
|
* A category of reflections.
|
|
4
4
|
*
|
|
@@ -14,14 +14,7 @@ export declare class ReflectionCategory {
|
|
|
14
14
|
/**
|
|
15
15
|
* All reflections of this category.
|
|
16
16
|
*/
|
|
17
|
-
children:
|
|
18
|
-
/**
|
|
19
|
-
* Do all children of this category have a separate document?
|
|
20
|
-
*
|
|
21
|
-
* A bound representation of the ´ReflectionCategory.getAllChildrenHaveOwnDocument´
|
|
22
|
-
* that can be used within templates.
|
|
23
|
-
*/
|
|
24
|
-
allChildrenHaveOwnDocument: Function;
|
|
17
|
+
children: DeclarationReflection[];
|
|
25
18
|
/**
|
|
26
19
|
* Create a new ReflectionCategory instance.
|
|
27
20
|
*
|
|
@@ -31,5 +24,5 @@ export declare class ReflectionCategory {
|
|
|
31
24
|
/**
|
|
32
25
|
* Do all children of this category have a separate document?
|
|
33
26
|
*/
|
|
34
|
-
|
|
27
|
+
allChildrenHaveOwnDocument(): boolean;
|
|
35
28
|
}
|
|
@@ -20,17 +20,12 @@ class ReflectionCategory {
|
|
|
20
20
|
*/
|
|
21
21
|
this.children = [];
|
|
22
22
|
this.title = title;
|
|
23
|
-
this.allChildrenHaveOwnDocument = () => this.getAllChildrenHaveOwnDocument();
|
|
24
23
|
}
|
|
25
24
|
/**
|
|
26
25
|
* Do all children of this category have a separate document?
|
|
27
26
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this.children.forEach((child) => {
|
|
31
|
-
onlyOwnDocuments = onlyOwnDocuments && !!child.hasOwnDocument;
|
|
32
|
-
});
|
|
33
|
-
return onlyOwnDocuments;
|
|
27
|
+
allChildrenHaveOwnDocument() {
|
|
28
|
+
return this.children.every((child) => child.hasOwnDocument);
|
|
34
29
|
}
|
|
35
30
|
}
|
|
36
31
|
exports.ReflectionCategory = ReflectionCategory;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReflectionKind } from "./reflections/abstract";
|
|
2
2
|
import type { ReflectionCategory } from "./ReflectionCategory";
|
|
3
|
+
import type { DeclarationReflection } from ".";
|
|
3
4
|
/**
|
|
4
5
|
* A group of reflections. All reflections in a group are of the same kind.
|
|
5
6
|
*
|
|
@@ -19,19 +20,12 @@ export declare class ReflectionGroup {
|
|
|
19
20
|
/**
|
|
20
21
|
* All reflections of this group.
|
|
21
22
|
*/
|
|
22
|
-
children:
|
|
23
|
+
children: DeclarationReflection[];
|
|
23
24
|
/**
|
|
24
25
|
* A list of generated css classes that should be applied to representations of this
|
|
25
26
|
* group in the generated markup.
|
|
26
27
|
*/
|
|
27
28
|
cssClasses?: string;
|
|
28
|
-
/**
|
|
29
|
-
* Do all children of this group have a separate document?
|
|
30
|
-
*
|
|
31
|
-
* A bound representation of the ´ReflectionGroup.getAllChildrenHaveOwnDocument´
|
|
32
|
-
* that can be used within templates.
|
|
33
|
-
*/
|
|
34
|
-
allChildrenHaveOwnDocument: () => boolean;
|
|
35
29
|
/**
|
|
36
30
|
* Are all children inherited members?
|
|
37
31
|
*/
|
|
@@ -62,5 +56,5 @@ export declare class ReflectionGroup {
|
|
|
62
56
|
/**
|
|
63
57
|
* Do all children of this group have a separate document?
|
|
64
58
|
*/
|
|
65
|
-
|
|
59
|
+
allChildrenHaveOwnDocument(): boolean;
|
|
66
60
|
}
|
|
@@ -20,20 +20,13 @@ class ReflectionGroup {
|
|
|
20
20
|
* All reflections of this group.
|
|
21
21
|
*/
|
|
22
22
|
this.children = [];
|
|
23
|
-
/**
|
|
24
|
-
* Do all children of this group have a separate document?
|
|
25
|
-
*
|
|
26
|
-
* A bound representation of the ´ReflectionGroup.getAllChildrenHaveOwnDocument´
|
|
27
|
-
* that can be used within templates.
|
|
28
|
-
*/
|
|
29
|
-
this.allChildrenHaveOwnDocument = () => this.getAllChildrenHaveOwnDocument();
|
|
30
23
|
this.title = title;
|
|
31
24
|
this.kind = kind;
|
|
32
25
|
}
|
|
33
26
|
/**
|
|
34
27
|
* Do all children of this group have a separate document?
|
|
35
28
|
*/
|
|
36
|
-
|
|
29
|
+
allChildrenHaveOwnDocument() {
|
|
37
30
|
return this.children.every((child) => child.hasOwnDocument);
|
|
38
31
|
}
|
|
39
32
|
}
|
|
@@ -51,7 +51,7 @@ export declare class Comment {
|
|
|
51
51
|
*/
|
|
52
52
|
getTag(tagName: string, paramName?: string): CommentTag | undefined;
|
|
53
53
|
/**
|
|
54
|
-
* Removes all tags with the given tag name from
|
|
54
|
+
* Removes all tags with the given tag name from the comment.
|
|
55
55
|
* @param tagName
|
|
56
56
|
*/
|
|
57
57
|
removeTags(tagName: string): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Reflection } from "../reflections/abstract";
|
|
2
1
|
import type { ReflectionGroup } from "../ReflectionGroup";
|
|
3
2
|
import type { SourceFile } from "./file";
|
|
3
|
+
import type { DeclarationReflection } from "..";
|
|
4
4
|
/**
|
|
5
5
|
* Exposes information about a directory containing source files.
|
|
6
6
|
*
|
|
@@ -56,5 +56,5 @@ export declare class SourceDirectory {
|
|
|
56
56
|
* @returns An aggregated list of all {@link DeclarationReflection} defined in the
|
|
57
57
|
* files of this directory.
|
|
58
58
|
*/
|
|
59
|
-
getAllReflections():
|
|
59
|
+
getAllReflections(): DeclarationReflection[];
|
|
60
60
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SourceDirectory = void 0;
|
|
4
|
+
const array_1 = require("../../utils/array");
|
|
4
5
|
/**
|
|
5
6
|
* Exposes information about a directory containing source files.
|
|
6
7
|
*
|
|
@@ -53,12 +54,7 @@ class SourceDirectory {
|
|
|
53
54
|
* files of this directory.
|
|
54
55
|
*/
|
|
55
56
|
getAllReflections() {
|
|
56
|
-
|
|
57
|
-
this.files.forEach((file) => {
|
|
58
|
-
reflections.push(...file.reflections);
|
|
59
|
-
});
|
|
60
|
-
// reflections.sort(Factories.GroupHandler.sortCallback);
|
|
61
|
-
return reflections;
|
|
57
|
+
return (0, array_1.flatMap)(this.files, (file) => file.reflections);
|
|
62
58
|
}
|
|
63
59
|
}
|
|
64
60
|
exports.SourceDirectory = SourceDirectory;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Reflection } from "../reflections/abstract";
|
|
2
1
|
import type { ReflectionGroup } from "../ReflectionGroup";
|
|
3
2
|
import type { SourceDirectory } from "./directory";
|
|
4
3
|
import type { RepositoryType } from "./repository";
|
|
4
|
+
import type { DeclarationReflection } from "..";
|
|
5
5
|
/**
|
|
6
6
|
* Represents references of reflections to their defining source files.
|
|
7
7
|
*
|
|
@@ -65,7 +65,7 @@ export declare class SourceFile {
|
|
|
65
65
|
/**
|
|
66
66
|
* A list of all reflections that are declared in this file.
|
|
67
67
|
*/
|
|
68
|
-
reflections:
|
|
68
|
+
reflections: DeclarationReflection[];
|
|
69
69
|
/**
|
|
70
70
|
* A grouped list of the reflections declared in this file.
|
|
71
71
|
*/
|
|
@@ -11,34 +11,34 @@ export declare class DefaultThemeRenderContext {
|
|
|
11
11
|
urlTo: (reflection: Reflection) => string | undefined;
|
|
12
12
|
markdown: (md: string | undefined) => string;
|
|
13
13
|
attemptExternalResolution: (symbol: ts.Symbol | undefined) => string | undefined;
|
|
14
|
-
reflectionTemplate: (props: import("../..").PageEvent<import("../../../models").ContainerReflection>) => import("../../../utils/jsx").
|
|
15
|
-
indexTemplate: (props: import("../..").PageEvent<import("../../../models").ProjectReflection>) => import("../../../utils/jsx").
|
|
16
|
-
defaultLayout: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx").
|
|
17
|
-
analytics: () => import("../../../utils/jsx").
|
|
18
|
-
breadcrumb: (props: Reflection) => import("../../../utils/jsx").
|
|
19
|
-
comment: (props: Reflection) => import("../../../utils/jsx").
|
|
20
|
-
footer: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx").
|
|
21
|
-
header: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx").
|
|
22
|
-
hierarchy: (props: import("../../../models").DeclarationHierarchy) => import("../../../utils/jsx").
|
|
23
|
-
index: (props: import("../../../models").ContainerReflection) => import("../../../utils/jsx").
|
|
24
|
-
member: (props: import("../../../models").DeclarationReflection) => import("../../../utils/jsx").
|
|
25
|
-
memberDeclaration: (props: import("../../../models").DeclarationReflection) => import("../../../utils/jsx").
|
|
26
|
-
memberGetterSetter: (props: import("../../../models").DeclarationReflection) => import("../../../utils/jsx").
|
|
27
|
-
memberReference: (props: import("../../../models").ReferenceReflection) => import("../../../utils/jsx").
|
|
14
|
+
reflectionTemplate: (props: import("../..").PageEvent<import("../../../models").ContainerReflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
15
|
+
indexTemplate: (props: import("../..").PageEvent<import("../../../models").ProjectReflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
16
|
+
defaultLayout: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
17
|
+
analytics: () => import("../../../utils/jsx.elements").JsxElement | undefined;
|
|
18
|
+
breadcrumb: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
|
|
19
|
+
comment: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
|
|
20
|
+
footer: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
21
|
+
header: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
22
|
+
hierarchy: (props: import("../../../models").DeclarationHierarchy) => import("../../../utils/jsx.elements").JsxElement;
|
|
23
|
+
index: (props: import("../../../models").ContainerReflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
|
|
24
|
+
member: (props: import("../../../models").DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
|
|
25
|
+
memberDeclaration: (props: import("../../../models").DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
|
|
26
|
+
memberGetterSetter: (props: import("../../../models").DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
|
|
27
|
+
memberReference: (props: import("../../../models").ReferenceReflection) => import("../../../utils/jsx.elements").JsxElement;
|
|
28
28
|
memberSignatureBody: (r_0: import("../../../models").SignatureReflection, r_1?: {
|
|
29
29
|
hideSources?: boolean | undefined;
|
|
30
|
-
} | undefined) => import("../../../utils/jsx").
|
|
30
|
+
} | undefined) => import("../../../utils/jsx.elements").JsxElement;
|
|
31
31
|
memberSignatureTitle: (r_0: import("../../../models").SignatureReflection, r_1?: {
|
|
32
32
|
hideName?: boolean | undefined;
|
|
33
33
|
arrowStyle?: boolean | undefined;
|
|
34
|
-
} | undefined) => import("../../../utils/jsx").
|
|
35
|
-
memberSignatures: (props: import("../../../models").DeclarationReflection) => import("../../../utils/jsx").
|
|
36
|
-
memberSources: (props: import("../../../models").DeclarationReflection | import("../../../models").SignatureReflection) => import("../../../utils/jsx").
|
|
37
|
-
members: (props: import("../../../models").ContainerReflection) => import("../../../utils/jsx").
|
|
38
|
-
membersGroup: (group: import("../../../models").ReflectionGroup) => import("../../../utils/jsx").
|
|
39
|
-
navigation: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx").
|
|
40
|
-
parameter: (props: import("../../../models").DeclarationReflection) => import("../../../utils/jsx").
|
|
41
|
-
type: (type: import("../../../models").Type | undefined) => import("../../../utils/jsx").
|
|
42
|
-
typeAndParent: (props: import("../../../models").Type) => import("../../../utils/jsx").
|
|
43
|
-
typeParameters: (typeParameters: import("../../../models").TypeParameterReflection[]) => import("../../../utils/jsx").
|
|
34
|
+
} | undefined) => import("../../../utils/jsx.elements").JsxElement;
|
|
35
|
+
memberSignatures: (props: import("../../../models").DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
|
|
36
|
+
memberSources: (props: import("../../../models").DeclarationReflection | import("../../../models").SignatureReflection) => import("../../../utils/jsx.elements").JsxElement;
|
|
37
|
+
members: (props: import("../../../models").ContainerReflection) => import("../../../utils/jsx.elements").JsxElement;
|
|
38
|
+
membersGroup: (group: import("../../../models").ReflectionGroup) => import("../../../utils/jsx.elements").JsxElement;
|
|
39
|
+
navigation: (props: import("../..").PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
|
|
40
|
+
parameter: (props: import("../../../models").DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
|
|
41
|
+
type: (type: import("../../../models").Type | undefined) => import("../../../utils/jsx.elements").JsxElement;
|
|
42
|
+
typeAndParent: (props: import("../../../models").Type) => import("../../../utils/jsx.elements").JsxElement;
|
|
43
|
+
typeParameters: (typeParameters: import("../../../models").TypeParameterReflection[]) => import("../../../utils/jsx.elements").JsxElement;
|
|
44
44
|
}
|
|
@@ -5,7 +5,7 @@ const utils_1 = require("../../../../utils");
|
|
|
5
5
|
const defaultLayout = (context, props) => (utils_1.JSX.createElement("html", { class: "default no-js" },
|
|
6
6
|
utils_1.JSX.createElement("head", null,
|
|
7
7
|
utils_1.JSX.createElement("meta", { charSet: "utf-8" }),
|
|
8
|
-
utils_1.JSX.createElement("meta", { "http-equiv": "
|
|
8
|
+
utils_1.JSX.createElement("meta", { "http-equiv": "x-ua-compatible", content: "IE=edge" }),
|
|
9
9
|
utils_1.JSX.createElement("title", null, props.model.name === props.project.name ? (props.project.name) : (utils_1.JSX.createElement(utils_1.JSX.Fragment, null,
|
|
10
10
|
props.model.name,
|
|
11
11
|
" | ",
|
|
@@ -17,6 +17,7 @@ const defaultLayout = (context, props) => (utils_1.JSX.createElement("html", { c
|
|
|
17
17
|
context.options.getValue("customCss") && (utils_1.JSX.createElement("link", { rel: "stylesheet", href: context.relativeURL("assets/custom.css") })),
|
|
18
18
|
utils_1.JSX.createElement("script", { async: true, src: context.relativeURL("assets/search.js"), id: "search-script" })),
|
|
19
19
|
utils_1.JSX.createElement("body", null,
|
|
20
|
+
utils_1.JSX.createElement("script", null, "document.body.classList.add(localStorage.getItem(\"tsd-theme\") || \"os\")"),
|
|
20
21
|
context.header(props),
|
|
21
22
|
utils_1.JSX.createElement("div", { class: "container container-main" },
|
|
22
23
|
utils_1.JSX.createElement("div", { class: "row" },
|
|
@@ -7,7 +7,7 @@ const models_1 = require("../../../../models");
|
|
|
7
7
|
const member = (context, props) => {
|
|
8
8
|
var _a;
|
|
9
9
|
return (utils_1.JSX.createElement("section", { class: "tsd-panel tsd-member " + props.cssClasses },
|
|
10
|
-
utils_1.JSX.createElement("a", {
|
|
10
|
+
utils_1.JSX.createElement("a", { id: props.anchor, class: "tsd-anchor" }),
|
|
11
11
|
!!props.name && (utils_1.JSX.createElement("h3", null,
|
|
12
12
|
(0, lib_1.renderFlags)(props.flags),
|
|
13
13
|
(0, lib_1.wbr)(props.name))),
|
|
@@ -18,6 +18,6 @@ const member = (context, props) => {
|
|
|
18
18
|
: props instanceof models_1.ReferenceReflection
|
|
19
19
|
? context.memberReference(props)
|
|
20
20
|
: context.memberDeclaration(props), (_a = props.groups) === null || _a === void 0 ? void 0 :
|
|
21
|
-
_a.map((item) => item.children.map((item) => !item.hasOwnDocument && context.member(
|
|
21
|
+
_a.map((item) => item.children.map((item) => !item.hasOwnDocument && context.member(item)))));
|
|
22
22
|
};
|
|
23
23
|
exports.member = member;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.membersGroup = void 0;
|
|
4
|
-
const lib_1 = require("../../lib");
|
|
5
4
|
const utils_1 = require("../../../../utils");
|
|
6
5
|
function membersGroup(context, group) {
|
|
7
6
|
if (group.categories) {
|
|
@@ -11,10 +10,10 @@ function membersGroup(context, group) {
|
|
|
11
10
|
item.title,
|
|
12
11
|
" "),
|
|
13
12
|
group.title),
|
|
14
|
-
item.children.map((item) => !item.hasOwnDocument && context.member(
|
|
13
|
+
item.children.map((item) => !item.hasOwnDocument && context.member(item)))))));
|
|
15
14
|
}
|
|
16
15
|
return (utils_1.JSX.createElement("section", { class: "tsd-panel-group tsd-member-group " + group.cssClasses },
|
|
17
16
|
utils_1.JSX.createElement("h2", null, group.title),
|
|
18
|
-
group.children.map((item) => !item.hasOwnDocument && context.member(
|
|
17
|
+
group.children.map((item) => !item.hasOwnDocument && context.member(item))));
|
|
19
18
|
}
|
|
20
19
|
exports.membersGroup = membersGroup;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.members = void 0;
|
|
4
|
-
const lib_1 = require("../../lib");
|
|
5
4
|
const utils_1 = require("../../../../utils");
|
|
6
5
|
function members(context, props) {
|
|
7
6
|
var _a;
|
|
8
7
|
if (props.categories && props.categories.length) {
|
|
9
8
|
return (utils_1.JSX.createElement(utils_1.JSX.Fragment, null, props.categories.map((item) => !item.allChildrenHaveOwnDocument() && (utils_1.JSX.createElement("section", { class: "tsd-panel-group tsd-member-group " + props.cssClasses },
|
|
10
9
|
utils_1.JSX.createElement("h2", null, item.title),
|
|
11
|
-
item.children.map((item) => !item.hasOwnDocument && context.member(
|
|
10
|
+
item.children.map((item) => !item.hasOwnDocument && context.member(item)))))));
|
|
12
11
|
}
|
|
13
12
|
return utils_1.JSX.createElement(utils_1.JSX.Fragment, null, (_a = props.groups) === null || _a === void 0 ? void 0 : _a.map((item) => !item.allChildrenHaveOwnDocument() && context.membersGroup(item)));
|
|
14
13
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Reflection, ReflectionFlags, TypeParameterReflection } from "../../models";
|
|
2
2
|
import { JSX } from "../../utils";
|
|
3
3
|
export declare function stringify(data: unknown): string;
|
|
4
4
|
/**
|
|
@@ -13,7 +13,6 @@ export declare function wbr(str: string): (string | JSX.Element)[];
|
|
|
13
13
|
export declare function join<T>(joiner: JSX.Children, list: readonly T[], cb: (x: T) => JSX.Children): JSX.Element;
|
|
14
14
|
export declare function renderFlags(flags: ReflectionFlags): JSX.Element;
|
|
15
15
|
export declare function classNames(names: Record<string, boolean | null | undefined>): string;
|
|
16
|
-
export declare function assertIsDeclarationReflection(reflection: Reflection): DeclarationReflection;
|
|
17
16
|
export declare function hasTypeParameters(reflection: Reflection): reflection is Reflection & {
|
|
18
17
|
typeParameters: TypeParameterReflection[];
|
|
19
18
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hasTypeParameters = exports.
|
|
4
|
-
const assert_1 = require("assert");
|
|
3
|
+
exports.hasTypeParameters = exports.classNames = exports.renderFlags = exports.join = exports.wbr = exports.stringify = void 0;
|
|
5
4
|
const models_1 = require("../../models");
|
|
6
5
|
const utils_1 = require("../../utils");
|
|
7
6
|
function stringify(data) {
|
|
@@ -58,11 +57,6 @@ function classNames(names) {
|
|
|
58
57
|
.join(" ");
|
|
59
58
|
}
|
|
60
59
|
exports.classNames = classNames;
|
|
61
|
-
function assertIsDeclarationReflection(reflection) {
|
|
62
|
-
(0, assert_1.ok)(reflection instanceof models_1.DeclarationReflection);
|
|
63
|
-
return reflection;
|
|
64
|
-
}
|
|
65
|
-
exports.assertIsDeclarationReflection = assertIsDeclarationReflection;
|
|
66
60
|
function hasTypeParameters(reflection) {
|
|
67
61
|
if (reflection instanceof models_1.DeclarationReflection || reflection instanceof models_1.SignatureReflection) {
|
|
68
62
|
return reflection.typeParameters != null;
|
|
@@ -29,4 +29,5 @@ export interface DocumentationEntryPoint {
|
|
|
29
29
|
sourceFile: ts.SourceFile;
|
|
30
30
|
}
|
|
31
31
|
export declare function getEntryPoints(logger: Logger, options: Options): DocumentationEntryPoint[] | undefined;
|
|
32
|
+
export declare function getWatchEntryPoints(logger: Logger, options: Options, program: ts.Program): DocumentationEntryPoint[] | undefined;
|
|
32
33
|
export declare function getExpandedEntryPointsForPaths(logger: Logger, inputFiles: string[], options: Options, programs?: ts.Program[]): DocumentationEntryPoint[] | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getExpandedEntryPointsForPaths = exports.getEntryPoints = exports.EntryPointStrategy = void 0;
|
|
3
|
+
exports.getExpandedEntryPointsForPaths = exports.getWatchEntryPoints = exports.getEntryPoints = exports.EntryPointStrategy = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
5
|
const ts = require("typescript");
|
|
6
6
|
const FS = require("fs");
|
|
@@ -49,6 +49,29 @@ function getEntryPoints(logger, options) {
|
|
|
49
49
|
return result;
|
|
50
50
|
}
|
|
51
51
|
exports.getEntryPoints = getEntryPoints;
|
|
52
|
+
function getWatchEntryPoints(logger, options, program) {
|
|
53
|
+
let result;
|
|
54
|
+
const entryPoints = options.getValue("entryPoints");
|
|
55
|
+
switch (options.getValue("entryPointStrategy")) {
|
|
56
|
+
case exports.EntryPointStrategy.Resolve:
|
|
57
|
+
result = getEntryPointsForPaths(logger, entryPoints, options, [
|
|
58
|
+
program,
|
|
59
|
+
]);
|
|
60
|
+
break;
|
|
61
|
+
case exports.EntryPointStrategy.Expand:
|
|
62
|
+
result = getExpandedEntryPointsForPaths(logger, entryPoints, options, [program]);
|
|
63
|
+
break;
|
|
64
|
+
case exports.EntryPointStrategy.Packages:
|
|
65
|
+
logger.error("Watch mode does not support 'packages' style entry points.");
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
if (result && result.length === 0) {
|
|
69
|
+
logger.error("Unable to find any entry points.");
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
exports.getWatchEntryPoints = getWatchEntryPoints;
|
|
52
75
|
function getModuleName(fileName, baseDir) {
|
|
53
76
|
return (0, fs_1.normalizePath)((0, path_1.relative)(baseDir, fileName)).replace(/(\/index)?(\.d)?\.[tj]sx?$/, "");
|
|
54
77
|
}
|