diff --git a/types/storybook__addon-actions/index.d.ts b/types/storybook__addon-actions/index.d.ts index 9b7009fbad..2d5cc73ef8 100644 --- a/types/storybook__addon-actions/index.d.ts +++ b/types/storybook__addon-actions/index.d.ts @@ -7,5 +7,5 @@ export type HandlerFunction = (...args: any[]) => undefined; export type DecoratorFunction = (args: any[]) => any[]; -export function decorateAction(decorators: DecoratorFunction[]): HandlerFunction; +export function decorateAction(decorators: DecoratorFunction[]): (name: string) => HandlerFunction; export function action(name: string): HandlerFunction; diff --git a/types/storybook__addon-actions/storybook__addon-actions-tests.tsx b/types/storybook__addon-actions/storybook__addon-actions-tests.tsx index 77ba80985b..b9c9bbba7f 100644 --- a/types/storybook__addon-actions/storybook__addon-actions-tests.tsx +++ b/types/storybook__addon-actions/storybook__addon-actions-tests.tsx @@ -19,3 +19,21 @@ storiesOf('Button', module) Hello World! )); + +interface CustomComponentProps { + id: string; + setValues(id: string, values: string[]): void; +} +class CustomComponent extends React.Component { + setSomeValues = () => { + this.props.setValues(this.props.id, ['one', 'two', 'three']); + } + render() { + return ; + } +} + +storiesOf('CustomComponent', module) + .add('decorated custom action', () => ( + + ));