mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 01:31:45 +00:00
[@storybook/addon-backgrounds] Add withBackgrounds function type
This commit is contained in:
+4
-1
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user