/**
 * Wrap a function so it is only invoked after `delay` ms of inactivity.
 *
 * @example
 * ```ts
 * const save = useDebounce(() => api.save(form), 300)
 * save()          // debounced
 * save.cancel()   // abort pending
 * save.flush()    // fire immediately
 * ```
 */
export declare function useDebounce<T extends (...args: any[]) => any>(fn: T, delay?: number): DebouncedFn<T>;
/**
 * Create a debounced read-only value that updates after `delay` ms of inactivity.
 *
 * @example
 * ```ts
 * const debouncedSearch = useDebouncedValue(() => searchInput.value, 300)
 * debouncedSearch.subscribe(val => console.log('Searching:', val))
 * ```
 */
export declare function useDebouncedValue<T>(getter: () => T, delay?: number): DebouncedValueRef<T>;
/**
 * Wrap a function so it fires at most once every `limit` ms.
 *
 * @example
 * ```ts
 * const onScroll = useThrottle(() => recalcLayout(), 100)
 * window.addEventListener('scroll', onScroll)
 * ```
 */
export declare function useThrottle<T extends (...args: any[]) => any>(fn: T, limit?: number): ThrottledFn<T>;
/**
 * Reactive interval that auto-cleans up.
 *
 * @example
 * ```ts
 * const { counter, pause, resume, reset } = useInterval(1000)
 * // counter increments every second
 * ```
 */
export declare function useInterval(interval?: number, options?: IntervalOptions): IntervalRef;
/**
 * One-shot timeout with start/stop control and auto-cleanup.
 *
 * @example
 * ```ts
 * const { isPending, start, stop } = useTimeout(() => showToast(), 3000)
 * start()   // begin countdown
 * stop()    // cancel
 * ```
 */
export declare function useTimeout(callback: () => void, delay?: number): TimeoutRef;
/**
 * useDebounce, useDebouncedValue, useThrottle, useInterval, useTimeout
 *
 * Timer composables with auto-cleanup via onDestroy.
 * SSR-safe — all functions return no-op stubs when `window` is unavailable.
 */
// =============================================================================
// Types
// =============================================================================
export declare interface DebouncedFn<T extends (...args: any[]) => any> {
  (...args: Parameters<T>): void
  cancel: () => void
  flush: () => void
  pending: () => boolean
}
export declare interface ThrottledFn<T extends (...args: any[]) => any> {
  (...args: Parameters<T>): void
  cancel: () => void
}
export declare interface DebouncedValueRef<T> {
  readonly value: T
  subscribe: (fn: (value: T) => void) => () => void
}
export declare interface IntervalOptions {
  immediate?: boolean
}
export declare interface IntervalRef {
  readonly counter: number
  pause: () => void
  resume: () => void
  reset: () => void
  subscribe: (fn: (counter: number) => void) => () => void
}
export declare interface TimeoutRef {
  readonly isPending: boolean
  start: () => void
  stop: () => void
  subscribe: (fn: (isPending: boolean) => void) => () => void
}
