diff --git a/api/app/context.d.ts b/api/app/context.d.ts index b03bc6357af7db0f3dd0afbf36e8c7bede366c35..07b46a3455b73a56d820c1239181d3d90c0e9bf9 100644 --- a/api/app/context.d.ts +++ b/api/app/context.d.ts @@ -22,6 +22,8 @@ import { HapModuleInfo } from '../bundle/hapModuleInfo'; import { AppVersionInfo } from './appVersionInfo'; import { AbilityInfo } from '../bundle/abilityInfo'; import { DisplayOrientation } from '../@ohos.bundle'; +import { ContinuationExtraParams } from './continuationExtraParams'; +import { ContinuationResult } from './continuationResult'; /** @@ -258,6 +260,19 @@ export interface Context extends BaseContext { */ printDrawnCompleted(callback: AsyncCallback): void; printDrawnCompleted(): Promise; + + /** + * Shows the list of devices that can be selected for ability hopping on the distributed network. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param extraParams Indicates the {@link ContinuationExtraParams} object containing the extra parameters + * used to filter the list of available devices. + * @return Returns the result of show device list operation, in {@link ContinuationResult}. + * @FAModelOnly + */ + showDeviceList(extraParams: ContinuationExtraParams, callback: AsyncCallback): void; + showDeviceList(extraParams: ContinuationExtraParams): Promise; } /** diff --git a/api/app/continuationExtraParams.d.ts b/api/app/continuationExtraParams.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..731e166b07335951da3d108a795dfb22c6bfff52 --- /dev/null +++ b/api/app/continuationExtraParams.d.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2022 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. + */ + +/** + * Indicates the description of additional parameters for continuation. + * + * @name ContinuationExtraParams + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + export interface ContinuationExtraParams { + + /** + * Indicates the type of devices to be matched. + * + * @default - + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + devTypes?: Array; + + /** + * Indicates the bundle name of the target application where the ability will be hopped. + * + * @default - + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + targetBundle?: string; + + /** + * Indicates the custom JSON parameters to be used as filter conditions. + * + * @default - + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + jsonParams?: string; +} \ No newline at end of file diff --git a/api/app/continuationResult.d.ts b/api/app/continuationResult.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..39cb85fe97c33f5ba5b0dda87aa605cf90b2d806 --- /dev/null +++ b/api/app/continuationResult.d.ts @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2022 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. + */ + +/** + * Indicates the description of transfer results for continuation. + * + * @name ContinuationResult + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + export interface ContinuationResult { + /** + * Error code. 0 indicates successful, otherwise it is failed. + * + * @default - + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + errCode: number; + + /** + * the information about the selected device id. + * + * @default - + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + id: string; + + /** + * the information about the selected device type. + * + * @default - + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + type: string; + + /** + * Indicates the name of the selected device. + * + * @default - + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + name: string; +} \ No newline at end of file