提交 28bcbfec 编写于 作者: D DCloud_LXH

feat: 添加鸿蒙兼容性

上级 24f0ec42
...@@ -23,8 +23,8 @@ export type GetBatteryInfoOptions = { ...@@ -23,8 +23,8 @@ export type GetBatteryInfoOptions = {
* 接口调用成功的回调 * 接口调用成功的回调
*/ */
complete ?: (res : any) => void complete ?: (res : any) => void
} }
export type GetBatteryInfoResult = { export type GetBatteryInfoResult = {
/** /**
* 设备电量,范围1 - 100 * 设备电量,范围1 - 100
...@@ -34,8 +34,8 @@ export type GetBatteryInfoResult = { ...@@ -34,8 +34,8 @@ export type GetBatteryInfoResult = {
* 是否正在充电中 * 是否正在充电中
*/ */
isCharging : boolean isCharging : boolean
} }
/** /**
* 错误码 * 错误码
* - 1001 getAppContext is null * - 1001 getAppContext is null
...@@ -60,8 +60,8 @@ export interface GetBatteryInfoFail extends IUniError { ...@@ -60,8 +60,8 @@ export interface GetBatteryInfoFail extends IUniError {
* @assert () => success({errCode: 0, errSubject: "uni-getBatteryInfo", errMsg: "getBatteryInfo:ok", level: 60, isCharging: false }) * @assert () => success({errCode: 0, errSubject: "uni-getBatteryInfo", errMsg: "getBatteryInfo:ok", level: 60, isCharging: false })
* @assert () => fail({errCode: 1001, errSubject: "uni-getBatteryInfo", errMsg: "getBatteryInfo:fail getAppContext is null" }) * @assert () => fail({errCode: 1001, errSubject: "uni-getBatteryInfo", errMsg: "getBatteryInfo:fail getAppContext is null" })
*/ */
export type GetBatteryInfo = (options : GetBatteryInfoOptions) => void export type GetBatteryInfo = (options : GetBatteryInfoOptions) => void
export type GetBatteryInfoSync = () => GetBatteryInfoResult export type GetBatteryInfoSync = () => GetBatteryInfoResult
...@@ -69,8 +69,7 @@ interface Uni { ...@@ -69,8 +69,7 @@ interface Uni {
/** /**
* 获取电池电量信息 * 获取电池电量信息
* @description 获取电池电量信息 *
* @param {GetBatteryInfoOptions} options
* @example * @example
* ```typescript * ```typescript
* uni.getBatteryInfo({ * uni.getBatteryInfo({
...@@ -92,39 +91,49 @@ interface Uni { ...@@ -92,39 +91,49 @@ interface Uni {
* "osVer": "12.0", * "osVer": "12.0",
* "uniVer": "3.6.11", * "uniVer": "3.6.11",
* "unixVer": "4.11" * "unixVer": "4.11"
* } * },
* "harmony": {
* "osVer": "x",
* "uniVer": "x",
* "unixVer": "x"
* }
* }
* }
* @uniVueVersion 2,3 //支持的vue版本
*
*/
getBatteryInfo (options : GetBatteryInfoOptions) : void,
/**
* 同步获取电池电量信息
*
* @example
* ```typescript
* uni.getBatteryInfo()
* ```
* @remark
* - 该接口需要同步调用
* @uniPlatform {
* "app": {
* "android": {
* "osVer": "4.4.4",
* "uniVer": "3.6.11",
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "12.0",
* "uniVer": "3.6.11",
* "unixVer": "4.11"
* },
* "harmony": {
* "osVer": "x",
* "uniVer": "x",
* "unixVer": "x"
* }
* } * }
* } * }
* @uniVueVersion 2,3 //支持的vue版本 * @uniVueVersion 2,3 //支持的vue版本
* *
*/ */
getBatteryInfo (options : GetBatteryInfoOptions) : void,
/**
* 同步获取电池电量信息
* @description 获取电池电量信息
* @example
* ```typescript
* uni.getBatteryInfo()
* ```
* @remark
* - 该接口需要同步调用
* @uniPlatform {
* "app": {
* "android": {
* "osVer": "4.4.4",
* "uniVer": "3.6.11",
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "12.0",
* "uniVer": "3.6.11",
* "unixVer": "4.11"
* }
* }
* }
* @uniVueVersion 2,3 //支持的vue版本
*
*/
getBatteryInfoSync():GetBatteryInfoResult getBatteryInfoSync():GetBatteryInfoResult
} }
...@@ -63,11 +63,11 @@ export type SetUserCaptureScreenOptions = { ...@@ -63,11 +63,11 @@ export type SetUserCaptureScreenOptions = {
*/ */
// complete : SetUserCaptureScreenSuccessCallback | SetUserCaptureScreenFailCallback | null // complete : SetUserCaptureScreenSuccessCallback | SetUserCaptureScreenFailCallback | null
complete ?: SetUserCaptureScreenCompleteCallback complete ?: SetUserCaptureScreenCompleteCallback
} }
/** /**
* 错误码 * 错误码
* - 12001 "setUserCaptureScreen:system not support" * - 12001 "setUserCaptureScreen:system not support"
* - 12010 "setUserCaptureScreen:system internal error" * - 12010 "setUserCaptureScreen:system internal error"
*/ */
export type SetUserCaptureScreenErrorCode = 12001 | 12010; export type SetUserCaptureScreenErrorCode = 12001 | 12010;
...@@ -80,76 +80,91 @@ export interface SetUserCaptureScreenFail extends IUniError { ...@@ -80,76 +80,91 @@ export interface SetUserCaptureScreenFail extends IUniError {
export type SetUserCaptureScreen = (options : SetUserCaptureScreenOptions) => void export type SetUserCaptureScreen = (options : SetUserCaptureScreenOptions) => void
export interface Uni { export interface Uni {
/** /**
* 开启截屏监听 * 开启截屏监听
* *
* @param {UserCaptureScreenCallback} callback * @param {UserCaptureScreenCallback} callback
* @tutorial https://uniapp.dcloud.net.cn/api/system/capture-screen.html#onusercapturescreen * @tutorial https://uniapp.dcloud.net.cn/api/system/capture-screen.html#onusercapturescreen
* @uniPlatform { * @uniPlatform {
* "app": { * "app": {
* "android": { * "android": {
* "osVer": "4.4.4", * "osVer": "4.4.4",
* "uniVer": "3.7.7", * "uniVer": "3.7.7",
* "unixVer": "3.9.0" * "unixVer": "3.9.0"
* }, * },
* "ios": { * "ios": {
* "osVer": "12.0", * "osVer": "12.0",
* "uniVer": "3.7.7", * "uniVer": "3.7.7",
* "unixVer": "4.11" * "unixVer": "4.11"
* } * },
* } * "harmony": {
* } * "osVer": "x",
* @uniVersion 3.7.7 * "uniVer": "x",
* "unixVer": "x"
* }
* }
* }
* @uniVersion 3.7.7
* @uniVueVersion 2,3 //支持的vue版本 * @uniVueVersion 2,3 //支持的vue版本
* @autotest { expectCallback: true } * @autotest { expectCallback: true }
*/ */
onUserCaptureScreen(callback : UserCaptureScreenCallback | null) : void, onUserCaptureScreen(callback : UserCaptureScreenCallback | null) : void,
/** /**
* 关闭截屏监听 * 关闭截屏监听
* *
* @param {UserCaptureScreenCallback} callback * @param {UserCaptureScreenCallback} callback
* @tutorial https://uniapp.dcloud.net.cn/api/system/capture-screen.html#offusercapturescreen * @tutorial https://uniapp.dcloud.net.cn/api/system/capture-screen.html#offusercapturescreen
* @uniPlatform { * @uniPlatform {
* "app": { * "app": {
* "android": { * "android": {
* "osVer": "4.4.4", * "osVer": "4.4.4",
* "uniVer": "3.7.7", * "uniVer": "3.7.7",
* "unixVer": "3.9.0" * "unixVer": "3.9.0"
* }, * },
* "ios": { * "ios": {
* "osVer": "12.0", * "osVer": "12.0",
* "uniVer": "3.7.7", * "uniVer": "3.7.7",
* "unixVer": "4.11" * "unixVer": "4.11"
* } * },
* } * "harmony": {
* } * "osVer": "x",
* @uniVersion 3.7.7 * "uniVer": "x",
* "unixVer": "x"
* }
* }
* }
* @uniVersion 3.7.7
* @uniVueVersion 2,3 //支持的vue版本 * @uniVueVersion 2,3 //支持的vue版本
* @autotest { expectCallback: true } * @autotest { expectCallback: true }
*/ */
offUserCaptureScreen(callback : UserCaptureScreenCallback | null) : void, offUserCaptureScreen(callback : UserCaptureScreenCallback | null) : void,
/** /**
* 设置防截屏 * 设置防截屏
* *
* @param {SetUserCaptureScreenOptions} options * @param {SetUserCaptureScreenOptions} options
* @tutorial https://uniapp.dcloud.net.cn/api/system/capture-screen.html#setusercapturescreen * @tutorial https://uniapp.dcloud.net.cn/api/system/capture-screen.html#setusercapturescreen
* @uniPlatform { * @uniPlatform {
* "app": { * "app": {
* "android": { * "android": {
* "osVer": "4.4.4", * "osVer": "4.4.4",
* "uniVer": "3.7.7", * "uniVer": "3.7.7",
* "unixVer": "3.9.0" * "unixVer": "3.9.0"
* }, * },
* "ios": { * "ios": {
* "osVer": "13.0", * "osVer": "13.0",
* "uniVer": "3.7.7", * "uniVer": "3.7.7",
* "unixVer": "4.11" * "unixVer": "4.11"
* } * },
* } * "harmony": {
* } * "osVer": "x",
* @uniVersion 3.7.7 * "uniVer": "x",
* @uniVueVersion 2,3 //支持的vue版本 * "unixVer": "x"
* }
* }
* }
* @uniVersion 3.7.7
* @uniVueVersion 2,3 //支持的vue版本
*/ */
setUserCaptureScreen(options : SetUserCaptureScreenOptions) : void setUserCaptureScreen(options : SetUserCaptureScreenOptions) : void
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册