1413470f0Sopenharmony_ci/* 2413470f0Sopenharmony_ci * Copyright (c) 2020-2022 Huawei Device Co., Ltd. 3413470f0Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4413470f0Sopenharmony_ci * you may not use this file except in compliance with the License. 5413470f0Sopenharmony_ci * You may obtain a copy of the License at 6413470f0Sopenharmony_ci * 7413470f0Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8413470f0Sopenharmony_ci * 9413470f0Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10413470f0Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11413470f0Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12413470f0Sopenharmony_ci * See the License for the specific language governing permissions and 13413470f0Sopenharmony_ci * limitations under the License. 14413470f0Sopenharmony_ci */ 15413470f0Sopenharmony_ci 16413470f0Sopenharmony_ci/** 17413470f0Sopenharmony_ci * @sysCap SystemCapability.PowerManager.BatteryManager.Lite 18413470f0Sopenharmony_ci */ 19413470f0Sopenharmony_ci 20413470f0Sopenharmony_ciexport interface BatterySocResponse { 21413470f0Sopenharmony_ci 22413470f0Sopenharmony_ci batterySoc: number; 23413470f0Sopenharmony_ci} 24413470f0Sopenharmony_ci 25413470f0Sopenharmony_ci/** 26413470f0Sopenharmony_ci * @sysCap SystemCapability.PowerManager.BatteryManager.Lite 27413470f0Sopenharmony_ci */ 28413470f0Sopenharmony_ci 29413470f0Sopenharmony_ciexport interface GetBatterySOC { 30413470f0Sopenharmony_ci 31413470f0Sopenharmony_ci success?: (data: BatterySocResponse) => void; 32413470f0Sopenharmony_ci 33413470f0Sopenharmony_ci fail?: (data: string, code: number) => void; 34413470f0Sopenharmony_ci 35413470f0Sopenharmony_ci complete?: () => void; 36413470f0Sopenharmony_ci} 37413470f0Sopenharmony_ci 38413470f0Sopenharmony_ciexport interface BatteryChargingStatusResponse { 39413470f0Sopenharmony_ci 40413470f0Sopenharmony_ci chargingStatus: number; 41413470f0Sopenharmony_ci} 42413470f0Sopenharmony_ci 43413470f0Sopenharmony_ci/** 44413470f0Sopenharmony_ci * @sysCap SystemCapability.PowerManager.BatteryManager.Lite 45413470f0Sopenharmony_ci */ 46413470f0Sopenharmony_ci 47413470f0Sopenharmony_ciexport interface GetChargingStatus { 48413470f0Sopenharmony_ci success?: (data: BatteryChargingStatusResponse) => void; 49413470f0Sopenharmony_ci 50413470f0Sopenharmony_ci fail?: (data: string, code: number) => void; 51413470f0Sopenharmony_ci 52413470f0Sopenharmony_ci complete?: () => void; 53413470f0Sopenharmony_ci} 54413470f0Sopenharmony_ci 55413470f0Sopenharmony_ci/** 56413470f0Sopenharmony_ci * @sysCap SystemCapability.PowerManager.BatteryManager.Lite 57413470f0Sopenharmony_ci */ 58413470f0Sopenharmony_ci 59413470f0Sopenharmony_ciexport interface BatteryHealthStatusResponse { 60413470f0Sopenharmony_ci 61413470f0Sopenharmony_ci healthStatus: number; 62413470f0Sopenharmony_ci} 63413470f0Sopenharmony_ci 64413470f0Sopenharmony_ci/** 65413470f0Sopenharmony_ci * @sysCap SystemCapability.PowerManager.BatteryManager.Lite 66413470f0Sopenharmony_ci */ 67413470f0Sopenharmony_ci 68413470f0Sopenharmony_ciexport interface GetHealthStatus { 69413470f0Sopenharmony_ci 70413470f0Sopenharmony_ci success?: (data: BatteryHealthStatusResponse) => void; 71413470f0Sopenharmony_ci 72413470f0Sopenharmony_ci fail?: (data: string, code: number) => void; 73413470f0Sopenharmony_ci 74413470f0Sopenharmony_ci complete?: () => void; 75413470f0Sopenharmony_ci} 76413470f0Sopenharmony_ci 77413470f0Sopenharmony_ci/** 78413470f0Sopenharmony_ci * @sysCap SystemCapability.PowerManager.BatteryManager.Lite 79413470f0Sopenharmony_ci */ 80413470f0Sopenharmony_ci 81413470f0Sopenharmony_ciexport interface BatteryGetPluggedTypeResponse { 82413470f0Sopenharmony_ci 83413470f0Sopenharmony_ci pluggedType: number; 84413470f0Sopenharmony_ci} 85413470f0Sopenharmony_ci 86413470f0Sopenharmony_ci/** 87413470f0Sopenharmony_ci * @sysCap SystemCapability.PowerManager.BatteryManager.Lite 88413470f0Sopenharmony_ci */ 89413470f0Sopenharmony_ci 90413470f0Sopenharmony_ciexport interface GetPluggedType { 91413470f0Sopenharmony_ci 92413470f0Sopenharmony_ci success?: (data: BatteryGetPluggedTypeResponse) => void; 93413470f0Sopenharmony_ci 94413470f0Sopenharmony_ci fail?: (data: string, code: number) => void; 95413470f0Sopenharmony_ci 96413470f0Sopenharmony_ci complete?: () => void; 97413470f0Sopenharmony_ci} 98413470f0Sopenharmony_ci 99413470f0Sopenharmony_ci/** 100413470f0Sopenharmony_ci * @sysCap SystemCapability.PowerManager.BatteryManager.Lite 101413470f0Sopenharmony_ci */ 102413470f0Sopenharmony_ci 103413470f0Sopenharmony_ciexport interface BatteryGetVoltageResponse { 104413470f0Sopenharmony_ci 105413470f0Sopenharmony_ci voltage: number; 106413470f0Sopenharmony_ci} 107413470f0Sopenharmony_ci 108413470f0Sopenharmony_ci/** 109413470f0Sopenharmony_ci * @sysCap SystemCapability.PowerManager.BatteryManager.Lite 110413470f0Sopenharmony_ci */ 111413470f0Sopenharmony_ci 112413470f0Sopenharmony_ciexport interface GetVoltage { 113413470f0Sopenharmony_ci 114413470f0Sopenharmony_ci success?: (data: BatteryGetVoltageResponse) => void; 115413470f0Sopenharmony_ci 116413470f0Sopenharmony_ci fail?: (data: string, code: number) => void; 117413470f0Sopenharmony_ci 118413470f0Sopenharmony_ci complete?: () => void; 119413470f0Sopenharmony_ci} 120413470f0Sopenharmony_ci 121413470f0Sopenharmony_ci/** 122413470f0Sopenharmony_ci * @sysCap SystemCapability.PowerManager.BatteryManager.Lite 123413470f0Sopenharmony_ci */ 124413470f0Sopenharmony_ci 125413470f0Sopenharmony_ciexport interface BatteryTechnologyResponse { 126413470f0Sopenharmony_ci 127413470f0Sopenharmony_ci technology: string; 128413470f0Sopenharmony_ci} 129413470f0Sopenharmony_ci 130413470f0Sopenharmony_ci/** 131413470f0Sopenharmony_ci * @sysCap SystemCapability.PowerManager.BatteryManager.Lite 132413470f0Sopenharmony_ci */ 133413470f0Sopenharmony_ci 134413470f0Sopenharmony_ciexport interface GetTechnology { 135413470f0Sopenharmony_ci 136413470f0Sopenharmony_ci success?: (data: BatteryTechnologyResponse) => void; 137413470f0Sopenharmony_ci 138413470f0Sopenharmony_ci fail?: (data: string, code: number) => void; 139413470f0Sopenharmony_ci 140413470f0Sopenharmony_ci complete?: () => void; 141413470f0Sopenharmony_ci} 142413470f0Sopenharmony_ci 143413470f0Sopenharmony_ci/** 144413470f0Sopenharmony_ci * @sysCap SystemCapability.PowerManager.BatteryManager.Lite 145413470f0Sopenharmony_ci */ 146413470f0Sopenharmony_ci 147413470f0Sopenharmony_ciexport interface BatteryTemperatureResponse { 148413470f0Sopenharmony_ci 149413470f0Sopenharmony_ci temperature: number; 150413470f0Sopenharmony_ci} 151413470f0Sopenharmony_ci 152413470f0Sopenharmony_ci/** 153413470f0Sopenharmony_ci * @sysCap SystemCapability.PowerManager.BatteryManager.Lite 154413470f0Sopenharmony_ci */ 155413470f0Sopenharmony_ci 156413470f0Sopenharmony_ciexport interface GetTemperature { 157413470f0Sopenharmony_ci 158413470f0Sopenharmony_ci success?: (data: BatteryTemperatureResponse) => void; 159413470f0Sopenharmony_ci 160413470f0Sopenharmony_ci fail?: (data: string, code: number) => void; 161413470f0Sopenharmony_ci 162413470f0Sopenharmony_ci complete?: () => void; 163413470f0Sopenharmony_ci} 164413470f0Sopenharmony_ci 165413470f0Sopenharmony_ci/** 166413470f0Sopenharmony_ci * @sysCap SystemCapability.PowerManager.BatteryManager.Lite 167413470f0Sopenharmony_ci */ 168413470f0Sopenharmony_ci 169413470f0Sopenharmony_ciexport default class battery { 170413470f0Sopenharmony_ci 171413470f0Sopenharmony_ci/** 172413470f0Sopenharmony_ci * Battery state of charge (SoC) of the current device, in percent. 173413470f0Sopenharmony_ci */ 174413470f0Sopenharmony_ci 175413470f0Sopenharmony_ci static BatterySOC(options?: GetBatterySOC): void; 176413470f0Sopenharmony_ci 177413470f0Sopenharmony_ci/** 178413470f0Sopenharmony_ci * Battery charging status of the current device. 179413470f0Sopenharmony_ci */ 180413470f0Sopenharmony_ci 181413470f0Sopenharmony_ci static ChargingStatus(options?: GetChargingStatus): void; 182413470f0Sopenharmony_ci 183413470f0Sopenharmony_ci/** 184413470f0Sopenharmony_ci * Battery health state of the current device. 185413470f0Sopenharmony_ci */ 186413470f0Sopenharmony_ci 187413470f0Sopenharmony_ci static HealthStatus(options?: GetHealthStatus): void; 188413470f0Sopenharmony_ci 189413470f0Sopenharmony_ci/** 190413470f0Sopenharmony_ci * Charger type of the current device. 191413470f0Sopenharmony_ci */ 192413470f0Sopenharmony_ci 193413470f0Sopenharmony_ci static PluggedType(options?: GetPluggedType): void; 194413470f0Sopenharmony_ci 195413470f0Sopenharmony_ci/** 196413470f0Sopenharmony_ci * Battery voltage of the current device. 197413470f0Sopenharmony_ci */ 198413470f0Sopenharmony_ci 199413470f0Sopenharmony_ci static Voltage(options?: GetVoltage): void; 200413470f0Sopenharmony_ci 201413470f0Sopenharmony_ci/** 202413470f0Sopenharmony_ci * Battery technology of the current device. 203413470f0Sopenharmony_ci */ 204413470f0Sopenharmony_ci 205413470f0Sopenharmony_ci static Technology(options?: GetTechnology): void; 206413470f0Sopenharmony_ci 207413470f0Sopenharmony_ci/** 208413470f0Sopenharmony_ci * Battery temperature of the current device. 209413470f0Sopenharmony_ci */ 210413470f0Sopenharmony_ci 211413470f0Sopenharmony_ci static Temperature(options?: GetTemperature): void; 212413470f0Sopenharmony_ci} 213