@inappstory/slide-api 0.1.41 → 0.1.42

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
@@ -1086,6 +1086,45 @@ declare class WidgetReactions extends WidgetBase<WidgetReactionsOptions> {
1086
1086
  };
1087
1087
  }
1088
1088
 
1089
+ type WidgetScratchCardOptions = WidgetOptionsBase;
1090
+
1091
+ declare class WidgetScratchCard extends WidgetBase<WidgetScratchCardOptions> {
1092
+ static DEFAULTS: WidgetScratchCardOptions;
1093
+ static widgetClassName: string;
1094
+ private scratchContainer;
1095
+ private scratchLayer;
1096
+ private localDataKeys;
1097
+ private readonly model;
1098
+ private _isClickCaptured;
1099
+ constructor(element: HTMLElement, options: Partial<WidgetScratchCardOptions>, widgetCallbacks: WidgetCallbacks, widgetDeps: WidgetDeps);
1100
+ get isClickCaptured(): boolean;
1101
+ onRefreshUserData(localData: Record<string, any>): void;
1102
+ isDone(): boolean;
1103
+ onStart(): void;
1104
+ onStop(): void;
1105
+ private init;
1106
+ private calcBrushSize;
1107
+ private handleResize;
1108
+ private mountScratchContainer;
1109
+ private renderScratchLayer;
1110
+ private getImage;
1111
+ private hideGeometry;
1112
+ private completeWidget;
1113
+ private disablePointerEventsOnGeometry;
1114
+ private sendStatEvent;
1115
+ private saveToLocalData;
1116
+ private handleMouseUp;
1117
+ private handleMouseDown;
1118
+ static api: {
1119
+ widgetClassName: string;
1120
+ onRefreshUserData: typeof WidgetBase.onRefreshUserData;
1121
+ init: (element: HTMLElement, localData: Record<string, any>, widgetCallbacks: WidgetCallbacks, widgetDeps: WidgetDeps) => void;
1122
+ onStart: (element: HTMLElement) => void;
1123
+ onStop: (element: HTMLElement) => void;
1124
+ isClickCaptured: (element: HTMLElement) => boolean;
1125
+ };
1126
+ }
1127
+
1089
1128
  interface ILayoutApi {
1090
1129
  get widgetCopyApi(): typeof WidgetCopy.api | undefined;
1091
1130
  get widgetBarcodeApi(): typeof WidgetBarcode.api | undefined;
@@ -1107,6 +1146,7 @@ interface ILayoutApi {
1107
1146
  get widgetTooltipApi(): typeof WidgetTooltip.api | undefined;
1108
1147
  get widgetTimerApi(): typeof WidgetTimer.api | undefined;
1109
1148
  get widgetReactionsApi(): typeof WidgetReactions.api | undefined;
1149
+ get widgetScratchCardApi(): typeof WidgetScratchCard.api | undefined;
1110
1150
  get VideoPlayer(): typeof Player | undefined;
1111
1151
  }
1112
1152
 
@@ -1476,7 +1516,8 @@ declare const enum Widgets {
1476
1516
  DateCountdown = "dateCountdown",
1477
1517
  Quest = "quest",
1478
1518
  Timer = "timer",
1479
- Reactions = "reactions"
1519
+ Reactions = "reactions",
1520
+ ScratchCard = "scratchCard"
1480
1521
  }
1481
1522
  interface WidgetsSharedDataMap {
1482
1523
  rangeSlider: WidgetRangeSliderSharedData;
@@ -2178,6 +2219,28 @@ declare class Slide {
2178
2219
  get disabledNavigation(): boolean;
2179
2220
  }
2180
2221
 
2222
+ declare class ScratchCard implements IElement {
2223
+ private readonly _elementNodeRef;
2224
+ private readonly _widgetApi;
2225
+ private readonly _widgetCallbacks;
2226
+ private readonly _widgetDeps;
2227
+ private static readonly _className;
2228
+ static className(): string;
2229
+ static isTypeOf(element: IElement): element is ScratchCard;
2230
+ constructor(_elementNodeRef: HTMLElement, _widgetApi: typeof WidgetScratchCard.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
2231
+ mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
2232
+ get nodeRef(): HTMLElement;
2233
+ init(localData: LocalData): Promise<boolean>;
2234
+ onPause(): void;
2235
+ onResume(): void;
2236
+ onStart(): void;
2237
+ onStop(): void;
2238
+ onBeforeUnmount(): Promise<void>;
2239
+ handleClick(): boolean;
2240
+ get isLayerForcePaused(): boolean;
2241
+ get isClickCaptured(): boolean;
2242
+ }
2243
+
2181
2244
  declare const enum ON_SLIDE_STOP_PREPARE_FOR_RESTART {
2182
2245
  UNKNOWN = 0,
2183
2246
  PREPARE = 1,
@@ -2225,6 +2288,7 @@ declare class Layer {
2225
2288
  get disabledNavigation(): boolean;
2226
2289
  get videoElement(): Video | null;
2227
2290
  get rangeSliderElement(): RangeSlider | null;
2291
+ get scratchCardElements(): ScratchCard[];
2228
2292
  get quizElement(): Quiz | null;
2229
2293
  get quizGroupedElement(): QuizGrouped | null;
2230
2294
  get questElement(): Quest | null;
package/dist/index.d.ts CHANGED
@@ -1086,6 +1086,45 @@ declare class WidgetReactions extends WidgetBase<WidgetReactionsOptions> {
1086
1086
  };
1087
1087
  }
1088
1088
 
1089
+ type WidgetScratchCardOptions = WidgetOptionsBase;
1090
+
1091
+ declare class WidgetScratchCard extends WidgetBase<WidgetScratchCardOptions> {
1092
+ static DEFAULTS: WidgetScratchCardOptions;
1093
+ static widgetClassName: string;
1094
+ private scratchContainer;
1095
+ private scratchLayer;
1096
+ private localDataKeys;
1097
+ private readonly model;
1098
+ private _isClickCaptured;
1099
+ constructor(element: HTMLElement, options: Partial<WidgetScratchCardOptions>, widgetCallbacks: WidgetCallbacks, widgetDeps: WidgetDeps);
1100
+ get isClickCaptured(): boolean;
1101
+ onRefreshUserData(localData: Record<string, any>): void;
1102
+ isDone(): boolean;
1103
+ onStart(): void;
1104
+ onStop(): void;
1105
+ private init;
1106
+ private calcBrushSize;
1107
+ private handleResize;
1108
+ private mountScratchContainer;
1109
+ private renderScratchLayer;
1110
+ private getImage;
1111
+ private hideGeometry;
1112
+ private completeWidget;
1113
+ private disablePointerEventsOnGeometry;
1114
+ private sendStatEvent;
1115
+ private saveToLocalData;
1116
+ private handleMouseUp;
1117
+ private handleMouseDown;
1118
+ static api: {
1119
+ widgetClassName: string;
1120
+ onRefreshUserData: typeof WidgetBase.onRefreshUserData;
1121
+ init: (element: HTMLElement, localData: Record<string, any>, widgetCallbacks: WidgetCallbacks, widgetDeps: WidgetDeps) => void;
1122
+ onStart: (element: HTMLElement) => void;
1123
+ onStop: (element: HTMLElement) => void;
1124
+ isClickCaptured: (element: HTMLElement) => boolean;
1125
+ };
1126
+ }
1127
+
1089
1128
  interface ILayoutApi {
1090
1129
  get widgetCopyApi(): typeof WidgetCopy.api | undefined;
1091
1130
  get widgetBarcodeApi(): typeof WidgetBarcode.api | undefined;
@@ -1107,6 +1146,7 @@ interface ILayoutApi {
1107
1146
  get widgetTooltipApi(): typeof WidgetTooltip.api | undefined;
1108
1147
  get widgetTimerApi(): typeof WidgetTimer.api | undefined;
1109
1148
  get widgetReactionsApi(): typeof WidgetReactions.api | undefined;
1149
+ get widgetScratchCardApi(): typeof WidgetScratchCard.api | undefined;
1110
1150
  get VideoPlayer(): typeof Player | undefined;
1111
1151
  }
1112
1152
 
@@ -1476,7 +1516,8 @@ declare const enum Widgets {
1476
1516
  DateCountdown = "dateCountdown",
1477
1517
  Quest = "quest",
1478
1518
  Timer = "timer",
1479
- Reactions = "reactions"
1519
+ Reactions = "reactions",
1520
+ ScratchCard = "scratchCard"
1480
1521
  }
1481
1522
  interface WidgetsSharedDataMap {
1482
1523
  rangeSlider: WidgetRangeSliderSharedData;
@@ -2178,6 +2219,28 @@ declare class Slide {
2178
2219
  get disabledNavigation(): boolean;
2179
2220
  }
2180
2221
 
2222
+ declare class ScratchCard implements IElement {
2223
+ private readonly _elementNodeRef;
2224
+ private readonly _widgetApi;
2225
+ private readonly _widgetCallbacks;
2226
+ private readonly _widgetDeps;
2227
+ private static readonly _className;
2228
+ static className(): string;
2229
+ static isTypeOf(element: IElement): element is ScratchCard;
2230
+ constructor(_elementNodeRef: HTMLElement, _widgetApi: typeof WidgetScratchCard.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
2231
+ mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
2232
+ get nodeRef(): HTMLElement;
2233
+ init(localData: LocalData): Promise<boolean>;
2234
+ onPause(): void;
2235
+ onResume(): void;
2236
+ onStart(): void;
2237
+ onStop(): void;
2238
+ onBeforeUnmount(): Promise<void>;
2239
+ handleClick(): boolean;
2240
+ get isLayerForcePaused(): boolean;
2241
+ get isClickCaptured(): boolean;
2242
+ }
2243
+
2181
2244
  declare const enum ON_SLIDE_STOP_PREPARE_FOR_RESTART {
2182
2245
  UNKNOWN = 0,
2183
2246
  PREPARE = 1,
@@ -2225,6 +2288,7 @@ declare class Layer {
2225
2288
  get disabledNavigation(): boolean;
2226
2289
  get videoElement(): Video | null;
2227
2290
  get rangeSliderElement(): RangeSlider | null;
2291
+ get scratchCardElements(): ScratchCard[];
2228
2292
  get quizElement(): Quiz | null;
2229
2293
  get quizGroupedElement(): QuizGrouped | null;
2230
2294
  get questElement(): Quest | null;