You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the authentication strategy options (authStrategy, auth) and make the types for auth depend on what authStrategy is set to, either as part of the same options object or via .defaults()#18
and derive the types for auth from the strategy function options
Make it work for custom classes created with .withDefaults(), e.g.
constAppOctokit=Octokit.defaults({authStrategy: createAppAuth})constappOctokit=newAppOctokit()// ^ complains that `auth` must be set to `{ appId: string, privateKey: string, ... etc }`
The text was updated successfully, but these errors were encountered:
I made the show on the topic: gr2m/helpdesk#29
An approach that eventually worked: TypeScript playground
The goal here is
If
authStrategy
is not set, requireauth
to be set to a string (token)If
authStrategy
is set, make sure it adheres to a common interface:.hook
property that can be used to hook into the request lifecycleand derive the types for
auth
from the strategy function optionsMake it work for custom classes created with
.withDefaults()
, e.g.The text was updated successfully, but these errors were encountered: