mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-01 13:14:16 +08:00
103 lines
3.2 KiB
HTML
103 lines
3.2 KiB
HTML
---
|
|
layout: docs
|
|
title: Clipboard
|
|
edit_url: "https://github.com/nylas/N1/blob/master/src/clipboard.coffee"
|
|
---
|
|
|
|
<h2>Summary</h2>
|
|
|
|
<div class="markdown-from-sourecode">
|
|
<p><p>Represents the clipboard used for copying and pasting in Atom.</p>
|
|
<p>An instance of this class is always available as the <code>atom.clipboard</code> global.</p>
|
|
</p>
|
|
</div>
|
|
|
|
<ul>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Instance Methods</h3>
|
|
|
|
<h4 id=write class="function-name">
|
|
write(<span class="args"><span class="arg">text</span><span class="arg">metadata</span></span>) <a href="#write" class="link"></a>
|
|
</h4>
|
|
|
|
<div class="function-description markdown-from-sourecode">
|
|
<p><p>Write the given text to the clipboard.</p>
|
|
<p>The metadata associated with the text is available by calling
|
|
<a href='#readWithMetadata'>readWithMetadata</a>.</p>
|
|
</p>
|
|
</div>
|
|
|
|
<strong>Parameters</strong>
|
|
<table class="arguments">
|
|
<tr>
|
|
<th>Argument</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
<tr>
|
|
<td style="width:15%;">
|
|
<em>text</em>
|
|
</td>
|
|
<td class="markdown-from-sourecode">
|
|
|
|
<p>The <a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string'>String</a> to store.</p>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="width:15%;">
|
|
<em>metadata</em>
|
|
</td>
|
|
<td class="markdown-from-sourecode">
|
|
|
|
<p>The additional info to associate with the text. </p>
|
|
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h4 id=read class="function-name">
|
|
read(<span class="args"></span>) <a href="#read" class="link"></a>
|
|
</h4>
|
|
|
|
<div class="function-description markdown-from-sourecode">
|
|
<p><p>Read the text from the clipboard.</p>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<strong>Returns</strong>
|
|
<table class="arguments">
|
|
<tr>
|
|
<th>Return Values</th>
|
|
</tr>
|
|
<tr><td class="markdown-from-sourecode"><p>Returns a <a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string'>String</a>.</p>
|
|
</td></tr>
|
|
</table>
|
|
<h4 id=readWithMetadata class="function-name">
|
|
readWithMetadata(<span class="args"></span>) <a href="#readWithMetadata" class="link"></a>
|
|
</h4>
|
|
|
|
<div class="function-description markdown-from-sourecode">
|
|
<p><p>Read the text from the clipboard and return both the text and the
|
|
associated metadata.</p>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<strong>Returns</strong>
|
|
<table class="arguments">
|
|
<tr>
|
|
<th>Return Values</th>
|
|
</tr>
|
|
<tr><td class="markdown-from-sourecode"><p>Returns an <a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object'>Object</a> with the following keys:</p>
|
|
<ul>
|
|
<li><code>text</code> The <a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string'>String</a> clipboard text.</li>
|
|
<li><code>metadata</code> The metadata stored by an earlier call to <a href='#write'>write</a>.</li>
|
|
</ul>
|
|
</td></tr>
|
|
</table>
|