typescript 4.8.0-dev.20220616 → 4.8.0-dev.20220619
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 +5 -1
- package/lib/de/diagnosticMessages.generated.json +5 -1
- package/lib/es/diagnosticMessages.generated.json +5 -1
- package/lib/fr/diagnosticMessages.generated.json +5 -1
- package/lib/it/diagnosticMessages.generated.json +5 -1
- package/lib/ja/diagnosticMessages.generated.json +5 -1
- package/lib/ko/diagnosticMessages.generated.json +5 -1
- package/lib/lib.dom.d.ts +128 -183
- package/lib/lib.dom.iterable.d.ts +1 -11
- package/lib/lib.webworker.d.ts +54 -27
- package/lib/lib.webworker.iterable.d.ts +1 -1
- package/lib/pl/diagnosticMessages.generated.json +5 -1
- package/lib/protocol.d.ts +1 -0
- package/lib/pt-br/diagnosticMessages.generated.json +5 -1
- package/lib/ru/diagnosticMessages.generated.json +5 -1
- package/lib/tr/diagnosticMessages.generated.json +5 -1
- package/lib/tsc.js +121 -45
- package/lib/tsserver.js +271 -99
- package/lib/tsserverlibrary.d.ts +10 -0
- package/lib/tsserverlibrary.js +271 -99
- package/lib/typescript.d.ts +9 -0
- package/lib/typescript.js +239 -77
- package/lib/typescriptServices.d.ts +9 -0
- package/lib/typescriptServices.js +239 -77
- package/lib/typingsInstaller.js +150 -45
- package/lib/zh-cn/diagnosticMessages.generated.json +5 -1
- package/lib/zh-tw/diagnosticMessages.generated.json +5 -1
- package/package.json +20 -20
package/lib/typingsInstaller.js
CHANGED
|
@@ -89,7 +89,7 @@ var ts;
|
|
|
89
89
|
// The following is baselined as a literal template type without intervention
|
|
90
90
|
/** The version of the TypeScript compiler release */
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
92
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220619";
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -9652,6 +9652,8 @@ var ts;
|
|
|
9652
9652
|
Qualified_name_0_is_not_allowed_without_a_leading_param_object_1: diag(8032, ts.DiagnosticCategory.Error, "Qualified_name_0_is_not_allowed_without_a_leading_param_object_1_8032", "Qualified name '{0}' is not allowed without a leading '@param {object} {1}'."),
|
|
9653
9653
|
A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags: diag(8033, ts.DiagnosticCategory.Error, "A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags_8033", "A JSDoc '@typedef' comment may not contain multiple '@type' tags."),
|
|
9654
9654
|
The_tag_was_first_specified_here: diag(8034, ts.DiagnosticCategory.Error, "The_tag_was_first_specified_here_8034", "The tag was first specified here."),
|
|
9655
|
+
You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder: diag(8035, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035", "You cannot rename elements that are defined in a 'node_modules' folder."),
|
|
9656
|
+
You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."),
|
|
9655
9657
|
Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, ts.DiagnosticCategory.Error, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."),
|
|
9656
9658
|
Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, ts.DiagnosticCategory.Error, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."),
|
|
9657
9659
|
JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17000, ts.DiagnosticCategory.Error, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."),
|
|
@@ -9922,6 +9924,9 @@ var ts;
|
|
|
9922
9924
|
For_await_loops_cannot_be_used_inside_a_class_static_block: diag(18038, ts.DiagnosticCategory.Error, "For_await_loops_cannot_be_used_inside_a_class_static_block_18038", "'For await' loops cannot be used inside a class static block."),
|
|
9923
9925
|
Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block: diag(18039, ts.DiagnosticCategory.Error, "Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block_18039", "Invalid use of '{0}'. It cannot be used inside a class static block."),
|
|
9924
9926
|
A_return_statement_cannot_be_used_inside_a_class_static_block: diag(18041, ts.DiagnosticCategory.Error, "A_return_statement_cannot_be_used_inside_a_class_static_block_18041", "A 'return' statement cannot be used inside a class static block."),
|
|
9927
|
+
_0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation: diag(18042, ts.DiagnosticCategory.Error, "_0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation_18042", "'{0}' is a type and cannot be imported in JavaScript files. Use '{1}' in a JSDoc type annotation."),
|
|
9928
|
+
Types_cannot_appear_in_export_declarations_in_JavaScript_files: diag(18043, ts.DiagnosticCategory.Error, "Types_cannot_appear_in_export_declarations_in_JavaScript_files_18043", "Types cannot appear in export declarations in JavaScript files."),
|
|
9929
|
+
_0_is_automatically_exported_here: diag(18044, ts.DiagnosticCategory.Message, "_0_is_automatically_exported_here_18044", "'{0}' is automatically exported here."),
|
|
9925
9930
|
};
|
|
9926
9931
|
})(ts || (ts = {}));
|
|
9927
9932
|
var ts;
|
|
@@ -34510,10 +34515,10 @@ var ts;
|
|
|
34510
34515
|
setDecoratorContext(/*val*/ false);
|
|
34511
34516
|
}
|
|
34512
34517
|
var pos = getNodePos();
|
|
34513
|
-
var expr = parseAssignmentExpressionOrHigher();
|
|
34518
|
+
var expr = parseAssignmentExpressionOrHigher(/*allowReturnTypeInArrowFunction*/ true);
|
|
34514
34519
|
var operatorToken;
|
|
34515
34520
|
while ((operatorToken = parseOptionalToken(27 /* CommaToken */))) {
|
|
34516
|
-
expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher(), pos);
|
|
34521
|
+
expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher(/*allowReturnTypeInArrowFunction*/ true), pos);
|
|
34517
34522
|
}
|
|
34518
34523
|
if (saveDecoratorContext) {
|
|
34519
34524
|
setDecoratorContext(/*val*/ true);
|
|
@@ -34521,9 +34526,9 @@ var ts;
|
|
|
34521
34526
|
return expr;
|
|
34522
34527
|
}
|
|
34523
34528
|
function parseInitializer() {
|
|
34524
|
-
return parseOptional(63 /* EqualsToken */) ? parseAssignmentExpressionOrHigher() : undefined;
|
|
34529
|
+
return parseOptional(63 /* EqualsToken */) ? parseAssignmentExpressionOrHigher(/*allowReturnTypeInArrowFunction*/ true) : undefined;
|
|
34525
34530
|
}
|
|
34526
|
-
function parseAssignmentExpressionOrHigher() {
|
|
34531
|
+
function parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction) {
|
|
34527
34532
|
// AssignmentExpression[in,yield]:
|
|
34528
34533
|
// 1) ConditionalExpression[?in,?yield]
|
|
34529
34534
|
// 2) LeftHandSideExpression = AssignmentExpression[?in,?yield]
|
|
@@ -34549,7 +34554,7 @@ var ts;
|
|
|
34549
34554
|
// If we do successfully parse arrow-function, we must *not* recurse for productions 1, 2 or 3. An ArrowFunction is
|
|
34550
34555
|
// not a LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done
|
|
34551
34556
|
// with AssignmentExpression if we see one.
|
|
34552
|
-
var arrowExpression = tryParseParenthesizedArrowFunctionExpression() || tryParseAsyncSimpleArrowFunctionExpression();
|
|
34557
|
+
var arrowExpression = tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) || tryParseAsyncSimpleArrowFunctionExpression(allowReturnTypeInArrowFunction);
|
|
34553
34558
|
if (arrowExpression) {
|
|
34554
34559
|
return arrowExpression;
|
|
34555
34560
|
}
|
|
@@ -34568,7 +34573,7 @@ var ts;
|
|
|
34568
34573
|
// parameter ('x => ...') above. We handle it here by checking if the parsed expression was a single
|
|
34569
34574
|
// identifier and the current token is an arrow.
|
|
34570
34575
|
if (expr.kind === 79 /* Identifier */ && token() === 38 /* EqualsGreaterThanToken */) {
|
|
34571
|
-
return parseSimpleArrowFunctionExpression(pos, expr, /*asyncModifier*/ undefined);
|
|
34576
|
+
return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, /*asyncModifier*/ undefined);
|
|
34572
34577
|
}
|
|
34573
34578
|
// Now see if we might be in cases '2' or '3'.
|
|
34574
34579
|
// If the expression was a LHS expression, and we have an assignment operator, then
|
|
@@ -34577,10 +34582,10 @@ var ts;
|
|
|
34577
34582
|
// Note: we call reScanGreaterToken so that we get an appropriately merged token
|
|
34578
34583
|
// for cases like `> > =` becoming `>>=`
|
|
34579
34584
|
if (ts.isLeftHandSideExpression(expr) && ts.isAssignmentOperator(reScanGreaterToken())) {
|
|
34580
|
-
return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(), pos);
|
|
34585
|
+
return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction), pos);
|
|
34581
34586
|
}
|
|
34582
34587
|
// It wasn't an assignment or a lambda. This is a conditional expression:
|
|
34583
|
-
return parseConditionalExpressionRest(expr, pos);
|
|
34588
|
+
return parseConditionalExpressionRest(expr, pos, allowReturnTypeInArrowFunction);
|
|
34584
34589
|
}
|
|
34585
34590
|
function isYieldExpression() {
|
|
34586
34591
|
if (token() === 125 /* YieldKeyword */) {
|
|
@@ -34620,7 +34625,7 @@ var ts;
|
|
|
34620
34625
|
nextToken();
|
|
34621
34626
|
if (!scanner.hasPrecedingLineBreak() &&
|
|
34622
34627
|
(token() === 41 /* AsteriskToken */ || isStartOfExpression())) {
|
|
34623
|
-
return finishNode(factory.createYieldExpression(parseOptionalToken(41 /* AsteriskToken */), parseAssignmentExpressionOrHigher()), pos);
|
|
34628
|
+
return finishNode(factory.createYieldExpression(parseOptionalToken(41 /* AsteriskToken */), parseAssignmentExpressionOrHigher(/*allowReturnTypeInArrowFunction*/ true)), pos);
|
|
34624
34629
|
}
|
|
34625
34630
|
else {
|
|
34626
34631
|
// if the next token is not on the same line as yield. or we don't have an '*' or
|
|
@@ -34628,7 +34633,7 @@ var ts;
|
|
|
34628
34633
|
return finishNode(factory.createYieldExpression(/*asteriskToken*/ undefined, /*expression*/ undefined), pos);
|
|
34629
34634
|
}
|
|
34630
34635
|
}
|
|
34631
|
-
function parseSimpleArrowFunctionExpression(pos, identifier, asyncModifier) {
|
|
34636
|
+
function parseSimpleArrowFunctionExpression(pos, identifier, allowReturnTypeInArrowFunction, asyncModifier) {
|
|
34632
34637
|
ts.Debug.assert(token() === 38 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
|
|
34633
34638
|
var parameter = factory.createParameterDeclaration(
|
|
34634
34639
|
/*modifiers*/ undefined,
|
|
@@ -34639,11 +34644,11 @@ var ts;
|
|
|
34639
34644
|
finishNode(parameter, identifier.pos);
|
|
34640
34645
|
var parameters = createNodeArray([parameter], parameter.pos, parameter.end);
|
|
34641
34646
|
var equalsGreaterThanToken = parseExpectedToken(38 /* EqualsGreaterThanToken */);
|
|
34642
|
-
var body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier);
|
|
34647
|
+
var body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier, allowReturnTypeInArrowFunction);
|
|
34643
34648
|
var node = factory.createArrowFunction(asyncModifier, /*typeParameters*/ undefined, parameters, /*type*/ undefined, equalsGreaterThanToken, body);
|
|
34644
34649
|
return addJSDocComment(finishNode(node, pos));
|
|
34645
34650
|
}
|
|
34646
|
-
function tryParseParenthesizedArrowFunctionExpression() {
|
|
34651
|
+
function tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) {
|
|
34647
34652
|
var triState = isParenthesizedArrowFunctionExpression();
|
|
34648
34653
|
if (triState === 0 /* False */) {
|
|
34649
34654
|
// It's definitely not a parenthesized arrow function expression.
|
|
@@ -34654,8 +34659,8 @@ var ts;
|
|
|
34654
34659
|
// it out, but don't allow any ambiguity, and return 'undefined' if this could be an
|
|
34655
34660
|
// expression instead.
|
|
34656
34661
|
return triState === 1 /* True */ ?
|
|
34657
|
-
parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ true) :
|
|
34658
|
-
tryParse(parsePossibleParenthesizedArrowFunctionExpression);
|
|
34662
|
+
parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ true, /*allowReturnTypeInArrowFunction*/ true) :
|
|
34663
|
+
tryParse(function () { return parsePossibleParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction); });
|
|
34659
34664
|
}
|
|
34660
34665
|
// True -> We definitely expect a parenthesized arrow function here.
|
|
34661
34666
|
// False -> There *cannot* be a parenthesized arrow function here.
|
|
@@ -34789,25 +34794,25 @@ var ts;
|
|
|
34789
34794
|
return 2 /* Unknown */;
|
|
34790
34795
|
}
|
|
34791
34796
|
}
|
|
34792
|
-
function parsePossibleParenthesizedArrowFunctionExpression() {
|
|
34797
|
+
function parsePossibleParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) {
|
|
34793
34798
|
var tokenPos = scanner.getTokenPos();
|
|
34794
34799
|
if (notParenthesizedArrow === null || notParenthesizedArrow === void 0 ? void 0 : notParenthesizedArrow.has(tokenPos)) {
|
|
34795
34800
|
return undefined;
|
|
34796
34801
|
}
|
|
34797
|
-
var result = parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ false);
|
|
34802
|
+
var result = parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ false, allowReturnTypeInArrowFunction);
|
|
34798
34803
|
if (!result) {
|
|
34799
34804
|
(notParenthesizedArrow || (notParenthesizedArrow = new ts.Set())).add(tokenPos);
|
|
34800
34805
|
}
|
|
34801
34806
|
return result;
|
|
34802
34807
|
}
|
|
34803
|
-
function tryParseAsyncSimpleArrowFunctionExpression() {
|
|
34808
|
+
function tryParseAsyncSimpleArrowFunctionExpression(allowReturnTypeInArrowFunction) {
|
|
34804
34809
|
// We do a check here so that we won't be doing unnecessarily call to "lookAhead"
|
|
34805
34810
|
if (token() === 131 /* AsyncKeyword */) {
|
|
34806
34811
|
if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1 /* True */) {
|
|
34807
34812
|
var pos = getNodePos();
|
|
34808
34813
|
var asyncModifier = parseModifiersForArrowFunction();
|
|
34809
34814
|
var expr = parseBinaryExpressionOrHigher(0 /* Lowest */);
|
|
34810
|
-
return parseSimpleArrowFunctionExpression(pos, expr, asyncModifier);
|
|
34815
|
+
return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, asyncModifier);
|
|
34811
34816
|
}
|
|
34812
34817
|
}
|
|
34813
34818
|
return undefined;
|
|
@@ -34831,7 +34836,7 @@ var ts;
|
|
|
34831
34836
|
}
|
|
34832
34837
|
return 0 /* False */;
|
|
34833
34838
|
}
|
|
34834
|
-
function parseParenthesizedArrowFunctionExpression(allowAmbiguity) {
|
|
34839
|
+
function parseParenthesizedArrowFunctionExpression(allowAmbiguity, allowReturnTypeInArrowFunction) {
|
|
34835
34840
|
var pos = getNodePos();
|
|
34836
34841
|
var hasJSDoc = hasPrecedingJSDocComment();
|
|
34837
34842
|
var modifiers = parseModifiersForArrowFunction();
|
|
@@ -34866,6 +34871,7 @@ var ts;
|
|
|
34866
34871
|
return undefined;
|
|
34867
34872
|
}
|
|
34868
34873
|
}
|
|
34874
|
+
var hasReturnColon = token() === 58 /* ColonToken */;
|
|
34869
34875
|
var type = parseReturnType(58 /* ColonToken */, /*isType*/ false);
|
|
34870
34876
|
if (type && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type)) {
|
|
34871
34877
|
return undefined;
|
|
@@ -34894,12 +34900,37 @@ var ts;
|
|
|
34894
34900
|
var lastToken = token();
|
|
34895
34901
|
var equalsGreaterThanToken = parseExpectedToken(38 /* EqualsGreaterThanToken */);
|
|
34896
34902
|
var body = (lastToken === 38 /* EqualsGreaterThanToken */ || lastToken === 18 /* OpenBraceToken */)
|
|
34897
|
-
? parseArrowFunctionExpressionBody(ts.some(modifiers, ts.isAsyncModifier))
|
|
34903
|
+
? parseArrowFunctionExpressionBody(ts.some(modifiers, ts.isAsyncModifier), allowReturnTypeInArrowFunction)
|
|
34898
34904
|
: parseIdentifier();
|
|
34905
|
+
// Given:
|
|
34906
|
+
// x ? y => ({ y }) : z => ({ z })
|
|
34907
|
+
// We try to parse the body of the first arrow function by looking at:
|
|
34908
|
+
// ({ y }) : z => ({ z })
|
|
34909
|
+
// This is a valid arrow function with "z" as the return type.
|
|
34910
|
+
//
|
|
34911
|
+
// But, if we're in the true side of a conditional expression, this colon
|
|
34912
|
+
// terminates the expression, so we cannot allow a return type if we aren't
|
|
34913
|
+
// certain whether or not the preceding text was parsed as a parameter list.
|
|
34914
|
+
//
|
|
34915
|
+
// For example,
|
|
34916
|
+
// a() ? (b: number, c?: string): void => d() : e
|
|
34917
|
+
// is determined by isParenthesizedArrowFunctionExpression to unambiguously
|
|
34918
|
+
// be an arrow expression, so we allow a return type.
|
|
34919
|
+
if (!allowReturnTypeInArrowFunction && hasReturnColon) {
|
|
34920
|
+
// However, if the arrow function we were able to parse is followed by another colon
|
|
34921
|
+
// as in:
|
|
34922
|
+
// a ? (x): string => x : null
|
|
34923
|
+
// Then allow the arrow function, and treat the second colon as terminating
|
|
34924
|
+
// the conditional expression. It's okay to do this because this code would
|
|
34925
|
+
// be a syntax error in JavaScript (as the second colon shouldn't be there).
|
|
34926
|
+
if (token() !== 58 /* ColonToken */) {
|
|
34927
|
+
return undefined;
|
|
34928
|
+
}
|
|
34929
|
+
}
|
|
34899
34930
|
var node = factory.createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body);
|
|
34900
34931
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
34901
34932
|
}
|
|
34902
|
-
function parseArrowFunctionExpressionBody(isAsync) {
|
|
34933
|
+
function parseArrowFunctionExpressionBody(isAsync, allowReturnTypeInArrowFunction) {
|
|
34903
34934
|
if (token() === 18 /* OpenBraceToken */) {
|
|
34904
34935
|
return parseFunctionBlock(isAsync ? 2 /* Await */ : 0 /* None */);
|
|
34905
34936
|
}
|
|
@@ -34927,12 +34958,12 @@ var ts;
|
|
|
34927
34958
|
var savedTopLevel = topLevel;
|
|
34928
34959
|
topLevel = false;
|
|
34929
34960
|
var node = isAsync
|
|
34930
|
-
? doInAwaitContext(parseAssignmentExpressionOrHigher)
|
|
34931
|
-
: doOutsideOfAwaitContext(parseAssignmentExpressionOrHigher);
|
|
34961
|
+
? doInAwaitContext(function () { return parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction); })
|
|
34962
|
+
: doOutsideOfAwaitContext(function () { return parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction); });
|
|
34932
34963
|
topLevel = savedTopLevel;
|
|
34933
34964
|
return node;
|
|
34934
34965
|
}
|
|
34935
|
-
function parseConditionalExpressionRest(leftOperand, pos) {
|
|
34966
|
+
function parseConditionalExpressionRest(leftOperand, pos, allowReturnTypeInArrowFunction) {
|
|
34936
34967
|
// Note: we are passed in an expression which was produced from parseBinaryExpressionOrHigher.
|
|
34937
34968
|
var questionToken = parseOptionalToken(57 /* QuestionToken */);
|
|
34938
34969
|
if (!questionToken) {
|
|
@@ -34941,8 +34972,8 @@ var ts;
|
|
|
34941
34972
|
// Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and
|
|
34942
34973
|
// we do not that for the 'whenFalse' part.
|
|
34943
34974
|
var colonToken;
|
|
34944
|
-
return finishNode(factory.createConditionalExpression(leftOperand, questionToken, doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher), colonToken = parseExpectedToken(58 /* ColonToken */), ts.nodeIsPresent(colonToken)
|
|
34945
|
-
? parseAssignmentExpressionOrHigher()
|
|
34975
|
+
return finishNode(factory.createConditionalExpression(leftOperand, questionToken, doOutsideOfContext(disallowInAndDecoratorContext, function () { return parseAssignmentExpressionOrHigher(/*allowReturnTypeInArrowFunction*/ false); }), colonToken = parseExpectedToken(58 /* ColonToken */), ts.nodeIsPresent(colonToken)
|
|
34976
|
+
? parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction)
|
|
34946
34977
|
: createMissingNode(79 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(58 /* ColonToken */))), pos);
|
|
34947
34978
|
}
|
|
34948
34979
|
function parseBinaryExpressionOrHigher(precedence) {
|
|
@@ -35857,13 +35888,13 @@ var ts;
|
|
|
35857
35888
|
function parseSpreadElement() {
|
|
35858
35889
|
var pos = getNodePos();
|
|
35859
35890
|
parseExpected(25 /* DotDotDotToken */);
|
|
35860
|
-
var expression = parseAssignmentExpressionOrHigher();
|
|
35891
|
+
var expression = parseAssignmentExpressionOrHigher(/*allowReturnTypeInArrowFunction*/ true);
|
|
35861
35892
|
return finishNode(factory.createSpreadElement(expression), pos);
|
|
35862
35893
|
}
|
|
35863
35894
|
function parseArgumentOrArrayLiteralElement() {
|
|
35864
35895
|
return token() === 25 /* DotDotDotToken */ ? parseSpreadElement() :
|
|
35865
35896
|
token() === 27 /* CommaToken */ ? finishNode(factory.createOmittedExpression(), getNodePos()) :
|
|
35866
|
-
parseAssignmentExpressionOrHigher();
|
|
35897
|
+
parseAssignmentExpressionOrHigher(/*allowReturnTypeInArrowFunction*/ true);
|
|
35867
35898
|
}
|
|
35868
35899
|
function parseArgumentExpression() {
|
|
35869
35900
|
return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement);
|
|
@@ -35881,7 +35912,7 @@ var ts;
|
|
|
35881
35912
|
var pos = getNodePos();
|
|
35882
35913
|
var hasJSDoc = hasPrecedingJSDocComment();
|
|
35883
35914
|
if (parseOptionalToken(25 /* DotDotDotToken */)) {
|
|
35884
|
-
var expression = parseAssignmentExpressionOrHigher();
|
|
35915
|
+
var expression = parseAssignmentExpressionOrHigher(/*allowReturnTypeInArrowFunction*/ true);
|
|
35885
35916
|
return withJSDoc(finishNode(factory.createSpreadAssignment(expression), pos), hasJSDoc);
|
|
35886
35917
|
}
|
|
35887
35918
|
var decorators = parseDecorators();
|
|
@@ -35910,7 +35941,7 @@ var ts;
|
|
|
35910
35941
|
var isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== 58 /* ColonToken */);
|
|
35911
35942
|
if (isShorthandPropertyAssignment) {
|
|
35912
35943
|
var equalsToken = parseOptionalToken(63 /* EqualsToken */);
|
|
35913
|
-
var objectAssignmentInitializer = equalsToken ? allowInAnd(parseAssignmentExpressionOrHigher) : undefined;
|
|
35944
|
+
var objectAssignmentInitializer = equalsToken ? allowInAnd(function () { return parseAssignmentExpressionOrHigher(/*allowReturnTypeInArrowFunction*/ true); }) : undefined;
|
|
35914
35945
|
node = factory.createShorthandPropertyAssignment(name, objectAssignmentInitializer);
|
|
35915
35946
|
// Save equals token for error reporting.
|
|
35916
35947
|
// TODO(rbuckton): Consider manufacturing this when we need to report an error as it is otherwise not useful.
|
|
@@ -35918,7 +35949,7 @@ var ts;
|
|
|
35918
35949
|
}
|
|
35919
35950
|
else {
|
|
35920
35951
|
parseExpected(58 /* ColonToken */);
|
|
35921
|
-
var initializer = allowInAnd(parseAssignmentExpressionOrHigher);
|
|
35952
|
+
var initializer = allowInAnd(function () { return parseAssignmentExpressionOrHigher(/*allowReturnTypeInArrowFunction*/ true); });
|
|
35922
35953
|
node = factory.createPropertyAssignment(name, initializer);
|
|
35923
35954
|
}
|
|
35924
35955
|
// Decorators, Modifiers, questionToken, and exclamationToken are not supported by property assignments and are reported in the grammar checker
|
|
@@ -36095,7 +36126,7 @@ var ts;
|
|
|
36095
36126
|
}
|
|
36096
36127
|
var node;
|
|
36097
36128
|
if (awaitToken ? parseExpected(160 /* OfKeyword */) : parseOptional(160 /* OfKeyword */)) {
|
|
36098
|
-
var expression = allowInAnd(parseAssignmentExpressionOrHigher);
|
|
36129
|
+
var expression = allowInAnd(function () { return parseAssignmentExpressionOrHigher(/*allowReturnTypeInArrowFunction*/ true); });
|
|
36099
36130
|
parseExpected(21 /* CloseParenToken */);
|
|
36100
36131
|
node = factory.createForOfStatement(awaitToken, initializer, expression, parseStatement());
|
|
36101
36132
|
}
|
|
@@ -37283,7 +37314,7 @@ var ts;
|
|
|
37283
37314
|
var pos = getNodePos();
|
|
37284
37315
|
var name = ts.tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(10 /* StringLiteral */);
|
|
37285
37316
|
parseExpected(58 /* ColonToken */);
|
|
37286
|
-
var value = parseAssignmentExpressionOrHigher();
|
|
37317
|
+
var value = parseAssignmentExpressionOrHigher(/*allowReturnTypeInArrowFunction*/ true);
|
|
37287
37318
|
return finishNode(factory.createAssertEntry(name, value), pos);
|
|
37288
37319
|
}
|
|
37289
37320
|
function parseAssertClause(skipAssertKeyword) {
|
|
@@ -37524,7 +37555,7 @@ var ts;
|
|
|
37524
37555
|
else {
|
|
37525
37556
|
parseExpected(88 /* DefaultKeyword */);
|
|
37526
37557
|
}
|
|
37527
|
-
var expression = parseAssignmentExpressionOrHigher();
|
|
37558
|
+
var expression = parseAssignmentExpressionOrHigher(/*allowReturnTypeInArrowFunction*/ true);
|
|
37528
37559
|
parseSemicolon();
|
|
37529
37560
|
setAwaitContext(savedAwaitContext);
|
|
37530
37561
|
var node = factory.createExportAssignment(modifiers, isExportEquals, expression);
|
|
@@ -48890,9 +48921,9 @@ var ts;
|
|
|
48890
48921
|
return moduleSpecifier && resolveExternalModuleName(moduleSpecifier, moduleSpecifier, /*ignoreErrors*/ true);
|
|
48891
48922
|
},
|
|
48892
48923
|
resolveExternalModuleSymbol: resolveExternalModuleSymbol,
|
|
48893
|
-
tryGetThisTypeAt: function (nodeIn, includeGlobalThis) {
|
|
48924
|
+
tryGetThisTypeAt: function (nodeIn, includeGlobalThis, container) {
|
|
48894
48925
|
var node = ts.getParseTreeNode(nodeIn);
|
|
48895
|
-
return node && tryGetThisTypeAt(node, includeGlobalThis);
|
|
48926
|
+
return node && tryGetThisTypeAt(node, includeGlobalThis, container);
|
|
48896
48927
|
},
|
|
48897
48928
|
getTypeArgumentConstraint: function (nodeIn) {
|
|
48898
48929
|
var node = ts.getParseTreeNode(nodeIn, ts.isTypeNode);
|
|
@@ -59340,7 +59371,7 @@ var ts;
|
|
|
59340
59371
|
}
|
|
59341
59372
|
if (t.flags & 268435456 /* StringMapping */) {
|
|
59342
59373
|
var constraint = getBaseConstraint(t.type);
|
|
59343
|
-
return constraint ? getStringMappingType(t.symbol, constraint) : stringType;
|
|
59374
|
+
return constraint && constraint !== t.type ? getStringMappingType(t.symbol, constraint) : stringType;
|
|
59344
59375
|
}
|
|
59345
59376
|
if (t.flags & 8388608 /* IndexedAccess */) {
|
|
59346
59377
|
if (isMappedTypeGenericIndexedAccess(t)) {
|
|
@@ -62310,9 +62341,12 @@ var ts;
|
|
|
62310
62341
|
}
|
|
62311
62342
|
function getStringMappingType(symbol, type) {
|
|
62312
62343
|
return type.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapType(type, function (t) { return getStringMappingType(symbol, t); }) :
|
|
62313
|
-
|
|
62314
|
-
|
|
62315
|
-
|
|
62344
|
+
// Mapping<Mapping<T>> === Mapping<T>
|
|
62345
|
+
type.flags & 268435456 /* StringMapping */ && symbol === type.symbol ? type :
|
|
62346
|
+
isGenericIndexType(type) || isPatternLiteralPlaceholderType(type) ? getStringMappingTypeForGenericType(symbol, isPatternLiteralPlaceholderType(type) && !(type.flags & 268435456 /* StringMapping */) ? getTemplateLiteralType(["", ""], [type]) : type) :
|
|
62347
|
+
type.flags & 128 /* StringLiteral */ ? getStringLiteralType(applyStringMapping(symbol, type.value)) :
|
|
62348
|
+
type.flags & 134217728 /* TemplateLiteral */ ? getTemplateLiteralType.apply(void 0, applyTemplateStringMapping(symbol, type.texts, type.types)) :
|
|
62349
|
+
type;
|
|
62316
62350
|
}
|
|
62317
62351
|
function applyStringMapping(symbol, str) {
|
|
62318
62352
|
switch (intrinsicTypeKinds.get(symbol.escapedName)) {
|
|
@@ -62323,6 +62357,15 @@ var ts;
|
|
|
62323
62357
|
}
|
|
62324
62358
|
return str;
|
|
62325
62359
|
}
|
|
62360
|
+
function applyTemplateStringMapping(symbol, texts, types) {
|
|
62361
|
+
switch (intrinsicTypeKinds.get(symbol.escapedName)) {
|
|
62362
|
+
case 0 /* Uppercase */: return [texts.map(function (t) { return t.toUpperCase(); }), types.map(function (t) { return getStringMappingType(symbol, t); })];
|
|
62363
|
+
case 1 /* Lowercase */: return [texts.map(function (t) { return t.toLowerCase(); }), types.map(function (t) { return getStringMappingType(symbol, t); })];
|
|
62364
|
+
case 2 /* Capitalize */: return [texts[0] === "" ? texts : __spreadArray([texts[0].charAt(0).toUpperCase() + texts[0].slice(1)], texts.slice(1), true), texts[0] === "" ? __spreadArray([getStringMappingType(symbol, types[0])], types.slice(1), true) : types];
|
|
62365
|
+
case 3 /* Uncapitalize */: return [texts[0] === "" ? texts : __spreadArray([texts[0].charAt(0).toLowerCase() + texts[0].slice(1)], texts.slice(1), true), texts[0] === "" ? __spreadArray([getStringMappingType(symbol, types[0])], types.slice(1), true) : types];
|
|
62366
|
+
}
|
|
62367
|
+
return [texts, types];
|
|
62368
|
+
}
|
|
62326
62369
|
function getStringMappingTypeForGenericType(symbol, type) {
|
|
62327
62370
|
var id = getSymbolId(symbol) + "," + getTypeId(type);
|
|
62328
62371
|
var result = stringMappingTypes.get(id);
|
|
@@ -62564,7 +62607,7 @@ var ts;
|
|
|
62564
62607
|
accessNode;
|
|
62565
62608
|
}
|
|
62566
62609
|
function isPatternLiteralPlaceholderType(type) {
|
|
62567
|
-
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */));
|
|
62610
|
+
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || !!(type.flags & 268435456 /* StringMapping */ && isPatternLiteralPlaceholderType(type.type));
|
|
62568
62611
|
}
|
|
62569
62612
|
function isPatternLiteralType(type) {
|
|
62570
62613
|
return !!(type.flags & 134217728 /* TemplateLiteral */) && ts.every(type.types, isPatternLiteralPlaceholderType);
|
|
@@ -66276,6 +66319,13 @@ var ts;
|
|
|
66276
66319
|
return -1 /* True */;
|
|
66277
66320
|
}
|
|
66278
66321
|
}
|
|
66322
|
+
else if (target.flags & 268435456 /* StringMapping */) {
|
|
66323
|
+
if (!(source.flags & 268435456 /* StringMapping */)) {
|
|
66324
|
+
if (isMemberOfStringMapping(source, target)) {
|
|
66325
|
+
return -1 /* True */;
|
|
66326
|
+
}
|
|
66327
|
+
}
|
|
66328
|
+
}
|
|
66279
66329
|
if (sourceFlags & 8650752 /* TypeVariable */) {
|
|
66280
66330
|
// IndexedAccess comparisons are handled above in the `targetFlags & TypeFlage.IndexedAccess` branch
|
|
66281
66331
|
if (!(sourceFlags & 8388608 /* IndexedAccess */ && targetFlags & 8388608 /* IndexedAccess */)) {
|
|
@@ -66319,7 +66369,10 @@ var ts;
|
|
|
66319
66369
|
}
|
|
66320
66370
|
}
|
|
66321
66371
|
else if (sourceFlags & 268435456 /* StringMapping */) {
|
|
66322
|
-
if (targetFlags & 268435456 /* StringMapping */
|
|
66372
|
+
if (targetFlags & 268435456 /* StringMapping */) {
|
|
66373
|
+
if (source.symbol !== target.symbol) {
|
|
66374
|
+
return 0 /* False */;
|
|
66375
|
+
}
|
|
66323
66376
|
if (result = isRelatedTo(source.type, target.type, 3 /* Both */, reportErrors)) {
|
|
66324
66377
|
resetErrorInfo(saveErrorInfo);
|
|
66325
66378
|
return result;
|
|
@@ -67244,7 +67297,7 @@ var ts;
|
|
|
67244
67297
|
return typeCouldHaveTopLevelSingletonTypes(constraint);
|
|
67245
67298
|
}
|
|
67246
67299
|
}
|
|
67247
|
-
return isUnitType(type) || !!(type.flags & 134217728 /* TemplateLiteral */);
|
|
67300
|
+
return isUnitType(type) || !!(type.flags & 134217728 /* TemplateLiteral */) || !!(type.flags & 268435456 /* StringMapping */);
|
|
67248
67301
|
}
|
|
67249
67302
|
function getExactOptionalUnassignableProperties(source, target) {
|
|
67250
67303
|
if (isTupleType(source) && isTupleType(target))
|
|
@@ -68715,6 +68768,31 @@ var ts;
|
|
|
68715
68768
|
return success && result === 9 /* BigIntLiteral */ && scanner.getTextPos() === (s.length + 1) && !(flags & 512 /* ContainsSeparator */)
|
|
68716
68769
|
&& (!roundTripOnly || s === ts.pseudoBigIntToString({ negative: negative, base10Value: ts.parsePseudoBigInt(scanner.getTokenValue()) }));
|
|
68717
68770
|
}
|
|
68771
|
+
function isMemberOfStringMapping(source, target) {
|
|
68772
|
+
if (target.flags & (4 /* String */ | 3 /* AnyOrUnknown */)) {
|
|
68773
|
+
return true;
|
|
68774
|
+
}
|
|
68775
|
+
if (target.flags & 134217728 /* TemplateLiteral */) {
|
|
68776
|
+
return isTypeAssignableTo(source, target);
|
|
68777
|
+
}
|
|
68778
|
+
if (target.flags & 268435456 /* StringMapping */) {
|
|
68779
|
+
// We need to see whether applying the same mappings of the target
|
|
68780
|
+
// onto the source would produce an identical type *and* that
|
|
68781
|
+
// it's compatible with the inner-most non-string-mapped type.
|
|
68782
|
+
//
|
|
68783
|
+
// The intuition here is that if same mappings don't affect the source at all,
|
|
68784
|
+
// and the source is compatible with the unmapped target, then they must
|
|
68785
|
+
// still reside in the same domain.
|
|
68786
|
+
var mappingStack = [];
|
|
68787
|
+
while (target.flags & 268435456 /* StringMapping */) {
|
|
68788
|
+
mappingStack.unshift(target.symbol);
|
|
68789
|
+
target = target.type;
|
|
68790
|
+
}
|
|
68791
|
+
var mappedSource = ts.reduceLeft(mappingStack, function (memo, value) { return getStringMappingType(value, memo); }, source);
|
|
68792
|
+
return mappedSource === source && isMemberOfStringMapping(source, target);
|
|
68793
|
+
}
|
|
68794
|
+
return false;
|
|
68795
|
+
}
|
|
68718
68796
|
function isValidTypeForTemplateLiteralPlaceholder(source, target) {
|
|
68719
68797
|
if (source === target || target.flags & (1 /* Any */ | 4 /* String */)) {
|
|
68720
68798
|
return true;
|
|
@@ -68723,7 +68801,8 @@ var ts;
|
|
|
68723
68801
|
var value = source.value;
|
|
68724
68802
|
return !!(target.flags & 8 /* Number */ && isValidNumberString(value, /*roundTripOnly*/ false) ||
|
|
68725
68803
|
target.flags & 64 /* BigInt */ && isValidBigIntString(value, /*roundTripOnly*/ false) ||
|
|
68726
|
-
target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName
|
|
68804
|
+
target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName ||
|
|
68805
|
+
target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target));
|
|
68727
68806
|
}
|
|
68728
68807
|
if (source.flags & 134217728 /* TemplateLiteral */) {
|
|
68729
68808
|
var texts = source.texts;
|
|
@@ -85602,6 +85681,7 @@ var ts;
|
|
|
85602
85681
|
return true;
|
|
85603
85682
|
}
|
|
85604
85683
|
function checkAliasSymbol(node) {
|
|
85684
|
+
var _a, _b, _c, _d, _e;
|
|
85605
85685
|
var symbol = getSymbolOfNode(node);
|
|
85606
85686
|
var target = resolveAlias(symbol);
|
|
85607
85687
|
if (target !== unknownSymbol) {
|
|
@@ -85612,6 +85692,31 @@ var ts;
|
|
|
85612
85692
|
// otherwise it will conflict with some local declaration). Note that in addition to normal flags we include matching SymbolFlags.Export*
|
|
85613
85693
|
// in order to prevent collisions with declarations that were exported from the current module (they still contribute to local names).
|
|
85614
85694
|
symbol = getMergedSymbol(symbol.exportSymbol || symbol);
|
|
85695
|
+
// A type-only import/export will already have a grammar error in a JS file, so no need to issue more errors within
|
|
85696
|
+
if (ts.isInJSFile(node) && !(target.flags & 111551 /* Value */) && !ts.isTypeOnlyImportOrExportDeclaration(node)) {
|
|
85697
|
+
var errorNode = ts.isImportOrExportSpecifier(node) ? node.propertyName || node.name :
|
|
85698
|
+
ts.isNamedDeclaration(node) ? node.name :
|
|
85699
|
+
node;
|
|
85700
|
+
ts.Debug.assert(node.kind !== 274 /* NamespaceExport */);
|
|
85701
|
+
if (node.kind === 275 /* ExportSpecifier */) {
|
|
85702
|
+
var diag = error(errorNode, ts.Diagnostics.Types_cannot_appear_in_export_declarations_in_JavaScript_files);
|
|
85703
|
+
var alreadyExportedSymbol = (_b = (_a = ts.getSourceFileOfNode(node).symbol) === null || _a === void 0 ? void 0 : _a.exports) === null || _b === void 0 ? void 0 : _b.get((node.propertyName || node.name).escapedText);
|
|
85704
|
+
if (alreadyExportedSymbol === target) {
|
|
85705
|
+
var exportingDeclaration = (_c = alreadyExportedSymbol.declarations) === null || _c === void 0 ? void 0 : _c.find(ts.isJSDocNode);
|
|
85706
|
+
if (exportingDeclaration) {
|
|
85707
|
+
ts.addRelatedInfo(diag, ts.createDiagnosticForNode(exportingDeclaration, ts.Diagnostics._0_is_automatically_exported_here, ts.unescapeLeadingUnderscores(alreadyExportedSymbol.escapedName)));
|
|
85708
|
+
}
|
|
85709
|
+
}
|
|
85710
|
+
}
|
|
85711
|
+
else {
|
|
85712
|
+
ts.Debug.assert(node.kind !== 254 /* VariableDeclaration */);
|
|
85713
|
+
var importDeclaration = ts.findAncestor(node, ts.or(ts.isImportDeclaration, ts.isImportEqualsDeclaration));
|
|
85714
|
+
var moduleSpecifier = (_e = (importDeclaration && ((_d = ts.tryGetModuleSpecifierFromDeclaration(importDeclaration)) === null || _d === void 0 ? void 0 : _d.text))) !== null && _e !== void 0 ? _e : "...";
|
|
85715
|
+
var importedIdentifier = ts.unescapeLeadingUnderscores(ts.isIdentifier(errorNode) ? errorNode.escapedText : symbol.escapedName);
|
|
85716
|
+
error(errorNode, ts.Diagnostics._0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation, importedIdentifier, "import(\"" + moduleSpecifier + "\")." + importedIdentifier);
|
|
85717
|
+
}
|
|
85718
|
+
return;
|
|
85719
|
+
}
|
|
85615
85720
|
var excludedMeanings = (symbol.flags & (111551 /* Value */ | 1048576 /* ExportValue */) ? 111551 /* Value */ : 0) |
|
|
85616
85721
|
(symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) |
|
|
85617
85722
|
(symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0);
|
|
@@ -132,6 +132,8 @@
|
|
|
132
132
|
"Add_definite_assignment_assertion_to_property_0_95020": "向属性“{0}”添加明确的赋值断言",
|
|
133
133
|
"Add_definite_assignment_assertions_to_all_uninitialized_properties_95028": "将明确赋值断言添加到未初始化的所有属性",
|
|
134
134
|
"Add_export_to_make_this_file_into_a_module_95097": "添加 \"export {}\",将此文件变为模块",
|
|
135
|
+
"Add_extends_constraint_2211": "添加 `extends` 约束。",
|
|
136
|
+
"Add_extends_constraint_to_all_type_parameters_2212": "将 `extends` 约束添加到所有类型参数",
|
|
135
137
|
"Add_import_from_0_90057": "从“{0}”添加导入",
|
|
136
138
|
"Add_index_signature_for_property_0_90017": "为属性“{0}”添加索引签名",
|
|
137
139
|
"Add_initializer_to_property_0_95019": "向属性“{0}”添加初始值设定项",
|
|
@@ -1493,7 +1495,7 @@
|
|
|
1493
1495
|
"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": "此语法需要一个导入的帮助程序,但找不到模块“{0}”。",
|
|
1494
1496
|
"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": "此语法需要名为 \"{1}\" 的导入帮助器,\"{0}\" 中不存在该帮助器。请考虑升级 \"{0}\" 的版本。",
|
|
1495
1497
|
"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": "此语法需要一个名为 \"{1}\" 且包含 {2} 参数的导入帮助程序,该帮助程序与 \"{0}\" 中的相应帮助程序不兼容。请考虑升级 \"{0}\" 的版本。",
|
|
1496
|
-
"
|
|
1498
|
+
"This_type_parameter_might_need_an_extends_0_constraint_2208": "此类型参数可能需要 `extends {0}` 约束。",
|
|
1497
1499
|
"This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326": "“import” 的这种用法无效。可以写入 “import()” 调用,但它们必须具有括号,并且不能带有类型参数。",
|
|
1498
1500
|
"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378": "仅当 “module” 选项设置为 “es2022”、“esnext”、“system”、“node16” 或 “nodenext”,且 “target” 选项设置为 “es2017” 或更高版本时,才允许使用顶级 “await” 表达式。",
|
|
1499
1501
|
"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": ".d.ts 文件中的顶级声明必须以 \"declare\" 或 \"export\" 修饰符开头。",
|
|
@@ -1651,6 +1653,7 @@
|
|
|
1651
1653
|
"Watch_and_Build_Modes_6250": "观看和生成模式",
|
|
1652
1654
|
"Watch_input_files_6005": "监视输入文件。",
|
|
1653
1655
|
"Watch_option_0_requires_a_value_of_type_1_5080": "观察选项 \"{0}\" 需要 {1} 类型的值。",
|
|
1656
|
+
"We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843": "我们只能通过在此处为整个参数添加类型来写入“{0}”的类型。",
|
|
1654
1657
|
"When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible_6698": "分配函数时,请检查以确保参数和返回值与子类型兼容。",
|
|
1655
1658
|
"When_type_checking_take_into_account_null_and_undefined_6699": "进行类型检查时,请考虑 “null” 和 “undefined”。",
|
|
1656
1659
|
"Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen_6191": "是否在监视模式下保留过时的控制台输出,而不是清除屏幕。",
|
|
@@ -1690,6 +1693,7 @@
|
|
|
1690
1693
|
"_0_index_type_1_is_not_assignable_to_2_index_type_3_2413": "“{0}”索引类型“{1}”不能分配给“{2}”索引类型“{3}”。",
|
|
1691
1694
|
"_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692": "“{0}”是基元,但“{1}”是包装器对象。如可能首选使用“{0}”。",
|
|
1692
1695
|
"_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedMod_1444": "\"{0}\" 是一种类型,在同时启用了 \"preserveValueImports\" 和 \"isolatedModules\" 时,必须使用仅类型导入进行导入。",
|
|
1696
|
+
"_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation_2842": "“{0}”是“{1}”的未使用重命名。是否打算将其用作类型批注?",
|
|
1693
1697
|
"_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_5075": "\"{0}\" 可赋给 \"{1}\" 类型的约束,但可以使用约束 \"{2}\" 的其他子类型实例化 \"{1}\"。",
|
|
1694
1698
|
"_0_is_declared_but_its_value_is_never_read_6133": "已声明“{0}”,但从未读取其值。",
|
|
1695
1699
|
"_0_is_declared_but_never_used_6196": "“{0}”已声明,但从未使用过。",
|
|
@@ -132,6 +132,8 @@
|
|
|
132
132
|
"Add_definite_assignment_assertion_to_property_0_95020": "將明確指派判斷提示新增至屬性 '{0}'",
|
|
133
133
|
"Add_definite_assignment_assertions_to_all_uninitialized_properties_95028": "為所有未初始化的屬性新增明確的指派判斷提示",
|
|
134
134
|
"Add_export_to_make_this_file_into_a_module_95097": "新增 'export {}' 以將此檔案轉為模組",
|
|
135
|
+
"Add_extends_constraint_2211": "新增 'extends' 限制式。",
|
|
136
|
+
"Add_extends_constraint_to_all_type_parameters_2212": "將 'extends' 限制式新增至所有類型參數",
|
|
135
137
|
"Add_import_from_0_90057": "從 \"{0}\" 新增匯入",
|
|
136
138
|
"Add_index_signature_for_property_0_90017": "為屬性 '{0}' 新增索引簽章",
|
|
137
139
|
"Add_initializer_to_property_0_95019": "將初始設定式新增至屬性 '{0}'",
|
|
@@ -1493,7 +1495,7 @@
|
|
|
1493
1495
|
"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": "此語法需要已匯入的協助程式,但找不到模組 '{0}'。",
|
|
1494
1496
|
"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": "此語法需要名為 '{1}' 的已匯入協助程式,但其不存在於 '{0}' 中。請考慮升級您的 '{0}' 版本。",
|
|
1495
1497
|
"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": "此語法需要名為 '{1}' 且具有 {2} 參數的匯入協助程式,其與 '{0}' 中的參數不相容。請考慮升級 '{0}' 的版本。",
|
|
1496
|
-
"
|
|
1498
|
+
"This_type_parameter_might_need_an_extends_0_constraint_2208": "此類型參數可能需要 'extends {0}' 限制式。",
|
|
1497
1499
|
"This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326": "此 'import' 的使用方式無效。'import()' 呼叫可以寫入,但必須有括弧,而且不能有類型引數。",
|
|
1498
1500
|
"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378": "只有在 'module' 選項設定為 'es2022'、'esnext'、'system'、'node16' 或 'nodenext',而且 'target' 選項設定為 'es2017' 或更高版本時,才允許最上層的 'await' 運算式。",
|
|
1499
1501
|
"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": ".d.ts 檔案中的最上層宣告必須以 'declare' 或 'export' 修飾元開頭。",
|
|
@@ -1651,6 +1653,7 @@
|
|
|
1651
1653
|
"Watch_and_Build_Modes_6250": "觀看及建置模式",
|
|
1652
1654
|
"Watch_input_files_6005": "監看輸入檔。",
|
|
1653
1655
|
"Watch_option_0_requires_a_value_of_type_1_5080": "監看選項 '{0}' 需要 {1} 類型的值。",
|
|
1656
|
+
"We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843": "我們只能在此新增整個參數的類型,來寫入 '{0}' 的類型。",
|
|
1654
1657
|
"When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible_6698": "指派函式時,請檢查以確認參數,而且傳回值是子類型相容的。",
|
|
1655
1658
|
"When_type_checking_take_into_account_null_and_undefined_6699": "當型別檢查時,請將 'null' 和 'undefined' 納入考慮。",
|
|
1656
1659
|
"Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen_6191": "是否要將已過期的主控台輸出,維持在監看模式下,而非清除螢幕。",
|
|
@@ -1690,6 +1693,7 @@
|
|
|
1690
1693
|
"_0_index_type_1_is_not_assignable_to_2_index_type_3_2413": "'{0}' 索引類型 '{1}' 無法指派給 '{2}' 索引類型 '{3}'。",
|
|
1691
1694
|
"_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692": "'{0}' 為基元,但 '{1}' 為包裝函式物件。建議盡可能使用 '{0}'。",
|
|
1692
1695
|
"_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedMod_1444": "'{0}' 是類型,而且當 'preserveValueImports' 和 'isolatedModules' 都啟用時,必須使用僅類型匯入來匯入。",
|
|
1696
|
+
"_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation_2842": "'{0}' 是未使用的 '{1}' 重新命名。您是否想要使用它作為類型註釋?",
|
|
1693
1697
|
"_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_5075": "'{0}' 可指派給 '{1}' 類型的條件約束,但可能會將 '{1}' 以不同的條件約束 '{2}' 子類型來具現化。",
|
|
1694
1698
|
"_0_is_declared_but_its_value_is_never_read_6133": "'{0}' 已宣告但從未讀取其值。",
|
|
1695
1699
|
"_0_is_declared_but_never_used_6196": "宣告了 '{0}',但從未使用過。",
|