diff --git a/types/storybook__addon-links/index.d.ts b/types/storybook__addon-links/index.d.ts index 802e193afb..08f3648855 100644 --- a/types/storybook__addon-links/index.d.ts +++ b/types/storybook__addon-links/index.d.ts @@ -6,4 +6,6 @@ import * as React from 'react'; -export function linkTo(book: string, kind?: string): React.MouseEventHandler; +export type LinkToFunction = (...args: any[]) => string; + +export function linkTo(book: string | LinkToFunction, kind?: string | LinkToFunction): React.MouseEventHandler; diff --git a/types/storybook__addon-links/storybook__addon-links-tests.tsx b/types/storybook__addon-links/storybook__addon-links-tests.tsx index 9b3abb6f6e..2f138daf20 100644 --- a/types/storybook__addon-links/storybook__addon-links-tests.tsx +++ b/types/storybook__addon-links/storybook__addon-links-tests.tsx @@ -8,4 +8,7 @@ storiesOf('Button', module) )) .add('Second', () => ( + )) + .add('With function', () => ( + ));