import { ReactNode, FC, ErrorInfo } from 'react'; import { ModuleContextValue, ModuleLifecycleHooks, HydrationConfig, ModuleSecurityConfig, ModuleSlotDefinition } from './types'; /** * Module boundary props. */ export interface ModuleBoundaryProps { /** Unique module identifier */ id: string; /** Human-readable module name */ name: string; /** Module version */ version?: string; /** Child content */ children: ReactNode; /** Slot definitions */ slots?: ModuleSlotDefinition[]; /** Lifecycle hooks */ lifecycle?: ModuleLifecycleHooks; /** Hydration configuration */ hydration?: Partial; /** Security configuration */ security?: Partial; /** Whether module is isolated */ isolated?: boolean; /** Performance budget (ms) */ performanceBudget?: number; /** Enable strict mode */ strict?: boolean; /** Fallback UI for errors */ fallback?: ReactNode | ((error: Error, reset: () => void) => ReactNode); /** Loading UI for hydration */ loading?: ReactNode; /** Callback when module mounts */ onMount?: () => void; /** Callback when module unmounts */ onUnmount?: () => void; /** Callback on error */ onError?: (error: Error, errorInfo: ErrorInfo) => void; /** Callback on hydration complete */ onHydrated?: () => void; } /** * Module boundary component. * Defines module boundaries with state isolation, error handling, and lifecycle management. * * @example * ```tsx * ( * * )} * onMount={() => analytics.track('module_mounted', { name: 'dashboard' })} * > * * * ``` */ export declare const ModuleBoundary: FC; /** * Hook to access the module boundary context. * @throws Error if used outside a ModuleBoundary * @returns Module context value */ export declare function useModuleContext(): ModuleContextValue; /** * Hook to optionally access the module context. * @returns Module context value or null */ export declare function useOptionalModuleContext(): ModuleContextValue | null;