W3cubDocs

/Haxe JavaScript

Clipboard

package js.html

extends EventTarget

Available on js

The Clipboard interface implements the Clipboard API, providing—if the user grants permission—both read and write access to the contents of the system clipboard.

Documentation Clipboard by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See also:

Methods

read():Promise<DataTransfer>

Requests arbitrary data (such as images) from the clipboard, returning a Promise. When the data has been retrieved, the promise is resolved with a DataTransfer object that provides the data.

Throws:

null

DOMError

readText():Promise<String>

Requests text from the system clipboard; returns a Promise which is resolved with a DOMString containing the clipboard's text once it's available.

Throws:

null

DOMError

write(data:DataTransfer):Promise<Void>

Writes arbitrary data to the system clipboard. This asynchronous operation signals that it's finished by resolving the returned Promise.

Throws:

null

DOMError

writeText(data:String):Promise<Void>

Writes text to the system clipboard, returning a Promise which is resolved once the text is fully copied into the clipboard.

Throws:

null

DOMError

© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/Clipboard.html