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