@dfeidao/atom-mobile
Advanced tools
Comparing version 4.6.201904261737 to 4.6.201904271518
{ | ||
"name": "@dfeidao/atom-mobile", | ||
"version": "4.6.201904261737", | ||
"version": "4.6.201904271518", | ||
"description": "原子操作", | ||
@@ -5,0 +5,0 @@ "scripts": { |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const uuid_1 = __importDefault(require("uuid")); | ||
const _pool_1 = require("./_pool"); | ||
function fire(fd, ctrl_name, action, msg, timeout) { | ||
// 这时,web中应已注册全局函数 function fd(msg: Imsg); | ||
const id = uuid_1.default(); | ||
const webview = fd.page.refs[ctrl_name]; | ||
const m = { | ||
action, | ||
content: msg === undefined ? null : msg, | ||
id, | ||
type: _pool_1.MessageType.native2web | ||
}; | ||
const content = JSON.stringify(m); | ||
webview.injectJavaScript(`fd(${JSON.stringify(id)},${JSON.stringify(content)});`); | ||
return _pool_1.add(m, timeout); | ||
return webview.fire(action, msg, timeout); | ||
} | ||
exports.default = fire; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
78157
2367