@overwolf/ow-electron-packages-types 1.0.0-beta.4 → 1.0.0-beta.6

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 +188 -28
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overwolf/ow-electron-packages-types",
3
- "version": "1.0.0-beta.4",
3
+ "version": "1.0.0-beta.6",
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
@@ -1972,6 +1972,135 @@ interface AudioGeneralSettings {
1972
1972
  */
1973
1973
  lowLatencyAudioBuffering?: boolean;
1974
1974
  }
1975
+ /**
1976
+ * Defines the alignment options specifying a position by using [Vertical][Horizontal]
1977
+ * (e.g., 'TopLeft', 'Center', 'BottomRight'). Typically used for positioning
1978
+ * UI elements, popovers, or text blocks.
1979
+ */
1980
+ export declare type AlignmentOptions =
1981
+ | 'TopLeft'
1982
+ | 'TopCenter'
1983
+ | 'TopRight'
1984
+ | 'CenterLeft'
1985
+ | 'Center'
1986
+ | 'CenterRight'
1987
+ | 'BottomLeft'
1988
+ | 'BottomCenter'
1989
+ | 'BottomRight';
1990
+
1991
+ /**
1992
+ * Defines the type of bounding or scaling applied to an element's dimensions
1993
+ * within a container.
1994
+ *
1995
+ * Typically used to control how content (like an image or video)
1996
+ * is resized to fit or fill a specific area.
1997
+ */
1998
+ export declare type BoundsType =
1999
+ | 'None'
2000
+ | 'Stretch'
2001
+ | 'ScaleInner'
2002
+ | 'ScaleOuter'
2003
+ | 'ScaleToWidth'
2004
+ | 'ScaleToHeight'
2005
+ | 'MaxOnly';
2006
+
2007
+ /**
2008
+ * Options for transforming and positioning a source element (e.g. an image or video) within an output container or scene.
2009
+ *
2010
+ * Typically used to control how content is translated, scaled, rotated, aligned,
2011
+ * and cropped within a visual presentation area.
2012
+ */
2013
+ export interface SourceTransformOptions {
2014
+ /**
2015
+ * Position X in pixels. Default is 0.
2016
+ */
2017
+ positionX?: number;
2018
+
2019
+ /**
2020
+ * Position Y in pixels. Default is 0.
2021
+ */
2022
+ positionY?: number;
2023
+
2024
+ /**
2025
+ * Rotation in degrees (-360.0 to 360.0). Default is 0.
2026
+ */
2027
+ rotation?: number;
2028
+
2029
+ /**
2030
+ * Size Width in pixels.
2031
+ */
2032
+ sizeWidth?: number;
2033
+
2034
+ /**
2035
+ * Size Height in pixels.
2036
+ */
2037
+ sizeHeight?: number;
2038
+
2039
+ /**
2040
+ * Alignment of the source within the output.
2041
+ * The alignment is relative to the top-left corner of the output.
2042
+ *
2043
+ * Default is TopLeft.
2044
+ */
2045
+ alignment?: AlignmentOptions;
2046
+
2047
+ /**
2048
+ * Defines a bounding box for the source within the output.
2049
+ *
2050
+ * Changing the bounds type or alignment only has an effect
2051
+ * if a bounds width or height is specified.
2052
+ *
2053
+ * Type of bounds to apply.
2054
+ * Default is None.
2055
+ */
2056
+ boundsType?: BoundsType;
2057
+
2058
+ /**
2059
+ * Alignment of the source within the bounding box.
2060
+ *
2061
+ * Relevant only when bounds width or height are defined.
2062
+ * Default is Center.
2063
+ */
2064
+ boundsAlignment?: AlignmentOptions;
2065
+
2066
+ /**
2067
+ * Bounding box width in pixels.
2068
+ */
2069
+ boundsWidth?: number;
2070
+
2071
+ /**
2072
+ * Bounding box height in pixels.
2073
+ */
2074
+ boundsHeight?: number;
2075
+
2076
+ /**
2077
+ * Crop to bounds. Default is False.
2078
+ */
2079
+ cropToBounds?: boolean;
2080
+
2081
+ /**
2082
+ * Crop options in pixels. Default is no crop.
2083
+ */
2084
+ cropLeft?: number;
2085
+ cropRight?: number;
2086
+ cropTop?: number;
2087
+ cropBottom?: number;
2088
+ }
2089
+
2090
+ /**
2091
+ * Defines a complete transformation operation to be applied to a specific source element.
2092
+ *
2093
+ * Typically used on a target source by its name with the full set of
2094
+ * transformation and positioning properties it should adopt.
2095
+ */
2096
+ export interface SourceTransform {
2097
+ /**
2098
+ * Source name to update.
2099
+ */
2100
+ readonly sourceName: string;
2101
+
2102
+ readonly transform: SourceTransformOptions;
2103
+ }
1975
2104
 
1976
2105
  /**
1977
2106
  * Configuration settings for how a capture source is rendered in the output video.
@@ -1980,15 +2109,25 @@ interface AudioGeneralSettings {
1980
2109
  * content relative to the output resolution.
1981
2110
  */
1982
2111
  interface CaptureSourceSettings {
2112
+ /**
2113
+ * Unique Source name (for easier identification).
2114
+ */
2115
+ name?: string;
2116
+
1983
2117
  /**
1984
2118
  * Whether the capture source should be centered and stretched to fit the output video size.
1985
2119
  *
1986
2120
  * When set to `true`, the source will automatically scale and center itself to match
1987
2121
  * the output resolution, even if it requires stretching.
1988
2122
  *
1989
- * @default true
2123
+ * @default true (if transform is not provided).
1990
2124
  */
1991
2125
  stretchToOutputSize?: boolean;
2126
+
2127
+ /**
2128
+ * Transform options for the source.
2129
+ */
2130
+ transform?: SourceTransformOptions;
1992
2131
  }
