Clipboard

The Clipboard interface of the Clipboard API provides read and write access to the contents of the system clipboard. This allows a web application to implement cut, copy, and paste features. Available only in secure contexts.

MDN Reference

Functions

Link copied to clipboard
open external override fun dispatchEvent(event: Event): Boolean
Link copied to clipboard
inline suspend fun Clipboard.read(): ClipboardItems

The read() method of the Clipboard interface returns a Promise that fulfills with a copy of the clipboard's contents.

Link copied to clipboard
open external fun readAsync(): Promise<ClipboardItems>

The read() method of the Clipboard interface returns a Promise that fulfills with a copy of the clipboard's contents.

Link copied to clipboard
inline suspend fun Clipboard.readText(): String

The readText() method of the Clipboard interface returns a Promise which fulfills with a copy of the textual contents of the system clipboard.

Link copied to clipboard
open external fun readTextAsync(): Promise<JsString>

The readText() method of the Clipboard interface returns a Promise which fulfills with a copy of the textual contents of the system clipboard.

Link copied to clipboard
open external fun <T : Event> when(type: EventType<T>, options: ObservableEventListenerOptions?): Observable<T>
Link copied to clipboard
inline suspend fun Clipboard.write(data: ClipboardItems)

The write() method of the Clipboard interface is used to write data such as images, text, and custom types, to the system clipboard.

Link copied to clipboard
open external fun writeAsync(data: ClipboardItems): Promise<Void>

The write() method of the Clipboard interface is used to write data such as images, text, and custom types, to the system clipboard.

Link copied to clipboard
inline suspend fun Clipboard.writeText(data: String)

The writeText() method of the Clipboard interface writes the specified text to the system clipboard, returning a Promise that is resolved once the system clipboard has been updated.

Link copied to clipboard
open external fun writeTextAsync(data: String): Promise<Void>

The writeText() method of the Clipboard interface writes the specified text to the system clipboard, returning a Promise that is resolved once the system clipboard has been updated.