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)

Copy text to the system clipboard.

@param text - The text to copy

Parameters:

NameTypeDefault
textstring

Throws: std::clipboardCopy

(source)

paste

ts
paste(): string

Read text from the system clipboard and return it.

Returns: string

Throws: std::clipboardPaste

(source)