fk-platform-sdk 1.0.33 → 1.0.34
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/interfaces/NativeModuleManagerProvider.d.ts +1 -0
- package/dist/interfaces/modules/FontModule.d.ts +5 -0
- package/dist/interfaces/modules/FontModule.js +2 -0
- package/dist/managers/ModuleManager.d.ts +2 -0
- package/dist/managers/ModuleManager.js +6 -0
- package/dist/modules/FontModuleImpl.d.ts +9 -0
- package/dist/modules/FontModuleImpl.js +32 -0
- package/dist/types/FontsManagerResponse.d.ts +3 -0
- package/dist/types/FontsManagerResponse.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { NativeModuleResponse } from "../NativeModuleResponse";
|
|
2
|
+
import { FontsManagerResponse } from "../../types/FontsManagerResponse";
|
|
3
|
+
export interface FontModule {
|
|
4
|
+
downloadFont: (fontFamily: string, url: string) => Promise<NativeModuleResponse<FontsManagerResponse>>;
|
|
5
|
+
}
|
|
@@ -7,6 +7,7 @@ import { SMSModule } from "../interfaces/modules/SMSModule";
|
|
|
7
7
|
import { LocationModule } from "../interfaces/modules/LocationModule";
|
|
8
8
|
import { AppVersionModule } from "../interfaces/modules/AppVersionModule";
|
|
9
9
|
import { DownloaderModule } from "../interfaces/modules/DownloaderModule";
|
|
10
|
+
import { FontModule } from "../interfaces/modules/FontModule";
|
|
10
11
|
export declare class ModuleManager {
|
|
11
12
|
private moduleMap;
|
|
12
13
|
constructor(nativeModuleCallbackManager: NativeModuleCallbackManager);
|
|
@@ -18,6 +19,7 @@ export declare class ModuleManager {
|
|
|
18
19
|
getLocationModule(): LocationModule;
|
|
19
20
|
getAppVersionModule(): AppVersionModule;
|
|
20
21
|
getDownloaderModule(): DownloaderModule;
|
|
22
|
+
getFontModule(): FontModule;
|
|
21
23
|
private addModule;
|
|
22
24
|
private getModule;
|
|
23
25
|
}
|
|
@@ -8,6 +8,7 @@ var SMSModuleImpl_1 = require("../modules/SMSModuleImpl");
|
|
|
8
8
|
var LocationModuleImpl_1 = require("../modules/LocationModuleImpl");
|
|
9
9
|
var AppVersionModuleImpl_1 = require("../modules/AppVersionModuleImpl");
|
|
10
10
|
var DownloaderModuleImpl_1 = require("../modules/DownloaderModuleImpl");
|
|
11
|
+
var FontModuleImpl_1 = require("../modules/FontModuleImpl");
|
|
11
12
|
var MODULE_NAME;
|
|
12
13
|
(function (MODULE_NAME) {
|
|
13
14
|
MODULE_NAME[MODULE_NAME["PERMISSION_MODULE"] = 0] = "PERMISSION_MODULE";
|
|
@@ -18,6 +19,7 @@ var MODULE_NAME;
|
|
|
18
19
|
MODULE_NAME[MODULE_NAME["LOCATION_MODULE"] = 5] = "LOCATION_MODULE";
|
|
19
20
|
MODULE_NAME[MODULE_NAME["APP_VERSION_MODULE"] = 6] = "APP_VERSION_MODULE";
|
|
20
21
|
MODULE_NAME[MODULE_NAME["DOWNLOADER_MODULE"] = 7] = "DOWNLOADER_MODULE";
|
|
22
|
+
MODULE_NAME[MODULE_NAME["FONT_MODULE"] = 8] = "FONT_MODULE";
|
|
21
23
|
})(MODULE_NAME || (MODULE_NAME = {}));
|
|
22
24
|
var ModuleManager = /** @class */ (function () {
|
|
23
25
|
function ModuleManager(nativeModuleCallbackManager) {
|
|
@@ -30,6 +32,7 @@ var ModuleManager = /** @class */ (function () {
|
|
|
30
32
|
this.addModule(MODULE_NAME.LOCATION_MODULE, new LocationModuleImpl_1.LocationModuleImpl(nativeModuleCallbackManager));
|
|
31
33
|
this.addModule(MODULE_NAME.APP_VERSION_MODULE, new AppVersionModuleImpl_1.AppVersionModuleImpl(nativeModuleCallbackManager));
|
|
32
34
|
this.addModule(MODULE_NAME.DOWNLOADER_MODULE, new DownloaderModuleImpl_1.DownloaderModuleImpl(nativeModuleCallbackManager));
|
|
35
|
+
this.addModule(MODULE_NAME.FONT_MODULE, new FontModuleImpl_1.FontModuleImpl(nativeModuleCallbackManager));
|
|
33
36
|
}
|
|
34
37
|
ModuleManager.prototype.getNavigationModule = function () {
|
|
35
38
|
return this.getModule(MODULE_NAME.NAVIGATION_MODULE);
|
|
@@ -55,6 +58,9 @@ var ModuleManager = /** @class */ (function () {
|
|
|
55
58
|
ModuleManager.prototype.getDownloaderModule = function () {
|
|
56
59
|
return this.getModule(MODULE_NAME.DOWNLOADER_MODULE);
|
|
57
60
|
};
|
|
61
|
+
ModuleManager.prototype.getFontModule = function () {
|
|
62
|
+
return this.getModule(MODULE_NAME.FONT_MODULE);
|
|
63
|
+
};
|
|
58
64
|
ModuleManager.prototype.addModule = function (moduleName, nativeModule) {
|
|
59
65
|
this.moduleMap[moduleName] = nativeModule;
|
|
60
66
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NativeModule, NativeModuleManager } from "../managers/NativeModuleHelper";
|
|
2
|
+
import { NativeModuleCallbackManager } from "../managers/NativeModuleCallbackManager";
|
|
3
|
+
import { NativeModuleResponse } from "../interfaces/NativeModuleResponse";
|
|
4
|
+
import { FontsManagerResponse } from "../types/FontsManagerResponse";
|
|
5
|
+
import { FontModule } from "../interfaces/modules/FontModule";
|
|
6
|
+
export declare class FontModuleImpl extends NativeModule<NativeModuleManager> implements FontModule {
|
|
7
|
+
constructor(nativeModuleCallbackManager: NativeModuleCallbackManager);
|
|
8
|
+
downloadFont(fontFamily: string, url: string): Promise<NativeModuleResponse<FontsManagerResponse>>;
|
|
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 FontModuleImpl = /** @class */ (function (_super) {
|
|
15
|
+
__extends(FontModuleImpl, _super);
|
|
16
|
+
function FontModuleImpl(nativeModuleCallbackManager) {
|
|
17
|
+
return _super.call(this, NativeModuleHelper_1.NativeModuleHelper.getCurrentNativeModuleProvider().FontModule, nativeModuleCallbackManager) || this;
|
|
18
|
+
}
|
|
19
|
+
FontModuleImpl.prototype.downloadFont = function (fontFamily, url) {
|
|
20
|
+
var _this = this;
|
|
21
|
+
return this.nativeModuleCallbackManager.executeOnBridge(function (requestId) {
|
|
22
|
+
_this.postMessage({
|
|
23
|
+
methodName: "downloadFont",
|
|
24
|
+
requestId: requestId,
|
|
25
|
+
fontFamily: fontFamily,
|
|
26
|
+
url: url
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
return FontModuleImpl;
|
|
31
|
+
}(NativeModuleHelper_1.NativeModule));
|
|
32
|
+
exports.FontModuleImpl = FontModuleImpl;
|