@inappstory/js-sdk 3.4.3 → 3.4.5

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.
@@ -1,4 +1,4 @@
1
- import { RecursivePartial } from "../global"
1
+ import { RecursivePartial } from "../global";
2
2
 
3
3
  export type Goods = Partial<{
4
4
  imgSrc: string;
@@ -10,7 +10,13 @@ export type Goods = Partial<{
10
10
  rawData: any;
11
11
  }>;
12
12
 
13
- export type GoodsWidgetOptions = RecursivePartial<{
13
+ export interface GoodsRenderItemProps<T extends Goods = Goods> {
14
+ goods: T;
15
+ index: number;
16
+ onClick: (goods: T) => void;
17
+ }
18
+
19
+ export type GoodsWidgetOptions<T extends Goods = Goods> = RecursivePartial<{
14
20
  goodsList: GoodsListOptions;
15
21
  goodsCard: GoodsCardOptions;
16
22
  loader: {
@@ -20,9 +26,11 @@ export type GoodsWidgetOptions = RecursivePartial<{
20
26
  };
21
27
  custom: string;
22
28
  };
23
- openGoodsWidgetHandler: (goodsList: Goods[]) => Promise<Goods[]>;
24
- getCardHtml?: (goods: Goods, index: number) => string;
25
- itemClickHandler?: (goods: Goods) => void;
29
+ openGoodsWidgetHandler: (goodsList: T[]) => Promise<T[]>;
30
+ isLoading?: boolean;
31
+ renderItem?: (props: GoodsRenderItemProps<T>) => React.ReactNode;
32
+ getCardHtml?: (goods: T, index: number) => string;
33
+ itemClickHandler?: (goods: T) => void;
26
34
  }>;
27
35
 
28
36
  export type GoodsCardOptions = Partial<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inappstory/js-sdk",
3
- "version": "3.4.3",
3
+ "version": "3.4.5",
4
4
  "description": "JS SDK",
5
5
  "keywords": [
6
6
  "stories",