import { ReactNode, FC, ComponentType, ElementType, default as React } from 'react'; /** * Module slot props. */ export interface ModuleSlotProps { /** Slot name */ name: string; /** Default content if slot is empty */ children?: ReactNode; /** Fallback during lazy loading */ fallback?: ReactNode; /** Whether slot is required */ required?: boolean; /** Placeholder when slot is empty and not required */ placeholder?: ReactNode; /** Wrapper element */ as?: ElementType; /** Additional class name */ className?: string; /** Additional styles */ style?: React.CSSProperties; /** Data attributes */ data?: Record; } /** * Dynamic module slot props for loading external modules. */ export interface DynamicModuleSlotProps { /** Module ID to load */ moduleId: string; /** Props to pass to loaded module */ moduleProps?: Record; /** Fallback during loading */ fallback?: ReactNode; /** Error fallback */ errorFallback?: ReactNode | ((error: Error) => ReactNode); /** Callback when module loads */ onLoad?: () => void; /** Callback on load error */ onError?: (error: Error) => void; /** Wrapper element */ as?: ElementType; /** Additional class name */ className?: string; /** Additional styles */ style?: React.CSSProperties; } /** * Module outlet props for named outlets. */ export interface ModuleOutletProps { /** Outlet name */ name: string; /** Default content */ children?: ReactNode; /** Wrapper element */ as?: ElementType; /** Additional class name */ className?: string; /** Additional styles */ style?: React.CSSProperties; } /** * Named slot within a module boundary for content projection. * Allows parent modules to inject content into child modules. * * @example * ```tsx * // In child module * *
* * Default Header * * * {children} * * } /> *
*
* * // In parent module * const context = useModuleContext(); * context.setSlot('header', ); * ``` */ export declare const ModuleSlot: FC; /** * Dynamically loads and renders a module by ID. * Integrates with the module loader for code splitting. * * @example * ```tsx * } * errorFallback={(error) => } * onLoad={() => analytics.track('widget_loaded')} * /> * ``` */ export declare const DynamicModuleSlot: FC; /** * Props for LazyModuleSlot. */ export interface LazyModuleSlotProps { /** Lazy import function */ loader: () => Promise<{ default: ComponentType; }>; /** Props to pass to loaded component */ componentProps?: Record; /** Fallback during loading */ fallback?: ReactNode; /** Wrapper element */ as?: ElementType; /** Additional class name */ className?: string; /** Additional styles */ style?: React.CSSProperties; } /** * Slot that lazily loads a component using React.lazy(). * * @example * ```tsx * import('./HeavyComponent')} * fallback={} * componentProps={{ theme: 'dark' }} * /> * ``` */ export declare const LazyModuleSlot: FC; /** * Named outlet for rendering module content. * Similar to router outlets but for module composition. * * @example * ```tsx * // In layout *
* *
* * * *
*
* ``` */ export declare const ModuleOutlet: FC; /** * Props for ConditionalModuleSlot. */ export interface ConditionalModuleSlotProps { /** Condition to check */ when: boolean; /** Module ID to load when condition is true */ moduleId: string; /** Props to pass to module */ moduleProps?: Record; /** Content to show when condition is false */ otherwise?: ReactNode; /** Fallback during loading */ fallback?: ReactNode; } /** * Conditionally loads and renders a module. * * @example * ```tsx * } * /> * ``` */ export declare const ConditionalModuleSlot: FC; /** * Props for ModulePortalSlot. */ export interface ModulePortalSlotProps { /** Portal target element ID */ target: string; /** Content to render in portal */ children: ReactNode; /** * Whether to render children inline as fallback when portal cannot be created. * This prevents blank pages when React environment issues occur. * @default true */ fallbackToInline?: boolean; /** * Custom fallback content to render when portal fails. */ fallback?: ReactNode; } /** * Renders content into a portal target outside the module boundary. * Includes fallback rendering to prevent blank pages when React * environment issues occur (e.g., multiple React instances). * * @example * ```tsx * // In module * * * * * * * // In document * * ``` */ export declare const ModulePortalSlot: FC;