4359 Commits

Author SHA1 Message Date
Mateusz Burzyński
1445bd4344
Reissue used before declaration error for const enums in isolatedModules (#57174) 2024-01-30 08:35:59 -08:00
Nathan Shively-Sanders
584b314c4c
Revert #54477 but keep the tests (#57160) 2024-01-24 16:29:45 -08:00
Andrew Branch
94f4379bca
Fix isolatedModules check for export assignments (#57148) 2024-01-24 12:03:18 -08:00
Andrew Branch
25a4f9e535
Deprioritize declaration emit paths from baseUrl containing node_modules (#57145) 2024-01-23 13:31:15 -08:00
Gabriela Araujo Britto
0a2b0bbb4b
No number constraint to mapped type with as clause (#57093) 2024-01-19 14:36:51 -08:00
Andrew Branch
6cb6fc94ae
Add --module preserve, support require in --moduleResolution bundler (#56785) 2024-01-19 12:03:24 -08:00
Gabriela Araujo Britto
4a34f45099
Revert "Fixed apparent type of homomorphic mapped type with non-homomorphic instantiation (#56727)" and add test (#57092) 2024-01-19 10:25:54 -08:00
Jake Bailey
ad2f465a38
Detect binary files by checking first 256 code units for 0xFFFD (#57008) 2024-01-16 16:15:23 -08:00
Gabriela Araujo Britto
59b6f78c29
Revert "Add numeric constraint to type parameter of mapped types with… (#57076) 2024-01-16 13:02:54 -08:00
Mateusz Burzyński
3f8707d04f
Add numeric constraint to type parameter of mapped types with name type and array constraints (#55774) 2024-01-16 10:59:00 -08:00
Titian Cernicova-Dragomir
fea4a4544f
Do not remove binding alias in function declarations (#57020) 2024-01-12 11:23:22 -08:00
Kevin Gibbons
fbf908bd58
Add types for Object.groupBy() and Map.groupBy() (#56805)
Co-authored-by: Nick McCurdy <nick@nickmccurdy.com>
Co-authored-by: Karl Horky <karl.horky@gmail.com>
Co-authored-by: Niklas Mollenhauer <nikeee@outlook.com>
2024-01-11 11:17:54 -08:00
Mateusz Burzyński
e76972562d
Fxied declaration emit for JS files when module.exports is assigned a non-alias value and when it has extra type members (#56243) 2024-01-11 10:31:11 -08:00
Andrew Branch
385db449f5
With allowJs, process JS files found searching node_modules when they have a realpath outside node_modules (#56946) 2024-01-10 10:15:58 -08:00
Mateusz Burzyński
4bcbc16cff
Use symbols of type aliases when emitting declarations (#56087) 2024-01-09 13:02:52 -08:00
Mateusz Burzyński
4557e34e70
Emit declarations using alternative containing modules for types exported using separate export statements (#56857) 2024-01-09 11:34:49 -08:00
Wesley Wigham
bc74ec41a3
When relating a deferred index type over a mapped type on the source side ... (#56742) 2024-01-09 11:28:02 -08:00
Mateusz Burzyński
3b1db10290
Fixed an issue with write type being left as non-instantiated when coming from a merged instantiation (#56322) 2024-01-09 11:21:50 -08:00
Mateusz Burzyński
424b96475e
Fixed apparent type of homomorphic mapped type with non-homomorphic instantiation (#56727) 2024-01-09 11:13:50 -08:00
Mateusz Burzyński
1e00399a38
Fixed emit of return statements with parenthesized assertions and comments (#56601) 2024-01-09 11:10:15 -08:00
Anders Hejlsberg
8ff77fbc48
Preserve type refinements in closures created past last assignment (#56908) 2024-01-08 20:21:05 -08:00
Mateusz Burzyński
5a355093bb
Fixed narrowing based on aliased discriminants coming from destructured parameters (#56860) 2024-01-08 13:18:06 -08:00
Andrew Branch
a099275b2a
Fix declaration emit for JS default re-exports that resolve to modules through synthesized default exports (#56340) 2024-01-03 13:46:54 -08:00
Gabriela Araujo Britto
be20dbbbbb
Infer between generic mapped types before inferring from apparent type (#56640) 2024-01-02 15:35:10 -08:00
Oleksandr T
382de91763
fix(56737): unique symbol quick info is different in JS than TS (#56743) 2024-01-02 11:34:45 -08:00
Kagami Sascha Rosylight
8a3fe5760f
Add asynciterable libs (#56723) 2024-01-02 11:07:57 -08:00
Daniel Rosenwasser
93e6b9da0c
Enforce identical enum values in compatibility checks (#55924) 2023-12-20 13:52:11 -08:00
Mateusz Burzyński
2c7162143b
Treat array literal contextually typed by homomorphic mapped types as in tuple context (#56555) 2023-12-13 15:12:38 -08:00
Titian Cernicova-Dragomir
b527b9059a
Perform usage analysis on refenced binding aliases in function signatures. (#55683)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
2023-12-13 13:14:51 -08:00
Jan Kühle
ba9eddb0d1
isolatedModules error on global shadowed by imported type (#56732) 2023-12-13 10:32:59 -08:00
Andrew Branch
289344a1ec
Don’t emit file references that are already referenced via imports (#56614) 2023-12-11 16:35:36 -08:00
Mateusz Burzyński
af368780cd
Avoid dependent parameters narrowings if any declared symbol of the parameter is assigned to (#56313) 2023-12-11 13:42:30 -08:00
Josh Goldberg ✨
41259d537b
Allow variance annotations on generic references (#56418) 2023-12-11 11:22:01 -08:00
Mateusz Burzyński
5b10466b63
Prevent ObjectFlags.IdenticalBaseTypeExists and ObjectFlags.IsConstrainedTypeVariable confusion (#56711) 2023-12-11 10:24:32 -08:00
Mateusz Burzyński
41ec497211
Defer conditional types with parenthesized multi-element tuple types in extends clause (#56271)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
2023-12-08 12:21:04 -08:00
Ryan Cavanaugh
8456dccbda
Directly copy only the index signature in addition to declared properties (#56626) 2023-12-07 12:25:50 -08:00
Oleksandr T
7e1c297730
fix(53181): Overloads Are Not Generated as Expected When Using JsDocOverload Tag to Declare Overloads of Functions Assigned to a Prototype (#53317)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2023-12-06 06:27:27 -08:00
Mateusz Burzyński
993ffd70e6
Improve contextually typed parameters with initializers (#56506) 2023-12-05 10:56:02 -08:00
Mateusz Burzyński
6edfef8c0d
Fixed an issue with reverse mapped types inference when single type variable is left after inferring from matching types (#55941)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2023-11-30 14:57:52 -08:00
Mateusz Burzyński
8d1fa440dd
Defer processing of nested generic calls that return constructor types (#54813)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2023-11-30 11:24:04 -08:00
Andrea Simone Costa
eb2046d046
Reverse mapped types with intersection constraint (#55811)
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2023-11-30 11:21:28 -08:00
Anders Hejlsberg
3258d75169
Reduce intersections of constrained type variables and primitive types (#56515) 2023-11-30 07:04:09 -08:00
Mateusz Burzyński
f834133fe2
Correctly resolve declared type for late bound property symbols of function expressions (#55357)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2023-11-30 07:02:48 -08:00
Mateusz Burzyński
afffad43f4
Allow non-generic return types to be read from single generic call signatures (#54477)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2023-11-29 15:40:43 -08:00
Mateusz Burzyński
0e610182d8
Avoid pulling object function property augmentations when resolving intersections' properties (#54753)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2023-11-29 15:37:13 -08:00
Mateusz Burzyński
e5513254a3
Fixed symbol lookup for binding expando properties in blocks (#56552) 2023-11-29 13:06:34 -08:00
Linus Groh
aef29e400e
Add types for Promise.withResolvers() (#56593) 2023-11-29 08:55:55 -08:00
Sheetal Nandi
13c9b16b2a
When reparsing top level await dont set original node for the new source file (#56439) 2023-11-21 13:35:49 -08:00
Mateusz Burzyński
2c0c128e98
Avoid incorrect narrowings using const variables from binding elemens with literal initializers (#56347) 2023-11-21 12:24:02 -08:00
Jake Bailey
0aa2c48ee3
Make our dts files compile when exactOptionalPropertyTypes is enabled downstream (#56489) 2023-11-21 11:40:31 -08:00