mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-03-29 17:08:21 +08:00
@storybook/addon-knobs: add button() knob (#23302)
This commit is contained in:
committed by
Sheetal Nandi
parent
1d7a6e1f41
commit
99614fa920
2
types/storybook__addon-knobs/index.d.ts
vendored
2
types/storybook__addon-knobs/index.d.ts
vendored
@@ -46,6 +46,8 @@ export function date(name: string, value?: Date): Date;
|
||||
|
||||
export function array<T>(name: string, value: T[], separator?: string): T[];
|
||||
|
||||
export function button(name: string, handler: () => any): void;
|
||||
|
||||
export interface WrapStoryProps {
|
||||
context?: object;
|
||||
storyFn?: RenderFunction;
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
select,
|
||||
date,
|
||||
array,
|
||||
button,
|
||||
knob,
|
||||
} from '@storybook/addon-knobs';
|
||||
|
||||
@@ -58,6 +59,8 @@ stories.add('with all knobs', () => {
|
||||
|
||||
const genericKnob: X = knob<X>('Some generic knob', { value: 'a', type: 'text' });
|
||||
|
||||
button('Some button', () => console.log('Button knob clicked'));
|
||||
|
||||
const style = {
|
||||
...customStyle,
|
||||
fontWeight: bold ? 800 as 800 : 400 as 400, // tslint:disable-line no-unnecessary-type-assertion
|
||||
|
||||
Reference in New Issue
Block a user