1/* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import {AsyncCallback} from './basic'; 17 18/** 19 * Provides interfaces to napitest. 20 * 21 * @since 7 22 */ 23declare namespace napitest { 24 /** 25 * Shuts down the system. 26 * 27 * <p>This method requires the ohos.permission.SHUTDOWN permission. 28 * 29 * @param reason Indicates the shutdown reason. 30 * @systemapi 31 * @since 7 32 */ 33 function shutdownDevice(reason: string): void; 34 35 /** 36 * Restarts the system. 37 * 38 * <p>This method requires the ohos.permission.REBOOT permission. 39 * 40 * @param reason Indicates the restart reason. For example, "updater" indicates entering the updater mode 41 * after the restart. If the parameter is not specified, the system enters the normal mode after the restart. 42 * @since 7 43 */ 44 function rebootDevice(reason: string): void; 45 46 /** 47 * Checks whether the screen of a device is on or off. 48 * 49 * @return Returns true if the screen is on; returns false otherwise. 50 * @since 7 51 */ 52 function isScreenOn(callback: AsyncCallback<boolean>): void; 53 function isScreenOn(): Promise<boolean>; 54} 55export default napitest; 56 57