Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export DecoratorFunction #506

Open
hayata-suenaga opened this issue Aug 13, 2023 · 1 comment
Open

Export DecoratorFunction #506

hayata-suenaga opened this issue Aug 13, 2023 · 1 comment

Comments

@hayata-suenaga
Copy link

Is your feature request related to a problem? Please describe.
I want to use DecoratorFunction type. However, this type is not exported from the library.

Describe the solution you'd like
import { DecoratorFunction } from @storybook/react-native

Describe alternatives you've considered

type Temp = Meta["decorators"];
type ExtractDecoratorFunction<T> = T extends (infer R)[] ? R : never;
type DecoratorFunction = ExtractDecoratorFunction<Temp>;

or

import {DecoratorFunction} from "@storybook/csf/dist/story"

Are you able to assist bring the feature to reality?
maybe?

Additional context
N/A

@dannyhw
Copy link
Member

dannyhw commented Aug 13, 2023

this should be possible, in the meantime heres a workaround you can use for now

import { addDecorator } from '@storybook/react-native';

type Decorator = Parameters<typeof addDecorator>[0];

You may also be able to use the decorator type from @storybook/react if you have it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants