-
Notifications
You must be signed in to change notification settings - Fork 36
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
fix(types): improvements to internal types and options
parameter
#642
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cheers!
@octokit/maintainers you can remove the required CI from all @octokit repositories using this @octoherd script: https://github.com/octoherd/script-remove-required-ci-check |
* Add internal `State` type * Type the `wrapRequest()` function * Add type augmentation of `OctokitResponse`
Waiting on octokit/types.ts#594 |
@oscard0m Could you review this to make sure it all makes sense The types for the handler were taken from |
I won’t be available until next week to review this. Is that ok? @wolfy1339 |
That's fine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall. Great job as always @wolfy1339
I left some comments on some @ts-expect-error
, just in case there is a chance we can solve them.
This is odd... The typescript compiler doesn't complain when compiling the whole project for the types, it only complains for the |
Build the project first, then import from the build and then do the type check
I'm on this team, but I'm not an org admin. Sorry! |
This seems to do with the fact that typescript is compiling the files one by one, and not taking them into account as to how they affect other files. When we build as a project, it keeps this context when it compiles all the files |
Well this is annoying.... Merging in |
🎉 This PR is included in version 8.1.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Fixes #641
This should unblock users, as using
object
doesn't allow users to access options properties in TypeScript.The types were inferred from the call to
octokit.hook.wrap()
, and also confirmed from the types from@octokit/core
https://github.com/octokit/core.js/blob/1c64ce28a2352c88091732985502b257cb242c02/src/types.ts#L55-L59