1993
2132
 
1994
2133
  /**
@@ -2106,8 +2245,16 @@ interface WindowCaptureSourceSettings extends CaptureSourceSettings {
2106
2245
  * The name of the executable associated with the window to capture.
2107
2246
  *
2108
2247
  * This is typically the process name (e.g., `"notepad.exe"` or `"chrome.exe"`).
2248
+ *
2249
+ * Mandatory field when using Window Capture source.
2250
+ * Optional when using Browser Window source.
2251
+ */
2252
+ executable?: string;
2253
+
2254
+ /**
2255
+ * The window title, if multiple windows of the same executable exist.
2109
2256
  */
2110
- executable: string;
2257
+ windowTitle?: string;
2111
2258
 
2112
2259
  /**
2113
2260
  * The capture method used to record the window.
@@ -2165,6 +2312,13 @@ interface CaptureSource {
2165
2312
  * capture method, and more, depending on the selected source type.
2166
2313
  */
2167
2314
  readonly properties: any;
2315
+
2316
+ /**
2317
+ * Optional name for the capture source.
2318
+ *
2319
+ * Can be used later for setting transform properties.
2320
+ */
2321
+ readonly name?: string;
2168
2322
  }
2169
2323
 
2170
2324
  /**
@@ -2855,6 +3009,26 @@ interface CaptureSettingsBuilder extends CaptureSettings {
2855
3009
  */
2856
3010
  addGameSource(settings: GameCaptureSourceSettings): CaptureSettingsBuilder;
2857
3011
 
3012
+ /**
3013
+ * Add Window video capture source
3014
+ * settings. Executable is mandatory.
3015
+ * @param settings
3016
+ */
3017
+ addWindowSource(
3018
+ settings: WindowCaptureSourceSettings
3019
+ ): CaptureSettingsBuilder;
3020
+
3021
+ /**
3022
+ * Add Electron window capture source
3023
+ * settings. Executable is optional.
3024
+ * @param browserWindow
3025
+ * @param settings
3026
+ */
3027
+ addBrowserWindowSource(
3028
+ browserWindow: BrowserWindow,
3029
+ setting: WindowCaptureSourceSettings
3030
+ ): CaptureSettingsBuilder;
3031
+
2858
3032
  /**
2859
3033
  * Adds an audio device for capturing input or output audio.
2860
3034
  *
@@ -2996,9 +3170,6 @@ interface EncoderInformation {
2996
3170
  * const options: RecordingAppOptions = {
2997
3171
  * showDebugWindow: true,
2998
3172
  * enableDebugLogs: true,
2999
- * customCommandLineArgs: ['--multi-threading'],
3000
- * overrideOBSFolder: 'C:/custom/obs',
3001
- * statsInterval: 5000
3002
3173
  * };
3003
3174
  * ```
3004
3175
  */
@@ -3014,24 +3185,6 @@ interface RecordingAppOptions {
3014
3185
  * Can be used to troubleshoot issues during recording.
3015
3186
  */
3016
3187
  enableDebugLogs?: boolean;
3017
-
3018
- /**
3019
- * Additional command-line arguments to pass when launching the recorder.
3020
- * This can be used to customize the underlying OBS runtime behavior.
3021
- */
3022
- customCommandLineArgs?: string[];
3023
-
3024
- /**
3025
- * Specifies a custom folder path to override the default OBS binaries used by the recorder.
3026
- * Useful for testing with a modified or custom OBS build.
3027
- */
3028
- overrideOBSFolder?: string;
3029
-
3030
- /**
3031
- * Interval in milliseconds for emitting 'stats' events.
3032
- * Default is 2000 (2 seconds). Set to `0` to disable stats reporting.
3033
- */
3034
- statsInterval?: number;
3035
3188
  }
3036
3189
 
3037
3190
 
@@ -3734,7 +3887,6 @@ interface IOverwolfRecordingApi {
3734
3887
  * Registers games to monitor and track for launch/exit detection.
3735
3888
  *
3736
3889
  * @param filter Filtering rules for which games to track.
3737
- *
3738
3890
  */
3739
3891
  registerGames(filter: GamesFilter): void;
3740
3892
 
@@ -3745,9 +3897,17 @@ interface IOverwolfRecordingApi {
3745
3897
  * @see {@link AudioDeviceSettingsUpdateInfo}
3746
3898
  * @since 0.32.0
3747
3899
  */
3748
- updateAudioDevice(
3749
- device: AudioDeviceSettingsUpdateInfo
3750
- ): Promise<void>;
3900
+ updateAudioDevice(device: AudioDeviceSettingsUpdateInfo): Promise<void>;
3901
+
3902
+ /**
3903
+ * Set a source to transform.
3904
+ *
3905
+ * Defines how the source will be rendered (for example, position, scale, crop, etc.).
3906
+ * Throws an error if the source is not found or if the transform is invalid.
3907
+ *
3908
+ * @param sourceTransform
3909
+ */
3910
+ setSourceTransform(sourceTransform: SourceTransform): Promise<void>;
3751
3911
 
3752
3912
  /** @event Fired when a registered game is launched. */
3753
3913
  on(eventName: 'game-launched', listener: (gameInfo: GameInfo) => void): this;
@@ -3775,7 +3935,7 @@ interface IOverwolfRecordingApi {
3775
3935
 
3776
3936
  /**
3777
3937
  * @event Fired periodically with recorder performance metrics.
3778
- * Interval is configured via {@link RecordingAppOptions.statsInterval}.
3938
+ *
3779
3939
  */
3780
3940
  on(eventName: 'stats', listener: (args: RecorderStats) => void): this;
3781
3941
  }