From 4459cf534e9ad91e317beaad9035dbad18cde231 Mon Sep 17 00:00:00 2001 From: kaicui Date: Thu, 11 Sep 2025 15:03:54 +0800 Subject: [PATCH 1/4] Interfaces overload and add static tags Signed-off-by: kaicui --- api/@ohos.arkui.uiExtension.d.ts | 109 ++++++++++++++++++++++++++-- api/@ohos.uiExtensionHost.d.ts | 65 +++++++++++++++++ api/@ohos.window.d.ts | 120 +++++++++++++++++++++++++++++-- 3 files changed, 283 insertions(+), 11 deletions(-) diff --git a/api/@ohos.arkui.uiExtension.d.ts b/api/@ohos.arkui.uiExtension.d.ts index 8c983c715b..5dfb2833b9 100644 --- a/api/@ohos.arkui.uiExtension.d.ts +++ b/api/@ohos.arkui.uiExtension.d.ts @@ -71,10 +71,23 @@ declare namespace uiExtension { * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 12 dynamic - * @since 20 static */ on(type: 'avoidAreaChange', callback: Callback): void; + /** + * Subscribes to the event indicating changes to the area where the window cannot be displayed. + * + * @param { Callback } callback - Callback used to return the avoid area information. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 22 static + */ + onAvoidAreaChange(callback: Callback): void; + /** * Unsubscribes from the event indicating changes to the area where the window cannot be displayed. * @@ -88,10 +101,23 @@ declare namespace uiExtension { * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 12 dynamic - * @since 20 static */ off(type: 'avoidAreaChange', callback?: Callback): void; + /** + * Unsubscribes from the event indicating changes to the area where the window cannot be displayed. + * + * @param { Callback } callback - Callback used to return the avoid area information. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 22 static + */ + offAvoidAreaChange(callback?: Callback): void; + /** * Subscribes to the window size change event of the host application. * @@ -104,10 +130,23 @@ declare namespace uiExtension { * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 12 dynamic - * @since 20 static */ on(type: 'windowSizeChange', callback: Callback): void; + /** + * Subscribes to the window size change event of the host application. + * + * @param { Callback } callback - Callback used to return the window size. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 22 static + */ + onWindowSizeChange(callback: Callback): void; + /** * Unsubscribes from the window size change event of the host application. * @@ -120,10 +159,23 @@ declare namespace uiExtension { * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 12 dynamic - * @since 20 static */ off(type: 'windowSizeChange', callback?: Callback): void; + /** + * Unsubscribes from the window size change event of the host application. + * + * @param { Callback } callback - Callback used to return the window size. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 22 static + */ + offWindowSizeChange(callback?: Callback): void; + /** * Subscribes to changes in the position and size of the component (EmbeddedComponent or UIExtensionComponent). This API can be used only on 2-in-1 devices. * @@ -142,6 +194,22 @@ declare namespace uiExtension { */ on(type: 'rectChange', reasons: number, callback: Callback): void; + /** + * Subscribes to changes in the position and size of the component (EmbeddedComponent or UIExtensionComponent). This API can be used only on 2-in-1 devices. + * + * @param { 'long' } reasons - The reasons of component rect change. + * @param { Callback } callback - Callback used to return the RectChangeOptions. + * @throws { BusinessError } 401 - Parameter error. Possible cause: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 22 static + */ + onRectChange(reasons: long, callback: Callback): void; + /** * Unsubscribes from changes in the position and size of the component (EmbeddedComponent or UIExtensionComponent). * This API can be used only on 2-in-1 devices. @@ -160,6 +228,22 @@ declare namespace uiExtension { */ off(type: 'rectChange', callback?: Callback): void; + /** + * Unsubscribes from changes in the position and size of the component (EmbeddedComponent or UIExtensionComponent). + * This API can be used only on 2-in-1 devices. + * + * @param { Callback } callback - Callback used to return the RectChangeOptions. + * @throws { BusinessError } 401 - Parameter error. Possible cause: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 22 static + */ + offRectChange(callback?: Callback): void; + /** * Sets whether to hide insecure windows. * When called by modal UIExtension and shouldHide == false, the "ohos.permission.ALLOW_SHOW_NON_SECURE_WINDOWS" permission is required. @@ -235,8 +319,9 @@ declare namespace uiExtension { * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 dynamic + * @since 20 static */ - occupyEvents(eventFlags: number): Promise; + occupyEvents(eventFlags: int): Promise; /** * The properties of the UIExtension window @@ -245,6 +330,7 @@ declare namespace uiExtension { * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 14 dynamic + * @since 20 static */ properties: WindowProxyProperties; } @@ -256,6 +342,7 @@ declare namespace uiExtension { * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 dynamic + * @since 20 static */ enum EventFlag { /** @@ -264,6 +351,7 @@ declare namespace uiExtension { * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 dynamic + * @since 20 static */ EVENT_NONE = 0x00000000, /** @@ -272,6 +360,7 @@ declare namespace uiExtension { * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 dynamic + * @since 20 static */ EVENT_PAN_GESTURE_LEFT = 0x00000001, /** @@ -280,6 +369,7 @@ declare namespace uiExtension { * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 dynamic + * @since 20 static */ EVENT_PAN_GESTURE_RIGHT = 0x00000002, /** @@ -288,6 +378,7 @@ declare namespace uiExtension { * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 dynamic + * @since 20 static */ EVENT_PAN_GESTURE_UP = 0x00000004, /** @@ -296,6 +387,7 @@ declare namespace uiExtension { * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 dynamic + * @since 20 static */ EVENT_PAN_GESTURE_DOWN = 0x00000008, /** @@ -304,6 +396,7 @@ declare namespace uiExtension { * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 dynamic + * @since 20 static */ EVENT_CLICK = 0x00000100, /** @@ -312,6 +405,7 @@ declare namespace uiExtension { * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 dynamic + * @since 20 static */ EVENT_LONG_PRESS = 0x00000200, } @@ -379,6 +473,7 @@ declare namespace uiExtension { * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 14 dynamic + * @since 20 static */ enum RectChangeReason { /** @@ -387,6 +482,7 @@ declare namespace uiExtension { * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 14 dynamic + * @since 20 static */ HOST_WINDOW_RECT_CHANGE = 0x0001, } @@ -398,6 +494,7 @@ declare namespace uiExtension { * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 14 dynamic + * @since 20 static */ interface RectChangeOptions { /** @@ -407,6 +504,7 @@ declare namespace uiExtension { * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 14 dynamic + * @since 20 static */ rect: window.Rect, @@ -417,6 +515,7 @@ declare namespace uiExtension { * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 14 dynamic + * @since 20 static */ reason: RectChangeReason } diff --git a/api/@ohos.uiExtensionHost.d.ts b/api/@ohos.uiExtensionHost.d.ts index f03e2c8a03..344b16fc72 100644 --- a/api/@ohos.uiExtensionHost.d.ts +++ b/api/@ohos.uiExtensionHost.d.ts @@ -28,6 +28,7 @@ import window from './@ohos.window'; * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since 11 dynamic + * @since 20 static */ declare namespace uiExtensionHost { /** @@ -37,6 +38,7 @@ declare namespace uiExtensionHost { * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since 11 dynamic + * @since 20 static */ interface UIExtensionHostWindowProxy { /** @@ -48,6 +50,7 @@ declare namespace uiExtensionHost { * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since 11 dynamic + * @since 20 static */ getWindowAvoidArea(type: window.AvoidAreaType): window.AvoidArea; @@ -66,6 +69,20 @@ declare namespace uiExtensionHost { */ on(type: 'avoidAreaChange', callback: Callback<{ type: window.AvoidAreaType, area: window.AvoidArea }>): void; + /** + * Register the callback of avoidAreaChange + * + * @param { Callback<{ type: window.AvoidAreaType, area: window.AvoidArea }> } callback - Callback used to return the area. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 22 static + */ + onAvoidAreaChange(callback: Callback<{ type: window.AvoidAreaType, area: window.AvoidArea }>): void; + /** * Unregister the callback of avoidAreaChange * @@ -81,6 +98,20 @@ declare namespace uiExtensionHost { */ off(type: 'avoidAreaChange', callback?: Callback<{ type: window.AvoidAreaType, area: window.AvoidArea }>): void; + /** + * Unregister the callback of avoidAreaChange + * + * @param { Callback<{ type: window.AvoidAreaType, area: window.AvoidArea }> } callback - Callback used to return the area. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 22 static + */ + offAvoidAreaChange(callback?: Callback<{ type: window.AvoidAreaType, area: window.AvoidArea }>): void; + /** * Register the callback of windowSizeChange * @@ -96,6 +127,20 @@ declare namespace uiExtensionHost { */ on(type: 'windowSizeChange', callback: Callback): void; + /** + * Register the callback of windowSizeChange + * + * @param { Callback } callback - Callback used to return the window size. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 22 static + */ + onWindowSizeChange(callback: Callback): void; + /** * Unregister the callback of windowSizeChange * @@ -111,6 +156,20 @@ declare namespace uiExtensionHost { */ off(type: 'windowSizeChange', callback?: Callback): void; + /** + * Unregister the callback of windowSizeChange + * + * @param { Callback } callback - Callback used to return the window size. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 22 static + */ + offWindowSizeChange(callback?: Callback): void; + /** * The properties of the UIExtension window * @@ -118,6 +177,7 @@ declare namespace uiExtensionHost { * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since 11 dynamic + * @since 20 static */ properties: UIExtensionHostWindowProxyProperties; @@ -153,6 +213,7 @@ declare namespace uiExtensionHost { * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since 12 dynamic + * @since 20 static */ hideNonSecureWindows(shouldHide: boolean): Promise; @@ -172,6 +233,7 @@ declare namespace uiExtensionHost { * @systemapi * @StageModelOnly * @since 12 dynamic + * @since 20 static */ createSubWindowWithOptions(name: string, subWindowOptions: window.SubWindowOptions): Promise; @@ -186,6 +248,7 @@ declare namespace uiExtensionHost { * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since 12 dynamic + * @since 20 static */ setWaterMarkFlag(enable: boolean): Promise; @@ -206,6 +269,7 @@ declare namespace uiExtensionHost { * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since 13 dynamic + * @since 20 static */ hidePrivacyContentForHost(shouldHide: boolean): Promise; } @@ -226,6 +290,7 @@ declare namespace uiExtensionHost { * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since 11 dynamic + * @since 20 static */ uiExtensionHostWindowProxyRect: window.Rect; } diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 69d0beedad..587227921e 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -7066,10 +7066,22 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since 11 dynamic - * @since 20 static */ on(type: 'touchOutside', callback: Callback): void; + /** + * Subscribes to the touch event outside this window. + * + * @param { Callback } callback - Callback used to return the click event outside this window. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @atomicservice + * @since 22 static + */ + onTouchOutside(callback: Callback): void; + /** * Unsubscribes from the touch event outside this window. * @@ -7080,10 +7092,21 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since 11 dynamic - * @since 20 static */ off(type: 'touchOutside', callback?: Callback): void; + /** + * Unsubscribes from the touch event outside this window. + * + * @param { Callback } callback - Callback used to return the click event outside this window. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; + * 2. Parameter verification failed. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @atomicservice + * @since 22 static + */ + offTouchOutside(callback?: Callback): void; + /** * Window displayId change callback on. * @@ -7266,10 +7289,27 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 12 dynamic - * @since 20 static */ on(type: 'noInteractionDetected', timeout: long, callback: Callback): void; + /** + * Subscribes to non-interaction events in a window within the specified period. + * Interaction events include physical keyboard input events and screen touch/click events, but not soft keyboard input events. + * + * @param { long } timeout - The timeout(in seconds) of no interaction detection. + * @param { Callback } callback - Callback used to notify the window has no interaction for a long time. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + onNoInteractionDetected(timeout: long, callback: Callback): void; + /** * Unsubscribes from non-interaction events in a window within the specified period. * Interaction events include physical keyboard input events and screen touch/click events, but not soft keyboard input events. @@ -7284,10 +7324,25 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 12 dynamic - * @since 20 static */ off(type: 'noInteractionDetected', callback?: Callback): void; + /** + * Unsubscribes from non-interaction events in a window within the specified period. + * Interaction events include physical keyboard input events and screen touch/click events, but not soft keyboard input events. + * + * @param { Callback } callback - Callback used to notify the window has no interaction for a long time. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; + * 2. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + offNoInteractionDetected(callback?: Callback): void; + /** * Register the callback of screenshot, only the focused window called back * @@ -7384,10 +7439,22 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since 12 dynamic - * @since 20 static */ on(type: 'dialogTargetTouch', callback: Callback): void; + /** + * Subscribes to click or touch events in a window covered by a modal window. This API takes effect only when it is called by a modal window. + * + * @param { Callback } callback - Callback invoked when the click event occurs in the target window of the modal window mode. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @atomicservice + * @since 22 static + */ + onDialogTargetTouch(callback: Callback): void; + /** * Unregister the callback of dialogTargetTouch * @@ -7410,10 +7477,21 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since 12 dynamic - * @since 20 static */ off(type: 'dialogTargetTouch', callback?: Callback): void; + /** + * Unsubscribes from the touch event of the target window in the modal window mode. + * + * @param { Callback } callback - Callback invoked when the click event occurs in the target window of the modal window mode. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; + * 2. Parameter verification failed. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @atomicservice + * @since 22 static + */ + offDialogTargetTouch(callback?: Callback): void; + /** * Register the callback of windowEvent * @@ -10594,6 +10672,19 @@ declare namespace window { */ on(eventType: 'uiExtensionSecureLimitChange', callback: Callback): void; + /** + * UIExtension in window secure limit change callback on. + * + * @param { Callback } callback Callback used to return the result whether the APP has uiextension secure limit. + * @throws { BusinessError } 801 - Capability not supported.Function on('uiExtensionSecureLimitChange') can not work correctly due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + onUiExtensionSecureLimitChange(callback: Callback): void; + /** * UIExtension in window secure limit change callback off. * @@ -10607,6 +10698,19 @@ declare namespace window { * @since 20 dynamic */ off(eventType: 'uiExtensionSecureLimitChange', callback?: Callback): void; + + /** + * UIExtension in window secure limit change callback off. + * + * @param { Callback } callback Callback used to return the result whether the APP has uiextension secure limit. + * @throws { BusinessError } 801 - Capability not supported.Function off('uiExtensionSecureLimitChange') can not work correctly due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + offUiExtensionSecureLimitChange(callback?: Callback): void; /** @@ -12277,6 +12381,7 @@ declare namespace window { * @systemapi Hide this for inner system use. * @stagemodelonly * @since 14 dynamic + * @since 20 static */ windowAttribute: ExtensionWindowAttribute; @@ -12288,6 +12393,7 @@ declare namespace window { * @systemapi Hide this for inner system use. * @stagemodelonly * @since 14 dynamic + * @since 20 static */ windowRect: Rect; @@ -12299,6 +12405,7 @@ declare namespace window { * @systemapi Hide this for inner system use. * @stagemodelonly * @since 14 dynamic + * @since 20 static */ subWindowOptions?: SubWindowOptions; @@ -12310,6 +12417,7 @@ declare namespace window { * @systemapi Hide this for inner system use. * @stagemodelonly * @since 14 dynamic + * @since 20 static */ systemWindowOptions?: SystemWindowOptions; } -- Gitee From b5f4d058e11088e9db5d4c3f35332c829f6593a7 Mon Sep 17 00:00:00 2001 From: kaicui Date: Fri, 12 Sep 2025 14:35:14 +0800 Subject: [PATCH 2/4] Modify based on the review comments. Signed-off-by: kaicui --- api/@ohos.arkui.uiExtension.d.ts | 37 +++++++------------------------- api/@ohos.uiExtensionHost.d.ts | 22 ++++--------------- api/@ohos.window.d.ts | 27 +++++++---------------- 3 files changed, 20 insertions(+), 66 deletions(-) diff --git a/api/@ohos.arkui.uiExtension.d.ts b/api/@ohos.arkui.uiExtension.d.ts index 5dfb2833b9..2e7967e45b 100644 --- a/api/@ohos.arkui.uiExtension.d.ts +++ b/api/@ohos.arkui.uiExtension.d.ts @@ -78,10 +78,6 @@ declare namespace uiExtension { * Subscribes to the event indicating changes to the area where the window cannot be displayed. * * @param { Callback } callback - Callback used to return the avoid area information. - * @throws { BusinessError } 401 - Parameter error. Possible causes: - *
1. Mandatory parameters are left unspecified. - *
2. Incorrect parameters types. - *
3. Parameter verification failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 22 static @@ -107,11 +103,8 @@ declare namespace uiExtension { /** * Unsubscribes from the event indicating changes to the area where the window cannot be displayed. * - * @param { Callback } callback - Callback used to return the avoid area information. - * @throws { BusinessError } 401 - Parameter error. Possible causes: - *
1. Mandatory parameters are left unspecified. - *
2. Incorrect parameters types. - *
3. Parameter verification failed. + * @param { Callback } [callback] - Unregister the callback function. + * If not provided, all callbacks for the given event type will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 22 static @@ -137,10 +130,6 @@ declare namespace uiExtension { * Subscribes to the window size change event of the host application. * * @param { Callback } callback - Callback used to return the window size. - * @throws { BusinessError } 401 - Parameter error. Possible causes: - *
1. Mandatory parameters are left unspecified. - *
2. Incorrect parameters types. - *
3. Parameter verification failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 22 static @@ -165,11 +154,8 @@ declare namespace uiExtension { /** * Unsubscribes from the window size change event of the host application. * - * @param { Callback } callback - Callback used to return the window size. - * @throws { BusinessError } 401 - Parameter error. Possible causes: - *
1. Mandatory parameters are left unspecified. - *
2. Incorrect parameters types. - *
3. Parameter verification failed. + * @param { Callback } [callback] - Unregister the callback function. + * If not provided, all callbacks for the given event type will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 22 static @@ -197,18 +183,14 @@ declare namespace uiExtension { /** * Subscribes to changes in the position and size of the component (EmbeddedComponent or UIExtensionComponent). This API can be used only on 2-in-1 devices. * - * @param { 'long' } reasons - The reasons of component rect change. + * @param { 'int' } reasons - The reasons of component rect change. * @param { Callback } callback - Callback used to return the RectChangeOptions. - * @throws { BusinessError } 401 - Parameter error. Possible cause: - *
1. Mandatory parameters are left unspecified. - *
2. Incorrect parameters types. - *
3. Parameter verification failed. * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 22 static */ - onRectChange(reasons: long, callback: Callback): void; + onRectChange(reasons: int, callback: Callback): void; /** * Unsubscribes from changes in the position and size of the component (EmbeddedComponent or UIExtensionComponent). @@ -232,11 +214,8 @@ declare namespace uiExtension { * Unsubscribes from changes in the position and size of the component (EmbeddedComponent or UIExtensionComponent). * This API can be used only on 2-in-1 devices. * - * @param { Callback } callback - Callback used to return the RectChangeOptions. - * @throws { BusinessError } 401 - Parameter error. Possible cause: - *
1. Mandatory parameters are left unspecified. - *
2. Incorrect parameters types. - *
3. Parameter verification failed. + * @param { Callback } [callback] - Unregister the callback function. + * If not provided, all callbacks for the given event type will be removed. * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice diff --git a/api/@ohos.uiExtensionHost.d.ts b/api/@ohos.uiExtensionHost.d.ts index 344b16fc72..030a72a819 100644 --- a/api/@ohos.uiExtensionHost.d.ts +++ b/api/@ohos.uiExtensionHost.d.ts @@ -73,10 +73,6 @@ declare namespace uiExtensionHost { * Register the callback of avoidAreaChange * * @param { Callback<{ type: window.AvoidAreaType, area: window.AvoidArea }> } callback - Callback used to return the area. - * @throws { BusinessError } 401 - Parameter error. Possible causes: - *
1. Mandatory parameters are left unspecified. - *
2. Incorrect parameters types. - *
3. Parameter verification failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since 22 static @@ -101,11 +97,8 @@ declare namespace uiExtensionHost { /** * Unregister the callback of avoidAreaChange * - * @param { Callback<{ type: window.AvoidAreaType, area: window.AvoidArea }> } callback - Callback used to return the area. - * @throws { BusinessError } 401 - Parameter error. Possible causes: - *
1. Mandatory parameters are left unspecified. - *
2. Incorrect parameters types. - *
3. Parameter verification failed. + * @param { Callback<{ type: window.AvoidAreaType, area: window.AvoidArea }> } [callback] - Unregister the callback function. + * If not provided, all callbacks for the given event type will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since 22 static @@ -131,10 +124,6 @@ declare namespace uiExtensionHost { * Register the callback of windowSizeChange * * @param { Callback } callback - Callback used to return the window size. - * @throws { BusinessError } 401 - Parameter error. Possible causes: - *
1. Mandatory parameters are left unspecified. - *
2. Incorrect parameters types. - *
3. Parameter verification failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since 22 static @@ -159,11 +148,8 @@ declare namespace uiExtensionHost { /** * Unregister the callback of windowSizeChange * - * @param { Callback } callback - Callback used to return the window size. - * @throws { BusinessError } 401 - Parameter error. Possible causes: - *
1. Mandatory parameters are left unspecified. - *
2. Incorrect parameters types. - *
3. Parameter verification failed. + * @param { Callback } [callback] - Unregister the callback function. + * If not provided, all callbacks for the given event type will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since 22 static diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 587227921e..cd949acd6a 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -7073,9 +7073,6 @@ declare namespace window { * Subscribes to the touch event outside this window. * * @param { Callback } callback - Callback used to return the click event outside this window. - * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; - * 2. Incorrect parameter types; - * 3. Parameter verification failed. * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since 22 static @@ -7098,9 +7095,8 @@ declare namespace window { /** * Unsubscribes from the touch event outside this window. * - * @param { Callback } callback - Callback used to return the click event outside this window. - * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; - * 2. Parameter verification failed. + * @param { Callback } [callback] - Unregister the callback function. + * If not provided, all callbacks for the given event type will be removed. * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since 22 static @@ -7298,9 +7294,6 @@ declare namespace window { * * @param { long } timeout - The timeout(in seconds) of no interaction detection. * @param { Callback } callback - Callback used to notify the window has no interaction for a long time. - * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; - * 2. Incorrect parameter types; - * 3. Parameter verification failed. * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. * @throws { BusinessError } 1300003 - This window manager service works abnormally. @@ -7331,9 +7324,8 @@ declare namespace window { * Unsubscribes from non-interaction events in a window within the specified period. * Interaction events include physical keyboard input events and screen touch/click events, but not soft keyboard input events. * - * @param { Callback } callback - Callback used to notify the window has no interaction for a long time. - * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; - * 2. Parameter verification failed. + * @param { Callback } [callback] - Unregister the callback function. + * If not provided, all callbacks for the given event type will be removed. * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. * @throws { BusinessError } 1300003 - This window manager service works abnormally. @@ -7446,9 +7438,6 @@ declare namespace window { * Subscribes to click or touch events in a window covered by a modal window. This API takes effect only when it is called by a modal window. * * @param { Callback } callback - Callback invoked when the click event occurs in the target window of the modal window mode. - * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; - * 2. Incorrect parameter types; - * 3. Parameter verification failed. * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since 22 static @@ -7483,9 +7472,8 @@ declare namespace window { /** * Unsubscribes from the touch event of the target window in the modal window mode. * - * @param { Callback } callback - Callback invoked when the click event occurs in the target window of the modal window mode. - * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; - * 2. Parameter verification failed. + * @param { Callback } [callback] - Unregister the callback function. + * If not provided, all callbacks for the given event type will be removed. * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since 22 static @@ -10702,7 +10690,8 @@ declare namespace window { /** * UIExtension in window secure limit change callback off. * - * @param { Callback } callback Callback used to return the result whether the APP has uiextension secure limit. + * @param { Callback } [callback] Unregister the callback function. + * If not provided, all callbacks for the given event type will be removed. * @throws { BusinessError } 801 - Capability not supported.Function off('uiExtensionSecureLimitChange') can not work correctly due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. * @throws { BusinessError } 1300003 - This window manager service works abnormally. -- Gitee From 69d908f36c1a61bc17e562d5bc9f807160ac5a29 Mon Sep 17 00:00:00 2001 From: kaicui Date: Tue, 16 Sep 2025 11:29:10 +0800 Subject: [PATCH 3/4] Modify based on review comments v2. Signed-off-by: kaicui --- api/@ohos.arkui.uiExtension.d.ts | 31 +++++++----- api/@ohos.uiExtensionHost.d.ts | 25 ++++++---- api/@ohos.window.d.ts | 83 +++++++++++++++++++++----------- 3 files changed, 91 insertions(+), 48 deletions(-) diff --git a/api/@ohos.arkui.uiExtension.d.ts b/api/@ohos.arkui.uiExtension.d.ts index 2e7967e45b..812a9b93c7 100644 --- a/api/@ohos.arkui.uiExtension.d.ts +++ b/api/@ohos.arkui.uiExtension.d.ts @@ -114,7 +114,8 @@ declare namespace uiExtension { /** * Subscribes to the window size change event of the host application. * - * @param { 'windowSizeChange' } type - Event type. The value is fixed at 'windowSizeChange', indicating the window size change event. + * @param { 'windowSizeChange' } type - Event type. + * The value is fixed at 'windowSizeChange', indicating the window size change event. * @param { Callback } callback - Callback used to return the window size. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. @@ -139,7 +140,8 @@ declare namespace uiExtension { /** * Unsubscribes from the window size change event of the host application. * - * @param { 'windowSizeChange' } type - Event type. The value is fixed at 'windowSizeChange', indicating the window size change event. + * @param { 'windowSizeChange' } type - Event type. The value is fixed at 'windowSizeChange', + * indicating the window size change event. * @param { Callback } callback - Callback used to return the window size. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. @@ -163,7 +165,8 @@ declare namespace uiExtension { offWindowSizeChange(callback?: Callback): void; /** - * Subscribes to changes in the position and size of the component (EmbeddedComponent or UIExtensionComponent). This API can be used only on 2-in-1 devices. + * Subscribes to changes in the position and size of the component (EmbeddedComponent or UIExtensionComponent). + * This API can be used only on 2-in-1 devices. * * @param { 'rectChange' } type - Event type. The value is fixed at 'rectChange', * indicating the rectangle change event for the component (EmbeddedComponent or UIExtensionComponent). @@ -173,7 +176,8 @@ declare namespace uiExtension { *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. - * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 801 - Capability not supported. + * Failed to call the API due to limited device capabilities. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 14 dynamic @@ -181,11 +185,13 @@ declare namespace uiExtension { on(type: 'rectChange', reasons: number, callback: Callback): void; /** - * Subscribes to changes in the position and size of the component (EmbeddedComponent or UIExtensionComponent). This API can be used only on 2-in-1 devices. + * Subscribes to changes in the position and size of the component (EmbeddedComponent or UIExtensionComponent). + * This API can be used only on 2-in-1 devices. * - * @param { 'int' } reasons - The reasons of component rect change. + * @param { int } reasons - The reasons of component rect change. * @param { Callback } callback - Callback used to return the RectChangeOptions. - * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 801 - Capability not supported. + * Failed to call the API due to limited device capabilities. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 22 static @@ -203,7 +209,8 @@ declare namespace uiExtension { *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. - * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 801 - Capability not supported. + * Failed to call the API due to limited device capabilities. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 14 dynamic @@ -212,11 +219,12 @@ declare namespace uiExtension { /** * Unsubscribes from changes in the position and size of the component (EmbeddedComponent or UIExtensionComponent). - * This API can be used only on 2-in-1 devices. + * This API can be used only on 2-in-1 devices. * * @param { Callback } [callback] - Unregister the callback function. * If not provided, all callbacks for the given event type will be removed. - * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 801 - Capability not supported. + * Failed to call the API due to limited device capabilities. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 22 static @@ -287,7 +295,8 @@ declare namespace uiExtension { * Sets the events that the component (EmbeddedComponent or UIExtensionComponent) will occupy, * preventing the host from responding to these events within the component's area. * - * @param { EventFlag } eventFlags - Type of events to occupy. For details about the available values, see {@link uiExtension.EventFlag }. + * @param { EventFlag } eventFlags - Type of events to occupy. + * For details about the available values, see {@link uiExtension.EventFlag }. * @returns { Promise } - The promise returned by the function * @throws { BusinessError } 401 - Parameter error. Possible cause: *
1. Mandatory parameters are left unspecified. diff --git a/api/@ohos.uiExtensionHost.d.ts b/api/@ohos.uiExtensionHost.d.ts index 030a72a819..14c3244cd2 100644 --- a/api/@ohos.uiExtensionHost.d.ts +++ b/api/@ohos.uiExtensionHost.d.ts @@ -57,8 +57,10 @@ declare namespace uiExtensionHost { /** * Register the callback of avoidAreaChange * - * @param { 'avoidAreaChange' } type - The value is fixed at 'avoidAreaChange', indicating the event of changes to the avoid area. - * @param { Callback<{ type: window.AvoidAreaType, area: window.AvoidArea }> } callback - Callback used to return the area. + * @param { 'avoidAreaChange' } type - The value is fixed at 'avoidAreaChange', + * indicating the event of changes to the avoid area. + * @param { Callback<{ type: window.AvoidAreaType, area: window.AvoidArea }> } callback + * - Callback used to return the area. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. @@ -72,7 +74,8 @@ declare namespace uiExtensionHost { /** * Register the callback of avoidAreaChange * - * @param { Callback<{ type: window.AvoidAreaType, area: window.AvoidArea }> } callback - Callback used to return the area. + * @param { Callback<{ type: window.AvoidAreaType, area: window.AvoidArea }> } callback + * - Callback used to return the area. * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since 22 static @@ -82,8 +85,10 @@ declare namespace uiExtensionHost { /** * Unregister the callback of avoidAreaChange * - * @param { 'avoidAreaChange' } type - The value is fixed at 'avoidAreaChange', indicating the event of changes to the avoid area. - * @param { Callback<{ type: window.AvoidAreaType, area: window.AvoidArea }> } callback - Callback used to return the area. + * @param { 'avoidAreaChange' } type - The value is fixed at 'avoidAreaChange', + * indicating the event of changes to the avoid area. + * @param { Callback<{ type: window.AvoidAreaType, area: window.AvoidArea }> } callback + * - Callback used to return the area. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. @@ -97,8 +102,8 @@ declare namespace uiExtensionHost { /** * Unregister the callback of avoidAreaChange * - * @param { Callback<{ type: window.AvoidAreaType, area: window.AvoidArea }> } [callback] - Unregister the callback function. - * If not provided, all callbacks for the given event type will be removed. + * @param { Callback<{ type: window.AvoidAreaType, area: window.AvoidArea }> } [callback] + * - Unregister the callback function. If not provided, all callbacks for the given event type will be removed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since 22 static @@ -108,7 +113,8 @@ declare namespace uiExtensionHost { /** * Register the callback of windowSizeChange * - * @param { 'windowSizeChange' } type - The value is fixed at 'windowSizeChange', indicating the window size change event. + * @param { 'windowSizeChange' } type - The value is fixed at 'windowSizeChange', + * indicating the window size change event. * @param { Callback } callback - Callback used to return the window size. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. @@ -133,7 +139,8 @@ declare namespace uiExtensionHost { /** * Unregister the callback of windowSizeChange * - * @param { 'windowSizeChange' } type - The value is fixed at 'windowSizeChange', indicating the window size change event. + * @param { 'windowSizeChange' } type - The value is fixed at 'windowSizeChange', + * indicating the window size change event. * @param { Callback } callback - Callback used to return the window size. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index cd949acd6a..db4da2224b 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -7058,7 +7058,8 @@ declare namespace window { /** * Subscribes to the touch event outside this window. * - * @param { 'touchOutside' } type - The value is fixed at 'touchOutside', indicating the click event outside this window. + * @param { 'touchOutside' } type - The value is fixed at 'touchOutside', + * indicating the click event outside this window. * @param { Callback } callback - Callback used to return the click event outside this window. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; @@ -7082,7 +7083,8 @@ declare namespace window { /** * Unsubscribes from the touch event outside this window. * - * @param { 'touchOutside' } type - The value is fixed at 'touchOutside', indicating the click event outside this window. + * @param { 'touchOutside' } type - The value is fixed at 'touchOutside', + * indicating the click event outside this window. * @param { Callback } callback - Callback used to return the click event outside this window. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; * 2. Parameter verification failed. @@ -7271,15 +7273,18 @@ declare namespace window { /** * Subscribes to non-interaction events in a window within the specified period. - * Interaction events include physical keyboard input events and screen touch/click events, but not soft keyboard input events. + * Interaction events include physical keyboard input events and screen touch/click events, + * but not soft keyboard input events. * - * @param { 'noInteractionDetected' } type - The value is fixed at 'noInteractionDetected', indicating the window has no interaction for a long time. + * @param { 'noInteractionDetected' } type - The value is fixed at 'noInteractionDetected', + * indicating the window has no interaction for a long time. * @param { long } timeout - The timeout(in seconds) of no interaction detection. * @param { Callback } callback - Callback used to notify the window has no interaction for a long time. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; * 3. Parameter verification failed. - * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 801 - Capability not supported. + * Failed to call the API due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. * @throws { BusinessError } 1300003 - This window manager service works abnormally. * @syscap SystemCapability.Window.SessionManager @@ -7290,11 +7295,13 @@ declare namespace window { /** * Subscribes to non-interaction events in a window within the specified period. - * Interaction events include physical keyboard input events and screen touch/click events, but not soft keyboard input events. + * Interaction events include physical keyboard input events and screen touch/click events, + * but not soft keyboard input events. * * @param { long } timeout - The timeout(in seconds) of no interaction detection. * @param { Callback } callback - Callback used to notify the window has no interaction for a long time. - * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 801 - Capability not supported. + * Failed to call the API due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. * @throws { BusinessError } 1300003 - This window manager service works abnormally. * @syscap SystemCapability.Window.SessionManager @@ -7305,13 +7312,16 @@ declare namespace window { /** * Unsubscribes from non-interaction events in a window within the specified period. - * Interaction events include physical keyboard input events and screen touch/click events, but not soft keyboard input events. + * Interaction events include physical keyboard input events and screen touch/click events, + * but not soft keyboard input events. * - * @param { 'noInteractionDetected' } type - The value is fixed at 'noInteractionDetected', indicating the window has no interaction for a long time. + * @param { 'noInteractionDetected' } type - The value is fixed at 'noInteractionDetected', + * indicating the window has no interaction for a long time. * @param { Callback } callback - Callback used to notify the window has no interaction for a long time. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; * 2. Parameter verification failed. - * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 801 - Capability not supported. + * Failed to call the API due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. * @throws { BusinessError } 1300003 - This window manager service works abnormally. * @syscap SystemCapability.Window.SessionManager @@ -7322,11 +7332,13 @@ declare namespace window { /** * Unsubscribes from non-interaction events in a window within the specified period. - * Interaction events include physical keyboard input events and screen touch/click events, but not soft keyboard input events. + * Interaction events include physical keyboard input events and screen touch/click events, + * but not soft keyboard input events. * * @param { Callback } [callback] - Unregister the callback function. * If not provided, all callbacks for the given event type will be removed. - * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 801 - Capability not supported. + * Failed to call the API due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. * @throws { BusinessError } 1300003 - This window manager service works abnormally. * @syscap SystemCapability.Window.SessionManager @@ -7421,10 +7433,13 @@ declare namespace window { * @since 10 */ /** - * Subscribes to click or touch events in a window covered by a modal window. This API takes effect only when it is called by a modal window. + * Subscribes to click or touch events in a window covered by a modal window. + * This API takes effect only when it is called by a modal window. * - * @param { 'dialogTargetTouch' } type - The value is fixed at 'dialogTargetTouch', indicating the click event of the target window in the modal window mode. - * @param { Callback } callback - Callback invoked when the click event occurs in the target window of the modal window mode. + * @param { 'dialogTargetTouch' } type - The value is fixed at 'dialogTargetTouch', + * indicating the click event of the target window in the modal window mode. + * @param { Callback } callback + * - Callback invoked when the click event occurs in the target window of the modal window mode. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; * 3. Parameter verification failed. @@ -7435,9 +7450,11 @@ declare namespace window { on(type: 'dialogTargetTouch', callback: Callback): void; /** - * Subscribes to click or touch events in a window covered by a modal window. This API takes effect only when it is called by a modal window. + * Subscribes to click or touch events in a window covered by a modal window. + * This API takes effect only when it is called by a modal window. * - * @param { Callback } callback - Callback invoked when the click event occurs in the target window of the modal window mode. + * @param { Callback } callback + * - Callback invoked when the click event occurs in the target window of the modal window mode. * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since 22 static @@ -7459,8 +7476,9 @@ declare namespace window { * Unsubscribes from the touch event of the target window in the modal window mode. * * @param { 'dialogTargetTouch' } type - The value is fixed at 'dialogTargetTouch', - * indicating the click event of the target window in the modal window mode. - * @param { Callback } callback - Callback invoked when the click event occurs in the target window of the modal window mode. + * indicating the click event of the target window in the modal window mode. + * @param { Callback } callback + * - Callback invoked when the click event occurs in the target window of the modal window mode. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; * 2. Parameter verification failed. * @syscap SystemCapability.WindowManager.WindowManager.Core @@ -10649,9 +10667,12 @@ declare namespace window { /** * UIExtension in window secure limit change callback on. * - * @param { 'uiExtensionSecureLimitChange' } eventType The value is fixed at 'uiExtensionSecureLimitChange', indicating the UIExtension secure limit change. - * @param { Callback } callback Callback used to return the result whether the APP has uiextension secure limit. - * @throws { BusinessError } 801 - Capability not supported.Function on('uiExtensionSecureLimitChange') can not work correctly due to limited device capabilities. + * @param { 'uiExtensionSecureLimitChange' } eventType + * The value is fixed at 'uiExtensionSecureLimitChange', indicating the UIExtension secure limit change. + * @param { Callback } callback + * Callback used to return the result whether the APP has uiextension secure limit. + * @throws { BusinessError } 801 - Capability not supported. + * Function on('uiExtensionSecureLimitChange') can not work correctly due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. * @throws { BusinessError } 1300003 - This window manager service works abnormally. * @syscap SystemCapability.Window.SessionManager @@ -10663,8 +10684,10 @@ declare namespace window { /** * UIExtension in window secure limit change callback on. * - * @param { Callback } callback Callback used to return the result whether the APP has uiextension secure limit. - * @throws { BusinessError } 801 - Capability not supported.Function on('uiExtensionSecureLimitChange') can not work correctly due to limited device capabilities. + * @param { Callback } callback + * Callback used to return the result whether the APP has uiextension secure limit. + * @throws { BusinessError } 801 - Capability not supported. + * Function on('uiExtensionSecureLimitChange') can not work correctly due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. * @throws { BusinessError } 1300003 - This window manager service works abnormally. * @syscap SystemCapability.Window.SessionManager @@ -10676,9 +10699,12 @@ declare namespace window { /** * UIExtension in window secure limit change callback off. * - * @param { 'uiExtensionSecureLimitChange' } eventType The value is fixed at 'uiExtensionSecureLimitChange', indicating the UIExtension secure limit change. - * @param { Callback } callback Callback used to return the result whether the APP has uiextension secure limit. - * @throws { BusinessError } 801 - Capability not supported.Function off('uiExtensionSecureLimitChange') can not work correctly due to limited device capabilities. + * @param { 'uiExtensionSecureLimitChange' } eventType + * The value is fixed at 'uiExtensionSecureLimitChange', indicating the UIExtension secure limit change. + * @param { Callback } callback + * Callback used to return the result whether the APP has uiextension secure limit. + * @throws { BusinessError } 801 - Capability not supported. + * Function off('uiExtensionSecureLimitChange') can not work correctly due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. * @throws { BusinessError } 1300003 - This window manager service works abnormally. * @syscap SystemCapability.Window.SessionManager @@ -10692,7 +10718,8 @@ declare namespace window { * * @param { Callback } [callback] Unregister the callback function. * If not provided, all callbacks for the given event type will be removed. - * @throws { BusinessError } 801 - Capability not supported.Function off('uiExtensionSecureLimitChange') can not work correctly due to limited device capabilities. + * @throws { BusinessError } 801 - Capability not supported. + * Function off('uiExtensionSecureLimitChange') can not work correctly due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. * @throws { BusinessError } 1300003 - This window manager service works abnormally. * @syscap SystemCapability.Window.SessionManager -- Gitee From 9340e20787c8dc359614ae71a005916b27729a2d Mon Sep 17 00:00:00 2001 From: kaicui Date: Fri, 19 Sep 2025 09:32:30 +0800 Subject: [PATCH 4/4] Modify based on review comments v3 Signed-off-by: kaicui --- api/@ohos.window.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index db4da2224b..e06315e197 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -7278,7 +7278,7 @@ declare namespace window { * * @param { 'noInteractionDetected' } type - The value is fixed at 'noInteractionDetected', * indicating the window has no interaction for a long time. - * @param { long } timeout - The timeout(in seconds) of no interaction detection. + * @param { number } timeout - The timeout(in seconds) of no interaction detection. * @param { Callback } callback - Callback used to notify the window has no interaction for a long time. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; @@ -7291,7 +7291,7 @@ declare namespace window { * @atomicservice * @since 12 dynamic */ - on(type: 'noInteractionDetected', timeout: long, callback: Callback): void; + on(type: 'noInteractionDetected', timeout: number, callback: Callback): void; /** * Subscribes to non-interaction events in a window within the specified period. -- Gitee