@univerjs/ui v0.4.2 • Docs
Interface: IClipboardInterfaceService
This interface provides an interface to access system's clipboard.
Properties
Property | Modifier | Type | Description | Defined in |
---|---|---|---|---|
supportClipboard | readonly | boolean | This property tells if the platform supports reading data directly from the clipboard. | packages/ui/src/services/clipboard/clipboard-interface.service.ts:56 (opens in a new tab) |
Methods
read()
read(): Promise<ClipboardItem[]>
Read ClipboardItem[]
from clipboard.
Returns
Promise
<ClipboardItem
[]>
Defined in
packages/ui/src/services/clipboard/clipboard-interface.service.ts:51 (opens in a new tab)
readText()
readText(): Promise<string>
Read plain text from clipboard. Use read() to read both plain text and html.
Returns
Promise
<string
>
plain text
Defined in
packages/ui/src/services/clipboard/clipboard-interface.service.ts:46 (opens in a new tab)
write()
write(text, html): Promise<void>
Write both plain text and html into clipboard.
Parameters
Parameter | Type |
---|---|
text | string |
html | string |
Returns
Promise
<void
>
Defined in
packages/ui/src/services/clipboard/clipboard-interface.service.ts:40 (opens in a new tab)
writeText()
writeText(text): Promise<void>
Write plain text into clipboard. Use write() to write both plain text and html.
Parameters
Parameter | Type |
---|---|
text | string |
Returns
Promise
<void
>
Defined in
packages/ui/src/services/clipboard/clipboard-interface.service.ts:33 (opens in a new tab)