-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support "type" transformation #24
Comments
Yep that's definitely doable Can you elaborate on your comment re generics and type parameters? |
In case anyone wants to pick this one up, it should be quite similar to the way "value" is implemented: |
So I vaguely referred to those other things because I'm relatively new to TypeScript so I don't have strong opinions on how I'd like them to work. Here's an example lifted from the TypeScript docs: function identity<Type>(arg: Type): Type {
return arg;
} There's two different types related to the function:
The type variable can appear again at call time, here it's let output = identity<string>("myString"); |
I'm unsure how the AST looks here & other details under the hood, but I would think that the "type" transformation should also cover type aliases and interface declarations. type Point {
x: number;
y: number;
} It would also be useful to reference properties of an object type similar to the way that the "map" transformation works on objects. I'm starting to look into the implementation of this transformation -- no promises though! |
Would it be possible to add a "type" transformation? In TypeScript, for example:
I think being able to "take type" and select
{ user: string; event: string }[]
it would be very useful.Less important imo, but there are also the cases of generics and type parameters to consider?
The text was updated successfully, but these errors were encountered: