UNPKG

@storybook/react-native

Version:

A better way to develop React Native Components for your app

41 lines (37 loc) 1.3 kB
import { WebSocketServer } from 'ws'; import { StoryIndex } from 'storybook/internal/types'; /** * Options for creating a channel server. */ interface ChannelServerOptions { /** * The port the server will listen on. */ port?: number; /** * The host the server will bind to. */ host?: string; /** * The path to the Storybook config folder. */ configPath: string; } /** * Creates a channel server for syncing storybook instances and sending events. * The server provides both WebSocket and REST endpoints: * - WebSocket: broadcasts all received messages to all connected clients * - POST /send-event: sends an event to all WebSocket clients * - GET /index.json: returns the story index built from story files * * @param options - Configuration options for the channel server. * @param options.port - The port to listen on. * @param options.host - The host to bind to. * @param options.configPath - The path to the Storybook config folder. * @returns The created WebSocketServer instance. */ declare function createChannelServer({ port, host, configPath, }: ChannelServerOptions): WebSocketServer; declare function buildIndex({ configPath }: { configPath: string; }): Promise<StoryIndex>; export { buildIndex, createChannelServer };