@byhealth/native-app-jssdk
Advanced tools
Comparing version 2.1.0 to 2.2.0-beta.1
@@ -8,2 +8,7 @@ import { ShareInfo, UserInfo, NewUserInfo } from './types/MemberAppJs'; | ||
/** | ||
* 获取App当前版本信息 | ||
* @returns {Promise<string>} iOS,4.1.0 或者 Android,4.1.0 | ||
*/ | ||
export declare function getVersion(): Promise<string>; | ||
/** | ||
* 返回上一级页面,如果没有上一级页面,则关闭当前页面。 | ||
@@ -10,0 +15,0 @@ */ |
@@ -30,2 +30,13 @@ "use strict"; | ||
/** | ||
* 获取App当前版本信息 | ||
* @returns {Promise<string>} iOS,4.1.0 或者 Android,4.1.0 | ||
*/ | ||
function getVersion() { | ||
return new Promise(function (resolve, reject) { | ||
nativeBridge_1.default('getAPPVersion', createCallback_1.default(resolve)); | ||
setTimeout(function () { return reject(unsupported('getAPPVersion')); }, 1000); | ||
}); | ||
} | ||
exports.getVersion = getVersion; | ||
/** | ||
* 返回上一级页面,如果没有上一级页面,则关闭当前页面。 | ||
@@ -242,1 +253,9 @@ */ | ||
} | ||
/** | ||
* 提示不支持接口 | ||
* @param api 接口名称 | ||
* @ignore | ||
*/ | ||
function unsupported(api) { | ||
throw new TypeError("Native webview does not support '" + api + "' API"); | ||
} |
@@ -16,2 +16,12 @@ /* | ||
/** | ||
* 获取App当前版本信息 | ||
* @returns {Promise<string>} iOS,4.1.0 或者 Android,4.1.0 | ||
*/ | ||
export function getVersion() { | ||
return new Promise(function (resolve, reject) { | ||
nativeBridge('getAPPVersion', createCallback(resolve)); | ||
setTimeout(function () { return reject(unsupported('getAPPVersion')); }, 1000); | ||
}); | ||
} | ||
/** | ||
* 返回上一级页面,如果没有上一级页面,则关闭当前页面。 | ||
@@ -204,2 +214,10 @@ */ | ||
} | ||
/** | ||
* 提示不支持接口 | ||
* @param api 接口名称 | ||
* @ignore | ||
*/ | ||
function unsupported(api) { | ||
throw new TypeError("Native webview does not support '" + api + "' API"); | ||
} | ||
export { NativeView }; |
{ | ||
"name": "@byhealth/native-app-jssdk", | ||
"version": "2.1.0", | ||
"version": "2.2.0-beta.1", | ||
"description": "By-Health Native App Jssdk.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -7,4 +7,4 @@ # By-Health Native App Jssdk | ||
* Yarn: `yarn add @byhealth/native-app-jssdk@next` | ||
* NPM: `npm install @byhealth/native-app-jssdk@next --save` | ||
* Yarn: `yarn add @byhealth/native-app-jssdk` | ||
* NPM: `npm install @byhealth/native-app-jssdk --save` | ||
@@ -11,0 +11,0 @@ ### 使用 |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
84620
1913
2