@maestro_io/maestro-web-sdk 2.2.8 → 2.3.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/external/AxiosNetworkClient.d.ts +8 -0
- package/dist/external/mocks/MockExternalNetworkClient.d.ts +15 -1
- package/dist/external/ports/networkClient.d.ts +14 -0
- package/dist/maestro-web-sdk.umd.js +3 -3
- package/dist/maestro-web-sdk.umd.js.map +1 -1
- package/dist/modules/bets/interfaces/IBets.d.ts +2 -1
- package/dist/modules/bets/view/components/PromoCodeBanner/PromoCodeBanner.d.ts +2 -9
- package/dist/modules/bets/view/components/PromoCodeBanner/index.d.ts +0 -1
- package/dist/modules/bets/view-model/BetsViewModel.d.ts +18 -6
- package/dist/modules/key-plays/interfaces/IKeyPlaysResponse.d.ts +4 -4
- package/dist/modules/key-plays/view/KeyPlayCardScoreTagView.d.ts +1 -1
- package/dist/modules/key-plays/view/KeyPlayCardView.d.ts +0 -4
- package/dist/modules/key-plays/view/KeyPlaysView.d.ts +2 -17
- package/dist/modules/key-plays/view-model/KeyPlaysViewModel.d.ts +2 -2
- package/dist/modules/stats/view/DriveSummary/DrivePlayCard.d.ts +44 -10
- package/dist/modules/stats/view/DriveSummary/DriveSummary.d.ts +0 -8
- package/dist/modules/stats/view/DriveSummary/ExpandedItems/DriveSummaryExpanded.d.ts +27 -0
- package/dist/modules/stats/view/DriveSummary/Header/DriveSummaryHeader.d.ts +13 -0
- package/dist/modules/stats/view/DriveSummary/MainStat/MainStat.d.ts +11 -0
- package/dist/modules/stats/view/MatchPredictor/MatchPredictorView.d.ts +45 -11
- package/dist/services/BetsService.d.ts +27 -7
- package/dist/services/NetworkManager/NetworkManager.d.ts +34 -0
- package/dist/services/NetworkManager/types.d.ts +28 -0
- package/dist/services/PageService/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -170,7 +170,7 @@ export interface IPersonalizedBetsResponse extends IBetsResponse {
|
|
|
170
170
|
live: IUserBet[];
|
|
171
171
|
settled: IUserBet[];
|
|
172
172
|
};
|
|
173
|
-
|
|
173
|
+
promotion?: {
|
|
174
174
|
/** "FIRST BET RESET" */
|
|
175
175
|
title: string;
|
|
176
176
|
/** Promo description */
|
|
@@ -179,6 +179,7 @@ export interface IPersonalizedBetsResponse extends IBetsResponse {
|
|
|
179
179
|
logo: string;
|
|
180
180
|
/** URL to QR code */
|
|
181
181
|
qrCode: string;
|
|
182
|
+
backgroundImage: string;
|
|
182
183
|
};
|
|
183
184
|
disclaimers?: {
|
|
184
185
|
/** Location-specific disclaimer */
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './PromoCodeBanner.styles.css';
|
|
3
|
-
import { WithFocusableProps } from '@/external/spatial-navigation';
|
|
4
3
|
import { Direction, Layout } from '@/external/spatial-navigation/utils';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
description: string;
|
|
8
|
-
logo: string;
|
|
9
|
-
qrCode: string;
|
|
10
|
-
showLogo?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export default class FocusablePromoCodeBannerWrapper extends React.Component<PromoCodeBannerProps> {
|
|
4
|
+
import { IBetPromo } from '@/modules/bets/view-model/BetsViewModel';
|
|
5
|
+
export default class FocusablePromoCodeBannerWrapper extends React.Component<IBetPromo> {
|
|
13
6
|
static contextTypes: {
|
|
14
7
|
refsMap: React.Requireable<any>;
|
|
15
8
|
setRef: React.Requireable<any>;
|
|
@@ -51,6 +51,7 @@ export type IBetPromo = {
|
|
|
51
51
|
description: string;
|
|
52
52
|
logo: string;
|
|
53
53
|
qrCode: string;
|
|
54
|
+
backgroundImage: string;
|
|
54
55
|
};
|
|
55
56
|
export type PromoBetItem = {
|
|
56
57
|
id: string;
|
|
@@ -119,7 +120,6 @@ export declare class BetsViewModel extends ViewModel {
|
|
|
119
120
|
private settingsSubscription;
|
|
120
121
|
initialized: boolean;
|
|
121
122
|
constructor(eventId: string, delegate: IMaestroEventDelegate, options?: {
|
|
122
|
-
pollingInterval?: number;
|
|
123
123
|
useMockData?: boolean;
|
|
124
124
|
});
|
|
125
125
|
/**
|
|
@@ -147,7 +147,23 @@ export declare class BetsViewModel extends ViewModel {
|
|
|
147
147
|
*/
|
|
148
148
|
refreshPolling(): void;
|
|
149
149
|
/**
|
|
150
|
-
*
|
|
150
|
+
* Get user credentials from delegate
|
|
151
|
+
*/
|
|
152
|
+
private getUserCredentials;
|
|
153
|
+
/**
|
|
154
|
+
* @description Update polling interval checking either response header or panel config.
|
|
155
|
+
* Refresh polling if necessary.
|
|
156
|
+
*/
|
|
157
|
+
private updatePollingInterval;
|
|
158
|
+
private getPanelConfigInterval;
|
|
159
|
+
private getResponseHeaderPollingIntervalValue;
|
|
160
|
+
/**
|
|
161
|
+
* Poll with the personalized endpoint for both authenticated and anonymous users
|
|
162
|
+
*
|
|
163
|
+
* SWID format is provided by the client app delegate:
|
|
164
|
+
* - Logged in: {6D201B58-440C-47A6-970B-0F8C78C0BAB8} (with curly braces)
|
|
165
|
+
* - Anonymous: 6D201B58-440C-47A6-970B-0F8C78C0BAB8 (without curly braces)
|
|
166
|
+
* - Failsafe: Empty string if local storage fails
|
|
151
167
|
*/
|
|
152
168
|
private pollWithInterval;
|
|
153
169
|
/**
|
|
@@ -180,10 +196,6 @@ export declare class BetsViewModel extends ViewModel {
|
|
|
180
196
|
* Fetch personalized bet data
|
|
181
197
|
*/
|
|
182
198
|
private fetchPersonalizedData;
|
|
183
|
-
/**
|
|
184
|
-
* Fetch non-personalized bet data
|
|
185
|
-
*/
|
|
186
|
-
private fetchNonPersonalizedData;
|
|
187
199
|
/**
|
|
188
200
|
* Fetch mock data for testing
|
|
189
201
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
type TeamId = string;
|
|
2
2
|
type AthleteId = string;
|
|
3
3
|
export default interface IMaestroKeyPlaysResponse {
|
|
4
|
-
entities
|
|
5
|
-
team
|
|
6
|
-
athlete
|
|
4
|
+
entities?: {
|
|
5
|
+
team?: Record<TeamId, IMaestroKeyPlaysTeam>;
|
|
6
|
+
athlete?: Record<AthleteId, MaestroKeyPlaysAthlete>;
|
|
7
7
|
};
|
|
8
8
|
sections: MaestroKeyPlaysSection[];
|
|
9
9
|
}
|
|
@@ -24,7 +24,7 @@ interface MaestroKeyPlaysAthlete {
|
|
|
24
24
|
headshot: string;
|
|
25
25
|
}
|
|
26
26
|
interface MaestroKeyPlaysSection {
|
|
27
|
-
title
|
|
27
|
+
title?: string;
|
|
28
28
|
items: MaestroKeyPlay[];
|
|
29
29
|
}
|
|
30
30
|
interface MaestroKeyPlay {
|
|
@@ -15,10 +15,6 @@ type KeyPlaysCardViewState = {
|
|
|
15
15
|
export declare class KeyPlayCardView extends React.Component<KeyPlayCardViewProps & WithFocusableProps, KeyPlaysCardViewState> {
|
|
16
16
|
private failedClipListener;
|
|
17
17
|
private vm;
|
|
18
|
-
state: {
|
|
19
|
-
failedClip: null;
|
|
20
|
-
imageLoaded: boolean;
|
|
21
|
-
};
|
|
22
18
|
constructor(props: KeyPlayCardViewProps);
|
|
23
19
|
componentDidMount(): void;
|
|
24
20
|
componentWillUnmount(): void;
|
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import './KeyPlaysView.styles.css';
|
|
3
3
|
import { KeyPlaysErrorState } from '../interfaces/IKeyPlays';
|
|
4
|
-
|
|
5
|
-
id: string;
|
|
6
|
-
clipID: string;
|
|
7
|
-
awayTeamScore?: number;
|
|
8
|
-
homeTeamScore?: number;
|
|
9
|
-
awayTeamName: string;
|
|
10
|
-
homeTeamName: string;
|
|
11
|
-
description: string;
|
|
12
|
-
playerImageUrl: string;
|
|
13
|
-
teamImageUrl: string;
|
|
14
|
-
thumbnailImageUrl: string;
|
|
15
|
-
}
|
|
16
|
-
interface IKeyPlaySection {
|
|
17
|
-
title: string;
|
|
18
|
-
items: IKeyPlayItem[];
|
|
19
|
-
}
|
|
4
|
+
import { KeyPlayItem } from '../view-model/KeyPlaysViewModel';
|
|
20
5
|
interface IKeyPlaysState {
|
|
21
6
|
playbackProgress: number | null;
|
|
22
7
|
playbackIndex: number | null;
|
|
23
|
-
items:
|
|
8
|
+
items: KeyPlayItem[];
|
|
24
9
|
scrollableContainer: HTMLDivElement | null;
|
|
25
10
|
}
|
|
26
11
|
export declare class KeyPlays extends Component<{}, IKeyPlaysState> {
|
|
@@ -2,8 +2,8 @@ import IMaestroKeyPlaysResponse from '../interfaces/IKeyPlaysResponse';
|
|
|
2
2
|
import IKeyPlay, { KeyPlayLoadFailureStatus, KeyPlaysErrorState } from '../interfaces/IKeyPlays';
|
|
3
3
|
import { Observable } from '@/helpers/Observable';
|
|
4
4
|
import AnalyticsService from '@/services/AnalyticsService/AnalyticsService';
|
|
5
|
-
type KeyPlayItem = {
|
|
6
|
-
title
|
|
5
|
+
export type KeyPlayItem = {
|
|
6
|
+
title?: string;
|
|
7
7
|
items: IKeyPlay[];
|
|
8
8
|
};
|
|
9
9
|
declare class KeyPlaysViewModel {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="prop-types" />
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { WithFocusableProps } from '@/external/spatial-navigation';
|
|
3
4
|
import { DrivePlay } from '../../interfaces/IStats';
|
|
@@ -13,14 +14,47 @@ type DrivePlayCardProps = {
|
|
|
13
14
|
onArrowPress?: (direction: Direction, props: any) => boolean | void;
|
|
14
15
|
parentFocusKey?: string;
|
|
15
16
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
declare const _default: {
|
|
18
|
+
new (props?: (DrivePlayCardProps & WithFocusableProps) | undefined, context?: any): {
|
|
19
|
+
state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState;
|
|
20
|
+
navigation: import("../../../../external/spatial-navigation/spatialNavigation").default;
|
|
21
|
+
getChildContext(): {
|
|
22
|
+
parentFocusKey: string;
|
|
23
|
+
};
|
|
24
|
+
setFocus: (focusKey: string) => void;
|
|
25
|
+
navigateByDirection: (direction: Direction, details?: Record<string, any>) => void;
|
|
26
|
+
stealFocus: () => void;
|
|
27
|
+
onUpdateFocus: (focused: boolean) => void;
|
|
28
|
+
onUpdateHasFocusedChild: (hasFocusedChild: boolean) => void;
|
|
29
|
+
onEnterPressHandler: (details: import("@/external/spatial-navigation/utils").Details) => void;
|
|
30
|
+
onEnterReleaseHandler: () => void;
|
|
31
|
+
onBackPressHandler: (details: import("@/external/spatial-navigation/utils").Details) => void;
|
|
32
|
+
onArrowPressHandler: (direction: Direction, details: import("@/external/spatial-navigation/utils").Details) => boolean | void;
|
|
33
|
+
onBecameFocusedHandler: (layout: Layout, details: import("@/external/spatial-navigation/utils").Details) => void;
|
|
34
|
+
onBecameBlurredHandler: (layout: Layout, details: import("@/external/spatial-navigation/utils").Details) => void;
|
|
35
|
+
componentDidMount(): void;
|
|
36
|
+
componentDidUpdate(): void;
|
|
37
|
+
componentWillUnmount(): void;
|
|
38
|
+
render(): React.ReactElement<DrivePlayCardProps & WithFocusableProps>;
|
|
39
|
+
setState<K extends keyof import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>(state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | ((prevState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, props: DrivePlayCardProps & WithFocusableProps) => import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>) | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>, callback?: (() => any) | undefined): void;
|
|
40
|
+
forceUpdate(callBack?: (() => any) | undefined): void;
|
|
41
|
+
props: Readonly<{
|
|
42
|
+
children?: React.ReactNode;
|
|
43
|
+
}> & Readonly<DrivePlayCardProps & WithFocusableProps>;
|
|
44
|
+
context: any;
|
|
45
|
+
refs: {
|
|
46
|
+
[key: string]: React.ReactInstance;
|
|
47
|
+
};
|
|
48
|
+
componentWillMount?(): void;
|
|
49
|
+
componentWillReceiveProps?(nextProps: Readonly<DrivePlayCardProps & WithFocusableProps>, nextContext: any): void;
|
|
50
|
+
shouldComponentUpdate?(nextProps: Readonly<DrivePlayCardProps & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): boolean;
|
|
51
|
+
componentWillUpdate?(nextProps: Readonly<DrivePlayCardProps & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
|
|
21
52
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
53
|
+
contextTypes: {
|
|
54
|
+
parentFocusKey: import("prop-types").Requireable<string>;
|
|
55
|
+
};
|
|
56
|
+
childContextTypes: {
|
|
57
|
+
parentFocusKey: import("prop-types").Requireable<string>;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export default _default;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { WithFocusableProps } from '@/external/spatial-navigation';
|
|
3
|
-
import { Layout } from '@/external/spatial-navigation/utils';
|
|
4
3
|
import './DriveSummary.styles.css';
|
|
5
4
|
import { DriveSummaryItem } from '../../view-model/StatsViewModel';
|
|
6
5
|
type DriveSummaryProps = {
|
|
@@ -8,16 +7,9 @@ type DriveSummaryProps = {
|
|
|
8
7
|
onItemEnterPress: () => void;
|
|
9
8
|
};
|
|
10
9
|
export default class DriveSummary extends React.Component<DriveSummaryProps & WithFocusableProps> {
|
|
11
|
-
static contextTypes: {
|
|
12
|
-
refsMap: React.Requireable<any>;
|
|
13
|
-
setRef: React.Requireable<any>;
|
|
14
|
-
scrollToFocusedElement: React.Requireable<any>;
|
|
15
|
-
};
|
|
16
|
-
context: import("@/components/core/ScrollableContainer/ScrollableContainer").ScrollableContainerContextType;
|
|
17
10
|
state: {
|
|
18
11
|
expanded: boolean;
|
|
19
12
|
};
|
|
20
|
-
onBecameFocused: (layout: Layout) => void;
|
|
21
13
|
handleEnterPress: (_props: any, _details: any) => void;
|
|
22
14
|
collapseCard: () => void;
|
|
23
15
|
render(): React.JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DrivePlay } from '../../../interfaces/IStats';
|
|
3
|
+
import { Direction } from '@/external/spatial-navigation/utils';
|
|
4
|
+
import './DriveSummaryExpanded.styles.css';
|
|
5
|
+
type Props = {
|
|
6
|
+
plays: DrivePlay[];
|
|
7
|
+
id: string;
|
|
8
|
+
parentFocusKey?: string;
|
|
9
|
+
collapseCard: () => void;
|
|
10
|
+
onItemEnterPress: () => void;
|
|
11
|
+
};
|
|
12
|
+
declare class DriveSummaryExpanded extends React.Component<Props> {
|
|
13
|
+
refsArray: HTMLDivElement[];
|
|
14
|
+
transitionEndListenerAttached: boolean;
|
|
15
|
+
transitionEndHandler: (() => void) | null;
|
|
16
|
+
wrapperRef: HTMLDivElement | null;
|
|
17
|
+
state: {
|
|
18
|
+
maxHeight: string;
|
|
19
|
+
focusedIndex: number;
|
|
20
|
+
};
|
|
21
|
+
onPlayArrowPress: (index: number) => (direction: Direction, _props: any) => false | undefined;
|
|
22
|
+
updateMaxHeight(focusedIndex: number): void;
|
|
23
|
+
scrollToElement(focusedIndex: number): void;
|
|
24
|
+
onBecameFocused: (focusedIndex: number) => () => void;
|
|
25
|
+
render(): React.JSX.Element;
|
|
26
|
+
}
|
|
27
|
+
export default DriveSummaryExpanded;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import './DriveSummaryHeader.styles.css';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
type Props = {
|
|
4
|
+
team: {
|
|
5
|
+
displayName: string;
|
|
6
|
+
logo?: string;
|
|
7
|
+
};
|
|
8
|
+
expanded: boolean;
|
|
9
|
+
focused: boolean;
|
|
10
|
+
hasPlays: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const DriveSummaryHeader: (props: Props) => React.JSX.Element;
|
|
13
|
+
export default DriveSummaryHeader;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './MainStat.styles.css';
|
|
3
|
+
type Props = {
|
|
4
|
+
playsQuantity: string;
|
|
5
|
+
yards: string;
|
|
6
|
+
time: string;
|
|
7
|
+
lastPlayMarquee?: string;
|
|
8
|
+
focused: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const MainStat: (props: Props) => React.JSX.Element;
|
|
11
|
+
export default MainStat;
|
|
@@ -1,18 +1,52 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="prop-types" />
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import './MatchPredictorView.styles.css';
|
|
3
4
|
import { WithFocusableProps } from '@/external/spatial-navigation';
|
|
4
|
-
import { Layout } from '@/external/spatial-navigation/utils';
|
|
5
5
|
import { StatsMatchPredictorItem } from '../../view-model/StatsViewModel';
|
|
6
6
|
export interface MatchPredictorProps {
|
|
7
7
|
item: StatsMatchPredictorItem;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
declare const _default: {
|
|
10
|
+
new (props?: (MatchPredictorProps & WithFocusableProps) | undefined, context?: any): {
|
|
11
|
+
state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState;
|
|
12
|
+
navigation: import("../../../../external/spatial-navigation/spatialNavigation").default;
|
|
13
|
+
getChildContext(): {
|
|
14
|
+
parentFocusKey: string;
|
|
15
|
+
};
|
|
16
|
+
setFocus: (focusKey: string) => void;
|
|
17
|
+
navigateByDirection: (direction: import("../../../../external/spatial-navigation/utils").Direction, details?: Record<string, any>) => void;
|
|
18
|
+
stealFocus: () => void;
|
|
19
|
+
onUpdateFocus: (focused: boolean) => void;
|
|
20
|
+
onUpdateHasFocusedChild: (hasFocusedChild: boolean) => void;
|
|
21
|
+
onEnterPressHandler: (details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
22
|
+
onEnterReleaseHandler: () => void;
|
|
23
|
+
onBackPressHandler: (details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
24
|
+
onArrowPressHandler: (direction: import("../../../../external/spatial-navigation/utils").Direction, details: import("../../../../external/spatial-navigation/utils").Details) => boolean | void;
|
|
25
|
+
onBecameFocusedHandler: (layout: import("../../../../external/spatial-navigation/utils").Layout, details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
26
|
+
onBecameBlurredHandler: (layout: import("../../../../external/spatial-navigation/utils").Layout, details: import("../../../../external/spatial-navigation/utils").Details) => void;
|
|
27
|
+
componentDidMount(): void;
|
|
28
|
+
componentDidUpdate(): void;
|
|
29
|
+
componentWillUnmount(): void;
|
|
30
|
+
render(): React.ReactElement<MatchPredictorProps & WithFocusableProps>;
|
|
31
|
+
setState<K extends keyof import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>(state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | ((prevState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, props: MatchPredictorProps & WithFocusableProps) => import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>) | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>, callback?: (() => any) | undefined): void;
|
|
32
|
+
forceUpdate(callBack?: (() => any) | undefined): void;
|
|
33
|
+
props: Readonly<{
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
}> & Readonly<MatchPredictorProps & WithFocusableProps>;
|
|
36
|
+
context: any;
|
|
37
|
+
refs: {
|
|
38
|
+
[key: string]: React.ReactInstance;
|
|
39
|
+
};
|
|
40
|
+
componentWillMount?(): void;
|
|
41
|
+
componentWillReceiveProps?(nextProps: Readonly<MatchPredictorProps & WithFocusableProps>, nextContext: any): void;
|
|
42
|
+
shouldComponentUpdate?(nextProps: Readonly<MatchPredictorProps & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): boolean;
|
|
43
|
+
componentWillUpdate?(nextProps: Readonly<MatchPredictorProps & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
|
|
14
44
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
45
|
+
contextTypes: {
|
|
46
|
+
parentFocusKey: import("prop-types").Requireable<string>;
|
|
47
|
+
};
|
|
48
|
+
childContextTypes: {
|
|
49
|
+
parentFocusKey: import("prop-types").Requireable<string>;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export default _default;
|
|
@@ -10,6 +10,7 @@ declare class BetsService {
|
|
|
10
10
|
/**
|
|
11
11
|
* Get non-personalized bets for an event
|
|
12
12
|
*
|
|
13
|
+
* @deprecated Use getPersonalizedBets instead. This method is kept for backward compatibility.
|
|
13
14
|
* @param eventID - The ID of the event
|
|
14
15
|
* @returns Promise with the bets data
|
|
15
16
|
*/
|
|
@@ -18,39 +19,58 @@ declare class BetsService {
|
|
|
18
19
|
* Get personalized bets for an event
|
|
19
20
|
*
|
|
20
21
|
* @param eventID - The ID of the event
|
|
21
|
-
* @param swid - The ESPN SWID parameter
|
|
22
|
-
* @param jwt - The authorization JWT
|
|
22
|
+
* @param swid - The ESPN SWID parameter (format provided by client app delegate)
|
|
23
|
+
* @param jwt - The authorization JWT (empty string for anonymous users)
|
|
23
24
|
* @returns Promise with the personalized bets data
|
|
24
25
|
*/
|
|
25
26
|
getPersonalizedBets(eventID: string, swid: string, jwt: string): Promise<IPersonalizedBetsResponse>;
|
|
26
27
|
/**
|
|
27
|
-
*
|
|
28
|
+
* Get personalized bets for an event with headers
|
|
29
|
+
*
|
|
30
|
+
* @param eventID - The ID of the event
|
|
31
|
+
* @param swid - The ESPN SWID parameter (format provided by client app delegate)
|
|
32
|
+
* @param jwt - The authorization JWT (empty string for anonymous users)
|
|
33
|
+
* @returns Promise with the personalized bets data and headers
|
|
34
|
+
*/
|
|
35
|
+
getPersonalizedBetsWithHeaders(eventID: string, swid: string, jwt: string): Promise<{
|
|
36
|
+
data: IPersonalizedBetsResponse;
|
|
37
|
+
headers: Record<string, string>;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Start polling for personalized bets
|
|
28
41
|
*
|
|
29
42
|
* @param eventID - The ID of the event
|
|
43
|
+
* @param swid - The ESPN SWID parameter
|
|
44
|
+
* @param jwt - The authorization JWT
|
|
30
45
|
* @param interval - The polling interval in milliseconds
|
|
31
46
|
* @param onData - Callback for successful data fetch
|
|
32
47
|
* @param onError - Callback for errors
|
|
33
48
|
* @returns Object with a stop function to stop polling
|
|
34
49
|
*/
|
|
35
|
-
|
|
50
|
+
pollPersonalizedBets(eventID: string, swid: string, jwt: string, interval: number, onData: (data: IPersonalizedBetsResponse) => void, onError?: (error: Error) => void): {
|
|
36
51
|
stop: () => void;
|
|
37
52
|
};
|
|
38
53
|
/**
|
|
39
|
-
* Start polling for personalized bets
|
|
54
|
+
* Start polling for personalized bets and return both data and headers
|
|
40
55
|
*
|
|
41
56
|
* @param eventID - The ID of the event
|
|
42
57
|
* @param swid - The ESPN SWID parameter
|
|
43
58
|
* @param jwt - The authorization JWT
|
|
44
59
|
* @param interval - The polling interval in milliseconds
|
|
45
|
-
* @param onData - Callback for successful data fetch
|
|
60
|
+
* @param onData - Callback for successful data fetch with headers
|
|
46
61
|
* @param onError - Callback for errors
|
|
47
62
|
* @returns Object with a stop function to stop polling
|
|
48
63
|
*/
|
|
49
|
-
|
|
64
|
+
pollPersonalizedBetsWithHeaders(eventID: string, swid: string, jwt: string, interval: number, onData: (response: {
|
|
65
|
+
data: IPersonalizedBetsResponse;
|
|
66
|
+
headers: Record<string, string>;
|
|
67
|
+
}) => void, onError?: (error: Error) => void): {
|
|
50
68
|
stop: () => void;
|
|
51
69
|
};
|
|
52
70
|
/**
|
|
53
71
|
* Get the endpoint for non-personalized bets
|
|
72
|
+
*
|
|
73
|
+
* @deprecated This endpoint is no longer used.
|
|
54
74
|
*/
|
|
55
75
|
nonPersonalizedBetsEndpoint(eventID: string): string;
|
|
56
76
|
/**
|
|
@@ -66,6 +66,21 @@ declare class NetworkManager {
|
|
|
66
66
|
useCache?: boolean;
|
|
67
67
|
skipResponseBodyDeserialization?: boolean;
|
|
68
68
|
}): Promise<T>;
|
|
69
|
+
/**
|
|
70
|
+
* Make a request to an external API and return both data and headers
|
|
71
|
+
*/
|
|
72
|
+
externalApiRequestWithHeaders<T = any>({ endpoint, method, params, data, headers, useCache, skipResponseBodyDeserialization, }: {
|
|
73
|
+
endpoint: string;
|
|
74
|
+
method?: HttpMethod;
|
|
75
|
+
params?: Record<string, any>;
|
|
76
|
+
data?: any;
|
|
77
|
+
headers?: Record<string, string>;
|
|
78
|
+
useCache?: boolean;
|
|
79
|
+
skipResponseBodyDeserialization?: boolean;
|
|
80
|
+
}): Promise<{
|
|
81
|
+
data: T;
|
|
82
|
+
headers: Record<string, string>;
|
|
83
|
+
}>;
|
|
69
84
|
/**
|
|
70
85
|
* Start polling a Maestro API endpoint at specified interval
|
|
71
86
|
*/
|
|
@@ -102,6 +117,25 @@ declare class NetworkManager {
|
|
|
102
117
|
}): {
|
|
103
118
|
stop: () => void;
|
|
104
119
|
};
|
|
120
|
+
/**
|
|
121
|
+
* Start polling an external API endpoint at specified interval and return both data and headers
|
|
122
|
+
*/
|
|
123
|
+
pollExternalApiRequestWithHeaders<T = any>({ endpoint, interval, method, params, data, headers, skipResponseBodyDeserialization, onData, onError, }: {
|
|
124
|
+
endpoint: string;
|
|
125
|
+
interval: number;
|
|
126
|
+
method?: HttpMethod;
|
|
127
|
+
params?: Record<string, any>;
|
|
128
|
+
data?: any;
|
|
129
|
+
headers?: Record<string, string>;
|
|
130
|
+
skipResponseBodyDeserialization?: boolean;
|
|
131
|
+
onData: (data: {
|
|
132
|
+
data: T;
|
|
133
|
+
headers: Record<string, string>;
|
|
134
|
+
}) => void;
|
|
135
|
+
onError?: (error: Error) => void;
|
|
136
|
+
}): {
|
|
137
|
+
stop: () => void;
|
|
138
|
+
};
|
|
105
139
|
/**
|
|
106
140
|
* Stop all polling tasks
|
|
107
141
|
*/
|
|
@@ -30,6 +30,15 @@ export interface IServiceNetworkManager {
|
|
|
30
30
|
useCache?: boolean;
|
|
31
31
|
skipResponseBodyDeserialization?: boolean;
|
|
32
32
|
}): Promise<T>;
|
|
33
|
+
externalApiRequestWithHeaders<T = any>(options: {
|
|
34
|
+
endpoint: string;
|
|
35
|
+
method?: string;
|
|
36
|
+
params?: Record<string, any>;
|
|
37
|
+
headers?: Record<string, string>;
|
|
38
|
+
data?: any;
|
|
39
|
+
useCache?: boolean;
|
|
40
|
+
skipResponseBodyDeserialization?: boolean;
|
|
41
|
+
}): Promise<ResponseWithHeaders<T>>;
|
|
33
42
|
pollExternalApiRequest<T = any>(options: {
|
|
34
43
|
endpoint: string;
|
|
35
44
|
interval: number;
|
|
@@ -42,6 +51,18 @@ export interface IServiceNetworkManager {
|
|
|
42
51
|
}): {
|
|
43
52
|
stop: () => void;
|
|
44
53
|
};
|
|
54
|
+
pollExternalApiRequestWithHeaders<T = any>(options: {
|
|
55
|
+
endpoint: string;
|
|
56
|
+
interval: number;
|
|
57
|
+
method?: string;
|
|
58
|
+
params?: Record<string, any>;
|
|
59
|
+
headers?: Record<string, string>;
|
|
60
|
+
data?: any;
|
|
61
|
+
onData: (data: ResponseWithHeaders<T>) => void;
|
|
62
|
+
onError?: (error: Error) => void;
|
|
63
|
+
}): {
|
|
64
|
+
stop: () => void;
|
|
65
|
+
};
|
|
45
66
|
}
|
|
46
67
|
/**
|
|
47
68
|
* Stats service NetworkManager interface
|
|
@@ -71,3 +92,10 @@ export type ServiceNetworkManager = IStatsNetworkManager | IBetsNetworkManager |
|
|
|
71
92
|
export interface NetworkManagerFactoryConfig {
|
|
72
93
|
defaultCacheDuration?: number;
|
|
73
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Interface for responses that include both data and headers
|
|
97
|
+
*/
|
|
98
|
+
export interface ResponseWithHeaders<T> {
|
|
99
|
+
data: T;
|
|
100
|
+
headers: Record<string, string>;
|
|
101
|
+
}
|