-
Notifications
You must be signed in to change notification settings - Fork 81
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
Passing down event name into TransformMethod
to allow for the right payload types to be used
#490
Comments
Hey @wolfy1339 I'm quite lost at this level of complexity in typing but I would like to help. I tried to play a bit myself and no luck but because I'm lacking expertise with generics and type inference at this level of complexity. Do you think it could be useful to draft a simple example of our problem in TypeScript playground? Tagging @G-Rath for a new TS battle ⚔️ |
You can see the discussion on what the issue is: octokit/app.js#213 (comment) Basically the first step to fixing this is to only allow the |
I am really not sure how to replicate what we have into the TS playground for a simpler example of the problem. |
This has turned into a bug. I confirmed that this is broken on |
I'm trying to fix the issue octokit/app.js#212, and I've hit a wall with types with the
transform
method.How do I pass down the
TName
type parameter from theHandlerFunction
type toTransformMethod
?The end result wanted is to keep all the same type inference as not having the
transform
method, and just apply the modifications from that function.In this case, we would like the return type to be
EmiterWebhookEvent<EventName extends EmitterWebhookEventName> & { octokit: Octokit }
The text was updated successfully, but these errors were encountered: