import { default as React, ReactNode } from 'react';
import { ReactEnvironmentStatus, ReactEnvironmentConfig } from './index';
/**
* Context value for React environment status.
*/
export interface ReactEnvironmentContextValue {
/** Current environment status */
status: ReactEnvironmentStatus | null;
/** Whether the environment is healthy */
isHealthy: boolean;
/** Whether the check is still pending */
isPending: boolean;
/** Force a re-check of the environment */
recheck: () => void;
}
/**
* Hook to access React environment status.
*
* @returns React environment context value
*
* @example
* ```tsx
* function MyComponent() {
* const { isHealthy, status } = useReactEnvironment();
*
* if (!isHealthy) {
* return
React environment issues detected
;
* }
*
* return App is running
;
* }
* ```
*/
export declare function useReactEnvironment(): ReactEnvironmentContextValue;
/**
* Props for ReactEnvironmentProvider.
*/
export interface ReactEnvironmentProviderProps {
/** Child components */
children: ReactNode;
/**
* Configuration for environment checks.
*/
config?: ReactEnvironmentConfig;
/**
* Content to render when environment is unhealthy.
* If not provided, children will still render with a console warning.
*/
fallback?: ReactNode;
/**
* Whether to block rendering of children when environment is unhealthy.
* @default false
*/
blockOnUnhealthy?: boolean;
/**
* Callback when environment issues are detected.
*/
onEnvironmentError?: (status: ReactEnvironmentStatus) => void;
}
/**
* Provider component that validates the React environment.
*
* Wraps your application to detect React version conflicts and provide
* environment health information to child components.
*
* @example
* ```tsx
* // Basic usage
*
*
*
*
* // With fallback and blocking
* }
* onEnvironmentError={(status) => console.error('React issues:', status)}
* >
*
*
* ```
*/
export declare function ReactEnvironmentProvider({ children, config, fallback, blockOnUnhealthy, onEnvironmentError, }: ReactEnvironmentProviderProps): React.JSX.Element;
export declare namespace ReactEnvironmentProvider {
var displayName: string;
}
/**
* Higher-order component that checks React environment before rendering.
*
* @param Component - Component to wrap
* @param fallback - Optional fallback to render on environment error
* @returns Wrapped component
*
* @example
* ```tsx
* const SafeApp = withReactEnvironmentCheck(App);
* // or
* const SafeApp = withReactEnvironmentCheck(App, );
* ```
*/
export declare function withReactEnvironmentCheck(Component: React.ComponentType
, fallback?: ReactNode): React.FC
;