@maestro_io/maestro-web-sdk 1.0.0 → 2.0.1
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/dist/MaestroEventDelegate.d.ts +9 -0
- package/dist/components/atoms/BaseButton/BaseButton.d.ts +9 -0
- package/dist/components/atoms/BaseButton/index.d.ts +2 -0
- package/dist/components/atoms/Image/index.d.ts +9 -0
- package/dist/components/atoms/SvgIcon/BetsIcon.d.ts +7 -0
- package/dist/components/atoms/SvgIcon/FantasyIcon.d.ts +6 -0
- package/dist/components/atoms/SvgIcon/Icon.d.ts +28 -0
- package/dist/components/atoms/SvgIcon/KeyPlaysIcon.d.ts +6 -0
- package/dist/components/atoms/SvgIcon/PlayIcon.d.ts +6 -0
- package/dist/components/atoms/SvgIcon/StatsIcon.d.ts +6 -0
- package/dist/components/atoms/SvgIcon/WarningIcon.d.ts +6 -0
- package/dist/components/atoms/SvgIcon/index.d.ts +2 -0
- package/dist/components/core/App/App.d.ts +10 -0
- package/dist/components/core/App/index.d.ts +2 -0
- package/dist/components/core/PanelManager/PanelManager.d.ts +14 -0
- package/dist/components/core/PanelManager/index.d.ts +2 -0
- package/dist/components/molecules/ActionButton/ActionButton.d.ts +50 -0
- package/dist/components/molecules/ActionButton/index.d.ts +2 -0
- package/dist/components/molecules/PanelNavButton/PanelNavButton.d.ts +107 -0
- package/dist/components/molecules/PanelNavButton/index.d.ts +2 -0
- package/dist/components/molecules/ScrollableGradient/ScrollableGradient.d.ts +11 -0
- package/dist/components/molecules/ScrollableGradient/index.d.ts +2 -0
- package/dist/components/molecules/SegmentButton/SegmentButton.d.ts +10 -0
- package/dist/components/molecules/SegmentButton/index.d.ts +2 -0
- package/dist/components/molecules/WatchButton/WatchButton.d.ts +10 -0
- package/dist/components/molecules/WatchButton/index.d.ts +2 -0
- package/dist/components/organisms/PanelNavigation/PanelNavigation.d.ts +15 -0
- package/dist/components/organisms/PanelNavigation/index.d.ts +2 -0
- package/dist/components/organisms/SegmentController/SegmentController.d.ts +14 -0
- package/dist/components/organisms/SegmentController/index.d.ts +2 -0
- package/dist/external/AxiosNetworkClient.d.ts +15 -0
- package/dist/external/LocalStorageCacheManager.d.ts +10 -0
- package/dist/external/ReactRenderer.d.ts +26 -0
- package/dist/external/ports/cacheManager.d.ts +15 -0
- package/dist/external/ports/networkClient.d.ts +5 -0
- package/dist/external/ports/renderer.d.ts +9 -0
- package/dist/external/spatial-navigation/index.d.ts +5 -0
- package/dist/external/spatial-navigation/measureLayout.d.ts +2 -0
- package/dist/external/spatial-navigation/spatialNavigation.d.ts +166 -0
- package/dist/external/spatial-navigation/utils.d.ts +15 -0
- package/dist/external/spatial-navigation/visualDebugger.d.ts +17 -0
- package/dist/external/spatial-navigation/withFocusable.d.ts +81 -0
- package/dist/helpers/Observable.d.ts +12 -0
- package/dist/helpers/deliver-focus.d.ts +5 -0
- package/dist/helpers/withRemoteControl.d.ts +47 -0
- package/dist/index.d.ts +60 -382
- package/dist/interfaces/IMaestroEvent.d.ts +62 -0
- package/dist/interfaces/IMaestroEventDelegate.d.ts +18 -0
- package/dist/interfaces/IMaestroManager.d.ts +82 -0
- package/dist/maestro-web-sdk.umd.js +2 -3
- package/dist/maestro-web-sdk.umd.js.map +1 -1
- package/dist/models/IModel.d.ts +7 -0
- package/dist/models/IPanel.d.ts +20 -0
- package/dist/models/ITheme.d.ts +77 -0
- package/dist/modules/key-plays/constants.d.ts +3 -0
- package/dist/modules/key-plays/interfaces/IKeyPlays.d.ts +31 -0
- package/dist/modules/key-plays/interfaces/IKeyPlaysResponse.d.ts +44 -0
- package/dist/modules/key-plays/view/KeyPlayCardScoreTagView.d.ts +9 -0
- package/dist/modules/key-plays/view/KeyPlayCardView.d.ts +115 -0
- package/dist/modules/key-plays/view/KeyPlayErrorStateView.d.ts +11 -0
- package/dist/modules/key-plays/view/KeyPlaysView.d.ts +53 -0
- package/dist/modules/key-plays/view-model/KeyPlaysViewModel.d.ts +29 -0
- package/dist/services/NetworkManager.d.ts +13 -0
- package/dist/services/ThemeManager/constants.d.ts +2 -0
- package/dist/view-models/MaestroEventViewModel.d.ts +37 -0
- package/dist/view-models/PanelManagerViewModel.d.ts +18 -0
- package/dist/view-models/ViewModel.d.ts +12 -0
- package/dist/view-models/index.d.ts +17 -0
- package/package.json +64 -36
- package/dist/BetsIcon-UrnN4lvP.js +0 -22
- package/dist/BetsIcon-UrnN4lvP.js.map +0 -1
- package/dist/FantasyIcon-DmloKsq_.js +0 -24
- package/dist/FantasyIcon-DmloKsq_.js.map +0 -1
- package/dist/KeyPlayErrorStateView-Dk89rtUq.js +0 -112
- package/dist/KeyPlayErrorStateView-Dk89rtUq.js.map +0 -1
- package/dist/KeyPlaysIcon-Br9gu_Zu.js +0 -24
- package/dist/KeyPlaysIcon-Br9gu_Zu.js.map +0 -1
- package/dist/KeyPlaysView-Br-88ytG.js +0 -174
- package/dist/KeyPlaysView-Br-88ytG.js.map +0 -1
- package/dist/PlayIcon-CNKWNaLP.js +0 -24
- package/dist/PlayIcon-CNKWNaLP.js.map +0 -1
- package/dist/StatsIcon-Ds4hriWX.js +0 -25
- package/dist/StatsIcon-Ds4hriWX.js.map +0 -1
- package/dist/WarningIcon-BuzZKL26.js +0 -24
- package/dist/WarningIcon-BuzZKL26.js.map +0 -1
- package/dist/index-BaSckwps.js +0 -2998
- package/dist/index-BaSckwps.js.map +0 -1
- package/dist/index-DXErYNZH.js +0 -151
- package/dist/index-DXErYNZH.js.map +0 -1
- package/dist/index-q5GKgbOd.js +0 -56
- package/dist/index-q5GKgbOd.js.map +0 -1
- package/dist/maestro-web-sdk.esm.js +0 -6
- package/dist/maestro-web-sdk.esm.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,382 +1,60 @@
|
|
|
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
|
-
getLastPlayedClipIndex(): number | null;
|
|
63
|
-
/**
|
|
64
|
-
* @description Retrieves the progress (between 0 and 1) of the currently-played key play clip.
|
|
65
|
-
*/
|
|
66
|
-
getCurrentClipPlaybackProgress(): number | null;
|
|
67
|
-
/**
|
|
68
|
-
* @description Retrieves the number of key plays.
|
|
69
|
-
*/
|
|
70
|
-
getKeyPlaysCount(): number | null;
|
|
71
|
-
/**
|
|
72
|
-
* @description Tells the SDK to start managing focus.
|
|
73
|
-
*/
|
|
74
|
-
startFocusManagement(): Promise<void>;
|
|
75
|
-
/**
|
|
76
|
-
* @description Feeds the SDK new key plays data. A null value indicates a failure to retrieve the data.
|
|
77
|
-
*/
|
|
78
|
-
updateKeyPlaysData(data: IMaestroKeyPlaysResponse | null): Promise<void>;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* @description Interface for the client app to implement in order to handle Maestro TV SDK events.
|
|
83
|
-
*/
|
|
84
|
-
export declare interface IMaestroEventDelegate {
|
|
85
|
-
/**
|
|
86
|
-
* @description Allows the SDK to tell the client app that the user has encountered an error screen for lack of valid key
|
|
87
|
-
plays data, indicating the client app should call `updateKeyPlaysData` as soon as possible.
|
|
88
|
-
*/
|
|
89
|
-
userRequestedNewKeyPlaysData(): Promise<void>;
|
|
90
|
-
/**
|
|
91
|
-
* Allows the SDK to request the client app play a particular key plays clip, given its array index in the key plays list. Note that the `MaestroKeyPlaysResponse` subdivides the key plays by section, so the `index` referenced here assumes the client app has access to a flattened list of the key plays, disregarding the sectional subdivisions.
|
|
92
|
-
*/
|
|
93
|
-
playClip(atIndex: number): void;
|
|
94
|
-
/**
|
|
95
|
-
* @description SDK can notify the client app when its time to handle the focus management
|
|
96
|
-
*/
|
|
97
|
-
startFocusManagement(): Promise<void>;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export declare interface IMaestroKeyPlaysResponse {
|
|
101
|
-
entities: {
|
|
102
|
-
team: Record<TeamId, IMaestroKeyPlaysTeam>;
|
|
103
|
-
athlete: Record<AthleteId, MaestroKeyPlaysAthlete>;
|
|
104
|
-
};
|
|
105
|
-
sections: MaestroKeyPlaysSection[];
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
declare interface IMaestroKeyPlaysTeam {
|
|
109
|
-
id: string;
|
|
110
|
-
displayName: string;
|
|
111
|
-
shortName: string;
|
|
112
|
-
color: string;
|
|
113
|
-
alternateColor: string;
|
|
114
|
-
homeAway: string;
|
|
115
|
-
displayOrder: string;
|
|
116
|
-
logoRef: string;
|
|
117
|
-
logoDarkRef: string;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
This is the MaestroKit top-level API for initializing and configuring the framework. It encompasses all functionality that is not specific to an event.
|
|
122
|
-
*/
|
|
123
|
-
declare interface IMaestroManager {
|
|
124
|
-
/**
|
|
125
|
-
* @description Configure the MaestroWebSDK.
|
|
126
|
-
* @param {SDKConfigParams} configParams - Configuration parameters
|
|
127
|
-
* @param {SDKConfigParams['environment']} configParams.environment - The type of environment to use. Defaults to 'development'.
|
|
128
|
-
* @param {SDKConfigParams['pollFrequency']} configParams.pollFrequency - The frequency in seconds to poll for updates. Defaults to 5.0.
|
|
129
|
-
* @param {SDKConfigParams['progressUpdateFrequency']} configParams.progressUpdateFrequency - The frequency in seconds to update progress. Defaults to 0.1.
|
|
130
|
-
* @param {SDKConfigParams['siteID']} configParams.siteID - The site ID to use for the SDK.
|
|
131
|
-
* @param {SDKConfigParams['jwt']} configParams.jwt - The JWT token to use for authentication.
|
|
132
|
-
* @param {SDKConfigParams['userID']} configParams.userID - The user ID of the logged account.
|
|
133
|
-
*/
|
|
134
|
-
configure(configParams: SDKConfigParams): void;
|
|
135
|
-
/**
|
|
136
|
-
Tells the SDK the user has opened an event in the app's player.
|
|
137
|
-
Arguments:
|
|
138
|
-
- eventID: The Event ID for the event opened in the player.
|
|
139
|
-
- delegate: an instance of the app's implementation of IMaestroEventDelegate
|
|
140
|
-
The function returns an instance of MaestroEventViewModel, which includes an implementation of IMaestroEvent. IMaestroEvent represents the app-facing portion of the MaestroKit API related to the currently-loaded event. So after `userDidStartWatchingEvent` is called, the SDK has access to the API detailed in `MaestroEventDelegate` for making calls to the app, and the app has access to the API detailed in `IMaestroEvent` for making calls to the SDK.
|
|
141
|
-
*/
|
|
142
|
-
userDidStartWatchingEvent(eventID: string, delegate: IMaestroEventDelegate): Promise<IMaestroEvent>;
|
|
143
|
-
/**
|
|
144
|
-
* @description Tells the SDK the user has closed an event that was open in the app's player.
|
|
145
|
-
* @param eventID
|
|
146
|
-
*/
|
|
147
|
-
userDidStopWatchingEvent(eventID: string): void;
|
|
148
|
-
/**
|
|
149
|
-
* @description Authenticates user.
|
|
150
|
-
* @param id - The user's ID.
|
|
151
|
-
* @param jwt - The user's jwt.
|
|
152
|
-
*/
|
|
153
|
-
authenticateUser(id: string, jwt: string): Promise<void>;
|
|
154
|
-
/**
|
|
155
|
-
* Logs out currently-authenticated user.
|
|
156
|
-
*/
|
|
157
|
-
deauthenticateUser(): Promise<void>;
|
|
158
|
-
/**
|
|
159
|
-
* Gets the site ID for the SDK
|
|
160
|
-
* @returns The site ID
|
|
161
|
-
*/
|
|
162
|
-
getSiteID(): string | undefined;
|
|
163
|
-
/**
|
|
164
|
-
* Gets the JWT token for authentication
|
|
165
|
-
* @returns The JWT token
|
|
166
|
-
*/
|
|
167
|
-
getJwt(): string | undefined;
|
|
168
|
-
/**
|
|
169
|
-
* Gets the user ID for the SDK
|
|
170
|
-
* @returns The user ID
|
|
171
|
-
*/
|
|
172
|
-
getUserID(): string | undefined;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
declare const KEY_PLAYS_ERROR_STATE: {
|
|
176
|
-
readonly unsupportedEvent: "unsupportedEvent";
|
|
177
|
-
readonly unpopulatedEvent: "unpopulatedEvent";
|
|
178
|
-
readonly tabLoadFailure: "tabLoadFailure";
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
declare const KEY_PLAYS_LOAD_FAILURE_STATUS: {
|
|
182
|
-
readonly noFailure: "noFailure";
|
|
183
|
-
readonly recentFailure: "recentFailure";
|
|
184
|
-
readonly nonRecentFailure: "nonRecentFailure";
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
declare type KeyPlayItem = {
|
|
188
|
-
title: string;
|
|
189
|
-
items: IKeyPlay[];
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
declare type KeyPlayLoadFailureStatus = (typeof KEY_PLAYS_LOAD_FAILURE_STATUS)[keyof typeof KEY_PLAYS_LOAD_FAILURE_STATUS];
|
|
193
|
-
|
|
194
|
-
declare type KeyPlaysErrorState = (typeof KEY_PLAYS_ERROR_STATE)[keyof typeof KEY_PLAYS_ERROR_STATE];
|
|
195
|
-
|
|
196
|
-
declare class KeyPlaysViewModel {
|
|
197
|
-
currentlyPlayingClipIndex: Observable<number | null>;
|
|
198
|
-
lastPlayedClipIndex: Observable<number | null>;
|
|
199
|
-
currentClipPlaybackProgress: Observable<number | null>;
|
|
200
|
-
errorState: Observable<KeyPlaysErrorState | null>;
|
|
201
|
-
failedClips: Observable<{
|
|
202
|
-
[key: string]: KeyPlayLoadFailureStatus;
|
|
203
|
-
}>;
|
|
204
|
-
items: Observable<KeyPlayItem[]>;
|
|
205
|
-
isCurrentlyPlaying(index: number): boolean;
|
|
206
|
-
setKeyPlays(items: IMaestroKeyPlaysResponse | null): Promise<void>;
|
|
207
|
-
private cleanErrors;
|
|
208
|
-
playKeyPlay(atIndex: number): Promise<void>;
|
|
209
|
-
parseNetworkResponse(response: IMaestroKeyPlaysResponse): KeyPlayItem[];
|
|
210
|
-
get allItems(): IKeyPlay[];
|
|
211
|
-
clipID(forKeyPlayAtIndex: number): string | undefined;
|
|
212
|
-
handleKeyPlayLoadFailure(forKeyPlayAtIndex: number): void;
|
|
213
|
-
loadFailureStatus(forKeyPlayAtIndex: number): KeyPlayLoadFailureStatus;
|
|
214
|
-
clearLoadFailureStatus(forKeyPlayAtIndex: number): void;
|
|
215
|
-
userRequestedNewKeyPlaysData(): Promise<void>;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
declare class MaestroEventViewModel extends ViewModel implements IMaestroEvent {
|
|
219
|
-
private _eventId;
|
|
220
|
-
private _title;
|
|
221
|
-
private _isLive;
|
|
222
|
-
delegate: IMaestroEventDelegate;
|
|
223
|
-
keyPlaysViewModel: KeyPlaysViewModel;
|
|
224
|
-
constructor(eventId: string | undefined, delegate: IMaestroEventDelegate);
|
|
225
|
-
deinit(): void;
|
|
226
|
-
updateKeyPlaysData(data: IMaestroKeyPlaysResponse | null): Promise<void>;
|
|
227
|
-
startFocusManagement(): Promise<void>;
|
|
228
|
-
didStartPlayingClip(index: number): void;
|
|
229
|
-
didStopPlayingClip(index: number): void;
|
|
230
|
-
didFailToPlayClip(index: number): void;
|
|
231
|
-
didUpdatePlaybackProgressOfClip(index: number, to: number): void;
|
|
232
|
-
didShowPanel(): Promise<void>;
|
|
233
|
-
didHidePanel(): Promise<void>;
|
|
234
|
-
didShowOverlay(): Promise<void>;
|
|
235
|
-
didHideOverlay(): Promise<void>;
|
|
236
|
-
currentEventDoesNotSupportKeyPlays(): void;
|
|
237
|
-
getCurrentEventID(): string;
|
|
238
|
-
getCurrentlyPlayingClipIndex(): number | null;
|
|
239
|
-
getLastPlayedClipIndex(): number | null;
|
|
240
|
-
getCurrentClipPlaybackProgress(): number | null;
|
|
241
|
-
getKeyPlaysCount(): number;
|
|
242
|
-
get eventId(): Observable<string>;
|
|
243
|
-
get title(): Observable<string>;
|
|
244
|
-
get isLive(): Observable<boolean>;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
declare interface MaestroKeyPlay {
|
|
248
|
-
description: string;
|
|
249
|
-
team: string;
|
|
250
|
-
wallClock: string;
|
|
251
|
-
displayClock: string;
|
|
252
|
-
shortPeriod: string;
|
|
253
|
-
scoringPlay: boolean;
|
|
254
|
-
athlete: string;
|
|
255
|
-
thumbnail: string;
|
|
256
|
-
thumbnailType: string;
|
|
257
|
-
clipID: string;
|
|
258
|
-
awayScore?: string;
|
|
259
|
-
homeScore?: string;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
declare interface MaestroKeyPlaysAthlete {
|
|
263
|
-
id: string;
|
|
264
|
-
shortName: string;
|
|
265
|
-
headshot: string;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
declare interface MaestroKeyPlaysSection {
|
|
269
|
-
title: string;
|
|
270
|
-
items: MaestroKeyPlay[];
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
/**
|
|
274
|
-
* Main SDK class that serves as the entry point for the Maestro TV SDK
|
|
275
|
-
* Follows a singleton pattern similar to the Swift implementation
|
|
276
|
-
*/
|
|
277
|
-
declare class MaestroWebSDK implements IMaestroManager {
|
|
278
|
-
private static instance;
|
|
279
|
-
private renderer;
|
|
280
|
-
private siteID?;
|
|
281
|
-
private jwt?;
|
|
282
|
-
private userID?;
|
|
283
|
-
private maestroEventViewModel;
|
|
284
|
-
private constructor();
|
|
285
|
-
userDidStartWatchingEvent(eventID: string, delegate: IMaestroEventDelegate): Promise<IMaestroEvent>;
|
|
286
|
-
userDidStopWatchingEvent(_: string): void;
|
|
287
|
-
authenticateUser(_: string, __: string): Promise<void>;
|
|
288
|
-
deauthenticateUser(): Promise<void>;
|
|
289
|
-
/**
|
|
290
|
-
* @description Returns the MaestroWebSDK instance
|
|
291
|
-
* @returns {MaestroWebSDK} - The MaestroWebSDK instance
|
|
292
|
-
*/
|
|
293
|
-
static getInstance(): MaestroWebSDK;
|
|
294
|
-
configure(configParams: SDKConfigParams): void;
|
|
295
|
-
/**
|
|
296
|
-
* Checks if this is an authorized client based on siteID
|
|
297
|
-
*/
|
|
298
|
-
get isAuthorizedClient(): boolean;
|
|
299
|
-
/**
|
|
300
|
-
* Sets the site ID for the SDK
|
|
301
|
-
* @param siteID The site ID to set
|
|
302
|
-
*/
|
|
303
|
-
setSiteID(siteID?: string): void;
|
|
304
|
-
getSiteID(): string | undefined;
|
|
305
|
-
/**
|
|
306
|
-
* Sets the JWT token for authentication
|
|
307
|
-
* @param jwt The JWT token to set
|
|
308
|
-
*/
|
|
309
|
-
setJwt(jwt: string): void;
|
|
310
|
-
getJwt(): string | undefined;
|
|
311
|
-
/**
|
|
312
|
-
* Sets the user ID for the SDK
|
|
313
|
-
* @param userID The user ID to set
|
|
314
|
-
*/
|
|
315
|
-
setUserID(userID: string): void;
|
|
316
|
-
getUserID(): string | undefined;
|
|
317
|
-
/**
|
|
318
|
-
* Gets the event view model
|
|
319
|
-
* @returns The current event view model
|
|
320
|
-
*/
|
|
321
|
-
getMaestroEventViewModel(): MaestroEventViewModel;
|
|
322
|
-
renderPanel(id: string): Promise<() => void>;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
/**
|
|
326
|
-
* Basic observable implementation for view models
|
|
327
|
-
*/
|
|
328
|
-
declare class Observable<T> {
|
|
329
|
-
private listeners;
|
|
330
|
-
private _value;
|
|
331
|
-
constructor(initialValue: T);
|
|
332
|
-
get value(): T;
|
|
333
|
-
set value(newValue: T);
|
|
334
|
-
subscribe(listener: (value: T) => void): () => void;
|
|
335
|
-
private notify;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
declare const SDK: MaestroWebSDK;
|
|
339
|
-
export default SDK;
|
|
340
|
-
|
|
341
|
-
declare type SDKConfigParams = {
|
|
342
|
-
/**
|
|
343
|
-
* The type of environment to use. Defaults to `development`. The available options are `development`, `staging`, and `production`.
|
|
344
|
-
*/
|
|
345
|
-
environment?: 'development' | 'staging' | 'production';
|
|
346
|
-
/**
|
|
347
|
-
* The frequency in seconds to poll for updates. Defaults to 5.0.
|
|
348
|
-
*/
|
|
349
|
-
pollFrequency?: number;
|
|
350
|
-
/**
|
|
351
|
-
* The frequency in seconds to update progress. Defaults to 0.1.
|
|
352
|
-
*/
|
|
353
|
-
progressUpdateFrequency?: number;
|
|
354
|
-
/**
|
|
355
|
-
* The site ID to use for the SDK.
|
|
356
|
-
*/
|
|
357
|
-
siteID?: string;
|
|
358
|
-
/**
|
|
359
|
-
* The JWT token to use for authentication.
|
|
360
|
-
*/
|
|
361
|
-
jwt?: string;
|
|
362
|
-
/**
|
|
363
|
-
* The user ID of the logged account.
|
|
364
|
-
*/
|
|
365
|
-
userID?: string;
|
|
366
|
-
};
|
|
367
|
-
|
|
368
|
-
declare type TeamId = string;
|
|
369
|
-
|
|
370
|
-
/**
|
|
371
|
-
* Base view model that implements reactive properties
|
|
372
|
-
*/
|
|
373
|
-
declare abstract class ViewModel {
|
|
374
|
-
private _isLoading;
|
|
375
|
-
private _error;
|
|
376
|
-
get isLoading(): Observable<boolean>;
|
|
377
|
-
get error(): Observable<string | null>;
|
|
378
|
-
protected setLoading(loading: boolean): void;
|
|
379
|
-
protected setError(error: string | null): void;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
export { }
|
|
1
|
+
import IMaestroEventDelegate from './interfaces/IMaestroEventDelegate';
|
|
2
|
+
import IMaestroManager, { SDKConfigParams } from './interfaces/IMaestroManager';
|
|
3
|
+
import IMaestroEvent from './interfaces/IMaestroEvent';
|
|
4
|
+
import { MaestroEventViewModel } from './view-models/MaestroEventViewModel';
|
|
5
|
+
import type IMaestroKeyPlaysResponse from './modules/key-plays/interfaces/IKeyPlaysResponse';
|
|
6
|
+
export { type IMaestroEventDelegate, type IMaestroEvent, type IMaestroKeyPlaysResponse, };
|
|
7
|
+
export type Environment = 'development' | 'staging' | 'production';
|
|
8
|
+
/**
|
|
9
|
+
* Main SDK class that serves as the entry point for the Maestro TV SDK
|
|
10
|
+
* Follows a singleton pattern similar to the Swift implementation
|
|
11
|
+
*/
|
|
12
|
+
declare class MaestroWebSDK implements IMaestroManager {
|
|
13
|
+
private static instance;
|
|
14
|
+
private renderer;
|
|
15
|
+
private siteID?;
|
|
16
|
+
private jwt?;
|
|
17
|
+
private userID?;
|
|
18
|
+
private maestroEventViewModel;
|
|
19
|
+
private constructor();
|
|
20
|
+
userDidStartWatchingEvent(eventID: string, delegate: IMaestroEventDelegate): Promise<IMaestroEvent>;
|
|
21
|
+
userDidStopWatchingEvent(eventId: string): void;
|
|
22
|
+
authenticateUser(_: string, __: string): Promise<void>;
|
|
23
|
+
deauthenticateUser(): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* @description Returns the MaestroWebSDK instance
|
|
26
|
+
* @returns {MaestroWebSDK} - The MaestroWebSDK instance
|
|
27
|
+
*/
|
|
28
|
+
static getInstance(): MaestroWebSDK;
|
|
29
|
+
configure(configParams: SDKConfigParams): void;
|
|
30
|
+
/**
|
|
31
|
+
* Checks if this is an authorized client based on siteID
|
|
32
|
+
*/
|
|
33
|
+
get isAuthorizedClient(): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Sets the site ID for the SDK
|
|
36
|
+
* @param siteID The site ID to set
|
|
37
|
+
*/
|
|
38
|
+
setSiteID(siteID?: string): void;
|
|
39
|
+
getSiteID(): string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Sets the JWT token for authentication
|
|
42
|
+
* @param jwt The JWT token to set
|
|
43
|
+
*/
|
|
44
|
+
setJwt(jwt: string): void;
|
|
45
|
+
getJwt(): string | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Sets the user ID for the SDK
|
|
48
|
+
* @param userID The user ID to set
|
|
49
|
+
*/
|
|
50
|
+
setUserID(userID: string): void;
|
|
51
|
+
getUserID(): string | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Gets the event view model
|
|
54
|
+
* @returns The current event view model
|
|
55
|
+
*/
|
|
56
|
+
getMaestroEventViewModel(): MaestroEventViewModel;
|
|
57
|
+
renderPanel(id: string): Promise<() => void>;
|
|
58
|
+
}
|
|
59
|
+
declare const SDK: MaestroWebSDK;
|
|
60
|
+
export default SDK;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import IMaestroKeyPlaysResponse from '../modules/key-plays/interfaces/IKeyPlaysResponse';
|
|
2
|
+
/**
|
|
3
|
+
* This is the public API that the app can use to make calls to the SDK related to the currently-loaded event.
|
|
4
|
+
*/
|
|
5
|
+
export default interface IMaestroEvent {
|
|
6
|
+
/**
|
|
7
|
+
* @description Tells the SDK that the user just started playing a new key play clip at the given index.
|
|
8
|
+
*/
|
|
9
|
+
didStartPlayingClip(index: number): void;
|
|
10
|
+
/**
|
|
11
|
+
* @description Tells the SDK that the user just stopped playing a key play clip at the given index.
|
|
12
|
+
*/
|
|
13
|
+
didStopPlayingClip(index: number): void;
|
|
14
|
+
/**
|
|
15
|
+
* @description Tells the SDK that the user tried to play the clip but it failed to play back.
|
|
16
|
+
*/
|
|
17
|
+
didFailToPlayClip(index: number): void;
|
|
18
|
+
/**
|
|
19
|
+
* @description Updates the SDK with the latest progress in the playback of the currently-played key play clip, from 0 to 1.
|
|
20
|
+
*/
|
|
21
|
+
didUpdatePlaybackProgressOfClip(index: number, to: number): void;
|
|
22
|
+
/**
|
|
23
|
+
* @description Tells the SDK that the app displayed the MaestroPanel.
|
|
24
|
+
*/
|
|
25
|
+
didShowPanel(): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* @description Tells the SDK that the app hid the MaestroPanel.
|
|
28
|
+
*/
|
|
29
|
+
didHidePanel(): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* @description Alerts the SDK that the current event does not support key plays.
|
|
32
|
+
*/
|
|
33
|
+
currentEventDoesNotSupportKeyPlays(): void;
|
|
34
|
+
/**
|
|
35
|
+
* @description Retrieves the event ID for the currently loaded event.
|
|
36
|
+
*/
|
|
37
|
+
getCurrentEventID(): string | null;
|
|
38
|
+
/**
|
|
39
|
+
* @description Retrieves the array index of the key play clip that is currently being played.
|
|
40
|
+
*/
|
|
41
|
+
getCurrentlyPlayingClipIndex(): number | null;
|
|
42
|
+
/**
|
|
43
|
+
* @description Retrieves the array index of the key plays clip that was most recently played.
|
|
44
|
+
*/
|
|
45
|
+
getLastPlayedClipIndex(): number | null;
|
|
46
|
+
/**
|
|
47
|
+
* @description Retrieves the progress (between 0 and 1) of the currently-played key play clip.
|
|
48
|
+
*/
|
|
49
|
+
getCurrentClipPlaybackProgress(): number | null;
|
|
50
|
+
/**
|
|
51
|
+
* @description Retrieves the number of key plays.
|
|
52
|
+
*/
|
|
53
|
+
getKeyPlaysCount(): number | null;
|
|
54
|
+
/**
|
|
55
|
+
* @description Tells the SDK to start managing focus.
|
|
56
|
+
*/
|
|
57
|
+
startFocusManagement(): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* @description Feeds the SDK new key plays data. A null value indicates a failure to retrieve the data.
|
|
60
|
+
*/
|
|
61
|
+
updateKeyPlaysData(data: IMaestroKeyPlaysResponse | null): Promise<void>;
|
|
62
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Interface for the client app to implement in order to handle Maestro TV SDK events.
|
|
3
|
+
*/
|
|
4
|
+
export default interface IMaestroEventDelegate {
|
|
5
|
+
/**
|
|
6
|
+
* @description Allows the SDK to tell the client app that the user has encountered an error screen for lack of valid key
|
|
7
|
+
plays data, indicating the client app should call `updateKeyPlaysData` as soon as possible.
|
|
8
|
+
*/
|
|
9
|
+
userRequestedNewKeyPlaysData(): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Allows the SDK to request the client app play a particular key plays clip, given its array index in the key plays list. Note that the `MaestroKeyPlaysResponse` subdivides the key plays by section, so the `index` referenced here assumes the client app has access to a flattened list of the key plays, disregarding the sectional subdivisions.
|
|
12
|
+
*/
|
|
13
|
+
playClip(atIndex: number): void;
|
|
14
|
+
/**
|
|
15
|
+
* @description SDK can notify the client app when its time to handle the focus management
|
|
16
|
+
*/
|
|
17
|
+
startFocusManagement(): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import IMaestroEventDelegate from './IMaestroEventDelegate';
|
|
2
|
+
import IMaestroEvent from './IMaestroEvent';
|
|
3
|
+
export type SDKConfigParams = {
|
|
4
|
+
/**
|
|
5
|
+
* The type of environment to use. Defaults to `development`. The available options are `development`, `staging`, and `production`.
|
|
6
|
+
*/
|
|
7
|
+
environment?: 'development' | 'staging' | 'production';
|
|
8
|
+
/**
|
|
9
|
+
* The frequency in seconds to poll for updates. Defaults to 5.0.
|
|
10
|
+
*/
|
|
11
|
+
pollFrequency?: number;
|
|
12
|
+
/**
|
|
13
|
+
* The frequency in seconds to update progress. Defaults to 0.1.
|
|
14
|
+
*/
|
|
15
|
+
progressUpdateFrequency?: number;
|
|
16
|
+
/**
|
|
17
|
+
* The site ID to use for the SDK.
|
|
18
|
+
*/
|
|
19
|
+
siteID?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The JWT token to use for authentication.
|
|
22
|
+
*/
|
|
23
|
+
jwt?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The user ID of the logged account.
|
|
26
|
+
*/
|
|
27
|
+
userID?: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
This is the MaestroKit top-level API for initializing and configuring the framework. It encompasses all functionality that is not specific to an event.
|
|
31
|
+
*/
|
|
32
|
+
export default interface IMaestroManager {
|
|
33
|
+
/**
|
|
34
|
+
* @description Configure the MaestroWebSDK.
|
|
35
|
+
* @param {SDKConfigParams} configParams - Configuration parameters
|
|
36
|
+
* @param {SDKConfigParams['environment']} configParams.environment - The type of environment to use. Defaults to 'development'.
|
|
37
|
+
* @param {SDKConfigParams['pollFrequency']} configParams.pollFrequency - The frequency in seconds to poll for updates. Defaults to 5.0.
|
|
38
|
+
* @param {SDKConfigParams['progressUpdateFrequency']} configParams.progressUpdateFrequency - The frequency in seconds to update progress. Defaults to 0.1.
|
|
39
|
+
* @param {SDKConfigParams['siteID']} configParams.siteID - The site ID to use for the SDK.
|
|
40
|
+
* @param {SDKConfigParams['jwt']} configParams.jwt - The JWT token to use for authentication.
|
|
41
|
+
* @param {SDKConfigParams['userID']} configParams.userID - The user ID of the logged account.
|
|
42
|
+
*/
|
|
43
|
+
configure(configParams: SDKConfigParams): void;
|
|
44
|
+
/**
|
|
45
|
+
Tells the SDK the user has opened an event in the app's player.
|
|
46
|
+
Arguments:
|
|
47
|
+
- eventID: The Event ID for the event opened in the player.
|
|
48
|
+
- delegate: an instance of the app's implementation of IMaestroEventDelegate
|
|
49
|
+
The function returns an instance of MaestroEventViewModel, which includes an implementation of IMaestroEvent. IMaestroEvent represents the app-facing portion of the MaestroKit API related to the currently-loaded event. So after `userDidStartWatchingEvent` is called, the SDK has access to the API detailed in `MaestroEventDelegate` for making calls to the app, and the app has access to the API detailed in `IMaestroEvent` for making calls to the SDK.
|
|
50
|
+
*/
|
|
51
|
+
userDidStartWatchingEvent(eventID: string, delegate: IMaestroEventDelegate): Promise<IMaestroEvent>;
|
|
52
|
+
/**
|
|
53
|
+
* @description Tells the SDK the user has closed an event that was open in the app's player.
|
|
54
|
+
* @param eventID
|
|
55
|
+
*/
|
|
56
|
+
userDidStopWatchingEvent(eventID: string): void;
|
|
57
|
+
/**
|
|
58
|
+
* @description Authenticates user.
|
|
59
|
+
* @param id - The user's ID.
|
|
60
|
+
* @param jwt - The user's jwt.
|
|
61
|
+
*/
|
|
62
|
+
authenticateUser(id: string, jwt: string): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Logs out currently-authenticated user.
|
|
65
|
+
*/
|
|
66
|
+
deauthenticateUser(): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Gets the site ID for the SDK
|
|
69
|
+
* @returns The site ID
|
|
70
|
+
*/
|
|
71
|
+
getSiteID(): string | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* Gets the JWT token for authentication
|
|
74
|
+
* @returns The JWT token
|
|
75
|
+
*/
|
|
76
|
+
getJwt(): string | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Gets the user ID for the SDK
|
|
79
|
+
* @returns The user ID
|
|
80
|
+
*/
|
|
81
|
+
getUserID(): string | undefined;
|
|
82
|
+
}
|