import * as _storybook_core_types from '@storybook/core/types'; import { StoryIndex, PreparedStory, NormalizedStoriesSpecifier, StorybookConfig as StorybookConfig$1 } from '@storybook/core/types'; import { ReactRenderer } from '@storybook/react'; import * as react_jsx_runtime from 'react/jsx-runtime'; import { Channel } from '@storybook/core/channels'; import { StoryContext } from '@storybook/csf'; import { PreviewWithSelection } from '@storybook/core/preview-api'; import { Theme } from '@storybook/react-native-theming'; export { Theme, darkTheme, theme } from '@storybook/react-native-theming'; interface Storage { getItem: (key: string) => Promise; setItem: (key: string, value: string) => Promise; } type StoryKind = string; type StoryName = string; type InitialSelection = `${StoryKind}--${StoryName}` | { /** * Kind is the default export name or the storiesOf("name") name */ kind: StoryKind; /** * Name is the named export or the .add("name") name */ name: StoryName; }; type DeepPartial = T extends object ? { [P in keyof T]?: DeepPartial; } : T; type Params = { onDeviceUI?: boolean; enableWebsockets?: boolean; query?: string; host?: string; port?: number; secured?: boolean; initialSelection?: InitialSelection; shouldPersistSelection?: boolean; theme: DeepPartial; storage?: Storage; }; declare class View { _storyIndex: StoryIndex; _setStory: (story: StoryContext) => void; _forceRerender: () => void; _ready: boolean; _preview: PreviewWithSelection; _asyncStorageStoryId: string; _webUrl: string; _storage: Storage; _channel: Channel; _idToPrepared: Record>; constructor(preview: PreviewWithSelection, channel: Channel); _getInitialStory: ({ initialSelection, shouldPersistSelection, }?: Partial) => Promise<{ storySpecifier: string; viewMode: string; }>; _getServerChannel: (params?: Partial) => Channel; createPreparedStoryMapping: () => Promise; getStorybookUI: (params?: Partial) => () => react_jsx_runtime.JSX.Element; } /** Configuration options that are needed at startup, only serialisable values are possible */ interface ReactNativeOptions { /** * Note that this is for future and play functions are not yet fully supported on native. */ playFn?: boolean; } declare function prepareStories({ storyEntries, options, }: { storyEntries: Array; options?: ReactNativeOptions; }): { index: StoryIndex; importMap: Record; }; declare const getProjectAnnotations: (view: View, annotations: any[]) => () => Promise<_storybook_core_types.NormalizedProjectAnnotations>; declare function start({ annotations, storyEntries, options, }: { storyEntries: Array; annotations: any[]; options?: ReactNativeOptions; }): View; declare function updateView(viewInstance: View, annotations: any[], normalizedStories: Array, options?: ReactNativeOptions): void; interface StorybookConfig { stories: StorybookConfig$1['stories']; addons: string[]; reactNative?: ReactNativeOptions; } export { StorybookConfig, getProjectAnnotations, prepareStories, start, updateView };