mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-27 20:10:58 +00:00
16 lines
579 B
TypeScript
16 lines
579 B
TypeScript
export interface UseIntervalOptions {
|
|
/** If set, the interval will start automatically when the component is mounted, `false` by default */
|
|
autoInvoke?: boolean;
|
|
}
|
|
export interface UseIntervalReturnValue {
|
|
/** Starts the interval */
|
|
start: () => void;
|
|
/** Stops the interval */
|
|
stop: () => void;
|
|
/** Toggles the interval */
|
|
toggle: () => void;
|
|
/** Indicates if the interval is active */
|
|
active: boolean;
|
|
}
|
|
export declare function useInterval(fn: () => void, interval: number, { autoInvoke }?: UseIntervalOptions): UseIntervalReturnValue;
|