@inappstory/react-sdk 1.8.0-rc.0 → 1.8.0-rc.2

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.
@@ -6,16 +6,22 @@ import { BannerPlaceAppearance } from "./bannerPlaceAppearance";
6
6
  * @enum {string}
7
7
  */
8
8
  export enum BannerPlaceViewModelEvent {
9
- /** Emitted when playback starts */
10
- Play = "play",
11
- /** Emitted when playback stops */
12
- Stop = "stop",
13
9
  /** Emitted when banner loading starts */
14
10
  LoadStart = "loadStart",
15
11
  /** Emitted when banner loading completes */
16
12
  LoadEnd = "loadEnd",
17
13
  /** Emitted when banner loading fails */
18
- LoadError = "loadError"
14
+ LoadError = "loadError",
15
+ /** Emitted when changed active banner */
16
+ ActiveIndexChange = "activeIndexChange",
17
+ /** Emitted before transition to the next slide after the duration has elapsed */
18
+ AutoplayTimeLeft = "autoplayTimeLeft",
19
+ /** Emitted when the banner is in the viewport and started. */
20
+ ShowBanner = "showBanner",
21
+ /** Emitted when the banner is in the viewport and error occurs on start. */
22
+ ShowBannerFailed = "showBannerFailed",
23
+ /** Emitted when interacting with banner widgets */
24
+ BannerWidget = "bannerWidget"
19
25
  }
20
26
 
21
27
  /**
@@ -135,6 +141,12 @@ export interface BannerPlace {
135
141
  */
136
142
  get activeIndex(): number;
137
143
 
144
+ /**
145
+ * Gets pagination bullets length
146
+ * @returns {number}
147
+ */
148
+ get paginationBullets(): number;
149
+
138
150
  /**
139
151
  * Sets the slider controller implementation
140
152
  * @param {IBannerPlaceSliderController} sliderController - The slider controller to use
@@ -148,14 +160,31 @@ export interface BannerPlace {
148
160
  updateAppearance(appearance: BannerPlaceAppearance): void;
149
161
 
150
162
  /**
151
- * Starts playback of all banners
163
+ * Resume autoplay
152
164
  */
153
- play(): void;
165
+ resume(): void;
154
166
 
155
167
  /**
156
- * Stops playback of all banners
168
+ * Pause autoplay
157
169
  */
158
- stop(): void;
170
+ pause(): void;
171
+
172
+ /**
173
+ * Run transition to next slide.
174
+ */
175
+ showNext(): void;
176
+
177
+ /**
178
+ * Run transition to previous slide.
179
+ */
180
+ showPrevious(): void;
181
+
182
+ /**
183
+ * Run transition to the slide by index
184
+ * @param {number} index - Slide index
185
+ * @param {number} speed - Transition duration
186
+ */
187
+ showByIndex(index: number, speed?: number): void;
159
188
 
160
189
  /**
161
190
  * Reloads banners for this place
@@ -181,6 +210,11 @@ export interface BannerPlace {
181
210
  * @emits BannerPlaceViewModelEvent.LoadStart
182
211
  * @emits BannerPlaceViewModelEvent.LoadEnd
183
212
  * @emits BannerPlaceViewModelEvent.LoadError
213
+ * @emits BannerPlaceViewModelEvent.ActiveIndexChange
214
+ * @emits BannerPlaceViewModelEvent.AutoplayTimeLeft
215
+ * @emits BannerPlaceViewModelEvent.ShowBanner
216
+ * @emits BannerPlaceViewModelEvent.ShowBannerFailed
217
+ * @emits BannerPlaceViewModelEvent.BannerWidget
184
218
  */
185
219
  fetchBanners(): Promise<Banner[]>;
186
220
  }
@@ -52,6 +52,18 @@ interface IasBannerPlaceProps {
52
52
  */
53
53
  onLoadError?: (error: Error) => void;
54
54
 
55
+ /**
56
+ * Callback triggered when when changed active banner
57
+ * @optional
58
+ */
59
+ onActiveIndexChange?: () => void;
60
+
61
+ /**
62
+ * Callback triggered before transition to the next slide after the duration has elapsed
63
+ * @optional
64
+ */
65
+ onAutoplayTimeLeft?: () => void;
66
+
55
67
  /**
56
68
  * Callback triggered when banner place is ready
57
69
  * @param {BannerPlace} bannerPlace - The initialized banner place instance