Extract function parameters or change function return type in mapped types #24068
Labels
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
Suggestion
An idea for TypeScript
Search Terms
extract function parameters
change function return type
Suggestion
Allow mapped types to change the return type of a function
Use Cases
I am writing a mocking framework. My system under test might be like this:
but in my mocking framework I want to do this:
to do the
withParameters
I need to type a function with the same parameters as defined on my class but with a different return type.Checklist
My suggestion meets these guidelines:
[ ] This wouldn't be a breaking change in existing TypeScript / JavaScript code
[ ] This wouldn't change the runtime behavior of existing JavaScript code
[ ] This could be implemented without emitting different JS based on the types of the expressions
[ ] This isn't a runtime feature (e.g. new expression-level syntax)
The text was updated successfully, but these errors were encountered: