/** * Deferred trigger * * Debounce a changing boolean value, with different delays depending on the * direction of the trigger (determined by the base value). * **Note**: the trailing delay takes into account the time already spent in * the "on" state of the trigger. * * Mainly useful for loading states where one wants to guarantee a period * without spinner (delay triggering the loading state), but then when it's * loading, make sure the spinner is shown for a minimum amount of time * (trailing delay of the trigger). */ interface IDeferredTriggerOptions { /** * Optional delay of the trigger in milliseconds. * Use 0 to process immediately within the effect hook. * * @default 100 */ readonly delay?: number; /** * Optional minimum duration in milliseconds (used when trigger returns to * base value, to make sure the triggered states doesn't flash). * * @default 400 */ readonly minDuration?: number; /** * Optional base value of the trigger. * * @default false */ readonly base?: boolean; } export declare const useDeferredTrigger: (flag: boolean, { delay, minDuration, base }?: IDeferredTriggerOptions) => boolean; export {};