UNPKG

386 BTypeScriptView Raw
1export interface Actions<T> {
2 setLeft: () => void;
3 setRight: () => void;
4 set: (value: T) => void;
5 toggle: () => void;
6}
7declare function useToggle<T = boolean>(): [boolean, Actions<T>];
8declare function useToggle<T>(defaultValue: T): [T, Actions<T>];
9declare function useToggle<T, U>(defaultValue: T, reverseValue: U): [T | U, Actions<T | U>];
10export default useToggle;