Skip to content

Commit c026b65

Browse files
mkozhukharenkoarunoda
authored andcommitted
Update typings (#493)
* add typings for `linkTo` addon * action must return `any` since it brakes typings chain So, having such example leads to the typescript error `error TS2322: Type 'Function' is not assignable to type '(newVal: string) => void'.` ```js interface Props { onChange?(newVal: string): void, } class ExampleComponent extends Component<Props, void> { render() { return ( <input onChange={this.props.onChange}>Hi!</div> ) } } storiesOf('Example', module) .add('Regular use case', () => ( <ExampleComponent onChange={action('changed')}/> )) ```
1 parent 97d11fb commit c026b65

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

config/storybook.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ interface Story {
99
addDecorator (decorator: StoryDecorator): Story;
1010
}
1111

12+
export function linkTo(name: string, ...params: any[]): void;
1213
export function storiesOf(name: string, module: any): Story;
13-
export function action(name: string, ...params: any[]): Function;
14+
export function action(name: string, ...params: any[]): any;

0 commit comments

Comments
 (0)