161847f8eSopenharmony_ci/*
261847f8eSopenharmony_ci * Copyright (c) 2022-2023 Huawei Device Co., Ltd.
361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"),
461847f8eSopenharmony_ci * you may not use this file except in compliance with the License.
561847f8eSopenharmony_ci * You may obtain a copy of the License at
661847f8eSopenharmony_ci *
761847f8eSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
861847f8eSopenharmony_ci *
961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and
1361847f8eSopenharmony_ci * limitations under the License.
1461847f8eSopenharmony_ci */
1561847f8eSopenharmony_ci
1661847f8eSopenharmony_ci/**
1761847f8eSopenharmony_ci * @file
1861847f8eSopenharmony_ci * @kit ArkUI
1961847f8eSopenharmony_ci */
2061847f8eSopenharmony_ci
2161847f8eSopenharmony_ciimport { AsyncCallback } from '../@ohos.base';
2261847f8eSopenharmony_ciimport ExtensionContext from './ExtensionContext';
2361847f8eSopenharmony_ciimport Want from '../@ohos.application.Want';
2461847f8eSopenharmony_ciimport StartOptions from '../@ohos.app.ability.StartOptions';
2561847f8eSopenharmony_ci
2661847f8eSopenharmony_ci/**
2761847f8eSopenharmony_ci * The context of window extension. It allows access to
2861847f8eSopenharmony_ci * windowExtension-specific resources.
2961847f8eSopenharmony_ci *
3061847f8eSopenharmony_ci * @extends ExtensionContext
3161847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core
3261847f8eSopenharmony_ci * @systemapi
3361847f8eSopenharmony_ci * @stagemodelonly
3461847f8eSopenharmony_ci * @since 9
3561847f8eSopenharmony_ci */
3661847f8eSopenharmony_ciexport default class WindowExtensionContext extends ExtensionContext {
3761847f8eSopenharmony_ci  /**
3861847f8eSopenharmony_ci   * Window extension uses this method to start a specific ability.
3961847f8eSopenharmony_ci   *
4061847f8eSopenharmony_ci   * @param { Want } want - Indicates the ability to start.
4161847f8eSopenharmony_ci   * @param { StartOptions } options - Indicates the start options.
4261847f8eSopenharmony_ci   * @param { AsyncCallback<void> } callback - The callback of startAbility.
4361847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible cause: 1.Mandatory parameters are left unspecified; 
4461847f8eSopenharmony_ci   *                                                                  2.Incorrect parameter types.
4561847f8eSopenharmony_ci   * @syscap SystemCapability.WindowManager.WindowManager.Core
4661847f8eSopenharmony_ci   * @systemapi
4761847f8eSopenharmony_ci   * @stagemodelonly
4861847f8eSopenharmony_ci   * @since 9
4961847f8eSopenharmony_ci   */
5061847f8eSopenharmony_ci  /**
5161847f8eSopenharmony_ci   * Window extension uses this method to start a specific ability.
5261847f8eSopenharmony_ci   *
5361847f8eSopenharmony_ci   * @param { Want } want - Indicates the ability to start.
5461847f8eSopenharmony_ci   * @param { StartOptions } options - Indicates the start options.
5561847f8eSopenharmony_ci   * @param { AsyncCallback<void> } callback - The callback of startAbility.
5661847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
5761847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible cause: 1.Mandatory parameters are left unspecified; 
5861847f8eSopenharmony_ci   *                                                                  2.Incorrect parameter types.
5961847f8eSopenharmony_ci   * @syscap SystemCapability.WindowManager.WindowManager.Core
6061847f8eSopenharmony_ci   * @systemapi
6161847f8eSopenharmony_ci   * @stagemodelonly
6261847f8eSopenharmony_ci   * @since 12
6361847f8eSopenharmony_ci   */
6461847f8eSopenharmony_ci  startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void>): void;
6561847f8eSopenharmony_ci
6661847f8eSopenharmony_ci  /**
6761847f8eSopenharmony_ci   * Window extension uses this method to start a specific ability.
6861847f8eSopenharmony_ci   *
6961847f8eSopenharmony_ci   * @param { Want } want - Indicates the ability to start.
7061847f8eSopenharmony_ci   * @param { StartOptions } [options] - Indicates the start options.
7161847f8eSopenharmony_ci   * @returns { Promise<void> } The promise returned by the function.
7261847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible cause: 1.Mandatory parameters are left unspecified; 
7361847f8eSopenharmony_ci   *                                                                  2.Incorrect parameter types.
7461847f8eSopenharmony_ci   * @syscap SystemCapability.WindowManager.WindowManager.Core
7561847f8eSopenharmony_ci   * @systemapi
7661847f8eSopenharmony_ci   * @stagemodelonly
7761847f8eSopenharmony_ci   * @since 9
7861847f8eSopenharmony_ci   */
7961847f8eSopenharmony_ci  /**
8061847f8eSopenharmony_ci   * Window extension uses this method to start a specific ability.
8161847f8eSopenharmony_ci   *
8261847f8eSopenharmony_ci   * @param { Want } want - Indicates the ability to start.
8361847f8eSopenharmony_ci   * @param { StartOptions } [options] - Indicates the start options.
8461847f8eSopenharmony_ci   * @returns { Promise<void> } The promise returned by the function.
8561847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
8661847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible cause: 1.Mandatory parameters are left unspecified; 
8761847f8eSopenharmony_ci   *                                                                  2.Incorrect parameter types.
8861847f8eSopenharmony_ci   * @syscap SystemCapability.WindowManager.WindowManager.Core
8961847f8eSopenharmony_ci   * @systemapi
9061847f8eSopenharmony_ci   * @stagemodelonly
9161847f8eSopenharmony_ci   * @since 12
9261847f8eSopenharmony_ci   */
9361847f8eSopenharmony_ci  startAbility(want: Want, options?: StartOptions): Promise<void>;
9461847f8eSopenharmony_ci}
95