From 7c064ba2c84f3f529881c76fc9e4c7b5a497a0c3 Mon Sep 17 00:00:00 2001 From: chyyy0213 Date: Thu, 17 Feb 2022 15:19:49 +0800 Subject: [PATCH] modify window interface declare Signed-off-by: chyyy0213 Change-Id: I42ea3411a6967662102869a95a59f7655792f158 --- api/@ohos.window.d.ts | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index b1bfab22e6..868d38934d 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -64,6 +64,22 @@ declare namespace window { FLOATING } + /** + * Create a sub window with a specific id and type, only support 7. + * @param id Indicates window id. + * @param type Indicates window type. + * @since 7 + */ + function create(id: string, type: WindowType, callback: AsyncCallback): void; + + /** + * Create a sub window with a specific id and type, only support 7. + * @param id Indicates window id. + * @param type Indicates window type. + * @since 7 + */ + function create(id: string, type: WindowType): Promise; + /** * Create a system window with a specific id and type. * @param ctx Indicates the context on which the window depends @@ -556,7 +572,7 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 7 */ - isShowing(callback: AsyncCallback): void; + isShowing(callback: AsyncCallback): void; /** * Checks whether the window is displayed @@ -649,34 +665,34 @@ declare namespace window { interface WindowStage { /** * Get main window of the stage. - * @since 8 + * @since 9 */ getMainWindow(): Promise; /** * Get main window of the stage. - * @since 8 + * @since 9 */ getMainWindow(callback: AsyncCallback): void; /** * Create sub window of the stage. * @param name window name of sub window - * @since 8 + * @since 9 */ createSubWindow(name: string): Promise; /** * Create sub window of the stage. * @param name window name of sub window - * @since 8 + * @since 9 */ createSubWindow(name: string, callback: AsyncCallback): void; /** * Get sub window of the stage. - * @since 8 + * @since 9 */ getSubWindow(): Promise>; /** * Get sub window of the stage. - * @since 8 + * @since 9 */ getSubWindow(callback: AsyncCallback>): void; /** @@ -684,31 +700,31 @@ declare namespace window { * @param path path Path of the page to which the content will be loaded * @param storage storage The data object shared within the content instance loaded by the window * @syscap SystemCapability.WindowManager.WindowManager.Core - * @since 8 + * @since 9 */ loadContent(path: string, storage: ContenStorage, callback: AsyncCallback): void; /** * Loads content * @param path path of the page to which the content will be loaded * @syscap SystemCapability.WindowManager.WindowManager.Core - * @since 8 + * @since 9 */ loadContent(path: string, callback: AsyncCallback): void; /** * Loads content * @param path path of the page to which the content will be loaded * @syscap SystemCapability.WindowManager.WindowManager.Core - * @since 8 + * @since 9 */ loadContent(path: string, storage?: ContenStorage): Promise; /** * window stage event callback on. - * @since 8 + * @since 9 */ on(eventType: 'windowStageEvent', callback: Callback): void; /** * window stage event callback off. - * @since 8 + * @since 9 */ off(eventType: 'windowStageEvent', callback?: Callback): void; } -- Gitee