-
Notifications
You must be signed in to change notification settings - Fork 26
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
Derive getUserOctokit
return type from Octokit
option
#262
Comments
I was able to reproduce the issue. It might be further complicated by the fact that the https://github.com/octokit/octokit.js/blob/e19f0cedb664746b9b7a5059a69488a5671aa4d0/src/app.ts#L9 would you like to give it a go and resolve the problem? I'd be happy to review PRs, but I won't be able to work on it myself anytime soon |
Unfortunately I don't think I will be able to prepare a full pull request. However, the code changes should be quite easy, thanks to the work done in #212 . And the fact that the I would think that it is enough to redeclare
and to redeclare
|
What happened?
causes a type error in the last line, because the unwrapped return value of
app.getUserOctokit
is not assignable to the constant of typeOctokit
.What did you expect to happen?
No type errors.
What the problem might be
app.getUserOctokit
returns a promise of an instance type ofOctokit
option.However,
app.getUserOctokit
is declared as returningPromise<OctokitInstance>
, whereOctokitInstance
is hardcoded to be an instance type ofOAuthTypeOctokit
, regardless of the options passed toOAuthApp
constructor.It should probably be declared as returning
Promise<OctokitTypeFromOptions<TOptions>>
instead.A similar issue (but about
octokit
field instead ofgetUserOctokit
method) is #212.The text was updated successfully, but these errors were encountered: