-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code
Description
TypeScript Version: 2.1.1 / nightly (2.2.0-dev.201xxxxx)
Can we support async function type? That would make a lot of async code much cleaner.
For example:
Code
type asyncFunctionResolvingToString = async () => string;Expected behavior:
Because TS currently implements ES2016 async/await proposal, under the hood it'd be equivalent to:
type asyncFunctionResolvingToString = () => Promise<string>;Note: using Promise is just an implementation detail and could change in the future. What would stay the same is the fact, that the method returns its values async and can be "awaited".
Actual behavior:
TS error:
TS: cannot find name async
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code