/** * Provides clipboard copy functionality with automatic timeout for the "copied" state. * Uses the modern Clipboard API for secure, asynchronous copying. * * @param timeout - Duration in milliseconds to keep the "copied" state true (default: 2000ms) * @returns Object containing the copied state and copy function * * @example * ```tsx * function CodeBlock({ code }: { code: string }) { * const { copied, copy } = useCopyToClipboard(); * * return ( *
*
{code}
* *
* ); * } * ``` * * @example * ```tsx * function ShareLink({ url }: { url: string }) { * const { copied, copy, error } = useCopyToClipboard(3000); * * return ( *
* * * {error &&

Failed to copy: {error.message}

} *
* ); * } * ``` * * @example * ```tsx * function ApiKeyDisplay({ apiKey }: { apiKey: string }) { * const { copied, copy } = useCopyToClipboard(); * const [showKey, setShowKey] = useState(false); * * const handleCopy = async () => { * await copy(apiKey); * // Additional actions after successful copy * trackEvent('api_key_copied'); * }; * * return ( *
* {showKey ? apiKey : '••••••••••••'} * * *
* ); * } * ``` */ export declare function useCopyToClipboard(timeout?: number): { copied: boolean; copy: (text: string) => Promise; error: Error | null; }; //# sourceMappingURL=useCopyToClipboard.d.ts.map