forked from overwolf/types
-
Notifications
You must be signed in to change notification settings - Fork 0
/
overwolf.d.ts
5795 lines (5207 loc) · 158 KB
/
overwolf.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
declare namespace overwolf {
const version: string;
enum ResultStatusTypes {
Success = "success",
Error = "error"
}
interface Result {
/**
* Whether the method executed successfully or not.
*/
success: boolean;
/**
* Information regarding the error (if an error occured)
*/
error?: string;
}
interface Event<T> {
/**
* Registers a listener to an event. When the event occurs, all registered
* listeners are called.
* @param callback The callback function to call when the event occurs.
*/
addListener(callback: (event: T) => void): void;
/**
* Unregister a listener to an event.
* @param callback The callback should be the same function that was passed
* to addListener(). If an anonymous function was passed, it cannot be
* removed.
*/
removeListener(callback: (event: T) => void): void;
}
interface Dictionary<T> {
[key: string]: T;
}
type CallbackFunction<T extends Result> = (result: T) => void;
}
declare namespace overwolf.io {
namespace enums {
const enum eEncoding {
UTF8 = "UTF8",
UTF8BOM = "UTF8BOM",
Unicode = "Unicode",
UnicodeBOM = "UnicodeBOM",
ASCII = "ASCII"
}
}
interface ReadFileOptions {
encoding: enums.eEncoding;
maxBytesToRead: number;
offset: number;
}
interface ListenFileOptions {
skipToEnd: boolean;
}
interface FileExistsResult extends Result {
found?: boolean;
}
interface ReadFileContentsResult extends Result {
content?: string;
}
/**
* Checks for the existance of the file in the given path.
* @param filePath The path to check for.
* @param callback Returns with the result.
*/
function fileExists(
filePath: string,
callback: CallbackFunction<FileExistsResult>
): void;
/**
* Writes the content to the target file. If the file doesn't exist, it will
* be created, along with any needed directories along the path. Otherwise,
* the file's content will be overwritten.
* @param filePath The full path of the file to write to.
* @param content The content to write.
* @param encoding The encoding to use, see more at
* @param triggerUacIfRequired If additional permissions are required, allows
* the triggering of the Windows UAC dialog.
* @param callback Called with the status of the request.
*/
function writeFileContents(
filePath: string,
content: string,
encoding: enums.eEncoding,
triggerUacIfRequired: boolean,
callback: CallbackFunction<Result>
): void;
/**
* Read the content to the target file.
* @param filePath The full path of the file to write to.
* @param encoding The encoding to use, see more at
* @param callback Called with the status of the request and the file contect.
*/
function readFileContents(
filePath: string,
encoding: enums.eEncoding,
callback: CallbackFunction<ReadFileContentsResult>
): void;
/**
* Copy a file from the local extension directory to a destination on the
* localmachine.
* @param src a relative (to the root of your extension's folder) file path or
* a full overwolf-extension:// URI to the source file to be copied
* @param dst The destination path (including filename) to copy to.
* @param overrideFile true if you want an existing file to be overriden,
* false otherwise.
* @param reserved for future use.
* @param callback result callback.
*/
function copyFile(
src: string,
dst: string,
overrideFile: boolean,
reserved: boolean,
callback: CallbackFunction<Result>
): void;
/**
* Lists all files and folder in the target path.
* @param path The target path
* @param callback result callback.
*/
function dir(
path: string,
callback: CallbackFunction<Result>
): void;
/**
* Reads a file's contents and returns an array of byte values.
* This function is extremly slow! Use it only for small files.
* @param path The target path.
* @param options Describes the different options to read a file.
* @param callback result callback.
*/
function readBinaryFile(
path: string,
options: ReadFileOptions,
callback: CallbackFunction<Result>
): void;
/**
* Reads a file's contents and returns it as text.
* @param path The target path.
* @param options Describes the different options to read a file.
* @param callback result callback.
*/
function readTextFile(
path: string,
options: ReadFileOptions,
callback: CallbackFunction<Result>
): void;
/**
* Is path exist.
* @param path The target path.
* @param callback result callback.
*/
function exist(
path: string,
callback: CallbackFunction<Result>
): void;
/**
* Start listening on file.
* Stream a file (text files only), line-by-line, from the local filesystem.
* @param id listen Id.
* @param path The target path.
* @param options Describes the different options to listen to a file.
* @param callback result callback.
*/
function listenOnFile(
id: string,
path: string,
options: ListenFileOptions,
callback: CallbackFunction<Result>
): void;
/**
* Stop listening on file.
* Stop streaming a file that you previously passed when calling listenOnFile().
* There are no callbacks - as this will never fail (even if the stream doesn't exist).
* @param id listen Id.
*/
function stopFileListener(
id: string
): void;
}
declare namespace overwolf.media {
namespace enums {
/**
* Media type for the Media Event.
*/
const enum eMediaType {
Video = "Video",
Image = "Image"
}
}
interface RescaleParams {
width: number;
height: number;
}
interface CropParams {
x: number;
y: number;
width: number;
height: number;
}
interface MemoryScreenshotParams {
roundAwayFromZero: boolean;
rescale: RescaleParams;
crop: CropParams;
}
interface FileResult extends Result {
url?: string;
path?: string;
}
interface GetAppVideoCaptureFolderSizeResult extends Result {
totalVideosSizeMB?: number;
}
interface GetAppScreenCaptureFolderSizeResult extends Result {
screenCaptureSizeMB?: number;
}
interface ScreenshotTakenEvent {
url: string;
}
interface GifGenerationErrorEvent {
reason: string;
}
/**
* Takes a screenshot and calls the callback with the success status and the
* screenshot URL. The screenshot is saved to the screenshots folder.
* @param callback A function called after the screenshot was taken.
*/
function takeScreenshot(callback: CallbackFunction<FileResult>): void;
/**
* Takes a screenshot and calls the callback with the success status and the
* screenshot URL. The screenshot is saved to the screenshots folder.
* @param targetFolder Target screen shot folder path.
* @param callback A function called after the screenshot was taken.
*/
function takeScreenshot(
targetFolder: string,
callback: CallbackFunction<FileResult>
): void;
/**
* Takes a window screenshot and calls the callback with the success status
* and the screenshot URL. The screenshot is saved to the screenshots folder.
* @param windowHandle The window Name
* @param postMediaEvent set true to posr media event (onMediaEvent)
* @param targetFolder set target folder path to screen shot
* @param callback A function called after the screenshot was taken.
*/
function takeWindowsScreenshotByHandle(
windowHandle: number,
postMediaEvent: boolean,
targetFolder: string,
callback: CallbackFunction<FileResult>
): void;
/**
* Takes a window screenshot and calls the callback with the success status
* and the screenshot URL. The screenshot is saved to the screenshots folder.
* @param windowHandle The window Name
* @param postMediaEvent set true to posr media event (onMediaEvent)
* @param callback A function called after the screenshot was taken.
*/
function takeWindowsScreenshotByHandle(
windowHandle: number,
postMediaEvent: boolean,
callback: CallbackFunction<FileResult>
): void;
/**
* Takes a window screenshot and calls the callback with the success status
* and the screenshot URL. The screenshot is saved to the screenshots folder.
* @param windowName The window Name
* @param postMediaEvent set true to posr media event (onMediaEvent)
* @param targetFolder set target folder path to screen shot
* @param callback A function called after the screenshot was taken.
*/
function takeWindowsScreenshotByName(
windowName: string,
postMediaEvent: boolean,
targetFolder: string,
callback: CallbackFunction<FileResult>
): void;
/**
* Takes a window screenshot and calls the callback with the success status
* and the screenshot URL. The screenshot is saved to the screenshots folder.
* @param windowName The window Name
* @param postMediaEvent set true to posr media event (onMediaEvent)
* @param callback A function called after the screenshot was taken.
*/
function takeWindowsScreenshotByName(
windowName: string,
postMediaEvent: boolean,
callback: CallbackFunction<FileResult>
): void;
/**
* Takes a memory screenshot and calls the callback with the success status
* and the screenshot URL. The screenshot will only be placed in the memory
* and will not be saved to a file (better performance). Can only be used
* while in a game.
* @param screenshotParams A JSON containing the parameters of the screenshot.
* @param callback A function called after the screenshot was taken.
*/
function getScreenshotUrl(
screenshotParams: MemoryScreenshotParams,
callback: CallbackFunction<FileResult>
): void;
/**
* Opens the social network sharing console to allow the user to share a
* picture.
* @param image A URL or image object to be shared.
* @param description The description to be used when posting to social
* networks.
* @param callback A function called after the image was shared.
*/
function shareImage(
image: any,
description: string,
callback: CallbackFunction<Result>
): void;
/**
* Posts a media event for other apps to receive. The time info should be
* received in UTC format.
* @param mediaType The type of the event.
* @param jsonInfo A json with additional info about the event.
* @param callback A callback with the status if the call.
*/
function postMediaEvent(
mediaType: enums.eMediaType,
jsonInfo: any,
callback: CallbackFunction<Result>
): void;
/**
* Deletes all gifs created by this app with an option to keep the newest X
* GBs (use with care).
* @param keepNewestXGbs Keep the newest X GBs of gifs. Pass 0 to delete all
* gifs.
* @param callback A callback function which will be called with the status of
* the request.
*/
function deleteOldGifs(
keepNewestXGbs: number,
callback: CallbackFunction<Result>
): void;
/**
* Returns the total size of the gif files created by this app in gigabytes.
* @param callback A callback with the gifs size.
*/
function getGifsSize(callback: CallbackFunction<Result>): void;
/**
* Returns the total size of the video capture folder created by the app. This
* includes all video/thumbnail and other filesthat are under the apps video
* folder - which is locatedinside the configured Overwolf video capture
* folder. NOTE: this function can take a long time to return if the folder
* contains a large amount of files (on some computers) - therefore,try to
* reduce the amount of times you call it.
* @param callback A callback with the size in MB.
*/
function getAppVideoCaptureFolderSize(
callback: CallbackFunction<GetAppVideoCaptureFolderSizeResult>
): void;
/**
* Similar to |getAppVideoCaptureFolderSize| but looks at the appsscreen
* capture folder.
* @param callback A callback with the size in MB.
*/
function getAppScreenCaptureFolderSize(
callback: CallbackFunction<GetAppScreenCaptureFolderSizeResult>
): void;
/**
* Fired when a media event has been posted.
*/
const onMediaEvent: Event<any>;
/**
* Fired when a screenshot was taken.
*/
const onScreenshotTaken: Event<ScreenshotTakenEvent>;
/**
* Fired when there's an error with the gif generation buffer.
*/
const onGifGenerationError: Event<GifGenerationErrorEvent>;
}
declare namespace overwolf.media.audio {
type PlayState = "playing" | "stopped" | "paused";
interface CreateResult extends Result {
id?: string;
}
interface PlayStateChangedEvent {
id: string;
playback_state: PlayState;
}
/**
* Creates an audio file from local path, extension local path or a remote
* Url.
* @param url The path of a local audio file, a url to a remote one or an
* extension url (overwolf-extension://app-id/file). Notice that if the url
* doesn't contain a file extension, mp3 will be assumed as the extension.
* @param callback A callback function which will be called with the ID of the
* created audio file.
*/
function create(url: string, callback: CallbackFunction<CreateResult>): void;
/**
* Plays the audio file matching the supplied ID.
* @param id The ID of the audio file to be played.
* @param callback A callback function which will be called with the status of
* the play request.
*/
function play(id: string, callback: CallbackFunction<Result>): void;
/**
* Stops the playback.
* @param callback A callback function which will be called with the status of
* the stop request.
*/
function stop(callback: CallbackFunction<Result>): void;
/**
* Stops the playback.
* @param id The ID of the audio file.
* @param callback A callback function which will be called with the status of
* the stop request.
*/
function stopById(id: string, callback: CallbackFunction<Result>): void;
/**
* Pauses the playback.
* @param callback A callback function which will be called with the status of
* the pause request.
*/
function pause(callback: CallbackFunction<Result>): void;
/**
* Pauses the playback of a specific sound.
* @param id The ID of the audio file.
* @param callback A callback function which will be called with the status of
* the pause request.
*/
function pauseById(id: string, callback: CallbackFunction<Result>): void;
/**
* Resumes the playback.
* @param callback A callback function which will be called with the status of
* the resume request.
*/
function resume(callback: CallbackFunction<Result>): void;
/**
* Resumes the playback of a specific file.
* @param id The ID of the audio file.
* @param callback A callback function which will be called with the status of
* the resume request.
*/
function resumeById(id: string, callback: CallbackFunction<Result>): void;
/**
* Sets the playback volume.
* @param volume The desired volume. The volume range is 0 - 100 where a
* volume of 0 means mute.
* @param callback A callback function which will be called with the status of
* the stop request.
*/
function setVolume(volume: number, callback: CallbackFunction<Result>): void;
/**
* Sets the playback volume of a specific file.
* @param id The ID of the audio file.
* @param volume The desired volume. The volume range is 0 - 100 where a
* volume of 0 means mute.
* @param callback A callback function which will be called with the status of
* the stop request.
*/
function setVolumeById(
id: string,
volume: number,
callback: CallbackFunction<Result>
): void;
/**
* Fired when the state of the playback is changed.
*/
const onPlayStateChanged: Event<PlayStateChangedEvent>;
}
declare namespace overwolf.media.videos {
interface VideoCompositionSegment {
startTime: number;
endTime: number;
}
interface GetVideosResult extends Result {
videos?: string[];
}
interface GetVideosSizeResult extends Result {
totalSizeGbs?: number;
}
/**
* Creates a compilation video out of a source video and a list of segments.
* @param sourceVideoUrl The url of the source video in an overwolf://media
* form.
* @param segments A JSON containing a list of segments, each segment has a
* start time and an end time in milliseconds. The segments must be sorted in
* acsending order. Example:
* {
* "segments": [
* { "startTime": 2000, "endTime": 4000 },
* { "startTime": 8000, "endTime": 10000 },
* { "startTime": 14000, "endTime": 18000 }
* ]
* }
* @param callback A callback function which will be called with the status of
* the request and the url to the target video.
*/
function createVideoComposition(
sourceVideoUrl: string,
segments: { segments: VideoCompositionSegment[] },
callback: CallbackFunction<FileResult>
): void;
/**
* Creates a compilation video out of a source video and a list of segments.
* @param files list of files to ccomposit to output video file
* (overwolf://media form. or file:///)
* @param outputFile the file output name
* @param callback A callback function which will be called with the status of
* the request and the url to the target video.
*/
function createVideoCompositionFiles(
files: string[],
outputFile: string,
callback: CallbackFunction<FileResult>
): void;
/**
* Gets a list of all of the videos created by this app.
* @param callback A callback function which will be called with the status of
* the request.
*/
function getVideos(callback: CallbackFunction<GetVideosResult>): void;
/**
* Returns the total size of the video files created by this app in gigabytes.
* @param callback A callback with the videos size.
*/
function getVideosSize(callback: CallbackFunction<GetVideosSizeResult>): void;
/**
* Deletes all videos created by this app with an option to keep the newest X
* GBs (use with care).
* @param keepNewestXGbs Keep the newest X GBs of videos. Pass 0 to delete all
* videos.
* @param callback A callback function which will be called with the status of
* the request.
*/
function deleteOldVideos(
keepNewestXGbs: number,
callback: CallbackFunction<Result>
): void;
/**
* Deletes a specific video created by this app.
* @param videoUrl The Overwolf URL of the video to delete.
* @param callback A callback function which will be called with the status of
* the request.
*/
function deleteVideo(
videoUrl: string,
callback: CallbackFunction<Result>
): void;
}
declare namespace overwolf.media.replays {
namespace enums {
const enum ReplayType {
Video = "Video",
Gif = "Gif"
}
}
/**
* Replays settings container.
*/
interface ReplaySettings extends streaming.StreamSettings {
/**
* Auto highlights configuration.
*/
highlights: ReplayHighlightsSetting;
}
/**
* Auto highlights settings.
*/
interface ReplayHighlightsSetting {
/**
* Enable auto Highlights recording.
*/
enable: boolean;
/**
* Array of requested highlights.
* use ["*"] to register all features.
*/
requiredHighlights: string[];
}
interface TurnOffResult extends Result {
description?: string;
metadata?: string;
osVersion?: string;
osBuild?: string;
}
interface TurnOnResult extends Result {
description?: string;
metadata?: string;
mediaFolder?: string;
osVersion?: string;
osBuild?: string;
}
interface GetHighlightsFeaturesResult extends Result {
features?: string[];
}
interface GetStateResult extends Result {
isOn?: boolean;
}
interface ReplayResult extends Result {
url?: string;
path?: string;
encodedPath?: string;
duration?: number;
thumbnail_url?: string;
thumbnail_path?: string;
thumbnail_encoded_path?: string;
start_time?: number;
}
interface CaptureErrorEvent {
error: string;
reason: string;
additionalInfo: string;
}
interface CaptureStoppedEvent {
status: string;
reason: string;
metaData: string;
osVersion: string;
osBuild: string;
}
interface CaptureWarningEvent {
warning: string;
reason: string;
}
interface ReplayServicesStartedEvent {
extensions: string[];
}
interface HighlightsCapturedEvent {
game_id: number;
match_id: string;
match_internal_id: string;
session_id: string;
session_start_time: string;
match_start_time: string;
start_time: string;
duration: string;
events: string[];
raw_events: raw_events[];
media_url: string;
media_path_encoded: string;
thumbnail_url: string;
thumbnail_encoded_path: string;
replay_video_start_time: number;
}
interface raw_events {
type:string;
time:number;
}
/**
* Turns off background replay capturing. Call this as soon as you no longer
* interesting in capturing, in order to free up resources.
* @param callback A callback function which will be called with the status of
* the request.
*/
function turnOff(callback: CallbackFunction<TurnOffResult>): void;
/**
* Turns on background replay capturing. Without calling it first, you will
* not be able to create video replays. Notice that turning on replay
* capturing will consume system resources so use it wisely.buffer_length
* defines the amount of time in milliseconds to have captured in the memory
* at all times.
* @param settings The video capture settings.
* @param callback A callback function which will be called with the status of
* the request.
*/
function turnOn(
settings: ReplaySettings,
callback: CallbackFunction<TurnOnResult>
): void;
/**
* Returns whether replay capturing is turned on or off.
* @param callback A callback function which will be called with the status of
* the request.
*/
function getState(callback: CallbackFunction<GetStateResult>): void;
/**
* Returns whether replay capturing is turned on or off.
* @param replayType The type of replay to get state for.
* @param callback A callback function which will be called with the status of
* the request.
*/
function getState(
replayType: replays.enums.ReplayType,
callback: CallbackFunction<GetStateResult>
): void;
/**
* Starts capturing a replay to a file. A replay id will be returned in the
* callback which is needed to finish capturing the replay. You can only call
* this method if replay mode is on and no other replay is currently being
* captured to a file.
* @param pastDuration The replay lengh, in milliseconds to include prior to
* the time of this call.
* @param futureDuration The replay lengh, in milliseconds to include after
* the time of this call. To ignore it, simply give it a non-positive value
* @param captureFinishedCallback A callback function which will be called
* when capturing is finished, at the end of the future duration supplied to
* this call.
* @param callback A callback function which will be called with the status of
* the request.
*/
function capture(
pastDuration: number,
futureDuration: number,
captureFinishedCallback: CallbackFunction<ReplayResult>,
callback: CallbackFunction<Result>
): void;
/**
* Starts capturing a replay to a file. A replay id will be returned in the
* callback which is needed to finish capturing the replay. You can only call
* this method if replay mode is on and no other replay is currently being
* captured to a file.
* @param replayType The type of replay to capture.
* @param pastDuration The replay lengh, in milliseconds to include prior to
* the time of this call.
* @param futureDuration The replay lengh, in milliseconds to include after
* the time of this call. To ignore it, simply give it a non-positive value
* @param captureFinishedCallback A callback function which will be called
* when capturing is finished, at the end of the future duration supplied to
* this call.
* @param callback A callback function which will be called with the status of
* the request.
*/
function capture(
replayType: replays.enums.ReplayType,
pastDuration: number,
futureDuration: number,
captureFinishedCallback: CallbackFunction<ReplayResult>,
callback: CallbackFunction<Result>
): void;
/**
* Starts capturing a replay to a file. A replay id will be returned in the
* callback which is needed to finish capturing the replay. You can only call
* this method if replay mode is on and no other replay is currently being
* captured to a file.
* @param pastDuration The video lengh, in milliseconds to include prior to
* the time of this call.
* @param callback A callback function which will be called with the status of
* the request.
*/
function startCapture(
pastDuration: number,
callback: CallbackFunction<FileResult>
): void;
/**
* Starts capturing a replay to a file. A replay id will be returned in the
* callback which is needed to finish capturing the replay. You can only call
* this method if replay mode is on and no other replay is currently being
* captured to a file.
* @param replayType The type of replay to capture.
* @param pastDuration The video lengh, in milliseconds to include prior to
* the time of this call.
* @param callback A callback function which will be called with the status of
* the request.
*/
function startCapture(
replayType: replays.enums.ReplayType,
pastDuration: number,
callback: CallbackFunction<FileResult>
): void;
/**
* Finishes capturing a replay and returns a url to the created video file.
* You can only call this method if replay mode is on and using a valid id of
* a replay being captured to a file.
* @param replayId The id of the replay you want to finish capturing.
* @param callback A callback function which will be called with the status of
* the request.
*/
function stopCapture(
replayId: string,
callback: CallbackFunction<ReplayResult>
): void;
/**
* Finishes capturing a replay and returns a url to the created video file.
* You can only call this method if replay mode is on and using a valid id of
* a replay being captured to a file.
* @param replayType The type of replay to stop capture.
* @param replayId The id of the replay you want to finish capturing.
* @param callback A callback function which will be called with the status of
* the request.
*/
function stopCapture(
replayType: replays.enums.ReplayType,
replayId: string,
callback: CallbackFunction<FileResult>
): void;
/**
* change target sub folder of current running replay provider
* @param replayType The type of replay to stop capture.
* @param subFolderName the new sub folder name
* @param callback A callback function which will be called with the status of
* the request.
*/
function setReplaysSubFolder(
replayType: replays.enums.ReplayType,
subFolderName: string,
callback: CallbackFunction<Result>
): void;
/**
* Get supported auto highlights features for a game
* @param gameId The id of the game you want to capture it highlights.
* @param callback A callback function which will be called with the status of
* the request.
*/
function getHighlightsFeatures(
gameId: number,
callback: CallbackFunction<GetHighlightsFeaturesResult>
): void;
/**
* Fired when an error has occurred with the capturing.
*/
const onCaptureError: Event<CaptureErrorEvent>;
/**
* Fired when replay service is stopped.
*/
const onCaptureStopped: Event<CaptureStoppedEvent>;
/**
* Fired on capture service warning.
*/
const onCaptureWarning: Event<CaptureWarningEvent>;
/**
* Fired when an replay serive is on (any other app);
*/
const onReplayServicesStarted: Event<ReplayServicesStartedEvent>;
/**
* Fired when a new Replay highlight recorded (when highlightsSetting is enabled).
*/
const onHighlightsCaptured: Event<HighlightsCapturedEvent>;
}
declare namespace overwolf.profile {
const enum ConnectionState {
Unknown = "Unknown",
Offline = "Offline",
Connecting = "Connecting",
Online = "Online",
Disconnecting = "Disconnecting"
}
interface GetCurrentUserResult extends Result {
avatar?: string;
channel?: string;
machineId?: string;
partnerId?: number;
userId?: string;
username?: string;
parameters?: Dictionary<string>;
installParams?: any;
}
interface LoginStateChangedEvent {
status: string;
connectionState: ConnectionState;
username: string;
}
/**
* Calls the given callback with the currently logged-in Overwolf user.
* @param callback A function called with the current user, or an error.
*/
function getCurrentUser(
callback: CallbackFunction<GetCurrentUserResult>
): void;
/**
* Opens the login dialog.
*/
function openLoginDialog(): void;
/**
* Fired when a user logged in or logged out.
*/
const onLoginStateChanged: Event<LoginStateChangedEvent>;
}
declare namespace overwolf.profile.subscriptions {
const enum eState {
Active = 0,
Cancelled = 1,
Revoked = 2
}
interface Info {
title: string;
description: string;
periodMonths: number;
price: number;
}
interface Subscription {
id: number;
pid: number;
uid: string;
extid: string;
muid: string;
exp: number;
grc: number;
state: eState;
planInfo: Info;
expired: boolean;