1/* 2 * Copyright (c) 2025 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 16/** 17 * @file 18 * @kit AbilityKit 19 */ 20 21import UIAbilityContext from './application/UIAbilityContext'; 22import { KioskStatus as _KioskStatus } from './application/KioskStatus'; 23 24/** 25 * The class of kiosk manager. 26 * 27 * @namespace kioskManager 28 * @syscap SystemCapability.Ability.AbilityRuntime.Core 29 * @stagemodelonly 30 * @since 20 31 * @arkts 1.1&1.2 32 */ 33declare namespace kioskManager { 34 /** 35 * Enter kiosk mode. 36 * 37 * @param { UIAbilityContext } context - The context that initiates to enter kiosk mode. 38 * @returns { Promise<void> } The promise returned by the function. 39 * @throws { BusinessError } 801 - Capability not supported. 40 * @throws { BusinessError } 16000050 - Internal error. 41 * @throws { BusinessError } 16000110 - Current application is not in kiosk app list, can not enter kiosk mode. 42 * @throws { BusinessError } 16000111 - System is already in kiosk mode, can not enter again. 43 * @throws { BusinessError } 16000113 - Current ability is not in foreground. 44 * @syscap SystemCapability.Ability.AbilityRuntime.Core 45 * @stagemodelonly 46 * @since 20 47 * @arkts 1.1&1.2 48 */ 49 function enterKioskMode(context: UIAbilityContext): Promise<void>; 50 51 /** 52 * Exit kiosk mode. 53 * 54 * @param { UIAbilityContext } context - The context that initiates to exit kiosk mode. 55 * @returns { Promise<void> } The promise returned by the function. 56 * @throws { BusinessError } 801 - Capability not supported. 57 * @throws { BusinessError } 16000050 - Internal error. 58 * @throws { BusinessError } 16000110 - Current application is not in kiosk app list, can not exit kiosk mode. 59 * @throws { BusinessError } 16000112 - Current application is not in kiosk mode, can not exit. 60 * @syscap SystemCapability.Ability.AbilityRuntime.Core 61 * @stagemodelonly 62 * @since 20 63 * @arkts 1.1&1.2 64 */ 65 function exitKioskMode(context: UIAbilityContext): Promise<void>; 66 67 /** 68 * Get current kiosk status. 69 * 70 * @returns { Promise<KioskStatus> } Current kiosk status. 71 * @throws { BusinessError } 202 - Not system application. 72 * @throws { BusinessError } 801 - Capability not supported. 73 * @throws { BusinessError } 16000050 - Internal error. 74 * @syscap SystemCapability.Ability.AbilityRuntime.Core 75 * @systemapi 76 * @stagemodelonly 77 * @since 20 78 * @arkts 1.1&1.2 79 */ 80 function getKioskStatus(): Promise<KioskStatus>; 81 82 /** 83 * The kiosk status data. 84 * 85 * @typedef { _KioskStatus } 86 * @syscap SystemCapability.Ability.AbilityRuntime.Core 87 * @stagemodelonly 88 * @since 20 89 * @arkts 1.1&1.2 90 */ 91 export type KioskStatus = _KioskStatus; 92} 93 94export default kioskManager; 95