forked from ElectronNET/Electron.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclipboard.ts
More file actions
62 lines (48 loc) · 1.81 KB
/
Copy pathclipboard.ts
File metadata and controls
62 lines (48 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { clipboard } from "electron";
module.exports = (socket: SocketIO.Server) => {
socket.on('clipboard-readText', (type) => {
const text = clipboard.readText(type);
socket.emit('clipboard-readText-Completed', text);
});
socket.on('clipboard-writeText', (text, type) => {
clipboard.writeText(text, type);
});
socket.on('clipboard-readHTML', (type) => {
const content = clipboard.readHTML(type);
socket.emit('clipboard-readHTML-Completed', content);
});
socket.on('clipboard-writeHTML', (markup, type) => {
clipboard.writeHTML(markup, type);
});
socket.on('clipboard-readRTF', (type) => {
const content = clipboard.readRTF(type);
socket.emit('clipboard-readRTF-Completed', content);
});
socket.on('clipboard-writeRTF', (text, type) => {
clipboard.writeHTML(text, type);
});
socket.on('clipboard-readBookmark', () => {
const bookmark = clipboard.readBookmark();
socket.emit('clipboard-readBookmark-Completed', bookmark);
});
socket.on('clipboard-writeBookmark', (title, url, type) => {
clipboard.writeBookmark(title, url, type);
});
socket.on('clipboard-readFindText', () => {
const content = clipboard.readFindText();
socket.emit('clipboard-readFindText-Completed', content);
});
socket.on('clipboard-writeFindText', (text) => {
clipboard.writeFindText(text);
});
socket.on('clipboard-clear', (type) => {
clipboard.clear(type);
});
socket.on('clipboard-availableFormats', (type) => {
const formats = clipboard.availableFormats(type);
socket.emit('clipboard-availableFormats-Completed', formats);
});
socket.on('clipboard-write', (data, type) => {
clipboard.write(data, type);
});
}