return type of auth({ type: "installation", installationId, factory })
should be Promise<ReturnType<factory>>
#204
Labels
Type: Bug
Something isn't working as documented, or is being fixed
typescript
Relevant to TypeScript users only
Follow up to https://github.com/octokit/auth-app.js/pull/198/files#diff-c54113cf61ec99691748a3890bfbeb00e10efb3f0a76f03a0fd9ec49072e410aR109-R111
Currently, when doing this:
The type for
installationOctokit
isunknown
. What it should be though is the same as the type ofappOctokit
.With the way the Types for authentication strategies are currently implemented, this change will be very hard to accomplish. Unfortunately it will be quite a rabbit hole, but I think it's about time we introduce a globally declared
Octokit
namespace on which we can define interfaces that plugins and users can extend.I'd declare the global
Octokit
namespace in https://github.com/octokit/types.ts/Then each Octokit authentication strategy module could extend the interface
We could still use
OctokitTypes.StrategyInterface
withimplements
to make sure the API surface for each authentication strategy is compatible.See
namespace
webhooks.js#308The text was updated successfully, but these errors were encountered: