> ## Documentation Index
> Fetch the complete documentation index at: https://docs.simular.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Clipboard

# Class: Clipboard

Defined in: [index.d.ts:285](https://github.com/simular-ai/simulang-js-internal/blob/d2b85c3277cbb16ce50c0781e1db8ad2c8a5690e/index.d.ts#L285)

Contains functions to read and write the clipboard.

## Constructors

### Constructor

> **new Clipboard**(): `Clipboard`

Defined in: [index.d.ts:286](https://github.com/simular-ai/simulang-js-internal/blob/d2b85c3277cbb16ce50c0781e1db8ad2c8a5690e/index.d.ts#L286)

#### Returns

`Clipboard`

## Methods

### clear()

> **clear**(): `void`

Defined in: [index.d.ts:321](https://github.com/simular-ai/simulang-js-internal/blob/d2b85c3277cbb16ce50c0781e1db8ad2c8a5690e/index.d.ts#L321)

Clears all content from the clipboard, regardless of type.

#### Returns

`void`

***

### getImage()

> **getImage**(): [`Image`](Image.mdx) | `null`

Defined in: [index.d.ts:300](https://github.com/simular-ai/simulang-js-internal/blob/d2b85c3277cbb16ce50c0781e1db8ad2c8a5690e/index.d.ts#L300)

Gets the image content from the clipboard.

Returns the clipboard image if available, or `null` if the
clipboard doesn't contain image data.

#### Returns

[`Image`](Image.mdx) | `null`

***

### getString()

> **getString**(): `string` | `null`

Defined in: [index.d.ts:293](https://github.com/simular-ai/simulang-js-internal/blob/d2b85c3277cbb16ce50c0781e1db8ad2c8a5690e/index.d.ts#L293)

Gets the string content from the clipboard.

Returns the clipboard string if available, or `null` if the
clipboard doesn't contain string data or is empty.

#### Returns

`string` | `null`

***

### pasteText()

> **pasteText**(`value`): `void`

Defined in: [index.d.ts:332](https://github.com/simular-ai/simulang-js-internal/blob/d2b85c3277cbb16ce50c0781e1db8ad2c8a5690e/index.d.ts#L332)

Types text by pasting it from the clipboard.

Saves the previous clipboard text and image (when present), sets
the clipboard to the specified string, verifies it was set
correctly, then simulates Command+V (or Ctrl+V) to paste it.
After pasting, reapplies the saved snapshot (image is restored
in preference to text when both were present). Other clipboard
formats are not saved or restored.

#### Parameters

##### value

`string`

#### Returns

`void`

***

### setImage()

> **setImage**(`image`): `string` | `null`

Defined in: [index.d.ts:319](https://github.com/simular-ai/simulang-js-internal/blob/d2b85c3277cbb16ce50c0781e1db8ad2c8a5690e/index.d.ts#L319)

Replaces the contents of the clipboard with the given image. For
example used to copy a screenshot to the clipboard.

Returns the previous string content, or `null` if the clipboard
was empty or had no string data. The clipboard is not
automatically restored; the caller can use the returned value to
restore it if desired.

#### Parameters

##### image

[`Image`](Image.mdx)

#### Returns

`string` | `null`

***

### setString()

> **setString**(`value`): `string` | `null`

Defined in: [index.d.ts:309](https://github.com/simular-ai/simulang-js-internal/blob/d2b85c3277cbb16ce50c0781e1db8ad2c8a5690e/index.d.ts#L309)

Replaces the contents of the clipboard with the given string.

Returns the previous string content, or `null` if the clipboard
was empty or had no string data. The clipboard is not
automatically restored; the caller can use the returned value to
restore it if desired.

#### Parameters

##### value

`string`

#### Returns

`string` | `null`
