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 */ 20 21import type { Callback } from "./@ohos.base"; 22 23/** 24 * This module provides the capability to subscribe to report the device status. 25 * 26 * @namespace deviceStatus 27 * @syscap SystemCapability.MultimodalAwareness.DeviceStatus 28 * @since 18 29 */ 30 31declare namespace deviceStatus { 32 /** 33 * Enum for steady standing status. 34 * 35 * @enum { number } SteadyStandingStatus 36 * @syscap SystemCapability.MultimodalAwareness.DeviceStatus 37 * @since 18 38 */ 39 export enum SteadyStandingStatus { 40 /** 41 * indicates exit status 42 * 43 * @syscap SystemCapability.MultimodalAwareness.DeviceStatus 44 * @since 18 45 */ 46 STATUS_EXIT = 0, 47 /** 48 * indicates enter status 49 * 50 * @syscap SystemCapability.MultimodalAwareness.DeviceStatus 51 * @since 18 52 */ 53 STATUS_ENTER = 1 54 } 55 56 /** 57 * Interface for device rotation radian 58 * @interface DeviceRotationRadian 59 * @syscap SystemCapability.MultimodalAwareness.DeviceStatus 60 * @systemapi 61 * @since 20 62 */ 63 export interface DeviceRotationRadian { 64 /** 65 * indicates X-RotationRadian 66 * @type { number } 67 * @syscap SystemCapability.MultimodalAwareness.DeviceStatus 68 * @systemapi 69 * @since 20 70 */ 71 x: number; 72 /** 73 * indicates Y-RotationRadian 74 * @type { number } 75 * @syscap SystemCapability.MultimodalAwareness.DeviceStatus 76 * @systemapi 77 * @since 20 78 */ 79 y: number; 80 /** 81 * indicates Z-RotationRadian 82 * @type { number } 83 * @syscap SystemCapability.MultimodalAwareness.DeviceStatus 84 * @systemapi 85 * @since 20 86 */ 87 z: number; 88 } 89 90 /** 91 * Subscribe to detect the steady standing status 92 * @param { 'steadyStandingDetect' } type - Indicates the event type. 93 * @param { Callback<SteadyStandingStatus> } callback - Indicates the callback for getting the event data. 94 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 95 * <br> 2. Incorrect parameter types. 3.Parameter verification failed. 96 * @throws { BusinessError } 801 - Capability not supported. Function can not work correctly due to limited 97 * <br> device capabilities. 98 * @throws { BusinessError } 32500001 - Service exception. 99 * @throws { BusinessError } 32500002 - Subscription failed. 100 * @syscap SystemCapability.MultimodalAwareness.DeviceStatus 101 * @since 18 102 */ 103 function on(type: 'steadyStandingDetect', callback: Callback<SteadyStandingStatus>): void; 104 105 /** 106 * Unsubscribe to detect the steady standing status 107 * @param { 'steadyStandingDetect' } type - Indicates the event type. 108 * @param { Callback<SteadyStandingStatus> } callback - Indicates the callback for getting the event data. 109 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 110 * <br> 2. Incorrect parameter types. 3.Parameter verification failed. 111 * @throws { BusinessError } 801 - Capability not supported. Function can not work correctly due to limited 112 * <br> device capabilities. 113 * @throws { BusinessError } 32500001 - Service exception. 114 * @throws { BusinessError } 32500003 - Unsubscription failed. 115 * @syscap SystemCapability.MultimodalAwareness.DeviceStatus 116 * @since 18 117 */ 118 function off(type: 'steadyStandingDetect', callback?: Callback<SteadyStandingStatus>): void; 119 120 /** 121 * Get the device rotation radian 122 * @returns { Promise<DeviceRotationRadian> } The result of device roatation radian. 123 * @throws { BusinessError } 202 - Permission check failed. A non-system application uses the system API. 124 * @throws { BusinessError } 801 - Capability not supported. Function can not work correctly due to limited 125 * <br> device capabilities. 126 * @throws { BusinessError } 32500001 - Service exception. 127 * @syscap SystemCapability.MultimodalAwareness.DeviceStatus 128 * @systemapi 129 * @since 20 130 */ 131 function getDeviceRotationRadian(): Promise<DeviceRotationRadian>; 132} 133export default deviceStatus; 134