feats
Version:
A comprehensive TypeScript utility library featuring fluent text building, type-safe switching, duration utilities, React hooks, and extended array/object prototypes for modern JavaScript development.
22 lines (21 loc) • 673 B
TypeScript
/**
* Represents an interval controller with manual control.
* - `set` starts a new interval (clearing any existing one).
* - `clear` stops the current interval.
*/
export interface Interval {
/**
* Starts a new interval with the given handler and delay (in ms).
* Automatically clears any previously set interval.
*/
set: (handler: VoidFunction, interval: number) => void;
/**
* Clears the currently active interval, if any.
*/
clear: VoidFunction;
}
/**
* React hook for managing an interval with manual control.
* Automatically clears the interval on component unmount.
*/
export declare function useInterval(): Interval;