UNPKG

rynex

Version:

A minimalist TypeScript framework for building reactive web applications with no virtual DOM

36 lines 1.19 kB
/** * Rynex Performance Utilities * Performance optimization helpers */ /** * Debounce function execution * Delays execution until after wait time has elapsed since last call */ export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void; /** * Throttle function execution * Ensures function is called at most once per specified time period */ export declare function throttle<T extends (...args: any[]) => any>(func: T, limit: number): (...args: Parameters<T>) => void; /** * Preload component or resource * Loads resource in advance for better performance */ export declare function preload<T>(loader: () => Promise<T>): Promise<T>; /** * Get preloaded resource * Retrieves previously preloaded resource */ export declare function getPreloaded<T>(loader: () => Promise<T>): Promise<T> | null; /** * Request idle callback wrapper * Executes callback during browser idle time */ export declare function onIdle(callback: () => void, options?: { timeout?: number; }): number; /** * Cancel idle callback */ export declare function cancelIdle(id: number): void; //# sourceMappingURL=performance.d.ts.map