window接口切换
FA模型接口 | Stage模型接口对应d.ts文件 | Stage模型对应接口 |
---|---|---|
enum WindowType { TYPE_APP } |
@ohos.window.d.ts | createSubWindow(name: string, callback: AsyncCallback<Window>): void; createSubWindow(name: string): Promise; FA模型应用通过window.create(id, WindowType.TYPE_APP)接口创建应用子窗口,Stage模型应用可使用WindowStage.CreateSubWindow()接口代替 |
create(id: string, type: WindowType, callback: AsyncCallback<Window>): void; create(id: string, type: WindowType): Promise<Window>; |
@ohos.window.d.ts | createWindow(config: Configuration, callback: AsyncCallback<Window>): void; createWindow(config: Configuration): Promise<Window>; |
getTopWindow(callback: AsyncCallback<Window>): void; getTopWindow(): Promise<Window>; |
@ohos.window.d.ts | getLastWindow(ctx: BaseContext, callback: AsyncCallback<Window>): void; getLastWindow(ctx: BaseContext): Promise<Window>; |