[@storybook/addon-backgrounds] Add withBackgrounds function type

This commit is contained in:
adhrinae
2018-12-20 23:32:27 +09:00
parent ffdeb117ad
commit c13ce38118
2 changed files with 6 additions and 3 deletions
+4 -1
View File
@@ -1,6 +1,7 @@
// Type definitions for @storybook/addon-backgrounds 3.2
// Type definitions for @storybook/addon-backgrounds 4.3.1
// Project: https://github.com/storybooks/storybook
// Definitions by: HyunSeob <https://github.com/hyunseob>
// An Dohyung <https://github.com/adhrinae>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@@ -11,7 +12,9 @@ export interface Background {
value: string;
default?: boolean;
}
export function withBackgrounds(backgrounds: Background[]): StoryDecorator;
// [DEPRECATED] Use `withBackgrounds` function instead.
declare function backgrounds(backgrounds: Background[]): StoryDecorator;
export default backgrounds;
@@ -1,10 +1,10 @@
import * as React from 'react';
import { storiesOf } from '@storybook/react';
import backgrounds from '@storybook/addon-backgrounds';
import { withBackgrounds } from '@storybook/addon-backgrounds';
storiesOf('Text', module)
.addDecorator(
backgrounds([
withBackgrounds([
{
name: 'white',
value: '#fff',