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
Instead of using any arguments and a mixed return type, we could specify valid values for action and pair them with the expected argument types in each case.
The main benefit is in better Intellisense/autocomplete hints when using the API. Specific options are suggested to the user, instead of an opaque string type forcing them to refer to the documentation.
Here's an example of autocomplete in action, after adding the three more specific type definitions:
I will link a PR with this code in case it's something the maintainers would consider integrating. It is a type-only change that doesn't affect any functionality, and is backwards-compatible with the current type definitions (being just a more narrow version of these).
The text was updated successfully, but these errors were encountered:
The current type definition for
addJob
is as follows:Instead of using
any
arguments and a mixed return type, we could specify valid values foraction
and pair them with the expected argument types in each case.Proposed implementation:
The main benefit is in better Intellisense/autocomplete hints when using the API. Specific options are suggested to the user, instead of an opaque string type forcing them to refer to the documentation.
Here's an example of autocomplete in action, after adding the three more specific type definitions:
I will link a PR with this code in case it's something the maintainers would consider integrating. It is a type-only change that doesn't affect any functionality, and is backwards-compatible with the current type definitions (being just a more narrow version of these).
The text was updated successfully, but these errors were encountered: