UNPKG

aura-glass

Version:

A comprehensive glassmorphism design system for React applications with 142+ production-ready components

117 lines 4 kB
import React from 'react'; export interface GlassPerformanceOptions { /** Enable performance monitoring */ enableMonitoring?: boolean; /** Target FPS for animations */ targetFPS?: number; /** Memory limit in MB */ memoryLimit?: number; /** Enable automatic quality adjustment */ autoAdjustQuality?: boolean; /** Quality adjustment threshold */ qualityThreshold?: number; /** Performance metrics callback */ onPerformanceMetrics?: (metrics: any) => void; /** Quality change callback */ onQualityChange?: (quality: number) => void; } export interface GlassPerformanceMetrics { fps: number; frameTime: number; memoryUsage: number; renderTime: number; quality: number; isThrottled: boolean; recommendations: string[]; } export declare function useGlassPerformance(options?: GlassPerformanceOptions): { metrics: GlassPerformanceMetrics; quality: number; optimizeForLowPerformance: () => { reduceParticles: boolean; disableShadows: boolean; lowerResolution: boolean; reduceAnimationComplexity: boolean; }; getOptimalSettings: () => { particleCount: number; shadowQuality: string; textureSize: number; animationEnabled: boolean; blurEnabled: boolean; }; isLowPerformance: boolean; isHighPerformance: boolean; }; export declare function useDebouncedPerformance(callback: (metrics: GlassPerformanceMetrics) => void, delay?: number, options?: GlassPerformanceOptions): { debouncedMetrics: GlassPerformanceMetrics | null; metrics: GlassPerformanceMetrics; quality: number; optimizeForLowPerformance: () => { reduceParticles: boolean; disableShadows: boolean; lowerResolution: boolean; reduceAnimationComplexity: boolean; }; getOptimalSettings: () => { particleCount: number; shadowQuality: string; textureSize: number; animationEnabled: boolean; blurEnabled: boolean; }; isLowPerformance: boolean; isHighPerformance: boolean; }; export declare function useConditionalRendering(performance: ReturnType<typeof useGlassPerformance>, thresholds?: { low: number; medium: number; high: number; }): { performanceLevel: string; shouldRender: (minPerformance: keyof typeof thresholds) => boolean; getComponentVariant: (variants: Record<string, any>) => any; }; export declare function useLazyPerformance(component: React.ComponentType<any>, fallback?: React.ComponentType<any>, options?: GlassPerformanceOptions & { minFPS?: number; loadDelay?: number; }): { Component: React.ComponentType<any> | (() => null); isLoaded: boolean; performance: { metrics: GlassPerformanceMetrics; quality: number; optimizeForLowPerformance: () => { reduceParticles: boolean; disableShadows: boolean; lowerResolution: boolean; reduceAnimationComplexity: boolean; }; getOptimalSettings: () => { particleCount: number; shadowQuality: string; textureSize: number; animationEnabled: boolean; blurEnabled: boolean; }; isLowPerformance: boolean; isHighPerformance: boolean; }; }; export declare function useProgressiveEnhancement(performance: ReturnType<typeof useGlassPerformance>, features: Array<{ name: string; component: React.ComponentType<any>; minFPS: number; fallback?: React.ComponentType<any>; }>): { enabledFeatures: { name: string; component: React.ComponentType<any>; minFPS: number; fallback?: React.ComponentType<any>; }[]; getFeatureComponent: (featureName: string) => React.ComponentType<any> | (() => null); isFeatureEnabled: (featureName: string) => boolean; performanceLevel: string; }; //# sourceMappingURL=useGlassPerformance.d.ts.map