proposal-await.ops
proposal-await.ops copied to clipboard
Implementation in TypeScript
I did an implementation for this proposal just for fun. https://github.com/Jack-Works/TypeScript/tree/await.ops
- [x] Syntax: Basic support
- [x] Type: Basic support
- [x] Transpile: Downlevel to ES2020
- [x] Type: Support concrete tuple type
- [x] Type: Check if Promise.{*} exists
- [x] ~~Syntax: Require a space after the operator? (Current impl
await.all[array]is valid)~~ - [ ] Service: Auto complete after
await. - [ ] Service: Syntax highlight
- [ ] Service: Refactor suggestion
- [ ] Service: Hover quickinfo?
- [x] Type: Unique type error message
Screenshots:

In TypeScript, Promise.all has 10 generic signatures. If the array has more than 10 items in it, it will fail. The new syntax does not have this limitation.

Downgraded to ES2020, they are the same.

Support iterables
Playground v2: https://www.typescriptlang.org/play/index.html?ts=4.0.0-pr-39224-4&ssl=1&ssc=1&pln=5&pc=2#code/IYZwngdgxgBAZgV2gFwJYHsIwLbFRACgEoYBvAKBipmAHc9kA6YAGxZgAZLqpMRkYAbQAeAXRgBeGvVRNWLQQAUATumyoQAU0bLNIdCwBumggCYAzOaKjuVYY2ToAosIAOmTRDSti5AL5AA
Playground v3: Playground Link