aura-glass
Version:
A comprehensive glassmorphism design system for React applications with 142+ production-ready components
96 lines • 3.21 kB
TypeScript
import { CSSProperties } from 'react';
export type PerformanceMode = 'high' | 'balanced' | 'low';
export type RenderingOptimization = 'gpu' | 'cpu' | 'auto';
export interface PerformanceOptions {
mode?: PerformanceMode;
rendering?: RenderingOptimization;
prefersReducedMotion?: boolean;
enableLazyLoading?: boolean;
enableVirtualization?: boolean;
}
/**
* Performance-optimized CSS properties based on device capabilities
*/
export declare const createPerformanceMixin: (options?: PerformanceOptions) => CSSProperties;
/**
* Optimized transition mixin with fallbacks
*/
export declare const createOptimizedTransition: (properties: string[], duration?: number, easing?: string, prefersReducedMotion?: boolean) => CSSProperties;
/**
* Memory-efficient animation mixin
*/
export declare const createMemoryEfficientAnimation: (name: string, duration?: number, iterationCount?: number | "infinite", options?: {
playState?: "running" | "paused";
fillMode?: "none" | "forwards" | "backwards" | "both";
prefersReducedMotion?: boolean;
}) => CSSProperties;
/**
* Lazy loading optimization styles
*/
export declare const createLazyLoadMixin: (isLoaded?: boolean, placeholder?: string) => CSSProperties;
/**
* Virtualization container styles
*/
export declare const createVirtualizationMixin: (itemHeight: number, containerHeight: number, overscan?: number) => CSSProperties;
/**
* Intersection Observer optimization
*/
export declare const createIntersectionObserverOptions: (threshold?: number[], rootMargin?: string) => IntersectionObserverInit;
/**
* Performance monitoring utilities
*/
export declare class PerformanceMonitor {
private static instance;
private metrics;
static getInstance(): PerformanceMonitor;
startMeasure(name: string): void;
endMeasure(name: string): number | null;
getAverageMetric(name: string): number | null;
clearMetrics(name?: string): void;
}
/**
* Device capability detection
*/
export declare const detectDeviceCapabilities: () => {
supportsGPU: boolean;
supportsBackdropFilter: boolean;
prefersReducedMotion: boolean;
connectionSpeed: string;
memoryInfo: null;
devicePixelRatio?: undefined;
} | {
supportsGPU: boolean;
supportsBackdropFilter: boolean;
prefersReducedMotion: boolean;
connectionSpeed: any;
memoryInfo: any;
devicePixelRatio: number;
};
/**
* Adaptive performance configuration
*/
export declare const getAdaptivePerformanceConfig: () => PerformanceOptions;
/**
* Debounced resize observer for performance
*/
export declare const createDebouncedResizeObserver: (callback: (entries: ResizeObserverEntry[]) => void, delay?: number) => ResizeObserver | null;
/**
* Memory leak prevention utilities
*/
export declare const createCleanupManager: () => {
add: (cleanup: () => void) => void;
cleanup: () => void;
};
/**
* Optimized scroll handling
*/
export declare const createOptimizedScrollHandler: (handler: (event: Event) => void, options?: {
throttle?: number;
passive?: boolean;
}) => {
handler: (event: Event) => void;
options: {
passive: boolean;
};
};
//# sourceMappingURL=performanceMixins.d.ts.map