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 16/** 17 * @file 18 * @kit AbilityKit 19 */ 20 21import { ApplicationInfo } from './applicationInfo'; 22import { CustomizeData } from './customizeData'; 23import bundle from './../@ohos.bundle'; 24 25/** 26 * Obtains configuration information about an ability 27 * 28 * @typedef AbilityInfo 29 * @syscap SystemCapability.BundleManager.BundleFramework 30 * @since 7 31 * @deprecated since 9 32 * @useinstead ohos.bundle.bundleManager.AbilityInfo 33 */ 34export interface AbilityInfo { 35 /** 36 * @type { string } 37 * @default Indicates the name of the bundle containing the ability 38 * @syscap SystemCapability.BundleManager.BundleFramework 39 * @since 7 40 * @deprecated since 9 41 */ 42 readonly bundleName: string; 43 44 /** 45 * @type { string } 46 * @default Ability simplified class name 47 * @syscap SystemCapability.BundleManager.BundleFramework 48 * @since 7 49 * @deprecated since 9 50 */ 51 readonly name: string; 52 53 /** 54 * @type { string } 55 * @default Indicates the label of the ability 56 * @syscap SystemCapability.BundleManager.BundleFramework 57 * @since 7 58 * @deprecated since 9 59 */ 60 readonly label: string; 61 62 /** 63 * @type { string } 64 * @default Describes the ability 65 * @syscap SystemCapability.BundleManager.BundleFramework 66 * @since 7 67 * @deprecated since 9 68 */ 69 readonly description: string; 70 71 /** 72 * @type { string } 73 * @default Indicates the icon of the ability 74 * @syscap SystemCapability.BundleManager.BundleFramework 75 * @since 7 76 * @deprecated since 9 77 */ 78 readonly icon: string; 79 80 /** 81 * @type { number } 82 * @default Indicates the label id of the ability 83 * @syscap SystemCapability.BundleManager.BundleFramework 84 * @since 7 85 * @deprecated since 9 86 */ 87 readonly labelId: number; 88 89 /** 90 * @type { number } 91 * @default Indicates the description id of the ability 92 * @syscap SystemCapability.BundleManager.BundleFramework 93 * @since 7 94 * @deprecated since 9 95 */ 96 readonly descriptionId: number; 97 98 /** 99 * @type { number } 100 * @default Indicates the icon id of the ability 101 * @syscap SystemCapability.BundleManager.BundleFramework 102 * @since 7 103 * @deprecated since 9 104 */ 105 readonly iconId: number; 106 107 /** 108 * @type { string } 109 * @default Indicates the name of the .hap package to which the capability belongs 110 * @syscap SystemCapability.BundleManager.BundleFramework 111 * @since 7 112 * @deprecated since 9 113 */ 114 readonly moduleName: string; 115 116 /** 117 * @type { string } 118 * @default Process of ability, if user do not set it ,the value equal application process 119 * @syscap SystemCapability.BundleManager.BundleFramework 120 * @since 7 121 * @deprecated since 9 122 */ 123 readonly process: string; 124 125 /** 126 * @type { string } 127 * @default Info about which ability is this nick point to 128 * @syscap SystemCapability.BundleManager.BundleFramework 129 * @FAModelOnly 130 * @since 7 131 * @deprecated since 9 132 */ 133 readonly targetAbility: string; 134 135 /** 136 * @type { number } 137 * @default Indicates the background service addressing a specific usage scenario 138 * @syscap SystemCapability.BundleManager.BundleFramework 139 * @FAModelOnly 140 * @since 7 141 * @deprecated since 9 142 */ 143 readonly backgroundModes: number; 144 145 /** 146 * @type { boolean } 147 * @default Indicates whether an ability can be called by other abilities 148 * @syscap SystemCapability.BundleManager.BundleFramework 149 * @since 7 150 * @deprecated since 9 151 */ 152 readonly isVisible: boolean; 153 154 /** 155 * @type { boolean } 156 * @default Indicates whether the ability provides the embedded card capability 157 * @syscap SystemCapability.BundleManager.BundleFramework 158 * @FAModelOnly 159 * @since 7 160 * @deprecated since 9 161 */ 162 readonly formEnabled: boolean; 163 164 /** 165 * @type { bundle.AbilityType } 166 * @default Enumerates types of templates that can be used by an ability 167 * @syscap SystemCapability.BundleManager.BundleFramework 168 * @FAModelOnly 169 * @since 7 170 * @deprecated since 9 171 */ 172 readonly type: bundle.AbilityType; 173 174 /** 175 * @type { bundle.AbilitySubType } 176 * @default Enumerates the subType of templates used by an ability 177 * @syscap SystemCapability.BundleManager.BundleFramework 178 * @FAModelOnly 179 * @since 7 180 * @deprecated since 9 181 */ 182 readonly subType: bundle.AbilitySubType; 183 184 /** 185 * @type { bundle.DisplayOrientation } 186 * @default Enumerates ability display orientations 187 * @syscap SystemCapability.BundleManager.BundleFramework 188 * @since 7 189 * @deprecated since 9 190 */ 191 readonly orientation: bundle.DisplayOrientation; 192 193 /** 194 * @type { bundle.LaunchMode } 195 * @default Enumerates ability launch modes 196 * @syscap SystemCapability.BundleManager.BundleFramework 197 * @since 7 198 * @deprecated since 9 199 */ 200 readonly launchMode: bundle.LaunchMode; 201 202 /** 203 * @type { Array<string> } 204 * @default The permissions that others need to launch this ability 205 * @syscap SystemCapability.BundleManager.BundleFramework 206 * @since 7 207 * @deprecated since 9 208 */ 209 readonly permissions: Array<string>; 210 211 /** 212 * @type { Array<string> } 213 * @default The device types that this ability can run on 214 * @syscap SystemCapability.BundleManager.BundleFramework 215 * @since 7 216 * @deprecated since 9 217 */ 218 readonly deviceTypes: Array<string>; 219 220 /** 221 * @type { Array<string> } 222 * @default The device capability that this ability needs 223 * @syscap SystemCapability.BundleManager.BundleFramework 224 * @since 7 225 * @deprecated since 9 226 */ 227 readonly deviceCapabilities: Array<string>; 228 229 /** 230 * @type { string } 231 * @default Indicates the permission required for reading ability data 232 * @syscap SystemCapability.BundleManager.BundleFramework 233 * @FAModelOnly 234 * @since 7 235 * @deprecated since 9 236 */ 237 readonly readPermission: string; 238 239 /** 240 * @type { string } 241 * @default Indicates the permission required for writing data to the ability 242 * @syscap SystemCapability.BundleManager.BundleFramework 243 * @FAModelOnly 244 * @since 7 245 * @deprecated since 9 246 */ 247 readonly writePermission: string; 248 249 /** 250 * @type { ApplicationInfo } 251 * @default Obtains configuration information about an application 252 * @syscap SystemCapability.BundleManager.BundleFramework 253 * @since 7 254 * @deprecated since 9 255 */ 256 readonly applicationInfo: ApplicationInfo; 257 258 /** 259 * @type { string } 260 * @default Uri of ability 261 * @syscap SystemCapability.BundleManager.BundleFramework 262 * @FAModelOnly 263 * @since 7 264 * @deprecated since 9 265 */ 266 readonly uri: string; 267 268 /** 269 * @type { Array<CustomizeData> } 270 * @default Indicates the metadata of ability 271 * @syscap SystemCapability.BundleManager.BundleFramework 272 * @since 8 273 * @deprecated since 9 274 */ 275 readonly metaData: Array<CustomizeData>; 276 277 /** 278 * @type { boolean } 279 * @default Indicates whether the ability is enabled 280 * @syscap SystemCapability.BundleManager.BundleFramework 281 * @since 8 282 * @deprecated since 9 283 */ 284 readonly enabled: boolean; 285} 286