mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Merge pull request #17406 from joscha/joscha/add-@storybook/addon-links
add package @storybook/addon-links
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
// Type definitions for @storybook/addon-links 3.0
|
||||
// Project: https://github.com/storybooks/storybook
|
||||
// Definitions by: Joscha Feth <https://github.com/joscha>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// TODO: Once TS2.3 is released,
|
||||
// https://github.com/Microsoft/TypeScript/issues/14819 should be fixed.
|
||||
// Then, upgrade this package's typescript version to 2.3 and
|
||||
// Remove the `declare module` wrapper.
|
||||
// tslint:disable-next-line no-single-declare-module
|
||||
declare module '@storybook/addon-links' {
|
||||
import * as React from 'react';
|
||||
|
||||
function linkTo<T>(book: string, kind?: string): React.MouseEventHandler<T>;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
/// <reference types="storybook__react" />
|
||||
|
||||
import * as React from 'react';
|
||||
import { storiesOf } from '@storybook/react';
|
||||
import { linkTo } from '@storybook/addon-links';
|
||||
|
||||
storiesOf('Button', module)
|
||||
.add('First', () => (
|
||||
<button onClick={linkTo('Button', 'Second')}>Go to "Second"</button>
|
||||
))
|
||||
.add('Second', () => (
|
||||
<button onClick={linkTo('Button', 'First')}>Go to "First"</button>
|
||||
));
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"jsx": "react",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"storybook__addon-links-tests.tsx"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user