1# @ohos.app.form.formInfo (formInfo)
2
3The **formInfo** module provides types and enums related to the widget information and state.
4
5> **NOTE**
6>
7> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
8
9## Modules to Import
10
11```ts
12import { formInfo } from '@kit.FormKit';
13```
14
15## FormInfo
16
17Defines the widget information.
18
19**System capability**: SystemCapability.Ability.Form
20
21| Name       | Type                | Readable   | Writable   | Description                                                        |
22| ----------- | -------- | -------- | -------------------- | ------------------------------------------------------------ |
23| bundleName  | string               | Yes   | No    | Name of the bundle to which the widget belongs.<br>**Atomic service API**: This API can be used in atomic services since API version 11. |
24| moduleName  | string               | Yes   | No    | Name of the module to which the widget belongs.<br>**Atomic service API**: This API can be used in atomic services since API version 11. |
25| abilityName | string               | Yes   | No    | Name of the ability to which the widget belongs.<br>**Atomic service API**: This API can be used in atomic services since API version 11. |
26| name        | string               | Yes   | No    | Name of an application or atomic service.<br>**Atomic service API**: This API can be used in atomic services since API version 11. |
27| displayName<sup>11+</sup> | string               | Yes   | No    | Widget name.<br>**Atomic service API**: This API can be used in atomic services since API version 11. |
28| displayNameId<sup>11+</sup> | number               | Yes   | No    | ID of the widget name displayed during widget preview.<br>**Atomic service API**: This API can be used in atomic services since API version 11. |
29| description | string               | Yes   | No    | Description of the widget.<br>**Atomic service API**: This API can be used in atomic services since API version 11. |
30| descriptionId<sup>10+</sup>      | number               | Yes   | No    | ID of the widget description.<br>**Atomic service API**: This API can be used in atomic services since API version 11. |
31| type        | [FormType](#formtype)             | Yes   | No    | Type of the widget. Currently, JS and ArkTS widgets are supported.<br>**Atomic service API**: This API can be used in atomic services since API version 11. |
32| jsComponentName      | string               | Yes   | No    | Name of the component used in the JS widget.<br>**Atomic service API**: This API can be used in atomic services since API version 11. |
33| colorMode  | [ColorMode](#colormode) | Yes   | No    | Color mode of the widget.<br>**Atomic service API**: This API can be used in atomic services since API version 11. |
34| isDefault    | boolean      | Yes   | No    | Whether the widget is the default one.<br>**Atomic service API**: This API can be used in atomic services since API version 11. |
35| updateEnabled  | boolean               | Yes   | No    | Whether the widget is updatable.<br>**Atomic service API**: This API can be used in atomic services since API version 11. |
36| formVisibleNotify  | boolean        | Yes   | No    | Whether to send a notification when the widget is visible.<br>**Atomic service API**: This API can be used in atomic services since API version 11. |
37| scheduledUpdateTime        | string               | Yes   | No    | Time when the widget was updated.<br>**Atomic service API**: This API can be used in atomic services since API version 11. |
38| formConfigAbility | string               | Yes   | No    | Configuration ability of the widget, that is, the ability corresponding to the option in the selection box displayed when the widget is long pressed.<br>**Atomic service API**: This API can be used in atomic services since API version 11. |
39| updateDuration        | number       | Yes   | No    | Update period of the widget.<br>**Atomic service API**: This API can be used in atomic services since API version 11. |
40| defaultDimension  | number | Yes   | No    | Widget specifications.<br>**Atomic service API**: This API can be used in atomic services since API version 11. |
41| supportDimensions    | Array&lt;number&gt;      | Yes   | No    | Dimensions supported by the widget. For details, see [FormDimension](#formdimension).<br>**Atomic service API**: This API can be used in atomic services since API version 11. |
42| customizeData    | Record\<string, string>      | Yes   | No    | Custom data of the widget.<br>**Atomic service API**: This API can be used in atomic services since API version 11. |
43| isDynamic<sup>10+</sup>      | boolean               | Yes   | No    | Whether the widget is a dynamic widget.<br>ArkTS widgets are classified into dynamic and static widgets. JS widgets are all dynamic widgets.<br>**Atomic service API**: This API can be used in atomic services since API version 11. |
44| transparencyEnabled<sup>11+</sup>      | boolean               | Yes   | No    | Whether the widget supports the setting of the background transparency.<br>For ArkTS widgets, the support for the background transparency setting depends on user configurations. For JS widgets, the background transparency setting is not supported.<br>**Atomic service API**: This API can be used in atomic services since API version 11. |
45| supportedShapes<sup>12+</sup>    | Array&lt;number&gt;      | Yes   | No    | Shapes supported by the widget. For details about the available shapes, see [FormShape<sup>12+</sup>](#formshape12).<br>**Atomic service API**: This API can be used in atomic services since API version 12. |
46
47## FormType
48
49Enumerates the widget types.
50
51**Atomic service API**: This API can be used in atomic services since API version 11.
52
53**System capability**: SystemCapability.Ability.Form
54
55| Name       | Value  | Description        |
56| ----------- | ---- | ------------ |
57| JS      | 1    | JS widget.  |
58| eTS     | 2    | ArkTS widget. |
59
60## ColorMode
61
62Enumerates the color modes supported by the widget.
63
64**Atomic service API**: This API can be used in atomic services since API version 11.
65
66**System capability**: SystemCapability.Ability.Form
67
68| Name       | Value  | Description        |
69| ----------- | ---- | ------------ |
70| MODE_AUTO   | -1    | Auto mode.  |
71| MODE_DARK    | 0   | Dark mode.  |
72| MODE_LIGHT     | 1   | Light mode.  |
73
74## FormStateInfo
75
76Describes the widget state information.
77
78**Atomic service API**: This API can be used in atomic services since API version 11.
79
80**System capability**: SystemCapability.Ability.Form
81
82| Name       | Type                | Readable   | Writable   | Description                                                        |
83| ----------- | -------- | -------- | -------------------- | ------------------------------------------------------------ |
84| formState  | [FormState](#formstate)               | Yes   | No    | Widget state.                         |
85| want  | [Want](../apis-ability-kit/js-apis-app-ability-want.md)         | Yes   | No    | Want text.   |
86
87##  FormState
88
89Enumerates the widget states.
90
91**Atomic service API**: This API can be used in atomic services since API version 11.
92
93**System capability**: SystemCapability.Ability.Form
94
95| Name       | Value  | Description        |
96| ----------- | ---- | ------------ |
97| UNKNOWN    | -1    | Unknown state.  |
98| DEFAULT     | 0   | Default state.  |
99| READY      | 1   | Ready state.  |
100
101##  FormParam
102
103Enumerates the widget parameters.
104
105**System capability**: SystemCapability.Ability.Form
106
107| Name       | Value  | Description        |
108| ----------- | ---- | ------------ |
109| IDENTITY_KEY     | 'ohos.extra.param.key.form_identity'    | Widget ID.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
110| DIMENSION_KEY      | 'ohos.extra.param.key.form_dimension'  | Widget dimension.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
111| NAME_KEY       | 'ohos.extra.param.key.form_name'   | Widget name.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
112| MODULE_NAME_KEY        | 'ohos.extra.param.key.module_name'   | Name of the module to which the widget belongs.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
113| WIDTH_KEY        | 'ohos.extra.param.key.form_width'   | Widget width.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
114| HEIGHT_KEY         | 'ohos.extra.param.key.form_height'   | Widget height.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
115| TEMPORARY_KEY          | 'ohos.extra.param.key.form_temporary'   | Temporary widget.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
116| ABILITY_NAME_KEY   | 'ohos.extra.param.key.ability_name'   | Ability name.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
117| BUNDLE_NAME_KEY    | 'ohos.extra.param.key.bundle_name'   | Bundle name.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
118| LAUNCH_REASON_KEY<sup>10+</sup>    | 'ohos.extra.param.key.form_launch_reason'   | Reason for creating the widget.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
119| PARAM_FORM_CUSTOMIZE_KEY<sup>10+</sup>    | 'ohos.extra.param.key.form_customize'   | Custom data.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
120| FORM_RENDERING_MODE_KEY<sup>11+</sup>    | 'ohos.extra.param.key.form_rendering_mode'   | Widget rendering mode.<br>**Atomic service API**: This API can be used in atomic services since API version 12. |
121| HOST_BG_INVERSE_COLOR_KEY<sup>12+</sup>    | 'ohos.extra.param.key.host_bg_inverse_color'   | Inverse background color of the widget client.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
122| FORM_LOCATION_KEY<sup>12+</sup>    | 'ohos.extra.param.key.form_location'   | Widget location.|
123| FORM_PERMISSION_NAME_KEY<sup>12+</sup> | 'ohos.extra.param.key.permission_name' | Name of the permission.<br>**Atomic service API**: This API can be used in atomic services since API version 12. |
124| FORM_PERMISSION_GRANTED_KEY<sup>12+</sup> | 'ohos.extra.param.key.permission_granted' | Whether the permission is granted.<br>**Atomic service API**: This API can be used in atomic services since API version 12. |
125
126##  FormDimension
127
128Enumerates the widget dimensions.
129
130**System capability**: SystemCapability.Ability.Form
131
132| Name       | Value  | Description        |
133| ----------- | ---- | ------------ |
134| Dimension_1_2      | 1   | 1 x 2.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
135| Dimension_2_2      | 2   | 2 x 2.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
136| Dimension_2_4      | 3   | 2 x 4.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
137| Dimension_4_4      | 4   | 4 x 4.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
138| Dimension_2_1      | 5   | 2 x 1.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
139| DIMENSION_1_1<sup>11+<sup>      | 6   | 1 x 1.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
140| DIMENSION_6_4<sup>12+<sup>      | 7   | 6 x 4.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
141
142##  FormShape<sup>12+</sup>
143
144Enumerates the widget shapes.
145
146**System capability**: SystemCapability.Ability.Form
147
148| Name       | Value  | Description        |
149| ----------- | ---- | ------------ |
150| RECT        | 1   | Rectangle.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
151| CIRCLE      | 2   | Circle.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
152
153## FormInfoFilter
154
155Defines the widget information filter. Only the widget information that meets the filter is returned.
156
157**Atomic service API**: This API can be used in atomic services since API version 11.
158
159**System capability**: SystemCapability.Ability.Form
160
161| Name       | Type  | Mandatory        |Description        |
162| ----------- | ---- | ------------ |------------ |
163| moduleName    | string    |No   | Only the information about the widget whose **moduleName** is the same as the provided value is returned.<br>If this parameter is not set, **moduleName** is not used for filtering.  |
164
165
166
167## VisibilityType
168
169Enumerates the visibility types of the widget.
170
171**Atomic service API**: This API can be used in atomic services since API version 11.
172
173**System capability**: SystemCapability.Ability.Form
174
175| Name       |  Value  | Description        |
176| ----------- | ---- | ------------ |
177| UNKNOWN<sup>10+</sup> | 0   | The visibility type of the widget is unknown. |
178| FORM_VISIBLE | 1   | The widget is visible. |
179| FORM_INVISIBLE   | 2   | The widget is invisible. |
180
181
182## LaunchReason<sup>10+</sup>
183
184Enumerates the reasons for creating a widget.
185
186**Atomic service API**: This API can be used in atomic services since API version 11.
187
188**System capability**: SystemCapability.Ability.Form
189
190| Name       |  Value  | Description        |
191| ----------- | ---- | ------------ |
192| FORM_DEFAULT | 1   | The widget is created by default. |
193| FORM_SHARE   | 2   | The widget is created for sharing. |
194