@overwolf/ow-electron-packages-types 0.2.0-beta.1 → 0.2.0-beta.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types.d.ts +158 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overwolf/ow-electron-packages-types",
3
- "version": "0.2.0-beta.1",
3
+ "version": "0.2.0-beta.4",
4
4
  "description": "Type definition file for autocompletion and documentation purposes for ow-electron packages",
5
5
  "license": "MIT",
6
6
  "types": "types.d.ts",
package/types.d.ts CHANGED
@@ -96,6 +96,7 @@ interface OWPackages extends overwolf.packages.OverwolfPackageManager {
96
96
  recorder: IOverwolfRecordingApi;
97
97
  overlay: IOverwolfOverlayApi;
98
98
  utility: IOverwolfUtilityApi;
99
+ crn: IOverwolfCRNApi;
99
100
  }
100
101
 
101
102
  /**
@@ -147,6 +148,13 @@ interface OverlayWindowOptions
147
148
 
148
149
  /** */
149
150
  enableIsolation?:boolean;
151
+
152
+ /**
153
+ * If true, the overlaywindow will be DPI aware (Main monitor DPI).
154
+ * @default false
155
+ * @since 1.7.0
156
+ */
157
+ dpiAware?: boolean;
150
158
  }
151
159
 
152
160
  interface IOverlayHotkey {
@@ -162,8 +170,38 @@ interface IOverlayHotkey {
162
170
  passthrough?: boolean;
163
171
  }
164
172
 
173
+ /**
174
+ * options for the `GameLaunchEvent`.
175
+ * ability to override some game settings in runtime.
176
+ *
177
+ * @see GameLaunchEvent
178
+ * @since 1.8.0
179
+ */
180
+ export interface GameLaunchEventOptions {
181
+ /**
182
+ * Force OOPO mode (when oopo is false in game list).
183
+ * @default false
184
+ */
185
+ forceOOPO?: boolean;
186
+
187
+ /**
188
+ * Force OOPO mouse Mixed mode control.
189
+ * @default false
190
+ */
191
+ forceOOPOMixedMode?: boolean;
192
+ }
193
+
165
194
  interface GameLaunchEvent {
166
- inject: () => void;
195
+ /**
196
+ * Inject the overlay into the game.
197
+ * @param options - options for the `GameLaunchEvent` since 1.8.0.
198
+ */
199
+ inject: (options?: GameLaunchEventOptions) => void;
200
+
201
+ /**
202
+ * Dismiss the overlay.
203
+ */
204
+ dismiss: () => void;
167
205
  }
168
206
 
169
207
  /**
@@ -320,6 +358,12 @@ interface IOverwolfOverlayApi extends EventEmitter {
320
358
  */
321
359
  hotkeys: IOverlayHotkeys;
322
360
 
361
+ /**
362
+ * Overlay package version
363
+ * @since 1.7.0
364
+ */
365
+ readonly version: string;
366
+
323
367
  /**
324
368
  * Enters Overlay "Exclusive Mode" - meaning, the game no longer receives user
325
369
  * input (all input will go to the overlay windows).
@@ -770,6 +814,13 @@ interface AudioDeviceSettingsInfo extends AudioDeviceSettings {
770
814
  readonly name: string;
771
815
  }
772
816
 
817
+ export interface AudioDeviceSettingsUpdateInfo extends AudioDeviceSettings {
818
+ /**
819
+ * Audio device unique name or Process name for application
820
+ */
821
+ readonly name: string;
822
+ }
823
+
773
824
  interface ApplicationAudioDeviceSettingsInfo
