@inappstory/slide-api 0.1.24 → 0.1.25
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 +1937 -349
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +146 -70
- package/dist/index.d.ts +146 -70
- package/dist/index.js +1937 -349
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
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> = {
|
|
@@ -1125,16 +1164,59 @@ interface SDKApi {
|
|
|
1125
1164
|
}): void;
|
|
1126
1165
|
isSdkSupportTimelineOnBeforeStart(): boolean;
|
|
1127
1166
|
isSdkSupportCorrectPauseResumeLifecycle(): boolean;
|
|
1167
|
+
emitEvent<K extends keyof EventHandlersEventMap>(name: K, event: EventHandlersEventMap[K]): void;
|
|
1168
|
+
onCardLoadingStateChange(state: CARD_LOADING_STATE, reason?: string): void;
|
|
1128
1169
|
}
|
|
1129
1170
|
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1171
|
+
interface ISlideApiDeps {
|
|
1172
|
+
getWidgetsSharedData: SDKApi["getWidgetsSharedData"];
|
|
1173
|
+
showToast: SDKApi["showToast"];
|
|
1174
|
+
writeToClipboard: SDKApi["writeToClipboard"];
|
|
1175
|
+
isExistsShare: SDKApi["isExistsShare"];
|
|
1176
|
+
sdkCanSendShareComplete: SDKApi["sdkCanSendShareComplete"];
|
|
1177
|
+
share: SDKApi["share"];
|
|
1178
|
+
shareSlideScreenshot: SDKApi["shareSlideScreenshot"];
|
|
1179
|
+
getCardSessionValue: SDKApi["getCardSessionValue"];
|
|
1180
|
+
setCardSessionValue: SDKApi["setCardSessionValue"];
|
|
1181
|
+
isAndroid: SDKApi["isAndroid"];
|
|
1182
|
+
isWeb: SDKApi["isWeb"];
|
|
1183
|
+
isIOS: SDKApi["isIOS"];
|
|
1184
|
+
isExistsShowCardTextInput: SDKApi["isExistsShowCardTextInput"];
|
|
1185
|
+
showCardTextInput: SDKApi["showCardTextInput"];
|
|
1186
|
+
openUrl: SDKApi["openUrl"];
|
|
1187
|
+
openGame: SDKApi["openGame"];
|
|
1188
|
+
openStory: SDKApi["openStory"];
|
|
1189
|
+
closeCard: SDKApi["closeCard"];
|
|
1190
|
+
vibrate: SDKApi["vibrate"];
|
|
1191
|
+
disableVerticalSwipeGesture: SDKApi["disableVerticalSwipeGesture"];
|
|
1192
|
+
enableVerticalSwipeGesture: SDKApi["enableVerticalSwipeGesture"];
|
|
1193
|
+
disableBackpress: SDKApi["disableBackpress"];
|
|
1194
|
+
enableBackpress: SDKApi["enableBackpress"];
|
|
1195
|
+
sendApiRequest: SDKApi["sendApiRequest"];
|
|
1196
|
+
sendStatisticEvent: SDKApi["sendStatisticEvent"];
|
|
1197
|
+
setCardLocalData: SDKApi["setCardLocalData"];
|
|
1198
|
+
getCardLocalData: SDKApi["getCardLocalData"];
|
|
1199
|
+
getCardServerData: SDKApi["getCardServerData"];
|
|
1200
|
+
cardAnimation: SDKApi["cardAnimation"];
|
|
1201
|
+
updateCardServerDataLocally: SDKApi["updateCardServerDataLocally"];
|
|
1202
|
+
getCardFonts: SDKApi["getCardFonts"];
|
|
1203
|
+
isExistsShowNextCard: SDKApi["isExistsShowNextCard"];
|
|
1204
|
+
cardShowNext: SDKApi["cardShowNext"];
|
|
1205
|
+
isExistsShowCardSlide: SDKApi["isExistsShowCardSlide"];
|
|
1206
|
+
showCardSlide: SDKApi["showCardSlide"];
|
|
1207
|
+
enableHorizontalSwipeGesture: SDKApi["enableHorizontalSwipeGesture"];
|
|
1208
|
+
disableHorizontalSwipeGesture: SDKApi["disableHorizontalSwipeGesture"];
|
|
1209
|
+
isExistsShowLayer: SDKApi["isExistsShowLayer"];
|
|
1210
|
+
showLayer: SDKApi["showLayer"];
|
|
1211
|
+
showNextSlide: SDKApi["showNextSlide"];
|
|
1212
|
+
isSdkSupportCorrectPauseResumeLifecycle: SDKApi["isSdkSupportCorrectPauseResumeLifecycle"];
|
|
1213
|
+
isSdkSupportTimelineOnBeforeStart: SDKApi["isSdkSupportTimelineOnBeforeStart"];
|
|
1214
|
+
updateTimeline: SDKApi["updateTimeline"];
|
|
1215
|
+
/** @deprecated, used only in native sdk **/
|
|
1216
|
+
cardPausedCallback: SDKApi["cardPausedCallback"];
|
|
1217
|
+
/** @deprecated, used only in native sdk **/
|
|
1218
|
+
cardResumedCallback: SDKApi["cardResumedCallback"];
|
|
1136
1219
|
}
|
|
1137
|
-
type GetSdkClientVariables = () => Record<string, any>;
|
|
1138
1220
|
|
|
1139
1221
|
type WidgetOptionsBase = {
|
|
1140
1222
|
slide: HTMLElement | null;
|
|
@@ -1174,7 +1256,7 @@ type WidgetCallbacks = {
|
|
|
1174
1256
|
onWidgetRequireResumeUI: OnWidgetRequireResumeUI;
|
|
1175
1257
|
};
|
|
1176
1258
|
type WidgetDeps = {
|
|
1177
|
-
|
|
1259
|
+
slideApiDeps: ISlideApiDeps;
|
|
1178
1260
|
slideRoot: HTMLElement;
|
|
1179
1261
|
getLayoutDirection: () => "ltr" | "rtl";
|
|
1180
1262
|
getSdkClientVariables: GetSdkClientVariables;
|
|
@@ -1245,15 +1327,15 @@ declare class WidgetBase<WidgetOptions extends WidgetOptionsBase> {
|
|
|
1245
1327
|
static createInstance<Widget extends WidgetBase<WidgetOptions>, WidgetOptions extends WidgetOptionsBase>(instantiate: (element: HTMLElement, options: Partial<WidgetOptions>) => Widget, element: HTMLElement, options: Partial<WidgetOptions>): Widget;
|
|
1246
1328
|
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
1329
|
static get widgetsService(): WidgetsService;
|
|
1248
|
-
static getLocalData(
|
|
1330
|
+
static getLocalData(slideApiDeps: ISlideApiDeps): Promise<Record<string, any>>;
|
|
1249
1331
|
getLocalData(): Promise<Record<string, any>>;
|
|
1250
|
-
static setLocalData(
|
|
1332
|
+
static setLocalData(slideApiDeps: ISlideApiDeps, keyValue: Record<string, any>, sendToServer?: boolean, syncWithRuntimeLocalData?: boolean): void;
|
|
1251
1333
|
setLocalData(keyValue: Record<string, any>, sendToServer?: boolean, syncWithRuntimeLocalData?: boolean): void;
|
|
1252
1334
|
get statisticEventBaseFieldsShortForm(): StatisticEventBaseFieldsShortForm;
|
|
1253
1335
|
static getStatisticEventBaseFieldsShortForm(cardId: number, cardType: CARD_TYPE, slideIndex: number): StatisticEventBaseFieldsShortForm;
|
|
1254
1336
|
get statisticEventBaseFieldsFullForm(): StatisticEventBaseFieldsFullForm;
|
|
1255
1337
|
static getStatisticEventBaseFieldsFullForm(cardId: number, cardType: CARD_TYPE, slideIndex: number): StatisticEventBaseFieldsFullForm;
|
|
1256
|
-
static sendStatisticEventToApp(
|
|
1338
|
+
static sendStatisticEventToApp(slideApiDeps: ISlideApiDeps, name: string, data: Record<string, string | number | Array<string | number>>, devPayload?: Record<string, string | number | Array<string | number>>, options?: {
|
|
1257
1339
|
forceEnableStatisticV2?: boolean;
|
|
1258
1340
|
}): void;
|
|
1259
1341
|
sendStatisticEventToApp(name: string, data: Record<string, string | number | Array<string | number>>, devPayload?: Record<string, string | number | Array<string | number>>, options?: {
|
|
@@ -1418,6 +1500,8 @@ interface SDKInterface {
|
|
|
1418
1500
|
type: "text";
|
|
1419
1501
|
textValue: string;
|
|
1420
1502
|
}): void;
|
|
1503
|
+
onEvent<K extends keyof EventHandlersEventMap>(name: K, event: EventHandlersEventMap[K]): void;
|
|
1504
|
+
onCardLoadingStateChange(state: CARD_LOADING_STATE, reason?: string): void;
|
|
1421
1505
|
}
|
|
1422
1506
|
|
|
1423
1507
|
type LocalData = Record<string, any>;
|
|
@@ -1429,6 +1513,7 @@ declare global {
|
|
|
1429
1513
|
}
|
|
1430
1514
|
|
|
1431
1515
|
interface IElement {
|
|
1516
|
+
get nodeRef(): HTMLElement;
|
|
1432
1517
|
init(localData: LocalData): Promise<boolean>;
|
|
1433
1518
|
onPause(): void;
|
|
1434
1519
|
onResume(): void;
|
|
@@ -1451,6 +1536,7 @@ declare class DataInput implements IElement {
|
|
|
1451
1536
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _widgetApi: typeof WidgetDataInput.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
|
|
1452
1537
|
static isTypeOf(element: IElement): element is DataInput;
|
|
1453
1538
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1539
|
+
get nodeRef(): HTMLElement;
|
|
1454
1540
|
init(localData: LocalData): Promise<boolean>;
|
|
1455
1541
|
onPause(): void;
|
|
1456
1542
|
onResume(): void;
|
|
@@ -1473,6 +1559,7 @@ declare class Poll implements IElement {
|
|
|
1473
1559
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _widgetApi: typeof WidgetPoll.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
|
|
1474
1560
|
static isTypeOf(element: IElement): element is Poll;
|
|
1475
1561
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1562
|
+
get nodeRef(): HTMLElement;
|
|
1476
1563
|
init(localData: LocalData): Promise<boolean>;
|
|
1477
1564
|
onPause(): void;
|
|
1478
1565
|
onResume(): void;
|
|
@@ -1496,6 +1583,7 @@ declare class PollLayers implements IElement {
|
|
|
1496
1583
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _layersNodesRefs: Array<HTMLElement>, _widgetApi: typeof WidgetPollLayers.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
|
|
1497
1584
|
static isTypeOf(element: IElement): element is PollLayers;
|
|
1498
1585
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1586
|
+
get nodeRef(): HTMLElement;
|
|
1499
1587
|
init(localData: LocalData): Promise<boolean>;
|
|
1500
1588
|
onPause(): void;
|
|
1501
1589
|
onResume(): void;
|
|
@@ -1517,6 +1605,7 @@ declare class Products implements IElement {
|
|
|
1517
1605
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _widgetApi: typeof WidgetProducts.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
|
|
1518
1606
|
static isTypeOf(element: IElement): element is Products;
|
|
1519
1607
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1608
|
+
get nodeRef(): HTMLElement;
|
|
1520
1609
|
init(localData: LocalData): Promise<boolean>;
|
|
1521
1610
|
onPause(): void;
|
|
1522
1611
|
onResume(): void;
|
|
@@ -1541,6 +1630,7 @@ declare class Quest implements IElement {
|
|
|
1541
1630
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _widgetApi: typeof WidgetQuest.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
|
|
1542
1631
|
static isTypeOf(element: IElement): element is Quest;
|
|
1543
1632
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1633
|
+
get nodeRef(): HTMLElement;
|
|
1544
1634
|
init(localData: LocalData): Promise<boolean>;
|
|
1545
1635
|
onPause(): void;
|
|
1546
1636
|
onResume(): void;
|
|
@@ -1569,6 +1659,7 @@ declare class Quiz implements IElement {
|
|
|
1569
1659
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _widgetApi: typeof WidgetQuiz.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
|
|
1570
1660
|
static isTypeOf(element: IElement): element is Quiz;
|
|
1571
1661
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1662
|
+
get nodeRef(): HTMLElement;
|
|
1572
1663
|
init(localData: LocalData): Promise<boolean>;
|
|
1573
1664
|
onPause(): void;
|
|
1574
1665
|
onResume(): void;
|
|
@@ -1591,6 +1682,7 @@ declare class QuizGrouped implements IElement {
|
|
|
1591
1682
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _widgetApi: typeof WidgetQuizGrouped.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
|
|
1592
1683
|
static isTypeOf(element: IElement): element is QuizGrouped;
|
|
1593
1684
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1685
|
+
get nodeRef(): HTMLElement;
|
|
1594
1686
|
init(localData: LocalData): Promise<boolean>;
|
|
1595
1687
|
onPause(): void;
|
|
1596
1688
|
onResume(): void;
|
|
@@ -1613,6 +1705,7 @@ declare class RangeSlider implements IElement {
|
|
|
1613
1705
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _widgetApi: typeof WidgetRangeSlider.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
|
|
1614
1706
|
static isTypeOf(element: IElement): element is RangeSlider;
|
|
1615
1707
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1708
|
+
get nodeRef(): HTMLElement;
|
|
1616
1709
|
init(localData: LocalData): Promise<boolean>;
|
|
1617
1710
|
onPause(): void;
|
|
1618
1711
|
onResume(): void;
|
|
@@ -1635,6 +1728,7 @@ declare class Rate implements IElement {
|
|
|
1635
1728
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _widgetApi: typeof WidgetRate.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
|
|
1636
1729
|
static isTypeOf(element: IElement): element is Rate;
|
|
1637
1730
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1731
|
+
get nodeRef(): HTMLElement;
|
|
1638
1732
|
init(localData: LocalData): Promise<boolean>;
|
|
1639
1733
|
onPause(): void;
|
|
1640
1734
|
onResume(): void;
|
|
@@ -1659,6 +1753,7 @@ declare class Share implements IElement {
|
|
|
1659
1753
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _layersNodesRefs: Array<HTMLElement>, _widgetApi: typeof WidgetShare.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
|
|
1660
1754
|
static isTypeOf(element: IElement): element is Share;
|
|
1661
1755
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1756
|
+
get nodeRef(): HTMLElement;
|
|
1662
1757
|
init(localData: LocalData): Promise<boolean>;
|
|
1663
1758
|
onPause(): void;
|
|
1664
1759
|
onResume(): void;
|
|
@@ -1678,6 +1773,7 @@ declare class SwipeUp implements IElement {
|
|
|
1678
1773
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer);
|
|
1679
1774
|
static isTypeOf(element: IElement): element is SwipeUp;
|
|
1680
1775
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1776
|
+
get nodeRef(): HTMLElement;
|
|
1681
1777
|
init(localData: LocalData): Promise<boolean>;
|
|
1682
1778
|
onPause(): void;
|
|
1683
1779
|
onResume(): void;
|
|
@@ -1697,6 +1793,7 @@ declare class SwipeUpItems implements IElement {
|
|
|
1697
1793
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer);
|
|
1698
1794
|
static isTypeOf(element: IElement): element is SwipeUpItems;
|
|
1699
1795
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1796
|
+
get nodeRef(): HTMLElement;
|
|
1700
1797
|
init(localData: LocalData): Promise<boolean>;
|
|
1701
1798
|
onPause(): void;
|
|
1702
1799
|
onResume(): void;
|
|
@@ -1719,6 +1816,7 @@ declare class Test implements IElement {
|
|
|
1719
1816
|
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _widgetApi: typeof WidgetTest.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
|
|
1720
1817
|
static isTypeOf(element: IElement): element is Test;
|
|
1721
1818
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1819
|
+
get nodeRef(): HTMLElement;
|
|
1722
1820
|
init(localData: LocalData): Promise<boolean>;
|
|
1723
1821
|
onPause(): void;
|
|
1724
1822
|
onResume(): void;
|
|
@@ -1735,7 +1833,7 @@ declare class Video implements IElement {
|
|
|
1735
1833
|
private readonly _elementNodeRef;
|
|
1736
1834
|
private readonly _layer;
|
|
1737
1835
|
private readonly _VideoPlayer;
|
|
1738
|
-
private readonly
|
|
1836
|
+
private readonly _slideApiDeps;
|
|
1739
1837
|
private static readonly _className;
|
|
1740
1838
|
static className(): string;
|
|
1741
1839
|
private readonly _video;
|
|
@@ -1743,9 +1841,10 @@ declare class Video implements IElement {
|
|
|
1743
1841
|
private readonly _vodData;
|
|
1744
1842
|
private _vodPlayerInstance;
|
|
1745
1843
|
private _videoStateAdapter;
|
|
1746
|
-
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _VideoPlayer: typeof Player | undefined,
|
|
1844
|
+
constructor(_elementNodeRef: HTMLElement, _layer: Layer, _VideoPlayer: typeof Player | undefined, _slideApiDeps: ISlideApiDeps);
|
|
1747
1845
|
static isTypeOf(element: IElement): element is Video;
|
|
1748
1846
|
mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
|
|
1847
|
+
get nodeRef(): HTMLElement;
|
|
1749
1848
|
init(localData: LocalData): Promise<boolean>;
|
|
1750
1849
|
private _isScreenOnPause;
|
|
1751
1850
|
onPause(): void;
|
|
@@ -1753,6 +1852,7 @@ declare class Video implements IElement {
|
|
|
1753
1852
|
onStart(): void;
|
|
1754
1853
|
onStop(): void;
|
|
1755
1854
|
onBeforeUnmount(): Promise<void>;
|
|
1855
|
+
get durationMs(): number;
|
|
1756
1856
|
private _initVOD;
|
|
1757
1857
|
private _convertMpdUrls;
|
|
1758
1858
|
private _destroyVODPlayer;
|
|
@@ -1760,14 +1860,15 @@ declare class Video implements IElement {
|
|
|
1760
1860
|
get isLayerForcePaused(): boolean;
|
|
1761
1861
|
private _videoStartedPromise;
|
|
1762
1862
|
get videoStartedPromise(): Promise<{
|
|
1763
|
-
|
|
1863
|
+
getVideoCurrentTime: () => number;
|
|
1764
1864
|
}> | null;
|
|
1765
|
-
|
|
1766
|
-
|
|
1865
|
+
get isLooped(): boolean;
|
|
1866
|
+
start(muted: boolean | undefined, getIsLooped: () => boolean): Promise<{
|
|
1867
|
+
getVideoCurrentTime: () => number;
|
|
1767
1868
|
}>;
|
|
1768
1869
|
pause(resetVideoTime?: boolean): number | null;
|
|
1769
1870
|
resume(): Promise<{
|
|
1770
|
-
|
|
1871
|
+
getVideoCurrentTime: () => number;
|
|
1771
1872
|
}>;
|
|
1772
1873
|
stop({ prepareForRestart }: {
|
|
1773
1874
|
prepareForRestart: ON_SLIDE_STOP_PREPARE_FOR_RESTART;
|
|
@@ -1781,8 +1882,7 @@ declare class Slide {
|
|
|
1781
1882
|
private readonly _slideReadyPromise;
|
|
1782
1883
|
private readonly _afterAppResumeQueuePush;
|
|
1783
1884
|
private readonly _afterStartInitQueuePush;
|
|
1784
|
-
|
|
1785
|
-
readonly sdkApi: SDKApi;
|
|
1885
|
+
readonly slideApiDeps: ISlideApiDeps;
|
|
1786
1886
|
private readonly _slideRoot;
|
|
1787
1887
|
private readonly _getLayoutDirection;
|
|
1788
1888
|
private readonly _slidePauseUI;
|
|
@@ -1790,7 +1890,7 @@ declare class Slide {
|
|
|
1790
1890
|
private readonly _getSdkClientVariables;
|
|
1791
1891
|
private readonly _layers;
|
|
1792
1892
|
private _start;
|
|
1793
|
-
constructor(_slidesNodesRefs: Array<HTMLElement>, _slideReadyPromise: Promise<void>, _afterAppResumeQueuePush: (cb: () => void) => void, _afterStartInitQueuePush: (cb: () => void) => void,
|
|
1893
|
+
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
1894
|
private _activeLayer;
|
|
1795
1895
|
get activeLayer(): Layer;
|
|
1796
1896
|
get layers(): Array<Layer>;
|
|
@@ -1820,8 +1920,7 @@ declare class Layer {
|
|
|
1820
1920
|
private readonly _slideReadyPromise;
|
|
1821
1921
|
private readonly _afterAppResumeQueuePush;
|
|
1822
1922
|
private readonly _afterStartInitQueuePush;
|
|
1823
|
-
|
|
1824
|
-
readonly sdkApi: SDKApi;
|
|
1923
|
+
readonly slideApiDeps: ISlideApiDeps;
|
|
1825
1924
|
private readonly _slideRoot;
|
|
1826
1925
|
private readonly _getLayoutDirection;
|
|
1827
1926
|
private readonly _slidePauseUI;
|
|
@@ -1837,7 +1936,7 @@ declare class Layer {
|
|
|
1837
1936
|
private _elements;
|
|
1838
1937
|
private readonly _timeline;
|
|
1839
1938
|
private readonly _widgetDeps;
|
|
1840
|
-
constructor(_nodeRef: HTMLElement, _slide: Slide, _slideReadyPromise: Promise<void>, _afterAppResumeQueuePush: (cb: () => void) => void, _afterStartInitQueuePush: (cb: () => void) => void,
|
|
1939
|
+
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
1940
|
init(localData: LocalData): Array<Promise<boolean>>;
|
|
1842
1941
|
onAfterAllMediaResourcesLoaded(): void;
|
|
1843
1942
|
get nodeRef(): HTMLElement;
|
|
@@ -1846,6 +1945,7 @@ declare class Layer {
|
|
|
1846
1945
|
get timeline(): SlideTimeline;
|
|
1847
1946
|
get layoutService(): LayoutService;
|
|
1848
1947
|
getLocalData(): Promise<LocalData>;
|
|
1948
|
+
findElementByNodeRef(nodeRef: HTMLElement): IElement | undefined;
|
|
1849
1949
|
get isQuest(): boolean;
|
|
1850
1950
|
private _initTextFit;
|
|
1851
1951
|
private _initTextElementAutoWidthCorrection;
|
|
@@ -1890,34 +1990,23 @@ declare class Layer {
|
|
|
1890
1990
|
get isLayerForcePaused(): boolean;
|
|
1891
1991
|
}
|
|
1892
1992
|
|
|
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 {
|
|
1993
|
+
declare class CardApi {
|
|
1910
1994
|
private readonly config;
|
|
1911
1995
|
get layoutDirection(): "ltr" | "rtl";
|
|
1912
1996
|
private static renderedBoxClassName;
|
|
1913
1997
|
private static prerenderBoxClassName;
|
|
1914
|
-
private readonly
|
|
1998
|
+
private readonly _singleCardSlideWrapper;
|
|
1915
1999
|
private readonly _viewport;
|
|
1916
2000
|
private readonly _getViewportWidth;
|
|
1917
2001
|
private readonly _getViewportHeight;
|
|
1918
2002
|
private readonly _overlappingActionBarHeight;
|
|
1919
2003
|
private readonly _separateUserAndAppPause;
|
|
2004
|
+
private readonly _useSdkCacheForMultislideMode;
|
|
1920
2005
|
readonly sdkApi: SDKApi;
|
|
2006
|
+
private activeSlide;
|
|
2007
|
+
private slides;
|
|
2008
|
+
private slidesMode;
|
|
2009
|
+
private sizeMetrics;
|
|
1921
2010
|
constructor(config: {
|
|
1922
2011
|
sdkApi: SDKApi;
|
|
1923
2012
|
slideWrapper: HTMLElement;
|
|
@@ -1939,7 +2028,11 @@ declare class SlideApi$1 {
|
|
|
1939
2028
|
getViewportHeight: () => number;
|
|
1940
2029
|
overlappingActionBarHeight?: number;
|
|
1941
2030
|
separateUserAndAppPause: boolean;
|
|
2031
|
+
root: HTMLElement;
|
|
2032
|
+
nonce?: string;
|
|
2033
|
+
useSdkCacheForMultislideMode: boolean;
|
|
1942
2034
|
});
|
|
2035
|
+
get state(): number;
|
|
1943
2036
|
destroy(): Promise<void>;
|
|
1944
2037
|
private initListeners;
|
|
1945
2038
|
private destroyListeners;
|
|
@@ -1952,22 +2045,11 @@ declare class SlideApi$1 {
|
|
|
1952
2045
|
result: boolean;
|
|
1953
2046
|
reason?: string;
|
|
1954
2047
|
}>;
|
|
2048
|
+
private slider;
|
|
2049
|
+
showSlides(slides: Array<string>, cardAppearance: Record<string, any>, index?: number): Promise<void>;
|
|
1955
2050
|
handleBackpress(): void;
|
|
1956
2051
|
private get layoutService();
|
|
1957
2052
|
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
2053
|
slideStart(config: {
|
|
1972
2054
|
muted?: boolean;
|
|
1973
2055
|
}): Promise<{
|
|
@@ -1978,7 +2060,6 @@ declare class SlideApi$1 {
|
|
|
1978
2060
|
}): Promise<{
|
|
1979
2061
|
currentTime: number;
|
|
1980
2062
|
}>;
|
|
1981
|
-
private _pauseCbTimer;
|
|
1982
2063
|
slideUserPause(): Promise<void>;
|
|
1983
2064
|
slideUserResume(): Promise<void>;
|
|
1984
2065
|
/**
|
|
@@ -1993,8 +2074,6 @@ declare class SlideApi$1 {
|
|
|
1993
2074
|
prepareForRestart: ON_SLIDE_STOP_PREPARE_FOR_RESTART;
|
|
1994
2075
|
}): Promise<void>;
|
|
1995
2076
|
slideTimerEnd(): void;
|
|
1996
|
-
private slidePauseUI;
|
|
1997
|
-
private slideResumeUI;
|
|
1998
2077
|
enableAudio(): void;
|
|
1999
2078
|
disableAudio(): void;
|
|
2000
2079
|
get isStopped(): boolean;
|
|
@@ -2006,11 +2085,6 @@ declare class SlideApi$1 {
|
|
|
2006
2085
|
slideClickHandler(targetElement: HTMLElement | null, navigationDirection: "forward" | "backward"): {
|
|
2007
2086
|
canClickNext: boolean;
|
|
2008
2087
|
};
|
|
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
2088
|
slideSwipeUpHandler(): boolean;
|
|
2015
2089
|
setTextInputResult(id: string, text: string): void;
|
|
2016
2090
|
setShareComplete(id: string, isSuccess: boolean): void;
|
|
@@ -2018,9 +2092,10 @@ declare class SlideApi$1 {
|
|
|
2018
2092
|
private _sdkClientVariables;
|
|
2019
2093
|
getSdkClientVariables(): ReturnType<GetSdkClientVariables>;
|
|
2020
2094
|
setSdkClientVariables(variables: Record<string, any>): void;
|
|
2095
|
+
setSlideInCacheStatus(index: number, status: SLIDE_IN_CACHE_STATUS): void;
|
|
2021
2096
|
}
|
|
2022
2097
|
|
|
2023
|
-
declare class SlideApi extends
|
|
2098
|
+
declare class SlideApi extends CardApi {
|
|
2024
2099
|
private root;
|
|
2025
2100
|
private slideWrapper;
|
|
2026
2101
|
constructor(_sdkInterface: SDKInterface, config: {
|
|
@@ -2036,9 +2111,10 @@ declare class SlideApi extends SlideApi$1 {
|
|
|
2036
2111
|
}) => void;
|
|
2037
2112
|
VODPlayer?: typeof Player;
|
|
2038
2113
|
overlappingActionBarHeight?: number;
|
|
2114
|
+
useSdkCacheForMultislideMode: boolean;
|
|
2039
2115
|
});
|
|
2040
2116
|
destroy(): Promise<void>;
|
|
2041
2117
|
}
|
|
2042
2118
|
|
|
2043
|
-
export { ON_SLIDE_STOP_PREPARE_FOR_RESTART, SlideApi, TIMELINE_ACTION, Widgets };
|
|
2044
|
-
export type { FontDTO, SDKInterface, WidgetPollSharedData, WidgetRangeSliderSharedData, WidgetVoteSharedData, WidgetsSharedDataMap };
|
|
2119
|
+
export { CARD_LOADING_STATE, ON_SLIDE_STOP_PREPARE_FOR_RESTART, SLIDE_IN_CACHE_STATUS, SlideApi, TIMELINE_ACTION, Widgets };
|
|
2120
|
+
export type { EventHandlersEventMap, FontDTO, SDKInterface, ShowSlideEvent, WidgetPollSharedData, WidgetRangeSliderSharedData, WidgetVoteSharedData, WidgetsSharedDataMap };
|