From 8b945025b474118b00c2aff34daf95ea60fb32ef Mon Sep 17 00:00:00 2001 From: wangtiantian Date: Sat, 18 Jun 2022 14:24:40 +0800 Subject: [PATCH 01/47] IssueNo:#I5CXMN:add cache event Description:add cache event Sig:SIG_ApplicaitonFramework Feature or Bugfix:Feature Binary Source:No Signed-off-by: wangtiantian --- api/@ohos.commonEvent.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/@ohos.commonEvent.d.ts b/api/@ohos.commonEvent.d.ts index 7826cee6e6..2b9db6f02c 100644 --- a/api/@ohos.commonEvent.d.ts +++ b/api/@ohos.commonEvent.d.ts @@ -254,6 +254,12 @@ declare namespace commonEvent { */ COMMON_EVENT_PACKAGE_DATA_CLEARED = "usual.event.PACKAGE_DATA_CLEARED", + /** + * this commonEvent means the user has cleared the package cache. + * @since 9 + */ + COMMON_EVENT_PACKAGE_CACHE_CLEARED = "usual.event.PACKAGE_CACHE_CLEARED", + /** * this commonEvent means the packages have been suspended. */ -- Gitee From 16171dbddb519574c4aff9e1b17ae5579d4945da Mon Sep 17 00:00:00 2001 From: ql Date: Tue, 21 Jun 2022 15:10:50 +0800 Subject: [PATCH 02/47] Add distributed mission manager api Signed-off-by: ql Change-Id: I14d17421964de0c66bb86372688726d578b93403 --- api/@ohos.distributedMissionManager.d.ts | 80 ++++++++++++++++++++++++ api/application/MissionCallbacks.d.ts | 57 +++++++++++++++++ api/application/MissionDeviceInfo.d.ts | 32 ++++++++++ api/application/MissionParameter.d.ts | 48 ++++++++++++++ 4 files changed, 217 insertions(+) create mode 100755 api/@ohos.distributedMissionManager.d.ts create mode 100755 api/application/MissionCallbacks.d.ts create mode 100755 api/application/MissionDeviceInfo.d.ts create mode 100755 api/application/MissionParameter.d.ts diff --git a/api/@ohos.distributedMissionManager.d.ts b/api/@ohos.distributedMissionManager.d.ts new file mode 100755 index 0000000000..4ea8d0791f --- /dev/null +++ b/api/@ohos.distributedMissionManager.d.ts @@ -0,0 +1,80 @@ +/* + * 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. + */ + +import { AsyncCallback } from './basic'; +import { MissionCallback } from './application/MissionCallbacks'; +import { MissionDeviceInfo } from './application/MissionDeviceInfo'; +import { MissionParameter } from './application/MissionParameter'; + +/** + * This module provides the capability to manage abilities and obtaining system task information for distributed + * scenario. + * @name distributedMissionManager + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @permission N/A + * @systemapi Hide this for inner system use. + */ +declare namespace distributedMissionManager { + /** + * Start sync missions from remote device. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission. + * @param parameter Parameters corresponding to mission. + * @return - + * @systemapi Hide this for inner system use. + */ + function startSyncRemoteMissions(parameter: MissionParameter, callback: AsyncCallback): void; + function startSyncRemoteMissions(parameter: MissionParameter): Promise; + + /** + * Stop sync missions from remote device. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission. + * @param parameter Parameters corresponding to mission. + * @return - + * @systemapi Hide this for inner system use. + */ + function stopSyncRemoteMissions(parameter: MissionDeviceInfo, callback: AsyncCallback): void; + function stopSyncRemoteMissions(parameter: MissionDeviceInfo): Promise; + + /** + * Register the missionListener to ams. + * @default - + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param parameter Parameters corresponding to mission. + * @param options The callbacks for regist mission. + * @return - + * @systemapi Hide this for inner system use. + */ + function registerMissionListener(parameter: MissionDeviceInfo, options: MissionCallback, callback: AsyncCallback): void; + function registerMissionListener(parameter: MissionDeviceInfo, options: MissionCallback): Promise; + + /** + * Unrgister the missionListener to ams. + * @default - + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param parameter Parameters corresponding to mission. + * @return - + * @systemapi Hide this for inner system use. + */ + function unRegisterMissionListener(parameter: MissionDeviceInfo, callback:AsyncCallback): void; + function unRegisterMissionListener(parameter: MissionDeviceInfo): Promise; +} +export default distributedMissionManager; diff --git a/api/application/MissionCallbacks.d.ts b/api/application/MissionCallbacks.d.ts new file mode 100755 index 0000000000..de4a16551b --- /dev/null +++ b/api/application/MissionCallbacks.d.ts @@ -0,0 +1,57 @@ +/* + * 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. + */ + +/** + * MissionCallback registered by app. + * + * @name MissionCallback + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @permission N/A + * @systemapi hide for inner use. + */ + export interface MissionCallback { + /** + * Called by system when mission changed. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param deviceId Indicates the deviceId mission changed. + * @return - + */ + notifyMissionsChanged(deviceId: string): void; + + /** + * Called by system when snapshop changed. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param deviceId Indicates the deviceId mission changed. + * @param mission Indicates the id of destroyed mission. + * @return - + */ + notifySnapshot(deviceId: string, mission: number): void; + + /** + * Called by system when network disconnect. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param deviceId Indicates the deviceId mission changed. + * @param state Indicates the state of network + * @return - + */ + notifyNetDisconnect(deviceId: string, state: number): void; +} \ No newline at end of file diff --git a/api/application/MissionDeviceInfo.d.ts b/api/application/MissionDeviceInfo.d.ts new file mode 100755 index 0000000000..d4ba0f2dbe --- /dev/null +++ b/api/application/MissionDeviceInfo.d.ts @@ -0,0 +1,32 @@ +/* + * 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. + */ + +/** + * Parameters corresponding to mission. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @permission N/A + * @systemapi hide for inner use. + */ + export interface MissionDeviceInfo { + /** + * Indicates the deviceId to start sync. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + deviceId: string; + } \ No newline at end of file diff --git a/api/application/MissionParameter.d.ts b/api/application/MissionParameter.d.ts new file mode 100755 index 0000000000..6d0455f67b --- /dev/null +++ b/api/application/MissionParameter.d.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +/** + * Parameters corresponding to mission. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @permission N/A + * @systemapi hide for inner use. + */ +export interface MissionParameter { + /** + * Indicates the deviceId to start sync. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + deviceId: string; + + /** + * If needed to fix the versions confilct. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + fixConflict: boolean; + + /** + * Tag used to be specified. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + tag: number; +} \ No newline at end of file -- Gitee From 73c7b4d7d745005d4f5ad7c8d7f6ea09b53d3900 Mon Sep 17 00:00:00 2001 From: mr-yx <496043997@qq.com> Date: Wed, 29 Jun 2022 00:06:37 +0800 Subject: [PATCH 03/47] update line breaks Signed-off-by: mr-yx <496043997@qq.com> --- api/application/AbilityRunningInfo.d.ts | 148 ++-- api/application/EventHub.d.ts | 118 +-- api/application/ExtensionRunningInfo.d.ts | 164 ++-- api/application/MissionListener.d.ts | 154 ++-- api/application/PermissionRequestResult.d.ts | 84 +- api/application/ProcessRunningInfo.d.ts | 164 ++-- api/bundle/PermissionDef.d.ts | 102 +-- api/bundle/abilityInfo.d.ts | 562 ++++++------- api/bundle/applicationInfo.d.ts | 376 ++++----- api/bundle/bundleInfo.d.ts | 518 ++++++------ api/bundle/bundleInstaller.d.ts | 300 +++---- api/bundle/customizeData.d.ts | 86 +- api/bundle/elementName.d.ts | 160 ++-- api/bundle/hapModuleInfo.d.ts | 288 +++---- api/bundle/moduleInfo.d.ts | 84 +- api/bundle/shortcutInfo.d.ts | 236 +++--- api/common/full/dom.d.ts | 58 +- api/common/full/featureability.d.ts | 798 +++++++++---------- api/common/lite/console.d.ts | 92 +-- api/common/lite/featureability.d.ts | 294 +++---- api/common/lite/global.d.ts | 156 ++-- api/common/lite/index.d.ts | 36 +- api/common/lite/viewmodel.d.ts | 236 +++--- 23 files changed, 2607 insertions(+), 2607 deletions(-) diff --git a/api/application/AbilityRunningInfo.d.ts b/api/application/AbilityRunningInfo.d.ts index 6ffba2b824..864465c87b 100644 --- a/api/application/AbilityRunningInfo.d.ts +++ b/api/application/AbilityRunningInfo.d.ts @@ -1,75 +1,75 @@ -/* - * 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. - */ - -import { ElementName } from '../bundle/elementName'; -import abilityManager from '../@ohos.application.abilityManager'; - -/** - * The class of an ability running information. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - * @permission N/A - */ -export interface AbilityRunningInfo { - /** - * @default ability element name - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - ability: ElementName; - - /** - * @default process id - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - pid: number; - - /** - * @default user id - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - uid: number; - - /** - * @default the name of the process - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - processName: string; - - /** - * @default ability start time - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - startTime: number; - - /** - * @default Enumerates state of the ability state info - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - abilityState: abilityManager.AbilityState; +/* + * 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. + */ + +import { ElementName } from '../bundle/elementName'; +import abilityManager from '../@ohos.application.abilityManager'; + +/** + * The class of an ability running information. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + * @permission N/A + */ +export interface AbilityRunningInfo { + /** + * @default ability element name + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + ability: ElementName; + + /** + * @default process id + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + pid: number; + + /** + * @default user id + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + uid: number; + + /** + * @default the name of the process + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + processName: string; + + /** + * @default ability start time + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + startTime: number; + + /** + * @default Enumerates state of the ability state info + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + abilityState: abilityManager.AbilityState; } \ No newline at end of file diff --git a/api/application/EventHub.d.ts b/api/application/EventHub.d.ts index cbc9cbdc8b..7fe3d203ca 100644 --- a/api/application/EventHub.d.ts +++ b/api/application/EventHub.d.ts @@ -1,60 +1,60 @@ -/* - * 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. - */ - -/** - * The event center of a context, support the subscription and publication of events. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A - * @StageModelOnly - */ -export default class EventHub { - /** - * Subscribe to an event. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param event Indicates the event. - * @param callback Indicates the callback. - * @return - - * @StageModelOnly - */ - on(event: string, callback: Function): void - - /** - * Unsubscribe from an event. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param event Indicates the event. - * @param callback Indicates the callback. - * @return - - * @StageModelOnly - */ - off(event: string, callback?: Function): void - - /** - * Trigger the event callbacks. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param event Indicates the event. - * @param args Indicates the callback arguments. - * @return - - * @StageModelOnly - */ - emit(event: string, ...args: Object[]): void +/* + * 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. + */ + +/** + * The event center of a context, support the subscription and publication of events. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + * @StageModelOnly + */ +export default class EventHub { + /** + * Subscribe to an event. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param event Indicates the event. + * @param callback Indicates the callback. + * @return - + * @StageModelOnly + */ + on(event: string, callback: Function): void + + /** + * Unsubscribe from an event. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param event Indicates the event. + * @param callback Indicates the callback. + * @return - + * @StageModelOnly + */ + off(event: string, callback?: Function): void + + /** + * Trigger the event callbacks. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param event Indicates the event. + * @param args Indicates the callback arguments. + * @return - + * @StageModelOnly + */ + emit(event: string, ...args: Object[]): void } \ No newline at end of file diff --git a/api/application/ExtensionRunningInfo.d.ts b/api/application/ExtensionRunningInfo.d.ts index 5021e879d1..32abe9c264 100644 --- a/api/application/ExtensionRunningInfo.d.ts +++ b/api/application/ExtensionRunningInfo.d.ts @@ -1,83 +1,83 @@ -/* - * 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. - */ - -import { ElementName } from '../bundle/elementName'; -import bundle from '../@ohos.bundle'; - -/** - * The class of an extension running information. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - * @permission N/A - */ -export interface ExtensionRunningInfo { - /** - * @default Indicates the extension of the extension info - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - extension: ElementName; - - /** - * @default process id - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - pid: number; - - /** - * @default user id - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - uid: number; - - /** - * @default the name of the process - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - processName: string; - - /** - * @default ability start time - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - startTime: number; - - /** - * @default All package names under the current process - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - clientPackage: Array; - - /** - * @default Enumerates types of the entension info - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - type: bundle.ExtensionAbilityType; +/* + * 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. + */ + +import { ElementName } from '../bundle/elementName'; +import bundle from '../@ohos.bundle'; + +/** + * The class of an extension running information. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + * @permission N/A + */ +export interface ExtensionRunningInfo { + /** + * @default Indicates the extension of the extension info + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + extension: ElementName; + + /** + * @default process id + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + pid: number; + + /** + * @default user id + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + uid: number; + + /** + * @default the name of the process + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + processName: string; + + /** + * @default ability start time + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + startTime: number; + + /** + * @default All package names under the current process + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + clientPackage: Array; + + /** + * @default Enumerates types of the entension info + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + type: bundle.ExtensionAbilityType; } \ No newline at end of file diff --git a/api/application/MissionListener.d.ts b/api/application/MissionListener.d.ts index b7416ce23e..07c409538a 100644 --- a/api/application/MissionListener.d.ts +++ b/api/application/MissionListener.d.ts @@ -1,78 +1,78 @@ -/* - * Copyright (c) 2021-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. - */ - -import image from "../@ohos.multimedia.image"; - -/** - * MissionListener registered by app. - * - * @name MissionListener - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @permission N/A - * @systemapi hide for inner use. - */ - export interface MissionListener { - /** - * Called by system when mission created. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @param mission Indicates the id of created mission. - * @return - - */ - onMissionCreated(mission: number): void; - - /** - * Called by system when mission destroyed. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @param mission Indicates the id of destroyed mission. - * @return - - */ - onMissionDestroyed(mission: number): void; - - /** - * Called by system when mission shapshot changed. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @param mission Indicates the id of the mission which the snapshot changes - * @return - - */ - onMissionSnapshotChanged(mission: number): void; - - /** - * Called by system when mission moved to fornt. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @param mission Indicates the id of the mission being moved to the foreground. - * @return - - */ - onMissionMovedToFront(mission: number): void; - - /** - * Called by system when mission icon has changed. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @param mission Indicates the id of the mission whose icon has changed. - * @param icon Indicates the icon of the mission whose icon has changed. - * @return - - */ - onMissionIconUpdated(mission: number, icon: image.PixelMap): void; +/* + * Copyright (c) 2021-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. + */ + +import image from "../@ohos.multimedia.image"; + +/** + * MissionListener registered by app. + * + * @name MissionListener + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @permission N/A + * @systemapi hide for inner use. + */ + export interface MissionListener { + /** + * Called by system when mission created. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param mission Indicates the id of created mission. + * @return - + */ + onMissionCreated(mission: number): void; + + /** + * Called by system when mission destroyed. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param mission Indicates the id of destroyed mission. + * @return - + */ + onMissionDestroyed(mission: number): void; + + /** + * Called by system when mission shapshot changed. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param mission Indicates the id of the mission which the snapshot changes + * @return - + */ + onMissionSnapshotChanged(mission: number): void; + + /** + * Called by system when mission moved to fornt. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param mission Indicates the id of the mission being moved to the foreground. + * @return - + */ + onMissionMovedToFront(mission: number): void; + + /** + * Called by system when mission icon has changed. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param mission Indicates the id of the mission whose icon has changed. + * @param icon Indicates the icon of the mission whose icon has changed. + * @return - + */ + onMissionIconUpdated(mission: number, icon: image.PixelMap): void; } \ No newline at end of file diff --git a/api/application/PermissionRequestResult.d.ts b/api/application/PermissionRequestResult.d.ts index e999115847..a3d8d6ae04 100755 --- a/api/application/PermissionRequestResult.d.ts +++ b/api/application/PermissionRequestResult.d.ts @@ -1,43 +1,43 @@ -/* - * 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. - */ - -/** - * The result of requestPermissionsFromUser with asynchronous callback. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A - * @StageModelOnly - */ -export default class PermissionRequestResult { - /** - * The permissions passed in by the user. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - */ - permissions: Array; - - /** - * The results for the corresponding request permissions. The value 0 indicates that a - * permission is granted, and the value -1 indicates not. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - */ - authResults: Array; +/* + * 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. + */ + +/** + * The result of requestPermissionsFromUser with asynchronous callback. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + * @StageModelOnly + */ +export default class PermissionRequestResult { + /** + * The permissions passed in by the user. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + permissions: Array; + + /** + * The results for the corresponding request permissions. The value 0 indicates that a + * permission is granted, and the value -1 indicates not. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + authResults: Array; } \ No newline at end of file diff --git a/api/application/ProcessRunningInfo.d.ts b/api/application/ProcessRunningInfo.d.ts index 2d489c1b14..3e1e689179 100644 --- a/api/application/ProcessRunningInfo.d.ts +++ b/api/application/ProcessRunningInfo.d.ts @@ -1,83 +1,83 @@ -/* - * 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. - */ - -/** - * The class of an process running information. - * - * @deprecated since 9 - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @permission N/A - */ -/** - * The class of an process running information. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A - */ -export interface ProcessRunningInfo { - /** - * @default process id - * @deprecated since 9 - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - */ - /** - * @default process id - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - */ - pid: number; - - /** - * @default user id - * @deprecated since 9 - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - */ - /** - * @default user id - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - */ - uid: number; - - /** - * @default the name of the process - * @deprecated since 9 - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - */ - /** - * @default the name of the process - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - */ - processName: string; - - /** - * @default an array of the bundleNames running in the process - * @deprecated since 9 - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - */ - /** - * @default an array of the bundleNames running in the process - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - */ - bundleNames: Array; +/* + * 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. + */ + +/** + * The class of an process running information. + * + * @deprecated since 9 + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @permission N/A + */ +/** + * The class of an process running information. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + */ +export interface ProcessRunningInfo { + /** + * @default process id + * @deprecated since 9 + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + /** + * @default process id + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + pid: number; + + /** + * @default user id + * @deprecated since 9 + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + /** + * @default user id + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + uid: number; + + /** + * @default the name of the process + * @deprecated since 9 + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + /** + * @default the name of the process + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + processName: string; + + /** + * @default an array of the bundleNames running in the process + * @deprecated since 9 + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + /** + * @default an array of the bundleNames running in the process + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + bundleNames: Array; } \ No newline at end of file diff --git a/api/bundle/PermissionDef.d.ts b/api/bundle/PermissionDef.d.ts index f47217e547..6be050d5d9 100644 --- a/api/bundle/PermissionDef.d.ts +++ b/api/bundle/PermissionDef.d.ts @@ -1,51 +1,51 @@ -/* - * 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. - */ - -/** - * @name Indicates the defined permission details in file config.json - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * @systemapi - */ - export interface PermissionDef { - /** - * @default Indicates the name of this permission - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - permissionName: string; - - /** - * @default Indicates the grant mode of this permission - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - grantMode: number; - - /** - * @default Indicates the labelId of this permission - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - labelId: number; - - /** - * @default Indicates the descriptionId of this permission - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - descriptionId: number; -} +/* + * 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. + */ + +/** + * @name Indicates the defined permission details in file config.json + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + * @systemapi + */ + export interface PermissionDef { + /** + * @default Indicates the name of this permission + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + permissionName: string; + + /** + * @default Indicates the grant mode of this permission + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + grantMode: number; + + /** + * @default Indicates the labelId of this permission + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + labelId: number; + + /** + * @default Indicates the descriptionId of this permission + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + descriptionId: number; +} diff --git a/api/bundle/abilityInfo.d.ts b/api/bundle/abilityInfo.d.ts index 7812efd172..b1ae1d907f 100644 --- a/api/bundle/abilityInfo.d.ts +++ b/api/bundle/abilityInfo.d.ts @@ -1,281 +1,281 @@ -/* - * 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. - */ - -import { ApplicationInfo } from './applicationInfo'; -import { CustomizeData } from './customizeData' -import { Metadata } from './metadata' -import bundle from './../@ohos.bundle'; - -/** - * @name Obtains configuration information about an ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - */ -export interface AbilityInfo { - /** - * @default Indicates the name of the bundle containing the ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly bundleName: string; - - /** - * @default Ability simplified class name - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly name: string; - - /** - * @default Indicates the label of the ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly label: string; - - /** - * @default Describes the ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly description: string; - - /** - * @default Indicates the icon of the ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly icon: string; - - /** - * @default Indicates the label id of the ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly labelId: number; - - /** - * @default Indicates the description id of the ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly descriptionId: number; - - /** - * @default Indicates the icon id of the ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly iconId: number; - - /** - * @default Indicates the name of the .hap package to which the capability belongs - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly moduleName: string; - - /** - * @default Process of ability, if user do not set it ,the value equal application process - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly process: string; - - /** - * @default Info about which ability is this nick point to - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @FAModelOnly - */ - readonly targetAbility: string; - - /** - * @default Indicates the background service addressing a specific usage scenario - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @FAModelOnly - */ - readonly backgroundModes: number; - - /** - * @default Indicates whether an ability can be called by other abilities - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly isVisible: boolean; - - /** - * @default Indicates whether the ability provides the embedded card capability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @FAModelOnly - */ - readonly formEnabled: boolean; - - /** - * @default Enumerates types of templates that can be used by an ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @FAModelOnly - */ - readonly type: bundle.AbilityType; - - /** - * @default Enumerates the subType of templates used by an ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @FAModelOnly - */ - readonly subType: bundle.AbilitySubType; - - /** - * @default Enumerates ability display orientations - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly orientation: bundle.DisplayOrientation; - - /** - * @default Enumerates ability launch modes - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly launchMode: bundle.LaunchMode; - - /** - * @default The permissions that others need to launch this ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly permissions: Array; - - /** - * @default The device types that this ability can run on - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly deviceTypes: Array; - - /** - * @default The device capability that this ability needs - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly deviceCapabilities: Array; - - /** - * @default Indicates the permission required for reading ability data - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @FAModelOnly - */ - readonly readPermission: string; - - /** - * @default Indicates the permission required for writing data to the ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @FAModelOnly - */ - readonly writePermission: string; - - /** - * @default Obtains configuration information about an application - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly applicationInfo: ApplicationInfo; - - /** - * @default Uri of ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @FAModelOnly - */ - readonly uri: string; - - /** - * @default Indicates the metadata of ability - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly metaData: Array; - - /** - * @default Indicates the metadata of ability - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * - */ - readonly metadata: Array; - - /** - * @default Indicates whether the ability is enabled - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly enabled: boolean; - - /** - * @default Indicates which window mode is supported - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly supportWindowMode: Array; - - /** - * @default Indicates maximum ratio of width over height of window under free window status. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly maxWindowRatio: number; - - /** - * @default Indicates minimum ratio of width over height of window under free window status. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly minWindowRatio: number; - - /** - * @default Indicates maximum width of window under free window status. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly maxWindowWidth: number; - - /** - * @default Indicates minimum width of window under free window status. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly minWindowWidth: number; - - /** - * @default Indicates maximum height of window under free window status. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly maxWindowHeight: number; - - /** - * @default Indicates minimum height of window under free window status. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly minWindowHeight: number; -} +/* + * 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. + */ + +import { ApplicationInfo } from './applicationInfo'; +import { CustomizeData } from './customizeData' +import { Metadata } from './metadata' +import bundle from './../@ohos.bundle'; + +/** + * @name Obtains configuration information about an ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + */ +export interface AbilityInfo { + /** + * @default Indicates the name of the bundle containing the ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly bundleName: string; + + /** + * @default Ability simplified class name + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly name: string; + + /** + * @default Indicates the label of the ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly label: string; + + /** + * @default Describes the ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly description: string; + + /** + * @default Indicates the icon of the ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly icon: string; + + /** + * @default Indicates the label id of the ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly labelId: number; + + /** + * @default Indicates the description id of the ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly descriptionId: number; + + /** + * @default Indicates the icon id of the ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly iconId: number; + + /** + * @default Indicates the name of the .hap package to which the capability belongs + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly moduleName: string; + + /** + * @default Process of ability, if user do not set it ,the value equal application process + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly process: string; + + /** + * @default Info about which ability is this nick point to + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + */ + readonly targetAbility: string; + + /** + * @default Indicates the background service addressing a specific usage scenario + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + */ + readonly backgroundModes: number; + + /** + * @default Indicates whether an ability can be called by other abilities + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly isVisible: boolean; + + /** + * @default Indicates whether the ability provides the embedded card capability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + */ + readonly formEnabled: boolean; + + /** + * @default Enumerates types of templates that can be used by an ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + */ + readonly type: bundle.AbilityType; + + /** + * @default Enumerates the subType of templates used by an ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + */ + readonly subType: bundle.AbilitySubType; + + /** + * @default Enumerates ability display orientations + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly orientation: bundle.DisplayOrientation; + + /** + * @default Enumerates ability launch modes + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly launchMode: bundle.LaunchMode; + + /** + * @default The permissions that others need to launch this ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly permissions: Array; + + /** + * @default The device types that this ability can run on + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly deviceTypes: Array; + + /** + * @default The device capability that this ability needs + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly deviceCapabilities: Array; + + /** + * @default Indicates the permission required for reading ability data + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + */ + readonly readPermission: string; + + /** + * @default Indicates the permission required for writing data to the ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + */ + readonly writePermission: string; + + /** + * @default Obtains configuration information about an application + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly applicationInfo: ApplicationInfo; + + /** + * @default Uri of ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + */ + readonly uri: string; + + /** + * @default Indicates the metadata of ability + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly metaData: Array; + + /** + * @default Indicates the metadata of ability + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + * + */ + readonly metadata: Array; + + /** + * @default Indicates whether the ability is enabled + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly enabled: boolean; + + /** + * @default Indicates which window mode is supported + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly supportWindowMode: Array; + + /** + * @default Indicates maximum ratio of width over height of window under free window status. + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly maxWindowRatio: number; + + /** + * @default Indicates minimum ratio of width over height of window under free window status. + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly minWindowRatio: number; + + /** + * @default Indicates maximum width of window under free window status. + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly maxWindowWidth: number; + + /** + * @default Indicates minimum width of window under free window status. + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly minWindowWidth: number; + + /** + * @default Indicates maximum height of window under free window status. + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly maxWindowHeight: number; + + /** + * @default Indicates minimum height of window under free window status. + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly minWindowHeight: number; +} diff --git a/api/bundle/applicationInfo.d.ts b/api/bundle/applicationInfo.d.ts index 909aefb1eb..9340a7b83e 100644 --- a/api/bundle/applicationInfo.d.ts +++ b/api/bundle/applicationInfo.d.ts @@ -1,188 +1,188 @@ -/* - * 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. - */ - -import { ModuleInfo } from './moduleInfo'; -import { CustomizeData } from './customizeData' -import { Metadata } from './metadata' - -/** - * @name Obtains configuration information about an application - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * - */ -export interface ApplicationInfo { - /** - * @default Indicates the application name, which is the same as {@code bundleName} - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly name: string; - - /** - * @default Description of application - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly description: string; - - /** - * @default Indicates the description id of the application - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly descriptionId: number; - - /** - * @default Indicates whether the application is a system application - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly systemApp: boolean; - - /** - * @default Indicates whether or not this application may be instantiated - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly enabled: boolean; - - /** - * @default Indicates the label of the application - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly label: string; - - /** - * @default Indicates the label id of the application - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly labelId: string; - - /** - * @default Indicates the icon of the application - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly icon: string; - - /** - * @default Indicates the icon id of the application - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly iconId: string; - - /** - * @default Process of application, if user do not set it ,the value equal bundleName - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly process: string; - - /** - * @default Indicates the running mode supported by the application - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly supportedModes: number; - - /** - * @default Indicates the path storing the module resources of the application - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly moduleSourceDirs: Array; - - /** - * @default Indicates the permissions required for accessing the application. - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly permissions: Array; - - /** - * @default Indicates module information about an application - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly moduleInfos: Array; - - /** - * @default Indicates the path where the {@code Entry.hap} file of the application is saved - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly entryDir: string; - - /** - * @default Indicates the application source code path - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly codePath: string; - - /** - * @default Indicates the metadata of module - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly metaData: Map>; - - /** - * @default Indicates the metadata of module - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly metadata: Map>; - - /** - * @default Indicates whether or not this application may be removable - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly removable: boolean; - - /** - * @default Indicates the access token of the application - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly accessTokenId: number; - - /** - * @default Indicates the uid of the application - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly uid: number; - - /** - * @default Indicates entity type of the application - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly entityType: string; - - /** - * @default Indicates fingerprint of the certificate - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly fingerprint: string; -} +/* + * 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. + */ + +import { ModuleInfo } from './moduleInfo'; +import { CustomizeData } from './customizeData' +import { Metadata } from './metadata' + +/** + * @name Obtains configuration information about an application + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + * + */ +export interface ApplicationInfo { + /** + * @default Indicates the application name, which is the same as {@code bundleName} + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly name: string; + + /** + * @default Description of application + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly description: string; + + /** + * @default Indicates the description id of the application + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly descriptionId: number; + + /** + * @default Indicates whether the application is a system application + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly systemApp: boolean; + + /** + * @default Indicates whether or not this application may be instantiated + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly enabled: boolean; + + /** + * @default Indicates the label of the application + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly label: string; + + /** + * @default Indicates the label id of the application + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly labelId: string; + + /** + * @default Indicates the icon of the application + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly icon: string; + + /** + * @default Indicates the icon id of the application + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly iconId: string; + + /** + * @default Process of application, if user do not set it ,the value equal bundleName + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly process: string; + + /** + * @default Indicates the running mode supported by the application + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly supportedModes: number; + + /** + * @default Indicates the path storing the module resources of the application + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly moduleSourceDirs: Array; + + /** + * @default Indicates the permissions required for accessing the application. + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly permissions: Array; + + /** + * @default Indicates module information about an application + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly moduleInfos: Array; + + /** + * @default Indicates the path where the {@code Entry.hap} file of the application is saved + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly entryDir: string; + + /** + * @default Indicates the application source code path + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly codePath: string; + + /** + * @default Indicates the metadata of module + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly metaData: Map>; + + /** + * @default Indicates the metadata of module + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly metadata: Map>; + + /** + * @default Indicates whether or not this application may be removable + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly removable: boolean; + + /** + * @default Indicates the access token of the application + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly accessTokenId: number; + + /** + * @default Indicates the uid of the application + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly uid: number; + + /** + * @default Indicates entity type of the application + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly entityType: string; + + /** + * @default Indicates fingerprint of the certificate + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly fingerprint: string; +} diff --git a/api/bundle/bundleInfo.d.ts b/api/bundle/bundleInfo.d.ts index 2f71c27b38..4da8310f43 100644 --- a/api/bundle/bundleInfo.d.ts +++ b/api/bundle/bundleInfo.d.ts @@ -1,259 +1,259 @@ -/* - * 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. - */ - -import { AbilityInfo } from './abilityInfo'; -import { ApplicationInfo } from './applicationInfo'; -import { ExtensionAbilityInfo } from './extensionAbilityInfo'; -import { HapModuleInfo } from './hapModuleInfo'; - -/** - * @name The scene which is used - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * - */ -export interface UsedScene { - /** - * @default Indicates the abilities that need the permission - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - abilities: Array; - - /** - * @default Indicates the time when the permission is used - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - when: string; -} - -/** - * @name Indicates the required permissions details defined in file config.json - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * - */ -export interface ReqPermissionDetail { - /** - * @default Indicates the name of this required permissions - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - name: string; - - /** - * @default Indicates the reason of this required permissions - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - reason: string; - - /** - * @default Indicates the reason id of this required permissions - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - reasonId: number; - - /** - * @default Indicates the used scene of this required permissions - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - usedScene: UsedScene; -} - -/** - * @name Obtains configuration information about a bundle - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * - */ -export interface BundleInfo { - /** - * @default Indicates the name of this bundle - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly name: string; - - /** - * @default Indicates the name of this original bundle - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly type: string; - - /** - * @default Indicates the ID of the application to which this bundle belongs - * The application ID uniquely identifies an application. It is determined by the bundle name and signature - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly appId: string; - - /** - * @default Indicates the UID of the application to which this bundle belongs - * The UID uniquely identifies an application. It is determined by the process and user IDs of the application - * After an application is installed, its UID remains unchanged unless it is uninstalled and then reinstalled - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly uid: number; - - /** - * @default Indicates the hap install time - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly installTime: number; - - /** - * @default Indicates the hap update time - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly updateTime: number; - - /** - * @default Obtains configuration information about an application - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly appInfo: ApplicationInfo; - - /** - * @default Obtains configuration information about an ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly abilityInfos: Array; - - /** - * @default Indicates the required permissions name defined in file config.json - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly reqPermissions: Array; - - /** - * @default Indicates the required permissions details defined in file config.json - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly reqPermissionDetails: Array; - - /** - * @default Describes the bundle vendor - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly vendor: string; - - /** - * @default Indicates the version number of the bundle - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly versionCode: number; - - /** - * @default Indicates the text description of the bundle version - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly versionName: string; - - /** - * @default Indicates the compatible version number of the bundle - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly compatibleVersion: number; - - /** - * @default Indicates the target version number of the bundle - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly targetVersion: number; - - /** - * @default Indicates is compress native libs - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly isCompressNativeLibs: boolean; - - /** - * @default Obtains configuration information about an module - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly hapModuleInfos: Array; - - /** - * @default Indicates entry module name - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly entryModuleName: string; - - /** - * @default Indicates the cpuAbi information of this bundle. - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly cpuAbi: string; - - /** - * @default Indicates is silent installation - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly isSilentInstallation: string; - - /** - * @default Indicates the earliest historical version compatible with the bundle - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly minCompatibleVersionCode: number; - - /** - * @default Indicates whether free installation of the entry is supported - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly entryInstallationFree: boolean; - - /** - * @default Indicates the grant status of required permissions - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly reqPermissionStates: Array; - - /** - * @default Obtains configuration information about an ability - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly extensionAbilityInfo: Array; -} +/* + * 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. + */ + +import { AbilityInfo } from './abilityInfo'; +import { ApplicationInfo } from './applicationInfo'; +import { ExtensionAbilityInfo } from './extensionAbilityInfo'; +import { HapModuleInfo } from './hapModuleInfo'; + +/** + * @name The scene which is used + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + * + */ +export interface UsedScene { + /** + * @default Indicates the abilities that need the permission + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + abilities: Array; + + /** + * @default Indicates the time when the permission is used + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + when: string; +} + +/** + * @name Indicates the required permissions details defined in file config.json + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + * + */ +export interface ReqPermissionDetail { + /** + * @default Indicates the name of this required permissions + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + name: string; + + /** + * @default Indicates the reason of this required permissions + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + reason: string; + + /** + * @default Indicates the reason id of this required permissions + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + reasonId: number; + + /** + * @default Indicates the used scene of this required permissions + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + usedScene: UsedScene; +} + +/** + * @name Obtains configuration information about a bundle + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + * + */ +export interface BundleInfo { + /** + * @default Indicates the name of this bundle + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly name: string; + + /** + * @default Indicates the name of this original bundle + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly type: string; + + /** + * @default Indicates the ID of the application to which this bundle belongs + * The application ID uniquely identifies an application. It is determined by the bundle name and signature + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly appId: string; + + /** + * @default Indicates the UID of the application to which this bundle belongs + * The UID uniquely identifies an application. It is determined by the process and user IDs of the application + * After an application is installed, its UID remains unchanged unless it is uninstalled and then reinstalled + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly uid: number; + + /** + * @default Indicates the hap install time + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly installTime: number; + + /** + * @default Indicates the hap update time + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly updateTime: number; + + /** + * @default Obtains configuration information about an application + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly appInfo: ApplicationInfo; + + /** + * @default Obtains configuration information about an ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly abilityInfos: Array; + + /** + * @default Indicates the required permissions name defined in file config.json + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly reqPermissions: Array; + + /** + * @default Indicates the required permissions details defined in file config.json + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly reqPermissionDetails: Array; + + /** + * @default Describes the bundle vendor + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly vendor: string; + + /** + * @default Indicates the version number of the bundle + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly versionCode: number; + + /** + * @default Indicates the text description of the bundle version + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly versionName: string; + + /** + * @default Indicates the compatible version number of the bundle + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly compatibleVersion: number; + + /** + * @default Indicates the target version number of the bundle + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly targetVersion: number; + + /** + * @default Indicates is compress native libs + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly isCompressNativeLibs: boolean; + + /** + * @default Obtains configuration information about an module + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly hapModuleInfos: Array; + + /** + * @default Indicates entry module name + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly entryModuleName: string; + + /** + * @default Indicates the cpuAbi information of this bundle. + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly cpuAbi: string; + + /** + * @default Indicates is silent installation + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly isSilentInstallation: string; + + /** + * @default Indicates the earliest historical version compatible with the bundle + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly minCompatibleVersionCode: number; + + /** + * @default Indicates whether free installation of the entry is supported + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly entryInstallationFree: boolean; + + /** + * @default Indicates the grant status of required permissions + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly reqPermissionStates: Array; + + /** + * @default Obtains configuration information about an ability + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly extensionAbilityInfo: Array; +} diff --git a/api/bundle/bundleInstaller.d.ts b/api/bundle/bundleInstaller.d.ts index bdebfff218..cc45ed47ee 100644 --- a/api/bundle/bundleInstaller.d.ts +++ b/api/bundle/bundleInstaller.d.ts @@ -1,151 +1,151 @@ -/* - * 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. - */ - -import { AsyncCallback } from './../basic'; -import bundle from './../@ohos.bundle'; - -/** - * @name Provides parameters required for hashParam. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * @systemapi Hide this for inner system use - */ - export interface HashParam { - /** - * @default Indicates the moduleName - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - moduleName: string; - - /** - * @default Indicates the hash value - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - hashValue: string; -} - -/** - * @name Provides parameters required for installing or uninstalling an application. - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * @systemapi Hide this for inner system use - */ -export interface InstallParam { - /** - * @default Indicates the user id - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - userId: number; - - /** - * @default Indicates the install flag - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - installFlag: number; - - /** - * @default Indicates whether the param has data - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - isKeepData: boolean; - - /** - * @default Indicates the hash params - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - hashParams?: Array; -} - -/** - * @name Indicates the install or uninstall status - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * @systemapi Hide this for inner system use - */ -export interface InstallStatus { - - /** - * @default Indicates the install or uninstall error code - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - status: bundle.InstallErrorCode; - - /** - * @default Indicates the install or uninstall result string message - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - statusMessage: string; -} - -/** - * @name Offers install, upgrade, and remove bundles on the devices. - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * @systemapi Hide this for inner system use - */ -export interface BundleInstaller { - /** - * Install an application in a HAP. - * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * - * @param bundleFilePaths Indicates the path where the bundle of the application is stored. The path should be the - * relative path to the data directory of the current application. - * @param installParam Indicates other parameters required for the installation. - * @return InstallStatus - * @permission ohos.permission.INSTALL_BUNDLE - */ - install(bundleFilePaths: Array, param: InstallParam, callback: AsyncCallback): void; - - /** - * Uninstall an application. - * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * - * @param bundleName Indicates the bundle name of the application to be uninstalled. - * @param installParam Indicates other parameters required for the uninstallation. - * @return InstallStatus - * @permission ohos.permission.INSTALL_BUNDLE - */ - uninstall(bundleName: string, param: InstallParam, callback: AsyncCallback): void; - - /** - * recover an application. - * - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - * - * @param bundleName Indicates the bundle name of the application to be recovered. - * @param installParam Indicates other parameters required for the recover. - * @return InstallStatus - * @permission ohos.permission.INSTALL_BUNDLE - * @systemapi Hide this for inner system use - */ - recover(bundleName: string, param: InstallParam, callback: AsyncCallback): void; +/* + * 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. + */ + +import { AsyncCallback } from './../basic'; +import bundle from './../@ohos.bundle'; + +/** + * @name Provides parameters required for hashParam. + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + * @systemapi Hide this for inner system use + */ + export interface HashParam { + /** + * @default Indicates the moduleName + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + moduleName: string; + + /** + * @default Indicates the hash value + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + hashValue: string; +} + +/** + * @name Provides parameters required for installing or uninstalling an application. + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + * @systemapi Hide this for inner system use + */ +export interface InstallParam { + /** + * @default Indicates the user id + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + userId: number; + + /** + * @default Indicates the install flag + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + installFlag: number; + + /** + * @default Indicates whether the param has data + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + isKeepData: boolean; + + /** + * @default Indicates the hash params + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + hashParams?: Array; +} + +/** + * @name Indicates the install or uninstall status + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + * @systemapi Hide this for inner system use + */ +export interface InstallStatus { + + /** + * @default Indicates the install or uninstall error code + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + status: bundle.InstallErrorCode; + + /** + * @default Indicates the install or uninstall result string message + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + statusMessage: string; +} + +/** + * @name Offers install, upgrade, and remove bundles on the devices. + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + * @systemapi Hide this for inner system use + */ +export interface BundleInstaller { + /** + * Install an application in a HAP. + * + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * + * @param bundleFilePaths Indicates the path where the bundle of the application is stored. The path should be the + * relative path to the data directory of the current application. + * @param installParam Indicates other parameters required for the installation. + * @return InstallStatus + * @permission ohos.permission.INSTALL_BUNDLE + */ + install(bundleFilePaths: Array, param: InstallParam, callback: AsyncCallback): void; + + /** + * Uninstall an application. + * + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * + * @param bundleName Indicates the bundle name of the application to be uninstalled. + * @param installParam Indicates other parameters required for the uninstallation. + * @return InstallStatus + * @permission ohos.permission.INSTALL_BUNDLE + */ + uninstall(bundleName: string, param: InstallParam, callback: AsyncCallback): void; + + /** + * recover an application. + * + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + * + * @param bundleName Indicates the bundle name of the application to be recovered. + * @param installParam Indicates other parameters required for the recover. + * @return InstallStatus + * @permission ohos.permission.INSTALL_BUNDLE + * @systemapi Hide this for inner system use + */ + recover(bundleName: string, param: InstallParam, callback: AsyncCallback): void; } \ No newline at end of file diff --git a/api/bundle/customizeData.d.ts b/api/bundle/customizeData.d.ts index 62cb31ea94..4427daf061 100644 --- a/api/bundle/customizeData.d.ts +++ b/api/bundle/customizeData.d.ts @@ -1,44 +1,44 @@ -/* - * 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. - */ - - /** - * @name Indicates the custom metadata - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * - */ - export interface CustomizeData { - /** - * @default Indicates the custom metadata name - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - name: string; - - /** - * @default Indicates the custom metadata value - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - value: string; - - /** - * @default Indicates the custom metadata resource - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - extra: string; +/* + * 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. + */ + + /** + * @name Indicates the custom metadata + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + * + */ + export interface CustomizeData { + /** + * @default Indicates the custom metadata name + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + name: string; + + /** + * @default Indicates the custom metadata value + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + value: string; + + /** + * @default Indicates the custom metadata resource + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + extra: string; } \ No newline at end of file diff --git a/api/bundle/elementName.d.ts b/api/bundle/elementName.d.ts index 92f4628f8c..3eeff9218e 100644 --- a/api/bundle/elementName.d.ts +++ b/api/bundle/elementName.d.ts @@ -1,80 +1,80 @@ -/* - * Copyright (c) 2021-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. - */ - -/** - * Contains basic Ability information, which uniquely identifies an ability. - * You can use this class to obtain values of the fields set in an element, - * such as the device ID, bundle name, and ability name. - * @name Contains basic Ability information, which uniquely identifies an ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * - * @permission N/A - */ - export interface ElementName { - /** - * device id - * @default - - * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - deviceId?: string; - - /** - * bundle name - * @default - - * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - bundleName: string; - - /** - * ability name - * @default ability class name. - * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - abilityName: string; - - /** - * uri - * @default - - * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - uri?: string; - - /** - * shortName - * @default - - * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - shortName?: string; - - /** - * module name - * @default - - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - moduleName?: string; -} +/* + * Copyright (c) 2021-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. + */ + +/** + * Contains basic Ability information, which uniquely identifies an ability. + * You can use this class to obtain values of the fields set in an element, + * such as the device ID, bundle name, and ability name. + * @name Contains basic Ability information, which uniquely identifies an ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * + * @permission N/A + */ + export interface ElementName { + /** + * device id + * @default - + * + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + deviceId?: string; + + /** + * bundle name + * @default - + * + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + bundleName: string; + + /** + * ability name + * @default ability class name. + * + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + abilityName: string; + + /** + * uri + * @default - + * + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + uri?: string; + + /** + * shortName + * @default - + * + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + shortName?: string; + + /** + * module name + * @default - + * + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + moduleName?: string; +} diff --git a/api/bundle/hapModuleInfo.d.ts b/api/bundle/hapModuleInfo.d.ts index 26c930161c..5ed5be922e 100644 --- a/api/bundle/hapModuleInfo.d.ts +++ b/api/bundle/hapModuleInfo.d.ts @@ -1,145 +1,145 @@ -/* - * 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. - */ - -import { AbilityInfo } from "./abilityInfo"; -import { ExtensionAbilityInfo } from "./extensionAbilityInfo"; -import { Metadata } from './metadata' - -/** - * @name Obtains configuration information about an module. - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * - */ -export interface HapModuleInfo { - /** - * @default Indicates the name of this hapmodule - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly name: string; - /** - * @default Describes the hapmodule - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly description: string; - /** - * @default Indicates the description of this hapmodule - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly descriptionId: number; - /** - * @default Indicates the icon of this hapmodule - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly icon: string; - /** - * @default Indicates the label of this hapmodule - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly label: string; - /** - * @default Indicates the label id of this hapmodule - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly labelId: number; - /** - * @default Indicates the icon id of this hapmodule - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly iconId: number; - /** - * @default Indicates the background img of this hapmodule - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly backgroundImg: string; - /** - * @default Indicates the supported modes of this hapmodule - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly supportedModes: number; - /** - * @default Indicates the req capabilities of this hapmodule - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly reqCapabilities: Array; - /** - * @default The device types that this hapmodule can run on - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly deviceTypes: Array; - /** - * @default Obtains configuration information about ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly abilityInfo: Array; - /** - * @default Indicates the name of the .hap package to which the capability belongs - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly moduleName: string; - /** - * @default Indicates the main ability name of this hapmodule - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly mainAbilityName: string; - /** - * @default Indicates whether free installation of the hapmodule is supported - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly installationFree: boolean; - - /** - * @default Indicates main elementName of the module - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly mainElementName: string; - - /** - * @default Obtains configuration information about extension ability - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly extensionAbilityInfo: Array; - /** - * @default Indicates the metadata of ability - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * - */ - readonly metadata: Array; - /** - * @default Indicates the hash value of the module - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly hashValue: string; +/* + * 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. + */ + +import { AbilityInfo } from "./abilityInfo"; +import { ExtensionAbilityInfo } from "./extensionAbilityInfo"; +import { Metadata } from './metadata' + +/** + * @name Obtains configuration information about an module. + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + * + */ +export interface HapModuleInfo { + /** + * @default Indicates the name of this hapmodule + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly name: string; + /** + * @default Describes the hapmodule + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly description: string; + /** + * @default Indicates the description of this hapmodule + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly descriptionId: number; + /** + * @default Indicates the icon of this hapmodule + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly icon: string; + /** + * @default Indicates the label of this hapmodule + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly label: string; + /** + * @default Indicates the label id of this hapmodule + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly labelId: number; + /** + * @default Indicates the icon id of this hapmodule + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly iconId: number; + /** + * @default Indicates the background img of this hapmodule + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly backgroundImg: string; + /** + * @default Indicates the supported modes of this hapmodule + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly supportedModes: number; + /** + * @default Indicates the req capabilities of this hapmodule + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly reqCapabilities: Array; + /** + * @default The device types that this hapmodule can run on + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly deviceTypes: Array; + /** + * @default Obtains configuration information about ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly abilityInfo: Array; + /** + * @default Indicates the name of the .hap package to which the capability belongs + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly moduleName: string; + /** + * @default Indicates the main ability name of this hapmodule + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly mainAbilityName: string; + /** + * @default Indicates whether free installation of the hapmodule is supported + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly installationFree: boolean; + + /** + * @default Indicates main elementName of the module + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly mainElementName: string; + + /** + * @default Obtains configuration information about extension ability + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly extensionAbilityInfo: Array; + /** + * @default Indicates the metadata of ability + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + * + */ + readonly metadata: Array; + /** + * @default Indicates the hash value of the module + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly hashValue: string; } \ No newline at end of file diff --git a/api/bundle/moduleInfo.d.ts b/api/bundle/moduleInfo.d.ts index 434eacc5dc..f961a10b9d 100644 --- a/api/bundle/moduleInfo.d.ts +++ b/api/bundle/moduleInfo.d.ts @@ -1,43 +1,43 @@ -/* - * 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. - */ - -/** - * @name Stores module information about an application. - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * - */ - export interface ModuleInfo { - /** - * The module name. - * - * @default Indicates the name of the .hap package to which the capability belongs - * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly moduleName: string; - - /** - * The module source path. - * - * @default Indicates the module source dir of this module - * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly moduleSourceDir: string; +/* + * 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. + */ + +/** + * @name Stores module information about an application. + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + * + */ + export interface ModuleInfo { + /** + * The module name. + * + * @default Indicates the name of the .hap package to which the capability belongs + * + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly moduleName: string; + + /** + * The module source path. + * + * @default Indicates the module source dir of this module + * + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly moduleSourceDir: string; } \ No newline at end of file diff --git a/api/bundle/shortcutInfo.d.ts b/api/bundle/shortcutInfo.d.ts index 78d78ce8d9..fbcc1baadd 100644 --- a/api/bundle/shortcutInfo.d.ts +++ b/api/bundle/shortcutInfo.d.ts @@ -1,119 +1,119 @@ -/* - * 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. - */ - - /** - * @name Provides methods for obtaining information about the ability that a shortcut will start, including the target - * bundle name and ability class name. - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * @systemapi Hide this for inner system use - */ - export interface ShortcutWant{ - /** - * @default Indicates the target bundle of the shortcut want - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly targetBundle: string; - /** - * @default Indicates the target class of the shortcut want - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly targetClass: string; - } - - /** - * @name Provides information about a shortcut, including the shortcut ID and label. - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * - */ - export interface ShortcutInfo { - /** - * @default Indicates the ID of the application to which this shortcut belongs - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly id: string; - /** - * @default Indicates the name of the bundle containing the shortcut - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly bundleName: string; - /** - * @default Indicates the host ability of the shortcut - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly hostAbility: string; - /** - * @default Indicates the icon of the shortcut - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly icon: string; - /** - * @default Indicate s the icon id of the shortcut - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly iconId: number; - /** - * @default Indicates the label of the shortcut - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly label: string; - /** - * @default Indicates the label id of the shortcut - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly labelId: number; - /** - * @default Indicates the disableMessage of the shortcut - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly disableMessage: string; - /** - * @default Indicates the wants of the shortcut - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly wants: Array; - /** - * @default Indicates whether the shortcut is static - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly isStatic?: boolean - /** - * @default Indicates whether the shortcut is homeshortcut - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly isHomeShortcut?: boolean; - /** - * @default Indicates whether the shortcut is enabled - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly isEnabled?: boolean; +/* + * 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. + */ + + /** + * @name Provides methods for obtaining information about the ability that a shortcut will start, including the target + * bundle name and ability class name. + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + * @systemapi Hide this for inner system use + */ + export interface ShortcutWant{ + /** + * @default Indicates the target bundle of the shortcut want + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly targetBundle: string; + /** + * @default Indicates the target class of the shortcut want + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly targetClass: string; + } + + /** + * @name Provides information about a shortcut, including the shortcut ID and label. + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + * + */ + export interface ShortcutInfo { + /** + * @default Indicates the ID of the application to which this shortcut belongs + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly id: string; + /** + * @default Indicates the name of the bundle containing the shortcut + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly bundleName: string; + /** + * @default Indicates the host ability of the shortcut + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly hostAbility: string; + /** + * @default Indicates the icon of the shortcut + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly icon: string; + /** + * @default Indicate s the icon id of the shortcut + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly iconId: number; + /** + * @default Indicates the label of the shortcut + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly label: string; + /** + * @default Indicates the label id of the shortcut + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly labelId: number; + /** + * @default Indicates the disableMessage of the shortcut + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly disableMessage: string; + /** + * @default Indicates the wants of the shortcut + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly wants: Array; + /** + * @default Indicates whether the shortcut is static + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly isStatic?: boolean + /** + * @default Indicates whether the shortcut is homeshortcut + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly isHomeShortcut?: boolean; + /** + * @default Indicates whether the shortcut is enabled + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly isEnabled?: boolean; } \ No newline at end of file diff --git a/api/common/full/dom.d.ts b/api/common/full/dom.d.ts index 39f358f314..2efda42009 100644 --- a/api/common/full/dom.d.ts +++ b/api/common/full/dom.d.ts @@ -1,29 +1,29 @@ -/* - * Copyright (c) 2020 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 { Element } from './viewmodel'; - -/** - * global dom - * @since 8 - */ -export declare class dom { - /** - * create a dynamic dom by tag, rturn element - * @param tag dom tag - * @since 8 - */ - static createElement(tag: string): Element -} +/* + * Copyright (c) 2020 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 { Element } from './viewmodel'; + +/** + * global dom + * @since 8 + */ +export declare class dom { + /** + * create a dynamic dom by tag, rturn element + * @param tag dom tag + * @since 8 + */ + static createElement(tag: string): Element +} diff --git a/api/common/full/featureability.d.ts b/api/common/full/featureability.d.ts index e37966a993..bc825a0587 100644 --- a/api/common/full/featureability.d.ts +++ b/api/common/full/featureability.d.ts @@ -1,399 +1,399 @@ -/* - * Copyright (c) 2020 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. - */ - -/** - * @since 5 - * @deprecated since 8 - */ -export interface Result { - /** - * Result code. - * @since 5 - */ - code: number; - - /** - * Returned data. - * @since 5 - */ - data: object; -} - -/** - * @since 5 - * @systemapi - * @deprecated since 8 - */ -export interface SubscribeMessageResponse { - /** - * Peer device ID. - * @since 5 - */ - deviceId: string; - - /** - * Name of the bundle where the peer ability locates. The name is case sensitive. - * @since 5 - */ - bundleName: string; - - /** - * Peer ability name, which is case sensitive. - * @since 5 - */ - abilityName: string; - - /** - * Messages received from the device. - * @since 5 - */ - message: string; -} - -/** - * @since 5 - * @deprecated since 8 - */ -export interface CallAbilityParam { - /** - * Name of the bundle where the ability locates. The name is case sensitive and must be the same as that on the AA side. - * @since 5 - */ - bundleName: string; - - /** - * Ability name, which is case sensitive and must be the same as that on the AA side. - * @since 5 - */ - abilityName: string; - - /** - * Ability operation code, which defines the service function of an AA and must be consistent with the AA side. - * @since 5 - */ - messageCode: number; - - /** - * Ability type. Different types of abilities have different implementation on the AA side. - * 0: Ability, which has an independent lifecycle. The FA starts and requests an AA through an RPC. Such type of abilities are used to provide basic services for multiple FAs to call or are used when the abilities should run in the background. - * 1: Internal ability, which shares the same process with the FA and communicates with it by calling internal functions. Such type of abilities are used in scenarios that require low response latency and cannot be called by other FAs. - * @since 5 - */ - abilityType: number; - - /** - * Data sent to the ability. The data to carry differs depending on the service to be processed and its field name must be consistent with the AA side. - * @since 5 - */ - data?: object; - - /** - * Whether the request is synchronous or asynchronous. The synchronous mode is used by default. Currently, the asynchronous mode is available only for internal abilities. - * 0: Synchronous mode (default value) - * 1: Asynchronous mode - * @since 5 - */ - syncOption?: number; -} - -/** - * @since 5 - * @deprecated since 8 - */ -export interface SubscribeAbilityEventParam { - /** - * Name of the bundle where the ability locates. The name is case sensitive and must be the same as that on the AA side. - * @since 5 - */ - bundleName: string; - - /** - * Ability name, which is case sensitive and must be the same as that on the AA side. - * @since 5 - */ - abilityName: string; - - /** - * Ability operation code, which defines the service function of an AA and must be consistent with the AA side. - * @since 5 - */ - messageCode: number; - - /** - * Ability type. Different types of abilities have different implementation on the AA side. - * 0: Ability, which has an independent lifecycle. The FA starts and requests an AA through an RPC. Such type of abilities are used to provide basic services for multiple FAs to call or are used when the abilities should run in the background. - * 1: Internal ability, which shares the same process with the FA and communicates with it by calling internal functions. Such type of abilities are used in scenarios that require low response latency and cannot be called by other FAs. - * @since 5 - */ - abilityType: number; - - /** - * Whether the request is synchronous or asynchronous. The synchronous mode is used by default. Currently, the asynchronous mode is available only for internal abilities. - * 0: Synchronous mode (default value) - * 1: Asynchronous mode - * @since 5 - */ - syncOption?: number; -} - -/** - * @since 5 - * @systemapi - * @deprecated since 8 - */ -export interface SendMessageOptions { - /** - * Destination device ID. - * @since 5 - */ - deviceId: string; - - /** - * Name of the destination bundle where the ability locates. The name is case sensitive. - * @since 5 - */ - bundleName: string; - - /** - * Destination ability name, which is case sensitive. - * @since 5 - */ - abilityName: string; - - /** - * Messages sent to the destination device. - * A maximum of 1 KB of data can be transmitted at a time. - * If more than 1 KB of data needs to be transmitted, split the messages into multiple parts to transmit. - * @since 5 - */ - message?: string; - - /** - * Called when the messages are sent successfully. - * @since 5 - */ - success?: () => void; - - /** - * Called when the messages fail to be sent. - * @since 5 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 5 - */ - complete?: () => void; -} - -/** - * @since 5 - * @systemapi - * @deprecated since 8 - */ -export interface SubscribeMessageOptions { - /** - * Called when the messages are sent successfully. - * @since 5 - */ - success?: (data: SubscribeMessageResponse) => void; - - /** - * Called when the messages fail to be sent. - * @since 5 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @since 5 - * @deprecated since 8 - */ -export interface RequestParams { - /** - * The name of the bundle to start. It should be used with abilityname and case sensitive. - * @since 5 - */ - bundleName?: string; - - /** - * Ability name, which is case sensitive. - * @since 5 - */ - abilityName?: string; - - /** - * The list of entities to which the FA to be called. If it is not filled in, all entity lists will be found by default. It should be used with action. - * @since 5 - */ - entities?: Array; - - /** - * Without specifying the bundle name and ability name, you can start the application according to other properties with action. - * @since 5 - */ - action?: string; - - /** - * If more than one FA meets the conditions, the user can select the device from the popup. - * 0: Default. Select the FA to start from the local and remote devices. - * 1: start FA from the local device. - * @since 5 - */ - deviceType?: number; - - /** - * Data sent to the ability which need to be serializable. - * @since 5 - */ - data?: object; - - /** - * Configuration switch when start FA. - * @since 5 - */ - flag?: number; - - /** - * Specify the url of the page which the FA to be called. Use home page directly by default. - * @since 5 - */ - url?: string; -} - -/** - * @since 5 - * @deprecated since 8 - */ -export interface FinishWithResultParams { - /** - * Result code. - * @since 5 - */ - code: number; - - /** - * Returned data. - * @since 5 - */ - result: object; -} - -/** - * @since 5 - * @deprecated since 8 - */ -export declare class FeatureAbility { - /** - * Start a FA without callback result. - * @param request Indicates the request param. - * @returns A Promise object is returned, which contains the result of whether to call Ability's interface successfully. - * @since 5 - * @deprecated since 8 - */ - static startAbility(request: RequestParams): Promise; - - /** - * Start a FA with callback result. - * @param request Indicates the request param. - * @returns A Promise object is returned, which contains the result of the data FA returned. - * @since 5 - * @deprecated since 8 - */ - static startAbilityForResult(request: RequestParams): Promise; - - /** - * FA call the interface to destory itself and set the result as parameters. - * @param request Indicates the request param. - * @returns A Promise object is returned, which contains the result whether to callback successfully. - * @since 5 - * @deprecated since 8 - */ - static finishWithResult(param: FinishWithResultParams): Promise; - - /** - - * Get device information list. - * @param flag Default 0, get the information list of all devices in the network. - * @returns A Promise object is returned, which contains the result whether the device information list is obtained successfully. - * @since 5 - * @deprecated since 8 - */ - static getDeviceList(flag: number): Promise; - - /** - - * Calls an AA. - * @param param Indicates the request param. - * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. - * @since 5 - * @deprecated since 8 - */ - static callAbility(param: CallAbilityParam): Promise; - - /** - * Start FA migration. - * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. - * @since 5 - * @deprecated since 8 - */ - static continueAbility(): Promise; - - /** - * Subscribes to events of an AA. - * @param param Indicates the request param. - * @param func Indicates the event reporting callback. - * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. - * @since 5 - * @deprecated since 8 - */ - static subscribeAbilityEvent(param: SubscribeAbilityEventParam, func: Function): Promise; - - /** - * Unsubscribes from events of an AA. - * @param param Indicates the request param. - * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. - * @since 5 - * @deprecated since 8 - */ - static unsubscribeAbilityEvent(param: SubscribeAbilityEventParam): Promise; - - /** - * Sends messages to the destination device. - * @param options Options. - * @since 5 - * @systemapi - * @deprecated since 8 - */ - static sendMsg(options: SendMessageOptions): void; - - /** - * Listens for messages sent from other devices. - * @param options Options. - * @since 5 - * @systemapi - * @deprecated since 8 - */ - static subscribeMsg(options: SubscribeMessageOptions): void; - - /** - * Cancels the listening for messages sent from other devices. - * @since 5 - * @systemapi - * @deprecated since 8 - */ - static unsubscribeMsg(): void; -} +/* + * Copyright (c) 2020 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. + */ + +/** + * @since 5 + * @deprecated since 8 + */ +export interface Result { + /** + * Result code. + * @since 5 + */ + code: number; + + /** + * Returned data. + * @since 5 + */ + data: object; +} + +/** + * @since 5 + * @systemapi + * @deprecated since 8 + */ +export interface SubscribeMessageResponse { + /** + * Peer device ID. + * @since 5 + */ + deviceId: string; + + /** + * Name of the bundle where the peer ability locates. The name is case sensitive. + * @since 5 + */ + bundleName: string; + + /** + * Peer ability name, which is case sensitive. + * @since 5 + */ + abilityName: string; + + /** + * Messages received from the device. + * @since 5 + */ + message: string; +} + +/** + * @since 5 + * @deprecated since 8 + */ +export interface CallAbilityParam { + /** + * Name of the bundle where the ability locates. The name is case sensitive and must be the same as that on the AA side. + * @since 5 + */ + bundleName: string; + + /** + * Ability name, which is case sensitive and must be the same as that on the AA side. + * @since 5 + */ + abilityName: string; + + /** + * Ability operation code, which defines the service function of an AA and must be consistent with the AA side. + * @since 5 + */ + messageCode: number; + + /** + * Ability type. Different types of abilities have different implementation on the AA side. + * 0: Ability, which has an independent lifecycle. The FA starts and requests an AA through an RPC. Such type of abilities are used to provide basic services for multiple FAs to call or are used when the abilities should run in the background. + * 1: Internal ability, which shares the same process with the FA and communicates with it by calling internal functions. Such type of abilities are used in scenarios that require low response latency and cannot be called by other FAs. + * @since 5 + */ + abilityType: number; + + /** + * Data sent to the ability. The data to carry differs depending on the service to be processed and its field name must be consistent with the AA side. + * @since 5 + */ + data?: object; + + /** + * Whether the request is synchronous or asynchronous. The synchronous mode is used by default. Currently, the asynchronous mode is available only for internal abilities. + * 0: Synchronous mode (default value) + * 1: Asynchronous mode + * @since 5 + */ + syncOption?: number; +} + +/** + * @since 5 + * @deprecated since 8 + */ +export interface SubscribeAbilityEventParam { + /** + * Name of the bundle where the ability locates. The name is case sensitive and must be the same as that on the AA side. + * @since 5 + */ + bundleName: string; + + /** + * Ability name, which is case sensitive and must be the same as that on the AA side. + * @since 5 + */ + abilityName: string; + + /** + * Ability operation code, which defines the service function of an AA and must be consistent with the AA side. + * @since 5 + */ + messageCode: number; + + /** + * Ability type. Different types of abilities have different implementation on the AA side. + * 0: Ability, which has an independent lifecycle. The FA starts and requests an AA through an RPC. Such type of abilities are used to provide basic services for multiple FAs to call or are used when the abilities should run in the background. + * 1: Internal ability, which shares the same process with the FA and communicates with it by calling internal functions. Such type of abilities are used in scenarios that require low response latency and cannot be called by other FAs. + * @since 5 + */ + abilityType: number; + + /** + * Whether the request is synchronous or asynchronous. The synchronous mode is used by default. Currently, the asynchronous mode is available only for internal abilities. + * 0: Synchronous mode (default value) + * 1: Asynchronous mode + * @since 5 + */ + syncOption?: number; +} + +/** + * @since 5 + * @systemapi + * @deprecated since 8 + */ +export interface SendMessageOptions { + /** + * Destination device ID. + * @since 5 + */ + deviceId: string; + + /** + * Name of the destination bundle where the ability locates. The name is case sensitive. + * @since 5 + */ + bundleName: string; + + /** + * Destination ability name, which is case sensitive. + * @since 5 + */ + abilityName: string; + + /** + * Messages sent to the destination device. + * A maximum of 1 KB of data can be transmitted at a time. + * If more than 1 KB of data needs to be transmitted, split the messages into multiple parts to transmit. + * @since 5 + */ + message?: string; + + /** + * Called when the messages are sent successfully. + * @since 5 + */ + success?: () => void; + + /** + * Called when the messages fail to be sent. + * @since 5 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 5 + */ + complete?: () => void; +} + +/** + * @since 5 + * @systemapi + * @deprecated since 8 + */ +export interface SubscribeMessageOptions { + /** + * Called when the messages are sent successfully. + * @since 5 + */ + success?: (data: SubscribeMessageResponse) => void; + + /** + * Called when the messages fail to be sent. + * @since 5 + */ + fail?: (data: string, code: number) => void; +} + +/** + * @since 5 + * @deprecated since 8 + */ +export interface RequestParams { + /** + * The name of the bundle to start. It should be used with abilityname and case sensitive. + * @since 5 + */ + bundleName?: string; + + /** + * Ability name, which is case sensitive. + * @since 5 + */ + abilityName?: string; + + /** + * The list of entities to which the FA to be called. If it is not filled in, all entity lists will be found by default. It should be used with action. + * @since 5 + */ + entities?: Array; + + /** + * Without specifying the bundle name and ability name, you can start the application according to other properties with action. + * @since 5 + */ + action?: string; + + /** + * If more than one FA meets the conditions, the user can select the device from the popup. + * 0: Default. Select the FA to start from the local and remote devices. + * 1: start FA from the local device. + * @since 5 + */ + deviceType?: number; + + /** + * Data sent to the ability which need to be serializable. + * @since 5 + */ + data?: object; + + /** + * Configuration switch when start FA. + * @since 5 + */ + flag?: number; + + /** + * Specify the url of the page which the FA to be called. Use home page directly by default. + * @since 5 + */ + url?: string; +} + +/** + * @since 5 + * @deprecated since 8 + */ +export interface FinishWithResultParams { + /** + * Result code. + * @since 5 + */ + code: number; + + /** + * Returned data. + * @since 5 + */ + result: object; +} + +/** + * @since 5 + * @deprecated since 8 + */ +export declare class FeatureAbility { + /** + * Start a FA without callback result. + * @param request Indicates the request param. + * @returns A Promise object is returned, which contains the result of whether to call Ability's interface successfully. + * @since 5 + * @deprecated since 8 + */ + static startAbility(request: RequestParams): Promise; + + /** + * Start a FA with callback result. + * @param request Indicates the request param. + * @returns A Promise object is returned, which contains the result of the data FA returned. + * @since 5 + * @deprecated since 8 + */ + static startAbilityForResult(request: RequestParams): Promise; + + /** + * FA call the interface to destory itself and set the result as parameters. + * @param request Indicates the request param. + * @returns A Promise object is returned, which contains the result whether to callback successfully. + * @since 5 + * @deprecated since 8 + */ + static finishWithResult(param: FinishWithResultParams): Promise; + + /** + + * Get device information list. + * @param flag Default 0, get the information list of all devices in the network. + * @returns A Promise object is returned, which contains the result whether the device information list is obtained successfully. + * @since 5 + * @deprecated since 8 + */ + static getDeviceList(flag: number): Promise; + + /** + + * Calls an AA. + * @param param Indicates the request param. + * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. + * @since 5 + * @deprecated since 8 + */ + static callAbility(param: CallAbilityParam): Promise; + + /** + * Start FA migration. + * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. + * @since 5 + * @deprecated since 8 + */ + static continueAbility(): Promise; + + /** + * Subscribes to events of an AA. + * @param param Indicates the request param. + * @param func Indicates the event reporting callback. + * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. + * @since 5 + * @deprecated since 8 + */ + static subscribeAbilityEvent(param: SubscribeAbilityEventParam, func: Function): Promise; + + /** + * Unsubscribes from events of an AA. + * @param param Indicates the request param. + * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. + * @since 5 + * @deprecated since 8 + */ + static unsubscribeAbilityEvent(param: SubscribeAbilityEventParam): Promise; + + /** + * Sends messages to the destination device. + * @param options Options. + * @since 5 + * @systemapi + * @deprecated since 8 + */ + static sendMsg(options: SendMessageOptions): void; + + /** + * Listens for messages sent from other devices. + * @param options Options. + * @since 5 + * @systemapi + * @deprecated since 8 + */ + static subscribeMsg(options: SubscribeMessageOptions): void; + + /** + * Cancels the listening for messages sent from other devices. + * @since 5 + * @systemapi + * @deprecated since 8 + */ + static unsubscribeMsg(): void; +} diff --git a/api/common/lite/console.d.ts b/api/common/lite/console.d.ts index fa2c5cc33e..2d8d27582d 100644 --- a/api/common/lite/console.d.ts +++ b/api/common/lite/console.d.ts @@ -1,46 +1,46 @@ -/* - * Copyright (c) 2020 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 declare class console { - /** - * Prints "debug" logs. - * @param message Text to print - */ - static debug(message: string): void; - - /** - * Prints "log" logs. - * @param message Text to print - */ - static log(message: string): void; - - /** - * Prints "info" logs. - * @param message Text to print - */ - static info(message: string): void; - - /** - * Prints "warn" logs. - * @param message Text to print - */ - static warn(message: string): void; - - /** - * Prints "error" logs. - * @param message Text to print - */ - static error(message: string): void; -} +/* + * Copyright (c) 2020 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 declare class console { + /** + * Prints "debug" logs. + * @param message Text to print + */ + static debug(message: string): void; + + /** + * Prints "log" logs. + * @param message Text to print + */ + static log(message: string): void; + + /** + * Prints "info" logs. + * @param message Text to print + */ + static info(message: string): void; + + /** + * Prints "warn" logs. + * @param message Text to print + */ + static warn(message: string): void; + + /** + * Prints "error" logs. + * @param message Text to print + */ + static error(message: string): void; +} diff --git a/api/common/lite/featureability.d.ts b/api/common/lite/featureability.d.ts index cbe4af8797..014cbb7538 100644 --- a/api/common/lite/featureability.d.ts +++ b/api/common/lite/featureability.d.ts @@ -1,147 +1,147 @@ -/* - * Copyright (c) 2020 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. - */ - -/** - * @since 5 - * @systemapi - * @deprecated since 8 - */ -export interface SubscribeMessageResponse { - /** - * Peer device ID. - * @since 5 - */ - deviceId: string; - - /** - * Name of the bundle where the peer ability locates. The name is case sensitive. - * @since 5 - */ - bundleName: string; - - /** - * Peer ability name, which is case sensitive. - * @since 5 - */ - abilityName: string; - - /** - * Messages received from the device. - * @since 5 - */ - message: string; -} - -/** - * @since 5 - * @systemapi - * @deprecated since 8 - */ -export interface SendMessageOptions { - /** - * Destination device ID. - * @since 5 - */ - deviceId: string; - - /** - * Name of the destination bundle where the ability locates. The name is case sensitive. - * @since 5 - */ - bundleName: string; - - /** - * Destination ability name, which is case sensitive. - * @since 5 - */ - abilityName: string; - - /** - * Messages sent to the destination device. - * A maximum of 1 KB of data can be transmitted at a time. - * If more than 1 KB of data needs to be transmitted, split the messages into multiple parts to transmit. - * @since 5 - */ - message?: string; - - /** - * Called when the messages are sent successfully. - * @since 5 - */ - success?: () => void; - - /** - * Called when the messages fail to be sent. - * @since 5 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 5 - */ - complete?: () => void; -} - -/** - * @since 5 - * @systemapi - * @deprecated since 8 - */ -export interface SubscribeMessageOptions { - /** - * Called when the messages are sent successfully. - * @since 5 - */ - success?: (data: SubscribeMessageResponse) => void; - - /** - * Called when the messages fail to be sent. - * @since 5 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @since 5 - * @deprecated since 8 - */ -export declare class FeatureAbility { - /** - * Sends messages to the destination device. - * @param options Options. - * @since 5 - * @systemapi - * @deprecated since 8 - */ - static sendMsg(options: SendMessageOptions): void; - - /** - * Listens for messages sent from other devices. - * @param options Options. - * @since 5 - * @systemapi - * @deprecated since 8 - */ - static subscribeMsg(options: SubscribeMessageOptions): void; - - /** - * Cancels the listening for messages sent from other devices. - * @since 5 - * @systemapi - * @deprecated since 8 - */ - static unsubscribeMsg(): void; -} +/* + * Copyright (c) 2020 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. + */ + +/** + * @since 5 + * @systemapi + * @deprecated since 8 + */ +export interface SubscribeMessageResponse { + /** + * Peer device ID. + * @since 5 + */ + deviceId: string; + + /** + * Name of the bundle where the peer ability locates. The name is case sensitive. + * @since 5 + */ + bundleName: string; + + /** + * Peer ability name, which is case sensitive. + * @since 5 + */ + abilityName: string; + + /** + * Messages received from the device. + * @since 5 + */ + message: string; +} + +/** + * @since 5 + * @systemapi + * @deprecated since 8 + */ +export interface SendMessageOptions { + /** + * Destination device ID. + * @since 5 + */ + deviceId: string; + + /** + * Name of the destination bundle where the ability locates. The name is case sensitive. + * @since 5 + */ + bundleName: string; + + /** + * Destination ability name, which is case sensitive. + * @since 5 + */ + abilityName: string; + + /** + * Messages sent to the destination device. + * A maximum of 1 KB of data can be transmitted at a time. + * If more than 1 KB of data needs to be transmitted, split the messages into multiple parts to transmit. + * @since 5 + */ + message?: string; + + /** + * Called when the messages are sent successfully. + * @since 5 + */ + success?: () => void; + + /** + * Called when the messages fail to be sent. + * @since 5 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 5 + */ + complete?: () => void; +} + +/** + * @since 5 + * @systemapi + * @deprecated since 8 + */ +export interface SubscribeMessageOptions { + /** + * Called when the messages are sent successfully. + * @since 5 + */ + success?: (data: SubscribeMessageResponse) => void; + + /** + * Called when the messages fail to be sent. + * @since 5 + */ + fail?: (data: string, code: number) => void; +} + +/** + * @since 5 + * @deprecated since 8 + */ +export declare class FeatureAbility { + /** + * Sends messages to the destination device. + * @param options Options. + * @since 5 + * @systemapi + * @deprecated since 8 + */ + static sendMsg(options: SendMessageOptions): void; + + /** + * Listens for messages sent from other devices. + * @param options Options. + * @since 5 + * @systemapi + * @deprecated since 8 + */ + static subscribeMsg(options: SubscribeMessageOptions): void; + + /** + * Cancels the listening for messages sent from other devices. + * @since 5 + * @systemapi + * @deprecated since 8 + */ + static unsubscribeMsg(): void; +} diff --git a/api/common/lite/global.d.ts b/api/common/lite/global.d.ts index 6594563f79..4c2f3f0193 100644 --- a/api/common/lite/global.d.ts +++ b/api/common/lite/global.d.ts @@ -1,78 +1,78 @@ -/* - * Copyright (c) 2020 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. - */ - -/** - * Sets the interval for repeatedly calling a function. - * @param handler Indicates the function to be called repeatedly at the interval. - * @param delay Indicates the interval between each two calls, in milliseconds. The function will be called after this delay. - * @param arguments Indicates additional arguments to pass to "handler" when the timer goes off. - * @returns Returns the timer ID. - */ -export declare function setInterval( - handler: Function, - delay: number, - ...arguments: any[] -): number; - -/** - * Sets a timer after which a function will be executed. - * @param handler Indicates the function to be called after the timer goes off. - * @param delay Indicates the delay (in milliseconds) after which the function will be called. If this parameter is left empty, default value "0" will be used, which means that the function will be called immediately or as soon as possible. - * @param arguments Indicates additional arguments to pass to "handler" when the timer goes off. - * @returns Returns the timer ID. - */ -export declare function setTimeout( - handler: Function, - delay?: number, - ...arguments: any[] -): number; - -/** - * Cancels the interval set by " setInterval()". - * @param intervalID Indicates the timer ID returned by "setInterval()". - */ -export declare function clearInterval(intervalID?: number): void; - -/** - * Cancels the timer set by " setTimeout()". - * @param timeoutID Indicates the timer ID returned by "setTimeout()". - */ -export declare function clearTimeout(timeoutID?: number): void; - -/** - * Get the java interface instance. The java instance needs to register, otherwise it cannot be obtained. - * After obtaining the instance, you can call the function with the same name on the Java side. - * @param name Java interface name, including package path, such as com.example.test.timeinterfaceimpl. - * @returns A promise object is returned. The resolve callback is the object of PA. The reject callback returns the object containing code and error data. - * @since 5 - * @deprecated since 8 - */ -export declare function createLocalParticleAbility(name?: string): any; - -/** - * Conditional compilation for rich equipment - */ -export declare const STANDARD: string; - -/** - * Conditional compilation for lite equipment - */ -export declare const LITE: string; - -/** - * Defining syscap function. - * @since 8 - */ -export declare function canIUse(syscap: string): boolean; +/* + * Copyright (c) 2020 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. + */ + +/** + * Sets the interval for repeatedly calling a function. + * @param handler Indicates the function to be called repeatedly at the interval. + * @param delay Indicates the interval between each two calls, in milliseconds. The function will be called after this delay. + * @param arguments Indicates additional arguments to pass to "handler" when the timer goes off. + * @returns Returns the timer ID. + */ +export declare function setInterval( + handler: Function, + delay: number, + ...arguments: any[] +): number; + +/** + * Sets a timer after which a function will be executed. + * @param handler Indicates the function to be called after the timer goes off. + * @param delay Indicates the delay (in milliseconds) after which the function will be called. If this parameter is left empty, default value "0" will be used, which means that the function will be called immediately or as soon as possible. + * @param arguments Indicates additional arguments to pass to "handler" when the timer goes off. + * @returns Returns the timer ID. + */ +export declare function setTimeout( + handler: Function, + delay?: number, + ...arguments: any[] +): number; + +/** + * Cancels the interval set by " setInterval()". + * @param intervalID Indicates the timer ID returned by "setInterval()". + */ +export declare function clearInterval(intervalID?: number): void; + +/** + * Cancels the timer set by " setTimeout()". + * @param timeoutID Indicates the timer ID returned by "setTimeout()". + */ +export declare function clearTimeout(timeoutID?: number): void; + +/** + * Get the java interface instance. The java instance needs to register, otherwise it cannot be obtained. + * After obtaining the instance, you can call the function with the same name on the Java side. + * @param name Java interface name, including package path, such as com.example.test.timeinterfaceimpl. + * @returns A promise object is returned. The resolve callback is the object of PA. The reject callback returns the object containing code and error data. + * @since 5 + * @deprecated since 8 + */ +export declare function createLocalParticleAbility(name?: string): any; + +/** + * Conditional compilation for rich equipment + */ +export declare const STANDARD: string; + +/** + * Conditional compilation for lite equipment + */ +export declare const LITE: string; + +/** + * Defining syscap function. + * @since 8 + */ +export declare function canIUse(syscap: string): boolean; diff --git a/api/common/lite/index.d.ts b/api/common/lite/index.d.ts index 8712a2be0c..2b74cea7b7 100644 --- a/api/common/lite/index.d.ts +++ b/api/common/lite/index.d.ts @@ -1,19 +1,19 @@ -/* - * Copyright (c) 2020 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 * from './viewmodel'; -export * from './featureability'; -export * from './console'; +/* + * Copyright (c) 2020 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 * from './viewmodel'; +export * from './featureability'; +export * from './console'; export * from './global'; \ No newline at end of file diff --git a/api/common/lite/viewmodel.d.ts b/api/common/lite/viewmodel.d.ts index cc51a0bd26..bd23458986 100644 --- a/api/common/lite/viewmodel.d.ts +++ b/api/common/lite/viewmodel.d.ts @@ -1,118 +1,118 @@ -/* - * Copyright (c) 2020 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 ViewModel { - /** - * Displays content based on the current system language and a path of the language resource key specified through $t. - * @param path Path of the language resource key - * @param param Content used to replace placeholders during runtime. There are two types of placeholders available: - * 1. Named placeholder, for example, {name}. The actual content must be of the object type, for example, $t('strings.object', {name: 'Hello world'}). - * 2. Digit placeholder, for example, {0}. The actual content must be of the array type, for example, $t('strings.array', ['Hello world']). - * @returns content to display - */ - $t(path: string, param?: object | Array): string; - - /** - * An object that holds all DOM elements and component instances that have been registered with the refs attribute - */ - $refs: ElementReferences; -} - -export interface ListScrollToOptions { - /** - * specified position. - */ - index: number; -} - -export interface ListElement { - /** - * Scrolls the list to the position of the item at the specified index. - */ - scrollTo(position: ListScrollToOptions): void; -} - -export interface ImageAnimatorElement { - /** - * Starts to play the frame animation of an image. If this method is called again, the playback starts from the first frame. - */ - start(): void; - /** - * Pauses the frame animation playback of an image. - */ - pause(): void; - /** - * Stops the frame animation playback of an image. - */ - stop(): void; - /** - * Resumes the frame animation playback of an image. - */ - resume(): void; - /** - * Obtains the playback state. Available values are as follows: - * Playing - * Paused - * Stopped - */ - getState(): "Playing" | "Paused" | "Stopped"; -} - -export interface ElementReferences { - [k: string]: object & ListElement & ImageAnimatorElement; -} - -export interface Options> { - /** - * Data model of the page that can be converted into a JSON object. - * The attribute name cannot start with $ or an underscore (_) or contain the reserved words such as for, if, show, and tid. - * For a function, the return value must be an object. - * Set the value of data to the return value of the function during page initialization. - */ - data?: Data; - - /** - * Called when the page is initialized. This function can be called only once in a lifecycle. - */ - onInit?(): void; - - /** - * Called when the page is created. This function can be called only once in a lifecycle. - */ - onReady?(): void; - - /** - * Called when the page is displayed. - */ - onShow?(): void; - - /** - * Called when the application is created - */ - onCreate?(): void; - - /** - * Called when the application is destroyed or called when the page is redirected to another one (without entering the navigation stack). - */ - onDestroy?(): void; -} - -type DefaultData = object; -type CombinedOptions = object & - Options & - ThisType; -export declare function extendViewModel( - options: CombinedOptions -): ViewModel & Data; +/* + * Copyright (c) 2020 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 ViewModel { + /** + * Displays content based on the current system language and a path of the language resource key specified through $t. + * @param path Path of the language resource key + * @param param Content used to replace placeholders during runtime. There are two types of placeholders available: + * 1. Named placeholder, for example, {name}. The actual content must be of the object type, for example, $t('strings.object', {name: 'Hello world'}). + * 2. Digit placeholder, for example, {0}. The actual content must be of the array type, for example, $t('strings.array', ['Hello world']). + * @returns content to display + */ + $t(path: string, param?: object | Array): string; + + /** + * An object that holds all DOM elements and component instances that have been registered with the refs attribute + */ + $refs: ElementReferences; +} + +export interface ListScrollToOptions { + /** + * specified position. + */ + index: number; +} + +export interface ListElement { + /** + * Scrolls the list to the position of the item at the specified index. + */ + scrollTo(position: ListScrollToOptions): void; +} + +export interface ImageAnimatorElement { + /** + * Starts to play the frame animation of an image. If this method is called again, the playback starts from the first frame. + */ + start(): void; + /** + * Pauses the frame animation playback of an image. + */ + pause(): void; + /** + * Stops the frame animation playback of an image. + */ + stop(): void; + /** + * Resumes the frame animation playback of an image. + */ + resume(): void; + /** + * Obtains the playback state. Available values are as follows: + * Playing + * Paused + * Stopped + */ + getState(): "Playing" | "Paused" | "Stopped"; +} + +export interface ElementReferences { + [k: string]: object & ListElement & ImageAnimatorElement; +} + +export interface Options> { + /** + * Data model of the page that can be converted into a JSON object. + * The attribute name cannot start with $ or an underscore (_) or contain the reserved words such as for, if, show, and tid. + * For a function, the return value must be an object. + * Set the value of data to the return value of the function during page initialization. + */ + data?: Data; + + /** + * Called when the page is initialized. This function can be called only once in a lifecycle. + */ + onInit?(): void; + + /** + * Called when the page is created. This function can be called only once in a lifecycle. + */ + onReady?(): void; + + /** + * Called when the page is displayed. + */ + onShow?(): void; + + /** + * Called when the application is created + */ + onCreate?(): void; + + /** + * Called when the application is destroyed or called when the page is redirected to another one (without entering the navigation stack). + */ + onDestroy?(): void; +} + +type DefaultData = object; +type CombinedOptions = object & + Options & + ThisType; +export declare function extendViewModel( + options: CombinedOptions +): ViewModel & Data; -- Gitee From ba5d9913f22cc5477364239b8fb955d56be27e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=82=96=E5=B8=85?= Date: Fri, 1 Jul 2022 16:37:48 +0800 Subject: [PATCH 04/47] =?UTF-8?q?Signed-off-by:=20=E8=82=96=E5=B8=85=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes to be committed: modified: api/@ohos.uitest.d.ts --- api/@ohos.uitest.d.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/api/@ohos.uitest.d.ts b/api/@ohos.uitest.d.ts index f1dd392982..b35917fbaa 100755 --- a/api/@ohos.uitest.d.ts +++ b/api/@ohos.uitest.d.ts @@ -471,6 +471,24 @@ class UiComponent{ * @test */ dragTo(target: UiComponent): Promise; + + /** + * Pinch enlarge this {@link UiComponent} to the target scale. + * @syscap SystemCapability.Test.UiTest + * @param scale the scale of the pinch enlarge this {@link UiComponent}'s size. + * @since 9 + * @test + */ + pinchOut(scale: number): Promise; + + /** + * Pinch shrink this {@link UiComponent} to the target scale. + * @syscap SystemCapability.Test.UiTest + * @param scale the scale of the pinch shrink this {@link UiComponent}'s size. + * @since 9 + * @test + */ + pinchIn(scale: number): Promise; } /** -- Gitee From 86ea1c11bdb3cba8d4063a4c773f303415fbe7b7 Mon Sep 17 00:00:00 2001 From: shikai-123 Date: Mon, 4 Jul 2022 12:39:56 +0800 Subject: [PATCH 05/47] Modify the return value type of promisewrapper Change the return value from object to function issues: https://gitee.com/openharmony/js_util_module/issues/I5DVPV Signed-off-by: zhoufei --- api/@ohos.util.d.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/api/@ohos.util.d.ts b/api/@ohos.util.d.ts index ea00afe070..f3f42ea249 100644 --- a/api/@ohos.util.d.ts +++ b/api/@ohos.util.d.ts @@ -64,10 +64,21 @@ declare namespace util { */ function callbackWrapper(original: Function): (err: Object, value: Object) => void; + /** + * Takes a function following the common error-first callback style, i.e taking an (err, value) => + * callback as the last argument, and return a function that returns promises. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param original asynchronous function + * @return return a version that returns promises + */ + function promiseWrapper(original: (err: Object, value: Object) => void): Function; + /** * Takes a function following the common error-first callback style, i.e taking an (err, value) => * callback as the last argument, and return a version that returns promises. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang * @param original asynchronous function * @return return a version that returns promises -- Gitee From 19b98cac0e444b20db4b68b326f8c4fc6cbff2bb Mon Sep 17 00:00:00 2001 From: ql Date: Mon, 4 Jul 2022 06:18:22 +0000 Subject: [PATCH 06/47] update api/@ohos.distributedMissionManager.d.ts. Signed-off-by: ql --- api/@ohos.distributedMissionManager.d.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/api/@ohos.distributedMissionManager.d.ts b/api/@ohos.distributedMissionManager.d.ts index 4ea8d0791f..5bd5e2f7e0 100755 --- a/api/@ohos.distributedMissionManager.d.ts +++ b/api/@ohos.distributedMissionManager.d.ts @@ -24,7 +24,7 @@ import { MissionParameter } from './application/MissionParameter'; * @name distributedMissionManager * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @permission N/A + * @permission ohos.permission.MANAGE_MISSIONS * @systemapi Hide this for inner system use. */ declare namespace distributedMissionManager { @@ -34,7 +34,6 @@ declare namespace distributedMissionManager { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Mission. * @param parameter Parameters corresponding to mission. - * @return - * @systemapi Hide this for inner system use. */ function startSyncRemoteMissions(parameter: MissionParameter, callback: AsyncCallback): void; @@ -46,7 +45,6 @@ declare namespace distributedMissionManager { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Mission. * @param parameter Parameters corresponding to mission. - * @return - * @systemapi Hide this for inner system use. */ function stopSyncRemoteMissions(parameter: MissionDeviceInfo, callback: AsyncCallback): void; @@ -59,7 +57,6 @@ declare namespace distributedMissionManager { * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @param parameter Parameters corresponding to mission. * @param options The callbacks for regist mission. - * @return - * @systemapi Hide this for inner system use. */ function registerMissionListener(parameter: MissionDeviceInfo, options: MissionCallback, callback: AsyncCallback): void; @@ -71,7 +68,6 @@ declare namespace distributedMissionManager { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @param parameter Parameters corresponding to mission. - * @return - * @systemapi Hide this for inner system use. */ function unRegisterMissionListener(parameter: MissionDeviceInfo, callback:AsyncCallback): void; -- Gitee From 03c3f5a9c0cdb6e43e7c4ce8c3f8f7b653568c18 Mon Sep 17 00:00:00 2001 From: ql Date: Mon, 4 Jul 2022 06:19:20 +0000 Subject: [PATCH 07/47] update api/application/MissionCallbacks.d.ts. Signed-off-by: ql --- api/application/MissionCallbacks.d.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/api/application/MissionCallbacks.d.ts b/api/application/MissionCallbacks.d.ts index de4a16551b..02a4962069 100755 --- a/api/application/MissionCallbacks.d.ts +++ b/api/application/MissionCallbacks.d.ts @@ -19,7 +19,7 @@ * @name MissionCallback * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @permission N/A + * @permission ohos.permission.MANAGE_MISSIONS * @systemapi hide for inner use. */ export interface MissionCallback { @@ -29,7 +29,6 @@ * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @param deviceId Indicates the deviceId mission changed. - * @return - */ notifyMissionsChanged(deviceId: string): void; @@ -40,7 +39,6 @@ * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @param deviceId Indicates the deviceId mission changed. * @param mission Indicates the id of destroyed mission. - * @return - */ notifySnapshot(deviceId: string, mission: number): void; @@ -51,7 +49,6 @@ * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @param deviceId Indicates the deviceId mission changed. * @param state Indicates the state of network - * @return - */ notifyNetDisconnect(deviceId: string, state: number): void; } \ No newline at end of file -- Gitee From d89ad6a6a52ba9f257c24182ea4556fdc411349d Mon Sep 17 00:00:00 2001 From: ql Date: Mon, 4 Jul 2022 06:19:55 +0000 Subject: [PATCH 08/47] update api/application/MissionDeviceInfo.d.ts. Signed-off-by: ql --- api/application/MissionDeviceInfo.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/application/MissionDeviceInfo.d.ts b/api/application/MissionDeviceInfo.d.ts index d4ba0f2dbe..911a7455b4 100755 --- a/api/application/MissionDeviceInfo.d.ts +++ b/api/application/MissionDeviceInfo.d.ts @@ -18,7 +18,7 @@ * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @permission N/A + * @permission ohos.permission.MANAGE_MISSIONS * @systemapi hide for inner use. */ export interface MissionDeviceInfo { -- Gitee From 15384df73a870f97b329ab9b12dd80dfaead61b5 Mon Sep 17 00:00:00 2001 From: ql Date: Mon, 4 Jul 2022 06:20:24 +0000 Subject: [PATCH 09/47] update api/application/MissionParameter.d.ts. Signed-off-by: ql --- api/application/MissionParameter.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/application/MissionParameter.d.ts b/api/application/MissionParameter.d.ts index 6d0455f67b..e1b67f209e 100755 --- a/api/application/MissionParameter.d.ts +++ b/api/application/MissionParameter.d.ts @@ -18,7 +18,7 @@ * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @permission N/A + * @permission ohos.permission.MANAGE_MISSIONS * @systemapi hide for inner use. */ export interface MissionParameter { -- Gitee From 6874b87a254e310a2304b01eac48c473006b4b5d Mon Sep 17 00:00:00 2001 From: ql Date: Mon, 4 Jul 2022 06:33:03 +0000 Subject: [PATCH 10/47] update api/@ohos.distributedMissionManager.d.ts. Signed-off-by: ql --- api/@ohos.distributedMissionManager.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.distributedMissionManager.d.ts b/api/@ohos.distributedMissionManager.d.ts index 5bd5e2f7e0..fb832ffd22 100755 --- a/api/@ohos.distributedMissionManager.d.ts +++ b/api/@ohos.distributedMissionManager.d.ts @@ -52,7 +52,7 @@ declare namespace distributedMissionManager { /** * Register the missionListener to ams. - * @default - + * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @param parameter Parameters corresponding to mission. @@ -64,7 +64,7 @@ declare namespace distributedMissionManager { /** * Unrgister the missionListener to ams. - * @default - + * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @param parameter Parameters corresponding to mission. -- Gitee From 796e2a794ff0ec08ac498c32b852202b8a5eeb1c Mon Sep 17 00:00:00 2001 From: dy Date: Mon, 4 Jul 2022 15:26:39 +0800 Subject: [PATCH 11/47] =?UTF-8?q?IssueNo:#I5FB6=20GsetModuleUpgradeFlag?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E7=9A=84=E5=8F=82=E6=95=B0isNeedUpdate?= =?UTF-8?q?=E4=B8=8D=E5=AF=B9=20Description:=E4=BF=AE=E6=94=B9upgradeFlag?= =?UTF-8?q?=E7=9A=84=E6=B3=A8=E9=87=8A=20Sig:SIG=5FApplicaitonFramework=20?= =?UTF-8?q?Feature=20or=20Bugfix:Bugfix=20Binary=20Source:No?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dy --- api/@ohos.bundle.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.bundle.d.ts b/api/@ohos.bundle.d.ts index 005100ea3b..9c18952094 100644 --- a/api/@ohos.bundle.d.ts +++ b/api/@ohos.bundle.d.ts @@ -704,7 +704,7 @@ declare namespace bundle { * @syscap SystemCapability.BundleManager.BundleFramework * @param bundleName Indicates the bundle name of the application. * @param moduleName Indicates the module name of the application. - * @param isNeedUpdate Indicates isNeedUpdate of the application. + * @param upgradeFlag Indicates upgradeFlag of the application. * @systemapi Hide this for inner system use */ function setModuleUpgradeFlag(bundleName: string, moduleName: string, upgradeFlag: UpgradeFlag, callback: AsyncCallback):void; -- Gitee From f444e4beacce6be6f20373738079e98dbad08cec Mon Sep 17 00:00:00 2001 From: m00512953 Date: Mon, 4 Jul 2022 17:02:27 +0800 Subject: [PATCH 12/47] mingxihua@huawei.com.cn Signed-off-by: m00512953 --- api/@ohos.ability.featureAbility.d.ts | 15 +++- api/@ohos.application.Context.d.ts | 107 ++++++++++++++++++++++++++ 2 files changed, 121 insertions(+), 1 deletion(-) create mode 100755 api/@ohos.application.Context.d.ts diff --git a/api/@ohos.ability.featureAbility.d.ts b/api/@ohos.ability.featureAbility.d.ts index 4638fdf139..1a7f985873 100644 --- a/api/@ohos.ability.featureAbility.d.ts +++ b/api/@ohos.ability.featureAbility.d.ts @@ -18,7 +18,7 @@ import { Callback } from './basic'; import Want from './@ohos.application.want'; import { StartAbilityParameter } from './ability/startAbilityParameter'; import { AbilityResult } from './ability/abilityResult'; -import { Context } from './app/context'; +import { Context as _Context } from './app/context'; import { DataAbilityHelper } from './ability/dataAbilityHelper'; import { ConnectOptions } from './ability/connectOptions'; import window from './@ohos.window'; @@ -213,5 +213,18 @@ declare namespace featureAbility { TYPE_DELETE = 3, TYPE_ASSERT = 4, } + + /** + * The context of an ability or an application. It allows access to + * application-specific resources, request and verification permissions. + * Can only be obtained through the ability. + * + * @since 6 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import abilityManager from 'app/context' + * @permission N/A + * @FAModelOnly + */ + export type Context = _Context } export default featureAbility; diff --git a/api/@ohos.application.Context.d.ts b/api/@ohos.application.Context.d.ts new file mode 100755 index 0000000000..a0d2be051c --- /dev/null +++ b/api/@ohos.application.Context.d.ts @@ -0,0 +1,107 @@ +/* + * 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. + */ + +import * as _AbilityContext from './application/AbilityContext'; +import * as _AbilityStageContext from './application/AbilityStageContext'; +import * as _ApplicationContext from './application/ApplicationContext'; +import * as _BaseContext from './application/BaseContext'; +import * as _Context from './application/Context'; +import * as _ExtensionContext from './application/ExtensionContext'; +import * as _FormExtensionContext from './application/FormExtensionContext'; + +/** + * The context of an application. It allows access to application-specific resources. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + * @StageModelOnly + */ +declare namespace applicationContext { + + /** + * The context of an ability. It allows access to ability-specific resources. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + * @StageModelOnly + */ + export type AbilityContext = _AbilityContext.default + + /** + * The context of an abilityStage. It allows access to abilityStage-specific resources. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + * @StageModelOnly + */ + export type AbilityStageContext = _AbilityStageContext.default + + /** + * The context of an application. It allows access to application-specific resources. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + * @StageModelOnly + */ + export type ApplicationContext = _ApplicationContext.default + + /** + * The base context of 'app.Context' for FA Mode or + * 'application.Context' for Stage Mode. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + */ + export type BaseContext = _BaseContext.default + + /** + * The base context of an ability or an application. It allows access to + * application-specific resources. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + * @StageModelOnly + */ + export type Context = _Context.default + + /** + * The context of an extension. It allows access to extension-specific resources. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + * @StageModelOnly + */ + export type ExtensionContext = _ExtensionContext.default + + /** + * The context of form extension. It allows access to + * formExtension-specific resources. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + * @permission N/A + * @StageModelOnly + */ + export type FormExtensionContext = _FormExtensionContext.default +} + +export default applicationContext; \ No newline at end of file -- Gitee From 567a986d8f1547013e44b325ce059eb9c01ccd86 Mon Sep 17 00:00:00 2001 From: yanwenhao Date: Tue, 5 Jul 2022 15:34:03 +0800 Subject: [PATCH 13/47] Delete FormExtensionContext::updateForm Signed-off-by: yanwenhao Change-Id: Idf3d1396b5769c283e35d597ff5390b12c012471 --- api/application/FormExtensionContext.d.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/api/application/FormExtensionContext.d.ts b/api/application/FormExtensionContext.d.ts index 0f5c012e19..db22ad8475 100644 --- a/api/application/FormExtensionContext.d.ts +++ b/api/application/FormExtensionContext.d.ts @@ -29,21 +29,6 @@ import Want from '../@ohos.application.Want'; */ export default class FormExtensionContext extends ExtensionContext { - /** - * update the given form. - * - *

