@inappstory/slide-api 0.1.24 → 0.1.26
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.cjs +2157 -360
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +149 -70
- package/dist/index.d.ts +149 -70
- package/dist/index.js +2157 -360
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
import { Player } from '@inappstory/video-player';
|
|
2
2
|
|
|
3
|
+
declare const enum CARD_TYPE {
|
|
4
|
+
STORY = 1,
|
|
5
|
+
UGC_STORY = 2,
|
|
6
|
+
GAME_CARD = 3,
|
|
7
|
+
IN_APP_MESSAGING = 4,
|
|
8
|
+
BANNER = 5
|
|
9
|
+
}
|
|
10
|
+
type GetSdkClientVariables = () => Record<string, any>;
|
|
11
|
+
interface ShowSlideEvent {
|
|
12
|
+
cardId: number;
|
|
13
|
+
index: number;
|
|
14
|
+
}
|
|
15
|
+
interface SlideLeftEvent {
|
|
16
|
+
cardId: number;
|
|
17
|
+
index: number;
|
|
18
|
+
}
|
|
19
|
+
interface EventHandlersEventMap {
|
|
20
|
+
showSlide: ShowSlideEvent;
|
|
21
|
+
slideLeft: SlideLeftEvent;
|
|
22
|
+
}
|
|
23
|
+
declare const enum CARD_LOADING_STATE {
|
|
24
|
+
LOADING = 0,
|
|
25
|
+
LOADED = 1,
|
|
26
|
+
LOADING_ERROR = 2
|
|
27
|
+
}
|
|
28
|
+
declare const enum SLIDE_IN_CACHE_STATUS {
|
|
29
|
+
FAILURE = 0,
|
|
30
|
+
SUCCESS = 1
|
|
31
|
+
}
|
|
32
|
+
|
|
3
33
|
interface IAnimation {
|
|
4
34
|
init(slide: HTMLElement, animate?: boolean): void;
|
|
5
35
|
start(slide: HTMLElement, animate?: boolean): void | ((isStop: boolean) => () => void);
|
|
@@ -996,6 +1026,8 @@ declare global {
|
|
|
996
1026
|
type: "text";
|
|
997
1027
|
textValue: string;
|
|
998
1028
|
}) => void;
|
|
1029
|
+
_onEvent<K extends keyof EventHandlersEventMap>(name: K, event: EventHandlersEventMap[K]): void;
|
|
1030
|
+
_onCardLoadingStateChange(state: CARD_LOADING_STATE, reason?: string): void;
|
|
999
1031
|
}
|
|
1000
1032
|
}
|
|
1001
1033
|
|
|
@@ -1005,21 +1037,25 @@ declare class SlideTimeline {
|
|
|
1005
1037
|
private readonly slideDisabledTimer;
|
|
1006
1038
|
private readonly slideReady;
|
|
1007
1039
|
private readonly _afterAppResumeQueuePush;
|
|
1008
|
-
private readonly
|
|
1009
|
-
constructor(slideIndex: number, slideDuration: number, slideDisabledTimer: boolean, slideReady: Promise<void>, _afterAppResumeQueuePush: (cb: () => void) => void,
|
|
1040
|
+
private readonly slideApiDeps;
|
|
1041
|
+
constructor(slideIndex: number, slideDuration: number, slideDisabledTimer: boolean, slideReady: Promise<void>, _afterAppResumeQueuePush: (cb: () => void) => void, slideApiDeps: ISlideApiDeps);
|
|
1010
1042
|
private resumedAt;
|
|
1011
1043
|
private timeSpent;
|
|
1012
1044
|
private timelineDisabledState;
|
|
1013
1045
|
private currentState;
|
|
1046
|
+
private deferredDataWaitingStateTimerId;
|
|
1047
|
+
private deferredResumeStateTimerId;
|
|
1048
|
+
private dataWaitingStartedAt;
|
|
1014
1049
|
static get layoutService(): LayoutService;
|
|
1015
1050
|
private get layoutService();
|
|
1016
1051
|
get isSDKSupportUpdateTimeline(): boolean;
|
|
1017
1052
|
get isSdkSupportTimelineOnBeforeStart(): boolean;
|
|
1018
1053
|
get index(): number;
|
|
1019
1054
|
get isTimelineDisabled(): boolean;
|
|
1055
|
+
get durationMs(): number;
|
|
1020
1056
|
private updateTimeline;
|
|
1021
1057
|
/**
|
|
1022
|
-
* trigger timeline update for new slide in sdk, before slide
|
|
1058
|
+
* trigger timeline update for new slide in sdk, before slide start event (prevent timeout in timeline while we wait for video start)
|
|
1023
1059
|
*/
|
|
1024
1060
|
triggerSlideLoadState(): void;
|
|
1025
1061
|
/**
|
|
@@ -1031,8 +1067,8 @@ declare class SlideTimeline {
|
|
|
1031
1067
|
/**
|
|
1032
1068
|
*
|
|
1033
1069
|
*/
|
|
1034
|
-
slidePaused(
|
|
1035
|
-
slideResumed(
|
|
1070
|
+
slidePaused(currentTime: number | null): void;
|
|
1071
|
+
slideResumed(getVideoCurrentTime?: () => number): void;
|
|
1036
1072
|
slideStopped(): void;
|
|
1037
1073
|
/**
|
|
1038
1074
|
* Update timer state (duration from 0 to actual value) and start timeline
|
|
@@ -1041,6 +1077,9 @@ declare class SlideTimeline {
|
|
|
1041
1077
|
startDisabledTimeline(fallback: () => void): void;
|
|
1042
1078
|
onSlideDataWaiting(videoCurrentTime: number | null): void;
|
|
1043
1079
|
onSlideError(videoCurrentTime: number | null): void;
|
|
1080
|
+
private clearDeferredDataWaitingStateTimerId;
|
|
1081
|
+
private clearDeferredResumeStateTimerId;
|
|
1082
|
+
private onBeforeStateChanged;
|
|
1044
1083
|
}
|
|
1045
1084
|
|
|
1046
1085
|
type APIResponse<DTO> = {
|
|
@@ -1104,6 +1143,7 @@ interface SDKApi {
|
|
|
1104
1143
|
cardShowNext(): void;
|
|
1105
1144
|
setCardSessionValue(element: HTMLElement, key: string, value: string): void;
|
|
1106
1145
|
getCardSessionValue(element: HTMLElement, key: string): string | undefined;
|
|
1146
|
+
isSdkSupportUpdateTimeline(): boolean;
|
|
1107
1147
|
updateTimeline(slideIndex: number, action: TIMELINE_ACTION, currentTime: number, duration: number, showLoader: boolean, showError: boolean): void;
|
|
1108
1148
|
/** @deprecated, used only in native sdk **/
|
|
1109
1149
|
cardPausedCallback(currentTime: number | null): void;
|
|
@@ -1125,16 +1165,60 @@ interface SDKApi {
|
|
|
1125
1165
|
}): void;
|
|
1126
1166
|
isSdkSupportTimelineOnBeforeStart(): boolean;
|
|
1127
1167
|
isSdkSupportCorrectPauseResumeLifecycle(): boolean;
|
|
1168
|
+
emitEvent<K extends keyof EventHandlersEventMap>(name: K, event: EventHandlersEventMap[K]): void;
|
|
1169
|
+
onCardLoadingStateChange(state: CARD_LOADING_STATE, reason?: string): void;
|
|
1128
1170
|
}
|
|
1129
1171
|
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1172
|
+
interface ISlideApiDeps {
|
|
1173
|
+
getWidgetsSharedData: SDKApi["getWidgetsSharedData"];
|
|
1174
|
+
showToast: SDKApi["showToast"];
|
|
1175
|
+
writeToClipboard: SDKApi["writeToClipboard"];
|
|
1176
|
+
isExistsShare: SDKApi["isExistsShare"];
|
|
1177
|
+
sdkCanSendShareComplete: SDKApi["sdkCanSendShareComplete"];
|
|
1178
|
+
share: SDKApi["share"];
|
|
1179
|
+
shareSlideScreenshot: SDKApi["shareSlideScreenshot"];
|
|
1180
|
+
getCardSessionValue: SDKApi["getCardSessionValue"];
|
|
1181
|
+
setCardSessionValue: SDKApi["setCardSessionValue"];
|
|
1182
|
+
isAndroid: SDKApi["isAndroid"];
|
|
1183
|
+
isWeb: SDKApi["isWeb"];
|
|
1184
|
+
isIOS: SDKApi["isIOS"];
|
|
1185
|
+
isExistsShowCardTextInput: SDKApi["isExistsShowCardTextInput"];
|
|
1186
|
+
showCardTextInput: SDKApi["showCardTextInput"];
|
|
1187
|
+
openUrl: SDKApi["openUrl"];
|
|
1188
|
+
openGame: SDKApi["openGame"];
|
|
1189
|
+
openStory: SDKApi["openStory"];
|
|
1190
|
+
closeCard: SDKApi["closeCard"];
|
|
1191
|
+
vibrate: SDKApi["vibrate"];
|
|
1192
|
+
disableVerticalSwipeGesture: SDKApi["disableVerticalSwipeGesture"];
|
|
1193
|
+
enableVerticalSwipeGesture: SDKApi["enableVerticalSwipeGesture"];
|
|
1194
|
+
disableBackpress: SDKApi["disableBackpress"];
|
|
1195
|
+
enableBackpress: SDKApi["enableBackpress"];
|
|
1196
|
+
sendApiRequest: SDKApi["sendApiRequest"];
|
|
1197
|
+
sendStatisticEvent: SDKApi["sendStatisticEvent"];
|
|
1198
|
+
setCardLocalData: SDKApi["setCardLocalData"];
|
|
1199
|
+
getCardLocalData: SDKApi["getCardLocalData"];
|
|
1200
|
+
getCardServerData: SDKApi["getCardServerData"];
|
|
1201
|
+
cardAnimation: SDKApi["cardAnimation"];
|
|
1202
|
+
updateCardServerDataLocally: SDKApi["updateCardServerDataLocally"];
|
|
1203
|
+
getCardFonts: SDKApi["getCardFonts"];
|
|
1204
|
+
isExistsShowNextCard: SDKApi["isExistsShowNextCard"];
|
|
1205
|
+
cardShowNext: SDKApi["cardShowNext"];
|
|
1206
|
+
isExistsShowCardSlide: SDKApi["isExistsShowCardSlide"];
|
|
1207
|
+
showCardSlide: SDKApi["showCardSlide"];
|
|
1208
|
+
enableHorizontalSwipeGesture: SDKApi["enableHorizontalSwipeGesture"];
|
|
1209
|
+
disableHorizontalSwipeGesture: SDKApi["disableHorizontalSwipeGesture"];
|
|
1210
|
+
isExistsShowLayer: SDKApi["isExistsShowLayer"];
|
|
1211
|
+
showLayer: SDKApi["showLayer"];
|
|
1212
|
+
showNextSlide: SDKApi["showNextSlide"];
|
|
1213
|
+
isSdkSupportCorrectPauseResumeLifecycle: SDKApi["isSdkSupportCorrectPauseResumeLifecycle"];
|
|
1214
|
+
isSdkSupportTimelineOnBeforeStart: SDKApi["isSdkSupportTimelineOnBeforeStart"];
|
|
1215
|
+
isSdkSupportUpdateTimeline: SDKApi["isSdkSupportUpdateTimeline"];
|
|
1216
|
+
updateTimeline: SDKApi["updateTimeline"];
|
|
1217
|
+
/** @deprecated, used only in native sdk **/
|
|
1218
|
+
cardPausedCallback: SDKApi["cardPausedCallback"];
|
|
1219
|
+
/** @deprecated, used only in native sdk **/
|
|
1220
|
+
cardResumedCallback: SDKApi["cardResumedCallback"];
|
|
1136
1221
|
}
|
|
1137
|
-
type GetSdkClientVariables = () => Record<string, any>;
|
|
1138
1222
|
|
|
1139
1223
|
type WidgetOptionsBase = {
|
|
1140
1224
|
slide: HTMLElement | null;
|
|
@@ -1174,7 +1258,7 @@ type WidgetCallbacks = {
|
|
|
1174
1258
|
onWidgetRequireResumeUI: OnWidgetRequireResumeUI;
|
|
1175
1259
|
};
|
|
1176
1260
|
type WidgetDeps = {
|
|
1177
|
-
|
|
1261
|
+
slideApiDeps: ISlideApiDeps;
|
|
1178
1262
|
slideRoot: HTMLElement;
|
|
1179
1263
|
getLayoutDirection: () => "ltr" | "rtl";
|
|
1180
1264
|
getSdkClientVariables: GetSdkClientVariables;
|
|
@@ -1245,15 +1329,15 @@ declare class WidgetBase<WidgetOptions extends WidgetOptionsBase> {
|
|
|
1245
1329
|
static createInstance<Widget extends WidgetBase<WidgetOptions>, WidgetOptions extends WidgetOptionsBase>(instantiate: (element: HTMLElement, options: Partial<WidgetOptions>) => Widget, element: HTMLElement, options: Partial<WidgetOptions>): Widget;
|
|
1246
1330
|
static initWidget<Widget extends WidgetBase<WidgetOptions>, WidgetOptions extends WidgetOptionsBase>(htmlElement: HTMLElement, localData: Record<string, any>, instantiate: (element: HTMLElement, options: Partial<WidgetOptions>) => Widget): Promise<Record<string, any>>;
|
|
1247
1331
|
static get widgetsService(): WidgetsService;
|
|
1248
|
-
static getLocalData(
|
|
1332
|
+
static getLocalData(slideApiDeps: ISlideApiDeps): Promise<Record<string, any>>;
|
|
1249
1333
|
getLocalData(): Promise<Record<string, any>>;
|
|
1250
|
-
static setLocalData(
|
|
1334
|
+
static setLocalData(slideApiDeps: ISlideApiDeps, keyValue: Record<string, any>, sendToServer?: boolean, syncWithRuntimeLocalData?: boolean): void;
|
|
1251
1335
|
setLocalData(keyValue: Record<string, any>, sendToServer?: boolean, syncWithRuntimeLocalData?: boolean): void;
|
|
1252
1336
|
get statisticEventBaseFieldsShortForm(): StatisticEventBaseFieldsShortForm;
|
|
1253
1337
|
static getStatisticEventBaseFieldsShortForm(cardId: number, cardType: CARD_TYPE, slideIndex: number): StatisticEventBaseFieldsShortForm;
|
|
1254
1338
|
get statisticEventBaseFieldsFullForm(): StatisticEventBaseFieldsFullForm;
|
|
1255
1339
|
static getStatisticEventBaseFieldsFullForm(cardId: number, cardType: CARD_TYPE, slideIndex: number): StatisticEventBaseFieldsFullForm;
|
|
1256
|
-
static sendStatisticEventToApp(
|
|
1340
|
+
static sendStatisticEventToApp(slideApiDeps: ISlideApiDeps, name: string, data: Record<string, string | number | Array<string | number>>, devPayload?: Record<string, string | number | Array<string | number>>, options?: {
|
|
1257
1341
|
forceEnableStatisticV2?: boolean;
|
|
1258
1342
|
}): void;
|
|
1259
1343
|
sendStatisticEventToApp(name: string, data: Record<string, string | number | Array<string | number>>, devPayload?: Record<string, string | number | Array<string | number>>, options?: {
|
|
@@ -1418,6 +1502,8 @@ interface SDKInterface {
|
|
|
1418
1502
|
type: "text";
|
|
1419
1503
|
textValue: string;
|
|
1420
1504
|
}): void;
|
|
1505
|
+
onEvent<K extends keyof EventHandlersEventMap>(name: K, event: EventHandlersEventMap[K]): void;
|
|
1506
|
+
onCardLoadingStateChange(state: CARD_LOADING_STATE, reason?: string): void;
|
|
1421
1507
|
}
|
|
1422
1508
|
|
|
1423
1509
|
type LocalData = Record<string, any>;
|
|
@@ -1429,6 +1515,7 @@ declare global {
|
|
|
1429
1515
|
}
|
|
1430
1516
|
|
|
1431
1517
|
interface IElement {
|
|
1518
|
+
get nodeRef(): HTMLElement;
|
|
1432
1519
|
init(localData: LocalData): Promise<boolean>;
|
|
1433
1520
|
onPause(): void;
|
|
1434
1521
|
onResume(): void;
|
|
@@ -1451,6 +1538,7 @@ declare class DataInput implements IElement {
|
|
|
1451
1538
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _widgetApi: typeof WidgetDataInput.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
|
|
1452
1539
|
static isTypeOf(element: IElement): element is DataInput;
|
|
1453
1540
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1541
|
+
get nodeRef(): HTMLElement;
|
|
1454
1542
|
init(localData: LocalData): Promise<boolean>;
|
|
1455
1543
|
onPause(): void;
|
|
1456
1544
|
onResume(): void;
|
|
@@ -1473,6 +1561,7 @@ declare class Poll implements IElement {
|
|
|
1473
1561
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _widgetApi: typeof WidgetPoll.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
|
|
1474
1562
|
static isTypeOf(element: IElement): element is Poll;
|
|
1475
1563
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1564
|
+
get nodeRef(): HTMLElement;
|
|
1476
1565
|
init(localData: LocalData): Promise<boolean>;
|
|
1477
1566
|
onPause(): void;
|
|
1478
1567
|
onResume(): void;
|
|
@@ -1496,6 +1585,7 @@ declare class PollLayers implements IElement {
|
|
|
1496
1585
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _layersNodesRefs: Array<HTMLElement>, _widgetApi: typeof WidgetPollLayers.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
|
|
1497
1586
|
static isTypeOf(element: IElement): element is PollLayers;
|
|
1498
1587
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1588
|
+
get nodeRef(): HTMLElement;
|
|
1499
1589
|
init(localData: LocalData): Promise<boolean>;
|
|
1500
1590
|
onPause(): void;
|
|
1501
1591
|
onResume(): void;
|
|
@@ -1517,6 +1607,7 @@ declare class Products implements IElement {
|
|
|
1517
1607
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _widgetApi: typeof WidgetProducts.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
|
|
1518
1608
|
static isTypeOf(element: IElement): element is Products;
|
|
1519
1609
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1610
|
+
get nodeRef(): HTMLElement;
|
|
1520
1611
|
init(localData: LocalData): Promise<boolean>;
|
|
1521
1612
|
onPause(): void;
|
|
1522
1613
|
onResume(): void;
|
|
@@ -1541,6 +1632,7 @@ declare class Quest implements IElement {
|
|
|
1541
1632
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _widgetApi: typeof WidgetQuest.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
|
|
1542
1633
|
static isTypeOf(element: IElement): element is Quest;
|
|
1543
1634
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1635
|
+
get nodeRef(): HTMLElement;
|
|
1544
1636
|
init(localData: LocalData): Promise<boolean>;
|
|
1545
1637
|
onPause(): void;
|
|
1546
1638
|
onResume(): void;
|
|
@@ -1569,6 +1661,7 @@ declare class Quiz implements IElement {
|
|
|
1569
1661
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _widgetApi: typeof WidgetQuiz.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
|
|
1570
1662
|
static isTypeOf(element: IElement): element is Quiz;
|
|
1571
1663
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1664
|
+
get nodeRef(): HTMLElement;
|
|
1572
1665
|
init(localData: LocalData): Promise<boolean>;
|
|
1573
1666
|
onPause(): void;
|
|
1574
1667
|
onResume(): void;
|
|
@@ -1591,6 +1684,7 @@ declare class QuizGrouped implements IElement {
|
|
|
1591
1684
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _widgetApi: typeof WidgetQuizGrouped.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
|
|
1592
1685
|
static isTypeOf(element: IElement): element is QuizGrouped;
|
|
1593
1686
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1687
|
+
get nodeRef(): HTMLElement;
|
|
1594
1688
|
init(localData: LocalData): Promise<boolean>;
|
|
1595
1689
|
onPause(): void;
|
|
1596
1690
|
onResume(): void;
|
|
@@ -1613,6 +1707,7 @@ declare class RangeSlider implements IElement {
|
|
|
1613
1707
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _widgetApi: typeof WidgetRangeSlider.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
|
|
1614
1708
|
static isTypeOf(element: IElement): element is RangeSlider;
|
|
1615
1709
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1710
|
+
get nodeRef(): HTMLElement;
|
|
1616
1711
|
init(localData: LocalData): Promise<boolean>;
|
|
1617
1712
|
onPause(): void;
|
|
1618
1713
|
onResume(): void;
|
|
@@ -1635,6 +1730,7 @@ declare class Rate implements IElement {
|
|
|
1635
1730
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _widgetApi: typeof WidgetRate.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
|
|
1636
1731
|
static isTypeOf(element: IElement): element is Rate;
|
|
1637
1732
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1733
|
+
get nodeRef(): HTMLElement;
|
|
1638
1734
|
init(localData: LocalData): Promise<boolean>;
|
|
1639
1735
|
onPause(): void;
|
|
1640
1736
|
onResume(): void;
|
|
@@ -1659,6 +1755,7 @@ declare class Share implements IElement {
|
|
|
1659
1755
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _layersNodesRefs: Array<HTMLElement>, _widgetApi: typeof WidgetShare.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
|
|
1660
1756
|
static isTypeOf(element: IElement): element is Share;
|
|
1661
1757
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1758
|
+
get nodeRef(): HTMLElement;
|
|
1662
1759
|
init(localData: LocalData): Promise<boolean>;
|
|
1663
1760
|
onPause(): void;
|
|
1664
1761
|
onResume(): void;
|
|
@@ -1678,6 +1775,7 @@ declare class SwipeUp implements IElement {
|
|
|
1678
1775
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer);
|
|
1679
1776
|
static isTypeOf(element: IElement): element is SwipeUp;
|
|
1680
1777
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1778
|
+
get nodeRef(): HTMLElement;
|
|
1681
1779
|
init(localData: LocalData): Promise<boolean>;
|
|
1682
1780
|
onPause(): void;
|
|
1683
1781
|
onResume(): void;
|
|
@@ -1697,6 +1795,7 @@ declare class SwipeUpItems implements IElement {
|
|
|
1697
1795
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer);
|
|
1698
1796
|
static isTypeOf(element: IElement): element is SwipeUpItems;
|
|
1699
1797
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1798
|
+
get nodeRef(): HTMLElement;
|
|
1700
1799
|
init(localData: LocalData): Promise<boolean>;
|
|
1701
1800
|
onPause(): void;
|
|
1702
1801
|
onResume(): void;
|
|
@@ -1719,6 +1818,7 @@ declare class Test implements IElement {
|
|
|
1719
1818
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _widgetApi: typeof WidgetTest.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
|
|
1720
1819
|
static isTypeOf(element: IElement): element is Test;
|
|
1721
1820
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1821
|
+
get nodeRef(): HTMLElement;
|
|
1722
1822
|
init(localData: LocalData): Promise<boolean>;
|
|
1723
1823
|
onPause(): void;
|
|
1724
1824
|
onResume(): void;
|
|
@@ -1735,7 +1835,7 @@ declare class Video implements IElement {
|
|
|
1735
1835
|
private readonly _elementNodeRef;
|
|
1736
1836
|
private readonly _layer;
|
|
1737
1837
|
private readonly _VideoPlayer;
|
|
1738
|
-
private readonly
|
|
1838
|
+
private readonly _slideApiDeps;
|
|
1739
1839
|
private static readonly _className;
|
|
1740
1840
|
static className(): string;
|
|
1741
1841
|
private readonly _video;
|
|
@@ -1743,9 +1843,10 @@ declare class Video implements IElement {
|
|
|
1743
1843
|
private readonly _vodData;
|
|
1744
1844
|
private _vodPlayerInstance;
|
|
1745
1845
|
private _videoStateAdapter;
|
|
1746
|
-
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _VideoPlayer: typeof Player | undefined,
|
|
1846
|
+
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _VideoPlayer: typeof Player | undefined, _slideApiDeps: ISlideApiDeps);
|
|
1747
1847
|
static isTypeOf(element: IElement): element is Video;
|
|
1748
1848
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1849
|
+
get nodeRef(): HTMLElement;
|
|
1749
1850
|
init(localData: LocalData): Promise<boolean>;
|
|
1750
1851
|
private _isScreenOnPause;
|
|
1751
1852
|
onPause(): void;
|
|
@@ -1753,6 +1854,7 @@ declare class Video implements IElement {
|
|
|
1753
1854
|
onStart(): void;
|
|
1754
1855
|
onStop(): void;
|
|
1755
1856
|
onBeforeUnmount(): Promise<void>;
|
|
1857
|
+
get durationMs(): number;
|
|
1756
1858
|
private _initVOD;
|
|
1757
1859
|
private _convertMpdUrls;
|
|
1758
1860
|
private _destroyVODPlayer;
|
|
@@ -1760,14 +1862,15 @@ declare class Video implements IElement {
|
|
|
1760
1862
|
get isLayerForcePaused(): boolean;
|
|
1761
1863
|
private _videoStartedPromise;
|
|
1762
1864
|
get videoStartedPromise(): Promise<{
|
|
1763
|
-
|
|
1865
|
+
getVideoCurrentTime: () => number;
|
|
1764
1866
|
}> | null;
|
|
1765
|
-
|
|
1766
|
-
|
|
1867
|
+
get isLooped(): boolean;
|
|
1868
|
+
start(muted: boolean | undefined, getIsLooped: () => boolean): Promise<{
|
|
1869
|
+
getVideoCurrentTime: () => number;
|
|
1767
1870
|
}>;
|
|
1768
1871
|
pause(resetVideoTime?: boolean): number | null;
|
|
1769
1872
|
resume(): Promise<{
|
|
1770
|
-
|
|
1873
|
+
getVideoCurrentTime: () => number;
|
|
1771
1874
|
}>;
|
|
1772
1875
|
stop({ prepareForRestart }: {
|
|
1773
1876
|
prepareForRestart: ON_SLIDE_STOP_PREPARE_FOR_RESTART;
|
|
@@ -1781,8 +1884,7 @@ declare class Slide {
|
|
|
1781
1884
|
private readonly _slideReadyPromise;
|
|
1782
1885
|
private readonly _afterAppResumeQueuePush;
|
|
1783
1886
|
private readonly _afterStartInitQueuePush;
|
|
1784
|
-
|
|
1785
|
-
readonly sdkApi: SDKApi;
|
|
1887
|
+
readonly slideApiDeps: ISlideApiDeps;
|
|
1786
1888
|
private readonly _slideRoot;
|
|
1787
1889
|
private readonly _getLayoutDirection;
|
|
1788
1890
|
private readonly _slidePauseUI;
|
|
@@ -1790,7 +1892,7 @@ declare class Slide {
|
|
|
1790
1892
|
private readonly _getSdkClientVariables;
|
|
1791
1893
|
private readonly _layers;
|
|
1792
1894
|
private _start;
|
|
1793
|
-
constructor(_slidesNodesRefs: Array<HTMLElement>, _slideReadyPromise: Promise<void>, _afterAppResumeQueuePush: (cb: () => void) => void, _afterStartInitQueuePush: (cb: () => void) => void,
|
|
1895
|
+
constructor(_slidesNodesRefs: Array<HTMLElement>, _slideReadyPromise: Promise<void>, _afterAppResumeQueuePush: (cb: () => void) => void, _afterStartInitQueuePush: (cb: () => void) => void, slideApiDeps: ISlideApiDeps, _slideRoot: HTMLElement, _getLayoutDirection: () => "ltr" | "rtl", _slidePauseUI: () => Promise<void>, _slideResumeUI: () => Promise<void>, _getSdkClientVariables: GetSdkClientVariables);
|
|
1794
1896
|
private _activeLayer;
|
|
1795
1897
|
get activeLayer(): Layer;
|
|
1796
1898
|
get layers(): Array<Layer>;
|
|
@@ -1820,8 +1922,7 @@ declare class Layer {
|
|
|
1820
1922
|
private readonly _slideReadyPromise;
|
|
1821
1923
|
private readonly _afterAppResumeQueuePush;
|
|
1822
1924
|
private readonly _afterStartInitQueuePush;
|
|
1823
|
-
|
|
1824
|
-
readonly sdkApi: SDKApi;
|
|
1925
|
+
readonly slideApiDeps: ISlideApiDeps;
|
|
1825
1926
|
private readonly _slideRoot;
|
|
1826
1927
|
private readonly _getLayoutDirection;
|
|
1827
1928
|
private readonly _slidePauseUI;
|
|
@@ -1837,7 +1938,7 @@ declare class Layer {
|
|
|
1837
1938
|
private _elements;
|
|
1838
1939
|
private readonly _timeline;
|
|
1839
1940
|
private readonly _widgetDeps;
|
|
1840
|
-
constructor(_nodeRef: HTMLElement, _slide: Slide, _slideReadyPromise: Promise<void>, _afterAppResumeQueuePush: (cb: () => void) => void, _afterStartInitQueuePush: (cb: () => void) => void,
|
|
1941
|
+
constructor(_nodeRef: HTMLElement, _slide: Slide, _slideReadyPromise: Promise<void>, _afterAppResumeQueuePush: (cb: () => void) => void, _afterStartInitQueuePush: (cb: () => void) => void, slideApiDeps: ISlideApiDeps, _slideRoot: HTMLElement, _getLayoutDirection: () => "ltr" | "rtl", _slidePauseUI: () => Promise<void>, _slideResumeUI: () => Promise<void>, _getSdkClientVariables: GetSdkClientVariables);
|
|
1841
1942
|
init(localData: LocalData): Array<Promise<boolean>>;
|
|
1842
1943
|
onAfterAllMediaResourcesLoaded(): void;
|
|
1843
1944
|
get nodeRef(): HTMLElement;
|
|
@@ -1846,6 +1947,7 @@ declare class Layer {
|
|
|
1846
1947
|
get timeline(): SlideTimeline;
|
|
1847
1948
|
get layoutService(): LayoutService;
|
|
1848
1949
|
getLocalData(): Promise<LocalData>;
|
|
1950
|
+
findElementByNodeRef(nodeRef: HTMLElement): IElement | undefined;
|
|
1849
1951
|
get isQuest(): boolean;
|
|
1850
1952
|
private _initTextFit;
|
|
1851
1953
|
private _initTextElementAutoWidthCorrection;
|
|
@@ -1890,34 +1992,24 @@ declare class Layer {
|
|
|
1890
1992
|
get isLayerForcePaused(): boolean;
|
|
1891
1993
|
}
|
|
1892
1994
|
|
|
1893
|
-
declare
|
|
1894
|
-
INIT = 0,
|
|
1895
|
-
INITED = 1,
|
|
1896
|
-
START = 2,
|
|
1897
|
-
STARTED = 3,
|
|
1898
|
-
RESUME = 4,
|
|
1899
|
-
RESUMED = 5,
|
|
1900
|
-
APP_PAUSE = 6,
|
|
1901
|
-
APP_PAUSED = 7,
|
|
1902
|
-
USER_PAUSE = 8,
|
|
1903
|
-
USER_PAUSED = 9,
|
|
1904
|
-
FORCE_PAUSED = 10,
|
|
1905
|
-
STOP = 11,
|
|
1906
|
-
STOPPED = 12,
|
|
1907
|
-
DESTROYED = 13
|
|
1908
|
-
}
|
|
1909
|
-
declare class SlideApi$1 {
|
|
1995
|
+
declare class CardApi {
|
|
1910
1996
|
private readonly config;
|
|
1911
1997
|
get layoutDirection(): "ltr" | "rtl";
|
|
1912
1998
|
private static renderedBoxClassName;
|
|
1913
1999
|
private static prerenderBoxClassName;
|
|
1914
|
-
private readonly
|
|
2000
|
+
private readonly _singleCardSlideWrapper;
|
|
1915
2001
|
private readonly _viewport;
|
|
1916
2002
|
private readonly _getViewportWidth;
|
|
1917
2003
|
private readonly _getViewportHeight;
|
|
1918
2004
|
private readonly _overlappingActionBarHeight;
|
|
1919
2005
|
private readonly _separateUserAndAppPause;
|
|
2006
|
+
private readonly _useSdkCacheForMultislideMode;
|
|
1920
2007
|
readonly sdkApi: SDKApi;
|
|
2008
|
+
private activeSlide;
|
|
2009
|
+
private slides;
|
|
2010
|
+
private slidesMode;
|
|
2011
|
+
private cardLoadingStateController;
|
|
2012
|
+
private sizeMetrics;
|
|
1921
2013
|
constructor(config: {
|
|
1922
2014
|
sdkApi: SDKApi;
|
|
1923
2015
|
slideWrapper: HTMLElement;
|
|
@@ -1939,7 +2031,11 @@ declare class SlideApi$1 {
|
|
|
1939
2031
|
getViewportHeight: () => number;
|
|
1940
2032
|
overlappingActionBarHeight?: number;
|
|
1941
2033
|
separateUserAndAppPause: boolean;
|
|
2034
|
+
root: HTMLElement;
|
|
2035
|
+
nonce?: string;
|
|
2036
|
+
useSdkCacheForMultislideMode: boolean;
|
|
1942
2037
|
});
|
|
2038
|
+
get state(): number;
|
|
1943
2039
|
destroy(): Promise<void>;
|
|
1944
2040
|
private initListeners;
|
|
1945
2041
|
private destroyListeners;
|
|
@@ -1952,22 +2048,11 @@ declare class SlideApi$1 {
|
|
|
1952
2048
|
result: boolean;
|
|
1953
2049
|
reason?: string;
|
|
1954
2050
|
}>;
|
|
2051
|
+
private slider;
|
|
2052
|
+
showSlides(slides: Array<string>, cardAppearance: Record<string, any>, index?: number): Promise<void>;
|
|
1955
2053
|
handleBackpress(): void;
|
|
1956
2054
|
private get layoutService();
|
|
1957
2055
|
private getLocalData;
|
|
1958
|
-
private _fontsInit;
|
|
1959
|
-
private _initAndLoadFonts;
|
|
1960
|
-
private _slide;
|
|
1961
|
-
private _slideInInit;
|
|
1962
|
-
private _state;
|
|
1963
|
-
private _afterStartInitQueue;
|
|
1964
|
-
private _afterAppResumeQueue;
|
|
1965
|
-
get state(): STATE;
|
|
1966
|
-
private _onAllMediaLoaded;
|
|
1967
|
-
private _init;
|
|
1968
|
-
private _slideInRender;
|
|
1969
|
-
private _slideBoxRenderComplete;
|
|
1970
|
-
private _slideConfig;
|
|
1971
2056
|
slideStart(config: {
|
|
1972
2057
|
muted?: boolean;
|
|
1973
2058
|
}): Promise<{
|
|
@@ -1978,7 +2063,6 @@ declare class SlideApi$1 {
|
|
|
1978
2063
|
}): Promise<{
|
|
1979
2064
|
currentTime: number;
|
|
1980
2065
|
}>;
|
|
1981
|
-
private _pauseCbTimer;
|
|
1982
2066
|
slideUserPause(): Promise<void>;
|
|
1983
2067
|
slideUserResume(): Promise<void>;
|
|
1984
2068
|
/**
|
|
@@ -1993,8 +2077,6 @@ declare class SlideApi$1 {
|
|
|
1993
2077
|
prepareForRestart: ON_SLIDE_STOP_PREPARE_FOR_RESTART;
|
|
1994
2078
|
}): Promise<void>;
|
|
1995
2079
|
slideTimerEnd(): void;
|
|
1996
|
-
private slidePauseUI;
|
|
1997
|
-
private slideResumeUI;
|
|
1998
2080
|
enableAudio(): void;
|
|
1999
2081
|
disableAudio(): void;
|
|
2000
2082
|
get isStopped(): boolean;
|
|
@@ -2006,11 +2088,6 @@ declare class SlideApi$1 {
|
|
|
2006
2088
|
slideClickHandler(targetElement: HTMLElement | null, navigationDirection: "forward" | "backward"): {
|
|
2007
2089
|
canClickNext: boolean;
|
|
2008
2090
|
};
|
|
2009
|
-
/**
|
|
2010
|
-
* Handle click or swipeUp on linkable elements (elements with data: linkType & linkTarget)
|
|
2011
|
-
* And click or swipeUp on SwipeUp elements (WidgetProducts, WidgetGoods)
|
|
2012
|
-
*/
|
|
2013
|
-
private _handleLinkAndSwipeUpActivation;
|
|
2014
2091
|
slideSwipeUpHandler(): boolean;
|
|
2015
2092
|
setTextInputResult(id: string, text: string): void;
|
|
2016
2093
|
setShareComplete(id: string, isSuccess: boolean): void;
|
|
@@ -2018,9 +2095,10 @@ declare class SlideApi$1 {
|
|
|
2018
2095
|
private _sdkClientVariables;
|
|
2019
2096
|
getSdkClientVariables(): ReturnType<GetSdkClientVariables>;
|
|
2020
2097
|
setSdkClientVariables(variables: Record<string, any>): void;
|
|
2098
|
+
setSlideInCacheStatus(index: number, status: SLIDE_IN_CACHE_STATUS): void;
|
|
2021
2099
|
}
|
|
2022
2100
|
|
|
2023
|
-
declare class SlideApi extends
|
|
2101
|
+
declare class SlideApi extends CardApi {
|
|
2024
2102
|
private root;
|
|
2025
2103
|
private slideWrapper;
|
|
2026
2104
|
constructor(_sdkInterface: SDKInterface, config: {
|
|
@@ -2036,9 +2114,10 @@ declare class SlideApi extends SlideApi$1 {
|
|
|
2036
2114
|
}) => void;
|
|
2037
2115
|
VODPlayer?: typeof Player;
|
|
2038
2116
|
overlappingActionBarHeight?: number;
|
|
2117
|
+
useSdkCacheForMultislideMode: boolean;
|
|
2039
2118
|
});
|
|
2040
2119
|
destroy(): Promise<void>;
|
|
2041
2120
|
}
|
|
2042
2121
|
|
|
2043
|
-
export { ON_SLIDE_STOP_PREPARE_FOR_RESTART, SlideApi, TIMELINE_ACTION, Widgets };
|
|
2044
|
-
export type { FontDTO, SDKInterface, WidgetPollSharedData, WidgetRangeSliderSharedData, WidgetVoteSharedData, WidgetsSharedDataMap };
|
|
2122
|
+
export { CARD_LOADING_STATE, ON_SLIDE_STOP_PREPARE_FOR_RESTART, SLIDE_IN_CACHE_STATUS, SlideApi, TIMELINE_ACTION, Widgets };
|
|
2123
|
+
export type { EventHandlersEventMap, FontDTO, SDKInterface, ShowSlideEvent, WidgetPollSharedData, WidgetRangeSliderSharedData, WidgetVoteSharedData, WidgetsSharedDataMap };
|