UNPKG

@nex-ui/hooks

Version:

A collection of React Hooks for Nex UI components.

22 lines (20 loc) 608 B
interface UseClipboardProps { /** * The time in milliseconds to wait before resetting the clipboard. * @default 2000 */ timeout?: number; } /** * Copies the given text to the clipboard. * @param {number} timeout - timeout in ms, default 2000 * @returns {copy, copied, error, reset} - copy function, copied state, error state, reset function */ declare function useClipboard({ timeout }?: UseClipboardProps): { copy: (valueToCopy: any) => void; reset: () => void; error: Error | null; copied: boolean; }; export { useClipboard }; export type { UseClipboardProps };