import { MetroConfig } from 'metro-config';
import { W as WebsocketsOptions } from '../index-6iAzVvXp.js';

/**
 * Options for configuring Storybook with React Native.
 */
interface WithStorybookOptions {
    /**
     * The path to the Storybook config folder. Defaults to './.rnstorybook'.
     */
    configPath?: string;
    /**
     * WebSocket configuration for syncing storybook instances or sending events to storybook.
     */
    websockets?: WebsocketsOptions | 'auto';
    /**
     * Whether to use JavaScript files for Storybook configuration instead of TypeScript. Defaults to false.
     */
    useJs?: boolean;
    /**
     * if false, we will attempt to remove storybook from the js bundle.
     */
    enabled?: boolean;
    /**
     * Whether to include doc tools in the storybook.requires file. Defaults to true.
     */
    docTools?: boolean;
    /**
     * Whether to use lite mode for the storybook. Defaults to false.
     * This will mock out the default storybook ui so you don't need to install all its dependencies like reanimated etc.
     */
    liteMode?: boolean;
    /**
     * Whether to enable MCP (Model Context Protocol) server support. Defaults to false.
     * When enabled, adds an /mcp endpoint to the channel server,
     * allowing AI agents (Claude Code, Cursor, etc.) to query component documentation.
     * If websockets are disabled, MCP documentation tools still work but story selection is unavailable.
     */
    experimental_mcp?: boolean;
}
/**
 * Configures Metro bundler to work with Storybook in React Native.
 * This function wraps a Metro configuration to enable Storybook usage.
 * This is intended to replace the withStorybook function in the future.
 *
 * @param config - The Metro bundler configuration to be modified. This should be a valid Metro config object
 *                 that includes resolver, transformer, and other Metro-specific options.
 * @param options - Options to customize the Storybook configuration.
 * @param options.configPath - The path to the Storybook config folder. Defaults to './.rnstorybook'.
 *                            This is where your main.js/ts and preview.js/ts files are located.
 * @param options.websockets - WebSocket configuration for syncing storybook instances or sending events.
 *                            When provided, creates a WebSocket server for real-time communication.
 * @param options.websockets.port - The port WebSocket server will listen on. Defaults to 7007.
 * @param options.websockets.host - The host WebSocket server will bind to. Defaults to 'localhost'.
 * @param options.websockets.secured - Whether to use WSS/HTTPS for the channel server.
 * @param options.websockets.key - TLS private key used when `secured` is true.
 * @param options.websockets.cert - TLS certificate used when `secured` is true.
 * @param options.useJs - Whether to use JavaScript files for Storybook configuration instead of TypeScript.
 *                       When true, generates storybook.requires.js instead of storybook.requires.ts.
 *                       Defaults to false.
 * @param options.enabled - If false, attempts to remove storybook modules from the JavaScript
 *                         bundle to reduce bundle size. Defaults to true.
 * @param options.docTools - Whether to include doc tools in the storybook.requires file.
 *                          Doc tools provide additional documentation features. Defaults to true.
 * @param options.liteMode - Whether to use lite mode for the storybook. In lite mode, the default
 *                          storybook UI is mocked out so you don't need to install all its dependencies
 *                          like reanimated etc. This is useful for reducing bundle size and dependencies.
 *                          Defaults to false.
 * @returns The modified Metro configuration with Storybook support enabled.
 *
 * @example
 * ```javascript
 * const { getDefaultConfig } = require('expo/metro-config');
 * const {withStorybook} = require('@storybook/react-native/metro/withStorybook');
 * const path = require('path');
 *
 * const projectRoot = __dirname;
 * const config = getDefaultConfig(projectRoot);
 *
 * module.exports = withStorybook(config, {
 *   configPath: path.resolve(projectRoot, './.rnstorybook'),
 *   websockets: { port: 7007, host: 'localhost' },
 *   useJs: false,
 *   docTools: true,
 *   liteMode: false,
 * });
 * ```
 *
 * @example
 * ```javascript
 * // Minimal configuration
 * const { getDefaultConfig } = require('expo/metro-config');
 * const {withStorybook} = require('@storybook/react-native/metro/withStorybook');
 *
 * const config = getDefaultConfig(__dirname);
 * module.exports = withStorybook(config);
 * ```
 *
 * @example
 * ```javascript
 * // Disable Storybook in production
 * const { getDefaultConfig } = require('expo/metro-config');
 * const {withStorybook} = require('@storybook/react-native/metro/withStorybook');
 *
 * const config = getDefaultConfig(__dirname);
 * module.exports = withStorybook(config, {
 *   enabled: process.env.EXPO_PUBLIC_STORYBOOK_ENABLED === "true",
 * });
 * ```
 */
declare function withStorybook(config: MetroConfig, options?: WithStorybookOptions): MetroConfig;

export { withStorybook };
