Feature Request: expose getPromisedTypeOfPromise #30774
Labels
API
Relates to the public API for TypeScript
Needs Investigation
This issue needs a team member to investigate its status.
Search Terms
Suggestion
expose
getPromisedTypeOfPromise
in theTypeChecker
API.Use Cases
Writing lint rules with typechecking involving promises. One example is one checking the result of a yield in a generator. Since yields inside generators are not typed, being able to use linting to check types are properly annotated can be powerful.
Examples
call
is a redux saga effect that has an API contract of calling a passed function and awaiting if it is a promise. Given this contract, its possible to write a lint rule instructing a consumer to annotatey
with: number
.Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: