@ryusei/code
Version:
<div align="center"> <a href="https://code.ryuseijs.com"> <img alt="RyuseiCode" src="https://code.ryuseijs.com/images/svg/logo.svg" width="70"> </a>
42 lines • 1.22 kB
TypeScript
/**
* The class for normalizing different copy/paste behaviours in browsers.
*
* @since 0.1.0
*/
export declare class Clipboard {
/**
* Creates a temporary textarea element.
*
* @param text - A value for the textarea.
*
* @return A created element.
*/
private create;
/**
* Pastes the text via execCommand for old browsers.
*
* @return A pasted text.
*/
private execPaste;
/**
* Copies the provided text via execCommand for old browsers.
*
* @param text - A text to copy.
* @param onFailed - Optional. A callback fired when copy failed.
*/
private execCopy;
/**
* Pastes the clipboard text.
*
* @param onPaste - A callback fired after pasting a text, taking a pasted value as the first argument.
*/
paste(onPaste: (text: string) => void): void;
/**
* Copies the passed text.
*
* @param text - A text to copy.
* @param onFailed - Optional. A callback fired when copy failed.
*/
copy(text: string, onFailed?: () => void): void;
}
//# sourceMappingURL=../../../../src/js/components/Edit/Clipboard.d.ts.map