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 MultimodalAwarenessKit 19 */ 20import type { Callback } from "./@ohos.base"; 21 22/** 23 * This module provides the capability to subscribe to report the device status. 24 * 25 * @namespace deviceStatus 26 * @syscap SystemCapability.MultimodalAwareness.DeviceStatus 27 * @since 18 28 */ 29declare namespace deviceStatus { 30 /** 31 * Enum for steady standing status. 32 * 33 * @enum { number } SteadyStandingStatus 34 * @syscap SystemCapability.MultimodalAwareness.DeviceStatus 35 * @since 18 36 */ 37 export enum SteadyStandingStatus { 38 /** 39 * indicates exit status 40 * 41 * @syscap SystemCapability.MultimodalAwareness.DeviceStatus 42 * @since 18 43 */ 44 STATUS_EXIT = 0, 45 /** 46 * indicates enter status 47 * 48 * @syscap SystemCapability.MultimodalAwareness.DeviceStatus 49 * @since 18 50 */ 51 STATUS_ENTER = 1 52 } 53 54 /** 55 * Subscribe to detect the steady standing status 56 * @param { 'steadyStandingDetect' } type - Indicates the event type. 57 * @param { Callback<SteadyStandingStatus> } callback - Indicates the callback for getting the event data. 58 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 59 * <br> 2. Incorrect parameter types. 3.Parameter verification failed. 60 * @throws { BusinessError } 801 - Capability not supported. Function can not work correctly due to limited 61 * <br> device capabilities. 62 * @throws { BusinessError } 32500001 - Service exception. 63 * @throws { BusinessError } 32500002 - Subscribe Failed. 64 * @syscap SystemCapability.MultimodalAwareness.DeviceStatus 65 * @since 18 66 */ 67 function on(type: 'steadyStandingDetect', callback: Callback<SteadyStandingStatus>): void; 68 69 /** 70 * Unsubscribe to detect the steady standing status 71 * @param { 'steadyStandingDetect' } type - Indicates the event type. 72 * @param { Callback<SteadyStandingStatus> } callback - Indicates the callback for getting the event data. 73 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 74 * <br> 2. Incorrect parameter types. 3.Parameter verification failed. 75 * @throws { BusinessError } 801 - Capability not supported. Function can not work correctly due to limited 76 * <br> device capabilities. 77 * @throws { BusinessError } 32500001 - Service exception. 78 * @throws { BusinessError } 32500003 - Unsubscribe Failed. 79 * @syscap SystemCapability.MultimodalAwareness.DeviceStatus 80 * @since 18 81 */ 82 function off(type: 'steadyStandingDetect', callback?: Callback<SteadyStandingStatus>): void; 83} 84export default deviceStatus; 85