@typescript-deploys/pr-build 5.4.0-pr-55371-20 → 5.4.0-pr-57230-11
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/README.md +1 -1
- package/lib/cs/diagnosticMessages.generated.json +1 -1
- package/lib/de/diagnosticMessages.generated.json +1 -1
- package/lib/es/diagnosticMessages.generated.json +1 -1
- package/lib/fr/diagnosticMessages.generated.json +1 -1
- package/lib/it/diagnosticMessages.generated.json +1 -1
- package/lib/ja/diagnosticMessages.generated.json +1 -1
- package/lib/ko/diagnosticMessages.generated.json +1 -1
- package/lib/lib.esnext.collection.d.ts +46 -0
- package/lib/pl/diagnosticMessages.generated.json +1 -1
- package/lib/pt-br/diagnosticMessages.generated.json +1 -1
- package/lib/ru/diagnosticMessages.generated.json +1 -1
- package/lib/tr/diagnosticMessages.generated.json +1 -1
- package/lib/tsc.js +23 -14
- package/lib/tsserver.js +34 -23
- package/lib/typescript.js +34 -23
- package/lib/typingsInstaller.js +3 -2
- package/lib/zh-cn/diagnosticMessages.generated.json +1 -1
- package/lib/zh-tw/diagnosticMessages.generated.json +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -47,4 +47,4 @@ with any additional questions or comments.
|
|
|
47
47
|
|
|
48
48
|
## Roadmap
|
|
49
49
|
|
|
50
|
-
For details on our planned features and future direction please refer to our [roadmap](https://github.com/microsoft/TypeScript/wiki/Roadmap).
|
|
50
|
+
For details on our planned features and future direction, please refer to our [roadmap](https://github.com/microsoft/TypeScript/wiki/Roadmap).
|
|
@@ -1628,7 +1628,7 @@
|
|
|
1628
1628
|
"Unexpected_token_1012": "Neočekávaný token",
|
|
1629
1629
|
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Neočekávaný token. Očekával se konstruktor, metoda, přístupový objekt nebo vlastnost.",
|
|
1630
1630
|
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Neočekávaný token. Očekával se název parametru typu bez složených závorek.",
|
|
1631
|
-
"Unexpected_token_Did_you_mean_or_gt_1382": "Neočekávaný token. Měli jste na mysli {'>'} nebo
|
|
1631
|
+
"Unexpected_token_Did_you_mean_or_gt_1382": "Neočekávaný token. Měli jste na mysli {'>'} nebo >?",
|
|
1632
1632
|
"Unexpected_token_Did_you_mean_or_rbrace_1381": "Neočekávaný token. Měli jste na mysli {'}'} nebo }?",
|
|
1633
1633
|
"Unexpected_token_expected_1179": "Neočekávaný token. Očekává se znak {.",
|
|
1634
1634
|
"Unknown_build_option_0_5072": "Neznámá možnost sestavení {0}",
|
|
@@ -1628,7 +1628,7 @@
|
|
|
1628
1628
|
"Unexpected_token_1012": "Unerwartetes Token.",
|
|
1629
1629
|
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Unerwartetes Token. Ein Konstruktor, eine Methode, eine Zugriffsmethode oder eine Eigenschaft wurde erwartet.",
|
|
1630
1630
|
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Unerwartetes Token. Es wurde ein Typparametername ohne geschweifte Klammern erwartet.",
|
|
1631
|
-
"Unexpected_token_Did_you_mean_or_gt_1382": "Unerwartetes Token. Meinten Sie \"{'>'}\" oder \"
|
|
1631
|
+
"Unexpected_token_Did_you_mean_or_gt_1382": "Unerwartetes Token. Meinten Sie \"{'>'}\" oder \">\"?",
|
|
1632
1632
|
"Unexpected_token_Did_you_mean_or_rbrace_1381": "Unerwartetes Token. Meinten Sie \"{'}'}\" oder \"}\"?",
|
|
1633
1633
|
"Unexpected_token_expected_1179": "Unerwartetes Token. \"{\" wurde erwartet.",
|
|
1634
1634
|
"Unknown_build_option_0_5072": "Unbekannte Buildoption \"{0}\".",
|
|
@@ -1628,7 +1628,7 @@
|
|
|
1628
1628
|
"Unexpected_token_1012": "Token inesperado.",
|
|
1629
1629
|
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Token inesperado. Se esperaba un constructor, un método, un descriptor de acceso o una propiedad.",
|
|
1630
1630
|
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Token inesperado. Se esperaba un nombre de parámetro de tipo sin llaves.",
|
|
1631
|
-
"Unexpected_token_Did_you_mean_or_gt_1382": "Token inesperado. ¿Pretendía usar \"{'>'}\" o \"
|
|
1631
|
+
"Unexpected_token_Did_you_mean_or_gt_1382": "Token inesperado. ¿Pretendía usar \"{'>'}\" o \">\"?",
|
|
1632
1632
|
"Unexpected_token_Did_you_mean_or_rbrace_1381": "Token inesperado. ¿Pretendía usar \"{'}'}\" o \"}\"?",
|
|
1633
1633
|
"Unexpected_token_expected_1179": "Token inesperado. Se esperaba \"{\".",
|
|
1634
1634
|
"Unknown_build_option_0_5072": "Opción de compilación \"{0}\" desconocida.",
|
|
@@ -1628,7 +1628,7 @@
|
|
|
1628
1628
|
"Unexpected_token_1012": "Jeton inattendu.",
|
|
1629
1629
|
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Jeton inattendu. Un constructeur, une méthode, un accesseur ou une propriété est attendu.",
|
|
1630
1630
|
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Jeton inattendu. Un nom de paramètre de type est attendu sans accolades.",
|
|
1631
|
-
"Unexpected_token_Did_you_mean_or_gt_1382": "Jeton inattendu. Est-ce que vous avez voulu utiliser '{'>'}' ou '
|
|
1631
|
+
"Unexpected_token_Did_you_mean_or_gt_1382": "Jeton inattendu. Est-ce que vous avez voulu utiliser '{'>'}' ou '>' ?",
|
|
1632
1632
|
"Unexpected_token_Did_you_mean_or_rbrace_1381": "Jeton inattendu. Est-ce que vous avez voulu utiliser '{'}'}' ou '}' ?",
|
|
1633
1633
|
"Unexpected_token_expected_1179": "Jeton inattendu. '{' est attendu.",
|
|
1634
1634
|
"Unknown_build_option_0_5072": "Option de build inconnue : '{0}'.",
|
|
@@ -1628,7 +1628,7 @@
|
|
|
1628
1628
|
"Unexpected_token_1012": "Token imprevisto.",
|
|
1629
1629
|
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Token imprevisto. È previsto un costruttore, un metodo, una funzione di accesso o una proprietà.",
|
|
1630
1630
|
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Token imprevisto. Sono previsti nomi di parametro senza parentesi graffe.",
|
|
1631
|
-
"Unexpected_token_Did_you_mean_or_gt_1382": "Token imprevisto. Si intendeva `{'>'}` o
|
|
1631
|
+
"Unexpected_token_Did_you_mean_or_gt_1382": "Token imprevisto. Si intendeva `{'>'}` o `>`?",
|
|
1632
1632
|
"Unexpected_token_Did_you_mean_or_rbrace_1381": "Token imprevisto. Si intendeva `{'}'}` o `}`?",
|
|
1633
1633
|
"Unexpected_token_expected_1179": "Token imprevisto. È previsto '{'.",
|
|
1634
1634
|
"Unknown_build_option_0_5072": "L'opzione di compilazione '{0}' è sconosciuta.",
|
|
@@ -1628,7 +1628,7 @@
|
|
|
1628
1628
|
"Unexpected_token_1012": "予期しないトークンです。",
|
|
1629
1629
|
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "予期しないトークンです。コンストラクター、メソッド、アクセサー、またはプロパティが必要です。",
|
|
1630
1630
|
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "予期しないトークンです。型パラメーター名には、中かっこを含めることはできません。",
|
|
1631
|
-
"Unexpected_token_Did_you_mean_or_gt_1382": "予期しないトークンです。`{'>'}` または
|
|
1631
|
+
"Unexpected_token_Did_you_mean_or_gt_1382": "予期しないトークンです。`{'>'}` または `>` を意図していましたか?",
|
|
1632
1632
|
"Unexpected_token_Did_you_mean_or_rbrace_1381": "予期しないトークンです。`{'}'}` または `}` を意図していましたか?",
|
|
1633
1633
|
"Unexpected_token_expected_1179": "予期しないトークンです。'{' が必要です。",
|
|
1634
1634
|
"Unknown_build_option_0_5072": "'{0}' は不明なビルド オプションです。",
|
|
@@ -1628,7 +1628,7 @@
|
|
|
1628
1628
|
"Unexpected_token_1012": "예기치 않은 토큰입니다.",
|
|
1629
1629
|
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "예기치 않은 토큰입니다. 생성자, 메서드, 접근자 또는 속성이 필요합니다.",
|
|
1630
1630
|
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "예기치 않은 토큰입니다. 중괄호가 없는 형식 매개 변수 이름이 필요합니다.",
|
|
1631
|
-
"Unexpected_token_Did_you_mean_or_gt_1382": "예기치 않은 토큰입니다. '{'>'}' 또는 '
|
|
1631
|
+
"Unexpected_token_Did_you_mean_or_gt_1382": "예기치 않은 토큰입니다. '{'>'}' 또는 '>'를 사용하시겠습니까?",
|
|
1632
1632
|
"Unexpected_token_Did_you_mean_or_rbrace_1381": "예기치 않은 토큰입니다. '{'}'}' 또는 '}'를 사용하시겠습니까?",
|
|
1633
1633
|
"Unexpected_token_expected_1179": "예기치 않은 토큰입니다. '{'가 있어야 합니다.",
|
|
1634
1634
|
"Unknown_build_option_0_5072": "알 수 없는 빌드 옵션 '{0}'입니다.",
|
|
@@ -27,3 +27,49 @@ interface MapConstructor {
|
|
|
27
27
|
keySelector: (item: T, index: number) => K,
|
|
28
28
|
): Map<K, T[]>;
|
|
29
29
|
}
|
|
30
|
+
|
|
31
|
+
interface SetLike<T> {
|
|
32
|
+
/**
|
|
33
|
+
* Despite its name, returns an iterable of the values in the set-like.
|
|
34
|
+
*/
|
|
35
|
+
keys(): Iterable<T>;
|
|
36
|
+
/**
|
|
37
|
+
* @returns a boolean indicating whether an element with the specified value exists in the set-like or not.
|
|
38
|
+
*/
|
|
39
|
+
has(value: T): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* @returns the number of (unique) elements in the set-like.
|
|
42
|
+
*/
|
|
43
|
+
readonly size: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface Set<T> {
|
|
47
|
+
/**
|
|
48
|
+
* @returns a new Set containing all the elements in this Set and also all the elements in the argument.
|
|
49
|
+
*/
|
|
50
|
+
union(other: SetLike<T>): Set<T>;
|
|
51
|
+
/**
|
|
52
|
+
* @returns a new Set containing all the elements which are both in this Set and in the argument.
|
|
53
|
+
*/
|
|
54
|
+
intersection(other: SetLike<T>): Set<T>;
|
|
55
|
+
/**
|
|
56
|
+
* @returns a new Set containing all the elements in this Set which are not also in the argument.
|
|
57
|
+
*/
|
|
58
|
+
difference(other: SetLike<T>): Set<T>;
|
|
59
|
+
/**
|
|
60
|
+
* @returns a new Set containing all the elements in this Set which are in this or in the argument, but not in both.
|
|
61
|
+
*/
|
|
62
|
+
symmetricDifference(other: SetLike<T>): Set<T>;
|
|
63
|
+
/**
|
|
64
|
+
* @returns a boolean indicating whether all the elements in this Set are also in the argument.
|
|
65
|
+
*/
|
|
66
|
+
isSubsetOf(other: SetLike<T>): Set<T>;
|
|
67
|
+
/**
|
|
68
|
+
* @returns a boolean indicating whether all the elements in the argument are also in this Set.
|
|
69
|
+
*/
|
|
70
|
+
isSupersetOf(other: SetLike<T>): Set<T>;
|
|
71
|
+
/**
|
|
72
|
+
* @returns a boolean indicating whether this Set has no elements in common with the argument.
|
|
73
|
+
*/
|
|
74
|
+
isDisjointFrom(other: SetLike<T>): Set<T>;
|
|
75
|
+
}
|
|
@@ -1628,7 +1628,7 @@
|
|
|
1628
1628
|
"Unexpected_token_1012": "Nieoczekiwany token.",
|
|
1629
1629
|
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Nieoczekiwany token. Oczekiwano konstruktora, metody, metody dostępu lub właściwości.",
|
|
1630
1630
|
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Nieoczekiwany token. Oczekiwano nazwy parametru typu bez nawiasów klamrowych.",
|
|
1631
|
-
"Unexpected_token_Did_you_mean_or_gt_1382": "Nieoczekiwany token. Czy chodziło o „{'>'}” lub
|
|
1631
|
+
"Unexpected_token_Did_you_mean_or_gt_1382": "Nieoczekiwany token. Czy chodziło o „{'>'}” lub „>”?",
|
|
1632
1632
|
"Unexpected_token_Did_you_mean_or_rbrace_1381": "Nieoczekiwany token. Czy chodziło o „{'}'}” lub „}”?",
|
|
1633
1633
|
"Unexpected_token_expected_1179": "Nieoczekiwany token. Oczekiwano znaku „{”.",
|
|
1634
1634
|
"Unknown_build_option_0_5072": "Nieznana opcja kompilacji „{0}”.",
|
|
@@ -1628,7 +1628,7 @@
|
|
|
1628
1628
|
"Unexpected_token_1012": "Token inesperado.",
|
|
1629
1629
|
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Token inesperado. Um construtor, método, acessador ou propriedade era esperado.",
|
|
1630
1630
|
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Token inesperado. Era esperado um nome de parâmetro de tipo sem chaves.",
|
|
1631
|
-
"Unexpected_token_Did_you_mean_or_gt_1382": "Token inesperado. Você quis dizer '{'>'}' ou '
|
|
1631
|
+
"Unexpected_token_Did_you_mean_or_gt_1382": "Token inesperado. Você quis dizer '{'>'}' ou '>'?",
|
|
1632
1632
|
"Unexpected_token_Did_you_mean_or_rbrace_1381": "Token inesperado. Você quis dizer '{'}'}' ou '}'?",
|
|
1633
1633
|
"Unexpected_token_expected_1179": "Token inesperado. '{' esperado.",
|
|
1634
1634
|
"Unknown_build_option_0_5072": "Opção de build '{0}' desconhecida.",
|
|
@@ -1628,7 +1628,7 @@
|
|
|
1628
1628
|
"Unexpected_token_1012": "Неожиданный токен.",
|
|
1629
1629
|
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Неожиданный токен. Ожидался конструктор, метод, метод доступа или свойство.",
|
|
1630
1630
|
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Непредвиденная лексема. Ожидалось имя параметра типа без фигурных скобок.",
|
|
1631
|
-
"Unexpected_token_Did_you_mean_or_gt_1382": "Непредвиденный токен. Возможно, вы хотели использовать \"{'>'}\" или \"
|
|
1631
|
+
"Unexpected_token_Did_you_mean_or_gt_1382": "Непредвиденный токен. Возможно, вы хотели использовать \"{'>'}\" или \">\"?",
|
|
1632
1632
|
"Unexpected_token_Did_you_mean_or_rbrace_1381": "Непредвиденный токен. Возможно, вы хотели использовать \"{'}'}\" или \"}\"?",
|
|
1633
1633
|
"Unexpected_token_expected_1179": "Неожиданный токен. Ожидался символ \"{\".",
|
|
1634
1634
|
"Unknown_build_option_0_5072": "Неизвестный параметр сборки \"{0}\".",
|
|
@@ -1628,7 +1628,7 @@
|
|
|
1628
1628
|
"Unexpected_token_1012": "Beklenmeyen belirteç.",
|
|
1629
1629
|
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Beklenmeyen belirteç. Bir oluşturucu, metot, erişimci veya özellik bekleniyordu.",
|
|
1630
1630
|
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Beklenmeyen belirteç. Küme ayracı olmadan bir tür parametresi adı bekleniyordu.",
|
|
1631
|
-
"Unexpected_token_Did_you_mean_or_gt_1382": "Beklenmeyen belirteç. Şunu mu demek istediniz: `{'>'}` veya
|
|
1631
|
+
"Unexpected_token_Did_you_mean_or_gt_1382": "Beklenmeyen belirteç. Şunu mu demek istediniz: `{'>'}` veya `>`?",
|
|
1632
1632
|
"Unexpected_token_Did_you_mean_or_rbrace_1381": "Beklenmeyen belirteç. Şunu mu demek istediniz: `{'}'}` veya `}`?",
|
|
1633
1633
|
"Unexpected_token_expected_1179": "Beklenmeyen belirteç. '{' bekleniyordu.",
|
|
1634
1634
|
"Unknown_build_option_0_5072": "Bilinmeyen '{0}' derleme seçeneği.",
|
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.4";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240131`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -3635,6 +3635,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
3635
3635
|
TypeFlags2[TypeFlags2["NonPrimitive"] = 67108864] = "NonPrimitive";
|
|
3636
3636
|
TypeFlags2[TypeFlags2["TemplateLiteral"] = 134217728] = "TemplateLiteral";
|
|
3637
3637
|
TypeFlags2[TypeFlags2["StringMapping"] = 268435456] = "StringMapping";
|
|
3638
|
+
TypeFlags2[TypeFlags2["Reserved1"] = 536870912] = "Reserved1";
|
|
3638
3639
|
TypeFlags2[TypeFlags2["AnyOrUnknown"] = 3] = "AnyOrUnknown";
|
|
3639
3640
|
TypeFlags2[TypeFlags2["Nullable"] = 98304] = "Nullable";
|
|
3640
3641
|
TypeFlags2[TypeFlags2["Literal"] = 2944] = "Literal";
|
|
@@ -3672,7 +3673,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
3672
3673
|
TypeFlags2[TypeFlags2["IncludesWildcard"] = 8388608 /* IndexedAccess */] = "IncludesWildcard";
|
|
3673
3674
|
TypeFlags2[TypeFlags2["IncludesEmptyObject"] = 16777216 /* Conditional */] = "IncludesEmptyObject";
|
|
3674
3675
|
TypeFlags2[TypeFlags2["IncludesInstantiable"] = 33554432 /* Substitution */] = "IncludesInstantiable";
|
|
3675
|
-
TypeFlags2[TypeFlags2["IncludesConstrainedTypeVariable"] =
|
|
3676
|
+
TypeFlags2[TypeFlags2["IncludesConstrainedTypeVariable"] = 536870912 /* Reserved1 */] = "IncludesConstrainedTypeVariable";
|
|
3676
3677
|
TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323331] = "NotPrimitiveUnion";
|
|
3677
3678
|
return TypeFlags2;
|
|
3678
3679
|
})(TypeFlags || {});
|
|
@@ -45914,6 +45915,11 @@ function createTypeChecker(host) {
|
|
|
45914
45915
|
diagnosticMessage = error(errorLocation, Diagnostics.Class_0_used_before_its_declaration, declarationName);
|
|
45915
45916
|
} else if (result.flags & 256 /* RegularEnum */) {
|
|
45916
45917
|
diagnosticMessage = error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
|
|
45918
|
+
} else {
|
|
45919
|
+
Debug.assert(!!(result.flags & 128 /* ConstEnum */));
|
|
45920
|
+
if (getIsolatedModules(compilerOptions)) {
|
|
45921
|
+
diagnosticMessage = error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
|
|
45922
|
+
}
|
|
45917
45923
|
}
|
|
45918
45924
|
if (diagnosticMessage) {
|
|
45919
45925
|
addRelatedInfo(diagnosticMessage, createDiagnosticForNode(declaration, Diagnostics._0_is_declared_here, declarationName));
|
|
@@ -55063,7 +55069,7 @@ function createTypeChecker(host) {
|
|
|
55063
55069
|
return simplified !== type ? simplified : getConstraintOfType(type);
|
|
55064
55070
|
}
|
|
55065
55071
|
function getConstraintFromIndexedAccess(type) {
|
|
55066
|
-
if (isMappedTypeGenericIndexedAccess(type)
|
|
55072
|
+
if (isMappedTypeGenericIndexedAccess(type)) {
|
|
55067
55073
|
return substituteIndexedMappedType(type.objectType, type.indexType);
|
|
55068
55074
|
}
|
|
55069
55075
|
const indexConstraint = getSimplifiedTypeOrConstraint(type.indexType);
|
|
@@ -55576,10 +55582,14 @@ function createTypeChecker(host) {
|
|
|
55576
55582
|
return errorInfo;
|
|
55577
55583
|
}
|
|
55578
55584
|
function getPropertyOfType(type, name, skipObjectFunctionPropertyAugment, includeTypeOnlyMembers) {
|
|
55585
|
+
var _a, _b;
|
|
55579
55586
|
type = getReducedApparentType(type);
|
|
55580
55587
|
if (type.flags & 524288 /* Object */) {
|
|
55581
55588
|
const resolved = resolveStructuredTypeMembers(type);
|
|
55582
55589
|
const symbol = resolved.members.get(name);
|
|
55590
|
+
if (symbol && !includeTypeOnlyMembers && ((_a = type.symbol) == null ? void 0 : _a.flags) & 512 /* ValueModule */ && ((_b = getSymbolLinks(type.symbol).typeOnlyExportStarMap) == null ? void 0 : _b.has(name))) {
|
|
55591
|
+
return void 0;
|
|
55592
|
+
}
|
|
55583
55593
|
if (symbol && symbolIsValue(symbol, includeTypeOnlyMembers)) {
|
|
55584
55594
|
return symbol;
|
|
55585
55595
|
}
|
|
@@ -57482,7 +57492,7 @@ function createTypeChecker(host) {
|
|
|
57482
57492
|
if (flags & 465829888 /* Instantiable */)
|
|
57483
57493
|
includes |= 33554432 /* IncludesInstantiable */;
|
|
57484
57494
|
if (flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */)
|
|
57485
|
-
includes |=
|
|
57495
|
+
includes |= 536870912 /* IncludesConstrainedTypeVariable */;
|
|
57486
57496
|
if (type === wildcardType)
|
|
57487
57497
|
includes |= 8388608 /* IncludesWildcard */;
|
|
57488
57498
|
if (!strictNullChecks && flags & 98304 /* Nullable */) {
|
|
@@ -57575,18 +57585,21 @@ function createTypeChecker(host) {
|
|
|
57575
57585
|
}
|
|
57576
57586
|
}
|
|
57577
57587
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
57578
|
-
const templates = filter(types,
|
|
57588
|
+
const templates = filter(types, isPatternLiteralType);
|
|
57579
57589
|
if (templates.length) {
|
|
57580
57590
|
let i = types.length;
|
|
57581
57591
|
while (i > 0) {
|
|
57582
57592
|
i--;
|
|
57583
57593
|
const t = types[i];
|
|
57584
|
-
if (t.flags & 128 /* StringLiteral */ && some(templates, (template) =>
|
|
57594
|
+
if (t.flags & 128 /* StringLiteral */ && some(templates, (template) => isTypeMatchedByTemplateLiteralOrStringMapping(t, template))) {
|
|
57585
57595
|
orderedRemoveItemAt(types, i);
|
|
57586
57596
|
}
|
|
57587
57597
|
}
|
|
57588
57598
|
}
|
|
57589
57599
|
}
|
|
57600
|
+
function isTypeMatchedByTemplateLiteralOrStringMapping(type, template) {
|
|
57601
|
+
return template.flags & 134217728 /* TemplateLiteral */ ? isTypeMatchedByTemplateLiteralType(type, template) : isMemberOfStringMapping(type, template);
|
|
57602
|
+
}
|
|
57590
57603
|
function removeConstrainedTypeVariables(types) {
|
|
57591
57604
|
const typeVariables = [];
|
|
57592
57605
|
for (const type of types) {
|
|
@@ -57684,10 +57697,10 @@ function createTypeChecker(host) {
|
|
|
57684
57697
|
if (includes & (32 /* Enum */ | 2944 /* Literal */ | 8192 /* UniqueESSymbol */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
|
|
57685
57698
|
removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */));
|
|
57686
57699
|
}
|
|
57687
|
-
if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) {
|
|
57700
|
+
if (includes & 128 /* StringLiteral */ && includes & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) {
|
|
57688
57701
|
removeStringLiteralsMatchedByTemplateLiterals(typeSet);
|
|
57689
57702
|
}
|
|
57690
|
-
if (includes &
|
|
57703
|
+
if (includes & 536870912 /* IncludesConstrainedTypeVariable */) {
|
|
57691
57704
|
removeConstrainedTypeVariables(typeSet);
|
|
57692
57705
|
}
|
|
57693
57706
|
if (unionReduction === 2 /* Subtype */) {
|
|
@@ -57851,7 +57864,7 @@ function createTypeChecker(host) {
|
|
|
57851
57864
|
while (i > 0) {
|
|
57852
57865
|
i--;
|
|
57853
57866
|
const t = types[i];
|
|
57854
|
-
if (!(t.flags & 134217728 /* TemplateLiteral */))
|
|
57867
|
+
if (!(t.flags & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)))
|
|
57855
57868
|
continue;
|
|
57856
57869
|
for (const t2 of literals) {
|
|
57857
57870
|
if (isTypeSubtypeOf(t2, t)) {
|
|
@@ -57925,7 +57938,7 @@ function createTypeChecker(host) {
|
|
|
57925
57938
|
if (strictNullChecks && includes & 98304 /* Nullable */ && includes & (524288 /* Object */ | 67108864 /* NonPrimitive */ | 16777216 /* IncludesEmptyObject */) || includes & 67108864 /* NonPrimitive */ && includes & (469892092 /* DisjointDomains */ & ~67108864 /* NonPrimitive */) || includes & 402653316 /* StringLike */ && includes & (469892092 /* DisjointDomains */ & ~402653316 /* StringLike */) || includes & 296 /* NumberLike */ && includes & (469892092 /* DisjointDomains */ & ~296 /* NumberLike */) || includes & 2112 /* BigIntLike */ && includes & (469892092 /* DisjointDomains */ & ~2112 /* BigIntLike */) || includes & 12288 /* ESSymbolLike */ && includes & (469892092 /* DisjointDomains */ & ~12288 /* ESSymbolLike */) || includes & 49152 /* VoidLike */ && includes & (469892092 /* DisjointDomains */ & ~49152 /* VoidLike */)) {
|
|
57926
57939
|
return neverType;
|
|
57927
57940
|
}
|
|
57928
|
-
if (includes & 134217728 /* TemplateLiteral */ && includes & 128 /* StringLiteral */ && extractRedundantTemplateLiterals(typeSet)) {
|
|
57941
|
+
if (includes & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && includes & 128 /* StringLiteral */ && extractRedundantTemplateLiterals(typeSet)) {
|
|
57929
57942
|
return neverType;
|
|
57930
57943
|
}
|
|
57931
57944
|
if (includes & 1 /* Any */) {
|
|
@@ -58192,7 +58205,6 @@ function createTypeChecker(host) {
|
|
|
58192
58205
|
return links.resolvedType;
|
|
58193
58206
|
}
|
|
58194
58207
|
function getTemplateLiteralType(texts, types) {
|
|
58195
|
-
var _a, _b;
|
|
58196
58208
|
const unionIndex = findIndex(types, (t) => !!(t.flags & (131072 /* Never */ | 1048576 /* Union */)));
|
|
58197
58209
|
if (unionIndex >= 0) {
|
|
58198
58210
|
return checkCrossProductUnion(types) ? mapType(types[unionIndex], (t) => getTemplateLiteralType(texts, replaceElement(types, unionIndex, t))) : errorType;
|
|
@@ -58200,9 +58212,6 @@ function createTypeChecker(host) {
|
|
|
58200
58212
|
if (contains(types, wildcardType)) {
|
|
58201
58213
|
return wildcardType;
|
|
58202
58214
|
}
|
|
58203
|
-
if (texts.length === 2 && texts[0] === "" && texts[1] === "" && !(types[0].flags & 2944 /* Literal */) && !((_b = (_a = types[0].symbol) == null ? void 0 : _a.declarations) == null ? void 0 : _b.some((d) => d.parent.kind === 195 /* InferType */)) && isTypeAssignableTo(types[0], stringType)) {
|
|
58204
|
-
return types[0];
|
|
58205
|
-
}
|
|
58206
58215
|
const newTypes = [];
|
|
58207
58216
|
const newTexts = [];
|
|
58208
58217
|
let text = texts[0];
|
package/lib/tsserver.js
CHANGED
|
@@ -2340,7 +2340,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2340
2340
|
|
|
2341
2341
|
// src/compiler/corePublic.ts
|
|
2342
2342
|
var versionMajorMinor = "5.4";
|
|
2343
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2343
|
+
var version = `${versionMajorMinor}.0-insiders.20240131`;
|
|
2344
2344
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2345
2345
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2346
2346
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6659,6 +6659,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
6659
6659
|
TypeFlags2[TypeFlags2["NonPrimitive"] = 67108864] = "NonPrimitive";
|
|
6660
6660
|
TypeFlags2[TypeFlags2["TemplateLiteral"] = 134217728] = "TemplateLiteral";
|
|
6661
6661
|
TypeFlags2[TypeFlags2["StringMapping"] = 268435456] = "StringMapping";
|
|
6662
|
+
TypeFlags2[TypeFlags2["Reserved1"] = 536870912] = "Reserved1";
|
|
6662
6663
|
TypeFlags2[TypeFlags2["AnyOrUnknown"] = 3] = "AnyOrUnknown";
|
|
6663
6664
|
TypeFlags2[TypeFlags2["Nullable"] = 98304] = "Nullable";
|
|
6664
6665
|
TypeFlags2[TypeFlags2["Literal"] = 2944] = "Literal";
|
|
@@ -6696,7 +6697,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
6696
6697
|
TypeFlags2[TypeFlags2["IncludesWildcard"] = 8388608 /* IndexedAccess */] = "IncludesWildcard";
|
|
6697
6698
|
TypeFlags2[TypeFlags2["IncludesEmptyObject"] = 16777216 /* Conditional */] = "IncludesEmptyObject";
|
|
6698
6699
|
TypeFlags2[TypeFlags2["IncludesInstantiable"] = 33554432 /* Substitution */] = "IncludesInstantiable";
|
|
6699
|
-
TypeFlags2[TypeFlags2["IncludesConstrainedTypeVariable"] =
|
|
6700
|
+
TypeFlags2[TypeFlags2["IncludesConstrainedTypeVariable"] = 536870912 /* Reserved1 */] = "IncludesConstrainedTypeVariable";
|
|
6700
6701
|
TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323331] = "NotPrimitiveUnion";
|
|
6701
6702
|
return TypeFlags2;
|
|
6702
6703
|
})(TypeFlags || {});
|
|
@@ -50649,6 +50650,11 @@ function createTypeChecker(host) {
|
|
|
50649
50650
|
diagnosticMessage = error2(errorLocation, Diagnostics.Class_0_used_before_its_declaration, declarationName);
|
|
50650
50651
|
} else if (result.flags & 256 /* RegularEnum */) {
|
|
50651
50652
|
diagnosticMessage = error2(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
|
|
50653
|
+
} else {
|
|
50654
|
+
Debug.assert(!!(result.flags & 128 /* ConstEnum */));
|
|
50655
|
+
if (getIsolatedModules(compilerOptions)) {
|
|
50656
|
+
diagnosticMessage = error2(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
|
|
50657
|
+
}
|
|
50652
50658
|
}
|
|
50653
50659
|
if (diagnosticMessage) {
|
|
50654
50660
|
addRelatedInfo(diagnosticMessage, createDiagnosticForNode(declaration, Diagnostics._0_is_declared_here, declarationName));
|
|
@@ -59798,7 +59804,7 @@ function createTypeChecker(host) {
|
|
|
59798
59804
|
return simplified !== type ? simplified : getConstraintOfType(type);
|
|
59799
59805
|
}
|
|
59800
59806
|
function getConstraintFromIndexedAccess(type) {
|
|
59801
|
-
if (isMappedTypeGenericIndexedAccess(type)
|
|
59807
|
+
if (isMappedTypeGenericIndexedAccess(type)) {
|
|
59802
59808
|
return substituteIndexedMappedType(type.objectType, type.indexType);
|
|
59803
59809
|
}
|
|
59804
59810
|
const indexConstraint = getSimplifiedTypeOrConstraint(type.indexType);
|
|
@@ -60311,10 +60317,14 @@ function createTypeChecker(host) {
|
|
|
60311
60317
|
return errorInfo;
|
|
60312
60318
|
}
|
|
60313
60319
|
function getPropertyOfType(type, name, skipObjectFunctionPropertyAugment, includeTypeOnlyMembers) {
|
|
60320
|
+
var _a, _b;
|
|
60314
60321
|
type = getReducedApparentType(type);
|
|
60315
60322
|
if (type.flags & 524288 /* Object */) {
|
|
60316
60323
|
const resolved = resolveStructuredTypeMembers(type);
|
|
60317
60324
|
const symbol = resolved.members.get(name);
|
|
60325
|
+
if (symbol && !includeTypeOnlyMembers && ((_a = type.symbol) == null ? void 0 : _a.flags) & 512 /* ValueModule */ && ((_b = getSymbolLinks(type.symbol).typeOnlyExportStarMap) == null ? void 0 : _b.has(name))) {
|
|
60326
|
+
return void 0;
|
|
60327
|
+
}
|
|
60318
60328
|
if (symbol && symbolIsValue(symbol, includeTypeOnlyMembers)) {
|
|
60319
60329
|
return symbol;
|
|
60320
60330
|
}
|
|
@@ -62217,7 +62227,7 @@ function createTypeChecker(host) {
|
|
|
62217
62227
|
if (flags & 465829888 /* Instantiable */)
|
|
62218
62228
|
includes |= 33554432 /* IncludesInstantiable */;
|
|
62219
62229
|
if (flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */)
|
|
62220
|
-
includes |=
|
|
62230
|
+
includes |= 536870912 /* IncludesConstrainedTypeVariable */;
|
|
62221
62231
|
if (type === wildcardType)
|
|
62222
62232
|
includes |= 8388608 /* IncludesWildcard */;
|
|
62223
62233
|
if (!strictNullChecks && flags & 98304 /* Nullable */) {
|
|
@@ -62310,18 +62320,21 @@ function createTypeChecker(host) {
|
|
|
62310
62320
|
}
|
|
62311
62321
|
}
|
|
62312
62322
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
62313
|
-
const templates = filter(types,
|
|
62323
|
+
const templates = filter(types, isPatternLiteralType);
|
|
62314
62324
|
if (templates.length) {
|
|
62315
62325
|
let i = types.length;
|
|
62316
62326
|
while (i > 0) {
|
|
62317
62327
|
i--;
|
|
62318
62328
|
const t = types[i];
|
|
62319
|
-
if (t.flags & 128 /* StringLiteral */ && some(templates, (template) =>
|
|
62329
|
+
if (t.flags & 128 /* StringLiteral */ && some(templates, (template) => isTypeMatchedByTemplateLiteralOrStringMapping(t, template))) {
|
|
62320
62330
|
orderedRemoveItemAt(types, i);
|
|
62321
62331
|
}
|
|
62322
62332
|
}
|
|
62323
62333
|
}
|
|
62324
62334
|
}
|
|
62335
|
+
function isTypeMatchedByTemplateLiteralOrStringMapping(type, template) {
|
|
62336
|
+
return template.flags & 134217728 /* TemplateLiteral */ ? isTypeMatchedByTemplateLiteralType(type, template) : isMemberOfStringMapping(type, template);
|
|
62337
|
+
}
|
|
62325
62338
|
function removeConstrainedTypeVariables(types) {
|
|
62326
62339
|
const typeVariables = [];
|
|
62327
62340
|
for (const type of types) {
|
|
@@ -62419,10 +62432,10 @@ function createTypeChecker(host) {
|
|
|
62419
62432
|
if (includes & (32 /* Enum */ | 2944 /* Literal */ | 8192 /* UniqueESSymbol */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
|
|
62420
62433
|
removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */));
|
|
62421
62434
|
}
|
|
62422
|
-
if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) {
|
|
62435
|
+
if (includes & 128 /* StringLiteral */ && includes & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) {
|
|
62423
62436
|
removeStringLiteralsMatchedByTemplateLiterals(typeSet);
|
|
62424
62437
|
}
|
|
62425
|
-
if (includes &
|
|
62438
|
+
if (includes & 536870912 /* IncludesConstrainedTypeVariable */) {
|
|
62426
62439
|
removeConstrainedTypeVariables(typeSet);
|
|
62427
62440
|
}
|
|
62428
62441
|
if (unionReduction === 2 /* Subtype */) {
|
|
@@ -62586,7 +62599,7 @@ function createTypeChecker(host) {
|
|
|
62586
62599
|
while (i > 0) {
|
|
62587
62600
|
i--;
|
|
62588
62601
|
const t = types[i];
|
|
62589
|
-
if (!(t.flags & 134217728 /* TemplateLiteral */))
|
|
62602
|
+
if (!(t.flags & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)))
|
|
62590
62603
|
continue;
|
|
62591
62604
|
for (const t2 of literals) {
|
|
62592
62605
|
if (isTypeSubtypeOf(t2, t)) {
|
|
@@ -62660,7 +62673,7 @@ function createTypeChecker(host) {
|
|
|
62660
62673
|
if (strictNullChecks && includes & 98304 /* Nullable */ && includes & (524288 /* Object */ | 67108864 /* NonPrimitive */ | 16777216 /* IncludesEmptyObject */) || includes & 67108864 /* NonPrimitive */ && includes & (469892092 /* DisjointDomains */ & ~67108864 /* NonPrimitive */) || includes & 402653316 /* StringLike */ && includes & (469892092 /* DisjointDomains */ & ~402653316 /* StringLike */) || includes & 296 /* NumberLike */ && includes & (469892092 /* DisjointDomains */ & ~296 /* NumberLike */) || includes & 2112 /* BigIntLike */ && includes & (469892092 /* DisjointDomains */ & ~2112 /* BigIntLike */) || includes & 12288 /* ESSymbolLike */ && includes & (469892092 /* DisjointDomains */ & ~12288 /* ESSymbolLike */) || includes & 49152 /* VoidLike */ && includes & (469892092 /* DisjointDomains */ & ~49152 /* VoidLike */)) {
|
|
62661
62674
|
return neverType;
|
|
62662
62675
|
}
|
|
62663
|
-
if (includes & 134217728 /* TemplateLiteral */ && includes & 128 /* StringLiteral */ && extractRedundantTemplateLiterals(typeSet)) {
|
|
62676
|
+
if (includes & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && includes & 128 /* StringLiteral */ && extractRedundantTemplateLiterals(typeSet)) {
|
|
62664
62677
|
return neverType;
|
|
62665
62678
|
}
|
|
62666
62679
|
if (includes & 1 /* Any */) {
|
|
@@ -62927,7 +62940,6 @@ function createTypeChecker(host) {
|
|
|
62927
62940
|
return links.resolvedType;
|
|
62928
62941
|
}
|
|
62929
62942
|
function getTemplateLiteralType(texts, types) {
|
|
62930
|
-
var _a, _b;
|
|
62931
62943
|
const unionIndex = findIndex(types, (t) => !!(t.flags & (131072 /* Never */ | 1048576 /* Union */)));
|
|
62932
62944
|
if (unionIndex >= 0) {
|
|
62933
62945
|
return checkCrossProductUnion(types) ? mapType(types[unionIndex], (t) => getTemplateLiteralType(texts, replaceElement(types, unionIndex, t))) : errorType;
|
|
@@ -62935,9 +62947,6 @@ function createTypeChecker(host) {
|
|
|
62935
62947
|
if (contains(types, wildcardType)) {
|
|
62936
62948
|
return wildcardType;
|
|
62937
62949
|
}
|
|
62938
|
-
if (texts.length === 2 && texts[0] === "" && texts[1] === "" && !(types[0].flags & 2944 /* Literal */) && !((_b = (_a = types[0].symbol) == null ? void 0 : _a.declarations) == null ? void 0 : _b.some((d) => d.parent.kind === 195 /* InferType */)) && isTypeAssignableTo(types[0], stringType)) {
|
|
62939
|
-
return types[0];
|
|
62940
|
-
}
|
|
62941
62950
|
const newTypes = [];
|
|
62942
62951
|
const newTexts = [];
|
|
62943
62952
|
let text = texts[0];
|
|
@@ -146873,17 +146882,19 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
146873
146882
|
Debug.assert(isJsxOpeningElement(tag) || isJsxClosingElement(tag), "tag should be opening or closing element");
|
|
146874
146883
|
const openTag = tag.parent.openingElement;
|
|
146875
146884
|
const closeTag = tag.parent.closingElement;
|
|
146876
|
-
const
|
|
146877
|
-
const
|
|
146878
|
-
const
|
|
146879
|
-
const
|
|
146880
|
-
if (
|
|
146885
|
+
const openTagNameStart = openTag.tagName.getStart(sourceFile);
|
|
146886
|
+
const openTagNameEnd = openTag.tagName.end;
|
|
146887
|
+
const closeTagNameStart = closeTag.tagName.getStart(sourceFile);
|
|
146888
|
+
const closeTagNameEnd = closeTag.tagName.end;
|
|
146889
|
+
if (openTagNameStart === openTag.getStart(sourceFile) || closeTagNameStart === closeTag.getStart(sourceFile) || openTagNameEnd === openTag.getEnd() || closeTagNameEnd === closeTag.getEnd())
|
|
146890
|
+
return void 0;
|
|
146891
|
+
if (!(openTagNameStart <= position && position <= openTagNameEnd || closeTagNameStart <= position && position <= closeTagNameEnd))
|
|
146881
146892
|
return void 0;
|
|
146882
146893
|
const openingTagText = openTag.tagName.getText(sourceFile);
|
|
146883
146894
|
if (openingTagText !== closeTag.tagName.getText(sourceFile))
|
|
146884
146895
|
return void 0;
|
|
146885
146896
|
return {
|
|
146886
|
-
ranges: [{ start:
|
|
146897
|
+
ranges: [{ start: openTagNameStart, length: openTagNameEnd - openTagNameStart }, { start: closeTagNameStart, length: closeTagNameEnd - closeTagNameStart }],
|
|
146887
146898
|
wordPattern: jsxTagWordPattern
|
|
146888
146899
|
};
|
|
146889
146900
|
}
|
|
@@ -152841,7 +152852,7 @@ function addMissingConstraint(changes, program, preferences, host, sourceFile, i
|
|
|
152841
152852
|
}
|
|
152842
152853
|
}
|
|
152843
152854
|
function tryGetConstraintFromDiagnosticMessage(messageText) {
|
|
152844
|
-
const [
|
|
152855
|
+
const [, constraint] = flattenDiagnosticMessageText(messageText, "\n", 0).match(/`extends (.*)`/) || [];
|
|
152845
152856
|
return constraint;
|
|
152846
152857
|
}
|
|
152847
152858
|
function tryGetConstraintType(checker, node) {
|
|
@@ -154838,7 +154849,7 @@ function doChange23(changes, sourceFile, arg, expression) {
|
|
|
154838
154849
|
);
|
|
154839
154850
|
}
|
|
154840
154851
|
function getSuggestion(messageText) {
|
|
154841
|
-
const [
|
|
154852
|
+
const [, suggestion] = flattenDiagnosticMessageText(messageText, "\n", 0).match(/'(.*)'/) || [];
|
|
154842
154853
|
return suggestion;
|
|
154843
154854
|
}
|
|
154844
154855
|
|
|
@@ -180777,7 +180788,7 @@ function convertScriptKindName(scriptKindName) {
|
|
|
180777
180788
|
}
|
|
180778
180789
|
}
|
|
180779
180790
|
function convertUserPreferences(preferences) {
|
|
180780
|
-
const { lazyConfiguredProjectsFromExternalProject, ...userPreferences } = preferences;
|
|
180791
|
+
const { lazyConfiguredProjectsFromExternalProject: _, ...userPreferences } = preferences;
|
|
180781
180792
|
return userPreferences;
|
|
180782
180793
|
}
|
|
180783
180794
|
var fileNamePropertyReader = {
|
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.4";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20240131`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -4412,6 +4412,7 @@ ${lanes.join("\n")}
|
|
|
4412
4412
|
TypeFlags2[TypeFlags2["NonPrimitive"] = 67108864] = "NonPrimitive";
|
|
4413
4413
|
TypeFlags2[TypeFlags2["TemplateLiteral"] = 134217728] = "TemplateLiteral";
|
|
4414
4414
|
TypeFlags2[TypeFlags2["StringMapping"] = 268435456] = "StringMapping";
|
|
4415
|
+
TypeFlags2[TypeFlags2["Reserved1"] = 536870912] = "Reserved1";
|
|
4415
4416
|
TypeFlags2[TypeFlags2["AnyOrUnknown"] = 3] = "AnyOrUnknown";
|
|
4416
4417
|
TypeFlags2[TypeFlags2["Nullable"] = 98304] = "Nullable";
|
|
4417
4418
|
TypeFlags2[TypeFlags2["Literal"] = 2944] = "Literal";
|
|
@@ -4449,7 +4450,7 @@ ${lanes.join("\n")}
|
|
|
4449
4450
|
TypeFlags2[TypeFlags2["IncludesWildcard"] = 8388608 /* IndexedAccess */] = "IncludesWildcard";
|
|
4450
4451
|
TypeFlags2[TypeFlags2["IncludesEmptyObject"] = 16777216 /* Conditional */] = "IncludesEmptyObject";
|
|
4451
4452
|
TypeFlags2[TypeFlags2["IncludesInstantiable"] = 33554432 /* Substitution */] = "IncludesInstantiable";
|
|
4452
|
-
TypeFlags2[TypeFlags2["IncludesConstrainedTypeVariable"] =
|
|
4453
|
+
TypeFlags2[TypeFlags2["IncludesConstrainedTypeVariable"] = 536870912 /* Reserved1 */] = "IncludesConstrainedTypeVariable";
|
|
4453
4454
|
TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323331] = "NotPrimitiveUnion";
|
|
4454
4455
|
return TypeFlags2;
|
|
4455
4456
|
})(TypeFlags || {});
|
|
@@ -48403,6 +48404,11 @@ ${lanes.join("\n")}
|
|
|
48403
48404
|
diagnosticMessage = error2(errorLocation, Diagnostics.Class_0_used_before_its_declaration, declarationName);
|
|
48404
48405
|
} else if (result.flags & 256 /* RegularEnum */) {
|
|
48405
48406
|
diagnosticMessage = error2(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
|
|
48407
|
+
} else {
|
|
48408
|
+
Debug.assert(!!(result.flags & 128 /* ConstEnum */));
|
|
48409
|
+
if (getIsolatedModules(compilerOptions)) {
|
|
48410
|
+
diagnosticMessage = error2(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
|
|
48411
|
+
}
|
|
48406
48412
|
}
|
|
48407
48413
|
if (diagnosticMessage) {
|
|
48408
48414
|
addRelatedInfo(diagnosticMessage, createDiagnosticForNode(declaration, Diagnostics._0_is_declared_here, declarationName));
|
|
@@ -57552,7 +57558,7 @@ ${lanes.join("\n")}
|
|
|
57552
57558
|
return simplified !== type ? simplified : getConstraintOfType(type);
|
|
57553
57559
|
}
|
|
57554
57560
|
function getConstraintFromIndexedAccess(type) {
|
|
57555
|
-
if (isMappedTypeGenericIndexedAccess(type)
|
|
57561
|
+
if (isMappedTypeGenericIndexedAccess(type)) {
|
|
57556
57562
|
return substituteIndexedMappedType(type.objectType, type.indexType);
|
|
57557
57563
|
}
|
|
57558
57564
|
const indexConstraint = getSimplifiedTypeOrConstraint(type.indexType);
|
|
@@ -58065,10 +58071,14 @@ ${lanes.join("\n")}
|
|
|
58065
58071
|
return errorInfo;
|
|
58066
58072
|
}
|
|
58067
58073
|
function getPropertyOfType(type, name, skipObjectFunctionPropertyAugment, includeTypeOnlyMembers) {
|
|
58074
|
+
var _a, _b;
|
|
58068
58075
|
type = getReducedApparentType(type);
|
|
58069
58076
|
if (type.flags & 524288 /* Object */) {
|
|
58070
58077
|
const resolved = resolveStructuredTypeMembers(type);
|
|
58071
58078
|
const symbol = resolved.members.get(name);
|
|
58079
|
+
if (symbol && !includeTypeOnlyMembers && ((_a = type.symbol) == null ? void 0 : _a.flags) & 512 /* ValueModule */ && ((_b = getSymbolLinks(type.symbol).typeOnlyExportStarMap) == null ? void 0 : _b.has(name))) {
|
|
58080
|
+
return void 0;
|
|
58081
|
+
}
|
|
58072
58082
|
if (symbol && symbolIsValue(symbol, includeTypeOnlyMembers)) {
|
|
58073
58083
|
return symbol;
|
|
58074
58084
|
}
|
|
@@ -59971,7 +59981,7 @@ ${lanes.join("\n")}
|
|
|
59971
59981
|
if (flags & 465829888 /* Instantiable */)
|
|
59972
59982
|
includes |= 33554432 /* IncludesInstantiable */;
|
|
59973
59983
|
if (flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */)
|
|
59974
|
-
includes |=
|
|
59984
|
+
includes |= 536870912 /* IncludesConstrainedTypeVariable */;
|
|
59975
59985
|
if (type === wildcardType)
|
|
59976
59986
|
includes |= 8388608 /* IncludesWildcard */;
|
|
59977
59987
|
if (!strictNullChecks && flags & 98304 /* Nullable */) {
|
|
@@ -60064,18 +60074,21 @@ ${lanes.join("\n")}
|
|
|
60064
60074
|
}
|
|
60065
60075
|
}
|
|
60066
60076
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
60067
|
-
const templates = filter(types,
|
|
60077
|
+
const templates = filter(types, isPatternLiteralType);
|
|
60068
60078
|
if (templates.length) {
|
|
60069
60079
|
let i = types.length;
|
|
60070
60080
|
while (i > 0) {
|
|
60071
60081
|
i--;
|
|
60072
60082
|
const t = types[i];
|
|
60073
|
-
if (t.flags & 128 /* StringLiteral */ && some(templates, (template) =>
|
|
60083
|
+
if (t.flags & 128 /* StringLiteral */ && some(templates, (template) => isTypeMatchedByTemplateLiteralOrStringMapping(t, template))) {
|
|
60074
60084
|
orderedRemoveItemAt(types, i);
|
|
60075
60085
|
}
|
|
60076
60086
|
}
|
|
60077
60087
|
}
|
|
60078
60088
|
}
|
|
60089
|
+
function isTypeMatchedByTemplateLiteralOrStringMapping(type, template) {
|
|
60090
|
+
return template.flags & 134217728 /* TemplateLiteral */ ? isTypeMatchedByTemplateLiteralType(type, template) : isMemberOfStringMapping(type, template);
|
|
60091
|
+
}
|
|
60079
60092
|
function removeConstrainedTypeVariables(types) {
|
|
60080
60093
|
const typeVariables = [];
|
|
60081
60094
|
for (const type of types) {
|
|
@@ -60173,10 +60186,10 @@ ${lanes.join("\n")}
|
|
|
60173
60186
|
if (includes & (32 /* Enum */ | 2944 /* Literal */ | 8192 /* UniqueESSymbol */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
|
|
60174
60187
|
removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */));
|
|
60175
60188
|
}
|
|
60176
|
-
if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) {
|
|
60189
|
+
if (includes & 128 /* StringLiteral */ && includes & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) {
|
|
60177
60190
|
removeStringLiteralsMatchedByTemplateLiterals(typeSet);
|
|
60178
60191
|
}
|
|
60179
|
-
if (includes &
|
|
60192
|
+
if (includes & 536870912 /* IncludesConstrainedTypeVariable */) {
|
|
60180
60193
|
removeConstrainedTypeVariables(typeSet);
|
|
60181
60194
|
}
|
|
60182
60195
|
if (unionReduction === 2 /* Subtype */) {
|
|
@@ -60340,7 +60353,7 @@ ${lanes.join("\n")}
|
|
|
60340
60353
|
while (i > 0) {
|
|
60341
60354
|
i--;
|
|
60342
60355
|
const t = types[i];
|
|
60343
|
-
if (!(t.flags & 134217728 /* TemplateLiteral */))
|
|
60356
|
+
if (!(t.flags & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)))
|
|
60344
60357
|
continue;
|
|
60345
60358
|
for (const t2 of literals) {
|
|
60346
60359
|
if (isTypeSubtypeOf(t2, t)) {
|
|
@@ -60414,7 +60427,7 @@ ${lanes.join("\n")}
|
|
|
60414
60427
|
if (strictNullChecks && includes & 98304 /* Nullable */ && includes & (524288 /* Object */ | 67108864 /* NonPrimitive */ | 16777216 /* IncludesEmptyObject */) || includes & 67108864 /* NonPrimitive */ && includes & (469892092 /* DisjointDomains */ & ~67108864 /* NonPrimitive */) || includes & 402653316 /* StringLike */ && includes & (469892092 /* DisjointDomains */ & ~402653316 /* StringLike */) || includes & 296 /* NumberLike */ && includes & (469892092 /* DisjointDomains */ & ~296 /* NumberLike */) || includes & 2112 /* BigIntLike */ && includes & (469892092 /* DisjointDomains */ & ~2112 /* BigIntLike */) || includes & 12288 /* ESSymbolLike */ && includes & (469892092 /* DisjointDomains */ & ~12288 /* ESSymbolLike */) || includes & 49152 /* VoidLike */ && includes & (469892092 /* DisjointDomains */ & ~49152 /* VoidLike */)) {
|
|
60415
60428
|
return neverType;
|
|
60416
60429
|
}
|
|
60417
|
-
if (includes & 134217728 /* TemplateLiteral */ && includes & 128 /* StringLiteral */ && extractRedundantTemplateLiterals(typeSet)) {
|
|
60430
|
+
if (includes & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && includes & 128 /* StringLiteral */ && extractRedundantTemplateLiterals(typeSet)) {
|
|
60418
60431
|
return neverType;
|
|
60419
60432
|
}
|
|
60420
60433
|
if (includes & 1 /* Any */) {
|
|
@@ -60681,7 +60694,6 @@ ${lanes.join("\n")}
|
|
|
60681
60694
|
return links.resolvedType;
|
|
60682
60695
|
}
|
|
60683
60696
|
function getTemplateLiteralType(texts, types) {
|
|
60684
|
-
var _a, _b;
|
|
60685
60697
|
const unionIndex = findIndex(types, (t) => !!(t.flags & (131072 /* Never */ | 1048576 /* Union */)));
|
|
60686
60698
|
if (unionIndex >= 0) {
|
|
60687
60699
|
return checkCrossProductUnion(types) ? mapType(types[unionIndex], (t) => getTemplateLiteralType(texts, replaceElement(types, unionIndex, t))) : errorType;
|
|
@@ -60689,9 +60701,6 @@ ${lanes.join("\n")}
|
|
|
60689
60701
|
if (contains(types, wildcardType)) {
|
|
60690
60702
|
return wildcardType;
|
|
60691
60703
|
}
|
|
60692
|
-
if (texts.length === 2 && texts[0] === "" && texts[1] === "" && !(types[0].flags & 2944 /* Literal */) && !((_b = (_a = types[0].symbol) == null ? void 0 : _a.declarations) == null ? void 0 : _b.some((d) => d.parent.kind === 195 /* InferType */)) && isTypeAssignableTo(types[0], stringType)) {
|
|
60693
|
-
return types[0];
|
|
60694
|
-
}
|
|
60695
60704
|
const newTypes = [];
|
|
60696
60705
|
const newTexts = [];
|
|
60697
60706
|
let text = texts[0];
|
|
@@ -144804,17 +144813,19 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
144804
144813
|
Debug.assert(isJsxOpeningElement(tag) || isJsxClosingElement(tag), "tag should be opening or closing element");
|
|
144805
144814
|
const openTag = tag.parent.openingElement;
|
|
144806
144815
|
const closeTag = tag.parent.closingElement;
|
|
144807
|
-
const
|
|
144808
|
-
const
|
|
144809
|
-
const
|
|
144810
|
-
const
|
|
144811
|
-
if (
|
|
144816
|
+
const openTagNameStart = openTag.tagName.getStart(sourceFile);
|
|
144817
|
+
const openTagNameEnd = openTag.tagName.end;
|
|
144818
|
+
const closeTagNameStart = closeTag.tagName.getStart(sourceFile);
|
|
144819
|
+
const closeTagNameEnd = closeTag.tagName.end;
|
|
144820
|
+
if (openTagNameStart === openTag.getStart(sourceFile) || closeTagNameStart === closeTag.getStart(sourceFile) || openTagNameEnd === openTag.getEnd() || closeTagNameEnd === closeTag.getEnd())
|
|
144821
|
+
return void 0;
|
|
144822
|
+
if (!(openTagNameStart <= position && position <= openTagNameEnd || closeTagNameStart <= position && position <= closeTagNameEnd))
|
|
144812
144823
|
return void 0;
|
|
144813
144824
|
const openingTagText = openTag.tagName.getText(sourceFile);
|
|
144814
144825
|
if (openingTagText !== closeTag.tagName.getText(sourceFile))
|
|
144815
144826
|
return void 0;
|
|
144816
144827
|
return {
|
|
144817
|
-
ranges: [{ start:
|
|
144828
|
+
ranges: [{ start: openTagNameStart, length: openTagNameEnd - openTagNameStart }, { start: closeTagNameStart, length: closeTagNameEnd - closeTagNameStart }],
|
|
144818
144829
|
wordPattern: jsxTagWordPattern
|
|
144819
144830
|
};
|
|
144820
144831
|
}
|
|
@@ -151573,7 +151584,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
151573
151584
|
}
|
|
151574
151585
|
}
|
|
151575
151586
|
function tryGetConstraintFromDiagnosticMessage(messageText) {
|
|
151576
|
-
const [
|
|
151587
|
+
const [, constraint] = flattenDiagnosticMessageText(messageText, "\n", 0).match(/`extends (.*)`/) || [];
|
|
151577
151588
|
return constraint;
|
|
151578
151589
|
}
|
|
151579
151590
|
function tryGetConstraintType(checker, node) {
|
|
@@ -153713,7 +153724,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
153713
153724
|
);
|
|
153714
153725
|
}
|
|
153715
153726
|
function getSuggestion(messageText) {
|
|
153716
|
-
const [
|
|
153727
|
+
const [, suggestion] = flattenDiagnosticMessageText(messageText, "\n", 0).match(/'(.*)'/) || [];
|
|
153717
153728
|
return suggestion;
|
|
153718
153729
|
}
|
|
153719
153730
|
var fixId28, errorCodes35;
|
|
@@ -178006,7 +178017,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
178006
178017
|
}
|
|
178007
178018
|
}
|
|
178008
178019
|
function convertUserPreferences(preferences) {
|
|
178009
|
-
const { lazyConfiguredProjectsFromExternalProject, ...userPreferences } = preferences;
|
|
178020
|
+
const { lazyConfiguredProjectsFromExternalProject: _, ...userPreferences } = preferences;
|
|
178010
178021
|
return userPreferences;
|
|
178011
178022
|
}
|
|
178012
178023
|
function findProjectByName(projectName, projects) {
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.4";
|
|
57
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
57
|
+
var version = `${versionMajorMinor}.0-insiders.20240131`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -3069,6 +3069,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
3069
3069
|
TypeFlags2[TypeFlags2["NonPrimitive"] = 67108864] = "NonPrimitive";
|
|
3070
3070
|
TypeFlags2[TypeFlags2["TemplateLiteral"] = 134217728] = "TemplateLiteral";
|
|
3071
3071
|
TypeFlags2[TypeFlags2["StringMapping"] = 268435456] = "StringMapping";
|
|
3072
|
+
TypeFlags2[TypeFlags2["Reserved1"] = 536870912] = "Reserved1";
|
|
3072
3073
|
TypeFlags2[TypeFlags2["AnyOrUnknown"] = 3] = "AnyOrUnknown";
|
|
3073
3074
|
TypeFlags2[TypeFlags2["Nullable"] = 98304] = "Nullable";
|
|
3074
3075
|
TypeFlags2[TypeFlags2["Literal"] = 2944] = "Literal";
|
|
@@ -3106,7 +3107,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
3106
3107
|
TypeFlags2[TypeFlags2["IncludesWildcard"] = 8388608 /* IndexedAccess */] = "IncludesWildcard";
|
|
3107
3108
|
TypeFlags2[TypeFlags2["IncludesEmptyObject"] = 16777216 /* Conditional */] = "IncludesEmptyObject";
|
|
3108
3109
|
TypeFlags2[TypeFlags2["IncludesInstantiable"] = 33554432 /* Substitution */] = "IncludesInstantiable";
|
|
3109
|
-
TypeFlags2[TypeFlags2["IncludesConstrainedTypeVariable"] =
|
|
3110
|
+
TypeFlags2[TypeFlags2["IncludesConstrainedTypeVariable"] = 536870912 /* Reserved1 */] = "IncludesConstrainedTypeVariable";
|
|
3110
3111
|
TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323331] = "NotPrimitiveUnion";
|
|
3111
3112
|
return TypeFlags2;
|
|
3112
3113
|
})(TypeFlags || {});
|
|
@@ -1628,7 +1628,7 @@
|
|
|
1628
1628
|
"Unexpected_token_1012": "意外的标记。",
|
|
1629
1629
|
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "意外的标记。应为构造函数、方法、访问器或属性。",
|
|
1630
1630
|
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "意外的标记。类型参数名不应包含大括号。",
|
|
1631
|
-
"Unexpected_token_Did_you_mean_or_gt_1382": "意外的标记。你是想使用 `{'>'}` 还是
|
|
1631
|
+
"Unexpected_token_Did_you_mean_or_gt_1382": "意外的标记。你是想使用 `{'>'}` 还是 `>`?",
|
|
1632
1632
|
"Unexpected_token_Did_you_mean_or_rbrace_1381": "意外的标记。你是想使用 `{'}'}` 还是 `}`?",
|
|
1633
1633
|
"Unexpected_token_expected_1179": "意外标记。应为 \"{\"。",
|
|
1634
1634
|
"Unknown_build_option_0_5072": "未知的生成选项 \"{0}\"。",
|
|
@@ -1628,7 +1628,7 @@
|
|
|
1628
1628
|
"Unexpected_token_1012": "未預期的語彙基元。",
|
|
1629
1629
|
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "未預期的語彙基元。必須是建構函式、方法、存取子或屬性。",
|
|
1630
1630
|
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "權杖錯誤。類型參數名稱不應有大括號。",
|
|
1631
|
-
"Unexpected_token_Did_you_mean_or_gt_1382": "未預期的語彙基元。您是指 `{'>'}` 或
|
|
1631
|
+
"Unexpected_token_Did_you_mean_or_gt_1382": "未預期的語彙基元。您是指 `{'>'}` 或 `>` 嗎?",
|
|
1632
1632
|
"Unexpected_token_Did_you_mean_or_rbrace_1381": "未預期的語彙基元。您是指 `{'}'}` 或 `}` 嗎?",
|
|
1633
1633
|
"Unexpected_token_expected_1179": "未預期的語彙基元。必須是 '{'。",
|
|
1634
1634
|
"Unknown_build_option_0_5072": "未知的組建選項 '{0}'。",
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.4.0-pr-
|
|
5
|
+
"version": "5.4.0-pr-57230-11",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"chokidar": "^3.5.3",
|
|
61
61
|
"diff": "^5.1.0",
|
|
62
62
|
"dprint": "^0.45.0",
|
|
63
|
-
"esbuild": "^0.
|
|
63
|
+
"esbuild": "^0.20.0",
|
|
64
64
|
"eslint": "^8.56.0",
|
|
65
65
|
"eslint-formatter-autolinkable-stylish": "^1.3.0",
|
|
66
66
|
"eslint-plugin-local": "^3.1.0",
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"node": "20.1.0",
|
|
115
115
|
"npm": "8.19.4"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "660c05350a6d1c3f33ee6553377a0725cd93105e"
|
|
118
118
|
}
|