import { ReactNode, FC, ComponentType } from 'react'; import { CoordinationContextValue, KnownEventType, EventPayload, EventHandler, EventSubscriptionOptions, ServiceContract } from './types'; export type { LibraryId, EventId, ServiceId, StateSliceId, SubscriptionId, PhaseId, CoordinationEvent, EventHandler, EventSubscription, EventSubscriptionOptions, EventBusConfig, EventBusStats, CoordinationEventBus, KnownEventType, KnownEvents, EventPayload, AuthEvents, NetworkEvents, StateEvents, SystemEvents, ThemeEvents, FeatureFlagEvents, HydrationEvents, StreamingEvents, RealtimeEvents, LifecycleEvents, ServiceScope, ServiceLifecycle, ServiceContract, ServiceRegistration, ServiceRegistrationOptions, ServiceFactory, DependencyContainer, LibraryState, LibraryRegistration, LifecyclePhase, LifecycleManager, LifecycleManagerConfig, StateChange, StateSubscriber, StateSliceRegistration, StateSyncRule, StateCoordinator, StateCoordinatorConfig, ProviderDefinition, ProviderOrchestratorConfig, ContextBridgeDefinition, CoordinationContextValue, CoordinationProviderProps, DeepPartial, PartialBy, Disposable, Result, } from './types'; export { EventPriority, createLibraryId, createEventId, createServiceId, createStateSliceId, createSubscriptionId, createPhaseId, isLibraryId, isEventId, isCoordinationEvent, isKnownEventType, ok, err, DEFAULT_EVENT_BUS_CONFIG, DEFAULT_LIFECYCLE_CONFIG, DEFAULT_LIFECYCLE_PHASES, DEFAULT_STATE_COORDINATOR_CONFIG, } from './types'; export { getCoordinationEventBus, setCoordinationEventBus, resetCoordinationEventBus, publishEvent, subscribeToEvent, } from './event-bus'; export { DependencyInjectorImpl, createServiceContract, getGlobalContainer, setGlobalContainer, resetGlobalContainer, registerService, resolveService, tryResolveService, LoggerContract, ConfigContract, TelemetryContract, type ILogger, type IConfigService, type ITelemetryService, } from './dependency-injector'; export { LifecycleManagerImpl, getLifecycleManager, setLifecycleManager, resetLifecycleManager, registerLibrary, initializeLibraries, shutdownLibraries, LIBRARY_IDS, PHASE_IDS, } from './lifecycle-manager'; export { StateCoordinatorImpl, getStateCoordinator, setStateCoordinator, resetStateCoordinator, registerStateSlice, SLICE_IDS, } from './state-coordinator'; export { FeatureBridgeImpl, createFeatureId, getFeatureBridge, setFeatureBridge, resetFeatureBridge, registerFeature, invokeCapability, invokeAnyCapability, type FeatureId, type FeatureCapability, type FeatureRegistration, type InvocationOptions, type InvocationResult, type FeatureBridgeConfig, } from './feature-bridge'; export { useComposedHooks, useSelectiveHooks, useConditionalHook, useMemoizedComposition, useParallelHooks, useHookSequence, defineHook, defineAsyncHook, type HookState, type ComposedResult, type HookDef, type AsyncHookResult, type CompositionOptions, } from './hook-composer'; export { ProviderOrchestratorImpl, OrchestratedProviders, getProviderOrchestrator, setProviderOrchestrator, resetProviderOrchestrator, registerProvider, getGlobalProviderTree, DefaultLoadingFallback, DefaultErrorFallback, type OrchestratedProvidersProps, } from './provider-orchestrator'; export { ContextBridgeImpl, ContextBridgeProvider, useBridgeManager, useBridgedContext, BridgeSource, BridgeConsumer, createComposedContext, useMultiContextSelector, withBridgedContext, getContextBridgeManager, setContextBridgeManager, resetContextBridgeManager, type BridgeOptions, type ContextBridgeProviderProps, type BridgeSourceProps, type BridgeConsumerProps, type WithBridgedContextProps, } from './context-bridge'; /** * Coordination context for React. */ declare const CoordinationContext: import('react').Context; /** * Props for CoordinationProvider component. */ export interface CoordinationProviderComponentProps { /** Child components */ children: ReactNode; /** Debug mode */ debug?: boolean; /** Callback when coordination is ready */ onReady?: () => void; /** Error handler */ onError?: (error: Error) => void; /** Whether to auto-initialize libraries */ autoInitialize?: boolean; } /** * Provider component for the coordination system. * * @example * ```tsx * function App() { * return ( * console.log('Coordination ready')} * autoInitialize * > * * * ); * } * ``` */ export declare const CoordinationProvider: FC; /** * Hook to access the coordination system. * * @returns Coordination context value * @throws Error if used outside CoordinationProvider * * @example * ```tsx * function MyComponent() { * const { eventBus, lifecycle, isInitialized } = useCoordination(); * * const handleClick = () => { * eventBus.publish('theme:changed', { * mode: 'dark', * resolvedMode: 'dark', * source: 'user', * }); * }; * * return ( * * ); * } * ``` */ export declare function useCoordination(): CoordinationContextValue; /** * Hook to optionally access the coordination system. * Returns null if outside CoordinationProvider. */ export declare function useOptionalCoordination(): CoordinationContextValue | null; /** * Hook to subscribe to coordination events. * * @template T - Event type * @param type - Event type to subscribe to * @param handler - Event handler * @param options - Subscription options * * @example * ```tsx * function AuthListener() { * useCoordinationEvent('auth:login', (event) => { * console.log('User logged in:', event.payload.userId); * }); * * useCoordinationEvent('auth:logout', (event) => { * console.log('User logged out:', event.payload.reason); * }); * * return null; * } * ``` */ export declare function useCoordinationEvent(type: T, handler: EventHandler>, options?: EventSubscriptionOptions): void; /** * Hook to publish coordination events. * * @returns Publish function * * @example * ```tsx * function ThemeToggle() { * const publish = useCoordinationPublish(); * * const toggleTheme = () => { * publish('theme:changed', { * mode: 'dark', * resolvedMode: 'dark', * source: 'user', * }); * }; * * return ; * } * ``` */ export declare function useCoordinationPublish(): (type: T, payload: EventPayload) => string; /** * Hook to check if all libraries are initialized. * * @returns Whether all libraries are initialized */ export declare function useIsCoordinationReady(): boolean; /** * Hook to get library initialization state. * * @param libraryId - Library ID * @returns Library state or undefined */ export declare function useLibraryState(libraryId: string): string | undefined; /** * Hook to resolve a service from the DI container. * * @template T - Service type * @param contract - Service contract * @returns Resolved service */ export declare function useService(contract: ServiceContract): T; /** * Hook to try resolving a service. * * @template T - Service type * @param contract - Service contract * @returns Service or undefined */ export declare function useTryService(contract: ServiceContract): T | undefined; /** * Props injected by withCoordination HOC. */ export interface WithCoordinationProps { coordination: CoordinationContextValue; } /** * Higher-order component to inject coordination context. * * @template P - Component props * @param Component - Component to wrap * @returns Wrapped component * * @example * ```tsx * interface MyComponentProps extends WithCoordinationProps { * title: string; * } * * class MyComponent extends React.Component { * handleClick = () => { * this.props.coordination.eventBus.publish('theme:changed', { * mode: 'dark', * resolvedMode: 'dark', * source: 'user', * }); * }; * * render() { * return ( * * ); * } * } * * export default withCoordination(MyComponent); * ``` */ export declare function withCoordination

(Component: ComponentType

): FC>; /** * Initializes the coordination system outside of React. * * @param options - Initialization options * @returns Cleanup function * * @example * ```typescript * // In main.ts * import { initCoordination } from '@/lib/coordination'; * * const cleanup = await initCoordination({ * debug: import.meta.env.DEV, * }); * * // On app shutdown * cleanup(); * ``` */ export declare function initCoordination(options?: { debug?: boolean; }): Promise<() => Promise>; /** * Gets the coordination system version. */ export declare function getCoordinationVersion(): string; export { CoordinationContext };