API Reference
@univerjs
@univerjs/ui
classes
Browserclipboardservice

@univerjs/ui v0.4.2Docs


Class: BrowserClipboardService

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

Extends

Implements

Constructors

new BrowserClipboardService()

new BrowserClipboardService(
   _localeService, 
   _logService, 
   _notificationService?): BrowserClipboardService

Parameters

ParameterType
_localeServiceLocaleService
_logServiceILogService
_notificationService?INotificationService

Returns

BrowserClipboardService

Overrides

Disposable.constructor

Defined in

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

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDisposable._disposedpackages/core/src/shared/lifecycle.ts:93 (opens in a new tab)

Accessors

supportClipboard

get supportClipboard(): boolean

This property tells if the platform supports reading data directly from the clipboard.

Returns

boolean

Implementation of

IClipboardInterfaceService.supportClipboard

Defined in

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

Methods

dispose()

dispose(): void

Returns

void

Inherited from

Disposable.dispose

Defined in

packages/core/src/shared/lifecycle.ts:106 (opens in a new tab)


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe

Defined in

packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

Disposable.ensureNotDisposed

Defined in

packages/core/src/shared/lifecycle.ts:100 (opens in a new tab)


read()

read(): Promise<ClipboardItem[]>

Read ClipboardItem[] from clipboard.

Returns

Promise<ClipboardItem[]>

Implementation of

IClipboardInterfaceService.read

Defined in

packages/ui/src/services/clipboard/clipboard-interface.service.ts:109 (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

Implementation of

IClipboardInterfaceService.readText

Defined in

packages/ui/src/services/clipboard/clipboard-interface.service.ts:123 (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>

Implementation of

IClipboardInterfaceService.write

Defined in

packages/ui/src/services/clipboard/clipboard-interface.service.ts:76 (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>

Implementation of

IClipboardInterfaceService.writeText

Defined in

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


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