Derive getUserOctokit
return type from Octokit
option
#262
Labels
Status: Up for grabs
Issues that are ready to be worked on by anyone
Type: Bug
Something isn't working as documented
typescript
Relevant to TypeScript users only
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: