@storybook/codemod
Version:
A collection of codemod scripts written with JSCodeshift
24 lines (22 loc) • 564 B
TypeScript
/**
* Takes the deprecated addon-info API, addWithInfo, and converts to the new withInfo API.
*
* @example Of deprecated addWithInfo API:
*
* ```jsx
* storiesOf('Button').addWithInfo('story name', 'Story description.', () => (
* <Button label="The Button" />
* ));
* ```
*
* Converts to the new withInfo API:
*
* ```jsx
* storiesOf('Button').add(
* 'story name',
* withInfo('Story description.')(() => <Button label="The Button" />)
* );
* ```
*/
declare function transformer(file: any, api: any): any;
export { transformer as default };