Skip to content

clipboard ​

Read and write the system clipboard.

ts
import { copy, paste } from "std::clipboard"

node main() {
  copy("hello")
  const text = paste()
}

Effects ​

std::clipboardCopy ​

ts
effect std::clipboardCopy {}

(source)

std::clipboardPaste ​

ts
effect std::clipboardPaste {}

(source)

Functions ​

copy ​

ts
copy(text: string) raises <std::clipboardCopy>

Copy text to the system clipboard.

Parameters:

NameTypeDefault
textstring

Throws: std::clipboardCopy

Needs: subprocess

(source)

paste ​

ts
paste(): string raises <std::clipboardPaste>

Read text from the system clipboard.

Returns: string

Throws: std::clipboardPaste

Needs: subprocess

(source)