@overwolf/ow-electron-packages-types 0.2.0-beta.2 → 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 +145 -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.2",
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
  /**
@@ -169,8 +170,38 @@ interface IOverlayHotkey {
169
170
  passthrough?: boolean;
170
171
  }
171
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
+
172
194
  interface GameLaunchEvent {
173
- 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;
174
205
  }
175
206
 
176
207
  /**
@@ -783,6 +814,13 @@ interface AudioDeviceSettingsInfo extends AudioDeviceSettings {
783
814
  readonly name: string;
784
815
  }
785
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
+
786
824
  interface ApplicationAudioDeviceSettingsInfo
787
825
  extends AudioDeviceSettingsInfo {
788
826
  readonly type: 'output';
@@ -1741,6 +1779,17 @@ interface IOverwolfRecordingApi {
1741
1779
  */
1742
1780
  registerGames(filter: GamesFilter);
1743
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
+
1744
1793
  /**
1745
1794
  * Fired when registered game is detected
1746
1795
  */
@@ -1788,3 +1837,98 @@ interface IOverwolfRecordingApi {
1788
1837
  */
1789
1838
  on(eventName: 'stats', listener: (args: RecorderStats) => void): this;
1790
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
+ // -----------------------------------------------------------------------------