-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.d.ts
60 lines (56 loc) · 1.97 KB
/
index.d.ts
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
/// <reference types="node" />
declare module "electron-overlay" {
interface IHotkey{
name: string;
keyCode: number;
modifiers?: {
alt?: boolean;
ctrl?: boolean;
shift?: boolean;
meta?: boolean;
};
passthrough?: boolean
}
interface IRectangle {
x: number;
y: number;
width: number;
height: number;
}
interface IOverlayWindowDetails{
name: string;
transparent: boolean;
resizable: boolean;
maxWidth: number;
maxHeight: number;
minWidth: number;
minHeight: number;
rect: IRectangle;
nativeHandle: number;
dragBorderWidth?: number;
caption?: {
left: number;
right: number;
top: number;
height: number;
}
}
enum FpsPosition {
TopLeft = "TopLeft",
TopRight = "TopRight",
BottomLeft = "BottomLeft",
BottomRight = "BottomRight",
}
export function start(): void;
export function stop(): void;
export function setEventCallback(cb: (event: string, ...args: any[]) => void): void;
export function setHotkeys(hotkeys: IHotkey[]): void;
export function sendCommand(arg: {command: "cursor", cursor: string}): void;
export function sendCommand(arg: {command: "fps", showfps: boolean, position: FpsPosition}): void;
export function sendCommand(arg: {command: "input.intercept", intercept: boolean}): void;
export function addWindow(windowId: number, details: IOverlayWindowDetails): void;
export function closeWindow(windowId: number): void;
export function sendWindowBounds(windowId: number, details: {rect: IRectangle}): void;
export function sendFrameBuffer(windowId: number, buffer: Buffer, width: number, height: number): void;
export function translateInputEvent(event: {windowId: number, msg: number, wparam: number, lparam: number}): any;
}