forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unity-webapi.d.ts
100 lines (79 loc) · 2.38 KB
/
unity-webapi.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
// Type definitions for Ubuntu Unity Web API 1.0
// Project: https://launchpad.net/libunity-webapps
// Definitions by: John Vrbanac <https://github.com/jmvrbanac>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface External {
getUnityObject(version:number):Unity;
}
declare class UnitySettings {
public name:String;
public iconUrl:String;
public onInit:Function;
}
declare enum UnityPlaybackState {
Playing,
Paused
}
declare class UnityTrackMetadata {
title:String;
// Optionals
album:String;
artist:String;
artLocation:String;
}
interface UnityMediaPlayer {
setTrack(trackMetadata:UnityTrackMetadata);
onPrevious(onPreviousCallback:Function);
onNext(onNextCallback:Function);
onPlayPause(onPlayPauseCallback:Function);
getPlaybackstate(response:Function);
setPlaybackstate(state:UnityPlaybackState);
setCanGoNext(cangonext:Boolean);
setCanGoPrev(cangoprev:Boolean);
setCanPlay(canplay:Boolean);
setCanPause(canpause:Boolean);
}
interface UnityNotification {
showNotification (summary:String, body:String, iconUrl?:String);
}
declare class UnityIndicatorProperties {
public count:Number;
public time:Date;
public iconURI:String;
public onIndicatorActivated:Function;
}
interface UnityMessagingIndicator {
showIndicator(name:String, indicatorProperties:UnityIndicatorProperties);
clearIndicator(name:String);
clearIndicators();
addAction(name:String, onActionInvoked:Function);
removeAction(name:String);
removeActions();
onPresenceChanged(onPresenceChanged:Function);
// This is suppose to be readonly, but i'm not sure how to do this
// in a definition file.
presence:String;
}
interface UnityLauncher {
setCount(count:number);
clearCount();
setProgress(progress:number);
clearProgress();
setUrgent(urgent:Boolean);
addAction(name:String, onActionInvoked:Function);
removeAction(name:String);
removeActions();
}
interface Unity {
init(settings:UnitySettings);
addAction(name:String, callback:Function);
removeAction(actionName:String);
removeActions();
Notification:UnityNotification;
MediaPlayer:UnityMediaPlayer;
MessagingIndicator:UnityMessagingIndicator;
Launcher:UnityLauncher;
}
interface BrowserPublic {
getUnityObject(version:number):Unity;
}