@overwolf/ow-electron-packages-types 0.0.9 → 0.1.0-beta.3

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.
package/package.json CHANGED
@@ -1,23 +1,29 @@
1
- {
2
- "name": "@overwolf/ow-electron-packages-types",
3
- "version": "0.0.9",
4
- "description": "Type definition file for autocompletion and documentation purposes for ow-electron packages",
5
- "license": "MIT",
6
- "types": "overlay.d.ts",
7
- "keywords": [
8
- "types",
9
- "npm",
10
- "package",
11
- "overwolf",
12
- "ow-electron",
13
- "overlay",
14
- "game-list"
15
- ],
16
- "devDependencies": {
17
- "@overwolf/ow-electron": "^22.3.3"
18
- },
19
- "repository": {
20
- "type": "git",
21
- "url": "https://github.com/overwolf/ow-electron-packages-types"
22
- }
23
- }
1
+ {
2
+ "name": "@overwolf/ow-electron-packages-types",
3
+ "version": "0.1.0-beta.3",
4
+ "description": "Type definition file for autocompletion and documentation purposes for ow-electron packages",
5
+ "license": "MIT",
6
+ "types": "types.d.ts",
7
+ "keywords": [
8
+ "types",
9
+ "npm",
10
+ "package",
11
+ "overwolf",
12
+ "ow-electron",
13
+ "overlay",
14
+ "game-list"
15
+ ],
16
+ "devDependencies": {
17
+ "@overwolf/ow-electron": "latest"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "https://github.com/overwolf/ow-electron-packages-types"
22
+ },
23
+ "exports": {
24
+ ".": "./types.d.ts"
25
+ },
26
+ "publishConfig": {
27
+ "tag": "beta"
28
+ }
29
+ }
@@ -0,0 +1,2 @@
1
+ export * from './recording-api.interface'
2
+ export * from './recording-api.types'
@@ -0,0 +1,195 @@
1
+ import { GamesFilter, GameInfo } from '../common';
2
+ import {
3
+ ActiveReplay,
4
+ CaptureReplayOptions,
5
+ CaptureSettings,
6
+ CaptureSettingsBuilder,
7
+ CaptureSettingsOptions,
8
+ RecorderStats,
9
+ RecordingAppOptions,
10
+ RecordingInformation,
11
+ RecordingOptions,
12
+ ReplayCallback,
13
+ ReplayOptions,
14
+ ReplayStopCallback,
15
+ SplitCallback,
16
+ StartCallback,
17
+ StopCallback,
18
+ } from './recording-api.types';
19
+
20
+ export interface IOverwolfRecordingApi {
21
+ /**
22
+ * Set Global options (For Debugging)
23
+ */
24
+ options: RecordingAppOptions;
25
+
26
+ /**
27
+ * Is recording or replays active
28
+ */
29
+ isActive(): Promise<boolean>;
30
+
31
+ /**
32
+ * Query System information.
33
+ *
34
+ * (Supported encoder, available audio\video devices, available setting with descriptions)
35
+ */
36
+ queryInformation(): Promise<RecordingInformation>;
37
+
38
+ /**
39
+ * Setting builder class, helps to create CaptureSettings object
40
+ * @param options
41
+ */
42
+ createSettingsBuilder(
43
+ options?: CaptureSettingsOptions
44
+ ): Promise<CaptureSettingsBuilder>;
45
+
46
+ /**
47
+ * Starts video recording.
48
+ *
49
+ * A 'recording-started' event is triggered when recording starts.
50
+ * Note: If recording fails to start, an exception (RecorderError) will be thrown.
51
+ *
52
+ * when the recording stopped to due error or game-exit, or stopRecording() call,
53
+ * 'recording-stopped' event is trigged with the details.
54
+ *
55
+ * @param options - The options for the recording.
56
+ * @param setting - Optional. Capture settings if the replay service is already running.
57
+ * @param listener - Optional. Callback for handling recording stopped event (same as 'recording-stopped' event) .
58
+ * @returns A promise that resolves when recording has started.
59
+ */
60
+ startRecording(
61
+ options: RecordingOptions,
62
+ setting?: CaptureSettings,
63
+ listener?: StopCallback
64
+ ): Promise<void>;
65
+
66
+ /**
67
+ * Stop active recording
68
+ * @param listener Optional. Callback for handling recording stopped event (same as 'recording-stopped' event). this will override the listener set in the startRecording (if was set).
69
+ */
70
+ stopRecording(listener?: StopCallback): Promise<void>;
71
+
72
+ /**
73
+ * Split active recording video (if split option was enabled at 'RecordingOptions').
74
+ * 'recording-split' is fired once the video split.
75
+ *
76
+ * ```
77
+ * try {
78
+ * await splitRecording(...);
79
+ * } catch(err) {
80
+ * if (error instanceof RecorderError) {... }
81
+ * }
82
+ *
83
+ * ```
84
+ * @param listener (optional) callback when video split.
85
+ */
86
+ splitRecording(listener?: SplitCallback): Promise<void>;
87
+
88
+ /**
89
+ * Starts replay's recording.
90
+ *
91
+ * A 'replays-started' event is triggered when recording starts.
92
+ *
93
+ * Note: If recording fails to start, an exception (RecorderError) will be thrown.
94
+ * ```
95
+ * try {
96
+ * await startReplays(...);
97
+ * } catch(err) {
98
+ * if (error instanceof RecorderError) {... }
99
+ * }
100
+ *
101
+ * ```
102
+ * @param options - The options for the replays.
103
+ * @param setting - Optional. Capture settings if the replay service is already running.
104
+ * @returns A promise that resolves when recording has started.
105
+ */
106
+ startReplays(
107
+ options: ReplayOptions,
108
+ setting?: CaptureSettings
109
+ ): Promise<void>;
110
+
111
+ /**
112
+ * Stop Replays service
113
+ *
114
+ * A 'replays-stopped' event is triggered when replays service stopped .
115
+ *
116
+ * Note: an exception (RecorderError) will be thrown, if the stop command fails
117
+ *
118
+ * * ```
119
+ * try {
120
+ * await stopReplays(...);
121
+ * } catch(err) {
122
+ * if (error instanceof RecorderError) {... }
123
+ * }
124
+ *
125
+ * ```
126
+ *
127
+ * (for example, replay's service is not active)
128
+ */
129
+ stopReplays(): Promise<void>;
130
+
131
+ /**
132
+ * Capture Replay.
133
+ * 'ActiveReplay' object to control replay (stop and such...)
134
+ * Note: an exception (RecorderError) will be thrown, if the stop command fails
135
+ * @param option
136
+ * @param callback (optional) called when replay is ready in addition to 'replay-ready' event.
137
+ */
138
+ captureReplay(
139
+ option: CaptureReplayOptions,
140
+ callback?: ReplayCallback
141
+ ): Promise<ActiveReplay>;
142
+
143
+ /**
144
+ * Game launch registration
145
+ * register to track running game, witch triggers 'game-launched' and 'game-exit' events.
146
+ */
147
+ registerGames(filter: GamesFilter);
148
+
149
+ /**
150
+ * Fired when registered game is detected
151
+ */
152
+ on(eventName: 'game-launched', listener: (gameInfo: GameInfo) => void): this;
153
+
154
+ /**
155
+ * Fired on registered game process terminated.
156
+ */
157
+ on(eventName: 'game-exit', listener: (gameInfo: GameInfo) => void): this;
158
+
159
+ /**
160
+ * Fired on video recording started
161
+ */
162
+ on(eventName: 'recording-started', listener: StartCallback): this;
163
+
164
+ /**
165
+ * Fired on video recording stopped
166
+ */
167
+ on(eventName: 'recording-stopped', listener: StopCallback): this;
168
+
169
+ /**
170
+ * Fired on recording video split (manual/size/time)
171
+ */
172
+ on(eventName: 'recording-split', listener: SplitCallback): this;
173
+
174
+ /**
175
+ * Fired on replays record started
176
+ */
177
+ on(eventName: 'replays-started', listener: StartCallback): this;
178
+
179
+ /**
180
+ * Fired on replays record stopped
181
+ */
182
+ on(eventName: 'replays-stopped', listener: ReplayStopCallback): this;
183
+
184
+ /**
185
+ * Fired on replay video was captured
186
+ */
187
+ on(eventName: 'replay-captured', listener: ReplayCallback): this;
188
+
189
+ /**
190
+ * Fired every |statsIntervalMS| (RecordingAppOptions) interval
191
+ * @param eventName
192
+ * @param listener
193
+ */
194
+ on(eventName: 'stats', listener: (args: RecorderStats) => void): this;
195
+ }