1/* 2 * Copyright (c) 2022-2023 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 */ 19 20import Want from './@ohos.app.ability.Want'; 21 22/** 23 * interface of formInfo. 24 * 25 * @namespace formInfo 26 * @syscap SystemCapability.Ability.Form 27 * @since 8 28 * @deprecated since 9 29 * @useinstead ohos.app.form.formInfo/formInfo 30 */ 31declare namespace formInfo { 32 /** 33 * Provides information about a form. 34 * 35 * @typedef FormInfo 36 * @syscap SystemCapability.Ability.Form 37 * @since 8 38 * @deprecated since 9 39 * @useinstead ohos.app.form.formInfo/formInfo#FormInfo 40 */ 41 interface FormInfo { 42 /** 43 * Obtains the bundle name of the application to which this form belongs. 44 * 45 * @type { string } 46 * @syscap SystemCapability.Ability.Form 47 * @since 8 48 * @deprecated since 9 49 * @useinstead ohos.app.form.formInfo/formInfo.FormInfo#bundleName 50 */ 51 bundleName: string; 52 53 /** 54 * Obtains the name of the application module to which this form belongs. 55 * 56 * @type { string } 57 * @syscap SystemCapability.Ability.Form 58 * @since 8 59 * @deprecated since 9 60 * @useinstead ohos.app.form.formInfo/formInfo.FormInfo#moduleName 61 */ 62 moduleName: string; 63 64 /** 65 * Obtains the class name of the ability to which this form belongs. 66 * 67 * @type { string } 68 * @syscap SystemCapability.Ability.Form 69 * @since 8 70 * @deprecated since 9 71 * @useinstead ohos.app.form.formInfo/formInfo.FormInfo#abilityName 72 */ 73 abilityName: string; 74 75 /** 76 * Obtains the name of this form. 77 * 78 * @type { string } 79 * @syscap SystemCapability.Ability.Form 80 * @since 8 81 * @deprecated since 9 82 * @useinstead ohos.app.form.formInfo/formInfo.FormInfo#name 83 */ 84 name: string; 85 86 /** 87 * Obtains the name of this form. 88 * 89 * @type { string } 90 * @syscap SystemCapability.Ability.Form 91 * @since 8 92 * @deprecated since 9 93 * @useinstead ohos.app.form.formInfo/formInfo.FormInfo#description 94 */ 95 description: string; 96 97 /** 98 * Obtains the type of this form. Currently, JS forms are supported. 99 * 100 * @type { FormType } 101 * @syscap SystemCapability.Ability.Form 102 * @since 8 103 * @deprecated since 9 104 * @useinstead ohos.app.form.formInfo/formInfo.FormInfo#type 105 */ 106 type: FormType; 107 108 /** 109 * Obtains the JS component name of this JS form. 110 * 111 * @type { string } 112 * @syscap SystemCapability.Ability.Form 113 * @since 8 114 * @deprecated since 9 115 * @useinstead ohos.app.form.formInfo/formInfo.FormInfo#jsComponentName 116 */ 117 jsComponentName: string; 118 119 /** 120 * Obtains the color mode of this form. 121 * 122 * @type { ColorMode } 123 * @syscap SystemCapability.Ability.Form 124 * @since 8 125 * @deprecated since 9 126 * @useinstead ohos.app.form.formInfo/formInfo.FormInfo#colorMode 127 */ 128 colorMode: ColorMode; 129 130 /** 131 * Checks whether this form is a default form. 132 * 133 * @type { boolean } 134 * @syscap SystemCapability.Ability.Form 135 * @since 8 136 * @deprecated since 9 137 * @useinstead ohos.app.form.formInfo/formInfo.FormInfo#isDefault 138 */ 139 isDefault: boolean; 140 141 /** 142 * Obtains the updateEnabled. 143 * 144 * @type { boolean } 145 * @syscap SystemCapability.Ability.Form 146 * @since 8 147 * @deprecated since 9 148 * @useinstead ohos.app.form.formInfo/formInfo.FormInfo#updateEnabled 149 */ 150 updateEnabled: boolean; 151 152 /** 153 * Obtains whether notify visible of this form. 154 * 155 * @type { boolean } 156 * @syscap SystemCapability.Ability.Form 157 * @since 8 158 * @deprecated since 9 159 * @useinstead ohos.app.form.formInfo/formInfo.FormInfo#formVisibleNotify 160 */ 161 formVisibleNotify: boolean; 162 163 /** 164 * Obtains the bundle relatedBundleName of the application to which this form belongs. 165 * 166 * @type { string } 167 * @syscap SystemCapability.Ability.Form 168 * @since 8 169 * @deprecated since 9 170 */ 171 relatedBundleName: string; 172 173 /** 174 * Obtains the scheduledUpdateTime. 175 * 176 * @type { string } 177 * @syscap SystemCapability.Ability.Form 178 * @since 8 179 * @deprecated since 9 180 * @useinstead ohos.app.form.formInfo/formInfo.FormInfo#scheduledUpdateTime 181 */ 182 scheduledUpdateTime: string; 183 184 /** 185 * Obtains the form config ability about this form. 186 * 187 * @type { string } 188 * @syscap SystemCapability.Ability.Form 189 * @since 8 190 * @deprecated since 9 191 * @useinstead ohos.app.form.formInfo/formInfo.FormInfo#formConfigAbility 192 */ 193 formConfigAbility: string; 194 195 /** 196 * Obtains the updateDuration. 197 * 198 * @type { number } 199 * @syscap SystemCapability.Ability.Form 200 * @since 8 201 * @deprecated since 9 202 * @useinstead ohos.app.form.formInfo/formInfo.FormInfo#updateDuration 203 */ 204 updateDuration: number; 205 206 /** 207 * Obtains the default grid style of this form. 208 * 209 * @type { number } 210 * @syscap SystemCapability.Ability.Form 211 * @since 8 212 * @deprecated since 9 213 * @useinstead ohos.app.form.formInfo/formInfo.FormInfo#defaultDimension 214 */ 215 defaultDimension: number; 216 217 /** 218 * Obtains the grid styles supported by this form. 219 * 220 * @type { Array<number> } 221 * @syscap SystemCapability.Ability.Form 222 * @since 8 223 * @deprecated since 9 224 * @useinstead ohos.app.form.formInfo/formInfo.FormInfo#supportDimensions 225 */ 226 supportDimensions: Array<number>; 227 228 /** 229 * Obtains the custom data defined in this form. 230 * 231 * @type { object } 232 * @syscap SystemCapability.Ability.Form 233 * @since 8 234 * @deprecated since 9 235 * @useinstead ohos.app.form.formInfo/formInfo.FormInfo#customizeData 236 */ 237 customizeData: { [key: string]: [value: string] }; 238 } 239 240 /** 241 * Type of form. 242 * 243 * @enum { number } 244 * @syscap SystemCapability.Ability.Form 245 * @since 8 246 * @deprecated since 9 247 * @useinstead ohos.app.form.formInfo/formInfo#FormType 248 */ 249 enum FormType { 250 /** 251 * JS form. 252 * 253 * @syscap SystemCapability.Ability.Form 254 * @since 8 255 * @deprecated since 9 256 * @useinstead ohos.app.form.formInfo/formInfo.FormType#JS 257 */ 258 JS = 1 259 } 260 261 /** 262 * Color mode. 263 * 264 * @enum { number } 265 * @syscap SystemCapability.Ability.Form 266 * @since 8 267 * @deprecated since 9 268 * @useinstead ohos.app.form.formInfo/formInfo#ColorMode 269 */ 270 enum ColorMode { 271 /** 272 * Automatic mode. 273 * 274 * @syscap SystemCapability.Ability.Form 275 * @since 8 276 * @deprecated since 9 277 * @useinstead ohos.app.form.formInfo/formInfo.ColorMode#MODE_AUTO 278 */ 279 MODE_AUTO = -1, 280 281 /** 282 * Dark mode. 283 * 284 * @syscap SystemCapability.Ability.Form 285 * @since 8 286 * @deprecated since 9 287 * @useinstead ohos.app.form.formInfo/formInfo.ColorMode#MODE_DARK 288 */ 289 MODE_DARK = 0, 290 291 /** 292 * Light mode. 293 * 294 * @syscap SystemCapability.Ability.Form 295 * @since 8 296 * @deprecated since 9 297 * @useinstead ohos.app.form.formInfo/formInfo.ColorMode#MODE_LIGHT 298 */ 299 MODE_LIGHT = 1 300 } 301 302 /** 303 * Provides state information about a form. 304 * 305 * @typedef FormStateInfo 306 * @syscap SystemCapability.Ability.Form 307 * @since 8 308 * @deprecated since 9 309 * @useinstead ohos.app.form.formInfo/formInfo#FormStateInfo 310 */ 311 interface FormStateInfo { 312 /** 313 * Obtains the form state. 314 * 315 * @type { FormState } 316 * @syscap SystemCapability.Ability.Form 317 * @since 8 318 * @deprecated since 9 319 * @useinstead ohos.app.form.formInfo/formInfo.FormStateInfo#formState 320 */ 321 formState: FormState; 322 323 /** 324 * Obtains the want form . 325 * 326 * @type { Want } 327 * @syscap SystemCapability.Ability.Form 328 * @since 8 329 * @deprecated since 9 330 * @useinstead ohos.app.form.formInfo/formInfo.FormStateInfo#want 331 */ 332 want: Want; 333 } 334 335 /** 336 * Provides state about a form. 337 * 338 * @enum { number } 339 * @syscap SystemCapability.Ability.Form 340 * @since 8 341 * @deprecated since 9 342 * @useinstead ohos.app.form.formInfo/formInfo#FormState 343 */ 344 enum FormState { 345 /** 346 * Indicates that the form status is unknown due to an internal error. 347 * 348 * @syscap SystemCapability.Ability.Form 349 * @since 8 350 * @deprecated since 9 351 * @useinstead ohos.app.form.formInfo/formInfo.FormState#UNKNOWN 352 */ 353 UNKNOWN = -1, 354 355 /** 356 * Indicates that the form is in the default state. 357 * 358 * @syscap SystemCapability.Ability.Form 359 * @since 8 360 * @deprecated since 9 361 * @useinstead ohos.app.form.formInfo/formInfo.FormState#DEFAULT 362 */ 363 DEFAULT = 0, 364 365 /** 366 * Indicates that the form is ready. 367 * 368 * @syscap SystemCapability.Ability.Form 369 * @since 8 370 * @deprecated since 9 371 * @useinstead ohos.app.form.formInfo/formInfo.FormState#READY 372 */ 373 READY = 1 374 } 375 376 /** 377 * Parameter of form. 378 * 379 * @enum { string } 380 * @syscap SystemCapability.Ability.Form 381 * @since 8 382 * @deprecated since 9 383 * @useinstead ohos.app.form.formInfo/formInfo#FormParam 384 */ 385 enum FormParam { 386 /** 387 * Indicates the key specifying the ID of the form to be obtained, which is represented as 388 * want: { 389 * "parameters": { 390 * IDENTITY_KEY: 1L 391 * } 392 * }. 393 * 394 * @syscap SystemCapability.Ability.Form 395 * @systemapi 396 * @since 8 397 * @deprecated since 9 398 * @useinstead ohos.app.form.formInfo/formInfo.FormParam#IDENTITY_KEY 399 */ 400 IDENTITY_KEY = 'ohos.extra.param.key.form_identity', 401 402 /** 403 * Indicates the key specifying the grid style of the form to be obtained, which is represented as 404 * want: { 405 * "parameters": { 406 * DIMENSION_KEY: FormDimension.Dimension_1_2 407 * } 408 * }. 409 * 410 * @syscap SystemCapability.Ability.Form 411 * @since 8 412 * @deprecated since 9 413 * @useinstead ohos.app.form.formInfo/formInfo.FormParam#DIMENSION_KEY 414 */ 415 DIMENSION_KEY = 'ohos.extra.param.key.form_dimension', 416 417 /** 418 * Indicates the key specifying the name of the form to be obtained, which is represented as 419 * want: { 420 * "parameters": { 421 * NAME_KEY: "formName" 422 * } 423 * }. 424 * 425 * @syscap SystemCapability.Ability.Form 426 * @since 8 427 * @deprecated since 9 428 * @useinstead ohos.app.form.formInfo/formInfo.FormParam#NAME_KEY 429 */ 430 NAME_KEY = 'ohos.extra.param.key.form_name', 431 432 /** 433 * Indicates the key specifying the name of the module to which the form to be obtained belongs, which is 434 * represented as 435 * want: { 436 * "parameters": { 437 * MODULE_NAME_KEY: "formEntry" 438 * } 439 * } 440 * This constant is mandatory. 441 * 442 * @syscap SystemCapability.Ability.Form 443 * @since 8 444 * @deprecated since 9 445 * @useinstead ohos.app.form.formInfo/formInfo.FormParam#MODULE_NAME_KEY 446 */ 447 MODULE_NAME_KEY = 'ohos.extra.param.key.module_name', 448 449 /** 450 * Indicates the key specifying the width of the form to be obtained, which is represented as 451 * want: { 452 * "parameters": { 453 * WIDTH_KEY: 800 454 * } 455 * } 456 * 457 * @syscap SystemCapability.Ability.Form 458 * @since 8 459 * @deprecated since 9 460 * @useinstead ohos.app.form.formInfo/formInfo.FormParam#WIDTH_KEY 461 */ 462 WIDTH_KEY = 'ohos.extra.param.key.form_width', 463 464 /** 465 * Indicates the key specifying the height of the form to be obtained, which is represented as 466 * want: { 467 * "parameters": { 468 * HEIGHT_KEY: 400 469 * } 470 * } 471 * 472 * @syscap SystemCapability.Ability.Form 473 * @since 8 474 * @deprecated since 9 475 * @useinstead ohos.app.form.formInfo/formInfo.FormParam#HEIGHT_KEY 476 */ 477 HEIGHT_KEY = 'ohos.extra.param.key.form_height', 478 479 /** 480 * Indicates the key specifying whether a form is temporary, which is represented as 481 * want: { 482 * "parameters": { 483 * TEMPORARY_KEY: true 484 * } 485 * } 486 * 487 * @syscap SystemCapability.Ability.Form 488 * @since 8 489 * @deprecated since 9 490 * @useinstead ohos.app.form.formInfo/formInfo.FormParam#TEMPORARY_KEY 491 */ 492 TEMPORARY_KEY = 'ohos.extra.param.key.form_temporary' 493 } 494} 495export default formInfo; 496