@univerjs/ui v0.4.2 • Docs
Class: BrowserClipboardService
This interface provides an interface to access system's clipboard.
Extends
Implements
Constructors
new BrowserClipboardService()
new BrowserClipboardService(
_localeService,
_logService,
_notificationService?): BrowserClipboardService
Parameters
Parameter | Type |
---|---|
_localeService | LocaleService |
_logService | ILogService |
_notificationService ? | INotificationService |
Returns
Overrides
Defined in
packages/ui/src/services/clipboard/clipboard-interface.service.ts:68 (opens in a new tab)
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_disposed | protected | boolean | false | Disposable ._disposed | packages/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
Defined in
packages/core/src/shared/lifecycle.ts:106 (opens in a new tab)
disposeWithMe()
disposeWithMe(disposable): IDisposable
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
Defined in
packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)
ensureNotDisposed()
protected ensureNotDisposed(): void
Returns
void
Inherited from
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
Parameter | Type |
---|---|
text | string |
html | string |
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
Parameter | Type |
---|---|
text | string |
Returns
Promise
<void
>
Implementation of
IClipboardInterfaceService
.writeText
Defined in
packages/ui/src/services/clipboard/clipboard-interface.service.ts:95 (opens in a new tab)