Skip to content

Fix for types number for addon knobs#1001

Merged
ndelangen merged 3 commits intostorybookjs:masterfrom
marcfallows:number-types
May 9, 2017
Merged

Fix for types number for addon knobs#1001
ndelangen merged 3 commits intostorybookjs:masterfrom
marcfallows:number-types

Conversation

@marcfallows
Copy link
Copy Markdown
Contributor

Issue: number did not have the correct types to allow for passing options in typescript.

What I did

I added the types, and updated the typescript example (which wasn't using number).

How to test

Typescript does not complain about packages/addon-knobs/example/typescript/index.tsx. If you only use the first commit you'll see it breakhttps://github.com/marcfallows/storybook/commit/07ddee747e839f0e93ffc010a479d94bc9b6c9c5 and then it is fixed on marcfallows@378acbc.


const bold = boolean('Bold', false);
const color = color('Color', 'black');
const selectedColor = color('Color', 'black');
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is changed because TS should complain about block scoping when trying to override color. Updated to use a different name (which lines up with the storybook example).

@codecov
Copy link
Copy Markdown

codecov bot commented May 8, 2017

Codecov Report

Merging #1001 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1001   +/-   ##
=======================================
  Coverage   12.61%   12.61%           
=======================================
  Files         192      192           
  Lines        4424     4424           
  Branches      707      707           
=======================================
  Hits          558      558           
  Misses       3241     3241           
  Partials      625      625

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 119d634...7620861. Read the comment docs.

@ndelangen ndelangen merged commit 7910ae6 into storybookjs:master May 9, 2017
@ndelangen
Copy link
Copy Markdown
Member

Thank you for this @marcfallows !

Maybe you can help us get even more typescript support?

@shilman shilman added the misc label May 27, 2017
@ndelangen ndelangen added the bug label May 27, 2017
@ndelangen ndelangen changed the title Fixes for types for knobs number Fix for types number for addon knobs May 27, 2017
@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Jul 11, 2024

View your CI Pipeline Execution ↗ for commit 7620861.

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 1m 18s View ↗

☁️ Nx Cloud last updated this comment at 2025-07-01 02:05:03 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants