mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Add typings for @storybook/addon-backgrounds
This commit is contained in:
17
types/storybook__addon-backgrounds/index.d.ts
vendored
Normal file
17
types/storybook__addon-backgrounds/index.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Type definitions for @storybook/addon-backgrounds 3.2
|
||||
// Project: https://github.com/storybooks/storybook
|
||||
// Definitions by: HyunSeob <https://github.com/hyunseob>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
import { StoryDecorator } from '@storybook/react';
|
||||
|
||||
export interface Background {
|
||||
name: string;
|
||||
value: string;
|
||||
default?: boolean;
|
||||
}
|
||||
|
||||
declare function backgrounds(backgrounds: Background[]): StoryDecorator;
|
||||
|
||||
export default backgrounds;
|
||||
@@ -0,0 +1,19 @@
|
||||
import * as React from 'react';
|
||||
import { storiesOf } from '@storybook/react';
|
||||
import backgrounds from '@storybook/addon-backgrounds';
|
||||
|
||||
storiesOf('Text', module)
|
||||
.addDecorator(
|
||||
backgrounds([
|
||||
{
|
||||
name: 'white',
|
||||
value: '#fff',
|
||||
default: true
|
||||
},
|
||||
{
|
||||
name: 'black',
|
||||
value: '#000'
|
||||
}
|
||||
])
|
||||
)
|
||||
.add('default', () => <p>This is just sample.</p>);
|
||||
32
types/storybook__addon-backgrounds/tsconfig.json
Normal file
32
types/storybook__addon-backgrounds/tsconfig.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"jsx": "react",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"paths": {
|
||||
"@storybook/addon-backgrounds": [
|
||||
"storybook__addon-backgrounds"
|
||||
],
|
||||
"@storybook/react": [
|
||||
"storybook__react"
|
||||
]
|
||||
},
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"storybook__addon-backgrounds-tests.tsx"
|
||||
]
|
||||
}
|
||||
1
types/storybook__addon-backgrounds/tslint.json
Normal file
1
types/storybook__addon-backgrounds/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user