@zturnlibs/ztron-api


clipboard

Variables

clipboard

const clipboard: object

Defined in: clipboard.ts:62

Type Declaration

clear

clear: () => Promise<void>

Clears the clipboard of all contents (text, images, files).

Returns

Promise<void>

readImage

readImage: () => Promise<Uint8Array<ArrayBufferLike> | null>

Reads an image from the clipboard as PNG bytes (null when the clipboard holds no image). Ztron divergence: Tauri v2 returns an Image; here the raw PNG bytes are returned directly — wrap with Image.fromBytes for a registered image.

Returns

Promise<Uint8Array<ArrayBufferLike> | null>

readText

readText: () => Promise<string | null>

Returns

Promise<string | null>

writeImage

writeImage: (image) => Promise<void>

Writes an image to the clipboard. Accepts raw PNG bytes (Uint8Array / number[] / ArrayBuffer) or a registered Image (re-encoded host-side).

Parameters
image

ArrayBuffer | number[] | Uint8Array<ArrayBufferLike> | Image

Returns

Promise<void>

writeText

writeText: (text) => Promise<void>

Parameters
text

string

Returns

Promise<void>

Functions

clear()

clear(): Promise<void>

Defined in: clipboard.ts:58

Clears the clipboard of all contents (text, images, files).

Returns

Promise<void>


readHtml()

readHtml(): Promise<string | null>

Defined in: clipboard.ts:48

Reads the clipboard HTML flavor (null when not present).

Returns

Promise<string | null>


readImage()

readImage(): Promise<Uint8Array<ArrayBufferLike> | null>

Defined in: clipboard.ts:18

Reads an image from the clipboard as PNG bytes (null when the clipboard holds no image). Ztron divergence: Tauri v2 returns an Image; here the raw PNG bytes are returned directly — wrap with Image.fromBytes for a registered image.

Returns

Promise<Uint8Array<ArrayBufferLike> | null>


readText()

readText(): Promise<string | null>

Defined in: clipboard.ts:5

Returns

Promise<string | null>


writeHtml()

writeHtml(html): Promise<void>

Defined in: clipboard.ts:53

Writes HTML to the clipboard (with a plain-text fallback).

Parameters

html

string

Returns

Promise<void>


writeImage()

writeImage(image): Promise<void>

Defined in: clipboard.ts:29

Writes an image to the clipboard. Accepts raw PNG bytes (Uint8Array / number[] / ArrayBuffer) or a registered Image (re-encoded host-side).

Parameters

image

ArrayBuffer | number[] | Uint8Array<ArrayBufferLike> | Image

Returns

Promise<void>


writeText()

writeText(text): Promise<void>

Defined in: clipboard.ts:8

Parameters

text

string

Returns

Promise<void>