mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-23 10:29:01 -06:00
Update LKG (#37175)
* Update LKG * Remove unneeded check (handled by top of function)
This commit is contained in:
parent
af4201ff51
commit
ff0422091f
@ -761,7 +761,8 @@
|
||||
"Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "Nur auf öffentliche und geschützte Methoden der Basisklasse kann über das Schlüsselwort \"super\" zugegriffen werden.",
|
||||
"Operator_0_cannot_be_applied_to_type_1_2736": "Der Operator \"{0}\" kann nicht auf den Typ \"{1}\" angewendet werden.",
|
||||
"Operator_0_cannot_be_applied_to_types_1_and_2_2365": "Der Operator \"{0}\" darf nicht auf die Typen \"{1}\" und \"{2}\" angewendet werden.",
|
||||
"Option_0_can_only_be_specified_in_tsconfig_json_file_6064": "Die Option \"{0}\" kann nur in der Datei \"tsconfig.json\" angegeben werden.",
|
||||
"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "Die Option \"{0}\" kann nur in der Datei \"tsconfig.json\" angegeben oder in der Befehlszeile auf FALSE oder NULL festgelegt werden.",
|
||||
"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "Die Option \"{0}\" kann nur in der Datei \"tsconfig.json\" angegeben oder in der Befehlszeile auf NULL festgelegt werden.",
|
||||
"Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "Die Option \"{0}\" kann nur verwendet werden, wenn die Option \"-inlineSourceMap\" oder \"-sourceMap\" angegeben wird.",
|
||||
"Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "Die Option \"{0}\" kann nicht angegeben werden, wenn die Option \"target\" den Wert \"ES3\" aufweist.",
|
||||
"Option_0_cannot_be_specified_with_option_1_5053": "Die Option \"{0}\" darf nicht zusammen mit der Option \"{1}\" angegeben werden.",
|
||||
@ -1035,7 +1036,7 @@
|
||||
"Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object_2470": "Der Symbol-Verweis verweist nicht auf das globale Symbolkonstruktorobjekt.",
|
||||
"Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6228": "Rufen Sie Rückrufe synchron auf, und aktualisieren Sie den Status von Verzeichnisüberwachungen auf Plattformen, die nativ keine rekursive Überwachung unterstützen.",
|
||||
"Syntax_Colon_0_6023": "Syntax: {0}",
|
||||
"Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": "Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'.",
|
||||
"Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": "Das Tag \"{0}\" erwartet mindestens {1} Argumente, von der JSX-Factory \"{2}\" werden aber höchstens {3} bereitgestellt.",
|
||||
"Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358": "Mit Tags versehene Vorlagenausdrücke sind in einer optionalen Kette nicht zulässig.",
|
||||
"The_0_modifier_can_only_be_used_in_TypeScript_files_8009": "Der Modifizierer \"{0}\" kann nur in TypeScript-Dateien verwendet werden.",
|
||||
"The_0_operator_cannot_be_applied_to_type_symbol_2469": "Der Operator \"{0}\" darf nicht den Typ \"symbol\" angewendet werden.",
|
||||
|
||||
@ -758,10 +758,12 @@
|
||||
"Only_amd_and_system_modules_are_supported_alongside_0_6082": "'amd' 및 'system' 모듈만 --{0}과(와) 함께 사용할 수 있습니다.",
|
||||
"Only_emit_d_ts_declaration_files_6014": "'.d.ts' 선언 파일만 내보냅니다.",
|
||||
"Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "선택적 형식 인수가 포함된 식별자/정규화된 이름만 현재 클래스 'extends' 절에서 지원됩니다.",
|
||||
"Only_named_exports_may_use_export_type_1383": "Only named exports may use 'export type'.",
|
||||
"Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "기본 클래스의 공용 및 보호된 메서드만 'super' 키워드를 통해 액세스할 수 있습니다.",
|
||||
"Operator_0_cannot_be_applied_to_type_1_2736": "'{0}' 연산자는 '{1}' 형식에 적용할 수 없습니다.",
|
||||
"Operator_0_cannot_be_applied_to_types_1_and_2_2365": "'{0}' 연산자를 '{1}' 및 '{2}' 형식에 적용할 수 없습니다.",
|
||||
"Option_0_can_only_be_specified_in_tsconfig_json_file_6064": "'{0}' 옵션은 'tsconfig.json' 파일에만 지정할 수 있습니다.",
|
||||
"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "'{0}' 옵션은 'tsconfig. json' 파일에만 지정하거나 명령줄에서 'false' 또는 'null'로 설정할 수 있습니다.",
|
||||
"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "'{0}' 옵션은 'tsconfig. json' 파일에만 지정하거나 명령줄에서 'null'로 설정할 수 있습니다.",
|
||||
"Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "'{0}' 옵션은 '--inlineSourceMap' 옵션 또는 '--sourceMap' 옵션이 제공되는 경우에만 사용할 수 있습니다.",
|
||||
"Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "'target' 옵션이 'ES3'인 경우 '{0}' 옵션을 지정할 수 없습니다.",
|
||||
"Option_0_cannot_be_specified_with_option_1_5053": "'{0}' 옵션은 '{1}' 옵션과 함께 지정할 수 없습니다.",
|
||||
@ -1035,6 +1037,7 @@
|
||||
"Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object_2470": "'기호' 참조에서 전역 기호 생성자 개체를 참조하지 않습니다.",
|
||||
"Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6228": "비동기적으로 콜백을 호출하며 기본적으로 재귀 조사를 지원하지 않는 플랫폼에서 디렉터리 감시자의 상태를 업데이트합니다.",
|
||||
"Syntax_Colon_0_6023": "구문: {0}",
|
||||
"Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": "'{0}' 태그는 '{1}'개 이상의 인수가 필요한데 JSX 팩터리 '{2}'이(가) 최대 '{3}'개를 제공합니다.",
|
||||
"Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358": "태그가 지정된 템플릿 식은 선택적 체인에서 사용할 수 없습니다.",
|
||||
"The_0_modifier_can_only_be_used_in_TypeScript_files_8009": "'{0}' 한정자는 TypeScript 파일에서만 사용할 수 있습니다.",
|
||||
"The_0_operator_cannot_be_applied_to_type_symbol_2469": "'{0}' 연산자는 'symbol' 유형에 적용될 수 없습니다.",
|
||||
@ -1179,6 +1182,7 @@
|
||||
"Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320": "'await' 형식의 피연산자는 유효한 프라미스여야 하거나 호출 가능 'then' 멤버를 포함하지 않아야 합니다.",
|
||||
"Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418": "계산된 속성 값의 형식은 '{1}' 형식에 할당할 수 없는 '{0}'입니다.",
|
||||
"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "'yield*'의 반복되는 요소 형식의 피연산자는 유효한 프라미스여야 하거나 호출 가능 'then' 멤버를 포함하지 않아야 합니다.",
|
||||
"Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615": "Type of property '{0}' circularly references itself in mapped type '{1}'.",
|
||||
"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "비동기 생성기에 있는 'yield' 형식의 피연산자는 유효한 프라미스여야 하거나 호출 가능 'then' 멤버를 포함하지 않아야 합니다.",
|
||||
"Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038": "형식이 이 가져오기에서 시작됩니다. 네임스페이스 스타일 가져오기는 호출하거나 생성할 수 없으며, 런타임에 오류를 초래합니다. 여기서는 대신 기본 가져오기 또는 가져오기 필요를 사용하는 것이 좋습니다.",
|
||||
"Type_parameter_0_has_a_circular_constraint_2313": "형식 매개 변수 '{0}'에 순환 제약 조건이 있습니다.",
|
||||
|
||||
@ -758,10 +758,12 @@
|
||||
"Only_amd_and_system_modules_are_supported_alongside_0_6082": "Tylko moduły „amd” i „system” są obsługiwane razem z parametrem --{0}.",
|
||||
"Only_emit_d_ts_declaration_files_6014": "Emituj tylko pliki deklaracji „d.ts”.",
|
||||
"Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "Klauzula „extends” klasy obsługuje obecnie tylko identyfikatory/nazwy kwalifikowane z opcjonalnymi argumentami typu.",
|
||||
"Only_named_exports_may_use_export_type_1383": "Only named exports may use 'export type'.",
|
||||
"Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "Tylko publiczne i chronione metody klasy bazowej są dostępne przy użyciu słowa kluczowego „super”.",
|
||||
"Operator_0_cannot_be_applied_to_type_1_2736": "Nie można zastosować operatora „{0}” do typu „{1}”.",
|
||||
"Operator_0_cannot_be_applied_to_types_1_and_2_2365": "Nie można zastosować operatora „{0}” do typów „{1}” i „{2}”.",
|
||||
"Option_0_can_only_be_specified_in_tsconfig_json_file_6064": "Opcję „{0}” można określić jedynie w pliku „tsconfig.json”.",
|
||||
"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "Opcję „{0}” można określić tylko w pliku „tsconfig.json” albo ustawić na wartość „false” lub „null” w wierszu polecenia.",
|
||||
"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "Opcję „{0}” można określić tylko w pliku „tsconfig.json” albo ustawić na wartość „null” w wierszu polecenia.",
|
||||
"Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "Opcja „{0}” może być używana tylko w przypadku podania opcji „--inlineSourceMap” lub „--sourceMap”.",
|
||||
"Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "Nie można określić opcji „{0}”, jeśli opcja „target” ma wartość „ES3”.",
|
||||
"Option_0_cannot_be_specified_with_option_1_5053": "Opcji „{0}” nie można określić razem z opcją „{1}”.",
|
||||
@ -1035,6 +1037,7 @@
|
||||
"Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object_2470": "Odwołanie do elementu „Symbol” nie zawiera odwołania do globalnego obiektu konstruktora symboli.",
|
||||
"Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6228": "Synchronicznie wywołaj wywołania zwrotne i zaktualizuj stan obserwatorów katalogów na platformach, które nie obsługują natywnego obserwowania rekursywnego.",
|
||||
"Syntax_Colon_0_6023": "Składnia: {0}",
|
||||
"Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": "Tag „{0}” oczekuje co najmniej „{1}” argumentów, ale fabryka JSX „{2}” dostarcza maksymalnie „{3}”.",
|
||||
"Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358": "Oznakowane wyrażenia szablonu nie są dozwolone w opcjonalnym łańcuchu.",
|
||||
"The_0_modifier_can_only_be_used_in_TypeScript_files_8009": "Modyfikatora „{0}” można używać tylko w plikach TypeScript.",
|
||||
"The_0_operator_cannot_be_applied_to_type_symbol_2469": "Nie można zastosować operatora „{0}” do typu „symbol”.",
|
||||
@ -1179,6 +1182,7 @@
|
||||
"Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320": "Typ operandu „await” musi być prawidłową obietnicą lub nie może zawierać wywoływalnej składowej „then”.",
|
||||
"Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418": "Typ wartości właściwości obliczanej to „{0}”, którego nie można przypisać do typu „{1}”.",
|
||||
"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "Typ iterowanych elementów operandu „yield*” musi być prawidłową obietnicą lub nie może zawierać wywoływalnej składowej „then”.",
|
||||
"Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615": "Type of property '{0}' circularly references itself in mapped type '{1}'.",
|
||||
"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "Typ operandu „yield” w generatorze asynchronicznym musi być prawidłową obietnicą lub nie może zawierać wywoływalnej składowej „then”.",
|
||||
"Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038": "Typ pochodzi z tego importu. Nie można wywołać ani skonstruować importu w stylu przestrzeni nazw, co spowoduje wystąpienie błędu w czasie wykonywania. Zamiast tego rozważ użycie importu domyślnego lub funkcji require importu.",
|
||||
"Type_parameter_0_has_a_circular_constraint_2313": "Parametr typu „{0}” zawiera ograniczenie cykliczne.",
|
||||
|
||||
@ -758,10 +758,12 @@
|
||||
"Only_amd_and_system_modules_are_supported_alongside_0_6082": "Há suporte somente aos módulos 'amd' e 'system' ao lado de --{0}.",
|
||||
"Only_emit_d_ts_declaration_files_6014": "Emita somente arquivos de declaração '.d.ts'.",
|
||||
"Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "Somente os identificadores/nomes qualificados com argumentos de tipo opcionais tem suporte atualmente nas cláusulas de classe 'extends'.",
|
||||
"Only_named_exports_may_use_export_type_1383": "Only named exports may use 'export type'.",
|
||||
"Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "Somente métodos protegidos e públicos da classe base são acessíveis pela palavra-chave 'super'.",
|
||||
"Operator_0_cannot_be_applied_to_type_1_2736": "O operador '{0}' não pode ser aplicado ao tipo '{1}'.",
|
||||
"Operator_0_cannot_be_applied_to_types_1_and_2_2365": "O operador '{0}' não pode ser aplicado aos tipos '{1}' e '{2}'.",
|
||||
"Option_0_can_only_be_specified_in_tsconfig_json_file_6064": "A opção '{0}' só pode ser especificada no arquivo 'tsconfig.json'.",
|
||||
"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "A opção '{0}' somente pode ser especificada no arquivo 'tsconfig.json' ou definida como 'false' ou 'null' na linha de comando.",
|
||||
"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "A opção '{0}' somente pode ser especificada no arquivo 'tsconfig.json' ou definida como 'null' na linha de comando.",
|
||||
"Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "A opção '{0} só pode ser usada quando qualquer uma das opções '--inlineSourceMap' ou '--sourceMap' é fornecida.",
|
||||
"Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "A opção '{0}' não pode ser especificada quando a opção 'target' é 'ES3'.",
|
||||
"Option_0_cannot_be_specified_with_option_1_5053": "A opção '{0}' não pode ser especificada com a opção '{1}'.",
|
||||
@ -1035,7 +1037,7 @@
|
||||
"Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object_2470": "A referência 'symbol' não se refere ao objeto global do construtor Symbol.",
|
||||
"Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6228": "Chame sincronicamente retornos de chamadas e atualize o estado de observadores de diretório em plataformas que não têm suporte à observação recursiva nativamente.",
|
||||
"Syntax_Colon_0_6023": "Sintaxe: {0}",
|
||||
"Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": "Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'.",
|
||||
"Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": "A tag '{0}' espera no mínimo os argumentos '{1}', mas o alocador JSX '{2}' fornece no máximo '{3}'.",
|
||||
"Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358": "Expressões de modelo marcado não são permitidas em uma cadeia opcional.",
|
||||
"The_0_modifier_can_only_be_used_in_TypeScript_files_8009": "O modificador '{0}' só pode ser usado em arquivos TypeScript.",
|
||||
"The_0_operator_cannot_be_applied_to_type_symbol_2469": "O operador '{0}' não pode ser aplicado ao tipo 'symbol'.",
|
||||
|
||||
@ -758,10 +758,12 @@
|
||||
"Only_amd_and_system_modules_are_supported_alongside_0_6082": "Только модули amd и system поддерживаются вместе с --{0}.",
|
||||
"Only_emit_d_ts_declaration_files_6014": "Порождаются только файлы объявлений \".d.ts\".",
|
||||
"Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "В предложениях extends класса сейчас поддерживаются только идентификаторы или полные имена с необязательными аргументами типа.",
|
||||
"Only_named_exports_may_use_export_type_1383": "Only named exports may use 'export type'.",
|
||||
"Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "Через ключевое слово super доступны только общие и защищенные методы базового класса.",
|
||||
"Operator_0_cannot_be_applied_to_type_1_2736": "Не удается применить операнд \"{0}\" к типу \"{1}\".",
|
||||
"Operator_0_cannot_be_applied_to_types_1_and_2_2365": "Оператор \"{0}\" невозможно применить к типам \"{1}\" и \"{2}\".",
|
||||
"Option_0_can_only_be_specified_in_tsconfig_json_file_6064": "Параметр \"{0}\" можно указать только в файле tsconfig.json.",
|
||||
"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "Параметр \"{0}\" можно указать только в файле \"tsconfig.json\" либо задать значение \"false\" или \"null\" для этого параметра в командной строке.",
|
||||
"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "Параметр \"{0}\" можно указать только в файле \"tsconfig.json\" либо задать значение \"null\" для этого параметра в командной строке.",
|
||||
"Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "Параметр \"{0}\" можно использовать только при указании \"--inlineSourceMap\" или \"--sourceMap\".",
|
||||
"Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "Параметр \"{0}\" не может быть указан, если параметр \"target\" имеет значение \"ES3\".",
|
||||
"Option_0_cannot_be_specified_with_option_1_5053": "Параметр \"{0}\" невозможно указать с помощью параметра \"{1}\".",
|
||||
@ -1180,6 +1182,7 @@
|
||||
"Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320": "Тип операнда \"await\" должен быть допустимым обещанием либо не должен содержать вызываемый элемент \"then\".",
|
||||
"Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418": "Типом значения вычисляемого свойства является \"{0}\", который не может быть назначен типу \"{1}\".",
|
||||
"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "Тип элементов итерации для операнда \"yield*\" должен быть допустимым обещанием либо не должен содержать вызываемый элемент \"then\".",
|
||||
"Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615": "Type of property '{0}' circularly references itself in mapped type '{1}'.",
|
||||
"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "Тип операнда \"yield\" в асинхронном генераторе должен быть допустимым обещанием либо не должен содержать вызываемый элемент \"then\".",
|
||||
"Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038": "Тип происходит от этого импорта. Импорт стиля пространства имен не может быть вызван или создан и приведет к сбою во время выполнения. Вместо этого рекомендуется использовать импорт по умолчанию или импорт, указанный здесь.",
|
||||
"Type_parameter_0_has_a_circular_constraint_2313": "Параметр типа \"{0}\" содержит циклическое ограничение.",
|
||||
|
||||
222
lib/tsc.js
222
lib/tsc.js
@ -4717,6 +4717,7 @@ var ts;
|
||||
Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration: diag(2612, ts.DiagnosticCategory.Error, "Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_2612", "Property '{0}' will overwrite the base property in '{1}'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration."),
|
||||
Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead: diag(2613, ts.DiagnosticCategory.Error, "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613", "Module '{0}' has no default export. Did you mean to use 'import { {1} } from {0}' instead?"),
|
||||
Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead: diag(2614, ts.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614", "Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?"),
|
||||
Type_of_property_0_circularly_references_itself_in_mapped_type_1: diag(2615, ts.DiagnosticCategory.Error, "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615", "Type of property '{0}' circularly references itself in mapped type '{1}'."),
|
||||
Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: diag(2649, ts.DiagnosticCategory.Error, "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", "Cannot augment module '{0}' with value exports because it resolves to a non-module entity."),
|
||||
A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: diag(2651, ts.DiagnosticCategory.Error, "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."),
|
||||
Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: diag(2652, ts.DiagnosticCategory.Error, "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."),
|
||||
@ -11140,6 +11141,15 @@ var ts;
|
||||
return !requireStringLiteralLikeArgument || ts.isStringLiteralLike(arg);
|
||||
}
|
||||
ts.isRequireCall = isRequireCall;
|
||||
function isRequireVariableDeclaration(node, requireStringLiteralLikeArgument) {
|
||||
return ts.isVariableDeclaration(node) && !!node.initializer && isRequireCall(node.initializer, requireStringLiteralLikeArgument);
|
||||
}
|
||||
ts.isRequireVariableDeclaration = isRequireVariableDeclaration;
|
||||
function isRequireVariableDeclarationStatement(node, requireStringLiteralLikeArgument) {
|
||||
if (requireStringLiteralLikeArgument === void 0) { requireStringLiteralLikeArgument = true; }
|
||||
return ts.isVariableStatement(node) && ts.every(node.declarationList.declarations, function (decl) { return isRequireVariableDeclaration(decl, requireStringLiteralLikeArgument); });
|
||||
}
|
||||
ts.isRequireVariableDeclarationStatement = isRequireVariableDeclarationStatement;
|
||||
function isSingleOrDoubleQuote(charCode) {
|
||||
return charCode === 39 || charCode === 34;
|
||||
}
|
||||
@ -11659,19 +11669,21 @@ var ts;
|
||||
}
|
||||
ts.getParameterSymbolFromJSDoc = getParameterSymbolFromJSDoc;
|
||||
function getHostSignatureFromJSDoc(node) {
|
||||
return getHostSignatureFromJSDocHost(getJSDocHost(node));
|
||||
var host = getEffectiveJSDocHost(node);
|
||||
return host && ts.isFunctionLike(host) ? host : undefined;
|
||||
}
|
||||
ts.getHostSignatureFromJSDoc = getHostSignatureFromJSDoc;
|
||||
function getHostSignatureFromJSDocHost(host) {
|
||||
function getEffectiveJSDocHost(node) {
|
||||
var host = getJSDocHost(node);
|
||||
var decl = getSourceOfDefaultedAssignment(host) ||
|
||||
getSourceOfAssignment(host) ||
|
||||
getSingleInitializerOfVariableStatementOrPropertyDeclaration(host) ||
|
||||
getSingleVariableOfVariableStatement(host) ||
|
||||
getNestedModuleDeclaration(host) ||
|
||||
host;
|
||||
return decl && ts.isFunctionLike(decl) ? decl : undefined;
|
||||
return decl;
|
||||
}
|
||||
ts.getHostSignatureFromJSDocHost = getHostSignatureFromJSDocHost;
|
||||
ts.getEffectiveJSDocHost = getEffectiveJSDocHost;
|
||||
function getJSDocHost(node) {
|
||||
return ts.Debug.checkDefined(findAncestor(node.parent, ts.isJSDoc)).parent;
|
||||
}
|
||||
@ -28460,6 +28472,9 @@ var ts;
|
||||
getJsxNamespace: function (n) { return ts.unescapeLeadingUnderscores(getJsxNamespace(n)); },
|
||||
getAccessibleSymbolChain: getAccessibleSymbolChain,
|
||||
getTypePredicateOfSignature: getTypePredicateOfSignature,
|
||||
resolveExternalModuleName: function (moduleSpecifier) {
|
||||
return resolveExternalModuleName(moduleSpecifier, moduleSpecifier, true);
|
||||
},
|
||||
resolveExternalModuleSymbol: resolveExternalModuleSymbol,
|
||||
tryGetThisTypeAt: function (node, includeGlobalThis) {
|
||||
node = ts.getParseTreeNode(node);
|
||||
@ -29989,7 +30004,7 @@ var ts;
|
||||
return resolved;
|
||||
}
|
||||
function getTargetOfExportAssignment(node, dontResolveAlias) {
|
||||
var expression = (ts.isExportAssignment(node) ? node.expression : node.right);
|
||||
var expression = ts.isExportAssignment(node) ? node.expression : node.right;
|
||||
var resolved = getTargetOfAliasLikeExpression(expression, dontResolveAlias);
|
||||
markSymbolOfAliasDeclarationIfTypeOnly(node, undefined, resolved, false);
|
||||
return resolved;
|
||||
@ -30240,8 +30255,8 @@ var ts;
|
||||
return getDeclarationOfJSPrototypeContainer(symbol);
|
||||
}
|
||||
}
|
||||
var sig = ts.getHostSignatureFromJSDocHost(host);
|
||||
if (sig) {
|
||||
var sig = ts.getEffectiveJSDocHost(node);
|
||||
if (sig && ts.isFunctionLike(sig)) {
|
||||
var symbol = getSymbolOfNode(sig);
|
||||
return symbol && symbol.valueDeclaration;
|
||||
}
|
||||
@ -31174,6 +31189,7 @@ var ts;
|
||||
context.encounteredError = true;
|
||||
return undefined;
|
||||
}
|
||||
type = getReducedType(type);
|
||||
if (type.flags & 1) {
|
||||
context.approximateLength += 3;
|
||||
return ts.createKeywordTypeNode(125);
|
||||
@ -32779,7 +32795,7 @@ var ts;
|
||||
}
|
||||
else {
|
||||
var varName = getUnusedName(name, symbol);
|
||||
var typeToSerialize = getWidenedType(getTypeOfSymbol(symbol));
|
||||
var typeToSerialize = getWidenedType(getTypeOfSymbol(getMergedSymbol(symbol)));
|
||||
if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) {
|
||||
serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignment ? 0 : 1);
|
||||
}
|
||||
@ -33518,6 +33534,7 @@ var ts;
|
||||
var type;
|
||||
if (pattern.kind === 189) {
|
||||
if (declaration.dotDotDotToken) {
|
||||
parentType = getReducedType(parentType);
|
||||
if (parentType.flags & 2 || !isValidSpreadType(parentType)) {
|
||||
error(declaration, ts.Diagnostics.Rest_types_may_only_be_created_from_object_types);
|
||||
return errorType;
|
||||
@ -34231,13 +34248,17 @@ var ts;
|
||||
return links.type;
|
||||
}
|
||||
function getTypeOfSymbol(symbol) {
|
||||
if (ts.getCheckFlags(symbol) & 65536) {
|
||||
var checkFlags = ts.getCheckFlags(symbol);
|
||||
if (checkFlags & 65536) {
|
||||
return getTypeOfSymbolWithDeferredType(symbol);
|
||||
}
|
||||
if (ts.getCheckFlags(symbol) & 1) {
|
||||
if (checkFlags & 1) {
|
||||
return getTypeOfInstantiatedSymbol(symbol);
|
||||
}
|
||||
if (ts.getCheckFlags(symbol) & 8192) {
|
||||
if (checkFlags & 262144) {
|
||||
return getTypeOfMappedSymbol(symbol);
|
||||
}
|
||||
if (checkFlags & 8192) {
|
||||
return getTypeOfReverseMappedSymbol(symbol);
|
||||
}
|
||||
if (symbol.flags & (3 | 4)) {
|
||||
@ -34496,7 +34517,7 @@ var ts;
|
||||
error(baseTypeNode.expression, ts.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments);
|
||||
return type.resolvedBaseTypes = ts.emptyArray;
|
||||
}
|
||||
baseType = getReturnTypeOfSignature(constructors[0]);
|
||||
baseType = getReducedType(getReturnTypeOfSignature(constructors[0]));
|
||||
}
|
||||
if (baseType === errorType) {
|
||||
return type.resolvedBaseTypes = ts.emptyArray;
|
||||
@ -34530,8 +34551,8 @@ var ts;
|
||||
return isValidBaseType(constraint);
|
||||
}
|
||||
}
|
||||
return !!(type.flags & (524288 | 67108864 | 1)) && !isGenericMappedType(type) ||
|
||||
!!(type.flags & 2097152) && ts.every(type.types, isValidBaseType);
|
||||
return !!(type.flags & (524288 | 67108864 | 1) && !isGenericMappedType(type) ||
|
||||
type.flags & 2097152 && ts.every(type.types, isValidBaseType));
|
||||
}
|
||||
function resolveBaseTypesOfInterface(type) {
|
||||
type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray;
|
||||
@ -34540,7 +34561,7 @@ var ts;
|
||||
if (declaration.kind === 246 && ts.getInterfaceBaseTypeNodes(declaration)) {
|
||||
for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) {
|
||||
var node = _c[_b];
|
||||
var baseType = getTypeFromTypeNode(node);
|
||||
var baseType = getReducedType(getTypeFromTypeNode(node));
|
||||
if (baseType !== errorType) {
|
||||
if (isValidBaseType(baseType)) {
|
||||
if (type !== baseType && !hasBaseType(baseType, type)) {
|
||||
@ -35533,7 +35554,6 @@ var ts;
|
||||
setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo);
|
||||
function addMemberForKeyType(t) {
|
||||
var templateMapper = combineTypeMappers(type.mapper, createTypeMapper([typeParameter], [t]));
|
||||
var propType = instantiateType(templateType, templateMapper);
|
||||
if (isTypeUsableAsPropertyName(t)) {
|
||||
var propName = getPropertyNameFromType(t);
|
||||
var modifiersProp = getPropertyOfType(modifiersType, propName);
|
||||
@ -35541,10 +35561,10 @@ var ts;
|
||||
!(templateModifiers & 8) && modifiersProp && modifiersProp.flags & 16777216);
|
||||
var isReadonly = !!(templateModifiers & 1 ||
|
||||
!(templateModifiers & 2) && modifiersProp && isReadonlySymbol(modifiersProp));
|
||||
var prop = createSymbol(4 | (isOptional ? 16777216 : 0), propName, isReadonly ? 8 : 0);
|
||||
prop.type = strictNullChecks && isOptional && !maybeTypeOfKind(propType, 32768 | 16384) ? getOptionalType(propType) :
|
||||
strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & 16777216 ? getTypeWithFacts(propType, 524288) :
|
||||
propType;
|
||||
var stripOptional = strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & 16777216;
|
||||
var prop = createSymbol(4 | (isOptional ? 16777216 : 0), propName, 262144 | (isReadonly ? 8 : 0) | (stripOptional ? 524288 : 0));
|
||||
prop.mappedType = type;
|
||||
prop.mapper = templateMapper;
|
||||
if (modifiersProp) {
|
||||
prop.syntheticOrigin = modifiersProp;
|
||||
prop.declarations = modifiersProp.declarations;
|
||||
@ -35552,14 +35572,35 @@ var ts;
|
||||
prop.nameType = t;
|
||||
members.set(propName, prop);
|
||||
}
|
||||
else if (t.flags & (1 | 4)) {
|
||||
stringIndexInfo = createIndexInfo(propType, !!(templateModifiers & 1));
|
||||
}
|
||||
else if (t.flags & (8 | 32)) {
|
||||
numberIndexInfo = createIndexInfo(numberIndexInfo ? getUnionType([numberIndexInfo.type, propType]) : propType, !!(templateModifiers & 1));
|
||||
else if (t.flags & (1 | 4 | 8 | 32)) {
|
||||
var propType = instantiateType(templateType, templateMapper);
|
||||
if (t.flags & (1 | 4)) {
|
||||
stringIndexInfo = createIndexInfo(propType, !!(templateModifiers & 1));
|
||||
}
|
||||
else {
|
||||
numberIndexInfo = createIndexInfo(numberIndexInfo ? getUnionType([numberIndexInfo.type, propType]) : propType, !!(templateModifiers & 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function getTypeOfMappedSymbol(symbol) {
|
||||
if (!symbol.type) {
|
||||
if (!pushTypeResolution(symbol, 0)) {
|
||||
return errorType;
|
||||
}
|
||||
var templateType = getTemplateTypeFromMappedType(symbol.mappedType.target || symbol.mappedType);
|
||||
var propType = instantiateType(templateType, symbol.mapper);
|
||||
var type = strictNullChecks && symbol.flags & 16777216 && !maybeTypeOfKind(propType, 32768 | 16384) ? getOptionalType(propType) :
|
||||
symbol.checkFlags & 524288 ? getTypeWithFacts(propType, 524288) :
|
||||
propType;
|
||||
if (!popTypeResolution()) {
|
||||
error(currentNode, ts.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(symbol.mappedType));
|
||||
type = errorType;
|
||||
}
|
||||
symbol.type = type;
|
||||
}
|
||||
return symbol.type;
|
||||
}
|
||||
function getTypeParameterFromMappedType(type) {
|
||||
return type.typeParameter ||
|
||||
(type.typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfNode(type.declaration.typeParameter)));
|
||||
@ -35682,7 +35723,7 @@ var ts;
|
||||
return type.resolvedProperties;
|
||||
}
|
||||
function getPropertiesOfType(type) {
|
||||
type = getApparentType(type);
|
||||
type = getApparentType(getReducedType(type));
|
||||
return type.flags & 3145728 ?
|
||||
getPropertiesOfUnionOrIntersectionType(type) :
|
||||
getPropertiesOfObjectType(type);
|
||||
@ -35975,7 +36016,7 @@ var ts;
|
||||
for (var _i = 0, _a = containingType.types; _i < _a.length; _i++) {
|
||||
var current = _a[_i];
|
||||
var type = getApparentType(current);
|
||||
if (type !== errorType) {
|
||||
if (!(type === errorType || type.flags & 131072)) {
|
||||
var prop = getPropertyOfType(type, name);
|
||||
var modifiers = prop ? ts.getDeclarationModifierFlagsFromSymbol(prop) : 0;
|
||||
if (prop && !(modifiers & excludeModifiers)) {
|
||||
@ -36047,6 +36088,9 @@ var ts;
|
||||
if (isLiteralType(type)) {
|
||||
checkFlags |= 128;
|
||||
}
|
||||
if (type.flags & 131072) {
|
||||
checkFlags |= 131072;
|
||||
}
|
||||
propTypes.push(type);
|
||||
}
|
||||
ts.addRange(propTypes, indexTypes);
|
||||
@ -36085,8 +36129,37 @@ var ts;
|
||||
var property = getUnionOrIntersectionProperty(type, name);
|
||||
return property && !(ts.getCheckFlags(property) & 16) ? property : undefined;
|
||||
}
|
||||
function getReducedType(type) {
|
||||
if (type.flags & 1048576 && type.objectFlags & 268435456) {
|
||||
return type.resolvedReducedType || (type.resolvedReducedType = getReducedUnionType(type));
|
||||
}
|
||||
else if (type.flags & 2097152) {
|
||||
if (!(type.objectFlags & 268435456)) {
|
||||
type.objectFlags |= 268435456 |
|
||||
(ts.some(getPropertiesOfUnionOrIntersectionType(type), isDiscriminantWithNeverType) ? 536870912 : 0);
|
||||
}
|
||||
return type.objectFlags & 536870912 ? neverType : type;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
function getReducedUnionType(unionType) {
|
||||
var reducedTypes = ts.sameMap(unionType.types, getReducedType);
|
||||
if (reducedTypes === unionType.types) {
|
||||
return unionType;
|
||||
}
|
||||
var reduced = getUnionType(reducedTypes);
|
||||
if (reduced.flags & 1048576) {
|
||||
reduced.resolvedReducedType = reduced;
|
||||
}
|
||||
return reduced;
|
||||
}
|
||||
function isDiscriminantWithNeverType(prop) {
|
||||
return !(prop.flags & 16777216) &&
|
||||
(ts.getCheckFlags(prop) & (192 | 131072)) === 192 &&
|
||||
!!(getTypeOfSymbol(prop).flags & 131072);
|
||||
}
|
||||
function getPropertyOfType(type, name) {
|
||||
type = getApparentType(type);
|
||||
type = getApparentType(getReducedType(type));
|
||||
if (type.flags & 524288) {
|
||||
var resolved = resolveStructuredTypeMembers(type);
|
||||
var symbol = resolved.members.get(name);
|
||||
@ -36118,7 +36191,7 @@ var ts;
|
||||
return ts.emptyArray;
|
||||
}
|
||||
function getSignaturesOfType(type, kind) {
|
||||
return getSignaturesOfStructuredType(getApparentType(type), kind);
|
||||
return getSignaturesOfStructuredType(getApparentType(getReducedType(type)), kind);
|
||||
}
|
||||
function getIndexInfoOfStructuredType(type, kind) {
|
||||
if (type.flags & 3670016) {
|
||||
@ -36131,10 +36204,10 @@ var ts;
|
||||
return info && info.type;
|
||||
}
|
||||
function getIndexInfoOfType(type, kind) {
|
||||
return getIndexInfoOfStructuredType(getApparentType(type), kind);
|
||||
return getIndexInfoOfStructuredType(getApparentType(getReducedType(type)), kind);
|
||||
}
|
||||
function getIndexTypeOfType(type, kind) {
|
||||
return getIndexTypeOfStructuredType(getApparentType(type), kind);
|
||||
return getIndexTypeOfStructuredType(getApparentType(getReducedType(type)), kind);
|
||||
}
|
||||
function getImplicitIndexTypeOfType(type, kind) {
|
||||
if (isObjectTypeWithInferableIndex(type)) {
|
||||
@ -37310,14 +37383,14 @@ var ts;
|
||||
return addTypesToUnion(typeSet, includes, type.types);
|
||||
}
|
||||
if (!(flags & 131072)) {
|
||||
includes |= flags & 68943871;
|
||||
includes |= flags & 71041023;
|
||||
if (flags & 66846720)
|
||||
includes |= 262144;
|
||||
if (type === wildcardType)
|
||||
includes |= 4194304;
|
||||
includes |= 8388608;
|
||||
if (!strictNullChecks && flags & 98304) {
|
||||
if (!(ts.getObjectFlags(type) & 524288))
|
||||
includes |= 2097152;
|
||||
includes |= 4194304;
|
||||
}
|
||||
else {
|
||||
var len = typeSet.length;
|
||||
@ -37409,7 +37482,7 @@ var ts;
|
||||
var includes = addTypesToUnion(typeSet, 0, types);
|
||||
if (unionReduction !== 0) {
|
||||
if (includes & 3) {
|
||||
return includes & 1 ? includes & 4194304 ? wildcardType : anyType : unknownType;
|
||||
return includes & 1 ? includes & 8388608 ? wildcardType : anyType : unknownType;
|
||||
}
|
||||
switch (unionReduction) {
|
||||
case 1:
|
||||
@ -37424,12 +37497,14 @@ var ts;
|
||||
break;
|
||||
}
|
||||
if (typeSet.length === 0) {
|
||||
return includes & 65536 ? includes & 2097152 ? nullType : nullWideningType :
|
||||
includes & 32768 ? includes & 2097152 ? undefinedType : undefinedWideningType :
|
||||
return includes & 65536 ? includes & 4194304 ? nullType : nullWideningType :
|
||||
includes & 32768 ? includes & 4194304 ? undefinedType : undefinedWideningType :
|
||||
neverType;
|
||||
}
|
||||
}
|
||||
return getUnionTypeFromSortedList(typeSet, includes & 66994211 ? 0 : 262144, aliasSymbol, aliasTypeArguments);
|
||||
var objectFlags = (includes & 66994211 ? 0 : 262144) |
|
||||
(includes & 2097152 ? 268435456 : 0);
|
||||
return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments);
|
||||
}
|
||||
function getUnionTypePredicate(signatures) {
|
||||
var first;
|
||||
@ -37492,15 +37567,15 @@ var ts;
|
||||
return addTypesToIntersection(typeSet, includes, type.types);
|
||||
}
|
||||
if (isEmptyAnonymousObjectType(type)) {
|
||||
if (!(includes & 8388608)) {
|
||||
includes |= 8388608;
|
||||
if (!(includes & 16777216)) {
|
||||
includes |= 16777216;
|
||||
typeSet.set(type.id.toString(), type);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (flags & 3) {
|
||||
if (type === wildcardType)
|
||||
includes |= 4194304;
|
||||
includes |= 8388608;
|
||||
}
|
||||
else if ((strictNullChecks || !(flags & 98304)) && !typeSet.has(type.id.toString())) {
|
||||
if (type.flags & 109440 && includes & 109440) {
|
||||
@ -37508,7 +37583,7 @@ var ts;
|
||||
}
|
||||
typeSet.set(type.id.toString(), type);
|
||||
}
|
||||
includes |= flags & 68943871;
|
||||
includes |= flags & 71041023;
|
||||
}
|
||||
return includes;
|
||||
}
|
||||
@ -37607,7 +37682,7 @@ var ts;
|
||||
var includes = addTypesToIntersection(typeMembershipMap, 0, types);
|
||||
var typeSet = ts.arrayFrom(typeMembershipMap.values());
|
||||
if (includes & 131072 ||
|
||||
strictNullChecks && includes & 98304 && includes & (524288 | 67108864 | 8388608) ||
|
||||
strictNullChecks && includes & 98304 && includes & (524288 | 67108864 | 16777216) ||
|
||||
includes & 67108864 && includes & (67238908 & ~67108864) ||
|
||||
includes & 132 && includes & (67238908 & ~132) ||
|
||||
includes & 296 && includes & (67238908 & ~296) ||
|
||||
@ -37617,7 +37692,7 @@ var ts;
|
||||
return neverType;
|
||||
}
|
||||
if (includes & 1) {
|
||||
return includes & 4194304 ? wildcardType : anyType;
|
||||
return includes & 8388608 ? wildcardType : anyType;
|
||||
}
|
||||
if (!strictNullChecks && includes & 98304) {
|
||||
return includes & 32768 ? undefinedType : nullType;
|
||||
@ -37628,7 +37703,7 @@ var ts;
|
||||
includes & 4096 && includes & 8192) {
|
||||
removeRedundantPrimitiveTypes(typeSet, includes);
|
||||
}
|
||||
if (includes & 8388608 && includes & 524288) {
|
||||
if (includes & 16777216 && includes & 524288) {
|
||||
ts.orderedRemoveItemAt(typeSet, ts.findIndex(typeSet, isEmptyAnonymousObjectType));
|
||||
}
|
||||
if (typeSet.length === 0) {
|
||||
@ -37727,6 +37802,7 @@ var ts;
|
||||
}
|
||||
function getIndexType(type, stringsOnly, noIndexSignatures) {
|
||||
if (stringsOnly === void 0) { stringsOnly = keyofStringsOnly; }
|
||||
type = getReducedType(type);
|
||||
return type.flags & 1048576 ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :
|
||||
type.flags & 2097152 ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :
|
||||
maybeTypeOfKind(type, 58982400) ? getIndexTypeForGenericType(type, stringsOnly) :
|
||||
@ -38070,7 +38146,7 @@ var ts;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
var apparentObjectType = getApparentType(objectType);
|
||||
var apparentObjectType = getApparentType(getReducedType(objectType));
|
||||
if (indexType.flags & 1048576 && !(indexType.flags & 16)) {
|
||||
var propTypes = [];
|
||||
var wasMissingProp = false;
|
||||
@ -38879,7 +38955,7 @@ var ts;
|
||||
if (typeVariable) {
|
||||
var mappedTypeVariable = instantiateType(typeVariable, mapper);
|
||||
if (typeVariable !== mappedTypeVariable) {
|
||||
return mapType(mappedTypeVariable, function (t) {
|
||||
return mapType(getReducedType(mappedTypeVariable), function (t) {
|
||||
if (t.flags & (3 | 58982400 | 524288 | 2097152) && t !== wildcardType && t !== errorType) {
|
||||
var replacementMapper = createReplacementMapper(typeVariable, t, mapper);
|
||||
return isArrayType(t) ? instantiateMappedArrayType(t, type, replacementMapper) :
|
||||
@ -39837,7 +39913,8 @@ var ts;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!(source.flags === target.flags && source.flags & 66584576))
|
||||
if (!(source.flags & 3145728) && !(target.flags & 3145728) &&
|
||||
source.flags !== target.flags && !(source.flags & 66584576))
|
||||
return false;
|
||||
}
|
||||
if (source.flags & 524288 && target.flags & 524288) {
|
||||
@ -39855,16 +39932,17 @@ var ts;
|
||||
return ts.getObjectFlags(source) & 4096 && !isUnhyphenatedJsxName(sourceProp.escapedName);
|
||||
}
|
||||
function getNormalizedType(type, writing) {
|
||||
do {
|
||||
while (true) {
|
||||
var t = isFreshLiteralType(type) ? type.regularType :
|
||||
ts.getObjectFlags(type) & 4 && type.node ? createTypeReference(type.target, getTypeArguments(type)) :
|
||||
type.flags & 33554432 ? writing ? type.typeVariable : type.substitute :
|
||||
type.flags & 25165824 ? getSimplifiedType(type, writing) :
|
||||
type;
|
||||
type.flags & 3145728 ? getReducedType(type) :
|
||||
type.flags & 33554432 ? writing ? type.typeVariable : type.substitute :
|
||||
type.flags & 25165824 ? getSimplifiedType(type, writing) :
|
||||
type;
|
||||
if (t === type)
|
||||
break;
|
||||
type = t;
|
||||
} while (true);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer) {
|
||||
@ -42555,6 +42633,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
else {
|
||||
source = getReducedType(source);
|
||||
if (!(priority & 128 && source.flags & (2097152 | 63176704))) {
|
||||
var apparentSource = getApparentType(source);
|
||||
if (apparentSource !== source && allowComplexConstraintInference && !(apparentSource.flags & (524288 | 2097152))) {
|
||||
@ -43097,9 +43176,6 @@ var ts;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function isSyntheticThisPropertyAccess(expr) {
|
||||
return ts.isAccessExpression(expr) && expr.expression.kind === 104 && !!(expr.expression.flags & 8);
|
||||
}
|
||||
function findDiscriminantProperties(sourceProperties, target) {
|
||||
var result;
|
||||
for (var _i = 0, sourceProperties_2 = sourceProperties; _i < sourceProperties_2.length; _i++) {
|
||||
@ -44225,9 +44301,6 @@ var ts;
|
||||
if (strictNullChecks && optionalChainContainsReference(target, reference) && assumeTrue === (literal.text !== "undefined")) {
|
||||
return getTypeWithFacts(type, 2097152);
|
||||
}
|
||||
if (containsMatchingReference(reference, target)) {
|
||||
return declaredType;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
if (type.flags & 1 && literal.text === "function") {
|
||||
@ -44359,9 +44432,6 @@ var ts;
|
||||
if (assumeTrue && strictNullChecks && optionalChainContainsReference(left, reference)) {
|
||||
return getTypeWithFacts(type, 2097152);
|
||||
}
|
||||
if (containsMatchingReference(reference, left) && !isSyntheticThisPropertyAccess(reference)) {
|
||||
return declaredType;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
var rightType = getTypeOfExpression(expr.right);
|
||||
@ -44423,9 +44493,6 @@ var ts;
|
||||
!(getTypeFacts(predicate.type) & 65536)) {
|
||||
return getTypeWithFacts(type, 2097152);
|
||||
}
|
||||
if (containsMatchingReference(reference, predicateArgument)) {
|
||||
return declaredType;
|
||||
}
|
||||
}
|
||||
}
|
||||
return type;
|
||||
@ -46040,7 +46107,7 @@ var ts;
|
||||
hasComputedStringProperty = false;
|
||||
hasComputedNumberProperty = false;
|
||||
}
|
||||
var type = checkExpression(memberDecl.expression);
|
||||
var type = getReducedType(checkExpression(memberDecl.expression));
|
||||
if (!isValidSpreadType(type)) {
|
||||
error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types);
|
||||
return errorType;
|
||||
@ -46199,7 +46266,7 @@ var ts;
|
||||
spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, false);
|
||||
attributesTable = ts.createSymbolTable();
|
||||
}
|
||||
var exprType = checkExpressionCached(attributeDecl.expression, checkMode);
|
||||
var exprType = getReducedType(checkExpressionCached(attributeDecl.expression, checkMode));
|
||||
if (isTypeAny(exprType)) {
|
||||
hasSpreadAnyType = true;
|
||||
}
|
||||
@ -52012,15 +52079,14 @@ var ts;
|
||||
checkSignatureDeclaration(node);
|
||||
}
|
||||
function checkJSDocImplementsTag(node) {
|
||||
var classLike = ts.getJSDocHost(node);
|
||||
if (!ts.isClassDeclaration(classLike) && !ts.isClassExpression(classLike)) {
|
||||
var classLike = ts.getEffectiveJSDocHost(node);
|
||||
if (!classLike || !ts.isClassDeclaration(classLike) && !ts.isClassExpression(classLike)) {
|
||||
error(classLike, ts.Diagnostics.JSDoc_0_is_not_attached_to_a_class, ts.idText(node.tagName));
|
||||
return;
|
||||
}
|
||||
}
|
||||
function checkJSDocAugmentsTag(node) {
|
||||
var classLike = ts.getJSDocHost(node);
|
||||
if (!ts.isClassDeclaration(classLike) && !ts.isClassExpression(classLike)) {
|
||||
var classLike = ts.getEffectiveJSDocHost(node);
|
||||
if (!classLike || !ts.isClassDeclaration(classLike) && !ts.isClassExpression(classLike)) {
|
||||
error(classLike, ts.Diagnostics.JSDoc_0_is_not_attached_to_a_class, ts.idText(node.tagName));
|
||||
return;
|
||||
}
|
||||
@ -53660,7 +53726,7 @@ var ts;
|
||||
}
|
||||
checkTypeReferenceNode(typeRefNode);
|
||||
if (produceDiagnostics) {
|
||||
var t = getTypeFromTypeNode(typeRefNode);
|
||||
var t = getReducedType(getTypeFromTypeNode(typeRefNode));
|
||||
if (t !== errorType) {
|
||||
if (isValidBaseType(t)) {
|
||||
var genericDiag = t.symbol && t.symbol.flags & 32 ?
|
||||
@ -61868,9 +61934,7 @@ var ts;
|
||||
}
|
||||
var target = getTargetOfBindingOrAssignmentElement(bindingElement);
|
||||
if (target && ts.isPropertyName(target)) {
|
||||
return ts.isComputedPropertyName(target) && isStringOrNumericLiteral(target.expression)
|
||||
? target.expression
|
||||
: target;
|
||||
return target;
|
||||
}
|
||||
}
|
||||
ts.tryGetPropertyNameOfBindingOrAssignmentElement = tryGetPropertyNameOfBindingOrAssignmentElement;
|
||||
@ -64472,7 +64536,7 @@ var ts;
|
||||
}
|
||||
var varStatement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
|
||||
ts.createVariableDeclaration(ts.getLocalName(node, false, false), undefined, iife)
|
||||
], languageVersion > 1 ? 2 : undefined));
|
||||
], languageVersion > 1 ? 1 : undefined));
|
||||
ts.setOriginalNode(varStatement, node);
|
||||
ts.setCommentRange(varStatement, node);
|
||||
ts.setSourceMapRange(varStatement, ts.moveRangePastDecorators(node));
|
||||
@ -65504,8 +65568,8 @@ var ts;
|
||||
if (node.isTypeOnly) {
|
||||
return undefined;
|
||||
}
|
||||
if (!node.exportClause) {
|
||||
return compilerOptions.isolatedModules || resolver.moduleExportsSomeValue(node.moduleSpecifier) ? node : undefined;
|
||||
if (!node.exportClause || ts.isNamespaceExport(node.exportClause)) {
|
||||
return node;
|
||||
}
|
||||
if (!resolver.isValueAliasDeclaration(node)) {
|
||||
return undefined;
|
||||
|
||||
567
lib/tsserver.js
567
lib/tsserver.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -3759,6 +3759,9 @@ var ts;
|
||||
CheckFlags[CheckFlags["OptionalParameter"] = 16384] = "OptionalParameter";
|
||||
CheckFlags[CheckFlags["RestParameter"] = 32768] = "RestParameter";
|
||||
CheckFlags[CheckFlags["DeferredType"] = 65536] = "DeferredType";
|
||||
CheckFlags[CheckFlags["HasNeverType"] = 131072] = "HasNeverType";
|
||||
CheckFlags[CheckFlags["Mapped"] = 262144] = "Mapped";
|
||||
CheckFlags[CheckFlags["StripOptional"] = 524288] = "StripOptional";
|
||||
CheckFlags[CheckFlags["Synthetic"] = 6] = "Synthetic";
|
||||
CheckFlags[CheckFlags["Discriminant"] = 192] = "Discriminant";
|
||||
CheckFlags[CheckFlags["Partial"] = 48] = "Partial";
|
||||
@ -3885,16 +3888,16 @@ var ts;
|
||||
TypeFlags[TypeFlags["NotPrimitiveUnion"] = 66994211] = "NotPrimitiveUnion";
|
||||
// The following flags are aggregated during union and intersection type construction
|
||||
/* @internal */
|
||||
TypeFlags[TypeFlags["IncludesMask"] = 68943871] = "IncludesMask";
|
||||
TypeFlags[TypeFlags["IncludesMask"] = 71041023] = "IncludesMask";
|
||||
// The following flags are used for different purposes during union and intersection type construction
|
||||
/* @internal */
|
||||
TypeFlags[TypeFlags["IncludesStructuredOrInstantiable"] = 262144] = "IncludesStructuredOrInstantiable";
|
||||
/* @internal */
|
||||
TypeFlags[TypeFlags["IncludesNonWideningType"] = 2097152] = "IncludesNonWideningType";
|
||||
TypeFlags[TypeFlags["IncludesNonWideningType"] = 4194304] = "IncludesNonWideningType";
|
||||
/* @internal */
|
||||
TypeFlags[TypeFlags["IncludesWildcard"] = 4194304] = "IncludesWildcard";
|
||||
TypeFlags[TypeFlags["IncludesWildcard"] = 8388608] = "IncludesWildcard";
|
||||
/* @internal */
|
||||
TypeFlags[TypeFlags["IncludesEmptyObject"] = 8388608] = "IncludesEmptyObject";
|
||||
TypeFlags[TypeFlags["IncludesEmptyObject"] = 16777216] = "IncludesEmptyObject";
|
||||
})(TypeFlags = ts.TypeFlags || (ts.TypeFlags = {}));
|
||||
var ObjectFlags;
|
||||
(function (ObjectFlags) {
|
||||
@ -3936,6 +3939,12 @@ var ts;
|
||||
ObjectFlags[ObjectFlags["CouldContainTypeVariablesComputed"] = 67108864] = "CouldContainTypeVariablesComputed";
|
||||
/* @internal */
|
||||
ObjectFlags[ObjectFlags["CouldContainTypeVariables"] = 134217728] = "CouldContainTypeVariables";
|
||||
/* @internal */
|
||||
ObjectFlags[ObjectFlags["ContainsIntersections"] = 268435456] = "ContainsIntersections";
|
||||
/* @internal */
|
||||
ObjectFlags[ObjectFlags["IsNeverIntersectionComputed"] = 268435456] = "IsNeverIntersectionComputed";
|
||||
/* @internal */
|
||||
ObjectFlags[ObjectFlags["IsNeverIntersection"] = 536870912] = "IsNeverIntersection";
|
||||
ObjectFlags[ObjectFlags["ClassOrInterface"] = 3] = "ClassOrInterface";
|
||||
/* @internal */
|
||||
ObjectFlags[ObjectFlags["RequiresWidening"] = 1572864] = "RequiresWidening";
|
||||
@ -7179,6 +7188,7 @@ var ts;
|
||||
Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration: diag(2612, ts.DiagnosticCategory.Error, "Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_2612", "Property '{0}' will overwrite the base property in '{1}'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration."),
|
||||
Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead: diag(2613, ts.DiagnosticCategory.Error, "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613", "Module '{0}' has no default export. Did you mean to use 'import { {1} } from {0}' instead?"),
|
||||
Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead: diag(2614, ts.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614", "Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?"),
|
||||
Type_of_property_0_circularly_references_itself_in_mapped_type_1: diag(2615, ts.DiagnosticCategory.Error, "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615", "Type of property '{0}' circularly references itself in mapped type '{1}'."),
|
||||
Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: diag(2649, ts.DiagnosticCategory.Error, "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", "Cannot augment module '{0}' with value exports because it resolves to a non-module entity."),
|
||||
A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: diag(2651, ts.DiagnosticCategory.Error, "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."),
|
||||
Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: diag(2652, ts.DiagnosticCategory.Error, "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."),
|
||||
@ -14355,6 +14365,15 @@ var ts;
|
||||
return !requireStringLiteralLikeArgument || ts.isStringLiteralLike(arg);
|
||||
}
|
||||
ts.isRequireCall = isRequireCall;
|
||||
function isRequireVariableDeclaration(node, requireStringLiteralLikeArgument) {
|
||||
return ts.isVariableDeclaration(node) && !!node.initializer && isRequireCall(node.initializer, requireStringLiteralLikeArgument);
|
||||
}
|
||||
ts.isRequireVariableDeclaration = isRequireVariableDeclaration;
|
||||
function isRequireVariableDeclarationStatement(node, requireStringLiteralLikeArgument) {
|
||||
if (requireStringLiteralLikeArgument === void 0) { requireStringLiteralLikeArgument = true; }
|
||||
return ts.isVariableStatement(node) && ts.every(node.declarationList.declarations, function (decl) { return isRequireVariableDeclaration(decl, requireStringLiteralLikeArgument); });
|
||||
}
|
||||
ts.isRequireVariableDeclarationStatement = isRequireVariableDeclarationStatement;
|
||||
function isSingleOrDoubleQuote(charCode) {
|
||||
return charCode === 39 /* singleQuote */ || charCode === 34 /* doubleQuote */;
|
||||
}
|
||||
@ -14933,19 +14952,22 @@ var ts;
|
||||
}
|
||||
ts.getParameterSymbolFromJSDoc = getParameterSymbolFromJSDoc;
|
||||
function getHostSignatureFromJSDoc(node) {
|
||||
return getHostSignatureFromJSDocHost(getJSDocHost(node));
|
||||
var host = getEffectiveJSDocHost(node);
|
||||
return host && ts.isFunctionLike(host) ? host : undefined;
|
||||
}
|
||||
ts.getHostSignatureFromJSDoc = getHostSignatureFromJSDoc;
|
||||
function getHostSignatureFromJSDocHost(host) {
|
||||
function getEffectiveJSDocHost(node) {
|
||||
var host = getJSDocHost(node);
|
||||
var decl = getSourceOfDefaultedAssignment(host) ||
|
||||
getSourceOfAssignment(host) ||
|
||||
getSingleInitializerOfVariableStatementOrPropertyDeclaration(host) ||
|
||||
getSingleVariableOfVariableStatement(host) ||
|
||||
getNestedModuleDeclaration(host) ||
|
||||
host;
|
||||
return decl && ts.isFunctionLike(decl) ? decl : undefined;
|
||||
return decl;
|
||||
}
|
||||
ts.getHostSignatureFromJSDocHost = getHostSignatureFromJSDocHost;
|
||||
ts.getEffectiveJSDocHost = getEffectiveJSDocHost;
|
||||
/** Use getEffectiveJSDocHost if you additionally need to look for jsdoc on parent nodes, like assignments. */
|
||||
function getJSDocHost(node) {
|
||||
return ts.Debug.checkDefined(findAncestor(node.parent, ts.isJSDoc)).parent;
|
||||
}
|
||||
@ -34790,6 +34812,9 @@ var ts;
|
||||
getJsxNamespace: function (n) { return ts.unescapeLeadingUnderscores(getJsxNamespace(n)); },
|
||||
getAccessibleSymbolChain: getAccessibleSymbolChain,
|
||||
getTypePredicateOfSignature: getTypePredicateOfSignature,
|
||||
resolveExternalModuleName: function (moduleSpecifier) {
|
||||
return resolveExternalModuleName(moduleSpecifier, moduleSpecifier, /*ignoreErrors*/ true);
|
||||
},
|
||||
resolveExternalModuleSymbol: resolveExternalModuleSymbol,
|
||||
tryGetThisTypeAt: function (node, includeGlobalThis) {
|
||||
node = ts.getParseTreeNode(node);
|
||||
@ -36575,7 +36600,7 @@ var ts;
|
||||
return resolved;
|
||||
}
|
||||
function getTargetOfExportAssignment(node, dontResolveAlias) {
|
||||
var expression = (ts.isExportAssignment(node) ? node.expression : node.right);
|
||||
var expression = ts.isExportAssignment(node) ? node.expression : node.right;
|
||||
var resolved = getTargetOfAliasLikeExpression(expression, dontResolveAlias);
|
||||
markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false);
|
||||
return resolved;
|
||||
@ -36883,8 +36908,8 @@ var ts;
|
||||
return getDeclarationOfJSPrototypeContainer(symbol);
|
||||
}
|
||||
}
|
||||
var sig = ts.getHostSignatureFromJSDocHost(host);
|
||||
if (sig) {
|
||||
var sig = ts.getEffectiveJSDocHost(node);
|
||||
if (sig && ts.isFunctionLike(sig)) {
|
||||
var symbol = getSymbolOfNode(sig);
|
||||
return symbol && symbol.valueDeclaration;
|
||||
}
|
||||
@ -37946,6 +37971,7 @@ var ts;
|
||||
context.encounteredError = true;
|
||||
return undefined; // TODO: GH#18217
|
||||
}
|
||||
type = getReducedType(type);
|
||||
if (type.flags & 1 /* Any */) {
|
||||
context.approximateLength += 3;
|
||||
return ts.createKeywordTypeNode(125 /* AnyKeyword */);
|
||||
@ -39799,7 +39825,7 @@ var ts;
|
||||
var varName = getUnusedName(name, symbol);
|
||||
// We have to use `getWidenedType` here since the object within a json file is unwidened within the file
|
||||
// (Unwidened types can only exist in expression contexts and should never be serialized)
|
||||
var typeToSerialize = getWidenedType(getTypeOfSymbol(symbol));
|
||||
var typeToSerialize = getWidenedType(getTypeOfSymbol(getMergedSymbol(symbol)));
|
||||
if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) {
|
||||
// If there are no index signatures and `typeToSerialize` is an object type, emit as a namespace instead of a const
|
||||
serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignment ? 0 /* None */ : 1 /* Export */);
|
||||
@ -40654,6 +40680,7 @@ var ts;
|
||||
var type;
|
||||
if (pattern.kind === 189 /* ObjectBindingPattern */) {
|
||||
if (declaration.dotDotDotToken) {
|
||||
parentType = getReducedType(parentType);
|
||||
if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) {
|
||||
error(declaration, ts.Diagnostics.Rest_types_may_only_be_created_from_object_types);
|
||||
return errorType;
|
||||
@ -41465,13 +41492,17 @@ var ts;
|
||||
return links.type;
|
||||
}
|
||||
function getTypeOfSymbol(symbol) {
|
||||
if (ts.getCheckFlags(symbol) & 65536 /* DeferredType */) {
|
||||
var checkFlags = ts.getCheckFlags(symbol);
|
||||
if (checkFlags & 65536 /* DeferredType */) {
|
||||
return getTypeOfSymbolWithDeferredType(symbol);
|
||||
}
|
||||
if (ts.getCheckFlags(symbol) & 1 /* Instantiated */) {
|
||||
if (checkFlags & 1 /* Instantiated */) {
|
||||
return getTypeOfInstantiatedSymbol(symbol);
|
||||
}
|
||||
if (ts.getCheckFlags(symbol) & 8192 /* ReverseMapped */) {
|
||||
if (checkFlags & 262144 /* Mapped */) {
|
||||
return getTypeOfMappedSymbol(symbol);
|
||||
}
|
||||
if (checkFlags & 8192 /* ReverseMapped */) {
|
||||
return getTypeOfReverseMappedSymbol(symbol);
|
||||
}
|
||||
if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) {
|
||||
@ -41759,7 +41790,7 @@ var ts;
|
||||
error(baseTypeNode.expression, ts.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments);
|
||||
return type.resolvedBaseTypes = ts.emptyArray;
|
||||
}
|
||||
baseType = getReturnTypeOfSignature(constructors[0]);
|
||||
baseType = getReducedType(getReturnTypeOfSignature(constructors[0]));
|
||||
}
|
||||
if (baseType === errorType) {
|
||||
return type.resolvedBaseTypes = ts.emptyArray;
|
||||
@ -41802,8 +41833,8 @@ var ts;
|
||||
}
|
||||
// TODO: Given that we allow type parmeters here now, is this `!isGenericMappedType(type)` check really needed?
|
||||
// There's no reason a `T` should be allowed while a `Readonly<T>` should not.
|
||||
return !!(type.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */ | 1 /* Any */)) && !isGenericMappedType(type) ||
|
||||
!!(type.flags & 2097152 /* Intersection */) && ts.every(type.types, isValidBaseType);
|
||||
return !!(type.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */ | 1 /* Any */) && !isGenericMappedType(type) ||
|
||||
type.flags & 2097152 /* Intersection */ && ts.every(type.types, isValidBaseType));
|
||||
}
|
||||
function resolveBaseTypesOfInterface(type) {
|
||||
type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray;
|
||||
@ -41812,7 +41843,7 @@ var ts;
|
||||
if (declaration.kind === 246 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) {
|
||||
for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) {
|
||||
var node = _c[_b];
|
||||
var baseType = getTypeFromTypeNode(node);
|
||||
var baseType = getReducedType(getTypeFromTypeNode(node));
|
||||
if (baseType !== errorType) {
|
||||
if (isValidBaseType(baseType)) {
|
||||
if (type !== baseType && !hasBaseType(baseType, type)) {
|
||||
@ -42977,7 +43008,6 @@ var ts;
|
||||
// mapped type is itself an instantiated type, combine the iteration mapper with the
|
||||
// instantiation mapper.
|
||||
var templateMapper = combineTypeMappers(type.mapper, createTypeMapper([typeParameter], [t]));
|
||||
var propType = instantiateType(templateType, templateMapper);
|
||||
// If the current iteration type constituent is a string literal type, create a property.
|
||||
// Otherwise, for type string create a string index signature.
|
||||
if (isTypeUsableAsPropertyName(t)) {
|
||||
@ -42987,13 +43017,10 @@ var ts;
|
||||
!(templateModifiers & 8 /* ExcludeOptional */) && modifiersProp && modifiersProp.flags & 16777216 /* Optional */);
|
||||
var isReadonly = !!(templateModifiers & 1 /* IncludeReadonly */ ||
|
||||
!(templateModifiers & 2 /* ExcludeReadonly */) && modifiersProp && isReadonlySymbol(modifiersProp));
|
||||
var prop = createSymbol(4 /* Property */ | (isOptional ? 16777216 /* Optional */ : 0), propName, isReadonly ? 8 /* Readonly */ : 0);
|
||||
// When creating an optional property in strictNullChecks mode, if 'undefined' isn't assignable to the
|
||||
// type, we include 'undefined' in the type. Similarly, when creating a non-optional property in strictNullChecks
|
||||
// mode, if the underlying property is optional we remove 'undefined' from the type.
|
||||
prop.type = strictNullChecks && isOptional && !maybeTypeOfKind(propType, 32768 /* Undefined */ | 16384 /* Void */) ? getOptionalType(propType) :
|
||||
strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & 16777216 /* Optional */ ? getTypeWithFacts(propType, 524288 /* NEUndefined */) :
|
||||
propType;
|
||||
var stripOptional = strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & 16777216 /* Optional */;
|
||||
var prop = createSymbol(4 /* Property */ | (isOptional ? 16777216 /* Optional */ : 0), propName, 262144 /* Mapped */ | (isReadonly ? 8 /* Readonly */ : 0) | (stripOptional ? 524288 /* StripOptional */ : 0));
|
||||
prop.mappedType = type;
|
||||
prop.mapper = templateMapper;
|
||||
if (modifiersProp) {
|
||||
prop.syntheticOrigin = modifiersProp;
|
||||
prop.declarations = modifiersProp.declarations;
|
||||
@ -43001,14 +43028,38 @@ var ts;
|
||||
prop.nameType = t;
|
||||
members.set(propName, prop);
|
||||
}
|
||||
else if (t.flags & (1 /* Any */ | 4 /* String */)) {
|
||||
stringIndexInfo = createIndexInfo(propType, !!(templateModifiers & 1 /* IncludeReadonly */));
|
||||
}
|
||||
else if (t.flags & (8 /* Number */ | 32 /* Enum */)) {
|
||||
numberIndexInfo = createIndexInfo(numberIndexInfo ? getUnionType([numberIndexInfo.type, propType]) : propType, !!(templateModifiers & 1 /* IncludeReadonly */));
|
||||
else if (t.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 32 /* Enum */)) {
|
||||
var propType = instantiateType(templateType, templateMapper);
|
||||
if (t.flags & (1 /* Any */ | 4 /* String */)) {
|
||||
stringIndexInfo = createIndexInfo(propType, !!(templateModifiers & 1 /* IncludeReadonly */));
|
||||
}
|
||||
else {
|
||||
numberIndexInfo = createIndexInfo(numberIndexInfo ? getUnionType([numberIndexInfo.type, propType]) : propType, !!(templateModifiers & 1 /* IncludeReadonly */));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function getTypeOfMappedSymbol(symbol) {
|
||||
if (!symbol.type) {
|
||||
if (!pushTypeResolution(symbol, 0 /* Type */)) {
|
||||
return errorType;
|
||||
}
|
||||
var templateType = getTemplateTypeFromMappedType(symbol.mappedType.target || symbol.mappedType);
|
||||
var propType = instantiateType(templateType, symbol.mapper);
|
||||
// When creating an optional property in strictNullChecks mode, if 'undefined' isn't assignable to the
|
||||
// type, we include 'undefined' in the type. Similarly, when creating a non-optional property in strictNullChecks
|
||||
// mode, if the underlying property is optional we remove 'undefined' from the type.
|
||||
var type = strictNullChecks && symbol.flags & 16777216 /* Optional */ && !maybeTypeOfKind(propType, 32768 /* Undefined */ | 16384 /* Void */) ? getOptionalType(propType) :
|
||||
symbol.checkFlags & 524288 /* StripOptional */ ? getTypeWithFacts(propType, 524288 /* NEUndefined */) :
|
||||
propType;
|
||||
if (!popTypeResolution()) {
|
||||
error(currentNode, ts.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(symbol.mappedType));
|
||||
type = errorType;
|
||||
}
|
||||
symbol.type = type;
|
||||
}
|
||||
return symbol.type;
|
||||
}
|
||||
function getTypeParameterFromMappedType(type) {
|
||||
return type.typeParameter ||
|
||||
(type.typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfNode(type.declaration.typeParameter)));
|
||||
@ -43143,7 +43194,7 @@ var ts;
|
||||
return type.resolvedProperties;
|
||||
}
|
||||
function getPropertiesOfType(type) {
|
||||
type = getApparentType(type);
|
||||
type = getApparentType(getReducedType(type));
|
||||
return type.flags & 3145728 /* UnionOrIntersection */ ?
|
||||
getPropertiesOfUnionOrIntersectionType(type) :
|
||||
getPropertiesOfObjectType(type);
|
||||
@ -43462,7 +43513,7 @@ var ts;
|
||||
/**
|
||||
* For a type parameter, return the base constraint of the type parameter. For the string, number,
|
||||
* boolean, and symbol primitive types, return the corresponding object types. Otherwise return the
|
||||
* type itself. Note that the apparent type of a union type is the union type itself.
|
||||
* type itself.
|
||||
*/
|
||||
function getApparentType(type) {
|
||||
var t = type.flags & 63176704 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type;
|
||||
@ -43490,7 +43541,7 @@ var ts;
|
||||
for (var _i = 0, _a = containingType.types; _i < _a.length; _i++) {
|
||||
var current = _a[_i];
|
||||
var type = getApparentType(current);
|
||||
if (type !== errorType) {
|
||||
if (!(type === errorType || type.flags & 131072 /* Never */)) {
|
||||
var prop = getPropertyOfType(type, name);
|
||||
var modifiers = prop ? ts.getDeclarationModifierFlagsFromSymbol(prop) : 0;
|
||||
if (prop && !(modifiers & excludeModifiers)) {
|
||||
@ -43562,6 +43613,9 @@ var ts;
|
||||
if (isLiteralType(type)) {
|
||||
checkFlags |= 128 /* HasLiteralType */;
|
||||
}
|
||||
if (type.flags & 131072 /* Never */) {
|
||||
checkFlags |= 131072 /* HasNeverType */;
|
||||
}
|
||||
propTypes.push(type);
|
||||
}
|
||||
ts.addRange(propTypes, indexTypes);
|
||||
@ -43608,6 +43662,41 @@ var ts;
|
||||
// We need to filter out partial properties in union types
|
||||
return property && !(ts.getCheckFlags(property) & 16 /* ReadPartial */) ? property : undefined;
|
||||
}
|
||||
/**
|
||||
* Return the reduced form of the given type. For a union type, it is a union of the normalized constituent types.
|
||||
* For an intersection of types containing one or more mututally exclusive discriminant properties, it is 'never'.
|
||||
* For all other types, it is simply the type itself. Discriminant properties are considered mutually exclusive when
|
||||
* no constituent property has type 'never', but the intersection of the constituent property types is 'never'.
|
||||
*/
|
||||
function getReducedType(type) {
|
||||
if (type.flags & 1048576 /* Union */ && type.objectFlags & 268435456 /* ContainsIntersections */) {
|
||||
return type.resolvedReducedType || (type.resolvedReducedType = getReducedUnionType(type));
|
||||
}
|
||||
else if (type.flags & 2097152 /* Intersection */) {
|
||||
if (!(type.objectFlags & 268435456 /* IsNeverIntersectionComputed */)) {
|
||||
type.objectFlags |= 268435456 /* IsNeverIntersectionComputed */ |
|
||||
(ts.some(getPropertiesOfUnionOrIntersectionType(type), isDiscriminantWithNeverType) ? 536870912 /* IsNeverIntersection */ : 0);
|
||||
}
|
||||
return type.objectFlags & 536870912 /* IsNeverIntersection */ ? neverType : type;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
function getReducedUnionType(unionType) {
|
||||
var reducedTypes = ts.sameMap(unionType.types, getReducedType);
|
||||
if (reducedTypes === unionType.types) {
|
||||
return unionType;
|
||||
}
|
||||
var reduced = getUnionType(reducedTypes);
|
||||
if (reduced.flags & 1048576 /* Union */) {
|
||||
reduced.resolvedReducedType = reduced;
|
||||
}
|
||||
return reduced;
|
||||
}
|
||||
function isDiscriminantWithNeverType(prop) {
|
||||
return !(prop.flags & 16777216 /* Optional */) &&
|
||||
(ts.getCheckFlags(prop) & (192 /* Discriminant */ | 131072 /* HasNeverType */)) === 192 /* Discriminant */ &&
|
||||
!!(getTypeOfSymbol(prop).flags & 131072 /* Never */);
|
||||
}
|
||||
/**
|
||||
* Return the symbol for the property with the given name in the given type. Creates synthetic union properties when
|
||||
* necessary, maps primitive types and type parameters are to their apparent types, and augments with properties from
|
||||
@ -43617,7 +43706,7 @@ var ts;
|
||||
* @param name a name of property to look up in a given type
|
||||
*/
|
||||
function getPropertyOfType(type, name) {
|
||||
type = getApparentType(type);
|
||||
type = getApparentType(getReducedType(type));
|
||||
if (type.flags & 524288 /* Object */) {
|
||||
var resolved = resolveStructuredTypeMembers(type);
|
||||
var symbol = resolved.members.get(name);
|
||||
@ -43653,7 +43742,7 @@ var ts;
|
||||
* maps primitive types and type parameters are to their apparent types.
|
||||
*/
|
||||
function getSignaturesOfType(type, kind) {
|
||||
return getSignaturesOfStructuredType(getApparentType(type), kind);
|
||||
return getSignaturesOfStructuredType(getApparentType(getReducedType(type)), kind);
|
||||
}
|
||||
function getIndexInfoOfStructuredType(type, kind) {
|
||||
if (type.flags & 3670016 /* StructuredType */) {
|
||||
@ -43668,12 +43757,12 @@ var ts;
|
||||
// Return the indexing info of the given kind in the given type. Creates synthetic union index types when necessary and
|
||||
// maps primitive types and type parameters are to their apparent types.
|
||||
function getIndexInfoOfType(type, kind) {
|
||||
return getIndexInfoOfStructuredType(getApparentType(type), kind);
|
||||
return getIndexInfoOfStructuredType(getApparentType(getReducedType(type)), kind);
|
||||
}
|
||||
// Return the index type of the given kind in the given type. Creates synthetic union index types when necessary and
|
||||
// maps primitive types and type parameters are to their apparent types.
|
||||
function getIndexTypeOfType(type, kind) {
|
||||
return getIndexTypeOfStructuredType(getApparentType(type), kind);
|
||||
return getIndexTypeOfStructuredType(getApparentType(getReducedType(type)), kind);
|
||||
}
|
||||
function getImplicitIndexTypeOfType(type, kind) {
|
||||
if (isObjectTypeWithInferableIndex(type)) {
|
||||
@ -44955,14 +45044,14 @@ var ts;
|
||||
}
|
||||
// We ignore 'never' types in unions
|
||||
if (!(flags & 131072 /* Never */)) {
|
||||
includes |= flags & 68943871 /* IncludesMask */;
|
||||
includes |= flags & 71041023 /* IncludesMask */;
|
||||
if (flags & 66846720 /* StructuredOrInstantiable */)
|
||||
includes |= 262144 /* IncludesStructuredOrInstantiable */;
|
||||
if (type === wildcardType)
|
||||
includes |= 4194304 /* IncludesWildcard */;
|
||||
includes |= 8388608 /* IncludesWildcard */;
|
||||
if (!strictNullChecks && flags & 98304 /* Nullable */) {
|
||||
if (!(ts.getObjectFlags(type) & 524288 /* ContainsWideningType */))
|
||||
includes |= 2097152 /* IncludesNonWideningType */;
|
||||
includes |= 4194304 /* IncludesNonWideningType */;
|
||||
}
|
||||
else {
|
||||
var len = typeSet.length;
|
||||
@ -45068,7 +45157,7 @@ var ts;
|
||||
var includes = addTypesToUnion(typeSet, 0, types);
|
||||
if (unionReduction !== 0 /* None */) {
|
||||
if (includes & 3 /* AnyOrUnknown */) {
|
||||
return includes & 1 /* Any */ ? includes & 4194304 /* IncludesWildcard */ ? wildcardType : anyType : unknownType;
|
||||
return includes & 1 /* Any */ ? includes & 8388608 /* IncludesWildcard */ ? wildcardType : anyType : unknownType;
|
||||
}
|
||||
switch (unionReduction) {
|
||||
case 1 /* Literal */:
|
||||
@ -45083,12 +45172,14 @@ var ts;
|
||||
break;
|
||||
}
|
||||
if (typeSet.length === 0) {
|
||||
return includes & 65536 /* Null */ ? includes & 2097152 /* IncludesNonWideningType */ ? nullType : nullWideningType :
|
||||
includes & 32768 /* Undefined */ ? includes & 2097152 /* IncludesNonWideningType */ ? undefinedType : undefinedWideningType :
|
||||
return includes & 65536 /* Null */ ? includes & 4194304 /* IncludesNonWideningType */ ? nullType : nullWideningType :
|
||||
includes & 32768 /* Undefined */ ? includes & 4194304 /* IncludesNonWideningType */ ? undefinedType : undefinedWideningType :
|
||||
neverType;
|
||||
}
|
||||
}
|
||||
return getUnionTypeFromSortedList(typeSet, includes & 66994211 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */, aliasSymbol, aliasTypeArguments);
|
||||
var objectFlags = (includes & 66994211 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) |
|
||||
(includes & 2097152 /* Intersection */ ? 268435456 /* ContainsIntersections */ : 0);
|
||||
return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments);
|
||||
}
|
||||
function getUnionTypePredicate(signatures) {
|
||||
var first;
|
||||
@ -45160,15 +45251,15 @@ var ts;
|
||||
return addTypesToIntersection(typeSet, includes, type.types);
|
||||
}
|
||||
if (isEmptyAnonymousObjectType(type)) {
|
||||
if (!(includes & 8388608 /* IncludesEmptyObject */)) {
|
||||
includes |= 8388608 /* IncludesEmptyObject */;
|
||||
if (!(includes & 16777216 /* IncludesEmptyObject */)) {
|
||||
includes |= 16777216 /* IncludesEmptyObject */;
|
||||
typeSet.set(type.id.toString(), type);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (flags & 3 /* AnyOrUnknown */) {
|
||||
if (type === wildcardType)
|
||||
includes |= 4194304 /* IncludesWildcard */;
|
||||
includes |= 8388608 /* IncludesWildcard */;
|
||||
}
|
||||
else if ((strictNullChecks || !(flags & 98304 /* Nullable */)) && !typeSet.has(type.id.toString())) {
|
||||
if (type.flags & 109440 /* Unit */ && includes & 109440 /* Unit */) {
|
||||
@ -45178,7 +45269,7 @@ var ts;
|
||||
}
|
||||
typeSet.set(type.id.toString(), type);
|
||||
}
|
||||
includes |= flags & 68943871 /* IncludesMask */;
|
||||
includes |= flags & 71041023 /* IncludesMask */;
|
||||
}
|
||||
return includes;
|
||||
}
|
||||
@ -45311,7 +45402,7 @@ var ts;
|
||||
// a void-like type and a type known to be non-void-like, or
|
||||
// a non-primitive type and a type known to be primitive.
|
||||
if (includes & 131072 /* Never */ ||
|
||||
strictNullChecks && includes & 98304 /* Nullable */ && includes & (524288 /* Object */ | 67108864 /* NonPrimitive */ | 8388608 /* IncludesEmptyObject */) ||
|
||||
strictNullChecks && includes & 98304 /* Nullable */ && includes & (524288 /* Object */ | 67108864 /* NonPrimitive */ | 16777216 /* IncludesEmptyObject */) ||
|
||||
includes & 67108864 /* NonPrimitive */ && includes & (67238908 /* DisjointDomains */ & ~67108864 /* NonPrimitive */) ||
|
||||
includes & 132 /* StringLike */ && includes & (67238908 /* DisjointDomains */ & ~132 /* StringLike */) ||
|
||||
includes & 296 /* NumberLike */ && includes & (67238908 /* DisjointDomains */ & ~296 /* NumberLike */) ||
|
||||
@ -45321,7 +45412,7 @@ var ts;
|
||||
return neverType;
|
||||
}
|
||||
if (includes & 1 /* Any */) {
|
||||
return includes & 4194304 /* IncludesWildcard */ ? wildcardType : anyType;
|
||||
return includes & 8388608 /* IncludesWildcard */ ? wildcardType : anyType;
|
||||
}
|
||||
if (!strictNullChecks && includes & 98304 /* Nullable */) {
|
||||
return includes & 32768 /* Undefined */ ? undefinedType : nullType;
|
||||
@ -45332,7 +45423,7 @@ var ts;
|
||||
includes & 4096 /* ESSymbol */ && includes & 8192 /* UniqueESSymbol */) {
|
||||
removeRedundantPrimitiveTypes(typeSet, includes);
|
||||
}
|
||||
if (includes & 8388608 /* IncludesEmptyObject */ && includes & 524288 /* Object */) {
|
||||
if (includes & 16777216 /* IncludesEmptyObject */ && includes & 524288 /* Object */) {
|
||||
ts.orderedRemoveItemAt(typeSet, ts.findIndex(typeSet, isEmptyAnonymousObjectType));
|
||||
}
|
||||
if (typeSet.length === 0) {
|
||||
@ -45437,6 +45528,7 @@ var ts;
|
||||
}
|
||||
function getIndexType(type, stringsOnly, noIndexSignatures) {
|
||||
if (stringsOnly === void 0) { stringsOnly = keyofStringsOnly; }
|
||||
type = getReducedType(type);
|
||||
return type.flags & 1048576 /* Union */ ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :
|
||||
type.flags & 2097152 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :
|
||||
maybeTypeOfKind(type, 58982400 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, stringsOnly) :
|
||||
@ -45826,7 +45918,7 @@ var ts;
|
||||
// In the following we resolve T[K] to the type of the property in T selected by K.
|
||||
// We treat boolean as different from other unions to improve errors;
|
||||
// skipping straight to getPropertyTypeForIndexType gives errors with 'boolean' instead of 'true'.
|
||||
var apparentObjectType = getApparentType(objectType);
|
||||
var apparentObjectType = getApparentType(getReducedType(objectType));
|
||||
if (indexType.flags & 1048576 /* Union */ && !(indexType.flags & 16 /* Boolean */)) {
|
||||
var propTypes = [];
|
||||
var wasMissingProp = false;
|
||||
@ -46722,7 +46814,7 @@ var ts;
|
||||
if (typeVariable) {
|
||||
var mappedTypeVariable = instantiateType(typeVariable, mapper);
|
||||
if (typeVariable !== mappedTypeVariable) {
|
||||
return mapType(mappedTypeVariable, function (t) {
|
||||
return mapType(getReducedType(mappedTypeVariable), function (t) {
|
||||
if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) {
|
||||
var replacementMapper = createReplacementMapper(typeVariable, t, mapper);
|
||||
return isArrayType(t) ? instantiateMappedArrayType(t, type, replacementMapper) :
|
||||
@ -47784,7 +47876,8 @@ var ts;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!(source.flags === target.flags && source.flags & 66584576 /* Substructure */))
|
||||
if (!(source.flags & 3145728 /* UnionOrIntersection */) && !(target.flags & 3145728 /* UnionOrIntersection */) &&
|
||||
source.flags !== target.flags && !(source.flags & 66584576 /* Substructure */))
|
||||
return false;
|
||||
}
|
||||
if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) {
|
||||
@ -47802,16 +47895,17 @@ var ts;
|
||||
return ts.getObjectFlags(source) & 4096 /* JsxAttributes */ && !isUnhyphenatedJsxName(sourceProp.escapedName);
|
||||
}
|
||||
function getNormalizedType(type, writing) {
|
||||
do {
|
||||
while (true) {
|
||||
var t = isFreshLiteralType(type) ? type.regularType :
|
||||
ts.getObjectFlags(type) & 4 /* Reference */ && type.node ? createTypeReference(type.target, getTypeArguments(type)) :
|
||||
type.flags & 33554432 /* Substitution */ ? writing ? type.typeVariable : type.substitute :
|
||||
type.flags & 25165824 /* Simplifiable */ ? getSimplifiedType(type, writing) :
|
||||
type;
|
||||
type.flags & 3145728 /* UnionOrIntersection */ ? getReducedType(type) :
|
||||
type.flags & 33554432 /* Substitution */ ? writing ? type.typeVariable : type.substitute :
|
||||
type.flags & 25165824 /* Simplifiable */ ? getSimplifiedType(type, writing) :
|
||||
type;
|
||||
if (t === type)
|
||||
break;
|
||||
type = t;
|
||||
} while (true);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
/**
|
||||
@ -50960,6 +51054,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
else {
|
||||
source = getReducedType(source);
|
||||
if (!(priority & 128 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 63176704 /* Instantiable */))) {
|
||||
var apparentSource = getApparentType(source);
|
||||
// getApparentType can return _any_ type, since an indexed access or conditional may simplify to any other type.
|
||||
@ -51582,9 +51677,6 @@ var ts;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function isSyntheticThisPropertyAccess(expr) {
|
||||
return ts.isAccessExpression(expr) && expr.expression.kind === 104 /* ThisKeyword */ && !!(expr.expression.flags & 8 /* Synthesized */);
|
||||
}
|
||||
function findDiscriminantProperties(sourceProperties, target) {
|
||||
var result;
|
||||
for (var _i = 0, sourceProperties_2 = sourceProperties; _i < sourceProperties_2.length; _i++) {
|
||||
@ -52835,11 +52927,6 @@ var ts;
|
||||
if (strictNullChecks && optionalChainContainsReference(target, reference) && assumeTrue === (literal.text !== "undefined")) {
|
||||
return getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
|
||||
}
|
||||
// For a reference of the form 'x.y', a 'typeof x === ...' type guard resets the
|
||||
// narrowed type of 'y' to its declared type.
|
||||
if (containsMatchingReference(reference, target)) {
|
||||
return declaredType;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
if (type.flags & 1 /* Any */ && literal.text === "function") {
|
||||
@ -53013,16 +53100,6 @@ var ts;
|
||||
if (assumeTrue && strictNullChecks && optionalChainContainsReference(left, reference)) {
|
||||
return getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
|
||||
}
|
||||
// For a reference of the form 'x.y', an 'x instanceof T' type guard resets the
|
||||
// narrowed type of 'y' to its declared type. We do this because preceding 'x.y'
|
||||
// references might reference a different 'y' property. However, we make an exception
|
||||
// for property accesses where x is a synthetic 'this' expression, indicating that we
|
||||
// were called from isPropertyInitializedInConstructor. Without this exception,
|
||||
// initializations of 'this' properties that occur before a 'this instanceof XXX'
|
||||
// check would not be considered.
|
||||
if (containsMatchingReference(reference, left) && !isSyntheticThisPropertyAccess(reference)) {
|
||||
return declaredType;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
// Check that right operand is a function type with a prototype property
|
||||
@ -53095,9 +53172,6 @@ var ts;
|
||||
!(getTypeFacts(predicate.type) & 65536 /* EQUndefined */)) {
|
||||
return getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
|
||||
}
|
||||
if (containsMatchingReference(reference, predicateArgument)) {
|
||||
return declaredType;
|
||||
}
|
||||
}
|
||||
}
|
||||
return type;
|
||||
@ -55056,7 +55130,7 @@ var ts;
|
||||
hasComputedStringProperty = false;
|
||||
hasComputedNumberProperty = false;
|
||||
}
|
||||
var type = checkExpression(memberDecl.expression);
|
||||
var type = getReducedType(checkExpression(memberDecl.expression));
|
||||
if (!isValidSpreadType(type)) {
|
||||
error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types);
|
||||
return errorType;
|
||||
@ -55243,7 +55317,7 @@ var ts;
|
||||
spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, /*readonly*/ false);
|
||||
attributesTable = ts.createSymbolTable();
|
||||
}
|
||||
var exprType = checkExpressionCached(attributeDecl.expression, checkMode);
|
||||
var exprType = getReducedType(checkExpressionCached(attributeDecl.expression, checkMode));
|
||||
if (isTypeAny(exprType)) {
|
||||
hasSpreadAnyType = true;
|
||||
}
|
||||
@ -62067,15 +62141,14 @@ var ts;
|
||||
checkSignatureDeclaration(node);
|
||||
}
|
||||
function checkJSDocImplementsTag(node) {
|
||||
var classLike = ts.getJSDocHost(node);
|
||||
if (!ts.isClassDeclaration(classLike) && !ts.isClassExpression(classLike)) {
|
||||
var classLike = ts.getEffectiveJSDocHost(node);
|
||||
if (!classLike || !ts.isClassDeclaration(classLike) && !ts.isClassExpression(classLike)) {
|
||||
error(classLike, ts.Diagnostics.JSDoc_0_is_not_attached_to_a_class, ts.idText(node.tagName));
|
||||
return;
|
||||
}
|
||||
}
|
||||
function checkJSDocAugmentsTag(node) {
|
||||
var classLike = ts.getJSDocHost(node);
|
||||
if (!ts.isClassDeclaration(classLike) && !ts.isClassExpression(classLike)) {
|
||||
var classLike = ts.getEffectiveJSDocHost(node);
|
||||
if (!classLike || !ts.isClassDeclaration(classLike) && !ts.isClassExpression(classLike)) {
|
||||
error(classLike, ts.Diagnostics.JSDoc_0_is_not_attached_to_a_class, ts.idText(node.tagName));
|
||||
return;
|
||||
}
|
||||
@ -64102,7 +64175,7 @@ var ts;
|
||||
}
|
||||
checkTypeReferenceNode(typeRefNode);
|
||||
if (produceDiagnostics) {
|
||||
var t = getTypeFromTypeNode(typeRefNode);
|
||||
var t = getReducedType(getTypeFromTypeNode(typeRefNode));
|
||||
if (t !== errorType) {
|
||||
if (isValidBaseType(t)) {
|
||||
var genericDiag = t.symbol && t.symbol.flags & 32 /* Class */ ?
|
||||
@ -73311,9 +73384,7 @@ var ts;
|
||||
}
|
||||
var target = getTargetOfBindingOrAssignmentElement(bindingElement);
|
||||
if (target && ts.isPropertyName(target)) {
|
||||
return ts.isComputedPropertyName(target) && isStringOrNumericLiteral(target.expression)
|
||||
? target.expression
|
||||
: target;
|
||||
return target;
|
||||
}
|
||||
}
|
||||
ts.tryGetPropertyNameOfBindingOrAssignmentElement = tryGetPropertyNameOfBindingOrAssignmentElement;
|
||||
@ -76482,7 +76553,7 @@ var ts;
|
||||
/*modifiers*/ undefined, ts.createVariableDeclarationList([
|
||||
ts.createVariableDeclaration(ts.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ false),
|
||||
/*type*/ undefined, iife)
|
||||
], languageVersion > 1 /* ES5 */ ? 2 /* Const */ : undefined));
|
||||
], languageVersion > 1 /* ES5 */ ? 1 /* Let */ : undefined));
|
||||
ts.setOriginalNode(varStatement, node);
|
||||
ts.setCommentRange(varStatement, node);
|
||||
ts.setSourceMapRange(varStatement, ts.moveRangePastDecorators(node));
|
||||
@ -78221,9 +78292,11 @@ var ts;
|
||||
if (node.isTypeOnly) {
|
||||
return undefined;
|
||||
}
|
||||
if (!node.exportClause) {
|
||||
// Elide a star export if the module it references does not export a value.
|
||||
return compilerOptions.isolatedModules || resolver.moduleExportsSomeValue(node.moduleSpecifier) ? node : undefined;
|
||||
if (!node.exportClause || ts.isNamespaceExport(node.exportClause)) {
|
||||
// never elide `export <whatever> from <whereever>` declarations -
|
||||
// they should be kept for sideffects/untyped exports, even when the
|
||||
// type checker doesn't know about any exports
|
||||
return node;
|
||||
}
|
||||
if (!resolver.isValueAliasDeclaration(node)) {
|
||||
// Elide the export declaration if it does not export a value.
|
||||
|
||||
@ -758,10 +758,12 @@
|
||||
"Only_amd_and_system_modules_are_supported_alongside_0_6082": "--{0} 旁仅支持 \"amd\" 和 \"system\" 模块。",
|
||||
"Only_emit_d_ts_declaration_files_6014": "仅发出 \".d.ts\" 声明文件。 ",
|
||||
"Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "类 \"extends\" 子句当前仅支持具有可选类型参数的标识符/限定名称。",
|
||||
"Only_named_exports_may_use_export_type_1383": "Only named exports may use 'export type'.",
|
||||
"Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "通过 \"super\" 关键字只能访问基类的公共方法和受保护方法。",
|
||||
"Operator_0_cannot_be_applied_to_type_1_2736": "运算符 \"{0}\" 不能应用于类型 \"{1}\"。",
|
||||
"Operator_0_cannot_be_applied_to_types_1_and_2_2365": "运算符“{0}”不能应用于类型“{1}”和“{2}”。",
|
||||
"Option_0_can_only_be_specified_in_tsconfig_json_file_6064": "仅可在 \"tsconfig.json\" 文件中指定选项“{0}”。",
|
||||
"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "选项“{0}”只能在 \"tsconfig.json\" 文件中指定,或者在命令行上设置为 \"false\" 或 \"null\"。",
|
||||
"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "选项“{0}”只能在 \"tsconfig.json\" 文件中指定或在命令行上设置为 \"null\"。",
|
||||
"Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "仅当提供了选项 \"--inlineSourceMap\" 或选项 \"--sourceMap\" 时,才能使用选项“{0}”。",
|
||||
"Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "选项 \"target\" 为 \"ES3\" 时,不能指定选项 \"{0}\"。",
|
||||
"Option_0_cannot_be_specified_with_option_1_5053": "选项“{0}”不能与选项“{1}”同时指定。",
|
||||
@ -1035,6 +1037,7 @@
|
||||
"Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object_2470": "\"Symbol\" 引用不是指全局符号构造函数对象。",
|
||||
"Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6228": "在不支持本机递归监视的平台上同步调用回调并更新目录观察程序的状态。",
|
||||
"Syntax_Colon_0_6023": "语法: {0}",
|
||||
"Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": "标记“{0}”至少需要“{1}”个参数,但 JSX 工厂“{2}”最多可提供“{3}”个。",
|
||||
"Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358": "可选链中不允许使用带有标记的模板表达式。",
|
||||
"The_0_modifier_can_only_be_used_in_TypeScript_files_8009": "\"{0}\" 修饰符只能在 TypeScript 文件中使用。",
|
||||
"The_0_operator_cannot_be_applied_to_type_symbol_2469": "“{0}”运算符不能应用于类型 \"symbol\"。",
|
||||
@ -1179,6 +1182,7 @@
|
||||
"Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320": "\"await\" 操作数的类型必须是有效承诺,或不得包含可调用的 \"then\" 成员。",
|
||||
"Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418": "计算属性类型的值为 \"{0}\",该值不能赋给 \"{1}\" 类型。",
|
||||
"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "\"yield*\" 操作数的迭代元素的类型必须是有效承诺,或不得包含可调用的 \"then\" 成员。",
|
||||
"Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615": "Type of property '{0}' circularly references itself in mapped type '{1}'.",
|
||||
"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "异步生成器中 \"yield\" 操作数的类型必须是有效承诺,或不得包含可调用的 \"then\" 成员。",
|
||||
"Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038": "此导入产生的类型。无法调用或构造命名空间样式的导入,这类导入将在运行时导致失败。请考虑改为使用默认导入或这里需要的导入。",
|
||||
"Type_parameter_0_has_a_circular_constraint_2313": "类型参数“{0}”具有循环约束。",
|
||||
|
||||
@ -2220,7 +2220,7 @@ namespace ts {
|
||||
// exports.name = expr OR module.exports.name = expr OR exports["name"] = expr ...
|
||||
return AssignmentDeclarationKind.ExportsProperty;
|
||||
}
|
||||
if (isBindableStaticNameExpression(lhs, /*excludeThisKeyword*/ true) || (isElementAccessExpression(lhs) && isDynamicName(lhs) && lhs.expression.kind !== SyntaxKind.ThisKeyword)) {
|
||||
if (isBindableStaticNameExpression(lhs, /*excludeThisKeyword*/ true) || (isElementAccessExpression(lhs) && isDynamicName(lhs))) {
|
||||
// F.G...x = expr
|
||||
return AssignmentDeclarationKind.Property;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user