typedoc 0.25.12 → 0.26.0-beta.0
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/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/lib/application.d.ts +15 -3
- package/dist/lib/application.js +65 -23
- package/dist/lib/cli.js +1 -1
- package/dist/lib/converter/comments/blockLexer.d.ts +1 -1
- package/dist/lib/converter/comments/blockLexer.js +1 -2
- package/dist/lib/converter/comments/declarationReference.js +8 -8
- package/dist/lib/converter/comments/declarationReferenceResolver.d.ts +1 -1
- package/dist/lib/converter/comments/declarationReferenceResolver.js +15 -14
- package/dist/lib/converter/comments/discovery.d.ts +3 -3
- package/dist/lib/converter/comments/discovery.js +21 -19
- package/dist/lib/converter/comments/index.d.ts +1 -1
- package/dist/lib/converter/comments/index.js +35 -16
- package/dist/lib/converter/comments/lineLexer.d.ts +1 -1
- package/dist/lib/converter/comments/lineLexer.js +1 -2
- package/dist/lib/converter/comments/linkResolver.d.ts +2 -2
- package/dist/lib/converter/comments/linkResolver.js +5 -3
- package/dist/lib/converter/comments/parser.d.ts +14 -3
- package/dist/lib/converter/comments/parser.js +144 -39
- package/dist/lib/converter/comments/rawLexer.d.ts +7 -1
- package/dist/lib/converter/comments/rawLexer.js +21 -70
- package/dist/lib/converter/comments/tagName.js +1 -2
- package/dist/lib/converter/context.d.ts +7 -2
- package/dist/lib/converter/context.js +7 -2
- package/dist/lib/converter/convert-expression.js +2 -3
- package/dist/lib/converter/converter.d.ts +8 -3
- package/dist/lib/converter/converter.js +16 -13
- package/dist/lib/converter/factories/index-signature.d.ts +1 -1
- package/dist/lib/converter/factories/index-signature.js +9 -12
- package/dist/lib/converter/factories/signature.d.ts +1 -1
- package/dist/lib/converter/factories/signature.js +11 -12
- package/dist/lib/converter/jsdoc.js +2 -3
- package/dist/lib/converter/plugins/CategoryPlugin.d.ts +3 -3
- package/dist/lib/converter/plugins/CategoryPlugin.js +22 -15
- package/dist/lib/converter/plugins/CommentPlugin.d.ts +1 -1
- package/dist/lib/converter/plugins/CommentPlugin.js +58 -67
- package/dist/lib/converter/plugins/GroupPlugin.d.ts +4 -4
- package/dist/lib/converter/plugins/GroupPlugin.js +52 -18
- package/dist/lib/converter/plugins/ImplementsPlugin.js +4 -3
- package/dist/lib/converter/plugins/InheritDocPlugin.d.ts +1 -1
- package/dist/lib/converter/plugins/InheritDocPlugin.js +5 -6
- package/dist/lib/converter/plugins/LinkResolverPlugin.d.ts +2 -2
- package/dist/lib/converter/plugins/PackagePlugin.d.ts +0 -2
- package/dist/lib/converter/plugins/PackagePlugin.js +8 -30
- package/dist/lib/converter/plugins/SourcePlugin.js +2 -2
- package/dist/lib/converter/symbols.js +31 -11
- package/dist/lib/converter/types.d.ts +1 -1
- package/dist/lib/converter/types.js +11 -6
- package/dist/lib/converter/utils/nodes.js +3 -4
- package/dist/lib/converter/utils/reflections.d.ts +1 -1
- package/dist/lib/converter/utils/reflections.js +1 -2
- package/dist/lib/converter/utils/repository.js +9 -7
- package/dist/lib/converter/utils/symbols.js +1 -2
- package/dist/lib/internationalization/index.d.ts +7 -0
- package/dist/lib/internationalization/index.js +11 -0
- package/dist/lib/internationalization/internationalization.d.ts +92 -0
- package/dist/lib/internationalization/internationalization.js +194 -0
- package/dist/lib/internationalization/locales/en.cjs +3 -0
- package/dist/lib/internationalization/locales/en.d.cts +2 -0
- package/dist/lib/internationalization/locales/test.cjs +8 -0
- package/dist/lib/internationalization/locales/test.d.cts +5 -0
- package/dist/lib/internationalization/translatable.d.ts +297 -0
- package/dist/lib/internationalization/translatable.js +322 -0
- package/dist/lib/models/ReflectionCategory.d.ts +2 -2
- package/dist/lib/models/ReflectionGroup.d.ts +2 -2
- package/dist/lib/models/comments/comment.d.ts +17 -3
- package/dist/lib/models/comments/comment.js +377 -298
- package/dist/lib/models/reflections/ReflectionSymbolId.js +2 -2
- package/dist/lib/models/reflections/abstract.d.ts +11 -8
- package/dist/lib/models/reflections/abstract.js +17 -11
- package/dist/lib/models/reflections/container.d.ts +25 -3
- package/dist/lib/models/reflections/container.js +64 -0
- package/dist/lib/models/reflections/declaration.d.ts +3 -15
- package/dist/lib/models/reflections/declaration.js +16 -21
- package/dist/lib/models/reflections/document.d.ts +27 -0
- package/dist/lib/models/reflections/document.js +43 -0
- package/dist/lib/models/reflections/index.d.ts +4 -3
- package/dist/lib/models/reflections/index.js +5 -4
- package/dist/lib/models/reflections/kind.d.ts +13 -1
- package/dist/lib/models/reflections/kind.js +12 -0
- package/dist/lib/models/reflections/parameter.d.ts +1 -1
- package/dist/lib/models/reflections/project.d.ts +2 -2
- package/dist/lib/models/reflections/project.js +8 -7
- package/dist/lib/models/reflections/signature.d.ts +2 -2
- package/dist/lib/models/reflections/type-parameter.d.ts +1 -1
- package/dist/lib/models/reflections/utils.js +1 -2
- package/dist/lib/models/reflections/variant.d.ts +2 -0
- package/dist/lib/models/types.d.ts +4 -4
- package/dist/lib/models/types.js +3 -3
- package/dist/lib/output/events.d.ts +5 -5
- package/dist/lib/output/events.js +2 -1
- package/dist/lib/output/index.d.ts +1 -1
- package/dist/lib/output/index.js +2 -1
- package/dist/lib/output/plugins/AssetsPlugin.js +1 -1
- package/dist/lib/output/plugins/JavascriptIndexPlugin.d.ts +3 -1
- package/dist/lib/output/plugins/JavascriptIndexPlugin.js +28 -8
- package/dist/lib/output/plugins/SitemapPlugin.d.ts +1 -1
- package/dist/lib/output/plugins/SitemapPlugin.js +24 -13
- package/dist/lib/output/renderer.d.ts +9 -1
- package/dist/lib/output/renderer.js +5 -7
- package/dist/lib/output/themes/MarkedPlugin.d.ts +13 -24
- package/dist/lib/output/themes/MarkedPlugin.js +75 -160
- package/dist/lib/output/themes/default/DefaultTheme.d.ts +16 -4
- package/dist/lib/output/themes/default/DefaultTheme.js +62 -16
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +44 -44
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +10 -10
- package/dist/lib/output/themes/default/layouts/default.js +1 -1
- package/dist/lib/output/themes/default/partials/analytics.js +1 -2
- package/dist/lib/output/themes/default/partials/anchor-icon.js +2 -3
- package/dist/lib/output/themes/default/partials/comment.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/comment.js +3 -4
- package/dist/lib/output/themes/default/partials/footer.js +22 -7
- package/dist/lib/output/themes/default/partials/header.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/header.js +4 -3
- package/dist/lib/output/themes/default/partials/hierarchy.js +3 -4
- package/dist/lib/output/themes/default/partials/icon.js +7 -2
- package/dist/lib/output/themes/default/partials/index.js +4 -4
- package/dist/lib/output/themes/default/partials/member.d.ts +2 -2
- package/dist/lib/output/themes/default/partials/member.declaration.js +2 -3
- package/dist/lib/output/themes/default/partials/member.js +13 -2
- package/dist/lib/output/themes/default/partials/member.reference.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/member.reference.js +9 -6
- package/dist/lib/output/themes/default/partials/member.signature.body.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/member.signature.body.js +4 -4
- package/dist/lib/output/themes/default/partials/member.signature.title.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/member.signature.title.js +1 -2
- package/dist/lib/output/themes/default/partials/member.sources.js +12 -6
- package/dist/lib/output/themes/default/partials/members.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/members.group.js +1 -2
- package/dist/lib/output/themes/default/partials/members.js +1 -2
- package/dist/lib/output/themes/default/partials/navigation.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/navigation.js +18 -15
- package/dist/lib/output/themes/default/partials/parameter.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/parameter.js +15 -15
- package/dist/lib/output/themes/default/partials/reflectionPreview.js +1 -2
- package/dist/lib/output/themes/default/partials/toolbar.js +4 -4
- package/dist/lib/output/themes/default/partials/type.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/type.js +14 -14
- package/dist/lib/output/themes/default/partials/typeAndParent.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/typeParameters.js +2 -3
- package/dist/lib/output/themes/default/templates/document.d.ts +5 -0
- package/dist/lib/output/themes/default/templates/document.js +7 -0
- package/dist/lib/output/themes/default/templates/hierarchy.js +1 -2
- package/dist/lib/output/themes/default/templates/reflection.d.ts +1 -1
- package/dist/lib/output/themes/default/templates/reflection.js +21 -19
- package/dist/lib/output/themes/lib.d.ts +1 -1
- package/dist/lib/output/themes/lib.js +12 -16
- package/dist/lib/serialization/deserializer.d.ts +3 -3
- package/dist/lib/serialization/deserializer.js +7 -5
- package/dist/lib/serialization/schema.d.ts +10 -3
- package/dist/lib/utils/array.js +9 -10
- package/dist/lib/utils/component.d.ts +1 -1
- package/dist/lib/utils/component.js +2 -2
- package/dist/lib/utils/entry-point.d.ts +11 -0
- package/dist/lib/utils/entry-point.js +51 -24
- package/dist/lib/utils/enum.js +6 -7
- package/dist/lib/utils/fs.js +15 -16
- package/dist/lib/utils/general.d.ts +4 -3
- package/dist/lib/utils/general.js +4 -5
- package/dist/lib/utils/highlighter.d.ts +4 -2
- package/dist/lib/utils/highlighter.js +41 -40
- package/dist/lib/utils/html.js +2 -3
- package/dist/lib/utils/index.d.ts +1 -1
- package/dist/lib/utils/index.js +1 -2
- package/dist/lib/utils/jsx.elements.d.ts +12 -0
- package/dist/lib/utils/jsx.js +4 -4
- package/dist/lib/utils/loggers.d.ts +13 -7
- package/dist/lib/utils/loggers.js +13 -10
- package/dist/lib/utils/map.d.ts +1 -1
- package/dist/lib/utils/map.js +1 -1
- package/dist/lib/utils/options/declaration.d.ts +40 -21
- package/dist/lib/utils/options/declaration.js +36 -36
- package/dist/lib/utils/options/help.d.ts +2 -1
- package/dist/lib/utils/options/help.js +10 -10
- package/dist/lib/utils/options/index.d.ts +1 -1
- package/dist/lib/utils/options/index.js +1 -2
- package/dist/lib/utils/options/options.d.ts +5 -34
- package/dist/lib/utils/options/options.js +10 -23
- package/dist/lib/utils/options/readers/arguments.js +3 -5
- package/dist/lib/utils/options/readers/package-json.js +2 -2
- package/dist/lib/utils/options/readers/tsconfig.js +8 -12
- package/dist/lib/utils/options/readers/typedoc.js +7 -6
- package/dist/lib/utils/options/sources/typedoc.js +187 -178
- package/dist/lib/utils/options/tsdoc-defaults.d.ts +1 -1
- package/dist/lib/utils/options/tsdoc-defaults.js +2 -0
- package/dist/lib/utils/package-manifest.d.ts +1 -1
- package/dist/lib/utils/package-manifest.js +9 -11
- package/dist/lib/utils/paths.js +4 -5
- package/dist/lib/utils/perf.js +3 -4
- package/dist/lib/utils/plugins.js +4 -5
- package/dist/lib/utils/reflections.d.ts +1 -1
- package/dist/lib/utils/reflections.js +2 -3
- package/dist/lib/utils/sort.d.ts +3 -2
- package/dist/lib/utils/sort.js +37 -6
- package/dist/lib/utils/tsconfig.js +3 -4
- package/dist/lib/utils/tsutils.js +2 -3
- package/dist/lib/utils/validation.js +4 -4
- package/dist/lib/validation/documentation.d.ts +1 -1
- package/dist/lib/validation/documentation.js +9 -4
- package/dist/lib/validation/exports.js +3 -5
- package/dist/lib/validation/links.js +2 -3
- package/package.json +14 -13
- package/static/main.js +4 -4
- package/static/style.css +21 -16
- package/tsdoc.json +9 -0
|
@@ -57,6 +57,26 @@ const converter_1 = require("../converter");
|
|
|
57
57
|
const sort_1 = require("../../utils/sort");
|
|
58
58
|
const utils_1 = require("../../utils");
|
|
59
59
|
const models_1 = require("../../models");
|
|
60
|
+
// Same as the defaultKindSortOrder in sort.ts
|
|
61
|
+
const defaultGroupOrder = [
|
|
62
|
+
index_1.ReflectionKind.Document,
|
|
63
|
+
index_1.ReflectionKind.Reference,
|
|
64
|
+
// project is never a child so never added to a group
|
|
65
|
+
index_1.ReflectionKind.Module,
|
|
66
|
+
index_1.ReflectionKind.Namespace,
|
|
67
|
+
index_1.ReflectionKind.Enum,
|
|
68
|
+
index_1.ReflectionKind.EnumMember,
|
|
69
|
+
index_1.ReflectionKind.Class,
|
|
70
|
+
index_1.ReflectionKind.Interface,
|
|
71
|
+
index_1.ReflectionKind.TypeAlias,
|
|
72
|
+
index_1.ReflectionKind.Constructor,
|
|
73
|
+
index_1.ReflectionKind.Property,
|
|
74
|
+
index_1.ReflectionKind.Variable,
|
|
75
|
+
index_1.ReflectionKind.Function,
|
|
76
|
+
index_1.ReflectionKind.Accessor,
|
|
77
|
+
index_1.ReflectionKind.Method,
|
|
78
|
+
// others are never added to groups
|
|
79
|
+
];
|
|
60
80
|
/**
|
|
61
81
|
* A handler that sorts and groups the found reflections in the resolving phase.
|
|
62
82
|
*
|
|
@@ -100,6 +120,9 @@ let GroupPlugin = (() => {
|
|
|
100
120
|
[converter_1.Converter.EVENT_RESOLVE_BEGIN]: () => {
|
|
101
121
|
this.sortFunction = (0, sort_1.getSortFunction)(this.application.options);
|
|
102
122
|
GroupPlugin.WEIGHTS = this.groupOrder;
|
|
123
|
+
if (GroupPlugin.WEIGHTS.length === 0) {
|
|
124
|
+
GroupPlugin.WEIGHTS = defaultGroupOrder.map((kind) => this.application.internationalization.kindPluralString(kind));
|
|
125
|
+
}
|
|
103
126
|
},
|
|
104
127
|
[converter_1.Converter.EVENT_RESOLVE_END]: this.onEndResolve,
|
|
105
128
|
}, undefined, -100);
|
|
@@ -124,19 +147,24 @@ let GroupPlugin = (() => {
|
|
|
124
147
|
this.usedBoosts.clear();
|
|
125
148
|
if (unusedBoosts.size &&
|
|
126
149
|
this.application.options.isSet("searchGroupBoosts")) {
|
|
127
|
-
context.logger.warn(
|
|
128
|
-
` The unused groups were:\n\t${Array.from(unusedBoosts).join("\n\t")}`);
|
|
150
|
+
context.logger.warn(context.i18n.not_all_search_group_boosts_used_0(Array.from(unusedBoosts).join("\n\t")));
|
|
129
151
|
}
|
|
130
152
|
}
|
|
131
153
|
group(reflection) {
|
|
132
|
-
if (reflection.
|
|
133
|
-
reflection.children
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
154
|
+
if (reflection.childrenIncludingDocuments && !reflection.groups) {
|
|
155
|
+
if (reflection.children) {
|
|
156
|
+
if (this.sortEntryPoints ||
|
|
157
|
+
!reflection.children.some((c) => c.kindOf(index_1.ReflectionKind.Module))) {
|
|
158
|
+
this.sortFunction(reflection.children);
|
|
159
|
+
this.sortFunction(reflection.documents || []);
|
|
160
|
+
this.sortFunction(reflection.childrenIncludingDocuments);
|
|
161
|
+
}
|
|
138
162
|
}
|
|
139
|
-
|
|
163
|
+
else if (reflection.documents) {
|
|
164
|
+
this.sortFunction(reflection.documents);
|
|
165
|
+
this.sortFunction(reflection.childrenIncludingDocuments);
|
|
166
|
+
}
|
|
167
|
+
reflection.groups = this.getReflectionGroups(reflection, reflection.childrenIncludingDocuments);
|
|
140
168
|
}
|
|
141
169
|
}
|
|
142
170
|
/**
|
|
@@ -158,19 +186,25 @@ let GroupPlugin = (() => {
|
|
|
158
186
|
return false;
|
|
159
187
|
});
|
|
160
188
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
if (reflection.type?.type === "reflection") {
|
|
166
|
-
extractGroupTags(reflection.type.declaration.comment);
|
|
167
|
-
for (const sig of reflection.type.declaration.getNonIndexSignatures()) {
|
|
189
|
+
if (reflection.isDeclaration()) {
|
|
190
|
+
extractGroupTags(reflection.comment);
|
|
191
|
+
for (const sig of reflection.getNonIndexSignatures()) {
|
|
168
192
|
extractGroupTags(sig.comment);
|
|
169
193
|
}
|
|
194
|
+
if (reflection.type?.type === "reflection") {
|
|
195
|
+
extractGroupTags(reflection.type.declaration.comment);
|
|
196
|
+
for (const sig of reflection.type.declaration.getNonIndexSignatures()) {
|
|
197
|
+
extractGroupTags(sig.comment);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
if (reflection.isDocument() && "group" in reflection.frontmatter) {
|
|
202
|
+
groups.add(String(reflection.frontmatter["group"]));
|
|
203
|
+
delete reflection.frontmatter["group"];
|
|
170
204
|
}
|
|
171
205
|
groups.delete("");
|
|
172
206
|
if (groups.size === 0) {
|
|
173
|
-
groups.add(
|
|
207
|
+
groups.add(this.application.internationalization.kindPluralString(reflection.kind));
|
|
174
208
|
}
|
|
175
209
|
for (const group of groups) {
|
|
176
210
|
if (group in this.boosts) {
|
|
@@ -210,7 +244,7 @@ let GroupPlugin = (() => {
|
|
|
210
244
|
cat.description = body;
|
|
211
245
|
}
|
|
212
246
|
else {
|
|
213
|
-
this.application.logger.warn(
|
|
247
|
+
this.application.logger.warn(this.application.i18n.comment_for_0_includes_groupDescription_for_1_but_no_child_in_group(parent.getFriendlyFullName(), header));
|
|
214
248
|
}
|
|
215
249
|
return true;
|
|
216
250
|
}
|
|
@@ -234,8 +234,7 @@ let ImplementsPlugin = (() => {
|
|
|
234
234
|
const property = findProperty(reflection, childType);
|
|
235
235
|
if (!property) {
|
|
236
236
|
// We're probably broken... but I don't think this should be fatal.
|
|
237
|
-
context.logger.warn(`Failed to retrieve${reflection.flags.isStatic ? " static" : ""} member "${reflection.escapedName ?? reflection.name}" of "${reflection.parent
|
|
238
|
-
?.name}" for inheritance analysis. Please report a bug.`);
|
|
237
|
+
context.logger.warn(`Failed to retrieve${reflection.flags.isStatic ? " static" : ""} member "${reflection.escapedName ?? reflection.name}" of "${reflection.parent?.name}" for inheritance analysis. Please report a bug.`);
|
|
239
238
|
return;
|
|
240
239
|
}
|
|
241
240
|
// Need to check both extends and implements clauses.
|
|
@@ -299,7 +298,9 @@ function createLink(context, reflection, clause, expr, symbol, isOverwrite) {
|
|
|
299
298
|
link(reflection);
|
|
300
299
|
link(reflection.getSignature);
|
|
301
300
|
link(reflection.setSignature);
|
|
302
|
-
|
|
301
|
+
for (const sig of reflection.indexSignatures || []) {
|
|
302
|
+
link(sig);
|
|
303
|
+
}
|
|
303
304
|
for (const sig of reflection.signatures ?? []) {
|
|
304
305
|
link(sig);
|
|
305
306
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConverterComponent } from "../components";
|
|
2
|
-
import { ValidationOptions } from "../../utils";
|
|
2
|
+
import { type ValidationOptions } from "../../utils";
|
|
3
3
|
/**
|
|
4
4
|
* A plugin that handles `@inheritDoc` tags by copying documentation from another API item.
|
|
5
5
|
* It is NOT responsible for handling bare JSDoc style `@inheritDoc` tags which do not specify
|
|
@@ -110,7 +110,7 @@ let InheritDocPlugin = (() => {
|
|
|
110
110
|
continue;
|
|
111
111
|
const declRef = (0, declarationReference_1.parseDeclarationReference)(source, 0, source.length);
|
|
112
112
|
if (!declRef || /\S/.test(source.substring(declRef[1]))) {
|
|
113
|
-
this.application.logger.warn(
|
|
113
|
+
this.application.logger.warn(this.application.i18n.declaration_reference_in_inheritdoc_for_0_not_fully_parsed(reflection.getFriendlyFullName()));
|
|
114
114
|
}
|
|
115
115
|
let sourceRefl = declRef && (0, declarationReferenceResolver_1.resolveDeclarationReference)(reflection, declRef[0]);
|
|
116
116
|
if (reflection instanceof models_1.SignatureReflection) {
|
|
@@ -136,7 +136,7 @@ let InheritDocPlugin = (() => {
|
|
|
136
136
|
}
|
|
137
137
|
if (!sourceRefl) {
|
|
138
138
|
if (this.validation.invalidLink) {
|
|
139
|
-
this.application.logger.warn(
|
|
139
|
+
this.application.logger.warn(this.application.i18n.failed_to_find_0_to_inherit_comment_from_in_1(source, reflection.getFriendlyFullName()));
|
|
140
140
|
}
|
|
141
141
|
continue;
|
|
142
142
|
}
|
|
@@ -160,7 +160,7 @@ let InheritDocPlugin = (() => {
|
|
|
160
160
|
source = source.type.declaration.signatures[0];
|
|
161
161
|
}
|
|
162
162
|
if (!source.comment) {
|
|
163
|
-
this.application.logger.warn(
|
|
163
|
+
this.application.logger.warn(this.application.i18n.reflection_0_tried_to_copy_comment_from_1_but_source_had_no_comment(target.getFullName(), source.getFullName()));
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
166
|
// If the source also has a @inheritDoc tag, we can't do anything yet.
|
|
@@ -207,9 +207,7 @@ let InheritDocPlugin = (() => {
|
|
|
207
207
|
parts.push(work.name);
|
|
208
208
|
} while (!this.dependencies.get(work).includes(orig));
|
|
209
209
|
parts.push(orig.name);
|
|
210
|
-
this.application.logger.warn(
|
|
211
|
-
.reverse()
|
|
212
|
-
.join(" -> ")}`);
|
|
210
|
+
this.application.logger.warn(this.application.i18n.inheritdoc_circular_inheritance_chain_0(parts.reverse().join(" -> ")));
|
|
213
211
|
};
|
|
214
212
|
for (const orig of this.dependencies.keys()) {
|
|
215
213
|
if (unwarned.has(orig)) {
|
|
@@ -235,6 +233,7 @@ exports.InheritDocPlugin = InheritDocPlugin;
|
|
|
235
233
|
function copySummaries(source, target) {
|
|
236
234
|
for (const [s, t] of (0, array_1.zip)(source || [], target || [])) {
|
|
237
235
|
t.comment = new models_1.Comment(s.comment?.summary);
|
|
236
|
+
t.comment.sourcePath = s.comment?.sourcePath;
|
|
238
237
|
}
|
|
239
238
|
}
|
|
240
239
|
function extractInheritDocTagReference(reflection) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConverterComponent } from "../components";
|
|
2
2
|
import type { Context } from "../../converter";
|
|
3
|
-
import { ValidationOptions } from "../../utils";
|
|
4
|
-
import { ProjectReflection } from "../../models";
|
|
3
|
+
import { type ValidationOptions } from "../../utils";
|
|
4
|
+
import { type ProjectReflection } from "../../models";
|
|
5
5
|
/**
|
|
6
6
|
* A plugin that resolves `{@link Foo}` tags.
|
|
7
7
|
*/
|
|
@@ -6,7 +6,6 @@ import { EntryPointStrategy } from "../../utils";
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class PackagePlugin extends ConverterComponent {
|
|
8
8
|
accessor readme: string;
|
|
9
|
-
accessor stripYamlFrontmatter: boolean;
|
|
10
9
|
accessor entryPointStrategy: EntryPointStrategy;
|
|
11
10
|
accessor entryPoints: string[];
|
|
12
11
|
accessor includeVersion: boolean;
|
|
@@ -25,7 +24,6 @@ export declare class PackagePlugin extends ConverterComponent {
|
|
|
25
24
|
initialize(): void;
|
|
26
25
|
private onRevive;
|
|
27
26
|
private onBegin;
|
|
28
|
-
private processReadmeContents;
|
|
29
27
|
private onBeginResolve;
|
|
30
28
|
private addEntries;
|
|
31
29
|
}
|
|
@@ -87,7 +87,7 @@ const path_1 = require("path");
|
|
|
87
87
|
* current project.
|
|
88
88
|
*/
|
|
89
89
|
let PackagePlugin = (() => {
|
|
90
|
-
var _PackagePlugin_readme_accessor_storage,
|
|
90
|
+
var _PackagePlugin_readme_accessor_storage, _PackagePlugin_entryPointStrategy_accessor_storage, _PackagePlugin_entryPoints_accessor_storage, _PackagePlugin_includeVersion_accessor_storage;
|
|
91
91
|
let _classDecorators = [(0, components_1.Component)({ name: "package" })];
|
|
92
92
|
let _classDescriptor;
|
|
93
93
|
let _classExtraInitializers = [];
|
|
@@ -96,9 +96,6 @@ let PackagePlugin = (() => {
|
|
|
96
96
|
let _readme_decorators;
|
|
97
97
|
let _readme_initializers = [];
|
|
98
98
|
let _readme_extraInitializers = [];
|
|
99
|
-
let _stripYamlFrontmatter_decorators;
|
|
100
|
-
let _stripYamlFrontmatter_initializers = [];
|
|
101
|
-
let _stripYamlFrontmatter_extraInitializers = [];
|
|
102
99
|
let _entryPointStrategy_decorators;
|
|
103
100
|
let _entryPointStrategy_initializers = [];
|
|
104
101
|
let _entryPointStrategy_extraInitializers = [];
|
|
@@ -112,8 +109,7 @@ let PackagePlugin = (() => {
|
|
|
112
109
|
constructor() {
|
|
113
110
|
super(...arguments);
|
|
114
111
|
_PackagePlugin_readme_accessor_storage.set(this, __runInitializers(this, _readme_initializers, void 0));
|
|
115
|
-
|
|
116
|
-
_PackagePlugin_entryPointStrategy_accessor_storage.set(this, (__runInitializers(this, _stripYamlFrontmatter_extraInitializers), __runInitializers(this, _entryPointStrategy_initializers, void 0)));
|
|
112
|
+
_PackagePlugin_entryPointStrategy_accessor_storage.set(this, (__runInitializers(this, _readme_extraInitializers), __runInitializers(this, _entryPointStrategy_initializers, void 0)));
|
|
117
113
|
_PackagePlugin_entryPoints_accessor_storage.set(this, (__runInitializers(this, _entryPointStrategy_extraInitializers), __runInitializers(this, _entryPoints_initializers, void 0)));
|
|
118
114
|
_PackagePlugin_includeVersion_accessor_storage.set(this, (__runInitializers(this, _entryPoints_extraInitializers), __runInitializers(this, _includeVersion_initializers, void 0)));
|
|
119
115
|
/**
|
|
@@ -123,8 +119,6 @@ let PackagePlugin = (() => {
|
|
|
123
119
|
}
|
|
124
120
|
get readme() { return __classPrivateFieldGet(this, _PackagePlugin_readme_accessor_storage, "f"); }
|
|
125
121
|
set readme(value) { __classPrivateFieldSet(this, _PackagePlugin_readme_accessor_storage, value, "f"); }
|
|
126
|
-
get stripYamlFrontmatter() { return __classPrivateFieldGet(this, _PackagePlugin_stripYamlFrontmatter_accessor_storage, "f"); }
|
|
127
|
-
set stripYamlFrontmatter(value) { __classPrivateFieldSet(this, _PackagePlugin_stripYamlFrontmatter_accessor_storage, value, "f"); }
|
|
128
122
|
get entryPointStrategy() { return __classPrivateFieldGet(this, _PackagePlugin_entryPointStrategy_accessor_storage, "f"); }
|
|
129
123
|
set entryPointStrategy(value) { __classPrivateFieldSet(this, _PackagePlugin_entryPointStrategy_accessor_storage, value, "f"); }
|
|
130
124
|
get entryPoints() { return __classPrivateFieldGet(this, _PackagePlugin_entryPoints_accessor_storage, "f"); }
|
|
@@ -170,11 +164,11 @@ let PackagePlugin = (() => {
|
|
|
170
164
|
if (this.readme) {
|
|
171
165
|
// Readme path provided, read only that file.
|
|
172
166
|
try {
|
|
173
|
-
this.readmeContents =
|
|
167
|
+
this.readmeContents = (0, utils_1.readFile)(this.readme);
|
|
174
168
|
this.readmeFile = this.readme;
|
|
175
169
|
}
|
|
176
170
|
catch {
|
|
177
|
-
this.application.logger.error(
|
|
171
|
+
this.application.logger.error(this.application.i18n.provided_readme_at_0_could_not_be_read((0, paths_1.nicePath)(this.readme)));
|
|
178
172
|
}
|
|
179
173
|
}
|
|
180
174
|
else {
|
|
@@ -182,30 +176,17 @@ let PackagePlugin = (() => {
|
|
|
182
176
|
const result = (0, fs_1.discoverInParentDir)("readme.md", dirName, (content) => content);
|
|
183
177
|
if (result) {
|
|
184
178
|
this.readmeFile = result.file;
|
|
185
|
-
this.readmeContents =
|
|
179
|
+
this.readmeContents = result.content;
|
|
186
180
|
}
|
|
187
181
|
}
|
|
188
182
|
}
|
|
189
|
-
processReadmeContents(contents) {
|
|
190
|
-
if (this.stripYamlFrontmatter) {
|
|
191
|
-
return contents.replace(/^\s*---\r?\n[\s\S]*?\r?\n---\s*?\r?\n\s*/, "");
|
|
192
|
-
}
|
|
193
|
-
return contents;
|
|
194
|
-
}
|
|
195
183
|
onBeginResolve(context) {
|
|
196
184
|
this.addEntries(context.project);
|
|
197
185
|
}
|
|
198
186
|
addEntries(project) {
|
|
199
187
|
if (this.readmeFile && this.readmeContents) {
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
const ignored = [
|
|
203
|
-
...comment.blockTags.map((tag) => tag.tag),
|
|
204
|
-
...comment.modifierTags,
|
|
205
|
-
];
|
|
206
|
-
this.application.logger.warn(`Block and modifier tags will be ignored within the readme:\n\t${ignored.join("\n\t")}`);
|
|
207
|
-
}
|
|
208
|
-
project.readme = comment.summary;
|
|
188
|
+
const { content } = this.application.converter.parseRawComment(new minimalSourceFile_1.MinimalSourceFile(this.readmeContents, this.readmeFile));
|
|
189
|
+
project.readme = content;
|
|
209
190
|
}
|
|
210
191
|
if (this.packageJson) {
|
|
211
192
|
project.packageName = this.packageJson.name;
|
|
@@ -217,13 +198,12 @@ let PackagePlugin = (() => {
|
|
|
217
198
|
}
|
|
218
199
|
}
|
|
219
200
|
else if (!project.name) {
|
|
220
|
-
this.application.logger.warn(
|
|
201
|
+
this.application.logger.warn(this.application.i18n.defaulting_project_name());
|
|
221
202
|
project.name = "Documentation";
|
|
222
203
|
}
|
|
223
204
|
}
|
|
224
205
|
};
|
|
225
206
|
_PackagePlugin_readme_accessor_storage = new WeakMap();
|
|
226
|
-
_PackagePlugin_stripYamlFrontmatter_accessor_storage = new WeakMap();
|
|
227
207
|
_PackagePlugin_entryPointStrategy_accessor_storage = new WeakMap();
|
|
228
208
|
_PackagePlugin_entryPoints_accessor_storage = new WeakMap();
|
|
229
209
|
_PackagePlugin_includeVersion_accessor_storage = new WeakMap();
|
|
@@ -231,12 +211,10 @@ let PackagePlugin = (() => {
|
|
|
231
211
|
(() => {
|
|
232
212
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
233
213
|
_readme_decorators = [(0, utils_1.Option)("readme")];
|
|
234
|
-
_stripYamlFrontmatter_decorators = [(0, utils_1.Option)("stripYamlFrontmatter")];
|
|
235
214
|
_entryPointStrategy_decorators = [(0, utils_1.Option)("entryPointStrategy")];
|
|
236
215
|
_entryPoints_decorators = [(0, utils_1.Option)("entryPoints")];
|
|
237
216
|
_includeVersion_decorators = [(0, utils_1.Option)("includeVersion")];
|
|
238
217
|
__esDecorate(_classThis, null, _readme_decorators, { kind: "accessor", name: "readme", static: false, private: false, access: { has: obj => "readme" in obj, get: obj => obj.readme, set: (obj, value) => { obj.readme = value; } }, metadata: _metadata }, _readme_initializers, _readme_extraInitializers);
|
|
239
|
-
__esDecorate(_classThis, null, _stripYamlFrontmatter_decorators, { kind: "accessor", name: "stripYamlFrontmatter", static: false, private: false, access: { has: obj => "stripYamlFrontmatter" in obj, get: obj => obj.stripYamlFrontmatter, set: (obj, value) => { obj.stripYamlFrontmatter = value; } }, metadata: _metadata }, _stripYamlFrontmatter_initializers, _stripYamlFrontmatter_extraInitializers);
|
|
240
218
|
__esDecorate(_classThis, null, _entryPointStrategy_decorators, { kind: "accessor", name: "entryPointStrategy", static: false, private: false, access: { has: obj => "entryPointStrategy" in obj, get: obj => obj.entryPointStrategy, set: (obj, value) => { obj.entryPointStrategy = value; } }, metadata: _metadata }, _entryPointStrategy_initializers, _entryPointStrategy_extraInitializers);
|
|
241
219
|
__esDecorate(_classThis, null, _entryPoints_decorators, { kind: "accessor", name: "entryPoints", static: false, private: false, access: { has: obj => "entryPoints" in obj, get: obj => obj.entryPoints, set: (obj, value) => { obj.entryPoints = value; } }, metadata: _metadata }, _entryPoints_initializers, _entryPoints_extraInitializers);
|
|
242
220
|
__esDecorate(_classThis, null, _includeVersion_decorators, { kind: "accessor", name: "includeVersion", static: false, private: false, access: { has: obj => "includeVersion" in obj, get: obj => obj.includeVersion, set: (obj, value) => { obj.includeVersion = value; } }, metadata: _metadata }, _includeVersion_initializers, _includeVersion_extraInitializers);
|
|
@@ -186,13 +186,13 @@ let SourcePlugin = (() => {
|
|
|
186
186
|
if (this.disableSources)
|
|
187
187
|
return;
|
|
188
188
|
if (this.disableGit && !this.sourceLinkTemplate) {
|
|
189
|
-
this.application.logger.error(
|
|
189
|
+
this.application.logger.error(context.i18n.disable_git_set_but_not_source_link_template());
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
192
|
if (this.disableGit &&
|
|
193
193
|
this.sourceLinkTemplate.includes("{gitRevision}") &&
|
|
194
194
|
!this.gitRevision) {
|
|
195
|
-
this.application.logger.warn(
|
|
195
|
+
this.application.logger.warn(context.i18n.disable_git_set_and_git_revision_used());
|
|
196
196
|
}
|
|
197
197
|
const basePath = this.basePath || (0, utils_1.getCommonDirectory)([...this.fileNames]);
|
|
198
198
|
for (const id in context.project.reflections) {
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.convertSymbol =
|
|
6
|
+
exports.convertSymbol = convertSymbol;
|
|
7
7
|
const assert_1 = __importDefault(require("assert"));
|
|
8
8
|
const typescript_1 = __importDefault(require("typescript"));
|
|
9
9
|
const models_1 = require("../models");
|
|
@@ -14,6 +14,9 @@ const signature_1 = require("./factories/signature");
|
|
|
14
14
|
const jsdoc_1 = require("./jsdoc");
|
|
15
15
|
const nodes_1 = require("./utils/nodes");
|
|
16
16
|
const reflections_1 = require("./utils/reflections");
|
|
17
|
+
const path_1 = require("path");
|
|
18
|
+
const utils_1 = require("../utils");
|
|
19
|
+
const paths_1 = require("../utils/paths");
|
|
17
20
|
const symbolConverters = {
|
|
18
21
|
[typescript_1.default.SymbolFlags.RegularEnum]: convertEnum,
|
|
19
22
|
[typescript_1.default.SymbolFlags.ConstEnum]: convertEnum,
|
|
@@ -128,7 +131,6 @@ function convertSymbol(context, symbol, exportSymbol) {
|
|
|
128
131
|
skip |= symbolConverters[flag]?.(context, symbol, exportSymbol) || 0;
|
|
129
132
|
}
|
|
130
133
|
}
|
|
131
|
-
exports.convertSymbol = convertSymbol;
|
|
132
134
|
function convertSymbols(context, symbols) {
|
|
133
135
|
for (const symbol of symbols) {
|
|
134
136
|
convertSymbol(context, symbol);
|
|
@@ -178,6 +180,28 @@ function convertNamespace(context, symbol, exportSymbol) {
|
|
|
178
180
|
else {
|
|
179
181
|
reflection = context.createDeclarationReflection(models_1.ReflectionKind.Namespace, symbol, exportSymbol);
|
|
180
182
|
context.finalizeDeclarationReflection(reflection);
|
|
183
|
+
let relativeTo = reflection.comment?.sourcePath;
|
|
184
|
+
if (relativeTo) {
|
|
185
|
+
relativeTo = (0, path_1.dirname)(relativeTo);
|
|
186
|
+
const tags = reflection.comment?.getTags("@document") || [];
|
|
187
|
+
reflection.comment?.removeTags("@document");
|
|
188
|
+
for (const tag of tags) {
|
|
189
|
+
const path = models_1.Comment.combineDisplayParts(tag.content);
|
|
190
|
+
let file;
|
|
191
|
+
try {
|
|
192
|
+
const resolved = (0, path_1.resolve)(relativeTo, path);
|
|
193
|
+
file = new utils_1.MinimalSourceFile((0, utils_1.readFile)(resolved), resolved);
|
|
194
|
+
}
|
|
195
|
+
catch {
|
|
196
|
+
context.logger.warn(context.logger.i18n.failed_to_read_0_when_processing_document_tag_in_1((0, paths_1.nicePath)(path), (0, paths_1.nicePath)(reflection.comment.sourcePath)));
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
const { content, frontmatter } = context.converter.parseRawComment(file);
|
|
200
|
+
const docRefl = new models_1.DocumentReflection((0, path_1.basename)(file.fileName).replace(/\.[^.]+$/, ""), reflection, content, frontmatter);
|
|
201
|
+
reflection.addChild(docRefl);
|
|
202
|
+
context.project.registerReflection(docRefl);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
181
205
|
}
|
|
182
206
|
convertSymbols(context.withScope(reflection), context.checker
|
|
183
207
|
.getExportsOfModule(symbol)
|
|
@@ -218,7 +242,7 @@ function convertTypeAliasAsInterface(context, symbol, exportSymbol, declaration)
|
|
|
218
242
|
const rc = context.withScope(reflection);
|
|
219
243
|
const type = context.checker.getTypeAtLocation(declaration);
|
|
220
244
|
if (type.getFlags() & typescript_1.default.TypeFlags.Union) {
|
|
221
|
-
context.logger.warn(
|
|
245
|
+
context.logger.warn(context.i18n.converting_union_as_interface(), declaration);
|
|
222
246
|
}
|
|
223
247
|
// Interfaces have properties
|
|
224
248
|
convertSymbols(rc, type.getProperties());
|
|
@@ -237,7 +261,7 @@ function convertTypeAliasAsInterface(context, symbol, exportSymbol, declaration)
|
|
|
237
261
|
// And maybe constructor signatures
|
|
238
262
|
convertConstructSignatures(rc, symbol);
|
|
239
263
|
// And finally, index signatures
|
|
240
|
-
(0, index_signature_1.
|
|
264
|
+
(0, index_signature_1.convertIndexSignatures)(rc, symbol);
|
|
241
265
|
}
|
|
242
266
|
function convertFunctionOrMethod(context, symbol, exportSymbol) {
|
|
243
267
|
// Can't just check method flag because this might be called for properties as well
|
|
@@ -277,8 +301,6 @@ function convertFunctionOrMethod(context, symbol, exportSymbol) {
|
|
|
277
301
|
}
|
|
278
302
|
context.finalizeDeclarationReflection(reflection);
|
|
279
303
|
const scope = context.withScope(reflection);
|
|
280
|
-
// Can't use zip here. We might have less declarations than signatures
|
|
281
|
-
// or less signatures than declarations.
|
|
282
304
|
for (const sig of signatures) {
|
|
283
305
|
(0, signature_1.createSignature)(scope, models_1.ReflectionKind.CallSignature, sig, symbol);
|
|
284
306
|
}
|
|
@@ -356,7 +378,7 @@ function convertClassOrInterface(context, symbol, exportSymbol) {
|
|
|
356
378
|
// but nobody has complained yet.
|
|
357
379
|
convertConstructSignatures(reflectionContext, symbol);
|
|
358
380
|
// And finally, index signatures
|
|
359
|
-
(0, index_signature_1.
|
|
381
|
+
(0, index_signature_1.convertIndexSignatures)(reflectionContext, symbol);
|
|
360
382
|
// Normally this shouldn't matter, unless someone did something with skipLibCheck on.
|
|
361
383
|
return typescript_1.default.SymbolFlags.Alias;
|
|
362
384
|
}
|
|
@@ -392,7 +414,6 @@ function convertProperty(context, symbol, exportSymbol) {
|
|
|
392
414
|
const reflection = context.createDeclarationReflection(context.scope.kindOf(models_1.ReflectionKind.VariableContainer)
|
|
393
415
|
? models_1.ReflectionKind.Variable
|
|
394
416
|
: models_1.ReflectionKind.Property, symbol, exportSymbol);
|
|
395
|
-
reflection.conversionFlags |= models_1.ConversionFlags.VariableOrPropertySource;
|
|
396
417
|
const declaration = symbol.getDeclarations()?.[0];
|
|
397
418
|
let parameterType;
|
|
398
419
|
if (declaration &&
|
|
@@ -559,7 +580,6 @@ function convertVariableAsFunction(context, symbol, exportSymbol) {
|
|
|
559
580
|
? models_1.ReflectionKind.Method
|
|
560
581
|
: models_1.ReflectionKind.Function, symbol, exportSymbol);
|
|
561
582
|
setModifiers(symbol, accessDeclaration, reflection);
|
|
562
|
-
reflection.conversionFlags |= models_1.ConversionFlags.VariableOrPropertySource;
|
|
563
583
|
context.finalizeDeclarationReflection(reflection);
|
|
564
584
|
const reflectionContext = context.withScope(reflection);
|
|
565
585
|
reflection.signatures ??= [];
|
|
@@ -591,7 +611,7 @@ function convertSymbolAsClass(context, symbol, exportSymbol) {
|
|
|
591
611
|
const rc = context.withScope(reflection);
|
|
592
612
|
context.finalizeDeclarationReflection(reflection);
|
|
593
613
|
if (!symbol.valueDeclaration) {
|
|
594
|
-
context.logger.error(
|
|
614
|
+
context.logger.error(context.i18n.converting_0_as_class_requires_value_declaration(symbol.name), symbol.declarations?.[0]);
|
|
595
615
|
return;
|
|
596
616
|
}
|
|
597
617
|
const type = context.checker.getTypeOfSymbolAtLocation(symbol, symbol.valueDeclaration);
|
|
@@ -622,7 +642,7 @@ function convertSymbolAsClass(context, symbol, exportSymbol) {
|
|
|
622
642
|
}
|
|
623
643
|
}
|
|
624
644
|
else {
|
|
625
|
-
context.logger.warn(
|
|
645
|
+
context.logger.warn(context.i18n.converting_0_as_class_without_construct_signatures(reflection.getFriendlyFullName()), symbol.valueDeclaration);
|
|
626
646
|
}
|
|
627
647
|
return (typescript_1.default.SymbolFlags.TypeAlias |
|
|
628
648
|
typescript_1.default.SymbolFlags.Interface |
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
-
import { SomeType } from "../models";
|
|
2
|
+
import { type SomeType } from "../models";
|
|
3
3
|
import type { Context } from "./context";
|
|
4
4
|
export interface TypeConverter<TNode extends ts.TypeNode = ts.TypeNode, TType extends ts.Type = ts.Type> {
|
|
5
5
|
kind: TNode["kind"][];
|
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.loadConverters = loadConverters;
|
|
7
|
+
exports.convertType = convertType;
|
|
7
8
|
const assert_1 = __importDefault(require("assert"));
|
|
8
9
|
const typescript_1 = __importDefault(require("typescript"));
|
|
9
10
|
const models_1 = require("../models");
|
|
@@ -61,7 +62,6 @@ function loadConverters() {
|
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
|
-
exports.loadConverters = loadConverters;
|
|
65
65
|
// This ought not be necessary, but we need some way to discover recursively
|
|
66
66
|
// typed symbols which do not have type nodes. See the `recursive` symbol in the variables test.
|
|
67
67
|
const seenTypes = new Set();
|
|
@@ -122,7 +122,6 @@ function convertType(context, typeOrNode) {
|
|
|
122
122
|
}
|
|
123
123
|
return requestBugReport(context, typeOrNode);
|
|
124
124
|
}
|
|
125
|
-
exports.convertType = convertType;
|
|
126
125
|
const arrayConverter = {
|
|
127
126
|
kind: [typescript_1.default.SyntaxKind.ArrayType],
|
|
128
127
|
convert(context, node) {
|
|
@@ -381,7 +380,7 @@ const typeLiteralConverter = {
|
|
|
381
380
|
for (const signature of type.getConstructSignatures()) {
|
|
382
381
|
(0, signature_1.createSignature)(rc, models_1.ReflectionKind.ConstructorSignature, signature, symbol);
|
|
383
382
|
}
|
|
384
|
-
(0, index_signature_1.
|
|
383
|
+
(0, index_signature_1.convertIndexSignatures)(rc, symbol);
|
|
385
384
|
return new models_1.ReflectionType(reflection);
|
|
386
385
|
},
|
|
387
386
|
convertType(context, type) {
|
|
@@ -399,7 +398,7 @@ const typeLiteralConverter = {
|
|
|
399
398
|
(0, signature_1.createSignature)(context.withScope(reflection), models_1.ReflectionKind.ConstructorSignature, signature, symbol);
|
|
400
399
|
}
|
|
401
400
|
if (symbol) {
|
|
402
|
-
(0, index_signature_1.
|
|
401
|
+
(0, index_signature_1.convertIndexSignatures)(context.withScope(reflection), symbol);
|
|
403
402
|
}
|
|
404
403
|
return new models_1.ReflectionType(reflection);
|
|
405
404
|
},
|
|
@@ -453,7 +452,13 @@ const referenceConverter = {
|
|
|
453
452
|
return ref;
|
|
454
453
|
}
|
|
455
454
|
const ref = models_1.ReferenceType.createSymbolReference(context.resolveAliasedSymbol(symbol), context);
|
|
456
|
-
if (type.flags & typescript_1.default.TypeFlags.
|
|
455
|
+
if (type.flags & typescript_1.default.TypeFlags.Substitution) {
|
|
456
|
+
// NoInfer<T>
|
|
457
|
+
ref.typeArguments = [
|
|
458
|
+
convertType(context, type.baseType),
|
|
459
|
+
];
|
|
460
|
+
}
|
|
461
|
+
else if (type.flags & typescript_1.default.TypeFlags.StringMapping) {
|
|
457
462
|
ref.typeArguments = [
|
|
458
463
|
convertType(context, type.type),
|
|
459
464
|
];
|
|
@@ -3,13 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.isNamedNode = isNamedNode;
|
|
7
|
+
exports.getHeritageTypes = getHeritageTypes;
|
|
8
|
+
exports.isObjectType = isObjectType;
|
|
7
9
|
const typescript_1 = __importDefault(require("typescript"));
|
|
8
10
|
function isNamedNode(node) {
|
|
9
11
|
const name = node.name;
|
|
10
12
|
return !!name && (typescript_1.default.isMemberName(name) || typescript_1.default.isComputedPropertyName(name));
|
|
11
13
|
}
|
|
12
|
-
exports.isNamedNode = isNamedNode;
|
|
13
14
|
function getHeritageTypes(declarations, kind) {
|
|
14
15
|
const exprs = declarations.flatMap((d) => (d.heritageClauses ?? [])
|
|
15
16
|
.filter((hc) => hc.token === kind)
|
|
@@ -24,8 +25,6 @@ function getHeritageTypes(declarations, kind) {
|
|
|
24
25
|
return true;
|
|
25
26
|
});
|
|
26
27
|
}
|
|
27
|
-
exports.getHeritageTypes = getHeritageTypes;
|
|
28
28
|
function isObjectType(type) {
|
|
29
29
|
return typeof type.objectFlags === "number";
|
|
30
30
|
}
|
|
31
|
-
exports.isObjectType = isObjectType;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SomeType } from "../../models";
|
|
1
|
+
import { type SomeType } from "../../models";
|
|
2
2
|
export declare function removeUndefined(type: SomeType): SomeType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeUndefined =
|
|
3
|
+
exports.removeUndefined = removeUndefined;
|
|
4
4
|
const models_1 = require("../../models");
|
|
5
5
|
function removeUndefined(type) {
|
|
6
6
|
if (type instanceof models_1.UnionType) {
|
|
@@ -18,4 +18,3 @@ function removeUndefined(type) {
|
|
|
18
18
|
}
|
|
19
19
|
return type;
|
|
20
20
|
}
|
|
21
|
-
exports.removeUndefined = removeUndefined;
|