1/* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import { ApplicationInfo } from './applicationInfo'; 17import { CustomizeData } from './customizeData' 18import bundle from './../@ohos.bundle'; 19 20/** 21 * @name Obtains configuration information about an ability 22 * @since 7 23 * @syscap SystemCapability.BundleManager.BundleFramework 24 * @deprecated since 9 25 * @useinstead ohos.bundle.bundleManager.AbilityInfo 26 */ 27export interface AbilityInfo { 28 /** 29 * @default Indicates the name of the bundle containing the ability 30 * @since 7 31 * @syscap SystemCapability.BundleManager.BundleFramework 32 */ 33 readonly bundleName: string; 34 35 /** 36 * @default Ability simplified class name 37 * @since 7 38 * @syscap SystemCapability.BundleManager.BundleFramework 39 */ 40 readonly name: string; 41 42 /** 43 * @default Indicates the label of the ability 44 * @since 7 45 * @syscap SystemCapability.BundleManager.BundleFramework 46 */ 47 readonly label: string; 48 49 /** 50 * @default Describes the ability 51 * @since 7 52 * @syscap SystemCapability.BundleManager.BundleFramework 53 */ 54 readonly description: string; 55 56 /** 57 * @default Indicates the icon of the ability 58 * @since 7 59 * @syscap SystemCapability.BundleManager.BundleFramework 60 */ 61 readonly icon: string; 62 63 /** 64 * @default Indicates the label id of the ability 65 * @since 7 66 * @syscap SystemCapability.BundleManager.BundleFramework 67 */ 68 readonly labelId: number; 69 70 /** 71 * @default Indicates the description id of the ability 72 * @since 7 73 * @syscap SystemCapability.BundleManager.BundleFramework 74 */ 75 readonly descriptionId: number; 76 77 /** 78 * @default Indicates the icon id of the ability 79 * @since 7 80 * @syscap SystemCapability.BundleManager.BundleFramework 81 */ 82 readonly iconId: number; 83 84 /** 85 * @default Indicates the name of the .hap package to which the capability belongs 86 * @since 7 87 * @syscap SystemCapability.BundleManager.BundleFramework 88 */ 89 readonly moduleName: string; 90 91 /** 92 * @default Process of ability, if user do not set it ,the value equal application process 93 * @since 7 94 * @syscap SystemCapability.BundleManager.BundleFramework 95 */ 96 readonly process: string; 97 98 /** 99 * @default Info about which ability is this nick point to 100 * @since 7 101 * @syscap SystemCapability.BundleManager.BundleFramework 102 * @FAModelOnly 103 */ 104 readonly targetAbility: string; 105 106 /** 107 * @default Indicates the background service addressing a specific usage scenario 108 * @since 7 109 * @syscap SystemCapability.BundleManager.BundleFramework 110 * @FAModelOnly 111 */ 112 readonly backgroundModes: number; 113 114 /** 115 * @default Indicates whether an ability can be called by other abilities 116 * @since 7 117 * @syscap SystemCapability.BundleManager.BundleFramework 118 */ 119 readonly isVisible: boolean; 120 121 /** 122 * @default Indicates whether the ability provides the embedded card capability 123 * @since 7 124 * @syscap SystemCapability.BundleManager.BundleFramework 125 * @FAModelOnly 126 */ 127 readonly formEnabled: boolean; 128 129 /** 130 * @default Enumerates types of templates that can be used by an ability 131 * @since 7 132 * @syscap SystemCapability.BundleManager.BundleFramework 133 * @FAModelOnly 134 */ 135 readonly type: bundle.AbilityType; 136 137 /** 138 * @default Enumerates the subType of templates used by an ability 139 * @since 7 140 * @syscap SystemCapability.BundleManager.BundleFramework 141 * @FAModelOnly 142 */ 143 readonly subType: bundle.AbilitySubType; 144 145 /** 146 * @default Enumerates ability display orientations 147 * @since 7 148 * @syscap SystemCapability.BundleManager.BundleFramework 149 */ 150 readonly orientation: bundle.DisplayOrientation; 151 152 /** 153 * @default Enumerates ability launch modes 154 * @since 7 155 * @syscap SystemCapability.BundleManager.BundleFramework 156 */ 157 readonly launchMode: bundle.LaunchMode; 158 159 /** 160 * @default The permissions that others need to launch this ability 161 * @since 7 162 * @syscap SystemCapability.BundleManager.BundleFramework 163 */ 164 readonly permissions: Array<string>; 165 166 /** 167 * @default The device types that this ability can run on 168 * @since 7 169 * @syscap SystemCapability.BundleManager.BundleFramework 170 */ 171 readonly deviceTypes: Array<string>; 172 173 /** 174 * @default The device capability that this ability needs 175 * @since 7 176 * @syscap SystemCapability.BundleManager.BundleFramework 177 */ 178 readonly deviceCapabilities: Array<string>; 179 180 /** 181 * @default Indicates the permission required for reading ability data 182 * @since 7 183 * @syscap SystemCapability.BundleManager.BundleFramework 184 * @FAModelOnly 185 */ 186 readonly readPermission: string; 187 188 /** 189 * @default Indicates the permission required for writing data to the ability 190 * @since 7 191 * @syscap SystemCapability.BundleManager.BundleFramework 192 * @FAModelOnly 193 */ 194 readonly writePermission: string; 195 196 /** 197 * @default Obtains configuration information about an application 198 * @since 7 199 * @syscap SystemCapability.BundleManager.BundleFramework 200 */ 201 readonly applicationInfo: ApplicationInfo; 202 203 /** 204 * @default Uri of ability 205 * @since 7 206 * @syscap SystemCapability.BundleManager.BundleFramework 207 * @FAModelOnly 208 */ 209 readonly uri: string; 210 211 /** 212 * @default Indicates the metadata of ability 213 * @since 8 214 * @syscap SystemCapability.BundleManager.BundleFramework 215 */ 216 readonly metaData: Array<CustomizeData>; 217 218 /** 219 * @default Indicates whether the ability is enabled 220 * @since 8 221 * @syscap SystemCapability.BundleManager.BundleFramework 222 */ 223 readonly enabled: boolean; 224} 225