Skip to content

Commit 7dd4467

Browse files
committed
(#87) Clipboard API docs
1 parent bd6e262 commit 7dd4467

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/clipboard.class.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
11
import { NativeAdapter } from "./adapter/native.adapter.class";
22

3+
/**
4+
* {@link Clipboard} class gives access to a systems clipboard
5+
*/
36
export class Clipboard {
7+
/**
8+
* {@link Clipboard} class constructor
9+
* @param nativeAdapter {@link NativeAdapter} instance used to access OS API
10+
*/
411
constructor(private nativeAdapter: NativeAdapter) {
512
}
613

14+
/**
15+
* {@link copy} copies a given text to the system clipboard
16+
* @param text The text to copy
17+
*/
718
public copy(text: string): Promise<void> {
819
return this.nativeAdapter.copy(text);
920
}
1021

22+
/**
23+
* {@link paste} pastes the current content of the system clipboard (limited to text)
24+
*/
1125
public paste(): Promise<string> {
1226
return this.nativeAdapter.paste();
1327
}

0 commit comments

Comments
 (0)