You can use this method to update the given form

- * - * @since 9 - * @syscap SystemCapability.Ability.Form - * @param formId Indicates the given form. - * @param formBindingData Indicates the form data. - * @return - - * @StageModelOnly - */ - updateForm(formId: string, formBindingData: formBindingData.FormBindingData, callback: AsyncCallback): void; - updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Promise; - /** * start an ability within the same bundle. * -- Gitee From 9639f8a6207bdda09336bc7616a16f6786529d42 Mon Sep 17 00:00:00 2001 From: zhangqiang183 Date: Tue, 5 Jul 2022 19:53:41 +0800 Subject: [PATCH 14/47] add image dts Signed-off-by: zhangqiang183 --- api/@ohos.multimedia.image.d.ts | 206 ++++++++++++++++++++++++++++++++ 1 file changed, 206 insertions(+) diff --git a/api/@ohos.multimedia.image.d.ts b/api/@ohos.multimedia.image.d.ts index 17ec79142e..682810e42a 100644 --- a/api/@ohos.multimedia.image.d.ts +++ b/api/@ohos.multimedia.image.d.ts @@ -503,6 +503,34 @@ declare namespace image { scaleMode?: ScaleMode; } + /** + * Initialization options for ImageSource. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + */ + interface SourceOptions { + /** + * The density for ImageSource. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + */ + sourceDensity: number; + + /** + * PixelMap expected format. + * @since 8 + * @syscap SystemCapability.Multimedia.Image.Core + */ + sourcePixelFormat?: PixelMapFormat; + + /** + * PixelMap size. + * @since 8 + * @syscap SystemCapability.Multimedia.Image.Core + */ + sourceSize?: Size; + } + /** * Create pixelmap by data buffer. * @since 8 @@ -526,6 +554,16 @@ declare namespace image { */ function createImageSource(uri: string): ImageSource; + /** + * Creates an ImageSource instance based on the URI. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.ImageSource + * @param uri Image source URI. + * @param options The config of Image source. + * @return Returns the ImageSource instance if the operation is successful; returns null otherwise. + */ + function createImageSource(uri: string, options: SourceOptions): ImageSource; + /** * Creates an ImageSource instance based on the file descriptor. * @since 7 @@ -535,6 +573,16 @@ declare namespace image { */ function createImageSource(fd: number): ImageSource; + /** + * Creates an ImageSource instance based on the file descriptor. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.ImageSource + * @param fd ID of a file descriptor. + * @param options The config of Image source. + * @return Returns the ImageSource instance if the operation is successful; returns null otherwise. + */ + function createImageSource(fd: number, options: SourceOptions): ImageSource; + /** * Creates an ImageSource instance based on the buffer. * @since 9 @@ -544,6 +592,16 @@ declare namespace image { */ function createImageSource(buf: ArrayBuffer): ImageSource; + /** + * Creates an ImageSource instance based on the buffer. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.ImageSource + * @param buf The buffer of the iamge. + * @param options The config of Image source. + * @return Returns the ImageSource instance if the operation is successful; returns null otherwise. + */ + function createImageSource(buf: ArrayBuffer, options: SourceOptions): ImageSource; + /** * Creates an ImageSource instance based on the buffer in incremental. * @since 9 @@ -553,6 +611,16 @@ declare namespace image { */ function CreateIncrementalSource(buf: ArrayBuffer): ImageSource; + /** + * Creates an ImageSource instance based on the buffer in incremental. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.ImageSource + * @param buf The buffer of the iamge. + * @param options The config of source. + * @return Returns the ImageSource instance if the operation is successful; returns null otherwise. + */ + function CreateIncrementalSource(buf: ArrayBuffer, options?: SourceOptions): ImageSource; + /** * Creates an ImagePacker instance. * @since 6 @@ -697,6 +765,144 @@ declare namespace image { */ getPixelBytesNumber(): number; + /** + * Obtains the density of the image pixel map. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @return The number of density. + */ + getDensity():number; + + /** + * Set the transparent rate of pixel map. This method uses a callback to return the operation result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param rate The value of transparent rate. + * @param callback Callback used to return the operation result. If the operation fails, an error message is returned. + */ + opacity(rate: number, callback: AsyncCallback): void; + + /** + * Set the transparent rate of pixel map. This method uses a promise to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param rate The value of transparent rate. + * @return A Promise instance used to return the operation result. If the operation fails, an error message is returned. + */ + opacity(rate: number): Promise; + + /** + * Obtains new pixel map with allpha information. This method uses a promise to return the information. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @return A Promise instance used to return the new image pixel map. If the operation fails, an error message is returned. + */ + createAlphaPixelmap(): Promise; + + /** + * Obtains new pixel map with allpha information. This method uses a callback to return the information. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param callback Callback used to return the new image pixel map. If the operation fails, an error message is returned. + */ + createAlphaPixelmap(callback: AsyncCallback): void; + + /** + * Image zoom in width and height. This method uses a callback to return the operation result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param x The zoom value of width. + * @param y The zoom value of height. + * @param callback Callback used to return the operation result. If the operation fails, an error message is returned. + */ + scale(x: number, y: number, callback: AsyncCallback): void; + + /** + * Image zoom in width and height. This method uses a promise to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param x The zoom value of width. + * @param y The zoom value of height. + * @return A Promise instance used to return the operation result. If the operation fails, an error message is returned. + */ + scale(x: number, y: number): Promise; + + /** + * Image position transformation. This method uses a callback to return the operation result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param x The position value of width. + * @param y The position value of height. + * @param callback Callback used to return the operation result. If the operation fails, an error message is returned. + */ + translate(x: number, y: number, callback: AsyncCallback): void; + + /** + * Image position transformation. This method uses a promise to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param x The position value of width. + * @param y The position value of height. + * @return A Promise instance used to return the operation result. If the operation fails, an error message is returned. + */ + translate(x: number, y: number): Promise; + + /** + * Image rotation. This method uses a callback to return the operation result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param angle The rotation angle. + * @param callback Callback used to return the operation result. If the operation fails, an error message is returned. + */ + rotate(angle: number, callback: AsyncCallback): void; + + /** + * Image rotation. This method uses a promise to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param angle The rotation angle. + * @return A Promise instance used to return the operation result. If the operation fails, an error message is returned. + */ + rotate(angle: number): Promise; + + /** + * Image flipping. This method uses a callback to return the operation result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param horizontal Is flip in horizontal. + * @param vertical Is flip in vertical. + * @param callback Callback used to return the operation result. If the operation fails, an error message is returned. + */ + flip(horizontal: boolean, vertical: boolean, callback: AsyncCallback): void; + + /** + * Image flipping. This method uses a promise to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param horizontal Is flip in horizontal. + * @param vertical Is flip in vertical. + * @return A Promise instance used to return the operation result. If the operation fails, an error message is returned. + */ + flip(horizontal: boolean, vertical: boolean): Promise; + + /** + * Crop the image. This method uses a callback to return the operation result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param region The region to crop. + * @param callback Callback used to return the operation result. If the operation fails, an error message is returned. + */ + crop(region: Region, callback: AsyncCallback): void; + + /** + * Crop the image. This method uses a promise to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param region The region to crop. + * @return A Promise instance used to return the operation result. If the operation fails, an error message is returned. + */ + crop(region: Region): Promise; + /** * Releases this PixelMap object. This method uses a callback to return the result. * @since 7 -- Gitee From a370fd72330bfee6d3a3e2ab6ca745d6f6ab5785 Mon Sep 17 00:00:00 2001 From: yangbo <1442420648@qq.com> Date: Tue, 5 Jul 2022 20:21:48 +0800 Subject: [PATCH 15/47] add delete_systemapi_plugin.js Signed-off-by: yangbo <1442420648@qq.com> Change-Id: Ibbf5dcaf9bd6bafc972653c9dcd08a9e7193e594 --- build-tools/delete_systemapi_plugin.js | 191 +++++++++++++++++++++++++ build-tools/package.json | 16 +++ 2 files changed, 207 insertions(+) create mode 100644 build-tools/delete_systemapi_plugin.js create mode 100644 build-tools/package.json diff --git a/build-tools/delete_systemapi_plugin.js b/build-tools/delete_systemapi_plugin.js new file mode 100644 index 0000000000..fcf3223a4f --- /dev/null +++ b/build-tools/delete_systemapi_plugin.js @@ -0,0 +1,191 @@ +/* + * Copyright (c) 2021-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. + */ +const path = require('path'); +const fs = require('fs'); +const ts = require('typescript'); + +let sourceFile = null; +let lastNoteStr = ''; +let lastNodeName = ''; + +function collectDeclaration(url) { + const utPath = path.resolve(__dirname, url); + const utFiles = []; + readFile(utPath, utFiles); + tsTransform(utFiles, deleteSystemApi); +} + +function tsTransform(utFiles, callback) { + utFiles.forEach((url) => { + if (/\.json/.test(url) || /index\-full\.d\.ts/.test(url) || /common\.d\.ts/.test(url)) { + const content = fs.readFileSync(url, 'utf-8'); + writeFile(url, content); + } else if (/\.d\.ts/.test(url)) { + const content = fs.readFileSync(url, 'utf-8'); + const fileName = path.basename(url).replace(/.d.ts/g, '.ts'); + ts.transpileModule(content, { + compilerOptions: { + "target": ts.ScriptTarget.ES2017 + }, + fileName: fileName, + transformers: { before: [callback(url)] } + }); + } + }); +} + +function readFile(dir, utFiles) { + try { + const files = fs.readdirSync(dir); + files.forEach((element) => { + const filePath = path.join(dir, element); + const status = fs.statSync(filePath); + if (status.isDirectory()) { + readFile(filePath, utFiles); + } else { + utFiles.push(filePath); + } + }) + } catch (e) { + console.log('ETS ERROR: ' + e); + } +} + +function writeFile(url, data, option) { + if (fs.existsSync(outputPath)) { + fs.rmdirSync(outputPath, { recursive: true }); + } + const newFilePath = path.resolve(outputPath, path.relative(__dirname, url)); + fs.mkdir(path.relative(__dirname, path.dirname(newFilePath)), { recursive: true }, (err) => { + if (err) { + console.log(`ERROR FOR CREATE PATH ${err}`); + } else { + fs.writeFile(newFilePath, data, option, (err) => { + if (err) { + console.log(`ERROR FOR CREATE FILE ${err}`); + } + }) + } + }) +} +function deleteSystemApi(url) { + return (context) => { + return (node) => { + sourceFile = node; + node = processSourceFile(node); + node = ts.visitEachChild(node, processAllNodes, context); + if (!isEmptyFile(node)) { + const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed }); + const result = printer.printNode(ts.EmitHint.Unspecified, node, sourceFile); + writeFile(url, result); + } + return node; + } + function processAllNodes(node) { + if (ts.isInterfaceDeclaration(node)) { + const newMembers = []; + node.members.forEach(member => { + if (!isSystemapi(member)) { + newMembers.push(member); + } + }); + node = ts.factory.updateInterfaceDeclaration(node, node.decorators, node.modifiers, node.name, + node.typeParameters, node.heritageClauses, newMembers); + } else if (ts.isClassDeclaration(node)) { + const newMembers = []; + node.members.forEach(member => { + if (!isSystemapi(member)) { + newMembers.push(member); + } + }); + node = ts.factory.updateClassDeclaration(node, node.decorators, node.modifiers, node.name, + node.typeParameters, node.heritageClauses, newMembers); + } else if (ts.isModuleDeclaration(node) && node.body && ts.isModuleBlock(node.body)) { + const newStatements = []; + node.body.statements.forEach(statement => { + if (!isSystemapi(statement)) { + newStatements.push(statement); + } + }); + const newModuleBody = ts.factory.updateBlock(node.body, newStatements); + node = ts.factory.updateModuleDeclaration(node, node.decorators, node.modifiers, node.name, newModuleBody); + } else if (ts.isEnumDeclaration(node)) { + const newMembers = []; + node.members.forEach(member => { + if (!isSystemapi(member)) { + newMembers.push(member); + } + }); + node = ts.factory.updateEnumDeclaration(node, node.decorators, node.modifiers, node.name, newMembers); + } + return ts.visitEachChild(node, processAllNodes, context); + } + function processSourceFile(node) { + const stateNamesSet = new Set([]); + const newStatements = []; + const newStatementsWithoutExport = []; + node.statements.forEach(statement => { + if (!isSystemapi(statement)) { + newStatements.push(statement); + } else if (ts.isModuleDeclaration(statement) && statement.name && ts.isIdentifier(statement.name)) { + stateNamesSet.add(statement.name.escapedText.toString()); + } + }); + newStatements.forEach(statement => { + if (!(ts.isExportAssignment(statement) && statement.expression && ts.isIdentifier(statement.expression) && + stateNamesSet.has(statement.expression.escapedText.toString()))) { + newStatementsWithoutExport.push(statement); + } + }); + return ts.factory.updateSourceFile(node, newStatementsWithoutExport, node.isDeclarationFile, + node.referencedFiles); + } + } +} +exports.deleteSystemApi = deleteSystemApi; + +function isSystemapi(node) { + const notesStr = node.getFullText().replace(node.getText(), "").replace(/[\s]/g, ""); + if (notesStr.length !== 0) { + if (ts.isFunctionDeclaration(node) || ts.isMethodSignature(node) || ts.isMethodDeclaration(node)) { + lastNodeName = node.name && node.name.escapedText ? node.name.escapedText.toString() : ""; + lastNoteStr = notesStr; + } + return /\@systemapi/g.test(notesStr); + } else { + if ((ts.isFunctionDeclaration(node) || ts.isMethodSignature(node) || ts.isMethodDeclaration(node)) && node.name && + node.name.escapedText.toString() !== "" && node.name.escapedText.toString() === lastNodeName) { + return /\@systemapi/g.test(lastNoteStr); + } else { + return false; + } + } +} + +function isEmptyFile(node) { + if (ts.isSourceFile(node) && node.statements) { + for (let i = 0; i < node.statements.length; i++) { + const statement = node.statements[i]; + if (!ts.isImportDeclaration(statement)) { + return false + } + } + } + return true; +} + +const apiSourcePath = '../api'; +const outputPath = path.resolve(__dirname, 'output'); +collectDeclaration(apiSourcePath); \ No newline at end of file diff --git a/build-tools/package.json b/build-tools/package.json new file mode 100644 index 0000000000..738d7b4037 --- /dev/null +++ b/build-tools/package.json @@ -0,0 +1,16 @@ +{ + "name": "delete", + "version": "1.0.0", + "description": "", + "main": "delete_systemapi_plugin.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "fs": "^0.0.1-security", + "path": "^0.12.7", + "typescript": "^4.7.4" + } +} -- Gitee From 10715e11dd355c8e78adb73ac36263ba951e29f0 Mon Sep 17 00:00:00 2001 From: "wudefeng@huawei.com" Date: Tue, 5 Jul 2022 21:19:08 +0800 Subject: [PATCH 16/47] add onInterceptRequest api Signed-off-by: wudefeng@huawei.com --- api/@internal/component/ets/web.d.ts | 57 ++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) mode change 100755 => 100644 api/@internal/component/ets/web.d.ts diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts old mode 100755 new mode 100644 index fa6391e1f4..d59b174261 --- a/api/@internal/component/ets/web.d.ts +++ b/api/@internal/component/ets/web.d.ts @@ -533,6 +533,54 @@ declare class WebResourceRequest { * @since 8 */ getResponseCode(): number; + + /** + * Sets the response data. + * @param data the response data. + * + * @since 9 + */ + setResponseData(data: string); + + /** + * Sets the response encoding. + * @param encoding the response encoding. + * + * @since 9 + */ + setResponseEncoding(encoding: string); + + /** + * Sets the response MIME type. + * @param mimeType the response MIME type. + * + * @since 9 + */ + setResponseMimeType(mimeType: string); + + /** + * Sets the reason message. + * @param reason the reason message. + * + * @since 9 + */ + setReasonMessage(reason: string); + + /** + * Sets the response headers. + * @param header the response headers. + * + * @since 9 + */ + setResponseHeader(header: Array
); + + /** + * Gets the response code. + * @param code the response code. + * + * @since 9 + */ + setResponseCode(code: number); } /** @@ -1317,6 +1365,15 @@ declare class WebAttribute extends CommonMethod { * @since 9 */ onHttpAuthRequest(callback: (event?: { result: WebHttpAuthResult }) => boolean): WebAttribute; + + /** + * Triggered when the resouces loading is intercepted. + * @param callback The triggered callback when the resouces loading is intercepted. + * + * @return If the response value is null, the Web will continue to load the resouces. Otherwise, the response value will be used + * @since 9 + */ + onInterceptRequest(callback: (event?: { request: WebResourceRequest}) => WebResourceResponse): WebAttribute; } declare const Web: WebInterface; -- Gitee From 1161684b0656e3f67c6554b650cf895fe4a37ccd Mon Sep 17 00:00:00 2001 From: zhangxin_T Date: Wed, 6 Jul 2022 09:42:45 +0800 Subject: [PATCH 17/47] change Context param type Signed-off-by: zhangxin_T --- api/@ohos.backgroundTaskManager.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.backgroundTaskManager.d.ts b/api/@ohos.backgroundTaskManager.d.ts index 9a2040c32a..4d02b29d42 100644 --- a/api/@ohos.backgroundTaskManager.d.ts +++ b/api/@ohos.backgroundTaskManager.d.ts @@ -15,7 +15,7 @@ import { AsyncCallback , Callback} from './basic'; import { WantAgent } from "./@ohos.wantAgent"; -import { Context } from './app/context'; +import Context from './application/BaseContext'; /** * Manages background tasks. -- Gitee From 585150b4a90b17b2d89ad4af3b8b95a26e3db3fb Mon Sep 17 00:00:00 2001 From: YOUR_NAME Date: Wed, 6 Jul 2022 10:28:31 +0800 Subject: [PATCH 18/47] fix commonevent Signed-off-by: liujiandong --- api/@ohos.commonEvent.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.commonEvent.d.ts b/api/@ohos.commonEvent.d.ts index 7b732362cc..9b00d6108b 100644 --- a/api/@ohos.commonEvent.d.ts +++ b/api/@ohos.commonEvent.d.ts @@ -965,7 +965,7 @@ declare namespace commonEvent { * This is a protected common event that can only be sent by system. * @since 9 */ - COMMON_EVENT_SLOT_CHANGE = "usual.event.SLOT_CHANGE" + COMMON_EVENT_SLOT_CHANGE = "usual.event.SLOT_CHANGE", /** * Indicate the action of a common event that the spn display information has been updated. -- Gitee From 1dcc90040d1c7377f7ee5eb6664f2b189188de3a Mon Sep 17 00:00:00 2001 From: laiguizhong Date: Wed, 6 Jul 2022 15:29:52 +0800 Subject: [PATCH 19/47] modify GesturePath class to interface Signed-off-by: laiguizhong Change-Id: Ic8db093ec308cd8e84369780981f69d317af96bf --- api/@ohos.application.AccessibilityExtensionAbility.d.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/api/@ohos.application.AccessibilityExtensionAbility.d.ts b/api/@ohos.application.AccessibilityExtensionAbility.d.ts index 14fff65e81..12add9c4fa 100644 --- a/api/@ohos.application.AccessibilityExtensionAbility.d.ts +++ b/api/@ohos.application.AccessibilityExtensionAbility.d.ts @@ -71,8 +71,7 @@ declare interface AccessibilityEvent { * @since 9 * @syscap SystemCapability.BarrierFree.Accessibility.Core */ - declare class GesturePath { - constructor(durationTime: number) + declare interface GesturePath { /** * Indicates the position of the points that make up the gesture. */ @@ -88,8 +87,7 @@ declare interface AccessibilityEvent { * @since 9 * @syscap SystemCapability.BarrierFree.Accessibility.Core */ -declare class GesturePoint { - constructor(positionX: number, positionY: number) +declare interface GesturePoint { /** * Indicates the X coordinate of point. */ -- Gitee From a58adcae3710ea123f290206339040acce04600b Mon Sep 17 00:00:00 2001 From: liu-binjun Date: Thu, 30 Jun 2022 17:14:47 +0800 Subject: [PATCH 20/47] feature:add interfaces for api9 Signed-off-by: liu-binjun --- api/@ohos.geolocation.d.ts | 155 ++++++++++++++++++++++++++++++++++++- 1 file changed, 153 insertions(+), 2 deletions(-) diff --git a/api/@ohos.geolocation.d.ts b/api/@ohos.geolocation.d.ts index 13d87e726d..56d7c34f54 100644 --- a/api/@ohos.geolocation.d.ts +++ b/api/@ohos.geolocation.d.ts @@ -149,6 +149,24 @@ declare namespace geolocation { */ function off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent) : void; + /** + * registering the callback function for listening to country code changes. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @param callback Indicates the callback for reporting country code changes. + */ + function on(type: 'countryCodeChange', callback: Callback) : void; + + /** + * unregistering the callback function for listening to country code changes. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @param callback Indicates the callback for reporting country code changes. + */ + function off(type: 'countryCodeChange', callback: Callback) : void; + /** * obtain current location * @@ -286,6 +304,111 @@ declare namespace geolocation { function sendCommand(command: LocationCommand, callback: AsyncCallback) : void; function sendCommand(command: LocationCommand) : Promise; + /** + * Obtain the current country code. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @param callback Indicates the callback for reporting the country code. + */ + function getCountryCode(callback: AsyncCallback) : void; + function getCountryCode() : Promise; + + /** + * enable the geographical location simulation function. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + * @param scenario Indicates the scenarios where location simulation is required. + * @param callback Indicates whether the position simulation function is enabled. + */ + function enableLocationMock(scenario: LocationRequestScenario, callback: AsyncCallback) : void; + function enableLocationMock(scenario: LocationRequestScenario) : Promise; + + /** + * diable the geographical location simulation function. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + * @param scenario Indicates the scenarios where location simulation is required. + * @param callback Indicates whether the position simulation function is enabled. + */ + function disableLocationMock(scenario: LocationRequestScenario, callback: AsyncCallback) : void; + function disableLocationMock(scenario: LocationRequestScenario) : Promise; + + /** + * sets the configuration parameters for location simulation. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + * @param config Indicates the configuration parameters for location simulation. + * @param callback Indicates whether the parameters of the location simulation function are set successfully. + */ + function setMockedLocations(config: LocationMockConfig, callback: AsyncCallback) : void; + function setMockedLocations(config: LocationMockConfig) : Promise; + + /** + * enable the reverse geocoding simulation function. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + * @param callback Indicates whether the reverse geocoding simulation function is enabled. + */ + function enableReverseGeocodingMock(callback: AsyncCallback) : void; + function enableReverseGeocodingMock() : Promise; + + /** + * disable the reverse geocoding simulation function. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + * @param callback Indicates whether the reverse geocoding simulation function is enabled. + */ + function disableReverseGeocodingMock(callback: AsyncCallback) : void; + function disableReverseGeocodingMock() : Promise; + + /** + * sets the configuration parameters for simulating reverse geocoding. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + * @param mockInfos Indicates the set of locations and place names to be simulated. + * @param callback Indicates whether the parameters of the reverse geocoding simulation are set successfully. + */ + function setReverseGeocodingMockInfo(mockInfos: Array, callback: AsyncCallback) : void; + function setReverseGeocodingMockInfo(mockInfos: Array) : Promise; + + /** + * configuration parameters for simulating reverse geocoding. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + */ + export interface ReverseGeocodingMockInfo { + location: ReverseGeoCodeRequest; + geoAddress: GeoAddress; + } + + /** + * parameters for configuring the location simulation function. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + */ + export interface LocationMockConfig { + scenario: LocationRequestScenario; + timeInterval: number; + locations: Array; + } + /** * satellite status information * @@ -425,6 +548,7 @@ declare namespace geolocation { addressUrl?: string; descriptions?: Array; descriptionsSize?: number; + isFromMock: Boolean; } /** @@ -474,6 +598,7 @@ declare namespace geolocation { timeSinceBoot: number; additions?: Array; additionSize?: number; + isFromMock: Boolean; } /** @@ -514,13 +639,15 @@ declare namespace geolocation { * @permission ohos.permission.LOCATION */ export enum GeoLocationErrorCode { - INPUT_PARAMS_ERROR = 101, + NOT_SUPPORTED = 100, + INPUT_PARAMS_ERROR, REVERSE_GEOCODE_ERROR, GEOCODE_ERROR, LOCATOR_ERROR, LOCATION_SWITCH_ERROR, LAST_KNOWN_LOCATION_ERROR, LOCATION_REQUEST_TIMEOUT_ERROR, + QUERY_COUNTRY_CODE_ERROR, } /** @@ -547,6 +674,30 @@ declare namespace geolocation { scenario: LocationRequestScenario; command: string; } + + /** + * country code structure + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + */ + export interface CountryCode { + country: string; + type: CountryCodeType; + } + + /** + * enum for country code type + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + */ + export enum CountryCodeType { + COUNTRY_CODE_FROM_LOCALE = 1, + COUNTRY_CODE_FROM_SIM, + COUNTRY_CODE_FROM_LOCATION, + COUNTRY_CODE_FROM_NETWORK, + } } -export default geolocation; \ No newline at end of file +export default geolocation; -- Gitee From 20801ab318f2549ee4aebeffbb69570dbfdd379a Mon Sep 17 00:00:00 2001 From: "zhaoyi46@huawei.com" Date: Wed, 6 Jul 2022 19:23:57 +0800 Subject: [PATCH 21/47] modify return type to NdefRecord Signed-off-by: zhaoyi46@huawei.com --- api/tag/nfctech.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/tag/nfctech.d.ts b/api/tag/nfctech.d.ts index 2cec52f28c..d163a3d196 100644 --- a/api/tag/nfctech.d.ts +++ b/api/tag/nfctech.d.ts @@ -251,7 +251,7 @@ export interface NdefMessage { * @since 9 * @permission ohos.permission.NFC_TAG */ - makeUriRecord(uri: string): NdefMessage; + makeUriRecord(uri: string): NdefRecord; /** * Create a ndef record with text data. @@ -261,7 +261,7 @@ export interface NdefMessage { * @since 9 * @permission ohos.permission.NFC_TAG */ - makeTextRecord(text: string, locale: string): NdefMessage; + makeTextRecord(text: string, locale: string): NdefRecord; /** * Create a ndef record with mime data. @@ -271,7 +271,7 @@ export interface NdefMessage { * @since 9 * @permission ohos.permission.NFC_TAG */ - makeMimeRecord(mimeType: string, mimeData: string): NdefMessage; + makeMimeRecord(mimeType: string, mimeData: string): NdefRecord; /** * Create a ndef record with external data. @@ -282,7 +282,7 @@ export interface NdefMessage { * @since 9 * @permission ohos.permission.NFC_TAG */ - makeExternalRecord(domainName: string, serviceName: string, externalData: string): NdefMessage; + makeExternalRecord(domainName: string, serviceName: string, externalData: string): NdefRecord; /** * Parse a ndef message into raw bytes. -- Gitee From 9a57fdc993d9eac08e940596d186d8e61b77962c Mon Sep 17 00:00:00 2001 From: liyong Date: Wed, 6 Jul 2022 20:30:18 +0800 Subject: [PATCH 22/47] fix typos Signed-off-by: liyong --- api/@ohos.multimedia.camera.d.ts | 34 +++++++++++++++++--------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/api/@ohos.multimedia.camera.d.ts b/api/@ohos.multimedia.camera.d.ts index da4415ef6d..7b44188356 100644 --- a/api/@ohos.multimedia.camera.d.ts +++ b/api/@ohos.multimedia.camera.d.ts @@ -944,7 +944,7 @@ declare namespace camera { /** * Adds a camera output. - * @param previewOutput Target camera output to add. + * @param cameraOutput Target camera output to add. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core @@ -953,7 +953,7 @@ declare namespace camera { /** * Adds a camera output. - * @param previewOutput Target camera output to add. + * @param cameraOutput Target camera output to add. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core @@ -1179,38 +1179,38 @@ declare namespace camera { setExposureMode(aeMode: ExposureMode): Promise; /** - * Gets current meterring point. - * @param callback Callback used to return the current meterring point. + * Gets current metering point. + * @param callback Callback used to return the current metering point. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - getMeterringPoint(callback: AsyncCallback): void; + getMeteringPoint(callback: AsyncCallback): void; /** - * Gets current meterring point. - * @return Promise used to return the current meterring point. + * Gets current metering point. + * @return Promise used to return the current metering point. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - getMeterringPoint(): Promise; + getMeteringPoint(): Promise; /** - * Set the center point of the meterring area. - * @param point Meterring point + * Set the center point of the metering area. + * @param point Metering point * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - setMeterringPoint(point: Point, callback: AsyncCallback): void; + setMeteringPoint(point: Point, callback: AsyncCallback): void; /** - * Set the center point of the meterring area. - * @param point meterring point + * Set the center point of the metering area. + * @param point metering point * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - setMeterringPoint(point: Point): Promise; + setMeteringPoint(point: Point): Promise; /** * Query the exposure compensation range. @@ -1557,6 +1557,7 @@ declare namespace camera { interface PreviewOutput extends CameraOutput { /** * Add surface id for output instance. + * @param surfaceId Surface object id used in camera preview output. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core @@ -1565,6 +1566,7 @@ declare namespace camera { /** * Add surface id for output instance. + * @param surfaceId Surface object id used in camera preview output. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core @@ -1790,7 +1792,7 @@ declare namespace camera { * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - getDefaultCaptureSetting(): Promise;; + getDefaultCaptureSetting(): Promise; /** * Start capture output. @@ -2152,7 +2154,7 @@ declare namespace camera { * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - interface MetadataOutput { + interface MetadataOutput extends CameraOutput { /** * Start output metadata * @param callback Callback used to return the result. -- Gitee From 15d66deb132ee3fead1e891eb1418392409df33d Mon Sep 17 00:00:00 2001 From: "wudefeng@huawei.com" Date: Thu, 7 Jul 2022 09:43:11 +0800 Subject: [PATCH 23/47] modify interface of setResponseCode notes Signed-off-by: wudefeng@huawei.com --- api/@internal/component/ets/web.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts index d59b174261..f2b0c93a3a 100644 --- a/api/@internal/component/ets/web.d.ts +++ b/api/@internal/component/ets/web.d.ts @@ -575,7 +575,7 @@ declare class WebResourceRequest { setResponseHeader(header: Array
); /** - * Gets the response code. + * Sets the response code. * @param code the response code. * * @since 9 -- Gitee From 88734f8f4c5f3afdfd4c52d41984fe2af413e7b6 Mon Sep 17 00:00:00 2001 From: mingxihua Date: Thu, 7 Jul 2022 09:48:25 +0800 Subject: [PATCH 24/47] mingxihua@huawei.com.cn Signed-off-by: mingxihua --- api/application/Context.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/api/application/Context.d.ts b/api/application/Context.d.ts index 9d37efe5e3..26c6eadcad 100755 --- a/api/application/Context.d.ts +++ b/api/application/Context.d.ts @@ -125,7 +125,6 @@ export default class Context extends BaseContext { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @hide */ area: AreaMode; -- Gitee From 2bbb76a016343bb7e201bfb72566ddc0e546857b Mon Sep 17 00:00:00 2001 From: sunyaozu Date: Thu, 7 Jul 2022 13:01:15 +0800 Subject: [PATCH 25/47] remove static of getLocationName method Signed-off-by: sunyaozu --- api/@ohos.i18n.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.i18n.d.ts b/api/@ohos.i18n.d.ts index 3693f83823..d7dafe4aed 100644 --- a/api/@ohos.i18n.d.ts +++ b/api/@ohos.i18n.d.ts @@ -246,7 +246,7 @@ export class PhoneNumberFormat { * @return Returns a string represents phone number's location. * @since 9 */ - static getLocationName(number: string, locale: string): string; + getLocationName(number: string, locale: string): string; } /** -- Gitee From 0c1669f7a71f4b1527506a1ab358968f547a1292 Mon Sep 17 00:00:00 2001 From: m00512953 Date: Thu, 7 Jul 2022 14:25:01 +0800 Subject: [PATCH 26/47] mingxihua@huawei.com.cn Signed-off-by: m00512953 --- api/@ohos.application.Context.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.application.Context.d.ts b/api/@ohos.application.Context.d.ts index a0d2be051c..d846ad9558 100755 --- a/api/@ohos.application.Context.d.ts +++ b/api/@ohos.application.Context.d.ts @@ -29,7 +29,7 @@ import * as _FormExtensionContext from './application/FormExtensionContext'; * @permission N/A * @StageModelOnly */ -declare namespace applicationContext { +declare namespace context { /** * The context of an ability. It allows access to ability-specific resources. @@ -104,4 +104,4 @@ declare namespace applicationContext { export type FormExtensionContext = _FormExtensionContext.default } -export default applicationContext; \ No newline at end of file +export default context; \ No newline at end of file -- Gitee From b9b51e5e87097211864ff111b622ba8d15dfc4be Mon Sep 17 00:00:00 2001 From: caiminggang Date: Thu, 7 Jul 2022 20:14:16 +0800 Subject: [PATCH 27/47] =?UTF-8?q?EnterpriseDeviceManager=E5=A4=9A=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=8E=A5=E5=8F=A3Callback=E6=A8=A1=E5=BC=8F=E5=8F=AF?= =?UTF-8?q?=E9=80=89=E5=8F=82=E6=95=B0=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: caiminggang --- api/@ohos.enterpriseDeviceManager.d.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/api/@ohos.enterpriseDeviceManager.d.ts b/api/@ohos.enterpriseDeviceManager.d.ts index 1683d8d0fa..db9a787976 100644 --- a/api/@ohos.enterpriseDeviceManager.d.ts +++ b/api/@ohos.enterpriseDeviceManager.d.ts @@ -59,7 +59,8 @@ declare namespace enterpriseDeviceManager { * @return {@code true} if enables administrator success. * @permission ohos.permission.MANAGE_ADMIN */ - function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number, callback: AsyncCallback): void; + function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback): void; + function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback): void; function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise; /** @@ -74,7 +75,8 @@ declare namespace enterpriseDeviceManager { * @return {@code true} if disables administrator success. * @permission ohos.permission.MANAGE_ADMIN */ - function disableAdmin(admin: Want, userId?: number, callback: AsyncCallback): void; + function disableAdmin(admin: Want, callback: AsyncCallback): void; + function disableAdmin(admin: Want, userId: number, callback: AsyncCallback): void; function disableAdmin(admin: Want, userId?: number): Promise; /** @@ -99,7 +101,8 @@ declare namespace enterpriseDeviceManager { * @param userId Indicates the user ID or do not pass user ID. * @return {@code true} if the administrator is enabled. */ - function isAdminEnabled(admin: Want, userId?: number, callback: AsyncCallback): void; + function isAdminEnabled(admin: Want, callback: AsyncCallback): void; + function isAdminEnabled(admin: Want, userId: number, callback: AsyncCallback): void; function isAdminEnabled(admin: Want, userId?: number): Promise; /** -- Gitee From 9a1c19a9e0a226e39319e99a8b37300c077fc1e0 Mon Sep 17 00:00:00 2001 From: liu-binjun Date: Thu, 7 Jul 2022 21:35:24 +0800 Subject: [PATCH 28/47] bugfix:fix review issues Signed-off-by: liu-binjun --- api/@ohos.geolocation.d.ts | 232 ++++++++++++++++++++++++++++++++++--- 1 file changed, 216 insertions(+), 16 deletions(-) diff --git a/api/@ohos.geolocation.d.ts b/api/@ohos.geolocation.d.ts index 56d7c34f54..56c14d6488 100644 --- a/api/@ohos.geolocation.d.ts +++ b/api/@ohos.geolocation.d.ts @@ -165,7 +165,7 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Core * @param callback Indicates the callback for reporting country code changes. */ - function off(type: 'countryCodeChange', callback: Callback) : void; + function off(type: 'countryCodeChange', callback?: Callback) : void; /** * obtain current location @@ -323,8 +323,8 @@ declare namespace geolocation { * @param scenario Indicates the scenarios where location simulation is required. * @param callback Indicates whether the position simulation function is enabled. */ - function enableLocationMock(scenario: LocationRequestScenario, callback: AsyncCallback) : void; - function enableLocationMock(scenario: LocationRequestScenario) : Promise; + function enableLocationMock(scenario?: LocationRequestScenario, callback: AsyncCallback) : void; + function enableLocationMock(scenario?: LocationRequestScenario) : Promise; /** * diable the geographical location simulation function. @@ -335,11 +335,11 @@ declare namespace geolocation { * @param scenario Indicates the scenarios where location simulation is required. * @param callback Indicates whether the position simulation function is enabled. */ - function disableLocationMock(scenario: LocationRequestScenario, callback: AsyncCallback) : void; - function disableLocationMock(scenario: LocationRequestScenario) : Promise; + function disableLocationMock(scenario?: LocationRequestScenario, callback: AsyncCallback) : void; + function disableLocationMock(scenario?: LocationRequestScenario) : Promise; /** - * sets the configuration parameters for location simulation. + * set the configuration parameters for location simulation. * * @since 9 * @syscap SystemCapability.Location.Location.Core @@ -347,8 +347,8 @@ declare namespace geolocation { * @param config Indicates the configuration parameters for location simulation. * @param callback Indicates whether the parameters of the location simulation function are set successfully. */ - function setMockedLocations(config: LocationMockConfig, callback: AsyncCallback) : void; - function setMockedLocations(config: LocationMockConfig) : Promise; + function setMockedLocations(config: LocationMockConfig, callback: AsyncCallback) : void; + function setMockedLocations(config: LocationMockConfig) : Promise; /** * enable the reverse geocoding simulation function. @@ -358,8 +358,8 @@ declare namespace geolocation { * @systemapi * @param callback Indicates whether the reverse geocoding simulation function is enabled. */ - function enableReverseGeocodingMock(callback: AsyncCallback) : void; - function enableReverseGeocodingMock() : Promise; + function enableReverseGeocodingMock(callback: AsyncCallback) : void; + function enableReverseGeocodingMock() : Promise; /** * disable the reverse geocoding simulation function. @@ -369,11 +369,11 @@ declare namespace geolocation { * @systemapi * @param callback Indicates whether the reverse geocoding simulation function is enabled. */ - function disableReverseGeocodingMock(callback: AsyncCallback) : void; - function disableReverseGeocodingMock() : Promise; + function disableReverseGeocodingMock(callback: AsyncCallback) : void; + function disableReverseGeocodingMock() : Promise; /** - * sets the configuration parameters for simulating reverse geocoding. + * set the configuration parameters for simulating reverse geocoding. * * @since 9 * @syscap SystemCapability.Location.Location.Core @@ -381,8 +381,8 @@ declare namespace geolocation { * @param mockInfos Indicates the set of locations and place names to be simulated. * @param callback Indicates whether the parameters of the reverse geocoding simulation are set successfully. */ - function setReverseGeocodingMockInfo(mockInfos: Array, callback: AsyncCallback) : void; - function setReverseGeocodingMockInfo(mockInfos: Array) : Promise; + function setReverseGeocodingMockInfo(mockInfos: Array, callback: AsyncCallback) : void; + function setReverseGeocodingMockInfo(mockInfos: Array) : Promise; /** * configuration parameters for simulating reverse geocoding. @@ -404,7 +404,6 @@ declare namespace geolocation { * @systemapi */ export interface LocationMockConfig { - scenario: LocationRequestScenario; timeInterval: number; locations: Array; } @@ -530,24 +529,123 @@ declare namespace geolocation { * @permission ohos.permission.LOCATION */ export interface GeoAddress { + /** + * Indicates latitude information. + * A positive value indicates north latitude, + * and a negative value indicates south latitude. + * @since 7 + */ latitude?: number; + + /** + * Indicates longitude information. + * A positive value indicates east longitude , + * and a negative value indicates west longitude . + * @since 7 + */ longitude?: number; + + /** + * Indicates language used for the location description. + * zh indicates Chinese, and en indicates English. + * @since 7 + */ locale?: string; + + /** + * Indicates landmark of the location. + * @since 7 + */ placeName?: string; + + /** + * Indicates country code. + * @since 7 + */ countryCode?: string; + + /** + * Indicates country name. + * @since 7 + */ countryName?: string; + + /** + * Indicates administrative region name. + * @since 7 + */ administrativeArea?: string; + + /** + * Indicates sub-administrative region name. + * @since 7 + */ subAdministrativeArea?: string; + + /** + * Indicates locality information. + * @since 7 + */ locality?: string; + + /** + * Indicates sub-locality information. + * @since 7 + */ subLocality?: string; + + /** + * Indicates road name. + * @since 7 + */ roadName?: string; + + /** + * Indicates auxiliary road information. + * @since 7 + */ subRoadName?: string; + + /** + * Indicates house information. + * @since 7 + */ premises?: string; + + /** + * Indicates postal code. + * @since 7 + */ postalCode?: string; + + /** + * Indicates phone number. + * @since 7 + */ phoneNumber?: string; + + /** + * Indicates website URL. + * @since 7 + */ addressUrl?: string; + + /** + * Indicates the amount of additional descriptive information. + * @since 7 + */ descriptions?: Array; + + /** + * Indicates the amount of additional descriptive information. + * @since 7 + */ descriptionsSize?: number; + + /** + * Indicates whether it is an mock GeoAddress + * @since 9 + */ isFromMock: Boolean; } @@ -588,16 +686,74 @@ declare namespace geolocation { * @permission ohos.permission.LOCATION */ export interface Location { + /** + * Indicates latitude information. + * A positive value indicates north latitude, + * and a negative value indicates south latitude. + * @since 7 + */ latitude: number; + + /** + * Indicates Longitude information. + * A positive value indicates east longitude , + * and a negative value indicates west longitude . + * @since 7 + */ longitude: number; + + /** + * Indicates location altitude, in meters. + * @since 7 + */ altitude: number; + + /** + * Indicates location accuracy, in meters. + * @since 7 + */ accuracy: number; + + /** + * Indicates speed, in m/s. + * @since 7 + */ speed: number; + + /** + * Indicates location timestamp in the UTC format. + * @since 7 + */ timeStamp: number; + + /** + * Indicates direction information. + * @since 7 + */ direction: number; + + /** + * Indicates location timestamp since boot. + * @since 7 + */ timeSinceBoot: number; + + /** + * Indicates additional information. + * @since 7 + */ additions?: Array; + + /** + * Indicates the amount of additional descriptive information. + * @since 7 + */ additionSize?: number; + + /** + * Indicates whether it is an mock GeoAddress + * @since 9 + */ isFromMock: Boolean; } @@ -639,14 +795,58 @@ declare namespace geolocation { * @permission ohos.permission.LOCATION */ export enum GeoLocationErrorCode { + /** + * Indicates function not supported. + * @since 7 + */ NOT_SUPPORTED = 100, + + /** + * Indicates input parameter error. + * @since 7 + */ INPUT_PARAMS_ERROR, + + /** + * Indicates reverse geocode query failed. + * @since 7 + */ REVERSE_GEOCODE_ERROR, + + /** + * Indicates geocode query failed. + * @since 7 + */ GEOCODE_ERROR, + + /** + * Indicates positioning failed. + * @since 7 + */ LOCATOR_ERROR, + + /** + * Indicates operation failure caused by abnormal position switch. + * @since 7 + */ LOCATION_SWITCH_ERROR, + + /** + * Indicates failed to get the last cache location. + * @since 7 + */ LAST_KNOWN_LOCATION_ERROR, + + /** + * Indicates location request timeout. + * @since 7 + */ LOCATION_REQUEST_TIMEOUT_ERROR, + + /** + * Indicates country code query failed. + * @since 9 + */ QUERY_COUNTRY_CODE_ERROR, } -- Gitee From 11cff56778ec1ae96dc518f0366dd2c4325a1222 Mon Sep 17 00:00:00 2001 From: m00512953 Date: Fri, 8 Jul 2022 10:01:07 +0800 Subject: [PATCH 29/47] mingxihua@huawei.com.cn Signed-off-by: m00512953 --- api/@ohos.application.Context.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.application.Context.d.ts b/api/@ohos.application.Context.d.ts index d846ad9558..a034f7d45e 100755 --- a/api/@ohos.application.Context.d.ts +++ b/api/@ohos.application.Context.d.ts @@ -65,7 +65,7 @@ declare namespace context { * The base context of 'app.Context' for FA Mode or * 'application.Context' for Stage Mode. * - * @since 8 + * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A */ -- Gitee From 3c4c2ef37168a31977a420fbc7dc05e68c6a88ad Mon Sep 17 00:00:00 2001 From: m00512953 Date: Fri, 8 Jul 2022 10:03:27 +0800 Subject: [PATCH 30/47] mingxihua@huawei.com.cn Signed-off-by: m00512953 --- api/@ohos.ability.featureAbility.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.ability.featureAbility.d.ts b/api/@ohos.ability.featureAbility.d.ts index 1a7f985873..a2ec2ed4a2 100644 --- a/api/@ohos.ability.featureAbility.d.ts +++ b/api/@ohos.ability.featureAbility.d.ts @@ -219,7 +219,7 @@ declare namespace featureAbility { * application-specific resources, request and verification permissions. * Can only be obtained through the ability. * - * @since 6 + * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @import import abilityManager from 'app/context' * @permission N/A -- Gitee From 6bef4a76683b992fef505f35cf165e2fa46ac8c5 Mon Sep 17 00:00:00 2001 From: m00512953 Date: Fri, 8 Jul 2022 10:23:33 +0800 Subject: [PATCH 31/47] mingxihua@huawei.com.cn Signed-off-by: m00512953 --- api/@ohos.ability.featureAbility.d.ts | 1 - ...cation.Context.d.ts => @ohos.application.context.d.ts} | 8 -------- 2 files changed, 9 deletions(-) rename api/{@ohos.application.Context.d.ts => @ohos.application.context.d.ts} (94%) diff --git a/api/@ohos.ability.featureAbility.d.ts b/api/@ohos.ability.featureAbility.d.ts index a2ec2ed4a2..109bd803f5 100644 --- a/api/@ohos.ability.featureAbility.d.ts +++ b/api/@ohos.ability.featureAbility.d.ts @@ -222,7 +222,6 @@ declare namespace featureAbility { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @import import abilityManager from 'app/context' - * @permission N/A * @FAModelOnly */ export type Context = _Context diff --git a/api/@ohos.application.Context.d.ts b/api/@ohos.application.context.d.ts similarity index 94% rename from api/@ohos.application.Context.d.ts rename to api/@ohos.application.context.d.ts index a034f7d45e..b08a47da80 100755 --- a/api/@ohos.application.Context.d.ts +++ b/api/@ohos.application.context.d.ts @@ -26,7 +26,6 @@ import * as _FormExtensionContext from './application/FormExtensionContext'; * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A * @StageModelOnly */ declare namespace context { @@ -36,7 +35,6 @@ declare namespace context { * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A * @StageModelOnly */ export type AbilityContext = _AbilityContext.default @@ -46,7 +44,6 @@ declare namespace context { * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A * @StageModelOnly */ export type AbilityStageContext = _AbilityStageContext.default @@ -56,7 +53,6 @@ declare namespace context { * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A * @StageModelOnly */ export type ApplicationContext = _ApplicationContext.default @@ -67,7 +63,6 @@ declare namespace context { * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A */ export type BaseContext = _BaseContext.default @@ -77,7 +72,6 @@ declare namespace context { * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A * @StageModelOnly */ export type Context = _Context.default @@ -87,7 +81,6 @@ declare namespace context { * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A * @StageModelOnly */ export type ExtensionContext = _ExtensionContext.default @@ -98,7 +91,6 @@ declare namespace context { * * @since 9 * @syscap SystemCapability.Ability.Form - * @permission N/A * @StageModelOnly */ export type FormExtensionContext = _FormExtensionContext.default -- Gitee From 4ad38c18bc435297631874f2d46d4487d33951f0 Mon Sep 17 00:00:00 2001 From: binny1024 Date: Fri, 8 Jul 2022 15:34:28 +0800 Subject: [PATCH 32/47] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=20syscap=20=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: binny1024 --- api/@ohos.application.WindowExtensionAbility.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/@ohos.application.WindowExtensionAbility.d.ts b/api/@ohos.application.WindowExtensionAbility.d.ts index 6d24e6bbdf..e26b8afd68 100644 --- a/api/@ohos.application.WindowExtensionAbility.d.ts +++ b/api/@ohos.application.WindowExtensionAbility.d.ts @@ -21,7 +21,7 @@ import Want from './@ohos.application.Want'; * class of window extension ability. * * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi hide for inner use. * @StageModelOnly */ @@ -30,7 +30,7 @@ export default class WindowExtensionAbility { * Indicates window extension ability context. * * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi hide for inner use. * @StageModelOnly */ @@ -40,7 +40,7 @@ export default class WindowExtensionAbility { * Called back when a window extension is first connected to an ability. * * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.WindowManager.WindowManager.Core * @param want Indicates connection information about the Window ability. * @systemapi hide for inner use. * @return Returns the proxy of the Window ability. @@ -52,7 +52,7 @@ export default class WindowExtensionAbility { * Called back when all abilities connected to a window extension are disconnected. * * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.WindowManager.WindowManager.Core * @param want Indicates disconnection information about the window extension. * @systemapi hide for inner use. * @return - @@ -64,7 +64,7 @@ export default class WindowExtensionAbility { * Called back when window is created. * * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi hide for inner use. * @return - * @StageModelOnly -- Gitee From c37155d0786da429d330c54c987a8052f3727065 Mon Sep 17 00:00:00 2001 From: dy_study Date: Thu, 7 Jul 2022 15:47:23 +0800 Subject: [PATCH 33/47] =?UTF-8?q?IssueNo:#I5FZS6=20Description:BaseContext?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E7=B1=BB=E5=9E=8B=E6=9B=B4=E6=96=B0=20Sig:SI?= =?UTF-8?q?G=5FApplicationFramework=20Feature=20or=20Bugfix:=20Feature=20B?= =?UTF-8?q?inary=20Source:=20No?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dy_study Change-Id: Ia4e614336b93c3ff67080c28ea11c8a62d06d8d8 --- api/application/BaseContext.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/application/BaseContext.d.ts b/api/application/BaseContext.d.ts index 50ab781d4c..9ddd20b757 100644 --- a/api/application/BaseContext.d.ts +++ b/api/application/BaseContext.d.ts @@ -21,7 +21,7 @@ * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A */ -export default interface BaseContext { +export default abstract class BaseContext { /** * Indicates the context is FA Mode or Stage Mode. * @@ -29,4 +29,4 @@ export default interface BaseContext { * @syscap SystemCapability.Ability.AbilityRuntime.Core */ stageMode: boolean; -} \ No newline at end of file +} -- Gitee From ccb1bfc72d5a6b1d97239cb01397c6f9d6327955 Mon Sep 17 00:00:00 2001 From: jidong Date: Tue, 5 Jul 2022 10:45:04 +0800 Subject: [PATCH 34/47] modify appaccount api description Signed-off-by: jidong --- api/@ohos.account.appAccount.d.ts | 84 +++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/api/@ohos.account.appAccount.d.ts b/api/@ohos.account.appAccount.d.ts index 927274ef63..652bdda1fc 100644 --- a/api/@ohos.account.appAccount.d.ts +++ b/api/@ohos.account.appAccount.d.ts @@ -416,6 +416,7 @@ declare namespace appAccount { /** * Checks whether a paticular account has all specified labels. * + * @since 9 * @param name Indicates the account name. * @param owner Indicates the account owner. * @param labels Indicates an array of labels to check. @@ -500,16 +501,22 @@ declare namespace appAccount { interface OAuthTokenInfo { /** * The authentication type. + * + * @since 8 */ authType: string; /** * The token value. + * + * @since 8 */ token: string; /** * The account to which the token belongs. + * + * @since 9 */ account?: AppAccountInfo; } @@ -608,18 +615,95 @@ declare namespace appAccount { * @syscap SystemCapability.Account.AppAccount */ enum Constants { + /** + * Indicates the action for adding account implicitly. + * + * @since 8 + */ ACTION_ADD_ACCOUNT_IMPLICITLY = "addAccountImplicitly", + + /** + * Indicates the action for authenticating. + * + * @since 8 + */ ACTION_AUTHENTICATE = "authenticate", + + /** + * Indicates the key of name. + * + * @since 8 + */ KEY_NAME = "name", + + /** + * Indicates the key of owner. + * + * @since 8 + */ KEY_OWNER = "owner", + + /** + * Indicates the key of token. + * + * @since 8 + */ KEY_TOKEN = "token", + + /** + * Indicates the key of action. + * + * @since 8 + */ KEY_ACTION = "action", + + /** + * Indicates the key of authentiaction type. + * + * @since 8 + */ KEY_AUTH_TYPE = "authType", + + /** + * Indicates the key of session id. + * + * @since 8 + */ KEY_SESSION_ID = "sessionId", + + /** + * Indicates the key of caller pid. + * + * @since 8 + */ KEY_CALLER_PID = "callerPid", + + /** + * Indicates the key of caller uid. + * + * @since 8 + */ KEY_CALLER_UID = "callerUid", + + /** + * Indicates the key of caller bundle name. + * + * @since 8 + */ KEY_CALLER_BUNDLE_NAME = "callerBundleName", + + /** + * Indicates the key of required labels. + * + * @since 9 + */ KEY_REQUIRED_LABELS = "requiredLabels", + + /** + * Indicates the key of boolean result. + * + * @since 9 + */ KEY_BOOLEAN_RESULT = "booleanResult" } -- Gitee From 202d39a8dbdebcdc5918b3e4c9f1fd2483a91487 Mon Sep 17 00:00:00 2001 From: fanxiaoyu Date: Sat, 9 Jul 2022 07:45:45 +0000 Subject: [PATCH 35/47] Adjust RPC sendReuest interface sequence Signed-off-by: fanxiaoyu --- api/@ohos.rpc.d.ts | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/api/@ohos.rpc.d.ts b/api/@ohos.rpc.d.ts index 88bcc1ce35..8cabd1f193 100644 --- a/api/@ohos.rpc.d.ts +++ b/api/@ohos.rpc.d.ts @@ -825,6 +825,24 @@ declare namespace rpc { */ queryLocalInterface(descriptor: string): IRemoteBroker; + /** + * Sends a {@link MessageParcel} message to the peer process in synchronous or asynchronous mode. + * + *

If options indicates the asynchronous mode, a promise will be fulfilled immediately + * and the reply message does not contain any content. If options indicates the synchronous mode, + * a promise will be fulfilled when the response to sendRequest is returned, + * and the reply message contains the returned information. + * param code Message code called by the request, which is determined by the client and server. + * If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool. + * param data {@link MessageParcel} object holding the data to send. + * param reply {@link MessageParcel} object that receives the response. + * param operations Indicates the synchronous or asynchronous mode to send messages. + * @returns Promise used to return the {@link SendRequestResult} instance. + * @throws Throws an exception if the method fails to be called. + * @since 8 + */ + sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): Promise; + /** * Sends a {@link MessageParcel} message to the peer process in synchronous or asynchronous mode. * @@ -845,24 +863,6 @@ declare namespace rpc { */ sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean; - /** - * Sends a {@link MessageParcel} message to the peer process in synchronous or asynchronous mode. - * - *

If options indicates the asynchronous mode, a promise will be fulfilled immediately - * and the reply message does not contain any content. If options indicates the synchronous mode, - * a promise will be fulfilled when the response to sendRequest is returned, - * and the reply message contains the returned information. - * param code Message code called by the request, which is determined by the client and server. - * If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool. - * param data {@link MessageParcel} object holding the data to send. - * param reply {@link MessageParcel} object that receives the response. - * param operations Indicates the synchronous or asynchronous mode to send messages. - * @returns Promise used to return the {@link SendRequestResult} instance. - * @throws Throws an exception if the method fails to be called. - * @since 8 - */ - sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): Promise; - /** * Sends a {@link MessageParcel} message to the peer process in synchronous or asynchronous mode. * -- Gitee From 3a69fc58ee1fda32a1fed73340e2933f50946c29 Mon Sep 17 00:00:00 2001 From: kangchongtao Date: Sat, 9 Jul 2022 16:33:21 +0800 Subject: [PATCH 36/47] =?UTF-8?q?=E5=AE=8C=E5=96=84gridRow=EF=BC=8CgridCol?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=85=A5=E5=8F=82=E5=8F=AF=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=EF=BC=8C=E5=A2=9E=E5=8A=A0GridCol=E5=B1=9E?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: kangchongtao Change-Id: I0b2c5ad5751d9cb4b2501c03234721e503617705 --- api/@internal/component/ets/grid_col.d.ts | 26 +++++++++++++++++++---- api/@internal/component/ets/grid_row.d.ts | 2 +- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/api/@internal/component/ets/grid_col.d.ts b/api/@internal/component/ets/grid_col.d.ts index 82f2162292..cb493ec093 100644 --- a/api/@internal/component/ets/grid_col.d.ts +++ b/api/@internal/component/ets/grid_col.d.ts @@ -64,19 +64,19 @@ declare interface GridColOptions { * Sets the span of current gird-container item. * @since 9 */ - span?: GridColColumnOption; + span?: number | GridColColumnOption; /** * Sets the offset of current gird-container item. * @since 9 */ - offset?: GridColColumnOption; + offset?: number | GridColColumnOption; /** * Sets the order of current gird-container item. * @since 9 */ - order?: GridColColumnOption; + order?: number | GridColColumnOption; } @@ -92,7 +92,25 @@ interface GridColInterface { (optiion?: GridColOptions): GridColAttribute; } -declare class GridColAttribute extends CommonMethod {} +declare class GridColAttribute extends CommonMethod { + /** + * Sets the span of current gird-container item. + * @since 9 + */ + span(value: number | GridColColumnOption): GridRowAttribute; + + /** + * Sets the offset of current gird-container item. + * @since 9 + */ + offset(value: number | GridColColumnOption): GridRowAttribute; + + /** + * Sets the order of current gird-container item. + * @since 9 + */ + order(value: number | GridColColumnOption): GridRowAttribute; +} declare const GridCol: GridColInterface declare const GridColInstance: GridColAttribute; \ No newline at end of file diff --git a/api/@internal/component/ets/grid_row.d.ts b/api/@internal/component/ets/grid_row.d.ts index 8ce36fd362..4105a105f3 100644 --- a/api/@internal/component/ets/grid_row.d.ts +++ b/api/@internal/component/ets/grid_row.d.ts @@ -179,7 +179,7 @@ declare interface GridRowOptions { * grid-container layout column spacing. * @since 9 */ - gutter?: GetterOption; + gutter?: Length | GetterOption; /** * Sets the total number of columns in the current layout. -- Gitee From 57d43aea79c38e8148d87636adf966e28fd89ebd Mon Sep 17 00:00:00 2001 From: yanxiaotao Date: Sun, 10 Jul 2022 10:46:43 +0800 Subject: [PATCH 37/47] update comments for api9 0710 Signed-off-by: yanxiaotao --- api/@ohos.wifi.d.ts | 72 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 61 insertions(+), 11 deletions(-) diff --git a/api/@ohos.wifi.d.ts b/api/@ohos.wifi.d.ts index 21ad360b00..549cfd2cdf 100644 --- a/api/@ohos.wifi.d.ts +++ b/api/@ohos.wifi.d.ts @@ -1070,8 +1070,13 @@ declare namespace wifi { /* @systemapi */ staticIp: IpConfig; - /** EAP config info */ - /* @systemapi */ + /** + * EAP config info. + * + * @since 9 + * @systemapi + * @syscap SystemCapability.Communication.WiFi.STA + */ eapConfig: WifiEapConfig; } @@ -1149,13 +1154,28 @@ declare namespace wifi { /** Channel width */ channelWidth: number; - /** Center frequency */ + /** + * Center frequency 0. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.STA + */ centerFrequency0: number; - /** Center frequency */ + /** + * Center frequency 1. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.STA + */ centerFrequency1: number; - /** Information elements */ + /** + * Information elements. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.STA + */ infoElems: Array; /** Time stamp */ @@ -1184,19 +1204,44 @@ declare namespace wifi { /** Simultaneous Authentication of Equals (SAE) */ WIFI_SEC_TYPE_SAE = 4, - /** EAP authentication */ + /** + * EAP authentication. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.Core + */ WIFI_SEC_TYPE_EAP = 5, - /** SUITE_B_192 192 bit level */ + /** + * SUITE_B_192 192 bit level. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.Core + */ WIFI_SEC_TYPE_EAP_SUITE_B = 6, - /** Opportunististic Wireless Encryption */ + /** + * Opportunististic Wireless Encryption. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.Core + */ WIFI_SEC_TYPE_OWE = 7, - /** WAPI certificate to be specified */ + /** + * WAPI certificate to be specified. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.Core + */ WIFI_SEC_TYPE_WAPI_CERT = 8, - /** WAPI pre-shared key to be specified */ + /** + * WAPI pre-shared key to be specified. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.Core + */ WIFI_SEC_TYPE_WAPI_PSK = 9, } @@ -1243,7 +1288,12 @@ declare namespace wifi { /* @systemapi */ snr: number; - /** Type of macAddress: 0 - real mac, 1 - random mac. */ + /** + * Type of macAddress: 0 - real mac, 1 - random mac. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.STA + */ macType: number; /** The Wi-Fi MAC address of a device. */ -- Gitee From 6c3c025fcff222b35ee599c35864fc875eadbc46 Mon Sep 17 00:00:00 2001 From: yanxiaotao Date: Sun, 10 Jul 2022 10:51:58 +0800 Subject: [PATCH 38/47] update comments for api9 0710 Signed-off-by: yanxiaotao --- api/@ohos.wifi.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.wifi.d.ts b/api/@ohos.wifi.d.ts index 549cfd2cdf..ceba8186e9 100644 --- a/api/@ohos.wifi.d.ts +++ b/api/@ohos.wifi.d.ts @@ -1074,7 +1074,7 @@ declare namespace wifi { * EAP config info. * * @since 9 - * @systemapi + * @systemapi * @syscap SystemCapability.Communication.WiFi.STA */ eapConfig: WifiEapConfig; -- Gitee From 9f175aa9fe30205704c40cef82dac385ec266c25 Mon Sep 17 00:00:00 2001 From: fanxiaoyu Date: Mon, 11 Jul 2022 08:29:16 +0000 Subject: [PATCH 39/47] Adjust RPC sendReuest interface sequence Signed-off-by: fanxiaoyu --- api/@ohos.rpc.d.ts | 66 +++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/api/@ohos.rpc.d.ts b/api/@ohos.rpc.d.ts index 8cabd1f193..2f2119fc3a 100644 --- a/api/@ohos.rpc.d.ts +++ b/api/@ohos.rpc.d.ts @@ -1070,22 +1070,6 @@ declare namespace rpc { */ onRemoteRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean; - /** - * Sends a request to the peer object. - * - *

If the peer object and {@code RemoteObject} are on the same device, the request is sent by the IPC driver. - * If they are on different devices, the request is sent by the socket driver. - * - * @param code Indicates the message code of the request. - * @param data Indicates the {@link MessageParcel} object storing the data to be sent. - * @param reply Indicates the {@link MessageParcel} object receiving the response data. - * @param options Indicates a synchronous (default) or asynchronous request. - * @return Returns {@code true} if the operation succeeds; returns {@code false} otherwise. - * @deprecated since 8 - * @since 7 - */ - sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean; - /** * Sends a {@link MessageParcel} message to the peer process in synchronous or asynchronous mode. * @@ -1104,6 +1088,22 @@ declare namespace rpc { */ sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): Promise; + /** + * Sends a request to the peer object. + * + *

If the peer object and {@code RemoteObject} are on the same device, the request is sent by the IPC driver. + * If they are on different devices, the request is sent by the socket driver. + * + * @param code Indicates the message code of the request. + * @param data Indicates the {@link MessageParcel} object storing the data to be sent. + * @param reply Indicates the {@link MessageParcel} object receiving the response data. + * @param options Indicates a synchronous (default) or asynchronous request. + * @return Returns {@code true} if the operation succeeds; returns {@code false} otherwise. + * @deprecated since 8 + * @since 7 + */ + sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean; + /** * Sends a {@link MessageParcel} message to the peer process in synchronous or asynchronous mode. * @@ -1226,23 +1226,6 @@ declare namespace rpc { */ getInterfaceDescriptor(): string; - /** - * Sends a request to the peer object. - * - *

If the peer object and {@code RemoteProxy} are on the same device, the request is sent by the IPC driver. - * If they are on different devices, the request is sent by the socket driver. - * - * @param code Indicates the message code of the request. - * @param data Indicates the {@link MessageParcel} object storing the data to be sent. - * @param reply Indicates the {@link MessageParcel} object receiving the response data. - * @param options Indicates a synchronous (default) or asynchronous request. - * @return Returns {@code true} if the operation succeeds; returns {@code false} otherwise. - * @throws RemoteException Throws this exception if a remote object exception occurs. - * @deprecated since 8 - * @since 7 - */ - sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean; - /** * Sends a {@link MessageParcel} message to the peer process in synchronous or asynchronous mode. * @@ -1261,6 +1244,23 @@ declare namespace rpc { */ sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): Promise; + /** + * Sends a request to the peer object. + * + *

If the peer object and {@code RemoteProxy} are on the same device, the request is sent by the IPC driver. + * If they are on different devices, the request is sent by the socket driver. + * + * @param code Indicates the message code of the request. + * @param data Indicates the {@link MessageParcel} object storing the data to be sent. + * @param reply Indicates the {@link MessageParcel} object receiving the response data. + * @param options Indicates a synchronous (default) or asynchronous request. + * @return Returns {@code true} if the operation succeeds; returns {@code false} otherwise. + * @throws RemoteException Throws this exception if a remote object exception occurs. + * @deprecated since 8 + * @since 7 + */ + sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean; + /** * Sends a {@link MessageParcel} message to the peer process in synchronous or asynchronous mode. * -- Gitee From 4ab14061737ebb43734eb434436fc6f7c577c264 Mon Sep 17 00:00:00 2001 From: ltdong Date: Mon, 11 Jul 2022 16:38:19 +0800 Subject: [PATCH 40/47] Exposes the secondary module ResultSet. Signed-off-by: ltdong --- api/@ohos.data.rdb.d.ts | 4 +++- api/data/rdb/resultSet.d.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index 71837d5297..07b0460791 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -14,7 +14,7 @@ */ import {AsyncCallback, Callback} from './basic'; -import { ResultSet } from './data/rdb/resultSet'; +import { ResultSet as _ResultSet } from './data/rdb/resultSet'; import Context from "./application/BaseContext"; import dataSharePredicates from './@ohos.data.dataSharePredicates'; @@ -709,6 +709,8 @@ declare namespace rdb { */ notIn(field: string, value: Array): RdbPredicates; } + + export type ResultSet = _ResultSet } export default rdb; diff --git a/api/data/rdb/resultSet.d.ts b/api/data/rdb/resultSet.d.ts index 4c8065184d..79d07883d2 100755 --- a/api/data/rdb/resultSet.d.ts +++ b/api/data/rdb/resultSet.d.ts @@ -22,7 +22,7 @@ import { AsyncCallback } from '../../basic' * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @import import data_rdb from '@ohos.data.rdb'; */ -interface ResultSet { +export default interface ResultSet { /** * Obtains the names of all columns in a result set. * -- Gitee From f500a10f8651f633c1b9914f666dc89524945f4a Mon Sep 17 00:00:00 2001 From: liyong Date: Mon, 11 Jul 2022 20:29:58 +0800 Subject: [PATCH 41/47] revert camera intf. Signed-off-by: liyong --- api/@ohos.multimedia.camera.d.ts | 1575 +++++++----------------------- 1 file changed, 360 insertions(+), 1215 deletions(-) diff --git a/api/@ohos.multimedia.camera.d.ts b/api/@ohos.multimedia.camera.d.ts index 7b44188356..18c9ad1114 100644 --- a/api/@ohos.multimedia.camera.d.ts +++ b/api/@ohos.multimedia.camera.d.ts @@ -74,72 +74,6 @@ declare namespace camera { CAMERA_STATUS_UNAVAILABLE } - /** - * Profile for camera streams. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface Profile { - /** - * Camera format. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - readonly format: CameraFormat; - /** - * Picture size. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - readonly size: Size; - } - - /** - * Video profile. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface VideoProfile extends Profile { - /** - * Frame rate in unit fps (frames per second). - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - readonly frameRate: Array; - } - - /** - * Camera output capability. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface CameraOutputCapability { - /** - * Preview profiles. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - readonly previewProfiles: Array; - /** - * Photo profiles. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - readonly photoProfiles: Array; - /** - * Video profiles. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - readonly videoProfiles: Array; - /** - * All the supported metadata Object Types. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - readonly supportedMetadataObjectTypes: Array; - } - /** * Camera manager object. * @since 9 @@ -147,58 +81,40 @@ declare namespace camera { */ interface CameraManager { /** - * Gets supported camera descriptions. + * Gets all camera descriptions. * @param callback Callback used to return the array of supported cameras. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - getSupportedCameras(callback: AsyncCallback>): void; + getCameras(callback: AsyncCallback>): void; /** - * Gets supported camera descriptions. + * Gets all camera descriptions. * @return Promise used to return an array of supported cameras. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - getSupportedCameras(): Promise>; - - /** - * Gets supported output capability for specific camera. - * @param camera Camera device. - * @param callback Callback used to return the camera output capability. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getSupportedOutputCapability(camera: CameraDevice, callback: AsyncCallback): void; - - /** - * Gets supported output capability for specific camera. - * @param camera Camera device. - * @return Promise used to return the camera output capability. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getSupportedOutputCapability(camera: CameraDevice): Promise; + getCameras(): Promise>; /** - * Creates a CameraInput instance by camera. - * @param camera Camera device used to create the instance. + * Creates a CameraInput instance by camera id. + * @param cameraId Camera ID used to create the instance. * @param callback Callback used to return the CameraInput instance. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core * @permission ohos.permission.CAMERA */ - createCameraInput(camera: CameraDevice, callback: AsyncCallback): void; + createCameraInput(cameraId: string, callback: AsyncCallback): void; /** - * Creates a CameraInput instance by camera. - * @param camera Camera device used to create the instance. + * Creates a CameraInput instance by camera id. + * @param cameraId Camera ID used to create the instance. * @return Promise used to return the CameraInput instance. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core * @permission ohos.permission.CAMERA */ - createCameraInput(camera: CameraDevice): Promise; + createCameraInput(cameraId: string): Promise; /** * Creates a CameraInput instance by camera position and type. @@ -222,118 +138,6 @@ declare namespace camera { */ createCameraInput(position: CameraPosition, type: CameraType): Promise; - /** - * Creates a PreviewOutput instance. - * @param profile Preview output profile. - * @param surfaceId Surface object id used in camera photo output. - * @param callback Callback used to return the PreviewOutput instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void; - - /** - * Creates a PreviewOutput instance. - * @param profile Preview output profile. - * @param surfaceId Surface object id used in camera photo output. - * @return Promise used to return the PreviewOutput instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createPreviewOutput(profile: Profile, surfaceId: string): Promise; - - /** - * Creates a deferred PreviewOutput instance. - * @param profile Preview output profile. - * @param callback Callback used to return the PreviewOutput instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createDeferredPreviewOutput(profile: Profile, callback: AsyncCallback): void; - - /** - * Creates a deferred PreviewOutput instance. - * @param profile Preview output profile. - * @return Promise used to return the PreviewOutput instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createDeferredPreviewOutput(profile: Profile): Promise; - - /** - * Creates a PhotoOutput instance. - * @param profile Photo output profile. - * @param surfaceId Surface object id used in camera photo output. - * @param callback Callback used to return the PhotoOutput instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void; - - /** - * Creates a PhotoOutput instance. - * @param profile Photo output profile. - * @param surfaceId Surface object id used in camera photo output. - * @return Promise used to return the PhotoOutput instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createPhotoOutput(profile: Profile, surfaceId: string): Promise; - - /** - * Creates a VideoOutput instance. - * @param profile Video profile. - * @param surfaceId Surface object id used in camera video output. - * @param callback Callback used to return the VideoOutput instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback): void; - - /** - * Creates a VideoOutput instance. - * @param profile Video profile. - * @param surfaceId Surface object id used in camera video output. - * @return Promise used to return the VideoOutput instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createVideoOutput(profile: VideoProfile, surfaceId: string): Promise; - - /** - * Creates a MetadataOutput instance. - * @param metadataObjectTypes Array of MetadataObjectType. - * @param callback Callback used to return the MetadataOutput instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createMetadataOutput(metadataObjectTypes: Array, callback: AsyncCallback): void; - - /** - * Creates a MetadataOutput instance. - * @param metadataObjectTypes Array of MetadataObjectType. - * @return Promise used to return the MetadataOutput instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createMetadataOutput(metadataObjectTypes: Array): Promise; - - /** - * Gets a CaptureSession instance. - * @param callback Callback used to return the CaptureSession instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createCaptureSession(callback: AsyncCallback): void; - - /** - * Gets a CaptureSession instance. - * @return Promise used to return the CaptureSession instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createCaptureSession(): Promise; - /** * Subscribes camera status change event callback. * @param type Event type. @@ -355,7 +159,7 @@ declare namespace camera { * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - camera: CameraDevice; + camera: Camera; /** * Current camera status. * @since 9 @@ -461,11 +265,11 @@ declare namespace camera { } /** - * Camera device object. + * Camera object. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - interface CameraDevice { + interface Camera { /** * Camera id attribute. * @since 9 @@ -513,210 +317,284 @@ declare namespace camera { } /** - * Point parameter. + * Camera input object. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - interface Point { + interface CameraInput { /** - * x co-ordinate + * Gets camera id. + * @param callback Callback used to return the camera ID. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - x: number; + getCameraId(callback: AsyncCallback): void; + /** - * y co-ordinate + * Gets camera id. + * @return Promise used to return the camera ID. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - y: number; - } + getCameraId(): Promise; - /** - * Camera input object. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface CameraInput { /** - * Open camera. - * @param callback Callback used to return the result. + * Check if device has flash light. + * @param callback Callback used to return the flash light support status. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - open(callback: AsyncCallback): void; + hasFlash(callback: AsyncCallback): void; /** - * Open camera. - * @return Promise used to return the result. + * Check if device has flash light. + * @return Promise used to return the flash light support status. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - open(): Promise; + hasFlash(): Promise; /** - * Close camera. - * @param callback Callback used to return the result. + * Checks whether a specified flash mode is supported. + * @param flashMode Flash mode. + * @param callback Callback used to return the flash light support status. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - close(callback: AsyncCallback): void; + isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback): void; /** - * Close camera. - * @return Promise used to return the result. + * Checks whether a specified flash mode is supported. + * @param flashMode Flash mode + * @return Promise used to return flash mode support status. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - close(): Promise; + isFlashModeSupported(flashMode: FlashMode): Promise; /** - * Releases instance. - * @param callback Callback used to return the result. + * Gets current flash mode. + * @param callback Callback used to return the current flash mode. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - release(callback: AsyncCallback): void; + getFlashMode(callback: AsyncCallback): void; /** - * Releases instance. - * @return Promise used to return the result. + * Gets current flash mode. + * @return Promise used to return the flash mode. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - release(): Promise; + getFlashMode(): Promise; /** - * Subscribes error event callback. - * @param type Event type. - * @param camera Camera device. - * @param callback Callback used to get the camera input errors. + * Sets flash mode. + * @param flashMode Target flash mode. + * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void; - } + setFlashMode(flashMode: FlashMode, callback: AsyncCallback): void; - /** - * Enum for CameraInput error code. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - enum CameraInputErrorCode { /** - * Unknown error. + * Sets flash mode. + * @param flashMode Target flash mode. + * @return Promise used to return the result. * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core */ - ERROR_UNKNOWN = -1, + setFlashMode(flashMode: FlashMode): Promise; + /** - * No permission. + * Checks whether a specified focus mode is supported. + * @param afMode Focus mode. + * @param callback Callback used to return the device focus support status. * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core */ - ERROR_NO_PERMISSION, + isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback): void; + /** - * Camera device preempted. + * Checks whether a specified focus mode is supported. + * @param afMode Focus mode. + * @return Promise used to return the focus mode support status. * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core */ - ERROR_DEVICE_PREEMPTED, + isFocusModeSupported(afMode: FocusMode): Promise; + /** - * Camera device disconnected. + * Gets current focus mode. + * @param callback Callback used to return the current focus mode. * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core */ - ERROR_DEVICE_DISCONNECTED, + getFocusMode(callback: AsyncCallback): void; + /** - * Camera device in use. + * Gets current focus mode. + * @return Promise used to return the focus mode. * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core */ - ERROR_DEVICE_IN_USE, + getFocusMode(): Promise; + /** - * Driver error. + * Sets focus mode. + * @param afMode Target focus mode. + * @param callback Callback used to return the result. * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core */ - ERROR_DRIVER_ERROR, - } - - /** - * Camera input error object. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface CameraInputError extends Error { - code: CameraInputErrorCode; - } + setFocusMode(afMode: FocusMode, callback: AsyncCallback): void; - /** - * Enum for camera format type. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - enum CameraFormat { /** - * YUV 420 Format. + * Sets focus mode. + * @param afMode Target focus mode. + * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - CAMERA_FORMAT_YUV_420_SP = 1003, + setFocusMode(afMode: FocusMode): Promise; /** - * JPEG Format. + * Gets all supported zoom ratio range. + * @param callback Callback used to return the zoom ratio range. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - CAMERA_FORMAT_JPEG = 2000 - } + getZoomRatioRange(callback: AsyncCallback>): void; - /** - * Enum for flash mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - enum FlashMode { /** - * Close mode. + * Gets all supported zoom ratio range. + * @return Promise used to return the zoom ratio range. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - FLASH_MODE_CLOSE = 0, + getZoomRatioRange(): Promise>; + /** - * Open mode. + * Gets zoom ratio. + * @param callback Callback used to return the current zoom ratio value. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - FLASH_MODE_OPEN, + getZoomRatio(callback: AsyncCallback): void; + /** - * Auto mode. + * Gets zoom ratio. + * @return Promise used to return the zoom ratio value. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - FLASH_MODE_AUTO, + getZoomRatio(): Promise; + /** - * Always open mode. + * Sets zoom ratio. + * @param zoomRatio Target zoom ratio. + * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - FLASH_MODE_ALWAYS_OPEN - } + setZoomRatio(zoomRatio: number, callback: AsyncCallback): void; + + /** + * Sets zoom ratio. + * @param zoomRatio Target zoom ratio. + * @return Promise used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + setZoomRatio(zoomRatio: number): Promise; + + /** + * Releases instance. + * @param callback Callback used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + release(callback: AsyncCallback): void; + + /** + * Releases instance. + * @return Promise used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + release(): Promise; + + /** + * Subscribes focus status change event callback. + * @param type Event type. + * @param callback Callback used to get the focus state change. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + on(type: 'focusStateChange', callback: AsyncCallback): void; + + /** + * Subscribes error event callback. + * @param type Event type. + * @param callback Callback used to get the camera input errors. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + on(type: 'error', callback: ErrorCallback): void; + } + + /** + * Enum for CameraInput error code. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + enum CameraInputErrorCode { + /** + * Unknown error. + * @since 9 + */ + ERROR_UNKNOWN = -1 + } + + /** + * Camera input error object. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + interface CameraInputError extends Error { + code: CameraInputErrorCode; + } /** - * Enum for exposure mode. + * Enum for flash mode. * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core */ - enum ExposureMode { + enum FlashMode { + /** + * Close mode. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + FLASH_MODE_CLOSE = 0, /** - * Lock exposure mode. + * Open mode. * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core */ - EXPOSURE_MODE_LOCKED = 0, + FLASH_MODE_OPEN, /** - * Auto exposure mode. + * Auto mode. * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core */ - EXPOSURE_MODE_AUTO, - /** - * Continuous automatic exposure. + FLASH_MODE_AUTO, + /** + * Always open mode. * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core */ - EXPOSURE_MODE_CONTINUOUS_AUTO + FLASH_MODE_ALWAYS_OPEN } /** @@ -778,59 +656,22 @@ declare namespace camera { } /** - * Enum for exposure state. + * Gets a CaptureSession instance. + * @param context Current application context. + * @param callback Callback used to return the CaptureSession instance. * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core */ - enum ExposureState { - /** - * Scan state. - * @since 8 - */ - EXPOSURE_STATE_SCAN = 0, - /** - * Converged state. - * @since 8 - */ - EXPOSURE_STATE_CONVERGED - } + function createCaptureSession(context: Context, callback: AsyncCallback): void; /** - * Enum for video stabilization mode. + * Gets a CaptureSession instance. + * @param context Current application context. + * @return Promise used to return the CaptureSession instance. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - enum VideoStabilizationMode { - /** - * Turn off video stablization. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - OFF = 0, - /** - * LOW mode provides basic stabilization effect. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - LOW, - /** - * MIDDLE mode means algorithms can achieve better effects than LOW mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - MIDDLE, - /** - * HIGH mode means algorithms can achieve better effects than MIDDLE mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - HIGH, - /** - * Camera HDF can select mode automatically. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - AUTO - } + function createCaptureSession(context: Context): Promise; /** * Capture session object. @@ -871,176 +712,180 @@ declare namespace camera { commitConfig(): Promise; /** - * Check whether the camera input can be added. + * Adds a camera input. * @param cameraInput Target camera input to add. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - canAddInput(cameraInput: CameraInput, callback: AsyncCallback): void; + addInput(cameraInput: CameraInput, callback: AsyncCallback): void; /** - * Check whether the camera input can be added. + * Adds a camera input. * @param cameraInput Target camera input to add. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - canAddInput(cameraInput: CameraInput): Promise; + addInput(cameraInput: CameraInput): Promise; /** - * Adds a camera input. - * @param cameraInput Target camera input to add. + * Adds a camera preview output. + * @param previewOutput Target camera preview output to add. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - addInput(cameraInput: CameraInput, callback: AsyncCallback): void; + addOutput(previewOutput: PreviewOutput, callback: AsyncCallback): void; /** - * Adds a camera input. - * @param cameraInput Target camera input to add. + * Adds a camera preview output. + * @param previewOutput Target camera preview output to add. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - addInput(cameraInput: CameraInput): Promise; + addOutput(previewOutput: PreviewOutput): Promise; /** - * Removes a camera input. - * @param cameraInput Target camera input to remove. + * Adds a camera photo output. + * @param photoOutput Target camera photo output to add. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - removeInput(cameraInput: CameraInput, callback: AsyncCallback): void; + addOutput(photoOutput: PhotoOutput, callback: AsyncCallback): void; /** - * Removes a camera input. - * @param cameraInput Target camera input to remove. + * Adds a camera photo output. + * @param photoOutput Target camera photo output to add. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - removeInput(cameraInput: CameraInput): Promise; + addOutput(photoOutput: PhotoOutput): Promise; /** - * Check whether the camera output can be added. - * @param cameraOutput Target camera output to add. + * Adds a camera video output. + * @param videoOutput Target camera video output to add. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - canAddOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void; + addOutput(videoOutput: VideoOutput, callback: AsyncCallback): void; /** - * Check whether the camera output can be added. - * @param cameraInput Target camera output to add. + * Adds a camera video output. + * @param videoOutput Target camera video output to add. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - canAddOutput(cameraOutput: CameraOutput): Promise; + addOutput(videoOutput: VideoOutput): Promise; /** - * Adds a camera output. - * @param cameraOutput Target camera output to add. + * Removes a camera input. + * @param cameraInput Target camera input to remove. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - addOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void; + removeInput(cameraInput: CameraInput, callback: AsyncCallback): void; /** - * Adds a camera output. - * @param cameraOutput Target camera output to add. + * Removes a camera input. + * @param cameraInput Target camera input to remove. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - addOutput(cameraOutput: CameraOutput): Promise; + removeInput(cameraInput: CameraInput): Promise; /** - * Removes a camera output. - * @param previewOutput Target camera output to remove. + * Removes a camera preview output. + * @param previewOutput Target camera preview output to remove. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void; + removeOutput(previewOutput: PreviewOutput, callback: AsyncCallback): void; /** - * Removes a camera output. - * @param previewOutput Target camera output to remove. + * Removes a camera preview output. + * @param previewOutput Target camera preview output to remove. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - removeOutput(cameraOutput: CameraOutput): Promise; + removeOutput(previewOutput: PreviewOutput): Promise; /** - * Starts capture session. + * Removes a camera photo output. + * @param photoOutput Target camera photo output to remove. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - start(callback: AsyncCallback): void; + removeOutput(photoOutput: PhotoOutput, callback: AsyncCallback): void; /** - * Starts capture session. + * Removes a camera photo output. + * @param photoOutput Target camera photo output to remove. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - start(): Promise; + removeOutput(photoOutput: PhotoOutput): Promise; /** - * Stops capture session. + * Removes a camera video output. + * @param videoOutput Target camera video output to remove. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - stop(callback: AsyncCallback): void; + removeOutput(videoOutput: VideoOutput, callback: AsyncCallback): void; /** - * Stops capture session. + * Removes a camera video output. + * @param videoOutput Target camera video output to remove. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - stop(): Promise; + removeOutput(videoOutput: VideoOutput): Promise; /** - * Lock the session for exclusive control. + * Starts capture session. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - lockForControl(callback: AsyncCallback): void; + start(callback: AsyncCallback): void; /** - * Lock the session for exclusive control. + * Starts capture session. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - lockForControl(): Promise; + start(): Promise; /** - * Unlock the session after exclusive control. + * Stops capture session. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - unlockForControl(callback: AsyncCallback): void; + stop(callback: AsyncCallback): void; /** - * Unlock the session after exclusive control. + * Stops capture session. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - unlockForControl(): Promise; + stop(): Promise; /** * Release capture session instance. @@ -1059,551 +904,72 @@ declare namespace camera { release(): Promise; /** - * Check if device has flash light. - * @param callback Callback used to return the flash light support status. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - hasFlash(callback: AsyncCallback): void; - - /** - * Check if device has flash light. - * @return Promise used to return the flash light support status. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - hasFlash(): Promise; - - /** - * Checks whether a specified flash mode is supported. - * @param flashMode Flash mode. - * @param callback Callback used to return the flash light support status. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback): void; - - /** - * Checks whether a specified flash mode is supported. - * @param flashMode Flash mode - * @return Promise used to return flash mode support status. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - isFlashModeSupported(flashMode: FlashMode): Promise; - - /** - * Gets current flash mode. - * @param callback Callback used to return the current flash mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getFlashMode(callback: AsyncCallback): void; - - /** - * Gets current flash mode. - * @return Promise used to return the flash mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getFlashMode(): Promise; - - /** - * Sets flash mode. - * @param flashMode Target flash mode. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setFlashMode(flashMode: FlashMode, callback: AsyncCallback): void; - - /** - * Sets flash mode. - * @param flashMode Target flash mode. - * @return Promise used to return the result. + * Subscribes error event callback. + * @param type Event type. + * @param callback Callback used to get the capture session errors. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - setFlashMode(flashMode: FlashMode): Promise; + on(type: 'error', callback: ErrorCallback): void; + } - /** - * Checks whether a specified exposure mode is supported. - * @param aeMode Exposure mode. - * @param callback Callback used to return the exposure mode support status. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback): void; + /** + * Enum for CaptureSession error code. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + enum CaptureSessionErrorCode { + ERROR_UNKNOWN = -1 + } - /** - * Checks whether a specified exposure mode is supported. - * @param aeMode Exposure mode - * @return Promise used to return exposure mode support status. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - isExposureModeSupported(aeMode: ExposureMode): Promise; - - /** - * Gets current exposure mode. - * @param callback Callback used to return the current exposure mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getExposureMode(callback: AsyncCallback): void; + /** + * Capture session error object. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + interface CaptureSessionError extends Error { + code: CaptureSessionErrorCode; + } - /** - * Gets current exposure mode. - * @return Promise used to return the current exposure mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getExposureMode(): Promise; - - /** - * Sets exposure mode. - * @param aeMode Exposure mode - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setExposureMode(aeMode: ExposureMode, callback: AsyncCallback): void; - - /** - * Sets Exposure mode. - * @param aeMode Exposure mode - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setExposureMode(aeMode: ExposureMode): Promise; - - /** - * Gets current metering point. - * @param callback Callback used to return the current metering point. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getMeteringPoint(callback: AsyncCallback): void; - - /** - * Gets current metering point. - * @return Promise used to return the current metering point. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getMeteringPoint(): Promise; - - /** - * Set the center point of the metering area. - * @param point Metering point - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setMeteringPoint(point: Point, callback: AsyncCallback): void; - - /** - * Set the center point of the metering area. - * @param point metering point - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setMeteringPoint(point: Point): Promise; - - /** - * Query the exposure compensation range. - * @param callback Callback used to return the array of compenstation range. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getExposureBiasRange(callback: AsyncCallback>): void; - - /** - * Query the exposure compensation range. - * @return Promise used to return the array of compenstation range. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getExposureBiasRange(): Promise>; - - /** - * Set exposure compensation. - * @param exposureBias Exposure compensation - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setExposureBias(exposureBias: number, callback: AsyncCallback): void; - - /** - * Set exposure compensation. - * @param exposureBias Exposure compensation - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setExposureBias(exposureBias: number): Promise; - - /** - * Query the exposure value. - * @param callback Callback used to return the exposure value. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getExposureValue(callback: AsyncCallback): void; - - /** - * Query the exposure value. - * @return Promise used to return the exposure value. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getExposureValue(): Promise; - - /** - * Checks whether a specified focus mode is supported. - * @param afMode Focus mode. - * @param callback Callback used to return the device focus support status. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback): void; - - /** - * Checks whether a specified focus mode is supported. - * @param afMode Focus mode. - * @return Promise used to return the focus mode support status. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - isFocusModeSupported(afMode: FocusMode): Promise; - - /** - * Gets current focus mode. - * @param callback Callback used to return the current focus mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getFocusMode(callback: AsyncCallback): void; - - /** - * Gets current focus mode. - * @return Promise used to return the focus mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getFocusMode(): Promise; - - /** - * Sets focus mode. - * @param afMode Target focus mode. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setFocusMode(afMode: FocusMode, callback: AsyncCallback): void; - - /** - * Sets focus mode. - * @param afMode Target focus mode. - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setFocusMode(afMode: FocusMode): Promise; - - /** - * Sets focus point. - * @param point Target focus point. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setFocusPoint(point: Point, callback: AsyncCallback): void; - - /** - * Sets focus point. - * @param afMode Target focus point. - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setFocusPoint(point: Point): Promise; - - /** - * Gets current focus point. - * @param callback Callback used to return the current focus point. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getFocusPoint(callback: AsyncCallback): void; - - /** - * Gets current focus point. - * @return Promise used to return the current focus point. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getFocusPoint(): Promise; - - /** - * Gets current focal length. - * @param callback Callback used to return the current focal point. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getFocalLength(callback: AsyncCallback): void; - - /** - * Gets current focal length. - * @return Promise used to return the current focal point. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getFocalLength(): Promise; - - /** - * Gets all supported zoom ratio range. - * @param callback Callback used to return the zoom ratio range. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getZoomRatioRange(callback: AsyncCallback>): void; - - /** - * Gets all supported zoom ratio range. - * @return Promise used to return the zoom ratio range. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getZoomRatioRange(): Promise>; - - /** - * Gets zoom ratio. - * @param callback Callback used to return the current zoom ratio value. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getZoomRatio(callback: AsyncCallback): void; - - /** - * Gets zoom ratio. - * @return Promise used to return the zoom ratio value. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getZoomRatio(): Promise; - - /** - * Sets zoom ratio. - * @param zoomRatio Target zoom ratio. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setZoomRatio(zoomRatio: number, callback: AsyncCallback): void; - - /** - * Sets zoom ratio. - * @param zoomRatio Target zoom ratio. - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setZoomRatio(zoomRatio: number): Promise; - - /** - * Check whether the specified video stabilization mode is supported. - * @param vsMode Video Stabilization mode. - * @param callback Callback used to return if video stablization mode is supported. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - isVideoStablizationModeSupported(vsMode: VideoStabilizationMode, callback: AsyncCallback): void; - - /** - * Check whether the specified video stabilization mode is supported. - * @param callback Callback used to return if video stablization mode is supported. - * @return Promise used to return flash mode support status. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - isVideoStablizationModeSupported(vsMode: VideoStabilizationMode): Promise; - - /** - * Query the video stabilization mode currently in use. - * @param callback Callback used to return the current video stabilization mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getActiveVideoStabilizationMode(callback: AsyncCallback): void; - - /** - * Query the video stabilization mode currently in use. - * @return Promise used to return the current video stabilization mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getActiveVideoStabilizationMode(): Promise; - - /** - * Set video stabilization mode. - * @param mode video stabilization mode to set. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setVideoStabilizationMode(mode: VideoStabilizationMode, callback: AsyncCallback): void; - - /** - * Set video stabilization mode. - * @param mode video stabilization mode to set. - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setVideoStabilizationMode(mode: VideoStabilizationMode): Promise; - - /** - * Subscribes focus status change event callback. - * @param type Event type. - * @param callback Callback used to get the focus state change. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - on(type: 'focusStateChange', callback: AsyncCallback): void; - - /** - * Subscribes exposure status change event callback. - * @param type Event type. - * @param callback Callback used to get the exposure state change. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - on(type: 'exposureStateChange', callback: AsyncCallback): void; - - /** - * Subscribes error event callback. - * @param type Event type. - * @param callback Callback used to get the capture session errors. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - on(type: 'error', callback: ErrorCallback): void; - } - - /** - * Enum for CaptureSession error code. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - enum CaptureSessionErrorCode { - /** - * Unknown error. - * @since 9 - */ - ERROR_UNKNOWN = -1, - /** - * Insufficient resources. - * @since 9 - */ - ERROR_INSUFFICIENT_RESOURCES, - /** - * Timeout error. - * @since 9 - */ - ERROR_TIMEOUT, - } - - /** - * Capture session error object. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface CaptureSessionError extends Error { - code: CaptureSessionErrorCode; - } - - /** - * Camera output object. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface CameraOutput { - /** - * Release output instance. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - release(callback: AsyncCallback): void; - - /** - * Release output instance. - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - release(): Promise; - } + /** + * Creates a PreviewOutput instance. + * @param surfaceId Surface object id used in camera preview output. + * @param callback Callback used to return the PreviewOutput instance. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + function createPreviewOutput(surfaceId: string, callback: AsyncCallback): void; /** - * Preview output object. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface PreviewOutput extends CameraOutput { - /** - * Add surface id for output instance. - * @param surfaceId Surface object id used in camera preview output. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - addDeferredSurface(surfaceId: string, callback: AsyncCallback): void; - - /** - * Add surface id for output instance. - * @param surfaceId Surface object id used in camera preview output. - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - addDeferredSurface(surfaceId: string): Promise; - - /** - * Start output instance. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - start(callback: AsyncCallback): void; - - /** - * Start output instance. - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - start(): Promise; + * Creates a PreviewOutput instance. + * @param surfaceId Surface object id used in camera preview output. + * @return Promise used to return the PreviewOutput instance. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + function createPreviewOutput(surfaceId: string): Promise; + /** + * Preview output object. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + interface PreviewOutput { /** - * Stop output instance. + * Release output instance. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - stop(callback: AsyncCallback): void; + release(callback: AsyncCallback): void; /** - * Stop output instance. + * Release output instance. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - stop(): Promise; + release(): Promise; /** * Subscribes frame start event callback. @@ -1639,11 +1005,7 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core */ enum PreviewOutputErrorCode { - /** - * Unknown error. - * @since 9 - */ - ERROR_UNKNOWN = -1, + ERROR_UNKNOWN = -1 } /** @@ -1655,6 +1017,24 @@ declare namespace camera { code: PreviewOutputErrorCode; } + /** + * Creates a PhotoOutput instance. + * @param surfaceId Surface object id used in camera photo output. + * @param callback Callback used to return the PhotoOutput instance. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + function createPhotoOutput(surfaceId: string, callback: AsyncCallback): void; + + /** + * Creates a PhotoOutput instance. + * @param surfaceId Surface object id used in camera photo output. + * @return Promise used to return the PhotoOutput instance. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + function createPhotoOutput(surfaceId: string): Promise; + /** * Enumerates the image rotation angles. * @since 9 @@ -1690,26 +1070,6 @@ declare namespace camera { ROTATION_270 = 270 } - interface Location { - /** - * Latitude. - * @since 9 - */ - latitude: number; - - /** - * Longitude. - * @since 9 - */ - longitude: number; - - /** - * Altitude. - * @since 9 - */ - altitude: number; - } - /** * Enumerates the image quality levels. * @since 9 @@ -1749,27 +1109,12 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core */ quality?: QualityLevel; - /** * Photo rotation. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ rotation?: ImageRotation; - - /** - * Photo location. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - location?: Location; - - /** - * Set the mirror photo function switch, default to false. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - mirror?: boolean; } /** @@ -1777,23 +1122,7 @@ declare namespace camera { * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - interface PhotoOutput extends CameraOutput { - /** - * Get default capture setting. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getDefaultCaptureSetting(callback: AsyncCallback): void; - - /** - * Get default capture setting. - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getDefaultCaptureSetting(): Promise; - + interface PhotoOutput { /** * Start capture output. * @param callback Callback used to return the result. @@ -1821,20 +1150,20 @@ declare namespace camera { capture(setting?: PhotoCaptureSetting): Promise; /** - * Check whether to support mirror photo. - * @param callback Callback used to return the mirror support status. + * Release output instance. + * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - isMirrorSupported(callback: AsyncCallback): void; + release(callback: AsyncCallback): void; /** - * Check whether to support mirror photo. - * @return Promise used to return the mirror support status. + * Release output instance. + * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - isMirrorSupported(): Promise; + release(): Promise; /** * Subscribes capture start event callback. @@ -1919,26 +1248,7 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core */ enum PhotoOutputErrorCode { - /** - * Unknown error. - * @since 9 - */ - ERROR_UNKNOWN = -1, - /** - * Driver error. - * @since 9 - */ - ERROR_DRIVER_ERROR, - /** - * Insufficient resources. - * @since 9 - */ - ERROR_INSUFFICIENT_RESOURCES, - /** - * Timeout error. - * @since 9 - */ - ERROR_TIMEOUT, + ERROR_UNKNOWN = -1 } /** @@ -1950,12 +1260,30 @@ declare namespace camera { code: PhotoOutputErrorCode; } + /** + * Creates a VideoOutput instance. + * @param surfaceId Surface object id used in camera video output. + * @param callback Callback used to return the VideoOutput instance. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + function createVideoOutput(surfaceId: string, callback: AsyncCallback): void; + + /** + * Creates a VideoOutput instance. + * @param surfaceId Surface object id used in camera video output. + * @return Promise used to return the VideoOutput instance. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + function createVideoOutput(surfaceId: string): Promise; + /** * Video output object. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - interface VideoOutput extends CameraOutput { + interface VideoOutput { /** * Start video output. * @param callback Callback used to return the result. @@ -1964,7 +1292,7 @@ declare namespace camera { */ start(callback: AsyncCallback): void; - /** + /** * Start video output. * @return Promise used to return the result. * @since 9 @@ -1989,212 +1317,38 @@ declare namespace camera { stop(): Promise; /** - * Subscribes frame start event callback. - * @param type Event type. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - on(type: 'frameStart', callback: AsyncCallback): void; - - /** - * Subscribes frame end event callback. - * @param type Event type. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - on(type: 'frameEnd', callback: AsyncCallback): void; - - /** - * Subscribes error event callback. - * @param type Event type. - * @param callback Callback used to get the video output errors. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - on(type: 'error', callback: ErrorCallback): void; - } - - /** - * Enum for video output error code. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - enum VideoOutputErrorCode { - /** - * Unknown error. - * @since 9 - */ - ERROR_UNKNOWN = -1, - /** - * Driver error. - * @since 9 - */ - ERROR_DRIVER_ERROR, - } - - /** - * Video output error object. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface VideoOutputError extends Error { - code: VideoOutputErrorCode; - } - - /** - * Metadata object type. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - enum MetadataObjectType { - FACE_DETECTION = 0 - } - - /** - * Rectangle definition. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface Rect { - /** - * X coordinator of top left point. - * @param Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - topLeftX: number; - /** - * Y coordinator of top left point. - * @param Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - topLeftY: number; - /** - * Width of this rectangle. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - width: number; - /** - * Height of this rectangle. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - height: number; - } - - /** - * Metadata object basis. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface MetadataObject { - /** - * Get current metadata object type. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getType(callback: AsyncCallback): void; - - /** - * Get current metadata object type. - * @param Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getType(): Promise; - - /** - * Get current metadata object timestamp in milliseconds. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getTimestamp(callback: AsyncCallback): void; - - /** - * Get current metadata object timestamp in milliseconds. - * @param Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getTimestamp(): Promise; - - /** - * Get the axis-aligned bounding box of detected metadata object. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getBoundingBox(callback: AsyncCallback): void; - - /** - * Get the axis-aligned bounding box of detected metadata object. - * @param Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getBoundingBox(): Promise; - } - - /** - * Metadata face object. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface MetadataFaceObject extends MetadataObject { - } - - /** - * Metadata Output object - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface MetadataOutput extends CameraOutput { - /** - * Start output metadata + * Release output instance. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - start(callback: AsyncCallback): void; + release(callback: AsyncCallback): void; /** - * Start output metadata + * Release output instance. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - start(): Promise; + release(): Promise; /** - * Stop output metadata + * Subscribes frame start event callback. + * @param type Event type. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - stop(callback: AsyncCallback): void; - - /** - * Stop output metadata - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - stop(): Promise; + on(type: 'frameStart', callback: AsyncCallback): void; /** - * Subscribes to metadata objects available event callback. + * Subscribes frame end event callback. * @param type Event type. - * @param callback Callback used to get the available metadata objects. + * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - on(type: 'metadataObjectsAvailable', callback: AsyncCallback>): void; + on(type: 'frameEnd', callback: AsyncCallback): void; /** * Subscribes error event callback. @@ -2203,34 +1357,25 @@ declare namespace camera { * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - on(type: 'error', callback: ErrorCallback): void; + on(type: 'error', callback: ErrorCallback): void; } /** - * Enum for metadata output error code. + * Enum for video output error code. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - enum MetadataOutputErrorCode { - /** - * Unknown errors. - * @since 9 - */ - ERROR_UNKNOWN = -1, - /** - * Insufficient resources. - * @since 9 - */ - ERROR_INSUFFICIENT_RESOURCES, + enum VideoOutputErrorCode { + ERROR_UNKNOWN = -1 } /** - * Metadata output error object. + * Video output error object. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - interface MetadataOutputError extends Error { - code: MetadataOutputErrorCode; + interface VideoOutputError extends Error { + code: VideoOutputErrorCode; } } -- Gitee From 0b6b06a5c5c4e66f404f2bb437fca19466c80967 Mon Sep 17 00:00:00 2001 From: liu-binjun Date: Mon, 11 Jul 2022 22:04:33 +0800 Subject: [PATCH 42/47] bugfix:Correct spelling mistakes Signed-off-by: liu-binjun --- api/@ohos.geolocation.d.ts | 39 +++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/api/@ohos.geolocation.d.ts b/api/@ohos.geolocation.d.ts index 56c14d6488..d8a755e11c 100644 --- a/api/@ohos.geolocation.d.ts +++ b/api/@ohos.geolocation.d.ts @@ -305,7 +305,7 @@ declare namespace geolocation { function sendCommand(command: LocationCommand) : Promise; /** - * Obtain the current country code. + * obtain the current country code. * * @since 9 * @syscap SystemCapability.Location.Location.Core @@ -321,19 +321,23 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Core * @systemapi * @param scenario Indicates the scenarios where location simulation is required. - * @param callback Indicates whether the position simulation function is enabled. + * @param callback Indicates a callback function, which is used to report the result + * of enabling the location simulation function. If the enabling fails, the error message will + * be carried in the first parameter err of AsyncCallback, If enabling succeeds, no data will be returned. */ function enableLocationMock(scenario?: LocationRequestScenario, callback: AsyncCallback) : void; function enableLocationMock(scenario?: LocationRequestScenario) : Promise; /** - * diable the geographical location simulation function. + * disable the geographical location simulation function. * * @since 9 * @syscap SystemCapability.Location.Location.Core * @systemapi * @param scenario Indicates the scenarios where location simulation is required. - * @param callback Indicates whether the position simulation function is enabled. + * @param callback Indicates a callback function, which is used to report the result + * of disabling the location simulation function. If the disabling fails, the error message will + * be carried in the first parameter err of AsyncCallback, If disabling succeeds, no data will be returned. */ function disableLocationMock(scenario?: LocationRequestScenario, callback: AsyncCallback) : void; function disableLocationMock(scenario?: LocationRequestScenario) : Promise; @@ -345,7 +349,9 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Core * @systemapi * @param config Indicates the configuration parameters for location simulation. - * @param callback Indicates whether the parameters of the location simulation function are set successfully. + * @param callback Indicates a callback function, which is used to report the result of setting + * the simulation locations. If the setting fails, the error message will be carried in the first + * parameter err of AsyncCallback. If the setting succeeds, no data will be returned. */ function setMockedLocations(config: LocationMockConfig, callback: AsyncCallback) : void; function setMockedLocations(config: LocationMockConfig) : Promise; @@ -356,7 +362,9 @@ declare namespace geolocation { * @since 9 * @syscap SystemCapability.Location.Location.Core * @systemapi - * @param callback Indicates whether the reverse geocoding simulation function is enabled. + * @param callback Indicates a callback function, which is used to report the result + * of enabling the reverse geocode simulation function. If the enabling fails, the error message will + * be carried in the first parameter err of AsyncCallback, If enabling succeeds, no data will be returned. */ function enableReverseGeocodingMock(callback: AsyncCallback) : void; function enableReverseGeocodingMock() : Promise; @@ -367,7 +375,9 @@ declare namespace geolocation { * @since 9 * @syscap SystemCapability.Location.Location.Core * @systemapi - * @param callback Indicates whether the reverse geocoding simulation function is enabled. + * @param callback Indicates a callback function, which is used to report the result + * of disabling the reverse geocode simulation function. If the disabling fails, the error message will + * be carried in the first parameter err of AsyncCallback, If disabling succeeds, no data will be returned. */ function disableReverseGeocodingMock(callback: AsyncCallback) : void; function disableReverseGeocodingMock() : Promise; @@ -379,7 +389,10 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Core * @systemapi * @param mockInfos Indicates the set of locations and place names to be simulated. - * @param callback Indicates whether the parameters of the reverse geocoding simulation are set successfully. + * @param callback Indicates a callback function, which is used to report the result of setting + * the configuration parameters for simulating reverse geocoding. If the setting fails, + * the error message will be carried in the first parameter err of AsyncCallback. + * If the setting succeeds, no data will be returned. */ function setReverseGeocodingMockInfo(mockInfos: Array, callback: AsyncCallback) : void; function setReverseGeocodingMockInfo(mockInfos: Array) : Promise; @@ -631,7 +644,7 @@ declare namespace geolocation { addressUrl?: string; /** - * Indicates the amount of additional descriptive information. + * Indicates additional information. * @since 7 */ descriptions?: Array; @@ -751,7 +764,7 @@ declare namespace geolocation { additionSize?: number; /** - * Indicates whether it is an mock GeoAddress + * Indicates whether it is an mock location. * @since 9 */ isFromMock: Boolean; @@ -797,7 +810,7 @@ declare namespace geolocation { export enum GeoLocationErrorCode { /** * Indicates function not supported. - * @since 7 + * @since 9 */ NOT_SUPPORTED = 100, @@ -826,13 +839,13 @@ declare namespace geolocation { LOCATOR_ERROR, /** - * Indicates operation failure caused by abnormal position switch. + * Indicates operation failure caused by abnormal location switch. * @since 7 */ LOCATION_SWITCH_ERROR, /** - * Indicates failed to get the last cache location. + * Indicates failed to get the last known location. * @since 7 */ LAST_KNOWN_LOCATION_ERROR, -- Gitee From 95c731aa196c96c633ab356d7af4ccde570f87b5 Mon Sep 17 00:00:00 2001 From: wangkai Date: Tue, 12 Jul 2022 15:27:37 +0800 Subject: [PATCH 43/47] context change Signed-off-by: wangkai --- api/@ohos.data.distributedData.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index b69caae78a..9dc938384c 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -57,7 +57,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @Note: if swap the area, you should close all the KV store and use the new Context to create the KVManager - * @StageModelOnly */ context: Context; } -- Gitee From c3e4b0c91763ccbaa7003078601f2ca86aea54f5 Mon Sep 17 00:00:00 2001 From: dy Date: Tue, 12 Jul 2022 15:45:46 +0800 Subject: [PATCH 44/47] =?UTF-8?q?IssueNo:#I5GP89=20=E4=BF=AE=E5=A4=8Dveris?= =?UTF-8?q?on=E6=8B=BC=E5=86=99=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98=20Desc?= =?UTF-8?q?ription:=E4=BF=AE=E5=A4=8Dverison=E6=8B=BC=E5=86=99=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E9=97=AE=E9=A2=98=20Sig:SIG=5FApplicaitonFramework=20?= =?UTF-8?q?Feature=20or=20Bugfix:Bugfix=20Binary=20Source:No?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dy --- api/bundle/dispatchInfo.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/bundle/dispatchInfo.d.ts b/api/bundle/dispatchInfo.d.ts index 641b8b170d..2538eb4c83 100644 --- a/api/bundle/dispatchInfo.d.ts +++ b/api/bundle/dispatchInfo.d.ts @@ -25,7 +25,7 @@ * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework */ - readonly verison: string; + readonly version: string; /** * @default Indicates the free install interface version number -- Gitee From e8c45e3335fbb4300c240d4c93bbfc05e8178062 Mon Sep 17 00:00:00 2001 From: xiongjun_gitee Date: Wed, 13 Jul 2022 15:05:13 +0800 Subject: [PATCH 45/47] onHttpAuthRequest add host realm Signed-off-by: xiongjun_gitee --- api/@internal/component/ets/web.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts index f2b0c93a3a..ffb8faf6bc 100644 --- a/api/@internal/component/ets/web.d.ts +++ b/api/@internal/component/ets/web.d.ts @@ -342,7 +342,7 @@ declare class HitTestValue { * Defines the http auth request result, related to {@link onHttpAuthRequest} method. * @since 9 */ -declare class WebHttpAuthResult { +declare class HttpAuthHandler { /** * Constructor. * @since 9 @@ -1364,7 +1364,7 @@ declare class WebAttribute extends CommonMethod { * * @since 9 */ - onHttpAuthRequest(callback: (event?: { result: WebHttpAuthResult }) => boolean): WebAttribute; + onHttpAuthRequest(callback: (event?: { handler: HttpAuthHandler, host: string, realm: string }) => boolean): WebAttribute; /** * Triggered when the resouces loading is intercepted. -- Gitee From 73046106f58bb395618b8f756d4d3fb8432c1c7e Mon Sep 17 00:00:00 2001 From: zhouke Date: Thu, 14 Jul 2022 10:47:32 +0800 Subject: [PATCH 46/47] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E8=83=BD=E5=8A=9B=E8=AF=B4=E6=98=8E.Signed-o?= =?UTF-8?q?ff-by:=20.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhouke --- api/@ohos.uitest.d.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/api/@ohos.uitest.d.ts b/api/@ohos.uitest.d.ts index 237ac9e789..2c2e3fb4f3 100644 --- a/api/@ohos.uitest.d.ts +++ b/api/@ohos.uitest.d.ts @@ -15,7 +15,7 @@ /** * Resize direction for the window. - * + * @syscap SystemCapability.Test.UiTest * @since 9 */ enum ResizeDirection{ @@ -30,7 +30,7 @@ } /** * Enumerates the string value match pattern. - * + * @syscap SystemCapability.Test.UiTest * @since 8 */ enum MatchPattern{ @@ -66,7 +66,7 @@ /** * Describes the window mode of the tested window - * + * @syscap SystemCapability.Test.UiTest * @since 9 */ enum WindowMode{ @@ -78,7 +78,7 @@ /** * Represents the point on the device screen. - * + * @syscap SystemCapability.Test.UiTest * @since 9 */ declare interface Point { @@ -88,7 +88,7 @@ declare interface Point { /** * Represents the rectangle area on the device screen. - * + * @syscap SystemCapability.Test.UiTest * @since 9 */ declare interface Rect { @@ -100,7 +100,7 @@ declare interface Rect { /** * Represents filer condition to get the window . - * + * @syscap SystemCapability.Test.UiTest * @since 9 */ declare interface WindowFilter { @@ -112,7 +112,7 @@ declare interface WindowFilter { /** * Describes the attribute requirements for the target UiComponents. - * + * * @since 8 * @syscap SystemCapability.Test.UiTest */ -- Gitee From 19eca45d59cf378a8c0cf12ce290f3069f84bed3 Mon Sep 17 00:00:00 2001 From: zhouke Date: Thu, 14 Jul 2022 10:49:28 +0800 Subject: [PATCH 47/47] modify.Signed-off-by: . Signed-off-by: zhouke --- api/@ohos.uitest.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.uitest.d.ts b/api/@ohos.uitest.d.ts index 2c2e3fb4f3..1e88f91157 100644 --- a/api/@ohos.uitest.d.ts +++ b/api/@ohos.uitest.d.ts @@ -112,7 +112,7 @@ declare interface WindowFilter { /** * Describes the attribute requirements for the target UiComponents. - * + * * @since 8 * @syscap SystemCapability.Test.UiTest */ -- Gitee