From 5fef2e5b4b22b6c28f73d14c475264069d485266 Mon Sep 17 00:00:00 2001 From: xuzihan129 Date: Mon, 23 Jun 2025 12:32:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8E=A5=E5=8F=A3Callback=E5=AE=9A?= =?UTF-8?q?=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuzihan129 --- api/@ohos.window.d.ts | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 7bf8f50a56..b63f8a3938 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -33,7 +33,6 @@ import bundleManager from './@ohos.bundle.bundleManager'; import { LocalStorage } from '@ohos.arkui.stateManagement'; import { UIContext } from '@ohos.arkui.UIContext'; import { ColorMetrics } from '@ohos.arkui.node'; -import { Callback } from './@ohos.base'; /*** endif */ /*** if arkts 1.1 */ @@ -59,6 +58,18 @@ declare interface Callback { } /*** endif */ +/*** if arkts 1.2 */ +/** + * Defines the window callback. + * + * @typedef { Callback } + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 20 + */ +type Callback = (data: T) => V; +/*** endif */ + /** * Window manager. * @@ -6459,7 +6470,8 @@ declare namespace window { * @throws { BusinessError } 1300004 - Unauthorized operation. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ on(type: 'windowWillClose', callback: Callback>): void; @@ -6475,7 +6487,8 @@ declare namespace window { * @throws { BusinessError } 1300004 - Unauthorized operation. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ off(type: 'windowWillClose', callback?: Callback>): void; -- Gitee From b0e9be270135199bc231db1aa50c6b44dc73ed79 Mon Sep 17 00:00:00 2001 From: xuzihan129 Date: Mon, 23 Jun 2025 15:58:43 +0000 Subject: [PATCH 2/2] =?UTF-8?q?update=20api/@ohos.window.d.ts.=20=E6=8C=89?= =?UTF-8?q?=E7=85=A7=E8=A6=81=E6=B1=82=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuzihan129 --- api/@ohos.window.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index b63f8a3938..3b62543309 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -62,7 +62,7 @@ declare interface Callback { /** * Defines the window callback. * - * @typedef { Callback } + * @typedef {function} * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 20 -- Gitee