@jay-js/ui
Version:
A library of UI components for Jay JS with Tailwind CSS and daisyUI.
38 lines (37 loc) • 1.09 kB
TypeScript
/**
* Configuration options for the useDrawer hook
*/ type TUseDrawer = {
/**
* ID of the drawer element to control
*/ drawerId?: string;
/**
* Optional ID of the drawer element to control
* @deprecated Use `drawerId` instead
*/ for?: string;
/**
* Callback function triggered when drawer is closed
*/ onClose?: (drawerContent: HTMLElement, drawer: HTMLElement) => void;
/**
* Callback function triggered when drawer is opened
*/ onOpen?: (drawerContent: HTMLElement, drawer: HTMLElement) => void;
};
/**
* Interface for drawer control methods
*/ export type TDrawerControls = {
/**
* Opens the drawer
*/ open: () => void;
/**
* Closes the drawer
*/ close: () => void;
/**
* Toggles the drawer between open and closed states
*/ toggle: () => void;
};
/**
* A hook to control drawer component functionality
*
* @param props - Configuration options for the drawer
* @returns Object with methods to open, close, or toggle the drawer
*/ export declare function useDrawer({ ...props }: TUseDrawer): TDrawerControls;
export { };