API Reference
@univerjs
@univerjs/ui
interfaces
Iclipboardinterfaceservice

@univerjs/ui v0.4.2Docs


Interface: IClipboardInterfaceService

This interface provides an interface to access system's clipboard.

Properties

PropertyModifierTypeDescriptionDefined in
supportClipboardreadonlybooleanThis 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

ParameterType
textstring
htmlstring

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

ParameterType
textstring

Returns

Promise<void>

Defined in

packages/ui/src/services/clipboard/clipboard-interface.service.ts:33 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.