@maestro_io/maestro-web-sdk 4.0.0-beta.5 → 5.0.0
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/index.d.ts
CHANGED
|
@@ -19,18 +19,17 @@
|
|
|
19
19
|
|
|
20
20
|
declare module '@maestro_io/maestro-web-sdk' {
|
|
21
21
|
import IMaestroEventDelegate, { PanelEvent } from '@maestro_io/maestro-web-sdk/interfaces/IMaestroEventDelegate';
|
|
22
|
-
import IMaestroManager, { SDKConfigParams } from '@maestro_io/maestro-web-sdk/interfaces/IMaestroManager';
|
|
22
|
+
import IMaestroManager, { SDKConfigParams, SDKEventConfigParams, SDKStopEventParams } from '@maestro_io/maestro-web-sdk/interfaces/IMaestroManager';
|
|
23
23
|
import IMaestroEvent from '@maestro_io/maestro-web-sdk/interfaces/IMaestroEvent';
|
|
24
24
|
import { MaestroEventViewModel } from '@maestro_io/maestro-web-sdk/view-models/MaestroEventViewModel';
|
|
25
25
|
import IMaestroKeyPlaysResponse from '@maestro_io/maestro-web-sdk/modules/key-plays/interfaces/IKeyPlaysResponse';
|
|
26
|
-
import { IUserSettings } from '@maestro_io/maestro-web-sdk/interfaces/IUserSettings';
|
|
27
26
|
import { GlobalConfig, PageConfig } from '@maestro_io/maestro-web-sdk/services/StaticService/types';
|
|
28
27
|
import { MaestroPanelType } from '@maestro_io/maestro-web-sdk/models/IPanel';
|
|
29
28
|
export { default as Overlay } from '@maestro_io/maestro-web-sdk/components/molecules/Overlay/Overlay';
|
|
30
29
|
export { OverlayType, IMaestroOverlayEvent, IOverlaySize, IOverlayPosition, IFantasyPayload, IOverlayAnalyticsEvent, } from '@maestro_io/maestro-web-sdk/types/OverlayTypes';
|
|
31
30
|
export { IWinningBet } from '@maestro_io/maestro-web-sdk/models/IWinningBet';
|
|
32
31
|
export { ActionTrackEvent, ImpressionTrackEvent, Metadata, PanelClickAction, PanelViewAction, } from '@maestro_io/maestro-web-sdk/services/AnalyticsService/types';
|
|
33
|
-
export { PanelEvent, IMaestroEventDelegate, IMaestroEvent, IMaestroKeyPlaysResponse, MaestroPanelType, };
|
|
32
|
+
export { PanelEvent, IMaestroEventDelegate, IMaestroEvent, IMaestroKeyPlaysResponse, MaestroPanelType, SDKEventConfigParams, SDKStopEventParams, };
|
|
34
33
|
export { IUserSettings, DEFAULT_USER_SETTINGS, } from '@maestro_io/maestro-web-sdk/interfaces/IUserSettings';
|
|
35
34
|
/**
|
|
36
35
|
* Main SDK class that serves as the entry point for the Maestro TV SDK
|
|
@@ -42,8 +41,8 @@ declare module '@maestro_io/maestro-web-sdk' {
|
|
|
42
41
|
* @returns {MaestroWebSDK} - The MaestroWebSDK instance
|
|
43
42
|
*/
|
|
44
43
|
static getInstance(): MaestroWebSDK;
|
|
45
|
-
userDidStartWatchingEvent(
|
|
46
|
-
userDidStopWatchingEvent(
|
|
44
|
+
userDidStartWatchingEvent({ eventId, pageId, userSettings, delegate, useProdEnv, }: SDKEventConfigParams): Promise<IMaestroEvent>;
|
|
45
|
+
userDidStopWatchingEvent(_config: SDKStopEventParams): Promise<void>;
|
|
47
46
|
configure(configParams: SDKConfigParams): void;
|
|
48
47
|
/**
|
|
49
48
|
* Sets the site ID for the SDK
|
|
@@ -51,6 +50,7 @@ declare module '@maestro_io/maestro-web-sdk' {
|
|
|
51
50
|
*/
|
|
52
51
|
setSiteID(siteID: string): void;
|
|
53
52
|
getSiteID(): string;
|
|
53
|
+
getIsProdEnv(): boolean;
|
|
54
54
|
/**
|
|
55
55
|
* Gets the event view model
|
|
56
56
|
* @returns The current event view model
|
|
@@ -155,6 +155,40 @@ declare module '@maestro_io/maestro-web-sdk/interfaces/IMaestroManager' {
|
|
|
155
155
|
*/
|
|
156
156
|
userSettings?: IUserSettings;
|
|
157
157
|
};
|
|
158
|
+
export type SDKStopEventParams = {
|
|
159
|
+
/**
|
|
160
|
+
* Event ID for the event being stopped.
|
|
161
|
+
*/
|
|
162
|
+
eventId?: string;
|
|
163
|
+
/**
|
|
164
|
+
* Page ID for the event being stopped.
|
|
165
|
+
*/
|
|
166
|
+
pageId?: string;
|
|
167
|
+
};
|
|
168
|
+
export type SDKEventConfigParams = {
|
|
169
|
+
/**
|
|
170
|
+
* The page ID to use to load the page configuration.
|
|
171
|
+
*/
|
|
172
|
+
pageId?: string;
|
|
173
|
+
/**
|
|
174
|
+
* User settings for customizing SDK behavior (panel visibility, feature toggles, etc.)
|
|
175
|
+
*/
|
|
176
|
+
userSettings?: IUserSettings;
|
|
177
|
+
/**
|
|
178
|
+
* Event ID as metadata value to use to load the page configuration.
|
|
179
|
+
* This is typically used when the page ID is not known, but a metadata value is available.
|
|
180
|
+
*/
|
|
181
|
+
eventId?: string;
|
|
182
|
+
/**
|
|
183
|
+
* The instance of the app's implementation of IMaestroEventDelegate
|
|
184
|
+
*/
|
|
185
|
+
delegate: IMaestroEventDelegate;
|
|
186
|
+
/**
|
|
187
|
+
* @description - Indicates whether to use the production environment for this event.
|
|
188
|
+
* @default true
|
|
189
|
+
*/
|
|
190
|
+
useProdEnv?: boolean;
|
|
191
|
+
};
|
|
158
192
|
/**
|
|
159
193
|
This is the MaestroKit top-level API for initializing and configuring the framework. It encompasses all functionality that is not specific to an event.
|
|
160
194
|
*/
|
|
@@ -174,12 +208,14 @@ declare module '@maestro_io/maestro-web-sdk/interfaces/IMaestroManager' {
|
|
|
174
208
|
- userSettings: Optional user settings to override the configured settings for this event
|
|
175
209
|
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.
|
|
176
210
|
*/
|
|
177
|
-
userDidStartWatchingEvent(
|
|
211
|
+
userDidStartWatchingEvent(config: SDKEventConfigParams): Promise<IMaestroEvent>;
|
|
178
212
|
/**
|
|
179
213
|
* @description Tells the SDK the user has closed an event that was open in the app's player.
|
|
180
|
-
* @param
|
|
214
|
+
* @param params - Parameters including eventId or pageId to identify the event being stopped.
|
|
215
|
+
* @param params.eventId - The Event ID for the event being stopped.
|
|
216
|
+
* @param params.pageId - The Page ID for the event being stopped.
|
|
181
217
|
*/
|
|
182
|
-
userDidStopWatchingEvent(
|
|
218
|
+
userDidStopWatchingEvent(params: SDKStopEventParams): Promise<void>;
|
|
183
219
|
/**
|
|
184
220
|
* Render the PanelManager with the available panels for the current event in the specified HTML id element.
|
|
185
221
|
* @param id - The ID of the HTML element where the panel will be rendered.
|
|
@@ -342,7 +378,7 @@ declare module '@maestro_io/maestro-web-sdk/view-models/MaestroEventViewModel' {
|
|
|
342
378
|
shopViewModel: ShopViewModel | null;
|
|
343
379
|
panelManagerViewModel: PanelManagerViewModel;
|
|
344
380
|
navigation: SpatialNavigation;
|
|
345
|
-
constructor(eventId: string | undefined, delegate: IMaestroEventDelegate);
|
|
381
|
+
constructor(eventId: string | undefined, pageId: string | undefined, delegate: IMaestroEventDelegate);
|
|
346
382
|
setActivePanel(panelType: MaestroPanelType): void;
|
|
347
383
|
updatePlayerTimeCode(timestamp: number): void;
|
|
348
384
|
getPlayerTimeCode(): number | null;
|
|
@@ -426,54 +462,8 @@ declare module '@maestro_io/maestro-web-sdk/modules/key-plays/interfaces/IKeyPla
|
|
|
426
462
|
export {};
|
|
427
463
|
}
|
|
428
464
|
|
|
429
|
-
declare module '@maestro_io/maestro-web-sdk/interfaces/IUserSettings' {
|
|
430
|
-
/**
|
|
431
|
-
* User settings interface for customizing Maestro Web SDK behavior
|
|
432
|
-
* Supports panel-level and feature-level customizations
|
|
433
|
-
*/
|
|
434
|
-
export interface IUserSettings {
|
|
435
|
-
panels?: {
|
|
436
|
-
bets?: {
|
|
437
|
-
/** Hide the entire bets panel from panel selection */
|
|
438
|
-
hidePanel?: boolean;
|
|
439
|
-
/** Hide wager values (dollar amounts) in betting cards */
|
|
440
|
-
hideWagers?: boolean;
|
|
441
|
-
};
|
|
442
|
-
stats?: {
|
|
443
|
-
/** Hide the entire stats panel from panel selection */
|
|
444
|
-
hidePanel?: boolean;
|
|
445
|
-
};
|
|
446
|
-
keyPlays?: {
|
|
447
|
-
/** Hide the entire key plays panel from panel selection */
|
|
448
|
-
hidePanel?: boolean;
|
|
449
|
-
};
|
|
450
|
-
fantasy?: {
|
|
451
|
-
/** Hide the entire fantasy panel from panel selection */
|
|
452
|
-
hidePanel?: boolean;
|
|
453
|
-
};
|
|
454
|
-
shop?: {
|
|
455
|
-
/** Hide the entire shop panel from panel selection */
|
|
456
|
-
hidePanel?: boolean;
|
|
457
|
-
};
|
|
458
|
-
};
|
|
459
|
-
}
|
|
460
|
-
/**
|
|
461
|
-
* Default user settings - all features enabled by default
|
|
462
|
-
*/
|
|
463
|
-
export const DEFAULT_USER_SETTINGS: IUserSettings;
|
|
464
|
-
/**
|
|
465
|
-
* Panel-specific settings type helpers
|
|
466
|
-
*/
|
|
467
|
-
export type BetsSettings = NonNullable<IUserSettings['panels']>['bets'];
|
|
468
|
-
export type StatsSettings = NonNullable<IUserSettings['panels']>['stats'];
|
|
469
|
-
export type KeyPlaysSettings = NonNullable<IUserSettings['panels']>['keyPlays'];
|
|
470
|
-
/**
|
|
471
|
-
* Utility type for getting panel settings by panel type
|
|
472
|
-
*/
|
|
473
|
-
export type PanelSettings<T extends keyof NonNullable<IUserSettings['panels']>> = NonNullable<IUserSettings['panels']>[T];
|
|
474
|
-
}
|
|
475
|
-
|
|
476
465
|
declare module '@maestro_io/maestro-web-sdk/services/StaticService/types' {
|
|
466
|
+
import { MaestroPanelType } from '@/models/IPanel';
|
|
477
467
|
import ITheme from '@/models/ITheme';
|
|
478
468
|
type PlatformConfig = {
|
|
479
469
|
analytics: {
|
|
@@ -489,7 +479,7 @@ declare module '@maestro_io/maestro-web-sdk/services/StaticService/types' {
|
|
|
489
479
|
_id: string;
|
|
490
480
|
slug: string;
|
|
491
481
|
panel_name?: string;
|
|
492
|
-
panel_type?:
|
|
482
|
+
panel_type?: MaestroPanelType;
|
|
493
483
|
icon_name?: string;
|
|
494
484
|
renderer?: {
|
|
495
485
|
block_data?: TBlockData;
|
|
@@ -554,11 +544,12 @@ declare module '@maestro_io/maestro-web-sdk/services/StaticService/types' {
|
|
|
554
544
|
|
|
555
545
|
declare module '@maestro_io/maestro-web-sdk/models/IPanel' {
|
|
556
546
|
export const MaestroPanelType: {
|
|
557
|
-
readonly KEY_PLAYS: "
|
|
558
|
-
readonly STATS: "
|
|
559
|
-
readonly BETS: "
|
|
560
|
-
readonly FANTASY: "
|
|
561
|
-
readonly SHOP: "
|
|
547
|
+
readonly KEY_PLAYS: "espnKeyPlays";
|
|
548
|
+
readonly STATS: "espnStats";
|
|
549
|
+
readonly BETS: "espnBet";
|
|
550
|
+
readonly FANTASY: "espnFantasy";
|
|
551
|
+
readonly SHOP: "espnShop";
|
|
552
|
+
readonly HELLO_WORLD: "helloWorld";
|
|
562
553
|
};
|
|
563
554
|
export type MaestroPanelType = typeof MaestroPanelType[keyof typeof MaestroPanelType];
|
|
564
555
|
export interface PanelTypeInfo {
|
|
@@ -567,7 +558,6 @@ declare module '@maestro_io/maestro-web-sdk/models/IPanel' {
|
|
|
567
558
|
imageNamePrefix: string;
|
|
568
559
|
iconName: string;
|
|
569
560
|
}
|
|
570
|
-
export const PANEL_TYPE_INFO: Record<MaestroPanelType, PanelTypeInfo>;
|
|
571
561
|
}
|
|
572
562
|
|
|
573
563
|
declare module '@maestro_io/maestro-web-sdk/components/molecules/Overlay/Overlay' {
|
|
@@ -728,6 +718,53 @@ declare module '@maestro_io/maestro-web-sdk/services/AnalyticsService/types' {
|
|
|
728
718
|
export type ActionTrackEvent = PanelClickAction;
|
|
729
719
|
}
|
|
730
720
|
|
|
721
|
+
declare module '@maestro_io/maestro-web-sdk/interfaces/IUserSettings' {
|
|
722
|
+
/**
|
|
723
|
+
* User settings interface for customizing Maestro Web SDK behavior
|
|
724
|
+
* Supports panel-level and feature-level customizations
|
|
725
|
+
*/
|
|
726
|
+
export interface IUserSettings {
|
|
727
|
+
panels?: {
|
|
728
|
+
bets?: {
|
|
729
|
+
/** Hide the entire bets panel from panel selection */
|
|
730
|
+
hidePanel?: boolean;
|
|
731
|
+
/** Hide wager values (dollar amounts) in betting cards */
|
|
732
|
+
hideWagers?: boolean;
|
|
733
|
+
};
|
|
734
|
+
stats?: {
|
|
735
|
+
/** Hide the entire stats panel from panel selection */
|
|
736
|
+
hidePanel?: boolean;
|
|
737
|
+
};
|
|
738
|
+
keyPlays?: {
|
|
739
|
+
/** Hide the entire key plays panel from panel selection */
|
|
740
|
+
hidePanel?: boolean;
|
|
741
|
+
};
|
|
742
|
+
fantasy?: {
|
|
743
|
+
/** Hide the entire fantasy panel from panel selection */
|
|
744
|
+
hidePanel?: boolean;
|
|
745
|
+
};
|
|
746
|
+
shop?: {
|
|
747
|
+
/** Hide the entire shop panel from panel selection */
|
|
748
|
+
hidePanel?: boolean;
|
|
749
|
+
};
|
|
750
|
+
};
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* Default user settings - all features enabled by default
|
|
754
|
+
*/
|
|
755
|
+
export const DEFAULT_USER_SETTINGS: IUserSettings;
|
|
756
|
+
/**
|
|
757
|
+
* Panel-specific settings type helpers
|
|
758
|
+
*/
|
|
759
|
+
export type BetsSettings = NonNullable<IUserSettings['panels']>['bets'];
|
|
760
|
+
export type StatsSettings = NonNullable<IUserSettings['panels']>['stats'];
|
|
761
|
+
export type KeyPlaysSettings = NonNullable<IUserSettings['panels']>['keyPlays'];
|
|
762
|
+
/**
|
|
763
|
+
* Utility type for getting panel settings by panel type
|
|
764
|
+
*/
|
|
765
|
+
export type PanelSettings<T extends keyof NonNullable<IUserSettings['panels']>> = NonNullable<IUserSettings['panels']>[T];
|
|
766
|
+
}
|
|
767
|
+
|
|
731
768
|
declare module '@maestro_io/maestro-web-sdk/helpers/Observable' {
|
|
732
769
|
/**
|
|
733
770
|
* Basic observable implementation for view models
|
|
@@ -1143,6 +1180,10 @@ declare module '@maestro_io/maestro-web-sdk/view-models/PanelManagerViewModel' {
|
|
|
1143
1180
|
getPanelType(atIndex: number): MaestroPanelType | null;
|
|
1144
1181
|
get panelTypeToLeft(): MaestroPanelType | null;
|
|
1145
1182
|
get panelTypeToRight(): MaestroPanelType | null;
|
|
1183
|
+
/**
|
|
1184
|
+
* @returns Array of PanelInfo for panels defined in config but not listed in MaestroPanelType
|
|
1185
|
+
*/
|
|
1186
|
+
getUnlistedPanels(): PanelInfo[];
|
|
1146
1187
|
}
|
|
1147
1188
|
}
|
|
1148
1189
|
|