fk-platform-sdk 1.0.31-beta-5.2 → 1.0.33

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.
@@ -8,4 +8,5 @@ export interface NativeModuleManagerProvider {
8
8
  SMSModule: NativeModuleManager;
9
9
  LocationModule: NativeModuleManager;
10
10
  AppVersionModule: NativeModuleManager;
11
+ DownloaderModule: NativeModuleManager;
11
12
  }
@@ -0,0 +1,5 @@
1
+ import { NativeModuleResponse } from "../NativeModuleResponse";
2
+ import { DownloadManagerResponse } from "../../types/DownloadManagerResponse";
3
+ export interface DownloaderModule {
4
+ fileDownload: (url: string, mimeType: string) => Promise<NativeModuleResponse<DownloadManagerResponse>>;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -6,6 +6,7 @@ import { AnalyticsModule } from "../analytics/interfaces/AnalyticsModule";
6
6
  import { SMSModule } from "../interfaces/modules/SMSModule";
7
7
  import { LocationModule } from "../interfaces/modules/LocationModule";
8
8
  import { AppVersionModule } from "../interfaces/modules/AppVersionModule";
9
+ import { DownloaderModule } from "../interfaces/modules/DownloaderModule";
9
10
  export declare class ModuleManager {
10
11
  private moduleMap;
11
12
  constructor(nativeModuleCallbackManager: NativeModuleCallbackManager);
@@ -16,6 +17,7 @@ export declare class ModuleManager {
16
17
  getSMSModule(): SMSModule;
17
18
  getLocationModule(): LocationModule;
18
19
  getAppVersionModule(): AppVersionModule;
20
+ getDownloaderModule(): DownloaderModule;
19
21
  private addModule;
20
22
  private getModule;
21
23
  }
@@ -7,6 +7,7 @@ var AnalyticsModuleImpl_1 = require("../modules/AnalyticsModuleImpl");
7
7
  var SMSModuleImpl_1 = require("../modules/SMSModuleImpl");
8
8
  var LocationModuleImpl_1 = require("../modules/LocationModuleImpl");
9
9
  var AppVersionModuleImpl_1 = require("../modules/AppVersionModuleImpl");
10
+ var DownloaderModuleImpl_1 = require("../modules/DownloaderModuleImpl");
10
11
  var MODULE_NAME;
11
12
  (function (MODULE_NAME) {
12
13
  MODULE_NAME[MODULE_NAME["PERMISSION_MODULE"] = 0] = "PERMISSION_MODULE";
@@ -16,6 +17,7 @@ var MODULE_NAME;
16
17
  MODULE_NAME[MODULE_NAME["SMS_MODULE"] = 4] = "SMS_MODULE";
17
18
  MODULE_NAME[MODULE_NAME["LOCATION_MODULE"] = 5] = "LOCATION_MODULE";
18
19
  MODULE_NAME[MODULE_NAME["APP_VERSION_MODULE"] = 6] = "APP_VERSION_MODULE";
20
+ MODULE_NAME[MODULE_NAME["DOWNLOADER_MODULE"] = 7] = "DOWNLOADER_MODULE";
19
21
  })(MODULE_NAME || (MODULE_NAME = {}));
20
22
  var ModuleManager = /** @class */ (function () {
21
23
  function ModuleManager(nativeModuleCallbackManager) {
@@ -27,6 +29,7 @@ var ModuleManager = /** @class */ (function () {
27
29
  this.addModule(MODULE_NAME.SMS_MODULE, new SMSModuleImpl_1.SMSModuleImpl(nativeModuleCallbackManager));
28
30
  this.addModule(MODULE_NAME.LOCATION_MODULE, new LocationModuleImpl_1.LocationModuleImpl(nativeModuleCallbackManager));
29
31
  this.addModule(MODULE_NAME.APP_VERSION_MODULE, new AppVersionModuleImpl_1.AppVersionModuleImpl(nativeModuleCallbackManager));
32
+ this.addModule(MODULE_NAME.DOWNLOADER_MODULE, new DownloaderModuleImpl_1.DownloaderModuleImpl(nativeModuleCallbackManager));
30
33
  }
31
34
  ModuleManager.prototype.getNavigationModule = function () {
32
35
  return this.getModule(MODULE_NAME.NAVIGATION_MODULE);
@@ -49,6 +52,9 @@ var ModuleManager = /** @class */ (function () {
49
52
  ModuleManager.prototype.getAppVersionModule = function () {
50
53
  return this.getModule(MODULE_NAME.APP_VERSION_MODULE);
51
54
  };
55
+ ModuleManager.prototype.getDownloaderModule = function () {
56
+ return this.getModule(MODULE_NAME.DOWNLOADER_MODULE);
57
+ };
52
58
  ModuleManager.prototype.addModule = function (moduleName, nativeModule) {
53
59
  this.moduleMap[moduleName] = nativeModule;
54
60
  };
@@ -0,0 +1,9 @@
1
+ import { NativeModuleResponse } from "../interfaces/NativeModuleResponse";
2
+ import { NativeModule, NativeModuleManager } from "../managers/NativeModuleHelper";
3
+ import { NativeModuleCallbackManager } from "../managers/NativeModuleCallbackManager";
4
+ import { DownloaderModule } from "../interfaces/modules/DownloaderModule";
5
+ import { DownloadManagerResponse } from "../types/DownloadManagerResponse";
6
+ export declare class DownloaderModuleImpl extends NativeModule<NativeModuleManager> implements DownloaderModule {
7
+ constructor(nativeModuleCallbackManager: NativeModuleCallbackManager);
8
+ fileDownload(url: string, mimeType: string): Promise<NativeModuleResponse<DownloadManagerResponse>>;
9
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ return function (d, b) {
7
+ extendStatics(d, b);
8
+ function __() { this.constructor = d; }
9
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10
+ };
11
+ })();
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ var NativeModuleHelper_1 = require("../managers/NativeModuleHelper");
14
+ var DownloaderModuleImpl = /** @class */ (function (_super) {
15
+ __extends(DownloaderModuleImpl, _super);
16
+ function DownloaderModuleImpl(nativeModuleCallbackManager) {
17
+ return _super.call(this, NativeModuleHelper_1.NativeModuleHelper.getCurrentNativeModuleProvider().DownloaderModule, nativeModuleCallbackManager) || this;
18
+ }
19
+ DownloaderModuleImpl.prototype.fileDownload = function (url, mimeType) {
20
+ var _this = this;
21
+ return this.nativeModuleCallbackManager.executeOnBridge(function (requestId) {
22
+ _this.postMessage({
23
+ methodName: "fileDownload",
24
+ requestId: requestId,
25
+ url: url,
26
+ mimeType: mimeType
27
+ });
28
+ });
29
+ };
30
+ return DownloaderModuleImpl;
31
+ }(NativeModuleHelper_1.NativeModule));
32
+ exports.DownloaderModuleImpl = DownloaderModuleImpl;
@@ -0,0 +1,3 @@
1
+ export interface DownloadManagerResponse {
2
+ message: string;
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fk-platform-sdk",
3
- "version": "1.0.31-beta-5.2",
3
+ "version": "1.0.33",
4
4
  "description": "SDK to enable external experience integration within flipkart app.",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",