Contents

Clipboard

The system clipboard manager.

import { clipboard } from '@mobrowser/api';

Example 

import { clipboard } from '@mobrowser/api';

clipboard.write('text/plain', 'Hello world')
const text = clipboard.read('text/plain')

Properties 

changeCount 

readonly changeCount: number;

The number of times the clipboard has been changed (macOS only).

Methods 

getTypes() 

getTypes(): ClipboardType[];

Returns the types available in the clipboard.

has() 

has(type: ClipboardType): boolean;

Checks if the clipboard has the given type.

ParameterTypeDescription
typeClipboardTypeThe type to check if the clipboard has.

read() 

read(type: ClipboardType): string;

Reads the data from the clipboard.

ParameterTypeDescription
typeClipboardTypeThe type of the data to read.

Return value 

The data from the clipboard.

write() 

write(type: ClipboardType, data: string): void;

Writes the data to the clipboard.

ParameterTypeDescription
typeClipboardTypeThe type of the data to write.
datastringThe data to write to the clipboard.

clear() 

clear(): void;

Clears the clipboard.