Commit graph

23 commits

Author SHA1 Message Date
Ron Buckton f56d6089f2 Adds back in the older Promise.all overloads 2021-09-09 18:31:41 -07:00
Ron Buckton ea521d45e9
Adds 'Awaited' type alias and updates to Promise.all/race/allSettled/any (#45350)
* Adds 'Awaited' type alias and updates to Promise.all/race/allSettled/any

* Use Awaited<T> with 'await'

* Clean up overloads

* Further restrict 'Awaited<T>' auto-wrapping for 'await'
2021-09-09 18:23:17 -07:00
Ron Buckton d5a646eb66
Remove optionality for Promise resolve callback (#39817) 2020-09-03 17:21:53 -07:00
Ron Buckton 10fb9c9381
Treat trailing 'void' as optional for assignability (#40231) 2020-08-28 09:12:09 -07:00
Ron Buckton 4fc4c4e3d6
Revert 'awaited' type (#37610) 2020-03-25 18:39:45 -07:00
Ron Buckton e3ec7b18b8
Add the 'awaited' type operator (#35998)
* Add the 'awaited' type operator

* Add script to manually add reviewers to a PR when GH 'Suggested Reviewers' breaks

* Fix lint error in review script

* Only defer generic awaited type for possible thenable

* Add variance-like behavior for awaited

* Switch awaited type params to 'unreliable' variance

* fix typo in inferTypes

* LKG without syntax in lib

* LKG with new syntax in lib

* Add 'strictAwaitedTypes' flag

* Treat strictAwaitedTypes as strict-mode flag

* Rename TAll, remove duplicate definition of 'race'

* Apply suggestions from code review

Co-Authored-By: ExE Boss <3889017+ExE-Boss@users.noreply.github.com>

* Fix inference priority

* Update comment to isGenericAwaitableType

* Add overloads for then/catch to Promise

* Add inference heuristic for T | PromiseLike<T> (for any PromiseLike)

* Remove strictAwaitedTypes flag

Co-authored-by: ExE Boss <3889017+ExE-Boss@users.noreply.github.com>
2020-03-20 16:09:01 -07:00
Jack Bates 78057a64ac Allow readonly arguments to Promise.all(), etc. 2019-09-19 11:11:59 -07:00
Ryan Cavanaugh d102ec0194
Better typings for promise.race based on conditional types (#31117)
Following the feature - Mapped tuple types #25947 - it is now possible to have better typings for Promise.race
2019-04-30 09:23:27 -07:00
Dan Rollo 2b0e9e686b typo: missing word: "to" (#27079)
Change:
...a resolve callback used resolve the promise...
to: 
...a resolve callback used to resolve the promise...

This PR suggested from: https://github.com/Microsoft/TypeScript/pull/27075
2018-09-13 14:23:56 -07:00
Ron Buckton 6aab09a82f Revert change to PromiseConstructor in #22772 2018-04-19 11:42:57 -07:00
Ron Buckton f7163a0a75
Merge pull request #23466 from falsandtru/lib/Promise.reject
Fix Promise.reject
2018-04-18 15:51:15 -07:00
falsandtru 55a3c22d43 Revert "Improve PromiseConstructor"
This reverts commit 4318f0d9a0.
2018-04-19 05:11:00 +09:00
falsandtru 4318f0d9a0 Improve PromiseConstructor 2018-04-18 11:45:01 +09:00
falsandtru 6798d56472 Fix Promise.reject 2018-04-17 23:08:06 +09:00
falsandtru 4c4f0e8e65 Fix Promise interfaces 2018-03-22 06:02:18 +09:00
Andy Hanson 73cab09608 Enable jsdoc-format lint rule 2017-04-03 14:39:19 -07:00
Ron Buckton 23216f9ba1 Merge branch 'master' into genericDefaults 2017-02-14 19:19:18 -08:00
Mohamed Hegazy d7ae0df647 Move interface Promise<T> declaration to es5.d.ts 2017-02-13 12:50:44 -08:00
Ron Buckton 442f5408b6 Updated Promise and PromiseLike to use defaults 2017-01-13 23:48:20 -08:00
Ron Buckton 9d4219acf1 Adjust overloads to fix #10524. 2016-09-06 15:23:11 -07:00
Ron Buckton ab2750a631 Improves Promise type definition.
Fixes #4903
2016-08-20 00:39:41 -07:00
Ron Buckton fb9806b5f9 Updates type definitions for Promise and PromiseLike, fixes issues in async functions due to introduction of never type.
Fixes #9193.
2016-06-15 17:36:27 -07:00
Kanchalai Tanglertsampan 4e6cef2965 Addres PR: change lib filenames from es6 to es2015 and es7 to es2016 2016-03-28 14:49:22 -07:00
Renamed from src/lib/es6.promise.d.ts (Browse further)