Skip to content

@jsvision/ui / ClipboardTextReader

Type Alias: ClipboardTextReader

ClipboardTextReader = () => string | Promise<string>

Defined in: ui/src/event/types.ts:65

Read exact plain text from a host clipboard.

The callback may return synchronously or through a promise. Returned text is untrusted and is bounded by the event loop before it becomes a paste event.

Returns

string | Promise<string>

The current raw host clipboard text.

Example

ts
import type { ClipboardTextReader } from '@jsvision/ui';

declare const hostClipboard: { readText(): Promise<string> };
const readClipboardText: ClipboardTextReader = () => hostClipboard.readText();