import { ComponentType, ReactNode } from 'react'; /** * Environment type */ export type Environment = 'development' | 'staging' | 'production' | 'test'; /** * Detected environment info */ export interface EnvironmentInfo { /** Environment type */ type: Environment; /** Base URL */ baseUrl: string; /** Is SSR */ isSSR: boolean; /** Is browser */ isBrowser: boolean; /** Debug mode enabled */ debugMode: boolean; /** API endpoint */ apiEndpoint: string | null; /** Version */ version: string | null; } /** * Feature flags for auto-setup */ export interface AutoSetupFeatures { /** Enable performance monitoring */ performance?: boolean; /** Enable error tracking */ errorTracking?: boolean; /** Enable analytics */ analytics?: boolean; /** Enable accessibility enhancements */ accessibility?: boolean; /** Enable real-time features */ realtime?: boolean; /** Enable offline support */ offline?: boolean; /** Enable theming */ theming?: boolean; /** Enable hydration system */ hydration?: boolean; } /** * Provider configuration */ export interface ProviderConfig { /** Provider component */ Provider: ComponentType<{ children: ReactNode; }>; /** Provider props */ props?: Record; /** Priority (higher = outer) */ priority?: number; /** Enabled condition */ enabled?: boolean | (() => boolean); } /** * Auto-setup configuration */ export interface AutoSetupConfig { /** Features to enable */ features?: AutoSetupFeatures; /** Custom providers */ providers?: ProviderConfig[]; /** Override environment detection */ environment?: Environment; /** Enable debug logging */ debug?: boolean; /** Analytics endpoint */ analyticsEndpoint?: string; /** Error reporting endpoint */ errorEndpoint?: string; /** Custom initialization */ onInit?: (env: EnvironmentInfo) => void | Promise; /** Custom cleanup */ onCleanup?: () => void; } /** * Auto-setup result */ export interface AutoSetupResult { /** Environment info */ environment: EnvironmentInfo; /** Active features */ features: AutoSetupFeatures; /** Composed provider */ Provider: ComponentType<{ children: ReactNode; }>; /** Cleanup function */ cleanup: () => void; /** Re-initialize */ reinit: () => Promise; } /** * Detect current environment */ export declare function detectEnvironment(): EnvironmentInfo; /** * Detect available features based on environment */ export declare function detectAvailableFeatures(env: EnvironmentInfo): AutoSetupFeatures; /** * Compose multiple providers into a single provider */ export declare function composeProviders(providers: ProviderConfig[]): ComponentType<{ children: ReactNode; }>; /** * Auto-setup manager */ export declare class AutoSetup { private static instance; private config; private readonly environment; private readonly features; private providers; private cleanupFns; private isInitialized; constructor(config?: AutoSetupConfig); /** * Get singleton instance */ static getInstance(config?: AutoSetupConfig): AutoSetup; /** * Reset singleton */ static reset(): void; /** * Initialize the auto-setup */ init(): Promise; /** * Cleanup all initialized features */ cleanup(): void; /** * Re-initialize */ reinit(): Promise; /** * Add a provider */ addProvider(config: ProviderConfig): void; /** * Get environment info */ getEnvironment(): EnvironmentInfo; /** * Get active features */ getFeatures(): AutoSetupFeatures; /** * Initialize features */ private initializeFeatures; /** * Get the result */ private getResult; /** * Debug logging */ private log; } /** * One-line initialization */ export declare function autoSetup(config?: AutoSetupConfig): Promise; /** * Get the auto-setup instance */ export declare function getAutoSetup(config?: AutoSetupConfig): AutoSetup; /** * Reset auto-setup */ export declare function resetAutoSetup(): void; /** * Hook for accessing auto-setup state */ export declare function useAutoSetup(): { environment: EnvironmentInfo; features: AutoSetupFeatures; isInitialized: boolean; isDevelopment: boolean; isProduction: boolean; isSSR: boolean; }; declare const _default: { AutoSetup: typeof AutoSetup; autoSetup: typeof autoSetup; getAutoSetup: typeof getAutoSetup; resetAutoSetup: typeof resetAutoSetup; detectEnvironment: typeof detectEnvironment; detectAvailableFeatures: typeof detectAvailableFeatures; composeProviders: typeof composeProviders; useAutoSetup: typeof useAutoSetup; }; export default _default;