diff --git a/api/@ohos.multimodalAwareness.motion.d.ts b/api/@ohos.multimodalAwareness.motion.d.ts index 57f3475b7e9742e296e268736c5f0ae15c685067..946d3980386ea84bd1bc4973d71a0c9ce85f49f0 100644 --- a/api/@ohos.multimodalAwareness.motion.d.ts +++ b/api/@ohos.multimodalAwareness.motion.d.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -17,181 +17,98 @@ * @file * @kit MultimodalAwarenessKit */ - import type { Callback } from "./@ohos.base"; - /** * This module provides the capability to subscribe to report the action or motion. * * @namespace motion * @syscap SystemCapability.MultimodalAwareness.Motion - * @since 15 + * @since arkts{ '1.1':'15','1.2':'20'} + * @arkts 1.1&1.2 */ - declare namespace motion { /** * Enum for operating hand status. * * @enum { number } OperatingHandStatus * @syscap SystemCapability.MultimodalAwareness.Motion - * @since 15 + * @since arkts{ '1.1':'15','1.2':'20'} + * @arkts 1.1&1.2 */ export enum OperatingHandStatus { /** * indicates nothing has been detected. * * @syscap SystemCapability.MultimodalAwareness.Motion - * @since 15 + * @since arkts{ '1.1':'15','1.2':'20'} + * @arkts 1.1&1.2 */ UNKNOWN_STATUS = 0, /** * indicates the operating hand is left hand. * * @syscap SystemCapability.MultimodalAwareness.Motion - * @since 15 + * @since arkts{ '1.1':'15','1.2':'20'} + * @arkts 1.1&1.2 */ LEFT_HAND_OPERATED = 1, /** * indicates the operating hand is right hand. * * @syscap SystemCapability.MultimodalAwareness.Motion - * @since 15 + * @since arkts{ '1.1':'15','1.2':'20'} + * @arkts 1.1&1.2 */ RIGHT_HAND_OPERATED = 2 - } - - /** - * Enum for holding hand status - * - * @enum { number } HoldingHandStatus - * @syscap SystemCapability.MultimodalAwareness.Motion - * @since 20 - */ - export enum HoldingHandStatus { - /** - * indicates no helding has been detected. - * - * @syscap SystemCapability.MultimodalAwareness.Motion - * @since 20 - */ - NOT_HELD = 0, - /** - * indicates holding with the left hand. - * - * @syscap SystemCapability.MultimodalAwareness.Motion - * @since 20 - */ - LEFT_HAND_HELD = 1, - /** - * indicates holding with the right hand. - * - * @syscap SystemCapability.MultimodalAwareness.Motion - * @since 20 - */ - RIGHT_HAND_HELD = 2, - /** - * indicates holding with both hands. - * - * @syscap SystemCapability.MultimodalAwareness.Motion - * @since 20 - */ - BOTH_HANDS_HELD = 3, - /** - * indicates nothing has been detected. - * - * @syscap SystemCapability.MultimodalAwareness.Motion - * @since 20 - */ - UNKNOWN_STATUS = 16 - } - + } /** * Subscribe to detect the operating hand changed event. - * @permission ohos.permission.ACTIVITY_MOTION + * @permission ohos.permission.ACTIVITY_MOTION or ohos.permission.DETECT_GESTURE * @param { 'operatingHandChanged' } type - Indicates the event type. * @param { Callback } callback - Indicates the callback for getting the event data. * @throws { BusinessError } 201 - Permission denied. An attempt was made to subscribe operatingHandChanged - *
event forbidden by permission: ohos.permission.ACTIVITY_MOTION. + *
event forbidden by permission: ohos.permission.ACTIVITY_MOTION or ohos.permission.DETECT_GESTURE. * @throws { BusinessError } 401 - Parameter error. Parameter verification failed. * @throws { BusinessError } 801 - Capability not supported. Function can not work correctly due to limited *
device capabilities. - * @throws { BusinessError } 31500001 - Service exception. Possible causes: 1. A system error, such as null pointer, container-related exception; - *
2. N-API invocation exception, invalid N-API status. - * @throws { BusinessError } 31500002 - Subscription failed. Possible causes: 1. Callback registration failure; - *
2. Failed to bind native object to js wrapper; 3. N-API invocation exception, invalid N-API status; 4. IPC request exception. + * @throws { BusinessError } 31500001 - Service exception. + * @throws { BusinessError } 31500002 - Subscribe Failed. * @syscap SystemCapability.MultimodalAwareness.Motion - * @since 15 + * @since arkts{ '1.1':'15','1.2':'20'} + * @arkts 1.1&1.2 */ function on(type: 'operatingHandChanged', callback: Callback): void; - /** - * Unsubscribe to detect the operating hand changed event. - * @permission ohos.permission.ACTIVITY_MOTION + * Unsubscribe from the operating hand changed event. + * @permission ohos.permission.ACTIVITY_MOTION or ohos.permission.DETECT_GESTURE * @param { 'operatingHandChanged' } type - Indicates the event type. * @param { Callback } callback - Indicates the callback for getting the event data. * @throws { BusinessError } 201 - Permission denied. An attempt was made to unsubscribe operatingHandChanged - *
event forbidden by permission: ohos.permission.ACTIVITY_MOTION. + *
event forbidden by permission: ohos.permission.ACTIVITY_MOTION or ohos.permission.DETECT_GESTURE. * @throws { BusinessError } 401 - Parameter error. Parameter verification failed. * @throws { BusinessError } 801 - Capability not supported. Function can not work correctly due to limited *
device capabilities. - * @throws { BusinessError } 31500001 - Service exception. Possible causes: 1. A system error, such as null pointer, container-related exception; - *
2. N-API invocation exception, invalid N-API status. - * @throws { BusinessError } 31500003 - Unsubscription failed. Possible causes: 1. Callback failure; - *
2. N-API invocation exception, invalid N-API status; 3. IPC request exception. + * @throws { BusinessError } 31500001 - Service exception. + * @throws { BusinessError } 31500003 - Unsubscribe Failed. * @syscap SystemCapability.MultimodalAwareness.Motion - * @since 15 + * @since arkts{ '1.1':'15','1.2':'20'} + * @arkts 1.1&1.2 */ function off(type: 'operatingHandChanged', callback?: Callback): void; - /** * Get the recent operating hand status. - * @permission ohos.permission.ACTIVITY_MOTION + * @permission ohos.permission.ACTIVITY_MOTION or ohos.permission.DETECT_GESTURE * @returns { OperatingHandStatus } The result of operating hand status. * @throws { BusinessError } 201 - Permission denied. An attempt was made to get the recent operating hand - *
status forbidden by permission: ohos.permission.ACTIVITY_MOTION. + *
status forbidden by permission: ohos.permission.ACTIVITY_MOTION or ohos.permission.DETECT_GESTURE. * @throws { BusinessError } 801 - Capability not supported. Function can not work correctly due to limited *
device capabilities. - * @throws { BusinessError } 31500001 - Service exception. Possible causes: 1. A system error, such as null pointer, container-related exception; - *
2. N-API invocation exception, invalid N-API status. + * @throws { BusinessError } 31500001 - Service exception. * @syscap SystemCapability.MultimodalAwareness.Motion - * @since 15 + * @since arkts{ '1.1':'15','1.2':'20'} + * @arkts 1.1&1.2 */ function getRecentOperatingHandStatus(): OperatingHandStatus; - - /** - * Subscribe the holding hand change event. - * @permission ohos.permission.ACTIVITY_MOTION - * @param { 'holdingHandChanged' } type - Indicates the event type. - * @param { Callback } callback - Indicates the callback for getting the event data. - * @throws { BusinessError } 201 - Permission denied. An attempt was made to subscribe holdingHandChanged - *
event forbidden by permission: ohos.permission.ACTIVITY_MOTION. - * @throws { BusinessError } 801 - Capability not supported. Function can not work correctly due to limited - *
device capabilities. - * @throws { BusinessError } 31500001 - Service exception. Possible causes: 1. A system error, such as null pointer, container-related exception; - *
2. N-API invocation exception, invalid N-API status. - * @throws { BusinessError } 31500002 - Subscribe Failed. Possible causes: 1. Callback registration failure; - *
2. Failed to bind native object to js wrapper; 3. N-API invocation exception, invalid N-API status; 4. IPC request exception. - * @syscap SystemCapability.MultimodalAwareness.Motion - * @since 20 - */ - function on(type: 'holdingHandChanged', callback: Callback): void; - - /** - * Unsubscribe the holding hand change event. - * @permission ohos.permission.ACTIVITY_MOTION - * @param { 'holdingHandChanged' } type - Indicates the event type. - * @param { Callback } callback - Indicates the callback for getting the event data. - * @throws { BusinessError } 201 - Permission denied. An attempt was made to unsubscribe holdingHandChanged - *
event forbidden by permission: ohos.permission.ACTIVITY_MOTION. - * @throws { BusinessError } 801 - Capability not supported. Function can not work correctly due to limited - *
device capabilities. - * @throws { BusinessError } 31500001 - Service exception. Possible causes: 1. A system error, such as null pointer, container-related exception; - *
2. N-API invocation exception, invalid N-API status. - * @throws { BusinessError } 31500003 - Unsubscribe Failed. Possible causes: 1. Callback removal failure; - *
2. N-API invocation exception, invalid N-API status; 3. IPC request exception. - * @syscap SystemCapability.MultimodalAwareness.Motion - * @since 20 - */ - function off(type: 'holdingHandChanged', callback?: Callback): void; } -export default motion; + +export default motion; \ No newline at end of file