Repository navigation
@storybook/addon-knobs: groupId - #24797
Conversation
|
@joscha Thank you for submitting this PR! 🔔 @martynaskadisa - please review this PR in the next few days. Be sure to explicitly select If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead. |
|
@joscha The Travis CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
|
A definition author has approved this PR ⭐️. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait. Thank you for your contribution to DefinitelyTyped! |
| max: number; | ||
| step: number; | ||
| } | ||
| } | {}; |
There was a problem hiding this comment.
{} is a super type of any other type. so this type is basically {} which is almost any.
did you mean to make the properties optional instead?
There was a problem hiding this comment.
e.g.:
{
range?: boolean;
min?: number;
max?: number;
step?: number;
}There was a problem hiding this comment.
also switching from interface to type is a breaking change to users who can extend this type today. if you do not think users are doing this today, then it should be fine.
There was a problem hiding this comment.
The {} is deliberate, we either need to pass all of them or the default options when omitting them (e.g. an empty object).
Regarding the interface change, I don't think people would extend, but you never know, so I will create an intermediate type.
There was a problem hiding this comment.
The {} is deliberate, we either need to pass all of them or the default options when omitting them (e.g. an empty object).
then write it as:
{
range: boolean;
min: number;
max: number;
step: number;
} | {
range?: undefined;
min?: undefined;
max?: undefined;
step?: undefined;
};|
@joscha there are a couple of lint failures that were introduced. can you take a look. |
|
🔔 @mhegazy - Thanks for your review of this PR! Can you please look at the new code and update your review status if appropriate? |
|
Few knob types like radio, button are missing definition, maybe it got introduced later in storybook. |
Please fill in this template.
Use a meaningful title for the pull request. Include the name of the package modified.
Test the change in your own code. (Compile and run.)
Add or edit tests to reflect the change. (Run with
npm test.)Follow the advice from the readme.
Avoid common mistakes.
Run
npm run lint package-name(ortscif notslint.jsonis present).Provide a URL to documentation or source code which provides context for the suggested changes: @storybook/addon-knobs wrong types for typescript in @types/storybook__addon-knobs storybookjs/storybook#3374,
Increase the version number in the header if appropriate.
If you are making substantial changes, consider adding a
tslint.jsoncontaining{ "extends": "dtslint/dt.json" }.