diff --git a/api/@ohos.ability.featureAbility.d.ts b/api/@ohos.ability.featureAbility.d.ts index 9a9170e063ce5aeffa4e30aa65db24d543c714c2..bb2d8fe62c5181e1856d340b98303ddbfb48e72c 100644 --- a/api/@ohos.ability.featureAbility.d.ts +++ b/api/@ohos.ability.featureAbility.d.ts @@ -19,6 +19,7 @@ import { AbilityResult } from './ability/abilityResult'; import { Context } from './app/context'; import { DataAbilityHelper } from './ability/dataAbilityHelper'; import { ConnectOptions } from './ability/connectOptions'; +import { ContinueAbilityOptions } from './ability/continueAbilityOptions'; /** * A Feature Ability represents an ability with a UI and is designed to interact with users. @@ -142,6 +143,17 @@ declare namespace featureAbility { function disconnectAbility(connection: number, callback:AsyncCallback): void; function disconnectAbility(connection: number): Promise; + /** + * Migrates this ability to the given device on the same distributed network. + * @default - + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + * @return - + */ + function continueAbility(options: ContinueAbilityOptions, callback: AsyncCallback): void; + function continueAbility(options: ContinueAbilityOptions): Promise; + export enum AbilityWindowConfiguration { WINDOW_MODE_UNDEFINED = 0, WINDOW_MODE_FULLSCREEN = 1, diff --git a/api/ability/continueAbilityOptions.d.ts b/api/ability/continueAbilityOptions.d.ts new file mode 100755 index 0000000000000000000000000000000000000000..9d1ce3c6408383dc922d166dc90a72b6e20029da --- /dev/null +++ b/api/ability/continueAbilityOptions.d.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ContinueAbilityOptions { + /** + * Indicates the ID of the target device where this ability will be migrated to. + * + * @default - + * @devices phone, tablet, tv, wearable, car + * @since 7 + * @sysCap AAFwk + */ + deviceId: string; + + /** + * Indicates whether the ability to be migrated back to the local device through + * This is a reserved field. + * + * @default - + * @devices phone, tablet, tv, wearable, car + * @since 7 + * @sysCap AAFwk + */ + reversible?: boolean; +} \ No newline at end of file