UNPKG

2.72 kBTypeScriptView Raw
1import type { StoryContext } from '@storybook/csf';
2import type { Theme } from './preview/components/Shared/theme';
3import type { ReactNativeFramework } from './types/types-6.0';
4/**
5 * Hook that returns a function to set the current story context.
6 */
7export declare function useSetStoryContext(): (args_0: StoryContext<ReactNativeFramework, import("@storybook/csf").Args> | ((prev: StoryContext<ReactNativeFramework, import("@storybook/csf").Args>) => StoryContext<ReactNativeFramework, import("@storybook/csf").Args>)) => void;
8/**
9 * Hook to read the current story context.
10 */
11export declare function useStoryContext(): StoryContext<ReactNativeFramework, import("@storybook/csf").Args>;
12/**
13 * Hook that reads the value of a specific story context parameter.
14 */
15export declare function useStoryContextParam<T = any>(name: string, defaultValue?: T): T;
16/**
17 * Hook that indicates if `storyId` is the currently selected story.
18 */
19export declare function useIsStorySelected(storyId: string): boolean;
20/**
21 * Hook that indicates if `title` is the currently selected story section.
22 */
23export declare function useIsStorySectionSelected(title: string): boolean;
24/**
25 * Hook that causes a re-render when the currently selected story is changed.
26 */
27export declare function useUpdateOnStoryChanged(): void;
28/**
29 * Hook that gets the current theme values.
30 */
31export declare function useTheme(): Theme;
32/**
33 * A boolean atom creator for an atom that can only be toggled between
34 * true/false.
35 *
36 * @see {@link https://jotai.org/docs/recipes/atom-creators#atomwithtoggle}
37 */
38export declare function atomWithToggle(initialValue?: boolean): import("jotai").WritableAtom<boolean, [nextValue?: boolean], void> & {
39 init: boolean;
40};
41/**
42 * Hook that retrieves the current state, and a setter, for the `isUIVisible`
43 * atom.
44 */
45export declare function useIsUIVisible(): [boolean, (nextValue?: boolean) => void];
46/**
47 * Hook that retrieves the current state, and a setter, for the
48 * `isSplitPanelVisibleAtom` atom.
49 */
50export declare function useIsSplitPanelVisible(): [boolean, (nextValue?: boolean) => void];
51interface SyncExternalUIParams {
52 isUIVisible?: boolean;
53 isSplitPanelVisible?: boolean;
54}
55/**
56 * Sync the UI atom states with external values, such as from Story parameters.
57 */
58export declare function syncExternalUI({ isUIVisible, isSplitPanelVisible }: SyncExternalUIParams): void;
59/**
60 * Hook that manages the state for the currently selected addon.
61 *
62 * This value persists across stories, so that the same addon will be selected
63 * when switching stories.
64 */
65export declare function useSelectedAddon(initialValue?: string): [string, (args_0: string | ((prev: string) => string)) => void];
66export {};