774
825
  extends AudioDeviceSettingsInfo {
775
826
  readonly type: 'output';
@@ -1728,6 +1779,17 @@ interface IOverwolfRecordingApi {
1728
1779
  */
1729
1780
  registerGames(filter: GamesFilter);
1730
1781
 
1782
+ /**
1783
+ * Update audio device settings while recording
1784
+ * (for example, volume, mute, etc.) by device name.
1785
+ *
1786
+ * @param device
1787
+ * @since 0.32.0
1788
+ */
1789
+ updateAudioDevice(
1790
+ device: AudioDeviceSettingsUpdateInfo
1791
+ ): Promise<void>;
1792
+
1731
1793
  /**
1732
1794
  * Fired when registered game is detected
1733
1795
  */
@@ -1775,3 +1837,98 @@ interface IOverwolfRecordingApi {
1775
1837
  */
1776
1838
  on(eventName: 'stats', listener: (args: RecorderStats) => void): this;
1777
1839
  }
1840
+
1841
+ // -----------------------------------------------------------------------------
1842
+ // Overwolf CRN API
1843
+
1844
+ export interface ICRNEvent {
1845
+ abort: () => void;
1846
+ }
1847
+
1848
+ /**
1849
+ * All supported notification actions.
1850
+ */
1851
+ export type CRNActionType =
1852
+ /**
1853
+ * User clicked on the `X` button to dismiss the notification.
1854
+ */
1855
+ | 'Dismissed'
1856
+ /**
1857
+ * Notification closed due to launching another game while the notification is displayed.
1858
+ */
1859
+ | 'IgnoredByLaunchingGame'
1860
+ /**
1861
+ * Notification automatically closed after no user action was registered.
1862
+ */
1863
+ | 'Timeout'
1864
+ /**
1865
+ * User clicked on `Turn off notifications` from the cogwheel icon.
1866
+ */
1867
+ | 'TurnOffNotificationsRequested'
1868
+ /**
1869
+ * User clicked on a notification that opens an external URL (e.g., newsletter site).
1870
+ */
1871
+ | 'OpenExternalUrl'
1872
+ /**
1873
+ * User clicked on a notification that downloads an external app.
1874
+ */
1875
+ | 'DownloadExternalApp'
1876
+ /**
1877
+ * User clicked on the `Cancel` button while the external app was downloading.
1878
+ */
1879
+ | 'CancelDownloadExternalApp'
1880
+ /**
1881
+ * User clicked on the `X` button while the external app was downloading.
1882
+ */
1883
+ | 'CloseClickedWhileDownloadingExternalApp'
1884
+ /**
1885
+ * Developer programmatically closed the notification using the `closeNotificationWindow()` method.
1886
+ */
1887
+ | 'ForceClosed';
1888
+
1889
+ export interface IOverwolfCRNApi {
1890
+ /**
1891
+ * returns Notification visible status.
1892
+ * true if the notification is currently visible, false if not.
1893
+ */
1894
+ isNotificationVisible(): Promise<boolean>;
1895
+
1896
+ /**
1897
+ * returns Notification settings status:
1898
+ * true if notifications are allowed, false if not.
1899
+ */
1900
+ getNotificationStatus(): Promise<boolean>;
1901
+
1902
+ /**
1903
+ * Closes the notification.
1904
+ */
1905
+ closeNotificationWindow(): void;
1906
+
1907
+ /**
1908
+ * Enables or disables notifications.
1909
+ * @param enable - true to enable notifications, false to disable.
1910
+ */
1911
+ allowNotifications(enable: boolean): void;
1912
+
1913
+ /**
1914
+ * Fired before a notification is shown.
1915
+ * @param eventName
1916
+ * @param listener
1917
+ */
1918
+ on(
1919
+ eventName: 'before-notification',
1920
+ listener: (event: ICRNEvent, args: any) => void
1921
+ ): this;
1922
+
1923
+ /**
1924
+ * Fired when a notification action is triggered.
1925
+ * @param eventName
1926
+ * @param listener
1927
+ */
1928
+ on(
1929
+ eventName: 'notification-action',
1930
+ listener: (event: CRNActionType) => void
1931
+ ): this;
1932
+ }
1933
+
1934
+ // -----------------------------------------------------------------------------