Skip to content

Conversation

@Newbie012
Copy link

Typescript 4.5 has introduced the Awaited type, which recursively extracts the value inside a promise.

@Newbie012
Copy link
Author

Newbie012 commented Jun 22, 2022

After some research, I discovered that this syntax uses Recursive Conditional Types which were introduced in version 4.1. Thus, it won't work for versions that are lower than 4.1.

I'm not sure how to proceed from here. Thoughts?

Copy link
Owner

@sandersn sandersn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awaited is a built-in type, but it doesn't use any new syntax. downlevel-dts is intended to make .d.ts files compatible with the syntax of old Typescript versions -- in most cases some semantics get lost, even.

I think the right fix for projects that need to support pre-4.5 versions is to provide their own copy of Awaited, perhaps only for people on pre-4.5 versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants