From b1ce4d25413092928eb12a2596379572363c71cb Mon Sep 17 00:00:00 2001 From: dy_study Date: Mon, 14 Mar 2022 14:24:15 +0800 Subject: [PATCH] =?UTF-8?q?IssueNo:#I4XPAK=20Description:=E5=85=83?= =?UTF-8?q?=E8=83=BD=E5=8A=9B=E4=B8=BB=E5=8A=A8=E6=B5=81=E8=BD=AC=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=B7=BB=E5=8A=A0=20Sig:SIG=5FApplicationFramework=20?= =?UTF-8?q?Feature=20or=20Bugfix:=20Feature=20Binary=20Source:=20No?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dy_study Change-Id: Ia4b1948ada983a5a7869a039804b69041b47a414 --- api/app/context.d.ts | 15 +++++++ api/app/continuationExtraParams.d.ts | 51 ++++++++++++++++++++++++ api/app/continuationResult.d.ts | 59 ++++++++++++++++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 api/app/continuationExtraParams.d.ts create mode 100644 api/app/continuationResult.d.ts diff --git a/api/app/context.d.ts b/api/app/context.d.ts index b03bc6357a..07b46a3455 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 0000000000..731e166b07 --- /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 0000000000..39cb85fe97 --- /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 -- Gitee