diff --git a/uni_modules/uni-getbatteryinfo/index.d.ts b/uni_modules/uni-getbatteryinfo/index.d.ts deleted file mode 100644 index 60b511f68f86e4fff522ee27ff04f3d5713a9645..0000000000000000000000000000000000000000 --- a/uni_modules/uni-getbatteryinfo/index.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -declare namespace UniNamespace { - interface GetBatteryInfoSuccessCallbackResult { - /** - * 是否正在充电中 - */ - isCharging: boolean; - /** - * 设备电量,范围 1 - 100 - */ - level: number; - errMsg: string; - } - - interface GetBatteryInfoOption { - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function - /** - * 接口调用失败的回调函数 - */ - fail?: Function - /** - * 接口调用成功的回调函数 - */ - success?: (result: GetBatteryInfoSuccessCallbackResult) => void - } -} - -declare interface Uni { - /** - * 获取设备电量 - * - * 文档: [https://uniapp.dcloud.net.cn/api/system/batteryInfo.html](https://uniapp.dcloud.net.cn/api/system/batteryInfo.html) - */ - getBatteryInfo(option?: UniNamespace.GetBatteryInfoOption): void; -} diff --git a/uni_modules/uni-getbatteryinfo/utssdk/app-android/index.uts b/uni_modules/uni-getbatteryinfo/utssdk/app-android/index.uts index 6006789a2d7ae16fb1b5d8e76b6a61ecd5ab0438..776339c4b83712305c8bc6b4d2a22a6f358b3eb2 100644 --- a/uni_modules/uni-getbatteryinfo/utssdk/app-android/index.uts +++ b/uni_modules/uni-getbatteryinfo/utssdk/app-android/index.uts @@ -5,9 +5,8 @@ import { UTSAndroid } from "io.dcloud.uts"; import { GetBatteryInfo, GetBatteryInfoSuccess, GetBatteryInfoResult,GetBatteryInfoSync } from '../interface.uts' /** * 异步获取电量 - * @param {Object} options */ -export const getBatteryInfo : GetBatteryInfo = function (options) { +export const getBatteryInfo : GetBatteryInfo = function (options : GetBatteryInfoOptions) { const context = UTSAndroid.getAppContext(); if (context != null) { const manager = context.getSystemService(