daily-toolset
Version:
A lightweight, versatile collection of TypeScript utility functions for everyday development needs. Simplify and streamline your Node.js, React, and Next.js projects with a powerful suite of well-organized helpers for strings, arrays, dates, objects, and
17 lines (16 loc) • 548 B
TypeScript
type Props = {
onOpen?: () => void;
onClose?: () => void;
};
/**
* A custom React hook that manages the open/closed state of a component.
*
* @param defaultOpen - Initial open state (default is false).
* @returns A tuple containing the current open state and an object with methods to open, close, and toggle the state.
*/
export declare function useDisclosure(initialState?: boolean, options?: Props): readonly [boolean, {
readonly open: () => void;
readonly close: () => void;
readonly toggle: () => void;
}];
export {};