diff --git a/api/@ohos.bundle.bundleMonitor.d.ts b/api/@ohos.bundle.bundleMonitor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0f08c1d940f6df17b02f45193b46c01690b49390 --- /dev/null +++ b/api/@ohos.bundle.bundleMonitor.d.ts @@ -0,0 +1,87 @@ +/* + * 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 { Callback } from './basic'; + +/** + * Bundle monitor + * @namespace bundleMonitor + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ +declare namespace bundleMonitor { + /** + * This module defines the result information of monitoring install, update and uninstall. + * @typedef BundleChangedInfo + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + interface BundleChangedInfo { + /** + * The bundle name + * @type {string} + * @systemapi + * @since 9 + */ + bundleName: string; + /** + * The user id + * @type {number} + * @systemapi + * @since 9 + */ + userId: number; + } + + /** + * Indicates the event type of bundle change + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + type BundleChangedEvent = 'add' | 'update' | 'remove'; + + /** + * Register to monitor the installation status + * @permission ohos.permission.LISTEN_BUNDLE_CHANGE + * @param { BundleChangedEvent } type - Indicates the command should be implement. + * @param { Callback } callback - Indicates the callback to be register. + * @throws {BusinessError} 201 - Verify permission denied. + * @throws {BusinessError} 401 - The parameter check failed. + * @throws {BusinessError} 801 - Capability not support. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function on(type: BundleChangedEvent, callback: Callback): void; + + /** + * Unregister to monitor the installation status + * @permission ohos.permission.LISTEN_BUNDLE_CHANGE + * @param { BundleChangedEvent } type -type Indicates the command should be implement. + * @param { Callback } callback - Indicates the callback to be unregister. + * @throws {BusinessError} 201 - Verify permission denied. + * @throws {BusinessError} 401 - The parameter check failed. + * @throws {BusinessError} 801 - Capability not support. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function off(type: BundleChangedEvent, callback?: Callback): void; +} + +export default bundleMonitor diff --git a/api/@ohos.bundle.innerBundleManager.d.ts b/api/@ohos.bundle.innerBundleManager.d.ts index 9eaaeee19f2a5d289681f7acd18a7e9f9bfcc5ee..eabbae5479ad3c487ba080f3297057df93a505e4 100644 --- a/api/@ohos.bundle.innerBundleManager.d.ts +++ b/api/@ohos.bundle.innerBundleManager.d.ts @@ -38,6 +38,8 @@ declare namespace innerBundleManager { * @return Returns the LauncherAbilityInfo object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.launcherBundleManager#getLauncherAbilityInfo */ function getLauncherAbilityInfos(bundleName: string, userId: number, callback: AsyncCallback>) : void; function getLauncherAbilityInfos(bundleName: string, userId: number) : Promise>; @@ -52,6 +54,8 @@ declare namespace innerBundleManager { * @return Returns the result or error maeeage. * @permission ohos.permission.LISTEN_BUNDLE_CHANGE * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.bundleMonitor#on */ function on(type:"BundleStatusChange", bundleStatusCallback : BundleStatusCallback, callback: AsyncCallback) : void; function on(type:"BundleStatusChange", bundleStatusCallback : BundleStatusCallback): Promise; @@ -65,6 +69,8 @@ declare namespace innerBundleManager { * @return Returns the result or error maeeage. * @permission ohos.permission.LISTEN_BUNDLE_CHANGE * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.bundleMonitor#off */ function off(type:"BundleStatusChange", callback: AsyncCallback) : void; function off(type:"BundleStatusChange"): Promise; @@ -78,6 +84,8 @@ declare namespace innerBundleManager { * @return Returns the LauncherAbilityInfo object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.launcherBundleManager#getAllLauncherAbilityInfos */ function getAllLauncherAbilityInfos(userId: number, callback: AsyncCallback>) : void; function getAllLauncherAbilityInfos(userId: number) : Promise>; @@ -91,6 +99,8 @@ declare namespace innerBundleManager { * @return Returns the LauncherShortcutInfo object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.launcherBundleManager#getShortcutInfo */ function getShortcutInfos(bundleName :string, callback: AsyncCallback>) : void; function getShortcutInfos(bundleName : string) : Promise>; diff --git a/api/@ohos.bundle.launcherBundleManager.d.ts b/api/@ohos.bundle.launcherBundleManager.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6eb6137c7b6c781bc8a6896af4a89dd3d6446fd3 --- /dev/null +++ b/api/@ohos.bundle.launcherBundleManager.d.ts @@ -0,0 +1,132 @@ +/* + * 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 { LauncherAbilityInfo as _LauncherAbilityInfo } from './bundleManager/launcherAbilityInfo'; +import { ShortcutInfo as _ShortcutInfo, ShortcutWant as _ShortcutWant} from './bundleManager/shortcutInfo'; + + +/** + * Launcher bundle manager. + * @namespace launcherBundleManager + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ +declare namespace launcherBundleManager { + /** + * Obtains launcher abilities info based on a given bundleName and userId. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { number } userId - Indicates the id for the user. + * @param { AsyncCallback> } callback -The callback of the LauncherAbilityInfo object result. + * @throws {BusinessError} 201 - Verify permission denied. + * @throws {BusinessError} 401 - The parameter check failed. + * @throws {BusinessError} 801 - Capability not support. + * @throws {BusinessError} 17700001 - The specified bundle name is not found. + * @throws {BusinessError} 17700004 - The specified user id is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ + function getLauncherAbilityInfo(bundleName: string, userId: number, callback: AsyncCallback>) : void; + + /** + * Obtains launcher abilities info based on a given bundleName and userId. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { number } userId - Indicates the id for the user. + * @returns { Promise> } the LauncherAbilityInfo object. + * @throws {BusinessError} 201 - Verify permission denied. + * @throws {BusinessError} 401 - The parameter check failed. + * @throws {BusinessError} 801 - Capability not support. + * @throws {BusinessError} 17700001 - The specified bundle name is not found. + * @throws {BusinessError} 17700004 - The specified user id is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ + function getLauncherAbilityInfo(bundleName: string, userId: number) : Promise>; + + /** + * Obtains launcher abilities info based on a given userId. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { number } userId - Indicates the id for the user. + * @param { AsyncCallback> } callback -The callback of the LauncherAbilityInfo object result. + * @throws {BusinessError} 201 - Verify permission denied. + * @throws {BusinessError} 401 - The parameter check failed. + * @throws {BusinessError} 801 - Capability not support. + * @throws {BusinessError} 17700004 - The specified user id is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ + function getAllLauncherAbilityInfo(userId: number, callback: AsyncCallback>) : void; + + /** + * Obtains launcher abilities info based on a given userId. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { number } userId - Indicates the id for the user. + * @returns { Promise> } the LauncherAbilityInfo object. + * @throws {BusinessError} 201 - Verify permission denied. + * @throws {BusinessError} 401 - The parameter check failed. + * @throws {BusinessError} 801 - Capability not support. + * @throws {BusinessError} 17700004 - The specified user id is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ + function getAllLauncherAbilityInfo(userId: number) : Promise>; + + /** + * Obtains shortcut info based on a given bundleName. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { AsyncCallback> } callback -The callback of the ShortcutInfo object result. + * @throws {BusinessError} 201 - Verify permission denied. + * @throws {BusinessError} 401 - The parameter check failed. + * @throws {BusinessError} 801 - Capability not support. + * @throws {BusinessError} 17700001 - The specified bundle name is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ + function getShortcutInfo(bundleName :string, callback: AsyncCallback>) : void; + + /** + * Obtains shortcut info based on a given bundleName. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @returns { Promise> } the LauncherShortcutInfo object. + * @throws {BusinessError} 201 - Verify permission denied. + * @throws {BusinessError} 401 - The parameter check failed. + * @throws {BusinessError} 801 - Capability not support. + * @throws {BusinessError} 17700001 - The specified bundle name is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ + function getShortcutInfo(bundleName : string) : Promise>; + + /** + * Contains basic launcher Ability information, which uniquely identifies an LauncherAbilityInfo. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ + export type LauncherAbilityInfo = _LauncherAbilityInfo; +} + +export default launcherBundleManager; diff --git a/api/bundle/abilityInfo.d.ts b/api/bundle/abilityInfo.d.ts index b1ae1d907f5d8290801f0f1eef179f6ff5ad5a63..fea1af40954e8af09280bb29e6d3dc6dea661a5c 100644 --- a/api/bundle/abilityInfo.d.ts +++ b/api/bundle/abilityInfo.d.ts @@ -23,6 +23,8 @@ import bundle from './../@ohos.bundle'; * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.AbilityInfo */ export interface AbilityInfo { /** diff --git a/api/bundle/applicationInfo.d.ts b/api/bundle/applicationInfo.d.ts index 73477bb49bc2aab39ecb3ae0367e76a56f8469fe..1d43226bc4e4a0246fb54d364f58deac756d4ff7 100644 --- a/api/bundle/applicationInfo.d.ts +++ b/api/bundle/applicationInfo.d.ts @@ -23,7 +23,8 @@ import { Resource } from './../global/resource'; * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA - * + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.ApplicationInfo */ export interface ApplicationInfo { /** diff --git a/api/bundle/bundleStatusCallback.d.ts b/api/bundle/bundleStatusCallback.d.ts index b5c4d368583d4bffdefc1f34d8fe4d41654cdf0c..7b1a2107dc6b3e194765b94cfc43a1b40822d320 100644 --- a/api/bundle/bundleStatusCallback.d.ts +++ b/api/bundle/bundleStatusCallback.d.ts @@ -23,6 +23,7 @@ * * @permission ohos.permission.LISTEN_BUNDLE_CHANGE * @systemapi Hide this for inner system use + * @deprecated since 9 */ export interface BundleStatusCallback { /** diff --git a/api/bundle/extensionAbilityInfo.d.ts b/api/bundle/extensionAbilityInfo.d.ts index c533ad6dc54b7aab9eb928e0b6be0940c01001f5..d8bf7564c7de544a931bb437ef311e29afd4b7a2 100644 --- a/api/bundle/extensionAbilityInfo.d.ts +++ b/api/bundle/extensionAbilityInfo.d.ts @@ -22,7 +22,8 @@ import bundle from './../@ohos.bundle'; * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA - * + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.ExtensionAbilityInfo */ export interface ExtensionAbilityInfo { /** diff --git a/api/bundle/hapModuleInfo.d.ts b/api/bundle/hapModuleInfo.d.ts index 5ed5be922e699bba39e878bdec513cbdfba1df67..c9662744a4dc5fbb91bd3b0c4547e7ed17c57053 100644 --- a/api/bundle/hapModuleInfo.d.ts +++ b/api/bundle/hapModuleInfo.d.ts @@ -22,7 +22,8 @@ import { Metadata } from './metadata' * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA - * + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.HapModuleInfo */ export interface HapModuleInfo { /** diff --git a/api/bundle/launcherAbilityInfo.d.ts b/api/bundle/launcherAbilityInfo.d.ts index a73f3ce63f7f6ffc9a3a054479a95437c99d0e72..31438d20dd49bd5cba19b3cd3dc3521c3b013f22 100644 --- a/api/bundle/launcherAbilityInfo.d.ts +++ b/api/bundle/launcherAbilityInfo.d.ts @@ -26,6 +26,8 @@ import { ElementName } from './elementName' * * @permission N/A * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.LauncherAbilityInfo */ export interface LauncherAbilityInfo { /** diff --git a/api/bundle/metadata.d.ts b/api/bundle/metadata.d.ts index 4fba45c5348ca3d4806cf46783ba4570b1c7e6c3..de2c7533d994244103f5d1717d1c20f22af6e596 100644 --- a/api/bundle/metadata.d.ts +++ b/api/bundle/metadata.d.ts @@ -18,7 +18,8 @@ * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA - * + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.Metadata */ export interface Metadata { /** diff --git a/api/bundle/moduleInfo.d.ts b/api/bundle/moduleInfo.d.ts index f961a10b9d6cabbadef869709aaa1a848f860e43..2f23150f4031dc248cc1e7dfe175a0aa248a40a7 100644 --- a/api/bundle/moduleInfo.d.ts +++ b/api/bundle/moduleInfo.d.ts @@ -18,7 +18,8 @@ * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA - * + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.HapModuleInfo */ export interface ModuleInfo { /** diff --git a/api/bundle/shortcutInfo.d.ts b/api/bundle/shortcutInfo.d.ts index 98c0a85563cd95a2dad1f72bd0a3305fe0fc7a15..7b931ae7998ff7f61e3479f9439c5b5089b53250 100644 --- a/api/bundle/shortcutInfo.d.ts +++ b/api/bundle/shortcutInfo.d.ts @@ -20,6 +20,8 @@ * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.launcherBundleManager.ShortcutWant */ export interface ShortcutWant{ /** @@ -47,13 +49,15 @@ * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA - * + * @deprecated since 9 + * @useinstead ohos.bundle.launcherBundleManager.ShortcutInfo */ export interface ShortcutInfo { /** * @default Indicates the ID of the application to which this shortcut belongs * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework + * */ readonly id: string; /** diff --git a/api/bundleManager/abilityInfo.d.ts b/api/bundleManager/abilityInfo.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e3a0325bf9f34ec1a800ef1743e22ed14c48ce9b --- /dev/null +++ b/api/bundleManager/abilityInfo.d.ts @@ -0,0 +1,469 @@ +/* + * 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 { ApplicationInfo } from './applicationInfo'; +import { Metadata } from './metadata' + +/** + * Obtains configuration information about an ability + * @typedef AbilityInfo + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +export interface AbilityInfo { + /** + * Indicates the name of the bundle containing the ability + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly bundleName: string; + + /** + * Indicates the name of the .hap package to which the capability belongs + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly moduleName: string; + + /** + * Ability simplified class name + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly name: string; + + /** + * Indicates the label of the ability + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly label: string; + + /** + * Indicates the label id of the ability + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly labelId: number; + + /** + * Indicates the ability + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly description: string; + + /** + * Indicates the description id of the ability + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly descriptionId: number; + + /** + * Indicates the icon of the ability + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly icon: string; + + /** + * Indicates the icon id of the ability + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly iconId: number; + + /** + * Process of ability, if user do not set it, the value equal application process + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly process: string; + + /** + * Indicates whether an ability can be called by other abilities + * @type {boolean} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly isVisible: boolean; + + /** + * Enumerates types of templates that can be used by an ability + * @type {AbilityType} + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + * @since 9 + */ + readonly type: AbilityType; + + /** + * Enumerates ability display orientations + * @type {DisplayOrientation} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly orientation: DisplayOrientation; + + /** + * Enumerates ability launch type + * @type {LaunchType} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly launchType: LaunchType; + + /** + * The permissions that others need to launch this ability + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly permissions: Array; + + /** + * Indicates the permission required for reading ability data + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + * @since 9 + */ + readonly readPermission: string; + + /** + * Indicates the permission required for writing data to the ability + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + * @since 9 + */ + readonly writePermission: string; + + /** + * Uri of ability + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + * @since 9 + */ + readonly uri: string; + + /** + * The device types that this ability can run on + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly deviceTypes: Array; + + /** + * Obtains configuration information about an application + * @type {ApplicationInfo} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly applicationInfo: ApplicationInfo; + + /** + * Indicates the metadata of ability + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly metadata: Array; + + /** + * Indicates whether the ability is enabled + * @type {boolean} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly enabled: boolean; + + /** + * Indicates which window mode is supported + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly supportWindowModes: Array; + + /** + * Indicates window size + * @type {WindowSize} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly windowSize: WindowSize; +} + +/** + * Indicates the window size. + * @typedef WindowSize + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +export interface WindowSize { + /** + * Indicates maximum ratio of width over height of window under free window status. + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly maxWindowRatio: number; + + /** + * Indicates minimum ratio of width over height of window under free window status. + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly minWindowRatio: number; + + /** + * Indicates maximum width of window under free window status. + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly maxWindowWidth: number; + + /** + * Indicates minimum width of window under free window status. + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly minWindowWidth: number; + + /** + * Indicates maximum height of window under free window status. + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly maxWindowHeight: number; + + /** + * Indicates minimum height of window under free window status. + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly minWindowHeight: number; +} + +/** + * Support window mode + * @enum {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +export enum SupportWindowMode { + /** + * Indicates supported window mode of full screen mode + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + FULL_SCREEN = 0, + /** + * Indicates supported window mode of split mode + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + SPLIT = 1, + /** + * Indicates supported window mode of floating mode + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + FLOATING = 2, +} + +/** + * Launch type + * @enum {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +export enum LaunchType { + /** + * Indicates that the ability has only one instance + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + SINGLETON = 0, + + /** + * Indicates that the ability can have multiple instances + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + STANDARD = 1, + + /** + * Indicates that the ability can have specified instances + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + SPECIFIED = 2, +} + +/** + * Indicates ability type + * @enum {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +export enum AbilityType { + /** + * Indicates an unknown ability type + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + UNKNOWN, + + /** + * Indicates that the ability has a UI + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + PAGE, + + /** + * Indicates that the ability does not have a UI + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + SERVICE, + + /** + * Indicates that the ability is used to provide data access services + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + DATA, +} + + +/** + * Display orientation + * @enum {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +export enum DisplayOrientation { + /** + * Indicates that the system automatically determines the display orientation + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + UNSPECIFIED, + + /** + * Indicates the landscape orientation + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + LANDSCAPE, + + /** + * Indicates the portrait orientation + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + PORTRAIT, + + /** + * Indicates the page ability orientation is the same as that of the nearest ability in the stack + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + FOLLOW_RECENT, + + /** + * Indicates the inverted landscape orientation + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + LANDSCAPE_INVERTED, + + /** + * Indicates the inverted portrait orientation + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + PORTRAIT_INVERTED, + + /** + * Indicates the orientation can be auto-rotated + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + AUTO_ROTATION, + + /** + * Indicates the landscape orientation rotated with sensor + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + AUTO_ROTATION_LANDSCAPE, + + /** + * Indicates the portrait orientation rotated with sensor + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + AUTO_ROTATION_PORTRAIT, + + /** + * Indicates the sensor restricted mode + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + AUTO_ROTATION_RESTRICTED, + + /** + * Indicates the sensor landscape restricted mode + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + AUTO_ROTATION_LANDSCAPE_RESTRICTED, + + /** + * Indicates the sensor portrait restricted mode + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + AUTO_ROTATION_PORTRAIT_RESTRICTED, + + /** + * Indicates the locked orientation mode + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + LOCKED, +} diff --git a/api/bundleManager/applicationInfo.d.ts b/api/bundleManager/applicationInfo.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2ea06512bd506f37145d4f46bc8fb2f37b804661 --- /dev/null +++ b/api/bundleManager/applicationInfo.d.ts @@ -0,0 +1,212 @@ +/* + * 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 { HapModuleInfo } from './hapModuleInfo'; +import { Metadata } from './metadata'; +import { Resource } from '../global/resource'; + +/** + * Obtains configuration information about an application + * @typedef ApplicationInfo + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +export interface ApplicationInfo { + /** + * Indicates the application name, which is the same as {@code bundleName} + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly name: string; + + /** + * Description of application + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly description: string; + + /** + * Indicates the description id of the application + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly descriptionId: number; + + /** + * Indicates whether or not this application may be instantiated + * @type {boolean} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly enabled: boolean; + + /** + * Indicates the label of the application + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly label: string; + + /** + * Indicates the label id of the application + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly labelId: number; + + /** + * Indicates the icon of the application + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly icon: string; + + /** + * Indicates the icon id of the application + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly iconId: number; + + /** + * Process of application, if user do not set it ,the value equal bundleName + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly process: string; + + /** + * Indicates the path storing the module resources of the application + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly moduleSourceDirs: Array; + + /** + * Indicates the permissions required for accessing the application. + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly permissions: Array; + + /** + * Indicates modules information about an application + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly modulesInfo: Array; + + /** + * Indicates the path where the {@code Entry.hap} file of the application is saved + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly entryDir: string; + + /** + * Indicates the application source code path + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly codePath: string; + + /** + * Indicates the metadata of module + * @type {Map>} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly metadata: Map>; + + /** + * Indicates whether or not this application may be removable + * @type {boolean} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly removable: boolean; + + /** + * Indicates the access token of the application + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly accessTokenId: number; + + /** + * Indicates the uid of the application + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly uid: number; + + /** + * Indicates icon resource of the application + * @type {Resource} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly iconResource: Resource; + + /** + * Indicates label resource of the application + * @type {Resource} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly labelResource: Resource; + + /** + * Indicates description resource of the application + * @type {Resource} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly descriptionResource: Resource; + + /** + * Indicates the appDistributionType of the application + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + readonly appDistributionType: string; + + /** + * Indicates the appProvisionType of the application + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + readonly appProvisionType: string; +} diff --git a/api/bundleManager/extensionAbilityInfo.d.ts b/api/bundleManager/extensionAbilityInfo.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..538dec89522a266207abbd9fe07ff98adcfb75c3 --- /dev/null +++ b/api/bundleManager/extensionAbilityInfo.d.ts @@ -0,0 +1,252 @@ +/* + * 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 { ApplicationInfo } from './applicationInfo'; +import { Metadata } from './metadata' + +/** + * Extension information about a bundle + * @typedef ExtensionAbilityInfo + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +export interface ExtensionAbilityInfo { + /** + * Indicates the name of the bundle + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly bundleName: string; + + /** + * Indicates the name of the module + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly moduleName: string; + + /** + * Indicates the name of the extension ability info + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly name: string; + + /** + * Indicates the label id of the extension ability info + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly labelId: number; + + /** + * Indicates the description id of the extension ability info + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly descriptionId: number; + + /** + * Indicates the icon id of the extension ability info + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly iconId: number; + + /** + * Indicates whether the extension ability info can be visible or not + * @type {boolean} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly isVisible: boolean; + + /** + * Enumerates types of the extension ability info + * @type {ExtensionAbilityType} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly extensionAbilityType: ExtensionAbilityType; + + /** + * The permissions that others need to use this extension ability info + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly permissions: Array; + + /** + * Obtains configuration information about an application + * @type {ApplicationInfo} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly applicationInfo: ApplicationInfo; + + /** + * Indicates the metadata of bundle + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly metadata: Array; + + /** + * Indicates the src language to express extension ability info + * @type {boolean} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly enabled: boolean; + + /** + * Indicates the read permission extension ability info + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly readPermission: string; + + /** + * Indicates the write permission of extension ability info + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly writePermission: string; +} + +/** + * This enumeration value is used to identify various types of extension ability + * @enum {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export enum ExtensionAbilityType { + /** + * Indicates extension info with type of form + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + FORM = 0, + + /** + * Indicates extension info with type of work schedule + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + WORK_SCHEDULER = 1, + + /** + * Indicates extension info with type of input method + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + INPUT_METHOD = 2, + + /** + * Indicates extension info with type of service + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + SERVICE = 3, + + /** + * Indicates extension info with type of accessibility + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + ACCESSIBILITY = 4, + + /** + * Indicates extension info with type of dataShare + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + DATA_SHARE = 5, + + /** + * Indicates extension info with type of filesShare + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + FILE_SHARE = 6, + + /** + * Indicates extension info with type of staticSubscriber + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + STATIC_SUBSCRIBER = 7, + + /** + * Indicates extension info with type of wallpaper + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + WALLPAPER = 8, + + /** + * Indicates extension info with type of backup + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + BACKUP = 9, + + /** + * Indicates extension info with type of window + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + WINDOW = 10, + + /** + * Indicates extension info with type of enterprise admin + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + ENTERPRISE_ADMIN = 11, + + /** + * Indicates extension info with type of thumbnail + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + THUMBNAIL = 13, + + /** + * Indicates extension info with type of preview + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + PREVIEW = 14, + + /** + * Indicates extension info with type of unspecified + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + UNSPECIFIED = 255, +} diff --git a/api/bundleManager/hapModuleInfo.d.ts b/api/bundleManager/hapModuleInfo.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4fc11edabebbb0a37d1a0a5e19d863df51ed0722 --- /dev/null +++ b/api/bundleManager/hapModuleInfo.d.ts @@ -0,0 +1,147 @@ +/* + * 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' + +/** + * Obtains configuration information about a hap module. + * @typedef HapModuleInfo + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +export interface HapModuleInfo { + /** + * Indicates the name of this hap module + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly name: string; + + /** + * Indicates the icon of this hap module + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly icon: string; + + /** + * Indicates the icon id of this hap module + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly iconId: number; + + /** + * Indicates the label of this hap module + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly label: string; + + /** + * Indicates the label id of this hap module + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly labelId: number; + + /** + * Describes the hap module + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly description: string; + + /** + * Indicates the description of this hap module + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly descriptionId: number; + + /** + * Indicates main elementName of the hap module + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly mainElementName: string; + + /** + * Obtains configuration information about abilities + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly abilitiesInfo: Array; + + /** + * Obtains configuration information about extension abilities + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly extensionAbilitiesInfo: Array; + + /** + * Indicates the metadata of ability + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly metadata: Array; + + /** + * The device types that this hap module can run on + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly deviceTypes: Array; + + /** + * Indicates whether free installation of the hap module is supported + * @type {boolean} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly installationFree: boolean; + + /** + * Indicates the hash value of the hap module + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + readonly hashValue: string; + + /** + * Indicates the module source dir of this hap module + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly moduleSourceDir: string; +} diff --git a/api/bundleManager/launcherAbilityInfo.d.ts b/api/bundleManager/launcherAbilityInfo.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0fb9f55e8b02fa4bcd2d4b5d5d54dfeed2d22b2b --- /dev/null +++ b/api/bundleManager/launcherAbilityInfo.d.ts @@ -0,0 +1,74 @@ +/* + * 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 { ApplicationInfo } from './applicationInfo'; +import { ElementName } from './elementName' + +/** + * Contains basic launcher Ability information, which uniquely identifies an LauncherAbilityInfo + * @typedef LauncherAbilityInfo + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ +export interface LauncherAbilityInfo { + /** + * Obtains application info information about an launcher ability. + * @type {ApplicationInfo} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly applicationInfo: ApplicationInfo; + + /** + * Obtains element name about an launcher ability. + * @type {ElementName} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly elementName : ElementName; + + /** + * Obtains labelId about an launcher ability. + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly labelId: number; + + /** + * Obtains iconId about an launcher ability. + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly iconId: number; + + /** + * Obtains userId about an launcher ability. + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly userId: number; + + /** + * Obtains installTime about an launcher ability. + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly installTime : number; +} diff --git a/api/bundleManager/metadata.d.ts b/api/bundleManager/metadata.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4a9e28b748dea9e328f98ea442c9b553cae3b07e --- /dev/null +++ b/api/bundleManager/metadata.d.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + /** + * Indicates the Metadata + * @typedef Metadata + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export interface Metadata { + /** + * Indicates the metadata name + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + name: string; + + /** + * Indicates the metadata value + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + value: string; + + /** + * Indicates the metadata resource + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + resource: string; + } \ No newline at end of file diff --git a/api/bundleManager/shortcutInfo.d.ts b/api/bundleManager/shortcutInfo.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..615f46d1fcb927f9adad468b997d3ce7c64c279e --- /dev/null +++ b/api/bundleManager/shortcutInfo.d.ts @@ -0,0 +1,128 @@ +/* + * 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. + */ + +/** + * Provides information about a shortcut, including the shortcut ID and label. + * @typedef ShortcutInfo + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ + export interface ShortcutInfo { + /** + * Indicates the ID of the application to which this shortcut belongs + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly id: string; + + /** + * Indicates the name of the bundle containing the shortcut + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly bundleName: string; + + /** + * Indicates the moduleName of the shortcut + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly moduleName: string; + + /** + * Indicates the host ability of the shortcut + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly hostAbility: string; + + /** + * Indicates the icon of the shortcut + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly icon: string; + + /** + * Indicate s the icon id of the shortcut + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly iconId: number; + + /** + * Indicates the label of the shortcut + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly label: string; + + /** + * Indicates the label id of the shortcut + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly labelId: number; + + /** + * Indicates the wants of the shortcut + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly wants: Array; + } + + /** + * Obtains information about the ability that a shortcut will start. + * @typedef ShortcutWant + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ + export interface ShortcutWant{ + /** + * Indicates the target bundle of the shortcut want + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly targetBundle: string; + + /** + * Indicates the target module of the shortcut want + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly targetModule: string; + + /** + * Indicates the target ability of the shortcut want + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly targetAbility: string; + } \ No newline at end of file