콘텐츠로 이동

writeHtml

이 콘텐츠는 아직 번역되지 않았습니다.

Module @netwiv/api/plugins/clipboard-manager · Kind Function

import { writeHtml } from '@netwiv/api/plugins/clipboard-manager';
  • Writes HTML or fallbacks to write provided plain text to the clipboard.
  • Android / iOS: Not supported.
function writeHtml(html: string, altText?: string | undefined): Promise<void>
import { writeHtml } from '@netwiv/api/plugins/clipboard-manager';
await writeHtml('<h1>Tauri is awesome!</h1>', 'plaintext');
// The following will write "<h1>Tauri is awesome</h1>" as plain text
await writeHtml('<h1>Tauri is awesome!</h1>', '<h1>Tauri is awesome</h1>');
// we can read html data only as a string so there's just readText(), no readHtml()
assert(await readText(), '<h1>Tauri is awesome!</h1>');

Upstream since 2.0.0


Descriptions come from the pinned @tauri-apps/plugin-clipboard-manager@2.3.3 declarations (MIT OR Apache-2.0); imports are shown with @netwiv/api paths.