From 442fdb85c044225c2877da19b5ef572aa2871725 Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Fri, 23 Jun 2017 00:50:05 +0200 Subject: [PATCH] add package @storybook/addon-links --- types/storybook__addon-links/index.d.ts | 16 +++++++++++++ .../storybook__addon-links-tests.tsx | 13 +++++++++++ types/storybook__addon-links/tsconfig.json | 23 +++++++++++++++++++ types/storybook__addon-links/tslint.json | 1 + 4 files changed, 53 insertions(+) create mode 100644 types/storybook__addon-links/index.d.ts create mode 100644 types/storybook__addon-links/storybook__addon-links-tests.tsx create mode 100644 types/storybook__addon-links/tsconfig.json create mode 100644 types/storybook__addon-links/tslint.json diff --git a/types/storybook__addon-links/index.d.ts b/types/storybook__addon-links/index.d.ts new file mode 100644 index 0000000000..d66f049c3c --- /dev/null +++ b/types/storybook__addon-links/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for @storybook/addon-links 3.0 +// Project: https://github.com/storybooks/storybook +// Definitions by: Joscha Feth +// 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(book: string, kind?: string): React.MouseEventHandler; +} diff --git a/types/storybook__addon-links/storybook__addon-links-tests.tsx b/types/storybook__addon-links/storybook__addon-links-tests.tsx new file mode 100644 index 0000000000..a818c12f6c --- /dev/null +++ b/types/storybook__addon-links/storybook__addon-links-tests.tsx @@ -0,0 +1,13 @@ +/// + +import * as React from 'react'; +import { storiesOf } from '@storybook/react'; +import { linkTo } from '@storybook/addon-links'; + +storiesOf('Button', module) + .add('First', () => ( + + )) + .add('Second', () => ( + + )); diff --git a/types/storybook__addon-links/tsconfig.json b/types/storybook__addon-links/tsconfig.json new file mode 100644 index 0000000000..79562bc8c1 --- /dev/null +++ b/types/storybook__addon-links/tsconfig.json @@ -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" + ] +} diff --git a/types/storybook__addon-links/tslint.json b/types/storybook__addon-links/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/storybook__addon-links/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }