/** * Performance utilities for DuskMoon custom elements * * Provides debounce, throttle, and scheduling helpers for * optimizing element responsiveness and reducing unnecessary work. * * @example * ```ts * import { debounce, throttle, scheduleTask } from '@duskmoon-dev/el-base'; * * class MySearch extends BaseElement { * #search = debounce((query: string) => { * this.emit('search', { query }); * }, 300); * * #handleScroll = throttle(() => { * this._updatePosition(); * }, 100); * } * ``` */ /** * Creates a debounced function that delays invocation until after * `delay` milliseconds have elapsed since the last call. * * Returns a function with a `.cancel()` method to abort pending execution. */ export declare function debounce) => void>(fn: T, delay: number): T & { cancel: () => void; }; /** * Creates a throttled function that invokes at most once per `interval` ms. * Uses leading-edge execution: fires immediately, then suppresses until interval passes. * * Returns a function with a `.cancel()` method to abort pending execution. */ export declare function throttle) => void>(fn: T, interval: number): T & { cancel: () => void; }; /** * Schedule a low-priority task using requestIdleCallback (with fallback). * Useful for deferring non-critical work like analytics, preloading, or cleanup. * * @returns A cancel function */ export declare function scheduleIdle(callback: () => void, options?: { timeout?: number; }): () => void; //# sourceMappingURL=performance.d.ts.map