import { MouseEventHandler, RefObject } from 'react'; export interface SwitchProps { /** Is switch on? By default false */ isOn?: boolean; /** Turn on if the mouse enter in the trigger */ turnOnOnTriggerHover?: boolean; /** Turn off if the mouse leave the trigger */ turnOffOnTriggerLeave?: boolean; /** disable the trigger click */ disableTriggerClick?: boolean; /** Disable target on target Mouse Leave */ turnOffOnTargetLeave?: boolean; /** Disable target on click outside */ turnOffOnClickOutside?: boolean; } export interface SwitchReturn { /** trigger attrs */ trigger: TriggerProps; /** target attrs */ target: TargetProps; /** toggle switch on/off */ toggle: Function; /** turn off switch */ turnOn: Function; /** turn off the switch */ turnOff: Function; /** is the switch on */ isOn: boolean; } export interface TriggerProps { ref?: RefObject; onClick?: MouseEventHandler; onMouseEnter?: MouseEventHandler; onMouseLeave?: MouseEventHandler; } export interface TargetProps { ref?: RefObject; onMouseLeave?: MouseEventHandler; } /** * useSwitch() - simulate a switch on/off logic. */ declare const useSwitch: (props?: SwitchProps) => SwitchReturn; export default useSwitch;