import type { Gettable } from "../utils/basic.cjs"; export interface UseClipboardOptions { /** * Enabled reading for clipboard, need to request permission * * @defaultValue false */ read?: boolean; /** * Copy source, which is copied by default when you call the copy method directly without passing any parameters */ source?: Source; /** * Milliseconds to reset state of `copied` ref * * @defaultValue 1_500 */ copiedDuration?: number; /** * Callback when the text is copied */ onCopy?: (text: string) => void; /** * Callback when the `copied` state is reset */ onCopiedReset?: () => void; } export interface UseClipboardReturns { /** * Whether the Clipboard API is supported */ isSupported: boolean; /** * The text in the clipboard */ text: string; /** * A flag to indicate the text is copied, will be reset after `copiedDuration` */ copied: boolean; /** * Copy the text to the clipboard */ copy: HasSource extends true ? (text?: string) => Promise : (text: string) => Promise; /** * Clear the text in the clipboard */ clear(): void; } /** * A React Hook that copy text with [Clipboard API](https://developer.mozilla.org/zh-CN/docs/Web/API/Clipboard_API) or fallback to `document.execCommand('copy')` if it's not available. */ export declare function useClipboard(options?: UseClipboardOptions): UseClipboardReturns; export declare function useClipboard(options: UseClipboardOptions>): UseClipboardReturns;