react-tesna-utils
Version:
A versatile utility library featuring optimized functions for data manipulation, clipboard handling, text truncation, comparison, validation, and more. Designed for modern JavaScript and TypeScript projects with efficient and reusable solutions.
12 lines (11 loc) • 410 B
TypeScript
export declare const useCopy: () => {
isCopied: boolean;
isCopyLoading: boolean;
copyText: (text: string) => Promise<void>;
};
/**
* Copies the provided text to the clipboard.
* @param text - The text to copy to the clipboard.
* @returns A promise that resolves to `true` if successful, or `false` if an error occurs.
*/
export declare function copyToClipboard(text: string): Promise<boolean>;