typescript 4.8.0-dev.20220509 → 4.8.0-dev.20220512
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/lib/cs/diagnosticMessages.generated.json +1 -0
- package/lib/de/diagnosticMessages.generated.json +1 -0
- package/lib/es/diagnosticMessages.generated.json +1 -0
- package/lib/fr/diagnosticMessages.generated.json +1 -0
- package/lib/it/diagnosticMessages.generated.json +1 -0
- package/lib/ja/diagnosticMessages.generated.json +1 -0
- package/lib/ko/diagnosticMessages.generated.json +1 -0
- package/lib/lib.es2020.intl.d.ts +29 -5
- package/lib/lib.es2021.intl.d.ts +7 -3
- package/lib/lib.esnext.intl.d.ts +5 -1
- package/lib/pl/diagnosticMessages.generated.json +1 -0
- package/lib/pt-br/diagnosticMessages.generated.json +1 -0
- package/lib/ru/diagnosticMessages.generated.json +1 -0
- package/lib/tr/diagnosticMessages.generated.json +1 -0
- package/lib/tsc.js +142 -42
- package/lib/tsserver.js +172 -56
- package/lib/tsserverlibrary.d.ts +8 -5
- package/lib/tsserverlibrary.js +172 -56
- package/lib/typescript.d.ts +8 -5
- package/lib/typescript.js +172 -56
- package/lib/typescriptServices.d.ts +8 -5
- package/lib/typescriptServices.js +172 -56
- package/lib/typingsInstaller.js +149 -44
- package/lib/zh-cn/diagnosticMessages.generated.json +1 -0
- package/lib/zh-tw/diagnosticMessages.generated.json +1 -0
- package/package.json +1 -1
package/lib/tsserver.js
CHANGED
|
@@ -100,7 +100,7 @@ var ts;
|
|
|
100
100
|
// The following is baselined as a literal template type without intervention
|
|
101
101
|
/** The version of the TypeScript compiler release */
|
|
102
102
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
103
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
103
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220512";
|
|
104
104
|
/* @internal */
|
|
105
105
|
var Comparison;
|
|
106
106
|
(function (Comparison) {
|
|
@@ -8142,6 +8142,7 @@ var ts;
|
|
|
8142
8142
|
String_literal_expected: diag(1141, ts.DiagnosticCategory.Error, "String_literal_expected_1141", "String literal expected."),
|
|
8143
8143
|
Line_break_not_permitted_here: diag(1142, ts.DiagnosticCategory.Error, "Line_break_not_permitted_here_1142", "Line break not permitted here."),
|
|
8144
8144
|
or_expected: diag(1144, ts.DiagnosticCategory.Error, "or_expected_1144", "'{' or ';' expected."),
|
|
8145
|
+
or_JSX_element_expected: diag(1145, ts.DiagnosticCategory.Error, "or_JSX_element_expected_1145", "'{' or JSX element expected."),
|
|
8145
8146
|
Declaration_expected: diag(1146, ts.DiagnosticCategory.Error, "Declaration_expected_1146", "Declaration expected."),
|
|
8146
8147
|
Import_declarations_in_a_namespace_cannot_reference_a_module: diag(1147, ts.DiagnosticCategory.Error, "Import_declarations_in_a_namespace_cannot_reference_a_module_1147", "Import declarations in a namespace cannot reference a module."),
|
|
8147
8148
|
Cannot_use_imports_exports_or_module_augmentations_when_module_is_none: diag(1148, ts.DiagnosticCategory.Error, "Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148", "Cannot use imports, exports, or module augmentations when '--module' is 'none'."),
|
|
@@ -8394,6 +8395,7 @@ var ts;
|
|
|
8394
8395
|
resolution_mode_can_only_be_set_for_type_only_imports: diag(1454, ts.DiagnosticCategory.Error, "resolution_mode_can_only_be_set_for_type_only_imports_1454", "`resolution-mode` can only be set for type-only imports."),
|
|
8395
8396
|
resolution_mode_is_the_only_valid_key_for_type_import_assertions: diag(1455, ts.DiagnosticCategory.Error, "resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455", "`resolution-mode` is the only valid key for type import assertions."),
|
|
8396
8397
|
Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require: diag(1456, ts.DiagnosticCategory.Error, "Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1456", "Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`."),
|
|
8398
|
+
Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk: diag(1457, ts.DiagnosticCategory.Message, "Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk_1457", "Matched by default include pattern '**/*'"),
|
|
8397
8399
|
The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470", "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),
|
|
8398
8400
|
Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead: diag(1471, ts.DiagnosticCategory.Error, "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471", "Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead."),
|
|
8399
8401
|
catch_or_finally_expected: diag(1472, ts.DiagnosticCategory.Error, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
@@ -14073,6 +14075,16 @@ var ts;
|
|
|
14073
14075
|
return node.kind === 324 /* JSDocLink */ || node.kind === 325 /* JSDocLinkCode */ || node.kind === 326 /* JSDocLinkPlain */;
|
|
14074
14076
|
}
|
|
14075
14077
|
ts.isJSDocLinkLike = isJSDocLinkLike;
|
|
14078
|
+
function hasRestParameter(s) {
|
|
14079
|
+
var last = ts.lastOrUndefined(s.parameters);
|
|
14080
|
+
return !!last && isRestParameter(last);
|
|
14081
|
+
}
|
|
14082
|
+
ts.hasRestParameter = hasRestParameter;
|
|
14083
|
+
function isRestParameter(node) {
|
|
14084
|
+
var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type;
|
|
14085
|
+
return node.dotDotDotToken !== undefined || !!type && type.kind === 318 /* JSDocVariadicType */;
|
|
14086
|
+
}
|
|
14087
|
+
ts.isRestParameter = isRestParameter;
|
|
14076
14088
|
// #endregion
|
|
14077
14089
|
})(ts || (ts = {}));
|
|
14078
14090
|
/* @internal */
|
|
@@ -16843,16 +16855,6 @@ var ts;
|
|
|
16843
16855
|
return typeParameters && ts.find(typeParameters, function (p) { return p.name.escapedText === name; });
|
|
16844
16856
|
}
|
|
16845
16857
|
ts.getTypeParameterFromJsDoc = getTypeParameterFromJsDoc;
|
|
16846
|
-
function hasRestParameter(s) {
|
|
16847
|
-
var last = ts.lastOrUndefined(s.parameters);
|
|
16848
|
-
return !!last && isRestParameter(last);
|
|
16849
|
-
}
|
|
16850
|
-
ts.hasRestParameter = hasRestParameter;
|
|
16851
|
-
function isRestParameter(node) {
|
|
16852
|
-
var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type;
|
|
16853
|
-
return node.dotDotDotToken !== undefined || !!type && type.kind === 318 /* JSDocVariadicType */;
|
|
16854
|
-
}
|
|
16855
|
-
ts.isRestParameter = isRestParameter;
|
|
16856
16858
|
function hasTypeArguments(node) {
|
|
16857
16859
|
return !!node.typeArguments;
|
|
16858
16860
|
}
|
|
@@ -34382,6 +34384,10 @@ var ts;
|
|
|
34382
34384
|
// isn't actually allowed, but we want to treat it as a lambda so we can provide
|
|
34383
34385
|
// a good error message.
|
|
34384
34386
|
if (ts.isModifierKind(second) && second !== 131 /* AsyncKeyword */ && lookAhead(nextTokenIsIdentifier)) {
|
|
34387
|
+
if (nextToken() === 127 /* AsKeyword */) {
|
|
34388
|
+
// https://github.com/microsoft/TypeScript/issues/44466
|
|
34389
|
+
return 0 /* False */;
|
|
34390
|
+
}
|
|
34385
34391
|
return 1 /* True */;
|
|
34386
34392
|
}
|
|
34387
34393
|
// If we had "(" followed by something that's not an identifier,
|
|
@@ -35197,9 +35203,22 @@ var ts;
|
|
|
35197
35203
|
}
|
|
35198
35204
|
scanJsxIdentifier();
|
|
35199
35205
|
var pos = getNodePos();
|
|
35200
|
-
return finishNode(factory.createJsxAttribute(parseIdentifierName(),
|
|
35201
|
-
|
|
35202
|
-
|
|
35206
|
+
return finishNode(factory.createJsxAttribute(parseIdentifierName(), parseJsxAttributeValue()), pos);
|
|
35207
|
+
}
|
|
35208
|
+
function parseJsxAttributeValue() {
|
|
35209
|
+
if (token() === 63 /* EqualsToken */) {
|
|
35210
|
+
if (scanJsxAttributeValue() === 10 /* StringLiteral */) {
|
|
35211
|
+
return parseLiteralNode();
|
|
35212
|
+
}
|
|
35213
|
+
if (token() === 18 /* OpenBraceToken */) {
|
|
35214
|
+
return parseJsxExpression(/*inExpressionContext*/ true);
|
|
35215
|
+
}
|
|
35216
|
+
if (token() === 29 /* LessThanToken */) {
|
|
35217
|
+
return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true);
|
|
35218
|
+
}
|
|
35219
|
+
parseErrorAtCurrentToken(ts.Diagnostics.or_JSX_element_expected);
|
|
35220
|
+
}
|
|
35221
|
+
return undefined;
|
|
35203
35222
|
}
|
|
35204
35223
|
function parseJsxSpreadAttribute() {
|
|
35205
35224
|
var pos = getNodePos();
|
|
@@ -40971,7 +40990,7 @@ var ts;
|
|
|
40971
40990
|
return undefined;
|
|
40972
40991
|
if (ts.length(specs) !== 1)
|
|
40973
40992
|
return specs;
|
|
40974
|
-
if (specs[0] ===
|
|
40993
|
+
if (specs[0] === ts.defaultIncludeSpec)
|
|
40975
40994
|
return undefined;
|
|
40976
40995
|
return specs;
|
|
40977
40996
|
}
|
|
@@ -41249,6 +41268,8 @@ var ts;
|
|
|
41249
41268
|
// until consistent casing errors are reported
|
|
41250
41269
|
return ts.getDirectoryPath(ts.getNormalizedAbsolutePath(fileName, basePath));
|
|
41251
41270
|
}
|
|
41271
|
+
/*@internal*/
|
|
41272
|
+
ts.defaultIncludeSpec = "**/*";
|
|
41252
41273
|
/**
|
|
41253
41274
|
* Parse the contents of a config file from json or json source file (tsconfig.json).
|
|
41254
41275
|
* @param json The contents of the config file to parse
|
|
@@ -41314,6 +41335,7 @@ var ts;
|
|
|
41314
41335
|
}
|
|
41315
41336
|
var includeSpecs = toPropValue(getSpecsFromRaw("include"));
|
|
41316
41337
|
var excludeOfRaw = getSpecsFromRaw("exclude");
|
|
41338
|
+
var isDefaultIncludeSpec = false;
|
|
41317
41339
|
var excludeSpecs = toPropValue(excludeOfRaw);
|
|
41318
41340
|
if (excludeOfRaw === "no-prop" && raw.compilerOptions) {
|
|
41319
41341
|
var outDir = raw.compilerOptions.outDir;
|
|
@@ -41323,7 +41345,8 @@ var ts;
|
|
|
41323
41345
|
}
|
|
41324
41346
|
}
|
|
41325
41347
|
if (filesSpecs === undefined && includeSpecs === undefined) {
|
|
41326
|
-
includeSpecs = [
|
|
41348
|
+
includeSpecs = [ts.defaultIncludeSpec];
|
|
41349
|
+
isDefaultIncludeSpec = true;
|
|
41327
41350
|
}
|
|
41328
41351
|
var validatedIncludeSpecs, validatedExcludeSpecs;
|
|
41329
41352
|
// The exclude spec list is converted into a regular expression, which allows us to quickly
|
|
@@ -41342,7 +41365,8 @@ var ts;
|
|
|
41342
41365
|
validatedFilesSpec: ts.filter(filesSpecs, ts.isString),
|
|
41343
41366
|
validatedIncludeSpecs: validatedIncludeSpecs,
|
|
41344
41367
|
validatedExcludeSpecs: validatedExcludeSpecs,
|
|
41345
|
-
pathPatterns: undefined,
|
|
41368
|
+
pathPatterns: undefined,
|
|
41369
|
+
isDefaultIncludeSpec: isDefaultIncludeSpec,
|
|
41346
41370
|
};
|
|
41347
41371
|
}
|
|
41348
41372
|
function getFileNames(basePath) {
|
|
@@ -51467,8 +51491,9 @@ var ts;
|
|
|
51467
51491
|
function getExportSymbolOfValueSymbolIfExported(symbol) {
|
|
51468
51492
|
return getMergedSymbol(symbol && (symbol.flags & 1048576 /* ExportValue */) !== 0 && symbol.exportSymbol || symbol);
|
|
51469
51493
|
}
|
|
51470
|
-
function symbolIsValue(symbol) {
|
|
51471
|
-
return !!(symbol.flags & 111551 /* Value */ ||
|
|
51494
|
+
function symbolIsValue(symbol, includeTypeOnlyMembers) {
|
|
51495
|
+
return !!(symbol.flags & 111551 /* Value */ ||
|
|
51496
|
+
symbol.flags & 2097152 /* Alias */ && resolveAlias(symbol).flags & 111551 /* Value */ && (includeTypeOnlyMembers || !getTypeOnlyAliasDeclaration(symbol)));
|
|
51472
51497
|
}
|
|
51473
51498
|
function findConstructorDeclaration(node) {
|
|
51474
51499
|
var members = node.members;
|
|
@@ -59158,12 +59183,12 @@ var ts;
|
|
|
59158
59183
|
* @param type a type to look up property from
|
|
59159
59184
|
* @param name a name of property to look up in a given type
|
|
59160
59185
|
*/
|
|
59161
|
-
function getPropertyOfType(type, name, skipObjectFunctionPropertyAugment) {
|
|
59186
|
+
function getPropertyOfType(type, name, skipObjectFunctionPropertyAugment, includeTypeOnlyMembers) {
|
|
59162
59187
|
type = getReducedApparentType(type);
|
|
59163
59188
|
if (type.flags & 524288 /* Object */) {
|
|
59164
59189
|
var resolved = resolveStructuredTypeMembers(type);
|
|
59165
59190
|
var symbol = resolved.members.get(name);
|
|
59166
|
-
if (symbol && symbolIsValue(symbol)) {
|
|
59191
|
+
if (symbol && symbolIsValue(symbol, includeTypeOnlyMembers)) {
|
|
59167
59192
|
return symbol;
|
|
59168
59193
|
}
|
|
59169
59194
|
if (skipObjectFunctionPropertyAugment)
|
|
@@ -62543,7 +62568,7 @@ var ts;
|
|
|
62543
62568
|
// the `exports` lookup process that only looks up namespace members which is used for most type references
|
|
62544
62569
|
var mergedResolvedSymbol = getMergedSymbol(resolveSymbol(currentNamespace));
|
|
62545
62570
|
var next = node.isTypeOf
|
|
62546
|
-
? getPropertyOfType(getTypeOfSymbol(mergedResolvedSymbol), current.escapedText)
|
|
62571
|
+
? getPropertyOfType(getTypeOfSymbol(mergedResolvedSymbol), current.escapedText, /*skipObjectFunctionPropertyAugment*/ false, /*includeTypeOnlyMembers*/ true)
|
|
62547
62572
|
: getSymbol(getExportsOfSymbol(mergedResolvedSymbol), current.escapedText, meaning);
|
|
62548
62573
|
if (!next) {
|
|
62549
62574
|
error(current, ts.Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName(currentNamespace), ts.declarationNameToString(current));
|
|
@@ -65465,6 +65490,20 @@ var ts;
|
|
|
65465
65490
|
}
|
|
65466
65491
|
}
|
|
65467
65492
|
}
|
|
65493
|
+
if (relation === comparableRelation && sourceFlags & 262144 /* TypeParameter */) {
|
|
65494
|
+
// This is a carve-out in comparability to essentially forbid comparing a type parameter
|
|
65495
|
+
// with another type parameter unless one extends the other. (Remember: comparability is mostly bidirectional!)
|
|
65496
|
+
var constraint = getConstraintOfTypeParameter(source);
|
|
65497
|
+
if (constraint && hasNonCircularBaseConstraint(source)) {
|
|
65498
|
+
while (constraint && constraint.flags & 262144 /* TypeParameter */) {
|
|
65499
|
+
if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false)) {
|
|
65500
|
+
return result;
|
|
65501
|
+
}
|
|
65502
|
+
constraint = getConstraintOfTypeParameter(constraint);
|
|
65503
|
+
}
|
|
65504
|
+
}
|
|
65505
|
+
return 0 /* False */;
|
|
65506
|
+
}
|
|
65468
65507
|
}
|
|
65469
65508
|
else if (targetFlags & 4194304 /* Index */) {
|
|
65470
65509
|
var targetType_1 = target.type;
|
|
@@ -65668,8 +65707,8 @@ var ts;
|
|
|
65668
65707
|
if (sourceFlags & 8650752 /* TypeVariable */) {
|
|
65669
65708
|
// IndexedAccess comparisons are handled above in the `targetFlags & TypeFlage.IndexedAccess` branch
|
|
65670
65709
|
if (!(sourceFlags & 8388608 /* IndexedAccess */ && targetFlags & 8388608 /* IndexedAccess */)) {
|
|
65671
|
-
var constraint = getConstraintOfType(source);
|
|
65672
|
-
if (!
|
|
65710
|
+
var constraint = getConstraintOfType(source) || unknownType;
|
|
65711
|
+
if (!getConstraintOfType(source) || (sourceFlags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */)) {
|
|
65673
65712
|
// A type variable with no constraint is not related to the non-primitive object type.
|
|
65674
65713
|
if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864 /* NonPrimitive */), 3 /* Both */)) {
|
|
65675
65714
|
resetErrorInfo(saveErrorInfo);
|
|
@@ -65677,12 +65716,12 @@ var ts;
|
|
|
65677
65716
|
}
|
|
65678
65717
|
}
|
|
65679
65718
|
// hi-speed no-this-instantiation check (less accurate, but avoids costly `this`-instantiation when the constraint will suffice), see #28231 for report on why this is needed
|
|
65680
|
-
|
|
65719
|
+
if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
|
|
65681
65720
|
resetErrorInfo(saveErrorInfo);
|
|
65682
65721
|
return result;
|
|
65683
65722
|
}
|
|
65684
65723
|
// slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example
|
|
65685
|
-
else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && !(targetFlags & sourceFlags & 262144 /* TypeParameter */), /*headMessage*/ undefined, intersectionState)) {
|
|
65724
|
+
else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && constraint !== unknownType && !(targetFlags & sourceFlags & 262144 /* TypeParameter */), /*headMessage*/ undefined, intersectionState)) {
|
|
65686
65725
|
resetErrorInfo(saveErrorInfo);
|
|
65687
65726
|
return result;
|
|
65688
65727
|
}
|
|
@@ -72519,7 +72558,25 @@ var ts;
|
|
|
72519
72558
|
}
|
|
72520
72559
|
function getTypeOfPropertyOfContextualType(type, name, nameType) {
|
|
72521
72560
|
return mapType(type, function (t) {
|
|
72522
|
-
|
|
72561
|
+
if (t.flags & 2097152 /* Intersection */) {
|
|
72562
|
+
var intersection = t;
|
|
72563
|
+
var newTypes = ts.mapDefined(intersection.types, getTypeOfConcretePropertyOfContextualType);
|
|
72564
|
+
if (newTypes.length > 0) {
|
|
72565
|
+
return getIntersectionType(newTypes);
|
|
72566
|
+
}
|
|
72567
|
+
newTypes = ts.mapDefined(intersection.types, getTypeOfApplicableIndexInfoOfContextualType);
|
|
72568
|
+
if (newTypes.length > 0) {
|
|
72569
|
+
return getIntersectionType(newTypes);
|
|
72570
|
+
}
|
|
72571
|
+
return undefined;
|
|
72572
|
+
}
|
|
72573
|
+
var concretePropertyType = getTypeOfConcretePropertyOfContextualType(t);
|
|
72574
|
+
if (concretePropertyType) {
|
|
72575
|
+
return concretePropertyType;
|
|
72576
|
+
}
|
|
72577
|
+
return getTypeOfApplicableIndexInfoOfContextualType(t);
|
|
72578
|
+
}, /*noReductions*/ true);
|
|
72579
|
+
function getTypeOfConcretePropertyOfContextualType(t) {
|
|
72523
72580
|
if (isGenericMappedType(t) && !t.declaration.nameType) {
|
|
72524
72581
|
var constraint = getConstraintTypeFromMappedType(t);
|
|
72525
72582
|
var constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
|
|
@@ -72527,8 +72584,9 @@ var ts;
|
|
|
72527
72584
|
if (isTypeAssignableTo(propertyNameType, constraintOfConstraint)) {
|
|
72528
72585
|
return substituteIndexedMappedType(t, propertyNameType);
|
|
72529
72586
|
}
|
|
72587
|
+
return undefined;
|
|
72530
72588
|
}
|
|
72531
|
-
|
|
72589
|
+
if (t.flags & 3670016 /* StructuredType */) {
|
|
72532
72590
|
var prop = getPropertyOfType(t, name);
|
|
72533
72591
|
if (prop) {
|
|
72534
72592
|
return isCircularMappedProperty(prop) ? undefined : getTypeOfSymbol(prop);
|
|
@@ -72539,10 +72597,16 @@ var ts;
|
|
|
72539
72597
|
return restType;
|
|
72540
72598
|
}
|
|
72541
72599
|
}
|
|
72542
|
-
return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(ts.unescapeLeadingUnderscores(name)))) === null || _a === void 0 ? void 0 : _a.type;
|
|
72543
72600
|
}
|
|
72544
72601
|
return undefined;
|
|
72545
|
-
}
|
|
72602
|
+
}
|
|
72603
|
+
function getTypeOfApplicableIndexInfoOfContextualType(t) {
|
|
72604
|
+
var _a;
|
|
72605
|
+
if (!(t.flags & 3670016 /* StructuredType */)) {
|
|
72606
|
+
return undefined;
|
|
72607
|
+
}
|
|
72608
|
+
return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(ts.unescapeLeadingUnderscores(name)))) === null || _a === void 0 ? void 0 : _a.type;
|
|
72609
|
+
}
|
|
72546
72610
|
}
|
|
72547
72611
|
// In an object literal contextually typed by a type T, the contextual type of a property assignment is the type of
|
|
72548
72612
|
// the matching property in T, if one exists. Otherwise, it is the type of the numeric index signature in T, if one
|
|
@@ -74420,9 +74484,8 @@ var ts;
|
|
|
74420
74484
|
markAliasReferenced(parentSymbol, node);
|
|
74421
74485
|
}
|
|
74422
74486
|
return isErrorType(apparentType) ? errorType : apparentType;
|
|
74423
|
-
;
|
|
74424
74487
|
}
|
|
74425
|
-
prop = getPropertyOfType(apparentType, right.escapedText);
|
|
74488
|
+
prop = getPropertyOfType(apparentType, right.escapedText, /*skipObjectFunctionPropertyAugment*/ false, /*includeTypeOnlyMembers*/ node.kind === 161 /* QualifiedName */);
|
|
74426
74489
|
}
|
|
74427
74490
|
// In `Foo.Bar.Baz`, 'Foo' is not referenced if 'Bar' is a const enum or a module containing only const enums.
|
|
74428
74491
|
// `Foo` is also not referenced in `enum FooCopy { Bar = Foo.Bar }`, because the enum member value gets inlined
|
|
@@ -81016,7 +81079,7 @@ var ts;
|
|
|
81016
81079
|
* @param type The type of the promise.
|
|
81017
81080
|
* @remarks The "promised type" of a type is the type of the "value" parameter of the "onfulfilled" callback.
|
|
81018
81081
|
*/
|
|
81019
|
-
function getPromisedTypeOfPromise(type, errorNode) {
|
|
81082
|
+
function getPromisedTypeOfPromise(type, errorNode, thisTypeForErrorOut) {
|
|
81020
81083
|
//
|
|
81021
81084
|
// { // type
|
|
81022
81085
|
// then( // thenFunction
|
|
@@ -81051,7 +81114,29 @@ var ts;
|
|
|
81051
81114
|
}
|
|
81052
81115
|
return undefined;
|
|
81053
81116
|
}
|
|
81054
|
-
var
|
|
81117
|
+
var thisTypeForError;
|
|
81118
|
+
var candidates;
|
|
81119
|
+
for (var _i = 0, thenSignatures_1 = thenSignatures; _i < thenSignatures_1.length; _i++) {
|
|
81120
|
+
var thenSignature = thenSignatures_1[_i];
|
|
81121
|
+
var thisType = getThisTypeOfSignature(thenSignature);
|
|
81122
|
+
if (thisType && thisType !== voidType && !isTypeRelatedTo(type, thisType, subtypeRelation)) {
|
|
81123
|
+
thisTypeForError = thisType;
|
|
81124
|
+
}
|
|
81125
|
+
else {
|
|
81126
|
+
candidates = ts.append(candidates, thenSignature);
|
|
81127
|
+
}
|
|
81128
|
+
}
|
|
81129
|
+
if (!candidates) {
|
|
81130
|
+
ts.Debug.assertIsDefined(thisTypeForError);
|
|
81131
|
+
if (thisTypeForErrorOut) {
|
|
81132
|
+
thisTypeForErrorOut.value = thisTypeForError;
|
|
81133
|
+
}
|
|
81134
|
+
if (errorNode) {
|
|
81135
|
+
error(errorNode, ts.Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1, typeToString(type), typeToString(thisTypeForError));
|
|
81136
|
+
}
|
|
81137
|
+
return undefined;
|
|
81138
|
+
}
|
|
81139
|
+
var onfulfilledParameterType = getTypeWithFacts(getUnionType(ts.map(candidates, getTypeOfFirstParameterOfSignature)), 2097152 /* NEUndefinedOrNull */);
|
|
81055
81140
|
if (isTypeAny(onfulfilledParameterType)) {
|
|
81056
81141
|
return undefined;
|
|
81057
81142
|
}
|
|
@@ -81175,7 +81260,8 @@ var ts;
|
|
|
81175
81260
|
var mapper = errorNode ? function (constituentType) { return getAwaitedTypeNoAlias(constituentType, errorNode, diagnosticMessage, arg0); } : getAwaitedTypeNoAlias;
|
|
81176
81261
|
return typeAsAwaitable.awaitedTypeOfType = mapType(type, mapper);
|
|
81177
81262
|
}
|
|
81178
|
-
var
|
|
81263
|
+
var thisTypeForErrorOut = { value: undefined };
|
|
81264
|
+
var promisedType = getPromisedTypeOfPromise(type, /*errorNode*/ undefined, thisTypeForErrorOut);
|
|
81179
81265
|
if (promisedType) {
|
|
81180
81266
|
if (type.id === promisedType.id || awaitedTypeStack.lastIndexOf(promisedType.id) >= 0) {
|
|
81181
81267
|
// Verify that we don't have a bad actor in the form of a promise whose
|
|
@@ -81244,7 +81330,12 @@ var ts;
|
|
|
81244
81330
|
if (isThenableType(type)) {
|
|
81245
81331
|
if (errorNode) {
|
|
81246
81332
|
ts.Debug.assertIsDefined(diagnosticMessage);
|
|
81247
|
-
|
|
81333
|
+
var chain = void 0;
|
|
81334
|
+
if (thisTypeForErrorOut.value) {
|
|
81335
|
+
chain = ts.chainDiagnosticMessages(chain, ts.Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1, typeToString(type), typeToString(thisTypeForErrorOut.value));
|
|
81336
|
+
}
|
|
81337
|
+
chain = ts.chainDiagnosticMessages(chain, diagnosticMessage, arg0);
|
|
81338
|
+
diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(errorNode, chain));
|
|
81248
81339
|
}
|
|
81249
81340
|
return undefined;
|
|
81250
81341
|
}
|
|
@@ -97732,22 +97823,29 @@ var ts;
|
|
|
97732
97823
|
if (node === undefined) {
|
|
97733
97824
|
return factory.createTrue();
|
|
97734
97825
|
}
|
|
97735
|
-
|
|
97826
|
+
if (node.kind === 10 /* StringLiteral */) {
|
|
97736
97827
|
// Always recreate the literal to escape any escape sequences or newlines which may be in the original jsx string and which
|
|
97737
97828
|
// Need to be escaped to be handled correctly in a normal string
|
|
97738
97829
|
var singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile);
|
|
97739
97830
|
var literal = factory.createStringLiteral(tryDecodeEntities(node.text) || node.text, singleQuote);
|
|
97740
97831
|
return ts.setTextRange(literal, node);
|
|
97741
97832
|
}
|
|
97742
|
-
|
|
97833
|
+
if (node.kind === 288 /* JsxExpression */) {
|
|
97743
97834
|
if (node.expression === undefined) {
|
|
97744
97835
|
return factory.createTrue();
|
|
97745
97836
|
}
|
|
97746
97837
|
return ts.visitNode(node.expression, visitor, ts.isExpression);
|
|
97747
97838
|
}
|
|
97748
|
-
|
|
97749
|
-
return
|
|
97839
|
+
if (ts.isJsxElement(node)) {
|
|
97840
|
+
return visitJsxElement(node, /*isChild*/ false);
|
|
97841
|
+
}
|
|
97842
|
+
if (ts.isJsxSelfClosingElement(node)) {
|
|
97843
|
+
return visitJsxSelfClosingElement(node, /*isChild*/ false);
|
|
97750
97844
|
}
|
|
97845
|
+
if (ts.isJsxFragment(node)) {
|
|
97846
|
+
return visitJsxFragment(node, /*isChild*/ false);
|
|
97847
|
+
}
|
|
97848
|
+
return ts.Debug.failBadSyntaxKind(node);
|
|
97751
97849
|
}
|
|
97752
97850
|
function visitJsxText(node) {
|
|
97753
97851
|
var fixed = fixupWhitespaceAndDecodeEntities(node.text);
|
|
@@ -118762,7 +118860,7 @@ var ts;
|
|
|
118762
118860
|
}
|
|
118763
118861
|
var matchedByInclude = ts.getMatchedIncludeSpec(program, fileName);
|
|
118764
118862
|
// Could be additional files specified as roots
|
|
118765
|
-
if (!matchedByInclude)
|
|
118863
|
+
if (!matchedByInclude || !ts.isString(matchedByInclude))
|
|
118766
118864
|
return undefined;
|
|
118767
118865
|
configFileNode = ts.getTsConfigPropArrayElementValue(options.configFile, "include", matchedByInclude);
|
|
118768
118866
|
message = ts.Diagnostics.File_is_matched_by_include_pattern_specified_here;
|
|
@@ -122360,6 +122458,8 @@ var ts;
|
|
|
122360
122458
|
if (ts.fileExtensionIsOneOf(fileName, [".json" /* Json */, ".mjs" /* Mjs */, ".cjs" /* Cjs */]))
|
|
122361
122459
|
return fileName;
|
|
122362
122460
|
var noExtension = ts.removeFileExtension(fileName);
|
|
122461
|
+
if (fileName === noExtension)
|
|
122462
|
+
return fileName;
|
|
122363
122463
|
if (ts.fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".d.cts" /* Dcts */, ".cts" /* Cts */]))
|
|
122364
122464
|
return noExtension + getJSExtensionForFile(fileName, options);
|
|
122365
122465
|
switch (ending) {
|
|
@@ -122648,6 +122748,9 @@ var ts;
|
|
|
122648
122748
|
var configFile = program.getCompilerOptions().configFile;
|
|
122649
122749
|
if (!((_a = configFile === null || configFile === void 0 ? void 0 : configFile.configFileSpecs) === null || _a === void 0 ? void 0 : _a.validatedIncludeSpecs))
|
|
122650
122750
|
return undefined;
|
|
122751
|
+
// Return true if its default include spec
|
|
122752
|
+
if (configFile.configFileSpecs.isDefaultIncludeSpec)
|
|
122753
|
+
return true;
|
|
122651
122754
|
var isJsonFile = ts.fileExtensionIs(fileName, ".json" /* Json */);
|
|
122652
122755
|
var basePath = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory()));
|
|
122653
122756
|
var useCaseSensitiveFileNames = program.useCaseSensitiveFileNames();
|
|
@@ -122713,11 +122816,13 @@ var ts;
|
|
|
122713
122816
|
if (matchedByFiles)
|
|
122714
122817
|
return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Part_of_files_list_in_tsconfig_json);
|
|
122715
122818
|
var matchedByInclude = getMatchedIncludeSpec(program, fileName);
|
|
122716
|
-
return matchedByInclude ?
|
|
122819
|
+
return ts.isString(matchedByInclude) ?
|
|
122717
122820
|
ts.chainDiagnosticMessages(
|
|
122718
122821
|
/*details*/ undefined, ts.Diagnostics.Matched_by_include_pattern_0_in_1, matchedByInclude, toFileName(options.configFile, fileNameConvertor)) :
|
|
122719
|
-
// Could be additional files specified as roots
|
|
122720
|
-
ts.chainDiagnosticMessages(/*details*/ undefined,
|
|
122822
|
+
// Could be additional files specified as roots or matched by default include
|
|
122823
|
+
ts.chainDiagnosticMessages(/*details*/ undefined, matchedByInclude ?
|
|
122824
|
+
ts.Diagnostics.Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk :
|
|
122825
|
+
ts.Diagnostics.Root_file_specified_for_compilation);
|
|
122721
122826
|
case ts.FileIncludeKind.SourceFromProjectReference:
|
|
122722
122827
|
case ts.FileIncludeKind.OutputFromProjectReference:
|
|
122723
122828
|
var isOutput = reason.kind === ts.FileIncludeKind.OutputFromProjectReference;
|
|
@@ -126434,6 +126539,8 @@ var ts;
|
|
|
126434
126539
|
case 256 /* FunctionDeclaration */:
|
|
126435
126540
|
case 213 /* FunctionExpression */:
|
|
126436
126541
|
return getAdjustedLocationForFunction(node);
|
|
126542
|
+
case 171 /* Constructor */:
|
|
126543
|
+
return node;
|
|
126437
126544
|
}
|
|
126438
126545
|
}
|
|
126439
126546
|
if (ts.isNamedDeclaration(node)) {
|
|
@@ -139532,11 +139639,12 @@ var ts;
|
|
|
139532
139639
|
ts.forEachUnique(declarations, function (declaration) {
|
|
139533
139640
|
for (var _i = 0, _a = getCommentHavingNodes(declaration); _i < _a.length; _i++) {
|
|
139534
139641
|
var jsdoc = _a[_i];
|
|
139642
|
+
var inheritDoc = ts.isJSDoc(jsdoc) && jsdoc.tags && ts.find(jsdoc.tags, function (t) { return t.kind === 327 /* JSDocTag */ && (t.tagName.escapedText === "inheritDoc" || t.tagName.escapedText === "inheritdoc"); });
|
|
139535
139643
|
// skip comments containing @typedefs since they're not associated with particular declarations
|
|
139536
139644
|
// Exceptions:
|
|
139537
139645
|
// - @typedefs are themselves declarations with associated comments
|
|
139538
139646
|
// - @param or @return indicate that the author thinks of it as a 'local' @typedef that's part of the function documentation
|
|
139539
|
-
if (jsdoc.comment === undefined
|
|
139647
|
+
if (jsdoc.comment === undefined && !inheritDoc
|
|
139540
139648
|
|| ts.isJSDoc(jsdoc)
|
|
139541
139649
|
&& declaration.kind !== 345 /* JSDocTypedefTag */ && declaration.kind !== 338 /* JSDocCallbackTag */
|
|
139542
139650
|
&& jsdoc.tags
|
|
@@ -139544,7 +139652,10 @@ var ts;
|
|
|
139544
139652
|
&& !jsdoc.tags.some(function (t) { return t.kind === 340 /* JSDocParameterTag */ || t.kind === 341 /* JSDocReturnTag */; })) {
|
|
139545
139653
|
continue;
|
|
139546
139654
|
}
|
|
139547
|
-
var newparts = getDisplayPartsFromComment(jsdoc.comment, checker);
|
|
139655
|
+
var newparts = jsdoc.comment ? getDisplayPartsFromComment(jsdoc.comment, checker) : [];
|
|
139656
|
+
if (inheritDoc && inheritDoc.comment) {
|
|
139657
|
+
newparts = newparts.concat(getDisplayPartsFromComment(inheritDoc.comment, checker));
|
|
139658
|
+
}
|
|
139548
139659
|
if (!ts.contains(parts, newparts, isIdenticalListOfDisplayParts)) {
|
|
139549
139660
|
parts.push(newparts);
|
|
139550
139661
|
}
|
|
@@ -154300,6 +154411,7 @@ var ts;
|
|
|
154300
154411
|
var importAdder = codefix.createImportAdder(context.sourceFile, context.program, context.preferences, context.host);
|
|
154301
154412
|
var functionDeclaration = codefix.createSignatureDeclarationFromCallExpression(256 /* FunctionDeclaration */, context, importAdder, info.call, ts.idText(info.token), info.modifierFlags, info.parentDeclaration);
|
|
154302
154413
|
changes.insertNodeAtEndOfScope(info.sourceFile, info.parentDeclaration, functionDeclaration);
|
|
154414
|
+
importAdder.writeFixes(changes);
|
|
154303
154415
|
}
|
|
154304
154416
|
function addJsxAttributes(changes, context, info) {
|
|
154305
154417
|
var importAdder = codefix.createImportAdder(context.sourceFile, context.program, context.preferences, context.host);
|
|
@@ -154308,7 +154420,7 @@ var ts;
|
|
|
154308
154420
|
var jsxAttributesNode = info.parentDeclaration.attributes;
|
|
154309
154421
|
var hasSpreadAttribute = ts.some(jsxAttributesNode.properties, ts.isJsxSpreadAttribute);
|
|
154310
154422
|
var attrs = ts.map(info.attributes, function (attr) {
|
|
154311
|
-
var value = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(attr));
|
|
154423
|
+
var value = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(attr), info.parentDeclaration);
|
|
154312
154424
|
var name = ts.factory.createIdentifier(attr.name);
|
|
154313
154425
|
var jsxAttribute = ts.factory.createJsxAttribute(name, ts.factory.createJsxExpression(/*dotDotDotToken*/ undefined, value));
|
|
154314
154426
|
// formattingScanner requires the Identifier to have a context for scanning attributes with "-" (data-foo).
|
|
@@ -154318,6 +154430,7 @@ var ts;
|
|
|
154318
154430
|
var jsxAttributes = ts.factory.createJsxAttributes(hasSpreadAttribute ? __spreadArray(__spreadArray([], attrs, true), jsxAttributesNode.properties, true) : __spreadArray(__spreadArray([], jsxAttributesNode.properties, true), attrs, true));
|
|
154319
154431
|
var options = { prefix: jsxAttributesNode.pos === jsxAttributesNode.end ? " " : undefined };
|
|
154320
154432
|
changes.replaceNode(context.sourceFile, jsxAttributesNode, jsxAttributes, options);
|
|
154433
|
+
importAdder.writeFixes(changes);
|
|
154321
154434
|
}
|
|
154322
154435
|
function addObjectLiteralProperties(changes, context, info) {
|
|
154323
154436
|
var importAdder = codefix.createImportAdder(context.sourceFile, context.program, context.preferences, context.host);
|
|
@@ -154325,7 +154438,7 @@ var ts;
|
|
|
154325
154438
|
var target = ts.getEmitScriptTarget(context.program.getCompilerOptions());
|
|
154326
154439
|
var checker = context.program.getTypeChecker();
|
|
154327
154440
|
var props = ts.map(info.properties, function (prop) {
|
|
154328
|
-
var initializer = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(prop));
|
|
154441
|
+
var initializer = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(prop), info.parentDeclaration);
|
|
154329
154442
|
return ts.factory.createPropertyAssignment(ts.createPropertyNameNodeForIdentifierOrLiteral(prop.name, target, quotePreference === 0 /* Single */), initializer);
|
|
154330
154443
|
});
|
|
154331
154444
|
var options = {
|
|
@@ -154334,8 +154447,9 @@ var ts;
|
|
|
154334
154447
|
indentation: info.indentation
|
|
154335
154448
|
};
|
|
154336
154449
|
changes.replaceNode(context.sourceFile, info.parentDeclaration, ts.factory.createObjectLiteralExpression(__spreadArray(__spreadArray([], info.parentDeclaration.properties, true), props, true), /*multiLine*/ true), options);
|
|
154450
|
+
importAdder.writeFixes(changes);
|
|
154337
154451
|
}
|
|
154338
|
-
function tryGetValueFromType(context, checker, importAdder, quotePreference, type) {
|
|
154452
|
+
function tryGetValueFromType(context, checker, importAdder, quotePreference, type, enclosingDeclaration) {
|
|
154339
154453
|
if (type.flags & 3 /* AnyOrUnknown */) {
|
|
154340
154454
|
return createUndefined();
|
|
154341
154455
|
}
|
|
@@ -154372,7 +154486,7 @@ var ts;
|
|
|
154372
154486
|
return ts.factory.createNull();
|
|
154373
154487
|
}
|
|
154374
154488
|
if (type.flags & 1048576 /* Union */) {
|
|
154375
|
-
var expression = ts.firstDefined(type.types, function (t) { return tryGetValueFromType(context, checker, importAdder, quotePreference, t); });
|
|
154489
|
+
var expression = ts.firstDefined(type.types, function (t) { return tryGetValueFromType(context, checker, importAdder, quotePreference, t, enclosingDeclaration); });
|
|
154376
154490
|
return expression !== null && expression !== void 0 ? expression : createUndefined();
|
|
154377
154491
|
}
|
|
154378
154492
|
if (checker.isArrayLikeType(type)) {
|
|
@@ -154380,7 +154494,7 @@ var ts;
|
|
|
154380
154494
|
}
|
|
154381
154495
|
if (isObjectLiteralType(type)) {
|
|
154382
154496
|
var props = ts.map(checker.getPropertiesOfType(type), function (prop) {
|
|
154383
|
-
var initializer = prop.valueDeclaration ? tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeAtLocation(prop.valueDeclaration)) : createUndefined();
|
|
154497
|
+
var initializer = prop.valueDeclaration ? tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeAtLocation(prop.valueDeclaration), enclosingDeclaration) : createUndefined();
|
|
154384
154498
|
return ts.factory.createPropertyAssignment(prop.name, initializer);
|
|
154385
154499
|
});
|
|
154386
154500
|
return ts.factory.createObjectLiteralExpression(props, /*multiLine*/ true);
|
|
@@ -154392,7 +154506,7 @@ var ts;
|
|
|
154392
154506
|
var signature = checker.getSignaturesOfType(type, 0 /* Call */);
|
|
154393
154507
|
if (signature === undefined)
|
|
154394
154508
|
return createUndefined();
|
|
154395
|
-
var func = codefix.createSignatureDeclarationFromSignature(213 /* FunctionExpression */, context, quotePreference, signature[0], codefix.createStubbedBody(ts.Diagnostics.Function_not_implemented.message, quotePreference), /*name*/ undefined, /*modifiers*/ undefined, /*optional*/ undefined, /*enclosingDeclaration*/
|
|
154509
|
+
var func = codefix.createSignatureDeclarationFromSignature(213 /* FunctionExpression */, context, quotePreference, signature[0], codefix.createStubbedBody(ts.Diagnostics.Function_not_implemented.message, quotePreference), /*name*/ undefined, /*modifiers*/ undefined, /*optional*/ undefined, /*enclosingDeclaration*/ enclosingDeclaration, importAdder);
|
|
154396
154510
|
return func !== null && func !== void 0 ? func : createUndefined();
|
|
154397
154511
|
}
|
|
154398
154512
|
if (ts.getObjectFlags(type) & 1 /* Class */) {
|
|
@@ -163679,7 +163793,7 @@ var ts;
|
|
|
163679
163793
|
* @returns `true` if `node` has a JSDoc "inheritDoc" tag on it, otherwise `false`.
|
|
163680
163794
|
*/
|
|
163681
163795
|
function hasJSDocInheritDocTag(node) {
|
|
163682
|
-
return ts.getJSDocTags(node).some(function (tag) { return tag.tagName.text === "inheritDoc"; });
|
|
163796
|
+
return ts.getJSDocTags(node).some(function (tag) { return tag.tagName.text === "inheritDoc" || tag.tagName.text === "inheritdoc"; });
|
|
163683
163797
|
}
|
|
163684
163798
|
function getJsDocTagsOfDeclarations(declarations, checker) {
|
|
163685
163799
|
if (!declarations)
|
|
@@ -163738,13 +163852,15 @@ var ts;
|
|
|
163738
163852
|
}
|
|
163739
163853
|
function findBaseOfDeclaration(checker, declaration, cb) {
|
|
163740
163854
|
var _a;
|
|
163741
|
-
if (ts.hasStaticModifier(declaration))
|
|
163742
|
-
return;
|
|
163743
163855
|
var classOrInterfaceDeclaration = ((_a = declaration.parent) === null || _a === void 0 ? void 0 : _a.kind) === 171 /* Constructor */ ? declaration.parent.parent : declaration.parent;
|
|
163744
163856
|
if (!classOrInterfaceDeclaration)
|
|
163745
163857
|
return;
|
|
163858
|
+
var isStaticMember = ts.hasStaticModifier(declaration);
|
|
163746
163859
|
return ts.firstDefined(ts.getAllSuperTypeNodes(classOrInterfaceDeclaration), function (superTypeNode) {
|
|
163747
|
-
var
|
|
163860
|
+
var baseType = checker.getTypeAtLocation(superTypeNode);
|
|
163861
|
+
var symbol = isStaticMember
|
|
163862
|
+
? ts.find(checker.getExportsOfModule(baseType.symbol), function (s) { return s.escapedName === declaration.symbol.name; })
|
|
163863
|
+
: checker.getPropertyOfType(baseType, declaration.symbol.name);
|
|
163748
163864
|
return symbol ? cb(symbol) : undefined;
|
|
163749
163865
|
});
|
|
163750
163866
|
}
|
package/lib/tsserverlibrary.d.ts
CHANGED
|
@@ -1388,8 +1388,9 @@ declare namespace ts {
|
|
|
1388
1388
|
readonly kind: SyntaxKind.JsxAttribute;
|
|
1389
1389
|
readonly parent: JsxAttributes;
|
|
1390
1390
|
readonly name: Identifier;
|
|
1391
|
-
readonly initializer?:
|
|
1391
|
+
readonly initializer?: JsxAttributeValue;
|
|
1392
1392
|
}
|
|
1393
|
+
export type JsxAttributeValue = StringLiteral | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment;
|
|
1393
1394
|
export interface JsxSpreadAttribute extends ObjectLiteralElement {
|
|
1394
1395
|
readonly kind: SyntaxKind.JsxSpreadAttribute;
|
|
1395
1396
|
readonly parent: JsxAttributes;
|
|
@@ -3746,8 +3747,8 @@ declare namespace ts {
|
|
|
3746
3747
|
createJsxOpeningFragment(): JsxOpeningFragment;
|
|
3747
3748
|
createJsxJsxClosingFragment(): JsxClosingFragment;
|
|
3748
3749
|
updateJsxFragment(node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment): JsxFragment;
|
|
3749
|
-
createJsxAttribute(name: Identifier, initializer:
|
|
3750
|
-
updateJsxAttribute(node: JsxAttribute, name: Identifier, initializer:
|
|
3750
|
+
createJsxAttribute(name: Identifier, initializer: JsxAttributeValue | undefined): JsxAttribute;
|
|
3751
|
+
updateJsxAttribute(node: JsxAttribute, name: Identifier, initializer: JsxAttributeValue | undefined): JsxAttribute;
|
|
3751
3752
|
createJsxAttributes(properties: readonly JsxAttributeLike[]): JsxAttributes;
|
|
3752
3753
|
updateJsxAttributes(node: JsxAttributes, properties: readonly JsxAttributeLike[]): JsxAttributes;
|
|
3753
3754
|
createJsxSpreadAttribute(expression: Expression): JsxSpreadAttribute;
|
|
@@ -4510,6 +4511,8 @@ declare namespace ts {
|
|
|
4510
4511
|
function isObjectLiteralElement(node: Node): node is ObjectLiteralElement;
|
|
4511
4512
|
function isStringLiteralLike(node: Node): node is StringLiteralLike;
|
|
4512
4513
|
function isJSDocLinkLike(node: Node): node is JSDocLink | JSDocLinkCode | JSDocLinkPlain;
|
|
4514
|
+
function hasRestParameter(s: SignatureDeclaration | JSDocSignature): boolean;
|
|
4515
|
+
function isRestParameter(node: ParameterDeclaration | JSDocParameterTag): boolean;
|
|
4513
4516
|
}
|
|
4514
4517
|
declare namespace ts {
|
|
4515
4518
|
const factory: NodeFactory;
|
|
@@ -11337,9 +11340,9 @@ declare namespace ts {
|
|
|
11337
11340
|
/** @deprecated Use `factory.updateJsxFragment` or the factory supplied by your transformation context instead. */
|
|
11338
11341
|
const updateJsxFragment: (node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment) => JsxFragment;
|
|
11339
11342
|
/** @deprecated Use `factory.createJsxAttribute` or the factory supplied by your transformation context instead. */
|
|
11340
|
-
const createJsxAttribute: (name: Identifier, initializer:
|
|
11343
|
+
const createJsxAttribute: (name: Identifier, initializer: JsxAttributeValue | undefined) => JsxAttribute;
|
|
11341
11344
|
/** @deprecated Use `factory.updateJsxAttribute` or the factory supplied by your transformation context instead. */
|
|
11342
|
-
const updateJsxAttribute: (node: JsxAttribute, name: Identifier, initializer:
|
|
11345
|
+
const updateJsxAttribute: (node: JsxAttribute, name: Identifier, initializer: JsxAttributeValue | undefined) => JsxAttribute;
|
|
11343
11346
|
/** @deprecated Use `factory.createJsxAttributes` or the factory supplied by your transformation context instead. */
|
|
11344
11347
|
const createJsxAttributes: (properties: readonly JsxAttributeLike[]) => JsxAttributes;
|
|
11345
11348
|
/** @deprecated Use `factory.updateJsxAttributes` or the factory supplied by your transformation context instead. */
|