import { DependencyList } from 'react'; /** * Render priority levels */ export type RenderPriority = 'critical' | 'high' | 'normal' | 'low' | 'idle'; /** * Lazy feature status */ export type LazyFeatureStatus = 'idle' | 'loading' | 'loaded' | 'error'; /** * Progressive load phase */ export type ProgressiveLoadPhase = 'skeleton' | 'low-quality' | 'medium-quality' | 'full'; /** * Network quality */ export type NetworkQuality = 'fast' | 'moderate' | 'slow' | 'offline'; /** * Options for useOptimizedRender */ export interface UseOptimizedRenderOptions { /** Render priority */ priority?: RenderPriority; /** Initial value */ initialValue?: T; /** Defer initial render */ defer?: boolean; /** Use React 18 transitions */ useTransition?: boolean; /** Use deferred value */ useDeferredValue?: boolean; /** Debounce delay in ms */ debounceMs?: number; /** Skip render condition */ skipWhen?: (value: T) => boolean; } /** * Return type for useOptimizedRender */ export interface UseOptimizedRenderReturn { /** Current value */ value: T; /** Is computation pending */ isPending: boolean; /** Is initial render */ isInitial: boolean; /** Force immediate computation */ forceCompute: () => void; } /** * Options for useLazyFeature */ export interface UseLazyFeatureOptions { /** Auto load on mount */ autoLoad?: boolean; /** Preload on hover/focus */ preloadOnInteraction?: boolean; /** Fallback value */ fallback?: T; /** Retry on error */ retryOnError?: boolean; /** Max retries */ maxRetries?: number; /** Retry delay in ms */ retryDelay?: number; /** Minimum loading time for UX */ minLoadingTime?: number; /** Cache the loaded module */ cache?: boolean; } /** * Return type for useLazyFeature */ export interface UseLazyFeatureReturn { /** Loaded feature */ feature: T | null; /** Loading status */ status: LazyFeatureStatus; /** Load error */ error: Error | null; /** Load the feature */ load: () => Promise; /** Preload handler for events */ preloadHandlers: { onMouseEnter: () => void; onFocus: () => void; }; /** Is loaded */ isLoaded: boolean; /** Is loading */ isLoading: boolean; } /** * Options for useProgressiveLoad */ export interface UseProgressiveLoadOptions { /** Enable network awareness */ networkAware?: boolean; /** Phases to skip on slow networks */ skipPhasesOnSlow?: ProgressiveLoadPhase[]; /** Custom phase durations */ phaseDurations?: Partial>; /** Start with placeholder */ startWithPlaceholder?: boolean; /** Minimum phase duration */ minPhaseDuration?: number; } /** * Return type for useProgressiveLoad */ export interface UseProgressiveLoadReturn { /** Current phase */ phase: ProgressiveLoadPhase; /** Current data for phase */ data: T | null; /** Network quality */ networkQuality: NetworkQuality; /** Is loading */ isLoading: boolean; /** Is complete */ isComplete: boolean; /** Progress percentage */ progress: number; /** Advance to next phase */ advancePhase: () => void; /** Set data for current phase */ setPhaseData: (data: T) => void; /** Reset to initial state */ reset: () => void; } /** * Hook for optimized rendering with scheduling and React 18 features */ export declare function useOptimizedRender(computeFn: () => T, deps: DependencyList, options?: UseOptimizedRenderOptions): UseOptimizedRenderReturn; /** * Hook for lazy loading features with progressive enhancement */ export declare function useLazyFeature(featureId: string, loader: () => Promise, options?: UseLazyFeatureOptions): UseLazyFeatureReturn; /** * Hook for network-aware progressive content loading */ export declare function useProgressiveLoad(options?: UseProgressiveLoadOptions): UseProgressiveLoadReturn; /** * Clear feature cache */ export declare function clearFeatureCache(featureId?: string): void; /** * Preload a feature */ export declare function preloadFeature(featureId: string, loader: () => Promise): Promise; declare const _default: { useOptimizedRender: typeof useOptimizedRender; useLazyFeature: typeof useLazyFeature; useProgressiveLoad: typeof useProgressiveLoad; clearFeatureCache: typeof clearFeatureCache; preloadFeature: typeof preloadFeature; }; export default _default;