diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 7bf8f50a56ded0c09aeb1682aad26a265616386c..3b625433099f31812d7f7800028fabb0f24003c3 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 {function} + * @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;