Repository navigation
Expand file tree
/
Copy pathelectron.d.ts
More file actions
99 lines (69 loc) · 2.86 KB
/
Copy pathelectron.d.ts
File metadata and controls
99 lines (69 loc) · 2.86 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
declare module "electron" {
type ClipboardType = "selection" | "clipboard";
module clipboard {
function availableFormats(type?: ClipboardType): void;
function clear(type?: ClipboardType): void;
function has(fmt: string, type?: ClipboardType): boolean;
function read(fmt: string): string;
function readBookmark(): {
title: string;
url: string;
};
function readBuffer(fmt: string): Uint8Array;
function readHTML(type?: ClipboardType): string;
function readImage(type?: ClipboardType): BrowserWindow.NativeImage;
function readRTF(type?: ClipboardType): string;
function readText(type?: ClipboardType): string;
function write(
data: {
text?: string;
html?: string;
image?: BrowserWindow.NativeImage;
rtf?: string;
bookmark?: string;
},
type?: ClipboardType
): void;
function writeBookmark(title: string, url: string, type?: ClipboardType): void;
function writeBuffer(fmt: string, buffer: Uint8Array, type?: ClipboardType): void;
function writeHTML(markup: string, type?: ClipboardType): void;
function writeImage(img: BrowserWindow.NativeImage, type?: ClipboardType): void;
function writeRTF(text: string, type?: ClipboardType): void;
function writeText(text: string, type?: ClipboardType): void;
}
interface UIpcSendEventInit {
senderId: number;
}
type UIpcSendEventListener<T extends any[]> = (event: UIpcSendEventInit, ...args: T) => void;
module ipcRenderer {
function on<T extends any[] = any[]>(channel: string, listener: UIpcSendEventListener<T>): void;
function once<T extends any[] = any[]>(channel: string, listener: UIpcSendEventListener<T>): void;
function off<T extends any[] = any[]>(channel: string, listener: UIpcSendEventListener<T>): void;
function sendTo<T extends any[] = any[]>(id: number, channel: string, ...args: T): void;
}
module contextBridge {}
module webFrame {}
module shell {}
module nativeImage {
type NativeImage = BrowserWindow.NativeImage;
function createEmpty(): NativeImage;
function createFromPath(path: string): NativeImage;
function createFromBitmap(
buffer: Uint8Array,
options: {
width: number;
height: number;
scaleFator?: number;
}
): NativeImage;
function createFromBuffer(
buffer: Uint8Array,
options?: {
width?: number;
height?: number;
scaleFator?: number;
}
): NativeImage;
function createFromDataURL(dataURL: string): NativeImage;
}
}