@inappstory/slide-api 0.1.27 → 0.1.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -54,7 +54,14 @@ type ProductCart = {
54
54
  priceCurrency: string;
55
55
  };
56
56
 
57
+ type AnimationDescriptor = {
58
+ cb: () => void;
59
+ timerId?: number;
60
+ timeout: number;
61
+ needResume?: boolean;
62
+ };
57
63
  interface IAnimation {
64
+ animations: AnimationDescriptor[];
58
65
  init(slide: HTMLElement, animate?: boolean): void;
59
66
  start(slide: HTMLElement, animate?: boolean): void | ((isStop: boolean) => () => void);
60
67
  stop(slide: HTMLElement, animate?: boolean): void;
@@ -70,6 +77,51 @@ declare const enum TIMELINE_ACTION {
70
77
  BEFORE_START = "before_start"
71
78
  }
72
79
 
80
+ type WidgetTimerOptions = WidgetOptionsBase;
81
+
82
+ declare class WidgetTimer extends WidgetBase<WidgetTimerOptions> {
83
+ static DEFAULTS: WidgetTimerOptions;
84
+ static widgetClassName: string;
85
+ private model;
86
+ private endTimeMs;
87
+ private timerRenderer;
88
+ private timerGroup;
89
+ private timerInit;
90
+ private rafId;
91
+ private effects;
92
+ private abortController;
93
+ constructor(element: HTMLElement, options: Partial<WidgetTimerOptions>, widgetCallbacks: WidgetCallbacks, widgetDeps: WidgetDeps);
94
+ isDone(): boolean;
95
+ private fillEffects;
96
+ private mountTimerGroup;
97
+ private createTimerModel;
98
+ private setTimerEndTime;
99
+ onStart(): void;
100
+ onStop(): void;
101
+ onPause(): void;
102
+ onResume(): void;
103
+ onRefreshUserData(localData: Record<string, any>): void;
104
+ private reset;
105
+ private update;
106
+ private complete;
107
+ private getCurrentTime;
108
+ private updateEffects;
109
+ private resetEffects;
110
+ private hideElement;
111
+ private showElement;
112
+ private doCompletitionAction;
113
+ private getMaxCardAnimationsDelay;
114
+ private waitCardAnimationsEnd;
115
+ static api: {
116
+ widgetClassName: string;
117
+ onRefreshUserData: typeof WidgetBase.onRefreshUserData;
118
+ init: (element: HTMLElement, localData: Record<string, any>, widgetCallbacks: WidgetCallbacks, widgetDeps: WidgetDeps) => void;
119
+ onStart: (element: HTMLElement) => void;
120
+ onStop: (element: HTMLElement) => void;
121
+ click: (element: HTMLElement) => boolean;
122
+ };
123
+ }
124
+
73
125
  type WidgetBarcodeOptions = WidgetOptionsBase;
74
126
 
75
127
  declare class WidgetBarcode extends WidgetBase<WidgetBarcodeOptions> {
@@ -434,6 +486,7 @@ declare class WidgetProducts extends WidgetBase<WidgetProductsOptions> {
434
486
  private _statEventWidgetClick;
435
487
  private _statEventWidgetOpen;
436
488
  private _statEventWidgetCardClick;
489
+ private getOrFetchProducts;
437
490
  fetchProducts(): Promise<{
438
491
  message: string;
439
492
  models: Array<OfferDto>;
@@ -443,6 +496,7 @@ declare class WidgetProducts extends WidgetBase<WidgetProductsOptions> {
443
496
  private initSwipeGestureDetector;
444
497
  private productsView;
445
498
  private isOpen;
499
+ private isLoading;
446
500
  get isForcePaused(): boolean;
447
501
  private currentModels;
448
502
  openProductsView(): Promise<void>;
@@ -954,6 +1008,7 @@ interface ILayoutApi {
954
1008
  get widgetVoteApi(): typeof WidgetVote.api | undefined;
955
1009
  get widgetProductsApi(): typeof WidgetProducts.api | undefined;
956
1010
  get widgetTooltipApi(): typeof WidgetTooltip.api | undefined;
1011
+ get widgetTimerApi(): typeof WidgetTimer.api | undefined;
957
1012
  get VideoPlayer(): typeof Player | undefined;
958
1013
  }
959
1014
 
package/dist/index.d.ts CHANGED
@@ -54,7 +54,14 @@ type ProductCart = {
54
54
  priceCurrency: string;
55
55
  };
56
56
 
57
+ type AnimationDescriptor = {
58
+ cb: () => void;
59
+ timerId?: number;
60
+ timeout: number;
61
+ needResume?: boolean;
62
+ };
57
63
  interface IAnimation {
64
+ animations: AnimationDescriptor[];
58
65
  init(slide: HTMLElement, animate?: boolean): void;
59
66
  start(slide: HTMLElement, animate?: boolean): void | ((isStop: boolean) => () => void);
60
67
  stop(slide: HTMLElement, animate?: boolean): void;
@@ -70,6 +77,51 @@ declare const enum TIMELINE_ACTION {
70
77
  BEFORE_START = "before_start"
71
78
  }
72
79
 
80
+ type WidgetTimerOptions = WidgetOptionsBase;
81
+
82
+ declare class WidgetTimer extends WidgetBase<WidgetTimerOptions> {
83
+ static DEFAULTS: WidgetTimerOptions;
84
+ static widgetClassName: string;
85
+ private model;
86
+ private endTimeMs;
87
+ private timerRenderer;
88
+ private timerGroup;
89
+ private timerInit;
90
+ private rafId;
91
+ private effects;
92
+ private abortController;
93
+ constructor(element: HTMLElement, options: Partial<WidgetTimerOptions>, widgetCallbacks: WidgetCallbacks, widgetDeps: WidgetDeps);
94
+ isDone(): boolean;
95
+ private fillEffects;
96
+ private mountTimerGroup;
97
+ private createTimerModel;
98
+ private setTimerEndTime;
99
+ onStart(): void;
100
+ onStop(): void;
101
+ onPause(): void;
102
+ onResume(): void;
103
+ onRefreshUserData(localData: Record<string, any>): void;
104
+ private reset;
105
+ private update;
106
+ private complete;
107
+ private getCurrentTime;
108
+ private updateEffects;
109
+ private resetEffects;
110
+ private hideElement;
111
+ private showElement;
112
+ private doCompletitionAction;
113
+ private getMaxCardAnimationsDelay;
114
+ private waitCardAnimationsEnd;
115
+ static api: {
116
+ widgetClassName: string;
117
+ onRefreshUserData: typeof WidgetBase.onRefreshUserData;
118
+ init: (element: HTMLElement, localData: Record<string, any>, widgetCallbacks: WidgetCallbacks, widgetDeps: WidgetDeps) => void;
119
+ onStart: (element: HTMLElement) => void;
120
+ onStop: (element: HTMLElement) => void;
121
+ click: (element: HTMLElement) => boolean;
122
+ };
123
+ }
124
+
73
125
  type WidgetBarcodeOptions = WidgetOptionsBase;
74
126
 
75
127
  declare class WidgetBarcode extends WidgetBase<WidgetBarcodeOptions> {
@@ -434,6 +486,7 @@ declare class WidgetProducts extends WidgetBase<WidgetProductsOptions> {
434
486
  private _statEventWidgetClick;
435
487
  private _statEventWidgetOpen;
436
488
  private _statEventWidgetCardClick;
489
+ private getOrFetchProducts;
437
490
  fetchProducts(): Promise<{
438
491
  message: string;
439
492
  models: Array<OfferDto>;
@@ -443,6 +496,7 @@ declare class WidgetProducts extends WidgetBase<WidgetProductsOptions> {
443
496
  private initSwipeGestureDetector;
444
497
  private productsView;
445
498
  private isOpen;
499
+ private isLoading;
446
500
  get isForcePaused(): boolean;
447
501
  private currentModels;
448
502
  openProductsView(): Promise<void>;
@@ -954,6 +1008,7 @@ interface ILayoutApi {
954
1008
  get widgetVoteApi(): typeof WidgetVote.api | undefined;
955
1009
  get widgetProductsApi(): typeof WidgetProducts.api | undefined;
956
1010
  get widgetTooltipApi(): typeof WidgetTooltip.api | undefined;
1011
+ get widgetTimerApi(): typeof WidgetTimer.api | undefined;
957
1012
  get VideoPlayer(): typeof Player | undefined;
958
1013
  }
959
1014