UNPKG

@rbxts/react-hooks

Version:

Generated by [Rojo](https://github.com/rojo-rbx/rojo) 7.4.0.

21 lines (20 loc) 731 B
interface ToggleState { readonly disable: () => void; readonly enable: () => void; readonly on: boolean; readonly toggle: () => void; readonly toggled: boolean; } /** * Creates a toggle state hook with initial state. * * @param initial - The initial state of the toggle. * @return An object containing the following properties: * - disable: A function to disable the toggle. * - enable: A function to enable the toggle. * - on: A boolean indicating whether the toggle is enabled. * - toggle: A function to toggle the toggle. * - toggled: A boolean indicating the current state of the toggle. Same as `on`. */ export declare function useToggleState(initial: boolean): ToggleState; export {};