@univerjsuiindexinterfacesIclipboardinterfaceservice

@univerjs/ui v0.5.0-beta.1Docs


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.submodules/univer/packages/ui/src/services/clipboard/clipboard-interface.service.ts:61

Methods

read()

read(): Promise<ClipboardItem[]>

Read ClipboardItem[] from clipboard.

Returns

Promise<ClipboardItem[]>

Defined in

submodules/univer/packages/ui/src/services/clipboard/clipboard-interface.service.ts:56


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

submodules/univer/packages/ui/src/services/clipboard/clipboard-interface.service.ts:51


write()

write(text, html): Promise<void>

Write both plain text and html into clipboard.

Parameters

ParameterType
textstring
htmlstring

Returns

Promise<void>

Defined in

submodules/univer/packages/ui/src/services/clipboard/clipboard-interface.service.ts:45


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

submodules/univer/packages/ui/src/services/clipboard/clipboard-interface.service.ts:38