react-native-firework-sdk 1.8.0 → 1.9.0

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.
Files changed (138) hide show
  1. package/android/build.gradle +1 -1
  2. package/android/src/main/java/com/fireworksdk/bridge/utils/FWLanguageUtil.kt +47 -14
  3. package/ios/Components/StoryBlock.swift +33 -2
  4. package/ios/Components/StoryBlockManager.m +32 -0
  5. package/ios/Components/VideoFeed.swift +10 -29
  6. package/ios/Components/VideoFeedManager.m +11 -6
  7. package/ios/FireworkSdk.xcodeproj/project.pbxproj +378 -204
  8. package/ios/Models/NativeToRN/FireworkEventName.swift +3 -1
  9. package/ios/Models/RNToNative/RCTConvert+Shopping.swift +21 -0
  10. package/ios/Models/RNToNative/RCTConvert+VideoFeed.swift +27 -0
  11. package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +23 -5
  12. package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +1 -0
  13. package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +31 -0
  14. package/ios/Modules/Shopping/ProductInfoViewConfiguration.swift +13 -0
  15. package/ios/Modules/Shopping/ShoppingCTAResult.swift +16 -0
  16. package/ios/Modules/Shopping/ShoppingModule.m +2 -1
  17. package/ios/Modules/Shopping/ShoppingModule.swift +103 -30
  18. package/ios/Support/MultiHostStreaming/FWMultiHostStreaming.podspec +24 -0
  19. package/ios/Support/MultiHostStreaming/src/MultiHostStreamingSDK.swift +17 -0
  20. package/ios/Utils/AppLanguage/Bundle+FWSwizzle.swift +58 -0
  21. package/ios/Utils/AppLanguage/FWAppLanguageManager.swift +139 -0
  22. package/ios/Utils/AppLanguage/FWLanguageUtil.swift +43 -0
  23. package/ios/Utils/AppLanguage/NumberFormatter+FWSwizzle.swift +25 -0
  24. package/ios/Utils/AppLanguage/UIImageView+FWSwizzle.swift +91 -0
  25. package/ios/Utils/AppLanguage/UILabel+FWSwizzle.swift +98 -0
  26. package/ios/Utils/AppLanguage/UITextField+FWSwizzle.swift +97 -0
  27. package/ios/Utils/AppLanguage/UITextView+FWSwizzle.swift +97 -0
  28. package/ios/Utils/AppLanguage/UIView+FWSwizzle.swift +38 -0
  29. package/ios/Utils/AppLanguage/UIViewController+FWSwizzle.swift +32 -0
  30. package/ios/Utils/AppLanguage/UIWindow+FWSwizzle.swift +26 -0
  31. package/ios/Utils/AppLanguage/URLSession+FWSwizzle.swift +69 -0
  32. package/ios/Utils/{DispatchQueue+FWOnce.swift → Extensions/DispatchQueue+FWOnce.swift} +3 -3
  33. package/ios/Utils/{UINavigationController+FWSwizzle.swift → Extensions/Swizzle/UINavigationController+FWSwizzle.swift} +6 -8
  34. package/ios/Utils/Extensions/UIView+FWUIHierarchy.swift +47 -0
  35. package/ios/Utils/FWRTL/Classes/Manager/FWRTLManager.h +25 -0
  36. package/ios/Utils/FWRTL/Classes/Manager/FWRTLManager.m +75 -0
  37. package/ios/Utils/FWRTL/Classes/UICategories/CALayer+FWRTL.h +21 -0
  38. package/ios/Utils/FWRTL/Classes/UICategories/CALayer+FWRTL.m +124 -0
  39. package/ios/Utils/FWRTL/Classes/UICategories/FWRTLRemoteViewControllerAdaptor.h +11 -0
  40. package/ios/Utils/FWRTL/Classes/UICategories/FWRTLRemoteViewControllerAdaptor.m +86 -0
  41. package/ios/Utils/FWRTL/Classes/UICategories/FWRTLWhiteListManager.h +16 -0
  42. package/ios/Utils/FWRTL/Classes/UICategories/FWRTLWhiteListManager.m +55 -0
  43. package/ios/Utils/FWRTL/Classes/UICategories/UILabel+FWRTL.h +18 -0
  44. package/ios/Utils/FWRTL/Classes/UICategories/UILabel+FWRTL.m +39 -0
  45. package/ios/Utils/FWRTL/Classes/UICategories/UIView+FWRTL.h +54 -0
  46. package/ios/Utils/FWRTL/Classes/UICategories/UIView+FWRTL.m +141 -0
  47. package/ios/Utils/FWRTL/Classes/UICategories/UIWindow+FWRTL.h +16 -0
  48. package/ios/Utils/FWRTL/Classes/UICategories/UIWindow+FWRTL.m +20 -0
  49. package/ios/Utils/FWRTL/Classes/Utils/FWRTLDefinitions.h +52 -0
  50. package/ios/Utils/FWRTL/Classes/Utils/NSObject+FWRTLReloadBlock.h +19 -0
  51. package/ios/Utils/FWRTL/Classes/Utils/NSObject+FWRTLReloadBlock.m +49 -0
  52. package/ios/Utils/FWRTL/Classes/Utils/NSString+FWRTL.h +21 -0
  53. package/ios/Utils/FWRTL/Classes/Utils/NSString+FWRTL.m +38 -0
  54. package/ios/Utils/FWRTL/Classes/Utils/UIImage+FWRTL.h +18 -0
  55. package/ios/Utils/FWRTL/Classes/Utils/UIImage+FWRTL.m +43 -0
  56. package/ios/Utils/FWSwizzleLoader.m +6 -1
  57. package/ios/Utils/FWSwizzleLoader.swift +13 -0
  58. package/ios/Utils/FWSwizzleUtil.swift +17 -9
  59. package/ios/react_native_firework_sdk.h +1 -0
  60. package/ios/scripts/react_native_firework_sdk_pods.rb +31 -0
  61. package/lib/commonjs/FWNavigator.js +2 -2
  62. package/lib/commonjs/FWNavigator.js.map +1 -1
  63. package/lib/commonjs/FireworkSDK.js +31 -6
  64. package/lib/commonjs/FireworkSDK.js.map +1 -1
  65. package/lib/commonjs/VideoShopping.js +71 -22
  66. package/lib/commonjs/VideoShopping.js.map +1 -1
  67. package/lib/commonjs/components/StoryBlock.js +156 -106
  68. package/lib/commonjs/components/StoryBlock.js.map +1 -1
  69. package/lib/commonjs/components/VideoFeed.js +37 -11
  70. package/lib/commonjs/components/VideoFeed.js.map +1 -1
  71. package/lib/commonjs/index.js +6 -0
  72. package/lib/commonjs/index.js.map +1 -1
  73. package/lib/commonjs/models/FWEventName.js +2 -0
  74. package/lib/commonjs/models/FWEventName.js.map +1 -1
  75. package/lib/commonjs/models/ShoppingCTAResult.js +2 -0
  76. package/lib/commonjs/models/ShoppingCTAResult.js.map +1 -0
  77. package/lib/commonjs/modules/FireworkSDKModule.js.map +1 -1
  78. package/lib/commonjs/modules/ShoppingModule.js.map +1 -1
  79. package/lib/module/FWNavigator.js +5 -2
  80. package/lib/module/FWNavigator.js.map +1 -1
  81. package/lib/module/FireworkSDK.js +31 -6
  82. package/lib/module/FireworkSDK.js.map +1 -1
  83. package/lib/module/VideoShopping.js +70 -23
  84. package/lib/module/VideoShopping.js.map +1 -1
  85. package/lib/module/components/StoryBlock.js +146 -103
  86. package/lib/module/components/StoryBlock.js.map +1 -1
  87. package/lib/module/components/VideoFeed.js +41 -10
  88. package/lib/module/components/VideoFeed.js.map +1 -1
  89. package/lib/module/index.js +1 -1
  90. package/lib/module/index.js.map +1 -1
  91. package/lib/module/models/FWEventName.js +2 -0
  92. package/lib/module/models/FWEventName.js.map +1 -1
  93. package/lib/module/models/ShoppingCTAResult.js +2 -0
  94. package/lib/module/models/ShoppingCTAResult.js.map +1 -0
  95. package/lib/module/modules/FireworkSDKModule.js.map +1 -1
  96. package/lib/module/modules/ShoppingModule.js.map +1 -1
  97. package/lib/typescript/FWNavigator.d.ts +6 -3
  98. package/lib/typescript/FireworkSDK.d.ts +20 -7
  99. package/lib/typescript/LiveStream.d.ts +2 -2
  100. package/lib/typescript/VideoShopping.d.ts +32 -11
  101. package/lib/typescript/components/StoryBlock.d.ts +21 -11
  102. package/lib/typescript/components/VideoFeed.d.ts +21 -5
  103. package/lib/typescript/index.d.ts +7 -4
  104. package/lib/typescript/models/AdBadgeConfiguration.d.ts +1 -1
  105. package/lib/typescript/models/AddToCartResult.d.ts +4 -0
  106. package/lib/typescript/models/FWEventName.d.ts +2 -0
  107. package/lib/typescript/models/FWEvents.d.ts +27 -0
  108. package/lib/typescript/models/IOSFontInfo.d.ts +2 -2
  109. package/lib/typescript/models/NewNativeContainerProps.d.ts +1 -1
  110. package/lib/typescript/models/ProductInfoViewConfiguration.d.ts +35 -0
  111. package/lib/typescript/models/ShoppingCTAResult.d.ts +11 -0
  112. package/lib/typescript/models/StoryBlockSource.d.ts +1 -1
  113. package/lib/typescript/models/VideoFeedConfiguration.d.ts +4 -3
  114. package/lib/typescript/models/VideoFeedSource.d.ts +1 -1
  115. package/lib/typescript/models/VideoPlayerConfiguration.d.ts +7 -5
  116. package/lib/typescript/modules/FireworkSDKModule.d.ts +1 -2
  117. package/lib/typescript/modules/ShoppingModule.d.ts +2 -0
  118. package/package.json +10 -6
  119. package/react-native-firework-sdk.podspec +26 -24
  120. package/src/FWNavigator.ts +6 -3
  121. package/src/FireworkSDK.ts +27 -8
  122. package/src/VideoShopping.ts +110 -41
  123. package/src/components/StoryBlock.tsx +158 -84
  124. package/src/components/VideoFeed.tsx +38 -9
  125. package/src/index.ts +21 -0
  126. package/src/models/AddToCartResult.ts +4 -0
  127. package/src/models/FWEventName.ts +2 -0
  128. package/src/models/FWEvents.ts +28 -0
  129. package/src/models/ProductInfoViewConfiguration.ts +37 -0
  130. package/src/models/ShoppingCTAResult.ts +11 -0
  131. package/src/models/VideoFeedConfiguration.ts +3 -2
  132. package/src/models/VideoPlayerConfiguration.ts +3 -1
  133. package/src/modules/FireworkSDKModule.ts +1 -2
  134. package/src/modules/ShoppingModule.ts +6 -1
  135. package/ios/Utils/UIView+ParentViewController.swift +0 -21
  136. /package/ios/Utils/{String+Color.swift → Extensions/String+Color.swift} +0 -0
  137. /package/ios/Utils/{UIView+Constraints.swift → Extensions/UIView+Constraints.swift} +0 -0
  138. /package/ios/Utils/{UIViewController+AttachChild.swift → Extensions/UIViewController+AttachChild.swift} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["FireworkSDKModule.ts"],"names":["NativeEventEmitter","NativeModules","LINKING_ERROR","FireworkSDKModule","FireworkSDK","Proxy","get","Error","FireworkSDKModuleEventEmitter"],"mappings":"AAAA,SAASA,kBAAT,QAAiD,cAAjD;AACA,SAASC,aAAT,QAA8B,cAA9B;AAGA,SAASC,aAAT,QAA8B,6BAA9B;AAIA,MAAMC,iBAAiB,GAAGF,aAAa,CAACG,WAAd,GACtBH,aAAa,CAACG,WADQ,GAEtB,IAAIC,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUL,aAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AAyBA,MAAMM,6BAA6B,GAAG,IAAIR,kBAAJ,CAAuBG,iBAAvB,CAAtC;AACA,SAASK,6BAAT;AACA,eAAeL,iBAAf","sourcesContent":["import { NativeEventEmitter, NativeModule } from 'react-native';\nimport { NativeModules } from 'react-native';\nimport type AdBadgeConfiguration from '../models/AdBadgeConfiguration';\n\nimport { LINKING_ERROR } from '../constants/FWErrorMessage';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\nimport type TrackPurchaseParameters from '../models/TrackPurchaseParameters';\n\nconst FireworkSDKModule = NativeModules.FireworkSDK\n ? NativeModules.FireworkSDK\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\ninterface IFireworkSDKModule extends NativeModule {\n init(userId?: string): void;\n openVideoPlayer(url: string, config?: VideoPlayerConfiguration): void;\n setCustomCTAClickEnabled(enabled: boolean): void;\n setCustomCTALinkContentPageRouteName(name?: string): Promise<any>;\n setShareBaseURL(url?: string): Promise<any>;\n setVideoPlaybackEventEnabled(enabled: boolean): void;\n setAdBadgeConfiguration(config?: AdBadgeConfiguration): Promise<any>;\n setAppComponentName(name?: string): Promise<any>;\n trackPurchase(parameters: TrackPurchaseParameters): void;\n changeAppLanguage(language: string): Promise<boolean>;\n restart(): Promise<void>;\n}\n\nconst FireworkSDKModuleEventEmitter = new NativeEventEmitter(FireworkSDKModule);\nexport { FireworkSDKModuleEventEmitter };\nexport default FireworkSDKModule as IFireworkSDKModule;\n"]}
1
+ {"version":3,"sources":["FireworkSDKModule.ts"],"names":["NativeEventEmitter","NativeModules","LINKING_ERROR","FireworkSDKModule","FireworkSDK","Proxy","get","Error","FireworkSDKModuleEventEmitter"],"mappings":"AAAA,SAASA,kBAAT,QAAiD,cAAjD;AACA,SAASC,aAAT,QAA8B,cAA9B;AAGA,SAASC,aAAT,QAA8B,6BAA9B;AAIA,MAAMC,iBAAiB,GAAGF,aAAa,CAACG,WAAd,GACtBH,aAAa,CAACG,WADQ,GAEtB,IAAIC,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUL,aAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AAwBA,MAAMM,6BAA6B,GAAG,IAAIR,kBAAJ,CAAuBG,iBAAvB,CAAtC;AACA,SAASK,6BAAT;AACA,eAAeL,iBAAf","sourcesContent":["import { NativeEventEmitter, NativeModule } from 'react-native';\nimport { NativeModules } from 'react-native';\nimport type AdBadgeConfiguration from '../models/AdBadgeConfiguration';\n\nimport { LINKING_ERROR } from '../constants/FWErrorMessage';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\nimport type TrackPurchaseParameters from '../models/TrackPurchaseParameters';\n\nconst FireworkSDKModule = NativeModules.FireworkSDK\n ? NativeModules.FireworkSDK\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\ninterface IFireworkSDKModule extends NativeModule {\n init(userId?: string): void;\n openVideoPlayer(url: string, config?: VideoPlayerConfiguration): void;\n setCustomCTAClickEnabled(enabled: boolean): void;\n setCustomCTALinkContentPageRouteName(name?: string): Promise<any>;\n setShareBaseURL(url?: string): Promise<any>;\n setVideoPlaybackEventEnabled(enabled: boolean): void;\n setAdBadgeConfiguration(config?: AdBadgeConfiguration): Promise<any>;\n setAppComponentName(name?: string): Promise<any>;\n trackPurchase(parameters: TrackPurchaseParameters): void;\n changeAppLanguage(language?: string | null): Promise<boolean>;\n}\n\nconst FireworkSDKModuleEventEmitter = new NativeEventEmitter(FireworkSDKModule);\nexport { FireworkSDKModuleEventEmitter };\nexport default FireworkSDKModule as IFireworkSDKModule;\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["ShoppingModule.ts"],"names":["NativeEventEmitter","NativeModules","LINKING_ERROR","ShoppingModule","Proxy","get","Error","ShoppingModuleEventEmitter"],"mappings":"AAAA,SAASA,kBAAT,EAA2CC,aAA3C,QAAgE,cAAhE;AAEA,SAASC,aAAT,QAA8B,6BAA9B;AAKA,MAAMC,cAAc,GAAGF,aAAa,CAACE,cAAd,GACnBF,aAAa,CAACE,cADK,GAEnB,IAAIC,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUJ,aAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AA+BA,MAAMK,0BAA0B,GAAG,IAAIP,kBAAJ,CAAuBG,cAAvB,CAAnC;AACA,SAASI,0BAAT;AAEA,eAAeJ,cAAf","sourcesContent":["import { NativeEventEmitter, NativeModule, NativeModules } from 'react-native';\n\nimport { LINKING_ERROR } from '../constants/FWErrorMessage';\nimport type { NewNativeContainerProps } from '../models/NewNativeContainerProps';\nimport type Product from '../models/Product';\nimport type ProductInfoViewConfiguration from '../models/ProductInfoViewConfiguration';\n\nconst ShoppingModule = NativeModules.ShoppingModule\n ? NativeModules.ShoppingModule\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\ninterface IShoppingModule extends NativeModule {\n init(): void;\n updateVideoProducts(products: Product[], callbackId: number | string): void;\n updateAddToCartStatus(\n res: string,\n tips: string,\n callbackId: number | string\n ): void;\n jumpToCartPage(\n callbackId: number | string,\n props: NewNativeContainerProps\n ): void;\n setCartIconVisible(visible: boolean): void;\n setCartItemCount(count: number): void;\n setCustomClickCartIconEnabled(enabled: boolean): Promise<void>; // Only supported on iOS\n clearCallbackId(callbackId: number | string, eventName: string): void; // Only supported on iOS\n setProductInfoViewConfiguration(config: ProductInfoViewConfiguration): void; // Only supported on iOS\n setCustomClickLinkButtonEnabled(enabled: boolean): Promise<void>; // Only supported on Android\n}\n\nconst ShoppingModuleEventEmitter = new NativeEventEmitter(ShoppingModule);\nexport { ShoppingModuleEventEmitter };\n\nexport default ShoppingModule as IShoppingModule;\n"]}
1
+ {"version":3,"sources":["ShoppingModule.ts"],"names":["NativeEventEmitter","NativeModules","LINKING_ERROR","ShoppingModule","Proxy","get","Error","ShoppingModuleEventEmitter"],"mappings":"AAAA,SAASA,kBAAT,EAA2CC,aAA3C,QAAgE,cAAhE;AAEA,SAASC,aAAT,QAA8B,6BAA9B;AAMA,MAAMC,cAAc,GAAGF,aAAa,CAACE,cAAd,GACnBF,aAAa,CAACE,cADK,GAEnB,IAAIC,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUJ,aAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AAmCA,MAAMK,0BAA0B,GAAG,IAAIP,kBAAJ,CAAuBG,cAAvB,CAAnC;AACA,SAASI,0BAAT;AAEA,eAAeJ,cAAf","sourcesContent":["import { NativeEventEmitter, NativeModule, NativeModules } from 'react-native';\n\nimport { LINKING_ERROR } from '../constants/FWErrorMessage';\nimport type { NewNativeContainerProps } from '../models/NewNativeContainerProps';\nimport type Product from '../models/Product';\nimport type ProductInfoViewConfiguration from '../models/ProductInfoViewConfiguration';\nimport type ShoppingCTAResult from '../models/ShoppingCTAResult';\n\nconst ShoppingModule = NativeModules.ShoppingModule\n ? NativeModules.ShoppingModule\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\ninterface IShoppingModule extends NativeModule {\n init(): void;\n updateVideoProducts(products: Product[], callbackId: number | string): void;\n updateAddToCartStatus(\n res: string,\n tips: string,\n callbackId: number | string\n ): void;\n updateShoppingCTAResult(\n result: ShoppingCTAResult,\n callbackId: number | string\n ): void; // Only supported on iOS\n jumpToCartPage(\n callbackId: number | string,\n props: NewNativeContainerProps\n ): void;\n setCartIconVisible(visible: boolean): void;\n setCartItemCount(count: number): void;\n setCustomClickCartIconEnabled(enabled: boolean): Promise<void>; // Only supported on iOS\n clearCallbackId(callbackId: number | string, eventName: string): void; // Only supported on iOS\n setProductInfoViewConfiguration(config: ProductInfoViewConfiguration): void; // Only supported on iOS\n setCustomClickLinkButtonEnabled(enabled: boolean): Promise<void>;\n}\n\nconst ShoppingModuleEventEmitter = new NativeEventEmitter(ShoppingModule);\nexport { ShoppingModuleEventEmitter };\n\nexport default ShoppingModule as IShoppingModule;\n"]}
@@ -1,4 +1,7 @@
1
- declare type FWNativeContainerProps = {
1
+ /**
2
+ * @deprecated The type will be deprecated since RN SDK V2.0.
3
+ */
4
+ export type FWNativeContainerProps = {
2
5
  [key: string]: any;
3
6
  };
4
7
  /**
@@ -14,7 +17,7 @@ declare class FWNavigator {
14
17
  * @param {FWNativeContainerProps} props We will pass the props to your app component.
15
18
  * @returns {Promise<boolean>} The result of pushing RN page from native page.
16
19
  *
17
- * @deprecated The property will be deprecated since RN SDK V2.
20
+ * @deprecated The method will be deprecated since RN SDK V2.0.
18
21
  */
19
22
  pushNativeContainer(props: FWNativeContainerProps): Promise<boolean>;
20
23
  /**
@@ -27,7 +30,7 @@ declare class FWNavigator {
27
30
  * @returns {Promise<boolean>} If the result is true,
28
31
  * we could call popNativeContainer to pop top-most native container.
29
32
  *
30
- * @deprecated The property will be deprecated since RN SDK V2.
33
+ * @deprecated The method will be deprecated since RN SDK V2.0.
31
34
  */
32
35
  canPopNativeContainer(): Promise<boolean>;
33
36
  /**
@@ -5,10 +5,10 @@ import type { CustomCTAClickEvent, SDKInitEvent, VideoFeedClickEvent, VideoPlayb
5
5
  import type TrackPurchaseParameters from './models/TrackPurchaseParameters';
6
6
  import type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';
7
7
  import VideoShopping from './VideoShopping';
8
- export declare type SDKInitCallback = (event: SDKInitEvent) => void;
9
- export declare type CustomCTAClickCallback = (event: CustomCTAClickEvent) => void;
10
- export declare type VideoPlaybackCallback = (event: VideoPlaybackEvent) => void;
11
- export declare type VideoFeedClickCallback = (event: VideoFeedClickEvent) => void;
8
+ export type SDKInitCallback = (event: SDKInitEvent) => void;
9
+ export type CustomCTAClickCallback = (event: CustomCTAClickEvent) => void;
10
+ export type VideoPlaybackCallback = (event: VideoPlaybackEvent) => void;
11
+ export type VideoFeedClickCallback = (event: VideoFeedClickEvent) => void;
12
12
  /**
13
13
  * Entry class of Firework SDK, which supports the sdk initialization and global configuration.
14
14
  */
@@ -30,8 +30,13 @@ declare class FireworkSDK {
30
30
  private _onCustomCTAClick;
31
31
  /**
32
32
  * The custom CTA link content page route name.
33
+ *
34
+ * @deprecated The get accessor will be deprecated since RN SDK V2.0.
33
35
  */
34
36
  get customCTALinkContentPageRouteName(): string | undefined;
37
+ /**
38
+ * @deprecated The set accessor will be deprecated since RN SDK V2.0.
39
+ */
35
40
  set customCTALinkContentPageRouteName(value: string | undefined);
36
41
  private _customCTALinkContentPageRouteName;
37
42
  /**
@@ -56,10 +61,17 @@ declare class FireworkSDK {
56
61
  private _adBadgeConfiguration;
57
62
  /**
58
63
  * The app component name.
64
+ *
65
+ * @deprecated The get accessor will be deprecated since RN SDK V2.0.
59
66
  */
60
67
  get appComponentName(): string | undefined;
68
+ /**
69
+ * @deprecated The set accessor will be deprecated since RN SDK V2.0.
70
+ */
61
71
  set appComponentName(value: string | undefined);
62
72
  private _appComponentName;
73
+ get appLanguage(): string | undefined | null;
74
+ private _appLanguage;
63
75
  /**
64
76
  * Defaults to false. You can enable debug logs by setting this property to true.
65
77
  */
@@ -104,10 +116,11 @@ declare class FireworkSDK {
104
116
  */
105
117
  trackPurchase(parameters: TrackPurchaseParameters): void;
106
118
  /**
107
- * Change App level language. Only supported on Android.
108
- * @param {string} language Such as en, ar and en-US
119
+ * Change App level language.
120
+ * @param {string | undefined | null} language Such as en, ar and en-US
121
+ * If language is null or undefined or empty string, we will use system language.
109
122
  * @returns
110
123
  */
111
- changeAppLanguage(language: string): Promise<boolean>;
124
+ changeAppLanguage(language?: string | null): Promise<boolean>;
112
125
  }
113
126
  export default FireworkSDK;
@@ -1,6 +1,6 @@
1
1
  import type { LiveStreamChatEvent, LiveStreamEvent } from './models/FWEvents';
2
- export declare type onLiveStreamEventCallback = (event: LiveStreamEvent) => void;
3
- export declare type onLiveStreamChatEventCallback = (event: LiveStreamChatEvent) => void;
2
+ export type onLiveStreamEventCallback = (event: LiveStreamEvent) => void;
3
+ export type onLiveStreamChatEventCallback = (event: LiveStreamChatEvent) => void;
4
4
  /**
5
5
  * The entry class of live stream.
6
6
  */
@@ -1,14 +1,25 @@
1
1
  import type AddToCartResult from './models/AddToCartResult';
2
- import type { AddToCartEvent, CustomClickLinkButtonEvent, UpdateProductDetailsEvent, WillDisplayProductEvent } from './models/FWEvents';
2
+ import type { AddToCartEvent, CustomClickLinkButtonEvent, ShoppingCTAEvent, UpdateProductDetailsEvent, WillDisplayProductEvent } from './models/FWEvents';
3
3
  import type Product from './models/Product';
4
4
  import type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';
5
5
  import type { NewNativeContainerProps } from './models/NewNativeContainerProps';
6
- export declare type AddToCartCallback = (event: AddToCartEvent) => Promise<AddToCartResult | undefined | null>;
7
- export declare type ClickCartIconCallback = () => Promise<NewNativeContainerProps | undefined | null>;
8
- export declare type CustomClickCartIconCallback = () => Promise<void>;
9
- export declare type UpdateProductDetailsCallback = (event: UpdateProductDetailsEvent) => Promise<Product[] | undefined | null>;
10
- export declare type WillDisplayProductCallback = (event: WillDisplayProductEvent) => Promise<ProductInfoViewConfiguration | undefined | null>;
11
- export declare type CustomClickLinkButtonCallback = (event: CustomClickLinkButtonEvent) => Promise<void>;
6
+ import type ShoppingCTAResult from './models/ShoppingCTAResult';
7
+ /**
8
+ * @deprecated The type will be deprecated since RN SDK V2.1.
9
+ */
10
+ export type AddToCartCallback = (event: AddToCartEvent) => Promise<AddToCartResult | undefined | null>;
11
+ export type ShoppingCTACallback = (event: ShoppingCTAEvent) => Promise<ShoppingCTAResult>;
12
+ /**
13
+ * @deprecated The type will be deprecated since RN SDK V2.0.
14
+ */
15
+ export type ClickCartIconCallback = () => Promise<NewNativeContainerProps | undefined | null>;
16
+ export type CustomClickCartIconCallback = () => Promise<void>;
17
+ export type UpdateProductDetailsCallback = (event: UpdateProductDetailsEvent) => Promise<Product[] | undefined | null>;
18
+ /**
19
+ * @deprecated The type will be deprecated since RN SDK V2.0.
20
+ */
21
+ export type WillDisplayProductCallback = (event: WillDisplayProductEvent) => Promise<ProductInfoViewConfiguration | undefined | null>;
22
+ export type CustomClickLinkButtonCallback = (event: CustomClickLinkButtonEvent) => Promise<void>;
12
23
  /**
13
24
  * The entry class of video shopping.
14
25
  */
@@ -19,13 +30,21 @@ declare class VideoShopping {
19
30
  *
20
31
  * The host apps can return an AddToCartResult object to tell FireworkSDK the result of adding to cart.
21
32
  * If the host apps want to customize the processing logic of clicking "Add to cart" button, they could return null or undefined in the callback.
33
+ * @deprecated The callback will be deprecated since RN SDK V2.1.
22
34
  */
23
35
  onAddToCart?: AddToCartCallback;
36
+ /**
37
+ * This callback is triggered when the user clicks the "Add to cart" or "Shop now" button.
38
+ * The host app can return a ShoppingCTAResult object to tell SDK how to handle the result.
39
+ */
40
+ onShoppingCTA?: ShoppingCTACallback;
24
41
  /**
25
42
  * This callback is triggered when the user clicks the shopping cart icon.
26
43
  *
27
44
  * The host app can return NewNativeContainerProps object
28
45
  * and we will push a new native container with the props.
46
+ *
47
+ * @deprecated The property will be deprecated since RN SDK V2.0.
29
48
  */
30
49
  onClickCartIcon?: ClickCartIconCallback;
31
50
  /**
@@ -46,7 +65,8 @@ declare class VideoShopping {
46
65
  /**
47
66
  * Please use productInfoViewConfiguration property. Only supported on iOS.
48
67
  *
49
- * @deprecated The property will be deprecated since RN SDK V2.
68
+ * @deprecated The property will be deprecated since RN SDK V2.0.
69
+ * Use {@link productInfoViewConfiguration} instead.
50
70
  */
51
71
  onWillDisplayProduct?: WillDisplayProductCallback;
52
72
  /**
@@ -57,8 +77,9 @@ declare class VideoShopping {
57
77
  set cartIconVisible(value: boolean);
58
78
  private _cartIconVisible;
59
79
  /**
60
- * The host app can use this property to configure "Add to cart" button style
61
- * and hide the link button next to "Add to cart" button. Only supported on iOS.
80
+ * The configuration of product info view.
81
+ * Please refer to {@link ProductInfoViewConfiguration} for more details.
82
+ * Only supported on iOS.
62
83
  */
63
84
  get productInfoViewConfiguration(): ProductInfoViewConfiguration | undefined;
64
85
  set productInfoViewConfiguration(value: ProductInfoViewConfiguration | undefined);
@@ -85,7 +106,7 @@ declare class VideoShopping {
85
106
  * Otherwise, we will hide the red indicator on the cart icon.
86
107
  */
87
108
  setCartItemCount(count: number): void;
88
- private handleAddToCartEvent;
109
+ private handleShoppingCTAEvent;
89
110
  private handleClickCartIconEvent;
90
111
  private handleUpdateProductDetailsEvent;
91
112
  private handleWillDisplayProductEvent;
@@ -1,7 +1,21 @@
1
1
  import React from 'react';
2
- import type { EmitterSubscription, StyleProp, ViewStyle } from 'react-native';
2
+ import type { StyleProp, ViewStyle } from 'react-native';
3
3
  import type FWError from '../models/FWError';
4
4
  import type { StoryBlockSource } from '../models/StoryBlockSource';
5
+ import type AdConfiguration from '../models/AdConfiguration';
6
+ export interface IStoryBlockMethods {
7
+ /**
8
+ * Play the story block.
9
+ */
10
+ play: () => void;
11
+ /**
12
+ * Pause the story block.
13
+ */
14
+ pause: () => void;
15
+ }
16
+ /**
17
+ * The props type of StoryBlock component.
18
+ */
5
19
  export interface IStoryBlockProps {
6
20
  /**
7
21
  * Standard React Native View Style.
@@ -29,18 +43,14 @@ export interface IStoryBlockProps {
29
43
  * Specifies if Picture in Picture is enabled. Only supported on iOS.
30
44
  */
31
45
  enablePictureInPicture?: boolean;
46
+ /**
47
+ * Ad configuration of the feed. Only supported on iOS.
48
+ */
49
+ adConfiguration?: AdConfiguration;
32
50
  /**
33
51
  * The feed loading result callback. It means loading successfully when error equals to undefined.
34
52
  */
35
53
  onStoryBlockLoadFinished?: (error?: FWError) => void;
36
54
  }
37
- export default class StoryBlock extends React.Component<IStoryBlockProps> {
38
- nativeComponentRef: React.RefObject<any>;
39
- subscriptions: EmitterSubscription[];
40
- componentDidMount(): void;
41
- componentWillUnmount(): void;
42
- render(): JSX.Element;
43
- private _onStoryBlockLoadFinished;
44
- private _generateKey;
45
- private _generateDynamicContentParametersString;
46
- }
55
+ declare const _default: React.ForwardRefExoticComponent<IStoryBlockProps & React.RefAttributes<IStoryBlockMethods>>;
56
+ export default _default;
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
- import { EmitterSubscription, StyleProp, ViewStyle } from 'react-native';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
3
  import type FWError from '../models/FWError';
4
4
  import type AdConfiguration from '../models/AdConfiguration';
5
5
  import type VideoFeedConfiguration from '../models/VideoFeedConfiguration';
6
6
  import type { VideoFeedSource } from '../models/VideoFeedSource';
7
7
  import type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';
8
- export declare type VideoFeedMode = 'row' | 'column' | 'grid';
8
+ export type VideoFeedMode = 'row' | 'column' | 'grid';
9
9
  export interface IVideoFeedProps {
10
10
  /**
11
11
  * Standard React Native View Style.
@@ -58,21 +58,37 @@ export interface IVideoFeedProps {
58
58
  */
59
59
  onVideoFeedLoadFinished?: (error?: FWError) => void;
60
60
  }
61
- export default class VideoFeed extends React.Component<IVideoFeedProps> {
61
+ /**
62
+ * VideoFeed component.
63
+ */
64
+ declare class VideoFeed extends React.Component<IVideoFeedProps> {
65
+ /**
66
+ * @ignore
67
+ */
62
68
  static defaultProps: {
63
69
  mode: string;
64
70
  };
65
- nativeComponentRef: React.RefObject<any>;
66
- subscriptions: EmitterSubscription[];
71
+ private _nativeComponentRef;
72
+ private _subscriptions;
67
73
  /**
68
74
  * Force refreshing the video feed.
69
75
  */
70
76
  refresh: () => void;
71
77
  private _onVideoFeedLoadFinished;
78
+ /**
79
+ * @ignore
80
+ */
72
81
  componentDidMount(): void;
82
+ /**
83
+ * @ignore
84
+ */
73
85
  componentWillUnmount(): void;
86
+ /**
87
+ * @ignore
88
+ */
74
89
  render(): JSX.Element;
75
90
  private _generateDynamicContentParametersString;
76
91
  private _generateVastAttributesString;
77
92
  private _getVideoFeedConfiguration;
78
93
  }
94
+ export default VideoFeed;
@@ -1,8 +1,10 @@
1
+ import type { IStoryBlockMethods, IStoryBlockProps } from './components/StoryBlock';
1
2
  import StoryBlock from './components/StoryBlock';
2
3
  import type { IVideoFeedProps, VideoFeedMode } from './components/VideoFeed';
3
4
  import VideoFeed from './components/VideoFeed';
4
5
  import type { CustomCTAClickCallback, SDKInitCallback, VideoFeedClickCallback, VideoPlaybackCallback } from './FireworkSDK';
5
6
  import FireworkSDK from './FireworkSDK';
7
+ import type { FWNativeContainerProps } from './FWNavigator';
6
8
  import FWNavigator from './FWNavigator';
7
9
  import type { onLiveStreamChatEventCallback, onLiveStreamEventCallback } from './LiveStream';
8
10
  import LiveStream from './LiveStream';
@@ -13,7 +15,7 @@ import type { VastAttribute } from './models/AdConfiguration';
13
15
  import type AddToCartResult from './models/AddToCartResult';
14
16
  import type FeedItemDetails from './models/FeedItemDetails';
15
17
  import type FWError from './models/FWError';
16
- import type { AddToCartEvent, CustomClickLinkButtonEvent, CustomCTAClickEvent, LiveStreamChatEvent, LiveStreamEvent, SDKInitEvent, UpdateProductDetailsEvent, VideoPlaybackEvent, WillDisplayProductEvent } from './models/FWEvents';
18
+ import type { AddToCartEvent, CustomClickLinkButtonEvent, CustomCTAClickEvent, LiveStreamChatEvent, LiveStreamEvent, SDKInitEvent, ShoppingCTAEvent, UpdateProductDetailsEvent, VideoFeedClickEvent, VideoPlaybackEvent, WillDisplayProductEvent } from './models/FWEvents';
17
19
  import type IOSFontInfo from './models/IOSFontInfo';
18
20
  import type { IOSSystemFontStyle, IOSSystemFontWeight } from './models/IOSFontInfo';
19
21
  import LiveStreamChatEventName from './models/LiveStreamChatEventName';
@@ -23,9 +25,10 @@ import type LiveStreamMessageDetails from './models/LiveStreamMessageDetails';
23
25
  import type { NewNativeContainerProps } from './models/NewNativeContainerProps';
24
26
  import type Product from './models/Product';
25
27
  import type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';
26
- import type { AddToCartButtonConfiguration, LinkButtonConfiguration } from './models/ProductInfoViewConfiguration';
28
+ import type { AddToCartButtonConfiguration, LinkButtonConfiguration, ShoppingCTAButtonConfiguration, ShoppingCTAButtonText } from './models/ProductInfoViewConfiguration';
27
29
  import type ProductUnit from './models/ProductUnit';
28
30
  import type { ProductPrice, ProductUnitOption } from './models/ProductUnit';
31
+ import type ShoppingCTAResult from './models/ShoppingCTAResult';
29
32
  import type { StoryBlockSource } from './models/StoryBlockSource';
30
33
  import type TrackPurchaseParameters from './models/TrackPurchaseParameters';
31
34
  import type VideoFeedConfiguration from './models/VideoFeedConfiguration';
@@ -36,7 +39,7 @@ import type { VideoPlayerSize } from './models/VideoPlaybackDetails';
36
39
  import VideoPlaybackEventName from './models/VideoPlaybackEventName';
37
40
  import type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';
38
41
  import type { VideoLaunchBehavior, VideoPlayerCompleteAction, VideoPlayerCTADelay, VideoPlayerCTADelayType, VideoPlayerCTAStyle, VideoPlayerStyle } from './models/VideoPlayerConfiguration';
39
- import type { AddToCartCallback, ClickCartIconCallback, CustomClickCartIconCallback, CustomClickLinkButtonCallback, UpdateProductDetailsCallback, WillDisplayProductCallback } from './VideoShopping';
42
+ import type { AddToCartCallback, ClickCartIconCallback, CustomClickCartIconCallback, CustomClickLinkButtonCallback, ShoppingCTACallback, UpdateProductDetailsCallback, WillDisplayProductCallback } from './VideoShopping';
40
43
  import VideoShopping from './VideoShopping';
41
44
  export default FireworkSDK;
42
- export { AdBadgeConfiguration, AdBadgeTextType, AdConfiguration, AddToCartButtonConfiguration, AddToCartCallback, AddToCartEvent, AddToCartResult, ClickCartIconCallback, CustomClickCartIconCallback, CustomClickLinkButtonCallback, CustomClickLinkButtonEvent, CustomCTAClickCallback, CustomCTAClickEvent, FeedItemDetails, FWError, FWNavigator, IOSFontInfo, IOSSystemFontStyle, IOSSystemFontWeight, IVideoFeedProps, LinkButtonConfiguration, LiveStream, LiveStreamChatEvent, LiveStreamChatEventName, LiveStreamEvent, LiveStreamEventDetails, LiveStreamEventName, LiveStreamMessageDetails, NewNativeContainerProps, onLiveStreamChatEventCallback, onLiveStreamEventCallback, Product, ProductInfoViewConfiguration, ProductPrice, ProductUnit, ProductUnitOption, SDKInitCallback, SDKInitEvent, StoryBlock, StoryBlockSource, TrackPurchaseParameters, UpdateProductDetailsCallback, UpdateProductDetailsEvent, VastAttribute, VideoFeed, VideoFeedClickCallback, VideoFeedConfiguration, VideoFeedContentPadding, VideoFeedMode, VideoFeedPlayIconConfiguration, VideoFeedSource, VideoFeedTitleConfiguration, VideoFeedTitlePosition, VideoLaunchBehavior, VideoPlaybackCallback, VideoPlaybackDetails, VideoPlaybackEvent, VideoPlaybackEventName, VideoPlayerCompleteAction, VideoPlayerConfiguration, VideoPlayerCTADelay, VideoPlayerCTADelayType, VideoPlayerCTAStyle, VideoPlayerSize, VideoPlayerStyle, VideoShopping, WillDisplayProductCallback, WillDisplayProductEvent, };
45
+ export { AdBadgeConfiguration, AdBadgeTextType, AdConfiguration, AddToCartButtonConfiguration, AddToCartCallback, AddToCartEvent, AddToCartResult, ClickCartIconCallback, CustomClickCartIconCallback, CustomClickLinkButtonCallback, CustomClickLinkButtonEvent, CustomCTAClickCallback, CustomCTAClickEvent, FeedItemDetails, FireworkSDK, FWError, FWNativeContainerProps, FWNavigator, IOSFontInfo, IOSSystemFontStyle, IOSSystemFontWeight, IStoryBlockMethods, IStoryBlockProps, IVideoFeedProps, LinkButtonConfiguration, LiveStream, LiveStreamChatEvent, LiveStreamChatEventName, LiveStreamEvent, LiveStreamEventDetails, LiveStreamEventName, LiveStreamMessageDetails, NewNativeContainerProps, onLiveStreamChatEventCallback, onLiveStreamEventCallback, Product, ProductInfoViewConfiguration, ProductPrice, ProductUnit, ProductUnitOption, SDKInitCallback, SDKInitEvent, ShoppingCTAButtonConfiguration, ShoppingCTAButtonText, ShoppingCTACallback, ShoppingCTAEvent, ShoppingCTAResult, StoryBlock, StoryBlockSource, TrackPurchaseParameters, UpdateProductDetailsCallback, UpdateProductDetailsEvent, VastAttribute, VideoFeed, VideoFeedClickCallback, VideoFeedClickEvent, VideoFeedConfiguration, VideoFeedContentPadding, VideoFeedMode, VideoFeedPlayIconConfiguration, VideoFeedSource, VideoFeedTitleConfiguration, VideoFeedTitlePosition, VideoLaunchBehavior, VideoPlaybackCallback, VideoPlaybackDetails, VideoPlaybackEvent, VideoPlaybackEventName, VideoPlayerCompleteAction, VideoPlayerConfiguration, VideoPlayerCTADelay, VideoPlayerCTADelayType, VideoPlayerCTAStyle, VideoPlayerSize, VideoPlayerStyle, VideoShopping, WillDisplayProductCallback, WillDisplayProductEvent, };
@@ -1,4 +1,4 @@
1
- export declare type AdBadgeTextType = 'ad' | 'sponsored';
1
+ export type AdBadgeTextType = 'ad' | 'sponsored';
2
2
  export default interface AdBadgeConfiguration {
3
3
  /**
4
4
  * The text type of the ad badge.
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @deprecated The interface will be removed since RN SDK V2.1.
3
+ * Use {@link ShoppingCTAEvent} instead.
4
+ */
1
5
  export default interface AddToCartResult {
2
6
  /**
3
7
  * The result of Adding to Cart
@@ -4,6 +4,7 @@ export declare enum FWEventName {
4
4
  VideoPlayback = "fw:video-playback",
5
5
  VideoFeedClick = "fw:video-feed-click",
6
6
  AddToCart = "fw:shopping:add-to-cart",
7
+ ShoppingCTAButtonClick = "fw:shopping:cta-button-click",
7
8
  ClickCartIcon = "fw:shopping:click-cart-icon",
8
9
  UpdateProductDetails = "fw:shopping:update-product-details",
9
10
  WillDisplayProduct = "fw:shopping:will-display-product",
@@ -11,6 +12,7 @@ export declare enum FWEventName {
11
12
  LiveStreamChat = "fw:livestream-chat",
12
13
  ShareBaseURLUpdated = "fw:share-base-url-updated",
13
14
  AdBadgeConfigurationUpdated = "fw:ad-badge-configuration-updated",
15
+ AppLanguageUpdated = "fw:app-language-updated",
14
16
  LogMessage = "fw:log-message",
15
17
  CustomLinkButtonClick = "fw:shopping:custom-link-button-click"
16
18
  }
@@ -25,6 +25,10 @@ export interface VideoPlaybackEvent {
25
25
  export interface VideoFeedClickEvent {
26
26
  info: FeedItemDetails;
27
27
  }
28
+ /**
29
+ * @deprecated The interface will be removed since RN SDK V2.1.
30
+ * Use {@link ShoppingCTAEvent} instead.
31
+ */
28
32
  export interface AddToCartEvent {
29
33
  /**
30
34
  * A unique identifier of the product.
@@ -35,6 +39,20 @@ export interface AddToCartEvent {
35
39
  */
36
40
  unitId: string;
37
41
  }
42
+ export interface ShoppingCTAEvent {
43
+ /**
44
+ * The url for the product unit
45
+ */
46
+ url: string;
47
+ /**
48
+ * A unique identifier of the product.
49
+ */
50
+ productId: string;
51
+ /**
52
+ * A unique identifier of the product unit.
53
+ */
54
+ unitId: string;
55
+ }
38
56
  export interface UpdateProductDetailsEvent {
39
57
  /**
40
58
  * A unique identifier list of the products.
@@ -57,7 +75,16 @@ export interface LiveStreamChatEvent {
57
75
  liveStream: LiveStreamEventDetails;
58
76
  }
59
77
  export interface CustomClickLinkButtonEvent {
78
+ /**
79
+ * The url for the product unit
80
+ */
60
81
  url: string;
82
+ /**
83
+ * A unique identifier of the product.
84
+ */
61
85
  productId: string;
86
+ /**
87
+ * A unique identifier of the product unit.
88
+ */
62
89
  unitId: string;
63
90
  }
@@ -1,5 +1,5 @@
1
- export declare type IOSSystemFontStyle = 'normal' | 'italic';
2
- export declare type IOSSystemFontWeight = 'ultraLight' | 'thin' | 'light' | 'regular' | 'medium' | 'semibold' | 'bold' | 'heavy' | 'black';
1
+ export type IOSSystemFontStyle = 'normal' | 'italic';
2
+ export type IOSSystemFontWeight = 'ultraLight' | 'thin' | 'light' | 'regular' | 'medium' | 'semibold' | 'bold' | 'heavy' | 'black';
3
3
  export default interface IOSFontInfo {
4
4
  /**
5
5
  * The iOS font name, such as "Helvetica", "Helvetica-Bold".
@@ -1,4 +1,4 @@
1
- export declare type NewNativeContainerProps = {
1
+ export type NewNativeContainerProps = {
2
2
  initialRouteName?: string;
3
3
  initialParams?: {
4
4
  [key: string]: any;
@@ -1,4 +1,8 @@
1
1
  import type IOSFontInfo from './IOSFontInfo';
2
+ /**
3
+ * @deprecated The interface will be removed since RN SDK V2.1.
4
+ * Use {@link ShoppingCTAButtonConfiguration} instead.
5
+ */
2
6
  export interface AddToCartButtonConfiguration {
3
7
  /**
4
8
  * The background color of "Add to cart" button.
@@ -19,14 +23,45 @@ export interface AddToCartButtonConfiguration {
19
23
  */
20
24
  iOSFontInfo?: IOSFontInfo;
21
25
  }
26
+ export type ShoppingCTAButtonText = 'addToCart' | 'shopNow';
27
+ export interface ShoppingCTAButtonConfiguration {
28
+ /**
29
+ * The text of shopping CTA button.
30
+ */
31
+ text?: ShoppingCTAButtonText;
32
+ /**
33
+ * The background color of CTA button.
34
+ */
35
+ backgroundColor?: string;
36
+ /**
37
+ * The text color of CTA button.
38
+ */
39
+ textColor?: string;
40
+ /**
41
+ * The font size of CTA button.
42
+ */
43
+ fontSize?: number;
44
+ /**
45
+ * The iOS font info of "Add to cart" button.
46
+ * The property is ignored when fontSize is not set.
47
+ */
48
+ iOSFontInfo?: IOSFontInfo;
49
+ }
22
50
  export interface LinkButtonConfiguration {
23
51
  isHidden?: boolean;
24
52
  }
25
53
  export default interface ProductInfoViewConfiguration {
26
54
  /**
27
55
  * Configuration of "Add to cart" button. Only supported on iOS.
56
+ *
57
+ * @deprecated The property will be removed since RN SDK V2.1.
58
+ * Use {@link ctaButton} instead.
28
59
  */
29
60
  addToCartButton?: AddToCartButtonConfiguration;
61
+ /**
62
+ * Configuration of shopping CTA button. Only supported on iOS.
63
+ */
64
+ ctaButton?: ShoppingCTAButtonConfiguration;
30
65
  /**
31
66
  * Configuration of link button next to "Add to cart" button. Only supported on iOS.
32
67
  */
@@ -0,0 +1,11 @@
1
+ export default interface ShoppingCTAResult {
2
+ /**
3
+ * The result of shopping CTA button
4
+ */
5
+ res: 'success' | 'fail';
6
+ /**
7
+ * We will show a toast to display the tips.
8
+ * If the property is undefined or empty string, we don't show a toast.
9
+ */
10
+ tips?: string;
11
+ }
@@ -1 +1 @@
1
- export declare type StoryBlockSource = 'discover' | 'channel' | 'playlist' | 'dynamicContent';
1
+ export type StoryBlockSource = 'discover' | 'channel' | 'playlist' | 'dynamicContent';
@@ -13,7 +13,7 @@ export interface VideoFeedTitleConfiguration {
13
13
  */
14
14
  fontSize?: number;
15
15
  /**
16
- * The iOS font info of "Add to cart" button.
16
+ * The iOS font info of video feed title.
17
17
  * The property is ignored when fontSize is not set.
18
18
  * Only supported on iOS.
19
19
  */
@@ -23,7 +23,7 @@ export interface VideoFeedPlayIconConfiguration {
23
23
  hidden?: boolean;
24
24
  iconWidth?: number;
25
25
  }
26
- export declare type VideoFeedTitlePosition = 'stacked' | 'nested';
26
+ export type VideoFeedTitlePosition = 'stacked' | 'nested';
27
27
  export interface VideoFeedContentPadding {
28
28
  top?: number;
29
29
  right?: number;
@@ -84,7 +84,8 @@ export default interface VideoFeedConfiguration {
84
84
  /**
85
85
  * Please use the enablePictureInPicture in IVideoFeedProps. Only supported on iOS.
86
86
  *
87
- * @deprecated The property will be deprecated since RN SDK V2.
87
+ * @deprecated The property will be deprecated since RN SDK V2.0.
88
+ * Use {@link IVideoFeedProps.enablePictureInPicture} of {@link IVideoFeedProps} instead.
88
89
  */
89
90
  enablePictureInPicture?: boolean;
90
91
  }
@@ -1 +1 @@
1
- export declare type VideoFeedSource = 'discover' | 'channel' | 'playlist' | 'playlistGroup' | 'dynamicContent';
1
+ export type VideoFeedSource = 'discover' | 'channel' | 'playlist' | 'playlistGroup' | 'dynamicContent';
@@ -1,6 +1,6 @@
1
1
  import type IOSFontInfo from './IOSFontInfo';
2
- export declare type VideoPlayerStyle = 'full' | 'fit';
3
- export declare type VideoPlayerCompleteAction = 'loop' | 'advanceToNext';
2
+ export type VideoPlayerStyle = 'full' | 'fit';
3
+ export type VideoPlayerCompleteAction = 'loop' | 'advanceToNext';
4
4
  export interface VideoPlayerCTAStyle {
5
5
  /**
6
6
  * The background color of CTA button.
@@ -15,13 +15,13 @@ export interface VideoPlayerCTAStyle {
15
15
  */
16
16
  fontSize?: number;
17
17
  /**
18
- * The iOS font info of "Add to cart" button.
18
+ * The iOS font info of CTA button.
19
19
  * The property is ignored when fontSize is not set.
20
20
  * Only supported on iOS.
21
21
  */
22
22
  iOSFontInfo?: IOSFontInfo;
23
23
  }
24
- export declare type VideoPlayerCTADelayType = 'constant' | 'percentage';
24
+ export type VideoPlayerCTADelayType = 'constant' | 'percentage';
25
25
  export interface VideoPlayerCTADelay {
26
26
  type: VideoPlayerCTADelayType;
27
27
  /**
@@ -32,7 +32,7 @@ export interface VideoPlayerCTADelay {
32
32
  */
33
33
  value: number;
34
34
  }
35
- export declare type VideoLaunchBehavior = 'default' | 'muteOnFirstLaunch';
35
+ export type VideoLaunchBehavior = 'default' | 'muteOnFirstLaunch';
36
36
  export default interface VideoPlayerConfiguration {
37
37
  /**
38
38
  * Sets the proportion of the video player to its container.
@@ -60,6 +60,8 @@ export default interface VideoPlayerConfiguration {
60
60
  showMuteButton?: boolean;
61
61
  /**
62
62
  * Specifies the video player launch behavior.
63
+ *
64
+ * @deprecated The type will be deprecated since RN SDK V2.0.
63
65
  */
64
66
  launchBehavior?: VideoLaunchBehavior;
65
67
  /**
@@ -12,8 +12,7 @@ interface IFireworkSDKModule extends NativeModule {
12
12
  setAdBadgeConfiguration(config?: AdBadgeConfiguration): Promise<any>;
13
13
  setAppComponentName(name?: string): Promise<any>;
14
14
  trackPurchase(parameters: TrackPurchaseParameters): void;
15
- changeAppLanguage(language: string): Promise<boolean>;
16
- restart(): Promise<void>;
15
+ changeAppLanguage(language?: string | null): Promise<boolean>;
17
16
  }
18
17
  declare const FireworkSDKModuleEventEmitter: NativeEventEmitter;
19
18
  export { FireworkSDKModuleEventEmitter };
@@ -2,10 +2,12 @@ import { NativeEventEmitter, NativeModule } from 'react-native';
2
2
  import type { NewNativeContainerProps } from '../models/NewNativeContainerProps';
3
3
  import type Product from '../models/Product';
4
4
  import type ProductInfoViewConfiguration from '../models/ProductInfoViewConfiguration';
5
+ import type ShoppingCTAResult from '../models/ShoppingCTAResult';
5
6
  interface IShoppingModule extends NativeModule {
6
7
  init(): void;
7
8
  updateVideoProducts(products: Product[], callbackId: number | string): void;
8
9
  updateAddToCartStatus(res: string, tips: string, callbackId: number | string): void;
10
+ updateShoppingCTAResult(result: ShoppingCTAResult, callbackId: number | string): void;
9
11
  jumpToCartPage(callbackId: number | string, props: NewNativeContainerProps): void;
10
12
  setCartIconVisible(visible: boolean): void;
11
13
  setCartItemCount(count: number): void;