typedoc 0.28.1 → 0.28.3
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.d.ts +2 -2
- package/dist/lib/application.js +6 -4
- package/dist/lib/cli.js +1 -1
- package/dist/lib/converter/comments/index.js +6 -1
- package/dist/lib/converter/context.js +2 -2
- package/dist/lib/converter/converter.d.ts +3 -3
- package/dist/lib/converter/converter.js +13 -6
- package/dist/lib/converter/factories/signature.d.ts +1 -0
- package/dist/lib/converter/factories/signature.js +28 -5
- package/dist/lib/converter/plugins/CategoryPlugin.js +1 -1
- package/dist/lib/converter/plugins/GroupPlugin.js +3 -0
- package/dist/lib/converter/plugins/IncludePlugin.js +2 -0
- package/dist/lib/converter/symbols.js +6 -2
- package/dist/lib/converter/types.js +28 -10
- package/dist/lib/internationalization/locales/en.cjs +1 -1
- package/dist/lib/internationalization/locales/en.d.cts +1 -1
- package/dist/lib/internationalization/locales/ja.cjs +0 -1
- package/dist/lib/internationalization/locales/zh.cjs +6 -1
- package/dist/lib/internationalization/locales/zh.d.cts +6 -1
- package/dist/lib/models/types.js +264 -216
- package/dist/lib/output/renderer.d.ts +5 -1
- package/dist/lib/output/renderer.js +9 -1
- package/dist/lib/output/router.js +17 -5
- package/dist/lib/output/themes/MarkedPlugin.js +6 -1
- package/dist/lib/output/themes/default/partials/index.js +5 -13
- package/dist/lib/output/themes/default/partials/members.js +9 -6
- package/dist/lib/output/themes/default/partials/moduleReflection.js +15 -8
- package/dist/lib/output/themes/default/partials/navigation.js +13 -5
- package/dist/lib/output/themes/lib.d.ts +3 -2
- package/dist/lib/output/themes/lib.js +22 -15
- package/dist/lib/serialization/deserializer.d.ts +1 -1
- package/dist/lib/serialization/deserializer.js +1 -1
- package/dist/lib/serialization/serializer.d.ts +1 -1
- package/dist/lib/serialization/serializer.js +1 -1
- package/dist/lib/utils/entry-point.js +5 -6
- package/dist/lib/utils/highlighter.js +3 -2
- package/dist/lib/utils/options/declaration.js +11 -1
- package/dist/lib/utils/options/defaults.js +2 -0
- package/dist/lib/utils/options/options.d.ts +1 -1
- package/dist/lib/utils/options/options.js +1 -1
- package/dist/lib/utils/options/readers/arguments.d.ts +2 -0
- package/dist/lib/utils/options/readers/arguments.js +17 -4
- package/dist/lib/utils/options/tsdoc-defaults.d.ts +1 -1
- package/dist/lib/utils/options/tsdoc-defaults.js +1 -0
- package/dist/lib/utils-common/array.d.ts +1 -0
- package/dist/lib/utils-common/array.js +1 -0
- package/dist/lib/utils-common/events.d.ts +1 -0
- package/dist/lib/utils-common/events.js +1 -0
- package/package.json +10 -10
- package/static/style.css +4 -4
- package/tsdoc.json +5 -0
|
@@ -34,7 +34,7 @@ export interface ApplicationEvents {
|
|
|
34
34
|
* Access to an Application instance can be retrieved with {@link Application.bootstrap} or
|
|
35
35
|
* {@link Application.bootstrapWithPlugins}. It can not be constructed manually.
|
|
36
36
|
*
|
|
37
|
-
* @group
|
|
37
|
+
* @group None
|
|
38
38
|
* @summary Root level class which contains most useful behavior.
|
|
39
39
|
*/
|
|
40
40
|
export declare class Application extends AbstractComponent<Application, ApplicationEvents> {
|
|
@@ -109,7 +109,7 @@ export declare class Application extends AbstractComponent<Application, Applicat
|
|
|
109
109
|
* @example
|
|
110
110
|
* Initialize the application with pretty-printing output disabled.
|
|
111
111
|
* ```ts
|
|
112
|
-
* const app = Application.bootstrap({ pretty: false });
|
|
112
|
+
* const app = await Application.bootstrap({ pretty: false });
|
|
113
113
|
* ```
|
|
114
114
|
*
|
|
115
115
|
* @param options Options to set during initialization
|
package/dist/lib/application.js
CHANGED
|
@@ -95,7 +95,7 @@ const DEFAULT_READERS = [
|
|
|
95
95
|
* Access to an Application instance can be retrieved with {@link Application.bootstrap} or
|
|
96
96
|
* {@link Application.bootstrapWithPlugins}. It can not be constructed manually.
|
|
97
97
|
*
|
|
98
|
-
* @group
|
|
98
|
+
* @group None
|
|
99
99
|
* @summary Root level class which contains most useful behavior.
|
|
100
100
|
*/
|
|
101
101
|
let Application = (() => {
|
|
@@ -236,7 +236,7 @@ let Application = (() => {
|
|
|
236
236
|
* @example
|
|
237
237
|
* Initialize the application with pretty-printing output disabled.
|
|
238
238
|
* ```ts
|
|
239
|
-
* const app = Application.bootstrap({ pretty: false });
|
|
239
|
+
* const app = await Application.bootstrap({ pretty: false });
|
|
240
240
|
* ```
|
|
241
241
|
*
|
|
242
242
|
* @param options Options to set during initialization
|
|
@@ -673,10 +673,12 @@ let Application = (() => {
|
|
|
673
673
|
const entryPoints = this.entryPoints.flatMap((entry) => {
|
|
674
674
|
const result = glob(entry, rootDir);
|
|
675
675
|
if (result.length === 0) {
|
|
676
|
-
|
|
676
|
+
// #2918 - do not pass entry through nicePath here in case it contains
|
|
677
|
+
// windows path separators which should cause additional warnings.
|
|
678
|
+
this.logger.warn(i18n.entrypoint_did_not_match_files_0(entry));
|
|
677
679
|
}
|
|
678
680
|
else if (result.length !== 1) {
|
|
679
|
-
this.logger.verbose(`Expanded ${
|
|
681
|
+
this.logger.verbose(`Expanded ${entry} to:\n\t${result
|
|
680
682
|
.map(nicePath)
|
|
681
683
|
.join("\n\t")}`);
|
|
682
684
|
}
|
package/dist/lib/cli.js
CHANGED
|
@@ -20,7 +20,7 @@ async function main() {
|
|
|
20
20
|
new td.TypeDocReader(),
|
|
21
21
|
new td.PackageJsonReader(),
|
|
22
22
|
new td.TSConfigReader(),
|
|
23
|
-
new td.ArgumentsReader(300),
|
|
23
|
+
new td.ArgumentsReader(300).ignoreErrors(),
|
|
24
24
|
]);
|
|
25
25
|
const exitCode = await run(app);
|
|
26
26
|
if (exitCode !== ExitCodes.Watching) {
|
|
@@ -172,7 +172,12 @@ export function getJsDocComment(declaration, config, logger, checker, files) {
|
|
|
172
172
|
}
|
|
173
173
|
const tag = comment.getIdentifiedTag(name, `@${declaration.tagName.text}`);
|
|
174
174
|
if (!tag) {
|
|
175
|
-
|
|
175
|
+
// If this is a template tag with multiple declarations, we warned already if there
|
|
176
|
+
// was a comment attached. If there wasn't, then don't error about failing to find
|
|
177
|
+
// a tag because this is unsupported.
|
|
178
|
+
if (!ts.isJSDocTemplateTag(declaration)) {
|
|
179
|
+
logger.error(i18n.failed_to_find_jsdoc_tag_for_name_0(name), declaration);
|
|
180
|
+
}
|
|
176
181
|
}
|
|
177
182
|
else {
|
|
178
183
|
const result = new Comment(Comment.cloneDisplayParts(tag.content));
|
|
@@ -145,7 +145,7 @@ export class Context {
|
|
|
145
145
|
reflection.escapedName = symbol?.escapedName ? String(symbol.escapedName) : undefined;
|
|
146
146
|
this.addChild(reflection);
|
|
147
147
|
}
|
|
148
|
-
if (symbol && this.converter.isExternal(symbol)) {
|
|
148
|
+
if (symbol && this.converter.isExternal(symbol, this.checker)) {
|
|
149
149
|
reflection.setFlag(ReflectionFlag.External);
|
|
150
150
|
}
|
|
151
151
|
if (exportSymbol) {
|
|
@@ -188,7 +188,7 @@ export class Context {
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
shouldIgnore(symbol) {
|
|
191
|
-
return this.converter.shouldIgnore(symbol);
|
|
191
|
+
return this.converter.shouldIgnore(symbol, this.checker);
|
|
192
192
|
}
|
|
193
193
|
/**
|
|
194
194
|
* Register a newly generated reflection. All created reflections should be
|
|
@@ -36,7 +36,7 @@ export interface ConverterEvents {
|
|
|
36
36
|
/**
|
|
37
37
|
* Compiles source files using TypeScript and converts compiler symbols to reflections.
|
|
38
38
|
*
|
|
39
|
-
* @group
|
|
39
|
+
* @group None
|
|
40
40
|
* @summary Responsible for converting TypeScript symbols into {@link Reflection}s and {@link Type}s.
|
|
41
41
|
*/
|
|
42
42
|
export declare class Converter extends AbstractComponent<Application, ConverterEvents> {
|
|
@@ -226,10 +226,10 @@ export declare class Converter extends AbstractComponent<Application, ConverterE
|
|
|
226
226
|
* information at this point since comment discovery hasn't happened.
|
|
227
227
|
* @internal
|
|
228
228
|
*/
|
|
229
|
-
shouldIgnore(symbol: ts.Symbol): boolean;
|
|
229
|
+
shouldIgnore(symbol: ts.Symbol, checker: ts.TypeChecker): boolean;
|
|
230
230
|
private isExcluded;
|
|
231
231
|
/** @internal */
|
|
232
|
-
isExternal(symbol: ts.Symbol): boolean;
|
|
232
|
+
isExternal(symbol: ts.Symbol, checker: ts.TypeChecker): boolean;
|
|
233
233
|
processDocumentTags(reflection: Reflection, parent: ContainerReflection): void;
|
|
234
234
|
private addDocument;
|
|
235
235
|
private _buildCommentParserConfig;
|
|
@@ -59,10 +59,11 @@ import { SourcePlugin } from "./plugins/SourcePlugin.js";
|
|
|
59
59
|
import { TypePlugin } from "./plugins/TypePlugin.js";
|
|
60
60
|
import { IncludePlugin } from "./plugins/IncludePlugin.js";
|
|
61
61
|
import { MergeModuleWithPlugin } from "./plugins/MergeModuleWithPlugin.js";
|
|
62
|
+
import { resolveAliasedSymbol } from "./utils/symbols.js";
|
|
62
63
|
/**
|
|
63
64
|
* Compiles source files using TypeScript and converts compiler symbols to reflections.
|
|
64
65
|
*
|
|
65
|
-
* @group
|
|
66
|
+
* @group None
|
|
66
67
|
* @summary Responsible for converting TypeScript symbols into {@link Reflection}s and {@link Type}s.
|
|
67
68
|
*/
|
|
68
69
|
let Converter = (() => {
|
|
@@ -310,7 +311,12 @@ let Converter = (() => {
|
|
|
310
311
|
this.compile(entryPoints, context);
|
|
311
312
|
this.resolve(context);
|
|
312
313
|
this.trigger(Converter.EVENT_END, context);
|
|
313
|
-
|
|
314
|
+
// Delete caches of options so that test usage which changes options
|
|
315
|
+
// doesn't have confusing behavior where tests run in isolation work
|
|
316
|
+
// but break when run as a batch.
|
|
317
|
+
delete this._config;
|
|
318
|
+
delete this.excludeCache;
|
|
319
|
+
delete this.externalPatternCache;
|
|
314
320
|
return project;
|
|
315
321
|
}
|
|
316
322
|
/** @internal */
|
|
@@ -487,11 +493,12 @@ let Converter = (() => {
|
|
|
487
493
|
* information at this point since comment discovery hasn't happened.
|
|
488
494
|
* @internal
|
|
489
495
|
*/
|
|
490
|
-
shouldIgnore(symbol) {
|
|
496
|
+
shouldIgnore(symbol, checker) {
|
|
497
|
+
symbol = resolveAliasedSymbol(symbol, checker);
|
|
491
498
|
if (this.isExcluded(symbol)) {
|
|
492
499
|
return true;
|
|
493
500
|
}
|
|
494
|
-
return this.excludeExternals && this.isExternal(symbol);
|
|
501
|
+
return this.excludeExternals && this.isExternal(symbol, checker);
|
|
495
502
|
}
|
|
496
503
|
isExcluded(symbol) {
|
|
497
504
|
this.excludeCache ??= new MinimatchSet(this.application.options.getValue("exclude"));
|
|
@@ -499,10 +506,10 @@ let Converter = (() => {
|
|
|
499
506
|
return (symbol.getDeclarations() ?? []).some((node) => cache.matchesAny(node.getSourceFile().fileName));
|
|
500
507
|
}
|
|
501
508
|
/** @internal */
|
|
502
|
-
isExternal(symbol) {
|
|
509
|
+
isExternal(symbol, checker) {
|
|
503
510
|
this.externalPatternCache ??= new MinimatchSet(this.externalPattern);
|
|
504
511
|
const cache = this.externalPatternCache;
|
|
505
|
-
const declarations = symbol.getDeclarations();
|
|
512
|
+
const declarations = resolveAliasedSymbol(symbol, checker).getDeclarations();
|
|
506
513
|
// `undefined` has no declarations, if someone does `export default undefined`
|
|
507
514
|
// the symbol ends up as having no declarations (the export symbol does, but
|
|
508
515
|
// not the source symbol)
|
|
@@ -7,6 +7,7 @@ export declare function createSignature(context: Context, kind: ReflectionKind.C
|
|
|
7
7
|
*/
|
|
8
8
|
export declare function createConstructSignatureWithType(context: Context, signature: ts.Signature, classType: Reflection): void;
|
|
9
9
|
export declare function convertParameterNodes(context: Context, sigRef: SignatureReflection, parameters: readonly (ts.JSDocParameterTag | ts.ParameterDeclaration)[]): ParameterReflection[];
|
|
10
|
+
export declare function convertTypeParameters(context: Context, parent: Reflection, parameters: readonly ts.TypeParameter[] | undefined): TypeParameterReflection[] | undefined;
|
|
10
11
|
export declare function convertTypeParameterNodes(context: Context, parameters: readonly ts.TypeParameterDeclaration[] | undefined): TypeParameterReflection[] | undefined;
|
|
11
12
|
export declare function createTypeParamReflection(param: ts.TypeParameterDeclaration, context: Context): TypeParameterReflection;
|
|
12
13
|
export declare function convertTemplateParameterNodes(context: Context, nodes: readonly ts.JSDocTemplateTag[] | undefined): TypeParameterReflection[] | undefined;
|
|
@@ -82,8 +82,22 @@ export function createConstructSignatureWithType(context, signature, classType)
|
|
|
82
82
|
const sigRefCtx = context.withScope(sigRef);
|
|
83
83
|
if (declaration) {
|
|
84
84
|
sigRef.comment = context.getSignatureComment(declaration);
|
|
85
|
+
if (sigRef.comment?.discoveryId === context.scope.parent?.comment?.discoveryId) {
|
|
86
|
+
delete sigRef.comment;
|
|
87
|
+
}
|
|
85
88
|
}
|
|
86
|
-
|
|
89
|
+
const parameterSymbols = signature.thisParameter
|
|
90
|
+
? [signature.thisParameter, ...signature.parameters]
|
|
91
|
+
: [...signature.parameters];
|
|
92
|
+
// Prevent a `this` parameter from appearing on constructor signature
|
|
93
|
+
// as TS disallows them on regular classes.
|
|
94
|
+
if (parameterSymbols[0]?.name === "this") {
|
|
95
|
+
parameterSymbols.shift();
|
|
96
|
+
}
|
|
97
|
+
sigRef.parameters = convertParameters(sigRefCtx, sigRef, parameterSymbols, declaration?.parameters);
|
|
98
|
+
sigRef.parameters = convertParameters(sigRefCtx, sigRef, parameterSymbols, undefined);
|
|
99
|
+
// Do NOT convert type parameters here, they go on the class itself in the @class case
|
|
100
|
+
// See #2914.
|
|
87
101
|
sigRef.type = ReferenceType.createResolvedReference(context.scope.parent.name, classType, context.project);
|
|
88
102
|
context.registerReflection(sigRef, undefined);
|
|
89
103
|
context.scope.signatures ??= [];
|
|
@@ -203,7 +217,7 @@ function checkForDestructuredParameterDefaults(param, decl) {
|
|
|
203
217
|
}
|
|
204
218
|
}
|
|
205
219
|
}
|
|
206
|
-
function convertTypeParameters(context, parent, parameters) {
|
|
220
|
+
export function convertTypeParameters(context, parent, parameters) {
|
|
207
221
|
return parameters?.map((param) => {
|
|
208
222
|
const constraintT = param.getConstraint();
|
|
209
223
|
const defaultT = param.getDefault();
|
|
@@ -236,9 +250,18 @@ export function convertTypeParameterNodes(context, parameters) {
|
|
|
236
250
|
export function createTypeParamReflection(param, context) {
|
|
237
251
|
const paramRefl = new TypeParameterReflection(param.name.text, context.scope, getVariance(param.modifiers));
|
|
238
252
|
const paramScope = context.withScope(paramRefl);
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
253
|
+
if (ts.isJSDocTemplateTag(param.parent)) {
|
|
254
|
+
// With a @template tag, the constraint applies only to the
|
|
255
|
+
// first type parameter declared.
|
|
256
|
+
if (param.parent.typeParameters[0].name.text === param.name.text && param.parent.constraint) {
|
|
257
|
+
paramRefl.type = context.converter.convertType(paramScope, param.parent.constraint);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
paramRefl.type = param.constraint
|
|
262
|
+
? context.converter.convertType(paramScope, param.constraint)
|
|
263
|
+
: void 0;
|
|
264
|
+
}
|
|
242
265
|
paramRefl.default = param.default
|
|
243
266
|
? context.converter.convertType(paramScope, param.default)
|
|
244
267
|
: void 0;
|
|
@@ -150,6 +150,9 @@ let GroupPlugin = (() => {
|
|
|
150
150
|
this.sortFunction(reflection.documents);
|
|
151
151
|
this.sortFunction(reflection.childrenIncludingDocuments);
|
|
152
152
|
}
|
|
153
|
+
if (reflection.comment?.hasModifier("@disableGroups")) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
153
156
|
reflection.groups = this.getReflectionGroups(reflection, reflection.childrenIncludingDocuments);
|
|
154
157
|
}
|
|
155
158
|
}
|
|
@@ -246,3 +246,5 @@ regionTagREsByExt["php"] = regionTagREsByExt["cs"];
|
|
|
246
246
|
regionTagREsByExt["ps1"] = regionTagREsByExt["cs"];
|
|
247
247
|
regionTagREsByExt["py"] = regionTagREsByExt["cs"];
|
|
248
248
|
regionTagREsByExt["js"] = regionTagREsByExt["ts"];
|
|
249
|
+
regionTagREsByExt["mts"] = regionTagREsByExt["ts"];
|
|
250
|
+
regionTagREsByExt["cts"] = regionTagREsByExt["ts"];
|
|
@@ -4,10 +4,11 @@ import { DeclarationReflection, IntrinsicType, LiteralType, ReferenceReflection,
|
|
|
4
4
|
import { getEnumFlags, hasAllFlags, hasAnyFlag, i18n, removeFlag } from "#utils";
|
|
5
5
|
import { convertDefaultValue } from "./convert-expression.js";
|
|
6
6
|
import { convertIndexSignatures } from "./factories/index-signature.js";
|
|
7
|
-
import { createConstructSignatureWithType, createSignature, createTypeParamReflection } from "./factories/signature.js";
|
|
7
|
+
import { convertTypeParameters, createConstructSignatureWithType, createSignature, createTypeParamReflection, } from "./factories/signature.js";
|
|
8
8
|
import { convertJsDocAlias, convertJsDocCallback } from "./jsdoc.js";
|
|
9
9
|
import { getHeritageTypes } from "./utils/nodes.js";
|
|
10
10
|
import { removeUndefined } from "./utils/reflections.js";
|
|
11
|
+
import { resolveAliasedSymbol } from "./utils/symbols.js";
|
|
11
12
|
const symbolConverters = {
|
|
12
13
|
[ts.SymbolFlags.RegularEnum]: convertEnum,
|
|
13
14
|
[ts.SymbolFlags.ConstEnum]: convertEnum,
|
|
@@ -61,7 +62,7 @@ for (const key of Object.keys(symbolConverters)) {
|
|
|
61
62
|
}
|
|
62
63
|
assert(conversionOrder.reduce((a, b) => a | b, 0) === allConverterFlags, "conversionOrder contains a symbol flag that converters do not.");
|
|
63
64
|
function _convertSymbolNow(context, symbol, exportSymbol) {
|
|
64
|
-
if (context.shouldIgnore(symbol)) {
|
|
65
|
+
if (context.shouldIgnore(resolveAliasedSymbol(symbol, context.checker))) {
|
|
65
66
|
return;
|
|
66
67
|
}
|
|
67
68
|
// This check can catch symbols which ought to be documented as references
|
|
@@ -702,6 +703,9 @@ function convertSymbolAsClass(context, symbol, exportSymbol) {
|
|
|
702
703
|
for (const sig of ctors) {
|
|
703
704
|
createConstructSignatureWithType(constructContext, sig, reflection);
|
|
704
705
|
}
|
|
706
|
+
// Take the type parameters from the first constructor signature and use
|
|
707
|
+
// them as the type parameters for the class, #2914
|
|
708
|
+
reflection.typeParameters = convertTypeParameters(rc, reflection, ctors[0].getTypeParameters());
|
|
705
709
|
const instType = ctors[0].getReturnType();
|
|
706
710
|
convertSymbols(rc, instType.getProperties());
|
|
707
711
|
for (const sig of instType.getCallSignatures()) {
|
|
@@ -440,11 +440,7 @@ const referenceConverter = {
|
|
|
440
440
|
// in the type we just retrieved from node.typeName.
|
|
441
441
|
if (!node.typeArguments &&
|
|
442
442
|
context.shouldInline(symbol, name)) {
|
|
443
|
-
|
|
444
|
-
// This might not actually be safe, it appears that it is in the relatively small
|
|
445
|
-
// amount of testing I've done with it, but I wouldn't be surprised if someone manages
|
|
446
|
-
// to find a crash.
|
|
447
|
-
return typeLiteralConverter.convertType(context, type, null, undefined);
|
|
443
|
+
return convertTypeInlined(context, type);
|
|
448
444
|
}
|
|
449
445
|
const ref = context.createSymbolReference(context.resolveAliasedSymbol(symbol), context, name);
|
|
450
446
|
ref.typeArguments = node.typeArguments?.map((type) => convertType(context, type));
|
|
@@ -470,11 +466,7 @@ const referenceConverter = {
|
|
|
470
466
|
name = node.typeName.right.text;
|
|
471
467
|
}
|
|
472
468
|
if (context.shouldInline(symbol, name)) {
|
|
473
|
-
|
|
474
|
-
// This might not actually be safe, it appears that it is in the relatively small
|
|
475
|
-
// amount of testing I've done with it, but I wouldn't be surprised if someone manages
|
|
476
|
-
// to find a crash.
|
|
477
|
-
return typeLiteralConverter.convertType(context, type, null, undefined);
|
|
469
|
+
return convertTypeInlined(context, type);
|
|
478
470
|
}
|
|
479
471
|
const ref = context.createSymbolReference(context.resolveAliasedSymbol(symbol), context, name);
|
|
480
472
|
if (type.flags & ts.TypeFlags.Substitution) {
|
|
@@ -785,3 +777,29 @@ function normalizeUnion(types) {
|
|
|
785
777
|
types.splice(Math.min(trueIndex, falseIndex), 1, new IntrinsicType("boolean"));
|
|
786
778
|
}
|
|
787
779
|
}
|
|
780
|
+
function convertTypeInlined(context, type) {
|
|
781
|
+
if (type.isUnion()) {
|
|
782
|
+
const types = type.types.map(type => convertType(context, type));
|
|
783
|
+
return new UnionType(types);
|
|
784
|
+
}
|
|
785
|
+
if (type.isIntersection()) {
|
|
786
|
+
const types = type.types.map(type => convertType(context, type));
|
|
787
|
+
return new IntersectionType(types);
|
|
788
|
+
}
|
|
789
|
+
if (type.isLiteral()) {
|
|
790
|
+
return new LiteralType(typeof type.value === "object"
|
|
791
|
+
? BigInt(type.value.base10Value) * (type.value.negative ? -1n : 1n)
|
|
792
|
+
: type.value);
|
|
793
|
+
}
|
|
794
|
+
if (context.checker.isArrayType(type)) {
|
|
795
|
+
const elementType = convertType(context, context.checker.getTypeArguments(type)[0]);
|
|
796
|
+
return new ArrayType(elementType);
|
|
797
|
+
}
|
|
798
|
+
if (isTypeReference(type) && context.checker.isTupleType(type)) {
|
|
799
|
+
const tupleNode = context.checker.typeToTypeNode(type.target, void 0, ts.NodeBuilderFlags.IgnoreErrors);
|
|
800
|
+
if (ts.isTupleTypeNode(tupleNode)) {
|
|
801
|
+
return tupleConverter.convertType(context, type, tupleNode);
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
return typeLiteralConverter.convertType(context, type);
|
|
805
|
+
}
|
|
@@ -118,7 +118,6 @@ module.exports = {
|
|
|
118
118
|
failed_to_resolve_0_to_ts_path: `Failed to resolve entry point path {0} from package.json to a TypeScript source file`,
|
|
119
119
|
use_expand_or_glob_for_files_in_dir: `If you wanted to include files inside this directory, set --entryPointStrategy to expand or specify a glob`,
|
|
120
120
|
glob_0_did_not_match_any_files: `The glob {0} did not match any files`,
|
|
121
|
-
glob_should_use_posix_slash: `Try replacing Windows path separators (\\) with posix path separators (/)`,
|
|
122
121
|
entry_point_0_did_not_match_any_files_after_exclude: `The glob {0} did not match any files after applying exclude patterns`,
|
|
123
122
|
entry_point_0_did_not_exist: `Provided entry point {0} does not exist`,
|
|
124
123
|
entry_point_0_did_not_match_any_packages: `The entry point glob {0} did not match any directories containing package.json`,
|
|
@@ -129,6 +128,7 @@ module.exports = {
|
|
|
129
128
|
// options
|
|
130
129
|
circular_reference_extends_0: `Circular reference encountered for "extends" field of {0}`,
|
|
131
130
|
failed_resolve_0_to_file_in_1: `Failed to resolve {0} to a file in {1}`,
|
|
131
|
+
glob_0_should_use_posix_slash: `The glob "{0}" escapes a non-special character. Glob inputs to TypeDoc may not use Windows path separators (\\), try replacing with posix path separators (/)`,
|
|
132
132
|
option_0_can_only_be_specified_by_config_file: `The '{0}' option can only be specified via a config file`,
|
|
133
133
|
option_0_expected_a_value_but_none_provided: `--{0} expected a value, but none was given as an argument`,
|
|
134
134
|
unknown_option_0_may_have_meant_1: `Unknown option: {0}, you may have meant:\n\t{1}`,
|
|
@@ -109,7 +109,6 @@ declare const _default: {
|
|
|
109
109
|
readonly failed_to_resolve_0_to_ts_path: "Failed to resolve entry point path {0} from package.json to a TypeScript source file";
|
|
110
110
|
readonly use_expand_or_glob_for_files_in_dir: "If you wanted to include files inside this directory, set --entryPointStrategy to expand or specify a glob";
|
|
111
111
|
readonly glob_0_did_not_match_any_files: "The glob {0} did not match any files";
|
|
112
|
-
readonly glob_should_use_posix_slash: "Try replacing Windows path separators (\\) with posix path separators (/)";
|
|
113
112
|
readonly entry_point_0_did_not_match_any_files_after_exclude: "The glob {0} did not match any files after applying exclude patterns";
|
|
114
113
|
readonly entry_point_0_did_not_exist: "Provided entry point {0} does not exist";
|
|
115
114
|
readonly entry_point_0_did_not_match_any_packages: "The entry point glob {0} did not match any directories containing package.json";
|
|
@@ -118,6 +117,7 @@ declare const _default: {
|
|
|
118
117
|
readonly saved_relative_path_0_resolved_from_1_is_not_a_file: "Serialized project referenced {0}, which does not exist relative to {1}";
|
|
119
118
|
readonly circular_reference_extends_0: "Circular reference encountered for \"extends\" field of {0}";
|
|
120
119
|
readonly failed_resolve_0_to_file_in_1: "Failed to resolve {0} to a file in {1}";
|
|
120
|
+
readonly glob_0_should_use_posix_slash: "The glob \"{0}\" escapes a non-special character. Glob inputs to TypeDoc may not use Windows path separators (\\), try replacing with posix path separators (/)";
|
|
121
121
|
readonly option_0_can_only_be_specified_by_config_file: "The '{0}' option can only be specified via a config file";
|
|
122
122
|
readonly option_0_expected_a_value_but_none_provided: "--{0} expected a value, but none was given as an argument";
|
|
123
123
|
readonly unknown_option_0_may_have_meant_1: "Unknown option: {0}, you may have meant:\n\t{1}";
|
|
@@ -89,7 +89,6 @@ module.exports = localeUtils.buildIncompleteTranslation({
|
|
|
89
89
|
entry_point_0_not_in_program: "エントリ ポイント {0} は、tsconfig の 'files' または 'include' オプションによって参照されていません。",
|
|
90
90
|
use_expand_or_glob_for_files_in_dir: "このディレクトリ内のファイルを含める場合は、--entryPointStrategyを設定して展開するか、globを指定します。",
|
|
91
91
|
glob_0_did_not_match_any_files: "グロブ {0} はどのファイルにも一致しませんでした",
|
|
92
|
-
// glob_should_use_posix_slash
|
|
93
92
|
entry_point_0_did_not_match_any_files_after_exclude: "除外パターンを適用した後、グロブ {0} はどのファイルにも一致しませんでした",
|
|
94
93
|
entry_point_0_did_not_exist: "指定されたエントリ ポイント {0} は存在しません",
|
|
95
94
|
entry_point_0_did_not_match_any_packages: "エントリ ポイント glob {0} は、package.json を含むディレクトリと一致しませんでした。",
|
|
@@ -18,6 +18,7 @@ module.exports = localeUtils.buildIncompleteTranslation({
|
|
|
18
18
|
no_entry_points_for_packages: "没有为包模式提供入口点,无法生成文档",
|
|
19
19
|
failed_to_find_packages: "找不到任何软件包,请确保您至少提供了一个包含 package.json 的目录作为入口点",
|
|
20
20
|
nested_packages_unsupported_0: "位于 {0} 的项目已将 entryPointStrategy 设置为包,但不支持嵌套包",
|
|
21
|
+
package_option_0_should_be_specified_at_root: "由 packageOptions 设置的选项 {0} 仅在根级别有效",
|
|
21
22
|
previous_error_occurred_when_reading_options_for_0: "读取 {0} 处的包的选项时发生上一个错误",
|
|
22
23
|
converting_project_at_0: "正在转换 {0} 处的项目",
|
|
23
24
|
failed_to_convert_packages: "无法转换一个或多个包,结果将不会合并在一起",
|
|
@@ -119,7 +120,6 @@ module.exports = localeUtils.buildIncompleteTranslation({
|
|
|
119
120
|
failed_to_resolve_0_to_ts_path: "无法将 package.json 中的入口点 {0} 解析至 TypeScript 源文件",
|
|
120
121
|
use_expand_or_glob_for_files_in_dir: "如果要包含此目录中的文件,请设置 --entryPointStrategy 以展开或指定 glob",
|
|
121
122
|
glob_0_did_not_match_any_files: "glob {0} 与任何文件均不匹配",
|
|
122
|
-
glob_should_use_posix_slash: `请将 Windows 路径分隔符(\\)替换为 POSIX 路径分隔符(/)`,
|
|
123
123
|
entry_point_0_did_not_match_any_files_after_exclude: "应用排除模式后,glob {0} 没有匹配任何文件",
|
|
124
124
|
entry_point_0_did_not_exist: "提供的入口点 {0} 不存在",
|
|
125
125
|
entry_point_0_did_not_match_any_packages: "入口点 glob {0} 与任何包含 package.json 的目录不匹配",
|
|
@@ -435,6 +435,10 @@ module.exports = localeUtils.buildIncompleteTranslation({
|
|
|
435
435
|
tag_type: "类型",
|
|
436
436
|
tag_typedef: "类型定义",
|
|
437
437
|
tag_summary: "概述",
|
|
438
|
+
tag_preventInline: "取消内联",
|
|
439
|
+
tag_inlineType: "内联类型",
|
|
440
|
+
tag_preventExpand: "取消扩展",
|
|
441
|
+
tag_expandType: "扩展类型",
|
|
438
442
|
// Inline tags
|
|
439
443
|
tag_link: "链接",
|
|
440
444
|
tag_label: "标记",
|
|
@@ -467,6 +471,7 @@ module.exports = localeUtils.buildIncompleteTranslation({
|
|
|
467
471
|
tag_inline: "内联",
|
|
468
472
|
tag_interface: "接口",
|
|
469
473
|
tag_namespace: "命名空间",
|
|
474
|
+
tag_function: "函数",
|
|
470
475
|
tag_overload: "重载",
|
|
471
476
|
tag_private: "私有成员",
|
|
472
477
|
tag_protected: "受保护成员",
|
|
@@ -13,6 +13,7 @@ declare const _default: {
|
|
|
13
13
|
no_entry_points_for_packages: string;
|
|
14
14
|
failed_to_find_packages: string;
|
|
15
15
|
nested_packages_unsupported_0: "位于 {0} 的项目已将 entryPointStrategy 设置为包,但不支持嵌套包";
|
|
16
|
+
package_option_0_should_be_specified_at_root: "由 packageOptions 设置的选项 {0} 仅在根级别有效";
|
|
16
17
|
previous_error_occurred_when_reading_options_for_0: "读取 {0} 处的包的选项时发生上一个错误";
|
|
17
18
|
converting_project_at_0: "正在转换 {0} 处的项目";
|
|
18
19
|
failed_to_convert_packages: string;
|
|
@@ -108,7 +109,6 @@ declare const _default: {
|
|
|
108
109
|
failed_to_resolve_0_to_ts_path: "无法将 package.json 中的入口点 {0} 解析至 TypeScript 源文件";
|
|
109
110
|
use_expand_or_glob_for_files_in_dir: string;
|
|
110
111
|
glob_0_did_not_match_any_files: "glob {0} 与任何文件均不匹配";
|
|
111
|
-
glob_should_use_posix_slash: string;
|
|
112
112
|
entry_point_0_did_not_match_any_files_after_exclude: "应用排除模式后,glob {0} 没有匹配任何文件";
|
|
113
113
|
entry_point_0_did_not_exist: "提供的入口点 {0} 不存在";
|
|
114
114
|
entry_point_0_did_not_match_any_packages: "入口点 glob {0} 与任何包含 package.json 的目录不匹配";
|
|
@@ -400,6 +400,10 @@ declare const _default: {
|
|
|
400
400
|
tag_type: string;
|
|
401
401
|
tag_typedef: string;
|
|
402
402
|
tag_summary: string;
|
|
403
|
+
tag_preventInline: string;
|
|
404
|
+
tag_inlineType: string;
|
|
405
|
+
tag_preventExpand: string;
|
|
406
|
+
tag_expandType: string;
|
|
403
407
|
tag_link: string;
|
|
404
408
|
tag_label: string;
|
|
405
409
|
tag_linkcode: string;
|
|
@@ -430,6 +434,7 @@ declare const _default: {
|
|
|
430
434
|
tag_inline: string;
|
|
431
435
|
tag_interface: string;
|
|
432
436
|
tag_namespace: string;
|
|
437
|
+
tag_function: string;
|
|
433
438
|
tag_overload: string;
|
|
434
439
|
tag_private: string;
|
|
435
440
|
tag_protected: string;
|