From 9ec59cbc6cc1adf69d92f3285287db7fb240946e Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 6 May 2019 08:11:48 -0700 Subject: [PATCH] docs: clarify clipboard type options (#18107) --- docs/api/clipboard.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/api/clipboard.md b/docs/api/clipboard.md index 429395877af2..adf64630c2c6 100644 --- a/docs/api/clipboard.md +++ b/docs/api/clipboard.md @@ -11,7 +11,7 @@ const { clipboard } = require('electron') clipboard.writeText('Example String') ``` -On X Window systems, there is also a selection clipboard. To manipulate it +On Linux, there is also a `selection` clipboard. To manipulate it you need to pass `selection` to each method: ```javascript @@ -28,53 +28,53 @@ The `clipboard` module has the following methods: ### `clipboard.readText([type])` -* `type` String (optional) +* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux. Returns `String` - The content in the clipboard as plain text. ### `clipboard.writeText(text[, type])` * `text` String -* `type` String (optional) +* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux. Writes the `text` into the clipboard as plain text. ### `clipboard.readHTML([type])` -* `type` String (optional) +* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux. Returns `String` - The content in the clipboard as markup. ### `clipboard.writeHTML(markup[, type])` * `markup` String -* `type` String (optional) +* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux. Writes `markup` to the clipboard. ### `clipboard.readImage([type])` -* `type` String (optional) +* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux. Returns [`NativeImage`](native-image.md) - The image content in the clipboard. ### `clipboard.writeImage(image[, type])` * `image` [NativeImage](native-image.md) -* `type` String (optional) +* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux. Writes `image` to the clipboard. ### `clipboard.readRTF([type])` -* `type` String (optional) +* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux. Returns `String` - The content in the clipboard as RTF. ### `clipboard.writeRTF(text[, type])` * `text` String -* `type` String (optional) +* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux. Writes the `text` into the clipboard in RTF. @@ -93,7 +93,7 @@ bookmark is unavailable. * `title` String * `url` String -* `type` String (optional) +* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux. Writes the `title` and `url` into the clipboard as a bookmark. @@ -123,20 +123,20 @@ synchronous IPC when called from the renderer process. ### `clipboard.clear([type])` -* `type` String (optional) +* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux. Clears the clipboard content. ### `clipboard.availableFormats([type])` -* `type` String (optional) +* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux. Returns `String[]` - An array of supported formats for the clipboard `type`. ### `clipboard.has(format[, type])` _Experimental_ * `format` String -* `type` String (optional) +* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux. Returns `Boolean` - Whether the clipboard supports the specified `format`. @@ -161,7 +161,7 @@ Returns `Buffer` - Reads `format` type from the clipboard. * `format` String * `buffer` Buffer -* `type` String (optional) +* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux. Writes the `buffer` into the clipboard as `format`. @@ -173,7 +173,7 @@ Writes the `buffer` into the clipboard as `format`. * `image` [NativeImage](native-image.md) (optional) * `rtf` String (optional) * `bookmark` String (optional) - The title of the url at `text`. -* `type` String (optional) +* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux. ```javascript const { clipboard } = require('electron')