@overwolf/ow-electron-packages-types 0.0.13 → 0.1.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +0,0 @@
1
- export const enum kGepSupportedGameIds {
2
- TeamfightTactics = 21570,
3
- RocketLeague = 10798,
4
- LeagueofLegends = 5426,
5
- LeagueofLegendsPBE = 22848,
6
- WoW = 765,
7
- FinalFantasyXIVOnline = 6350,
8
- }
package/overlay.d.ts DELETED
@@ -1,325 +0,0 @@
1
- import {
2
- BrowserWindow,
3
- BrowserWindowConstructorOptions,
4
- Size,
5
- WebContents,
6
- } from 'electron';
7
- import { EventEmitter } from 'events';
8
-
9
- export declare type GameProcessInfo = {
10
- pid?: number;
11
-
12
- fullPath: string;
13
-
14
- commandLine?: string;
15
-
16
- is32Bit?: boolean;
17
-
18
- isElevated?: boolean;
19
- };
20
-
21
- export declare type GameInfo = {
22
- id: number;
23
-
24
- classId: number;
25
-
26
- name: string;
27
-
28
- supported: boolean;
29
-
30
- processInfo?: GameProcessInfo;
31
-
32
- flags?: any;
33
-
34
- type: 'Game' | 'Launcher';
35
- };
36
-
37
- export interface GamesFilter {
38
- all?: boolean;
39
-
40
- includeUnsupported?: boolean;
41
-
42
- gamesIds: number[];
43
- }
44
-
45
- /**
46
- * Input pass through
47
- * 'noPassThrough': Window will handle input and block from game (Default)
48
- * 'passThrough': window will not handle any input
49
- * 'passThroughAndNotify': Window will handle input and also pass it to the game.
50
- */
51
- export type PassthroughType = "noPassThrough" | "passThrough" | "passThroughAndNotify";
52
-
53
- /**
54
- * Overlay rendering Z-Order
55
- */
56
- export type ZOrderType = "default" | "topMost" | "bottomMost";
57
-
58
- /** Overlay ow-electron options */
59
- export interface OverlayOptions {
60
- passthrough?: PassthroughType | number;
61
-
62
- zOrder?: ZOrderType | number; // backwards compatible
63
- }
64
-
65
- export interface OverlayWindowOptions
66
- extends BrowserWindowConstructorOptions,
67
- OverlayOptions {
68
- /**
69
- * unique name (id)
70
- */
71
- name: string;
72
-
73
- /** not supported yet */
74
- enableHWAcceleration?: boolean;
75
-
76
- /** */
77
- enableIsolation?:boolean;
78
- }
79
-
80
- export interface IOverlayHotkey {
81
- name: string;
82
- keyCode: number;
83
- modifiers?: {
84
- alt?: boolean;
85
- ctrl?: boolean;
86
- shift?: boolean;
87
- custom?: number; // custom modifier (i.e key code)
88
- meta?: boolean;
89
- };
90
- passthrough?: boolean;
91
- }
92
-
93
- export interface GameLaunchEvent {
94
- inject: () => void;
95
- }
96
-
97
- /**
98
- * TBD
99
- */
100
- export interface OverlayBrowserWindow {
101
- window: BrowserWindow;
102
-
103
- readonly overlayOptions: OverlayOptions;
104
-
105
- readonly name: string;
106
-
107
- readonly id: number;
108
- }
109
-
110
- export interface InjectionError {
111
- error: string;
112
- }
113
-
114
- export interface GameWindowInfo {
115
- size: Size;
116
- nativeHandle: number;
117
- focused: boolean;
118
- graphics: 'd3d9' | 'd3d12' | 'd3d11' | string | undefined;
119
- }
120
-
121
- export interface GameInputInterception {
122
- /**
123
- * Can the Overlay window process input
124
- * Related to `mixed mode when available` and/or `exclusive only` games
125
- */
126
- readonly canInterceptInput?: boolean;
127
- /**
128
- * Overlay has full input control, blocking input from the game
129
- */
130
- readonly exclusiveMode?: boolean;
131
- }
132
-
133
- export interface ActiveGameInfo {
134
- readonly gameInfo: GameInfo;
135
- readonly gameWindowInfo: GameWindowInfo;
136
- readonly gameInputInfo: GameInputInterception;
137
- }
138
-
139
- export declare type GameWindowUpdateReason = undefined | 'resized' | 'focus';
140
- export declare type HotkeyState = 'pressed' | 'released';
141
-
142
- export declare type HotkeyCallback = (
143
- hotKey: IOverlayHotkey,
144
- state: HotkeyState
145
- ) => void;
146
-
147
- export interface ExclusiveInputOptions {
148
- /**
149
- * Exclusive mode FadeIn / FadeOut duration in miliseconds.
150
- *
151
- * Use `0` to disable.
152
- * @default 100
153
- */
154
- fadeAnimateInterval?: number;
155
-
156
- /**
157
- * Exclusive mode overlay background color.
158
- * Use `rgba(0,0,0,0)` to disable background color
159
- *
160
- * Note: Using an invalid color format (e.g: not `rgba(...)`) will throw an Error.
161
- * @default 'rgba(12, 12, 12, , 0.5)'
162
- */
163
- backgroundColor?: string;
164
- }
165
-
166
- export interface IOverlayHotkeys {
167
- /**
168
- * Register new hotkey.
169
- * Throw error when hotkey already exits, or callback is missing
170
- */
171
- register(hotKey: IOverlayHotkey, callback: HotkeyCallback): void;
172
-
173
- /**
174
- * Update existing hotkey.
175
- * Return false if hotkey doesn't exits
176
- */
177
- update(hotKey: IOverlayHotkey): boolean;
178
-
179
- /**
180
- * Clear all hotkeys
181
- */
182
- unregisterAll(): void;
183
-
184
- /**
185
- * Remove hotkey by name.
186
- * Return false if doesn't exits.
187
- */
188
- unregister(name: string): boolean;
189
-
190
- /**
191
- * Get all active hotkeys.
192
- */
193
- all(): IOverlayHotkey[];
194
- }
195
-
196
- export interface IOverwolfOverlayApi extends EventEmitter {
197
- /**
198
- * Create new Overlay window
199
- */
200
- createWindow(options: OverlayWindowOptions): Promise<OverlayBrowserWindow>;
201
-
202
- /**
203
- * Game launch registration
204
- */
205
- registerGames(filter: GamesFilter);
206
-
207
- /**
208
- * injected Game inforamation
209
- */
210
- getActiveGameInfo(): ActiveGameInfo | undefined;
211
-
212
- /**
213
- * Get all open overlay windows
214
- */
215
- getAllWindows(): OverlayBrowserWindow[];
216
-
217
- /**
218
- * The overlay window that owns the given `webContents` or `null` if the contents are not
219
- * owned by a window.
220
- */
221
- fromWebContents(webContents: WebContents): OverlayBrowserWindow | null;
222
-
223
- /**
224
- * The overlay window that owns the given `BrowserWindow` or `null` if the browerWindow are not
225
- * owned by a window.
226
- */
227
- fromBrowserWindow(browserWindow: BrowserWindow): OverlayBrowserWindow | null;
228
-
229
- /**
230
- * Overlay hotkeys api
231
- */
232
- hotkeys: IOverlayHotkeys;
233
-
234
- /**
235
- * Enters Overlay "Exclusive Mode" - meaning, the game no longer receives user
236
- * input (all input will go to the overlay windows).
237
- *
238
- * The `game-input-exclusive-mode-changed` event fires if exclusive mode was entered.
239
- *
240
- * NOTE: This is only supported when getActiveGameInfo returns
241
- * `"canInterceptInput" == false`. Calling this function when unsupported will
242
- * be ignored and will not throw an exception.
243
- */
244
- enterExclusiveMode(options?: ExclusiveInputOptions): void;
245
-
246
- /**
247
- * Exits Overlay Exclusive Mode, returning input control to the game.
248
- *
249
- * The `game-input-exclusive-mode-changed` event fires when exiting exclusive mode.
250
- */
251
- exitExclusiveMode(): void;
252
-
253
- /**
254
- *TODO(bFox) :replace ...args
255
- */
256
- on(eventName: 'error', listener: (...args: any[]) => void): this;
257
-
258
- /**
259
- * Fired when registered game is detected
260
- * call `event.inject()` to enable overlay for the game.
261
- */
262
- on(
263
- eventName: 'game-launched',
264
- listener: (event: GameLaunchEvent, gameInfo: GameInfo) => void
265
- ): this;
266
-
267
- /**
268
- * Fired on registered game process terminated.
269
- */
270
- on(
271
- eventName: 'game-exit',
272
- listener: (gameInfo: GameInfo, wasInjected: boolean) => void
273
- ): this;
274
-
275
- /**
276
- * Fired when overlay is ready for game.
277
- *
278
- */
279
- on(eventName: 'game-injected', listener: (gameInfo: GameInfo) => void): this;
280
-
281
- /**
282
- * TODO(bFox) :replace ...args
283
- */
284
- on(
285
- eventName: 'game-injection-error',
286
- listener: (gameInfo: GameInfo, error: string, ...args: any[]) => void
287
- ): this;
288
-
289
- /** */
290
- on(
291
- eventName: 'game-focus-changed',
292
- listener: (
293
- window: GameWindowInfo,
294
- gameInfo: GameInfo,
295
- focus: boolean
296
- ) => void
297
- ): this;
298
-
299
- /** */
300
- on(
301
- eventName: 'game-window-changed',
302
- listener: (
303
- window: GameWindowInfo,
304
- gameInfo: GameInfo,
305
- reason?: GameWindowUpdateReason
306
- ) => void
307
- ): this;
308
-
309
- /**
310
- * Fires when the game input interception state changes
311
- */
312
- on(
313
- eventName: 'game-input-interception-changed',
314
- listener: (info: GameInputInterception) => void
315
- ): this;
316
-
317
- /**
318
- * Fires when Overlay input Exclusive Mode changes.
319
- * Only relevant to `mixed mode when available` and/or `exclusive only` games
320
- */
321
- on(
322
- eventName: 'game-input-exclusive-mode-changed',
323
- listener: (info: GameInputInterception) => void
324
- ): this;
325
- }