Sorrell Docgen

Search documentation

Menu

API REFERENCE

@sorrell/docs-react-native-storybook

Native Storybook infrastructure for Expo applications.

48 exportsSource

Functions

ArticleFUNCTION

Signature

export declare function Article(
    __namedParameters: ArticleProps
): Element;

ArticleCalloutFUNCTION

Signature

export declare function ArticleCallout(
    __namedParameters: ArticleCalloutProps
): Element;

ArticleCodeFUNCTION

Signature

export declare function ArticleCode(
    __namedParameters: ArticleCodeProps
): Element;

ArticleExampleFUNCTION

Signature

export declare function ArticleExample(
    __namedParameters: ArticleExampleProps
): Element;

ArticleSectionFUNCTION

Signature

export declare function ArticleSection(
    __namedParameters: ArticleSectionProps
): Element;

ArticleTextFUNCTION

Signature

export declare function ArticleText(
    __namedParameters: { children: ReactNode }
): Element;

Signature

export declare function createAsyncStorageSelectionStorage(
    storage: {
        getItem: (key: string) => Promise<string | null>;
        removeItem?: (key: string) => Promise<void>;
        setItem: (key: string, value: string) => Promise<void>
    }
): SelectionStorage;

createControlsDefaultsFUNCTION

Signature

export declare function createControlsDefaults(
    overrides?: ControlsDefaults
): ControlsDefaults;

createMemorySelectionStorageFUNCTION

Signature

export declare function createMemorySelectionStorage(
    initial?: Readonly<Record<string, string>>
): SelectionStorage;

createMetroConfigFUNCTION

Signature

export declare function createMetroConfig(
    config?: MetroConfig,
    options?: MetroStorybookOptions
): MetroConfig;

createNativeDecoratorsFUNCTION

Signature

export declare function createNativeDecorators(
    title?: string
): ((Story: NativeStoryRenderer) => ReactNode)[];

createNativeThemeFUNCTION

Signature

export declare function createNativeTheme(
    mode: NativeThemeMode,
    systemMode: "light" | "dark" | null | undefined
): NativeTheme;

decodeSelectionFUNCTION

Signature

export declare function decodeSelection(
    value: string | null
): StorySelection;

encodeSelectionFUNCTION

Signature

export declare function encodeSelection(
    selection: StorySelection
): string;

KeyboardDecoratorFUNCTION

Signature

export declare function KeyboardDecorator(
    Story: NativeStoryRenderer
): Element;

NativeStorybookProviderFUNCTION

Signature

export declare function NativeStorybookProvider(
    __namedParameters: NativeStorybookProviderProps
): Element;

NativeThemeProviderFUNCTION

Signature

export declare function NativeThemeProvider(
    __namedParameters: NativeThemeProviderProps
): Element;

readSelectionFUNCTION

Signature

export declare function readSelection(
    storage: SelectionStorage,
    key: string
): Promise<StorySelection>;

resolveNativeThemeModeFUNCTION

Signature

export declare function resolveNativeThemeMode(
    mode: NativeThemeMode,
    systemMode: "light" | "dark" | null | undefined
): "light" | "dark";

StoryHeaderFUNCTION

Signature

export declare function StoryHeader(
    __namedParameters: StoryHeaderProps
): Element;

StoryHeaderDecoratorFUNCTION

Signature

export declare function StoryHeaderDecorator(
    Story: NativeStoryRenderer,
    title: string,
    subtitle?: string
): Element;

ThemeDecoratorFUNCTION

Signature

export declare function ThemeDecorator(
    Story: NativeStoryRenderer
): Element;

useNativeStorybookFUNCTION

Signature

export declare function useNativeStorybook(): NativeStorybookContextValue;

useNativeThemeFUNCTION

Signature

export declare function useNativeTheme(): ThemeContextValue;

withStorybookMetroFUNCTION

Signature

export declare function withStorybookMetro(
    config: MetroConfig,
    options?: MetroStorybookOptions
): MetroConfig;

writeSelectionFUNCTION

Signature

export declare function writeSelection(
    storage: SelectionStorage,
    key: string,
    selection: StorySelection
): Promise<void>;

Interfaces

ArticleCalloutPropsINTERFACE

Signature

export declare interface ArticleCalloutProps {
    readonly children: ReactNode;
    readonly title?: string;
    readonly tone?: "note" | "warning" | "tip";
}

ArticleCodePropsINTERFACE

Signature

