Skip to content

Convert type OctokitOptions to interface OctokitOptions #449

@oscard0m

Description

@oscard0m

What’s missing?

To convert type OctokitOptions to interface OctokitOptions would open the door to make more accurate types for Octokit Plugins with specific required options like @octokit/plugin-throttling:

https://github.com/octokit/plugin-throttling.js/blob/c567474ff2f6959a460d1139959052ec70a791a6/src/types.ts#L10-L20

Why?

When trying to deprecate a property for the option object provided to @octokit/plugin-throttling I noticed there is not a good typing to be able to do so.

Also, we are missing all the benefits from a good TS typing for this and other plugins (auto-completion, catch errors on build time, etc...)

Alternatives you tried
You can see this draft PR (octokit/plugin-throttling.js#457) where we did a bit of experimentation but @G-Rath come up with a great solution which implies this change in @octokit/core.js types:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions