Interface: UseClipboardReturn
Defined in: use-clipboard.ts:20
Value returned by useClipboard.
Properties
copied
copied:
boolean
Defined in: use-clipboard.ts:24
true after a successful copy, until timeout elapses or reset is called.
copy
copy: (
text) =>Promise<boolean>
Defined in: use-clipboard.ts:22
Copies text to the clipboard. Resolves true on success and never rejects.
Parameters
text
string
Returns
Promise<boolean>
error
error:
Error|null
Defined in: use-clipboard.ts:26
The error from the last failed copy, or null. Cleared by the next copy or reset.
reset
reset: () =>
void
Defined in: use-clipboard.ts:28
Clears copied and error and cancels any pending timeout.
Returns
void