export declare interface ArticleCodeProps {
    readonly children: ReactNode;
    readonly language?: string;
}

ArticleExamplePropsINTERFACE

Signature

export declare interface ArticleExampleProps {
    readonly children: ReactNode;
    readonly title?: string;
}

ArticlePropsINTERFACE

Signature

export declare interface ArticleProps {
    readonly children: ReactNode;
    readonly scroll?: boolean;
    readonly title?: string;
}

ArticleSectionPropsINTERFACE

Signature

export declare interface ArticleSectionProps {
    readonly children: ReactNode;
    readonly title?: string;
}

ControlsDefaultsINTERFACE

Signature

export declare interface ControlsDefaults {
    readonly exclude?: readonly string[];
    readonly expanded?: boolean;
    readonly hideNoControlsWarning?: boolean;
    readonly sort?: "alpha" | "requiredFirst" | "none";
}

MetroConfigINTERFACE

Signature

export declare interface MetroConfig {
    readonly resolver?: Record<string, unknown>;
    readonly transformer?: Record<string, unknown>;
}

MetroStorybookOptionsINTERFACE

Signature

export declare interface MetroStorybookOptions {
    readonly configPath?: string;
    readonly enabled?: boolean;
    readonly storybookEntrypoint?: string;
    readonly withStorybook?: (config: MetroConfig, options: MetroStorybookOptions) => MetroConfig;
}

NativeProviderComponentPropsINTERFACE

Signature

export declare interface NativeProviderComponentProps {
    readonly children: ReactNode;
    readonly style?: object;
}

NativeProviderCompositionINTERFACE

Signature

export declare interface NativeProviderComposition {
    readonly GestureHandlerRootView?: NativeProviderComponent;
    readonly KeyboardProvider?: NativeProviderComponent;
    readonly SafeAreaProvider?: NativeProviderComponent;
}

NativeStorybookContextValueINTERFACE

Signature

export declare interface NativeStorybookContextValue {
    readonly selection: StorySelection;
    readonly setSelection: (selection: StorySelection) => void;
    readonly setThemeMode: (mode: NativeThemeMode) => void;
    readonly theme: NativeTheme;
}

NativeStorybookProviderPropsINTERFACE

Signature

export declare interface NativeStorybookProviderProps {
    readonly children: ReactNode;
    readonly initialMode?: NativeThemeMode;
    readonly initialSelection?: StorySelection;
    readonly providers?: NativeProviderComposition;
    readonly storage?: SelectionStorage;
    readonly storageKey?: string;
}

NativeThemeINTERFACE

Signature

export declare interface NativeTheme {
    readonly colors: NativeThemeColors;
    readonly mode: NativeThemeMode;
    readonly resolvedMode: "light" | "dark";
}

NativeThemeColorsINTERFACE

Signature

export declare interface NativeThemeColors {
    readonly accent: string;
    readonly background: string;
    readonly border: string;
    readonly codeBackground: string;
    readonly foreground: string;
    readonly muted: string;
    readonly surface: string;
}

NativeThemeProviderPropsINTERFACE

Signature

export declare interface NativeThemeProviderProps {
    readonly children: ReactNode;
    readonly initialMode?: NativeThemeMode;
    readonly storage?: SelectionStorage;
    readonly storageKey?: string;
}

SelectionStorageINTERFACE

Signature

export declare interface SelectionStorage {
    readonly getItem: (key: string) => string | Promise<string | null> | null;
    readonly removeItem?: (key: string) => void | Promise<void>;
    readonly setItem: (key: string, value: string) => void | Promise<void>;
}

StoryHeaderPropsINTERFACE

Signature

export declare interface StoryHeaderProps {
    readonly subtitle?: string;
    readonly title: string;
}

StorySelectionINTERFACE

Signature

export declare interface StorySelection {
    readonly storyId?: string;
    readonly themeMode?: NativeThemeMode;
}

Types

Signature

export declare type NativeProviderComponent = ComponentType<NativeProviderComponentProps>;

NativeStoryRendererTYPE

Signature

export declare type NativeStoryRenderer = (props?: Readonly<Record<string, unknown>>) => ReactNode;

NativeThemeModeTYPE

Signature

export declare type NativeThemeMode = "light" | "dark" | "system";

Constants

defaultControlsVARIABLE

Signature

export declare const defaultControls: Required<Pick<ControlsDefaults, "expanded" | "sort" | "hideNoControlsWarning">> & Pick<ControlsDefaults, "exclude">;