1e41f4b71Sopenharmony_ci# ArkUI Subsystem ChangeLog
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci## cl.arkui.1 Restrictions on Data Type Declarations of State Variables
4e41f4b71Sopenharmony_ci
5e41f4b71Sopenharmony_ci1. The data types of state variables decorated by state decorators must be explicitly declared. They cannot be declared as **any** or **Date**.
6e41f4b71Sopenharmony_ci
7e41f4b71Sopenharmony_ci    Example:
8e41f4b71Sopenharmony_ci
9e41f4b71Sopenharmony_ci    ```ts
10e41f4b71Sopenharmony_ci    // xxx.ets
11e41f4b71Sopenharmony_ci    @Entry
12e41f4b71Sopenharmony_ci    @Component
13e41f4b71Sopenharmony_ci    struct DatePickerExample {
14e41f4b71Sopenharmony_ci      // Incorrect: @State isLunar: any = false
15e41f4b71Sopenharmony_ci      @State isLunar: boolean = false
16e41f4b71Sopenharmony_ci      // Incorrect: @State selectedDate: Date = new Date('2021-08-08')
17e41f4b71Sopenharmony_ci      private selectedDate: Date = new Date('2021-08-08')
18e41f4b71Sopenharmony_ci
19e41f4b71Sopenharmony_ci      build() {
20e41f4b71Sopenharmony_ci        Column() {
21e41f4b71Sopenharmony_ci          Button('Switch Calendar')
22e41f4b71Sopenharmony_ci            .margin({ top: 30 })
23e41f4b71Sopenharmony_ci            .onClick(() => {
24e41f4b71Sopenharmony_ci              this.isLunar = !this.isLunar
25e41f4b71Sopenharmony_ci            })
26e41f4b71Sopenharmony_ci          DatePicker({
27e41f4b71Sopenharmony_ci            start: new Date('1970-1-1'),
28e41f4b71Sopenharmony_ci            end: new Date('2100-1-1'),
29e41f4b71Sopenharmony_ci            selected: this.selectedDate
30e41f4b71Sopenharmony_ci          })
31e41f4b71Sopenharmony_ci            .lunar(this.isLunar)
32e41f4b71Sopenharmony_ci            .onChange((value: DatePickerResult) => {
33e41f4b71Sopenharmony_ci              this.selectedDate.setFullYear(value.year, value.month, value.day)
34e41f4b71Sopenharmony_ci              console.info('select current date is: ' + JSON.stringify(value))
35e41f4b71Sopenharmony_ci            })
36e41f4b71Sopenharmony_ci
37e41f4b71Sopenharmony_ci        }.width('100%')
38e41f4b71Sopenharmony_ci      }
39e41f4b71Sopenharmony_ci    }
40e41f4b71Sopenharmony_ci    ```
41e41f4b71Sopenharmony_ci
42e41f4b71Sopenharmony_ci2. The data type declaration of the **@State**, **@Provide**, **@Link**, or **@Consume** decorated state variables can consist of only one of the primitive data types or reference data types.
43e41f4b71Sopenharmony_ci
44e41f4b71Sopenharmony_ci    The **Length**, **ResourceStr**, and **ResourceColor** types are combinations of primitive data types or reference data types. Therefore, they cannot be used by the aforementioned types of state variables.
45e41f4b71Sopenharmony_ci    For details about the definitions of **Length**, **ResourceStr**, and **ResourceColor**, see [Types](../../../application-dev/reference/arkui-ts/ts-types.md).
46e41f4b71Sopenharmony_ci
47e41f4b71Sopenharmony_ci    Example:
48e41f4b71Sopenharmony_ci
49e41f4b71Sopenharmony_ci    ```ts
50e41f4b71Sopenharmony_ci    // xxx.ets
51e41f4b71Sopenharmony_ci    @Entry
52e41f4b71Sopenharmony_ci    @Component
53e41f4b71Sopenharmony_ci    struct IndexPage {
54e41f4b71Sopenharmony_ci      // Incorrect: @State message: string | Resource = 'Hello World'
55e41f4b71Sopenharmony_ci      @State message: string = 'Hello World'
56e41f4b71Sopenharmony_ci      // Incorrect: @State message: ResourceStr = $r('app.string.hello')
57e41f4b71Sopenharmony_ci      @State resourceStr: Resource = $r('app.string.hello')
58e41f4b71Sopenharmony_ci    
59e41f4b71Sopenharmony_ci      build() {
60e41f4b71Sopenharmony_ci        Row() {
61e41f4b71Sopenharmony_ci          Column() {
62e41f4b71Sopenharmony_ci            Text(`${this.message}`)
63e41f4b71Sopenharmony_ci              .fontSize(50)
64e41f4b71Sopenharmony_ci              .fontWeight(FontWeight.Bold)
65e41f4b71Sopenharmony_ci          }
66e41f4b71Sopenharmony_ci          .width('100%')
67e41f4b71Sopenharmony_ci        }
68e41f4b71Sopenharmony_ci        .height('100%')
69e41f4b71Sopenharmony_ci      }
70e41f4b71Sopenharmony_ci    }
71e41f4b71Sopenharmony_ci    ```
72e41f4b71Sopenharmony_ci
73e41f4b71Sopenharmony_ci    ![hello](../../../application-dev/quick-start/figures/hello.PNG)
74e41f4b71Sopenharmony_ci
75e41f4b71Sopenharmony_ci**Change Impact**
76e41f4b71Sopenharmony_ci
77e41f4b71Sopenharmony_ci1. If the data type of a state variable decorated by a state decorator is declared as **any**, a build error will occur.
78e41f4b71Sopenharmony_ci    ```ts
79e41f4b71Sopenharmony_ci    // ArkTS:ERROR Please define an explicit type, not any.
80e41f4b71Sopenharmony_ci    @State isLunar: any = false
81e41f4b71Sopenharmony_ci    ```
82e41f4b71Sopenharmony_ci2. If the data type of a state variable decorated by a state decorator is declared as **Date**, a build error will occur.
83e41f4b71Sopenharmony_ci    ```ts
84e41f4b71Sopenharmony_ci    // ArkTS:ERROR The @State property 'selectedDate' cannot be a 'Date' object.
85e41f4b71Sopenharmony_ci    @State selectedDate: Date = new Date('2021-08-08')
86e41f4b71Sopenharmony_ci    ```
87e41f4b71Sopenharmony_ci3. If the data type of a **@State**, **@Provide**, **@Link**, and or **@Consume** decorated state variable is Length, **ResourceStr**, or **ResourceColor**, a build error will occur.
88e41f4b71Sopenharmony_ci    ```ts
89e41f4b71Sopenharmony_ci    /* ArkTS:ERROR The state variable type here is 'ResourceStr', it contains both a simple type and an object type,
90e41f4b71Sopenharmony_ci      which are not allowed to be defined for state variable of a struct.*/
91e41f4b71Sopenharmony_ci    @State message: ResourceStr = $r('app.string.hello')
92e41f4b71Sopenharmony_ci    ```
93e41f4b71Sopenharmony_ci
94e41f4b71Sopenharmony_ci**Key API/Component Changes**
95e41f4b71Sopenharmony_ci
96e41f4b71Sopenharmony_ciN/A
97e41f4b71Sopenharmony_ci
98e41f4b71Sopenharmony_ci**Adaptation Guide**
99e41f4b71Sopenharmony_ci
100e41f4b71Sopenharmony_ci1. Explicitly declare the data type for state variables decorated by state decorators.
101e41f4b71Sopenharmony_ci2. If a state variable decorated by a state decorator uses the **Date** object, change it to a regular variable – a variable not decorated by any decorator.
102e41f4b71Sopenharmony_ci3. Adapt the **@State**, **@Provide**, **@Link**, and **@Consume** decorated variables based on the following code snippet so that they do not use the **Length(string|number|Resource)**, **ResourceStr(string|Resource)**, and **ResourceColor(string|number|Color|Resource)** types:
103e41f4b71Sopenharmony_ci    ```ts
104e41f4b71Sopenharmony_ci    // Incorrect:
105e41f4b71Sopenharmony_ci    @State message: ResourceStr = $r('app.string.hello')
106e41f4b71Sopenharmony_ci    // Corrected:
107e41f4b71Sopenharmony_ci    @State resourceStr: Resource = $r('app.string.hello')
108e41f4b71Sopenharmony_ci    ```
109e41f4b71Sopenharmony_ci
110e41f4b71Sopenharmony_ci
111e41f4b71Sopenharmony_ci## cl.arkui.2 Initialization Rules and Restrictions of Custom Components' Member Variables
112e41f4b71Sopenharmony_ci
113e41f4b71Sopenharmony_ciComply with the following rules when using constructors to initialize member variables:
114e41f4b71Sopenharmony_ci
115e41f4b71Sopenharmony_ci| **From the Variable in the Parent Component (Right) to the Variable in the Child Component (Below)**| **regular** | **@State** | **@Link** | **@Prop** | **@Provide** | **@Consume** | **@ObjectLink** |
116e41f4b71Sopenharmony_ci|---------------------------------|----------------------------|------------|-----------|-----------|--------------|--------------|------------------|
117e41f4b71Sopenharmony_ci| **regular**                    | Supported                        | Supported        | Supported       | Supported       | Not supported           | Not supported           | Supported              |
118e41f4b71Sopenharmony_ci| **@State**                     | Supported                        | Supported        | Supported       | Supported       | Supported          | Supported          | Supported              |
119e41f4b71Sopenharmony_ci| **@Link**                      | Not supported                         | Supported (1)     | Supported (1)    | Supported (1)    | Supported (1)       | Supported (1)       | Supported (1)           |
120e41f4b71Sopenharmony_ci| **@Prop**                      | Supported                        | Supported        | Supported       | Supported       | Supported          | Supported          | Supported              |
121e41f4b71Sopenharmony_ci| **@Provide**                   | Supported                        | Supported        | Supported       | Supported       | Supported          | Supported          | Supported              |
122e41f4b71Sopenharmony_ci| **@Consume**                   | Not supported                         | Not supported         | Not supported        | Not supported        | Not supported           | Not supported           | Not supported               |
123e41f4b71Sopenharmony_ci| **@ObjectLink**                | Not supported                         | Not supported     | Not supported        | Not supported        | Not supported           | Not supported           | Not supported               |
124e41f4b71Sopenharmony_ci
125e41f4b71Sopenharmony_ci| **From the Variable in the Parent Component (Right) to the Variable in the Child Component (Below)**| **@StorageLink** | **@StorageProp** | **@LocalStorageLink** | **@LocalStorageProp** |
126e41f4b71Sopenharmony_ci|------------------|------------------|------------------|-----------------------|------------------------|
127e41f4b71Sopenharmony_ci| **regular**                   | Supported              | Not supported               | Not supported                    | Not supported             |
128e41f4b71Sopenharmony_ci| **@State**                    | Supported              | Supported              | Supported                   | Supported                    |
129e41f4b71Sopenharmony_ci| **@Link**                     | Supported (1)           | Supported (1)           | Supported (1)                | Supported (1)                 |
130e41f4b71Sopenharmony_ci| **@Prop**                     | Supported              | Supported              | Supported                   | Supported                    |
131e41f4b71Sopenharmony_ci| **@Provide**                  | Supported              | Supported              | Supported                   | Supported                    |
132e41f4b71Sopenharmony_ci| **@Consume**                  | Not supported            | Not supported             | Not supported                 | Not supported                  |
133e41f4b71Sopenharmony_ci| **@ObjectLink**               | Not supported            | Not supported             | Not supported                 | Not supported                  |
134e41f4b71Sopenharmony_ci
135e41f4b71Sopenharmony_ci> **NOTE**
136e41f4b71Sopenharmony_ci>
137e41f4b71Sopenharmony_ci> **Supported (1)**: The dollar sign ($) must be used, for example, **this.$varA**. 
138e41f4b71Sopenharmony_ci>
139e41f4b71Sopenharmony_ci> **regular**: refers to a regular variable that is not decorated by any decorator.
140e41f4b71Sopenharmony_ci
141e41f4b71Sopenharmony_ci**@StorageLink**, **@StorageProp**, **@LocalStorageLink**, and **@LocalStorageProp** variables cannot be initialized from the parent component.
142e41f4b71Sopenharmony_ci
143e41f4b71Sopenharmony_ci**Change Impact**
144e41f4b71Sopenharmony_ci
145e41f4b71Sopenharmony_ci1. Variables decorated by **@LocalStorageLink** and **@LocalStorageProp** cannot be initialized from the parent component.
146e41f4b71Sopenharmony_ci    ```ts
147e41f4b71Sopenharmony_ci    @Entry
148e41f4b71Sopenharmony_ci    @Component
149e41f4b71Sopenharmony_ci    struct LocalStorageComponent {
150e41f4b71Sopenharmony_ci        build() {
151e41f4b71Sopenharmony_ci            Column() {
152e41f4b71Sopenharmony_ci                Child({
153e41f4b71Sopenharmony_ci                  /* ArkTS:ERROR Property 'simpleVarName' in the custom component 'Child' cannot
154e41f4b71Sopenharmony_ci                    initialize here (forbidden to specify). */
155e41f4b71Sopenharmony_ci                  simpleVarName: 1,
156e41f4b71Sopenharmony_ci                  /* ArkTS:ERROR Property 'objectName' in the custom component 'Child' cannot
157e41f4b71Sopenharmony_ci                    initialize here (forbidden to specify). */
158e41f4b71Sopenharmony_ci                  objectName: new ClassA("x")
159e41f4b71Sopenharmony_ci                })
160e41f4b71Sopenharmony_ci            }
161e41f4b71Sopenharmony_ci        }
162e41f4b71Sopenharmony_ci    }
163e41f4b71Sopenharmony_ci    @Component
164e41f4b71Sopenharmony_ci    struct Child {
165e41f4b71Sopenharmony_ci        @LocalStorageLink("storageSimpleProp") simpleVarName: number = 0;
166e41f4b71Sopenharmony_ci        @LocalStorageProp("storageObjectProp") objectName: ClassA = new ClassA("x");
167e41f4b71Sopenharmony_ci        build() {}
168e41f4b71Sopenharmony_ci    }
169e41f4b71Sopenharmony_ci    ```
170e41f4b71Sopenharmony_ci2. The **@ObjectLink** decorated variable cannot be directly initialized from a decorated variable in the parent component. The source of the parent component must be an array item or object attribute decorated by **@State**, **@Link**, **@Provide**, **@Consume**, or **@ObjectLink**.
171e41f4b71Sopenharmony_ci    ```ts
172e41f4b71Sopenharmony_ci    let NextID : number = 0;
173e41f4b71Sopenharmony_ci    
174e41f4b71Sopenharmony_ci    @Observed class ClassA {
175e41f4b71Sopenharmony_ci      public id : number;
176e41f4b71Sopenharmony_ci      public c: number;
177e41f4b71Sopenharmony_ci      constructor(c: number) {
178e41f4b71Sopenharmony_ci        this.id = NextID++;
179e41f4b71Sopenharmony_ci        this.c = c;
180e41f4b71Sopenharmony_ci      }
181e41f4b71Sopenharmony_ci    }
182e41f4b71Sopenharmony_ci    
183e41f4b71Sopenharmony_ci    @Component
184e41f4b71Sopenharmony_ci    struct Child {
185e41f4b71Sopenharmony_ci      @ObjectLink varA : ClassA;
186e41f4b71Sopenharmony_ci      build() {
187e41f4b71Sopenharmony_ci        Row() {
188e41f4b71Sopenharmony_ci          Text('ViewA-' + this.varA.id)
189e41f4b71Sopenharmony_ci        }
190e41f4b71Sopenharmony_ci      }
191e41f4b71Sopenharmony_ci    }
192e41f4b71Sopenharmony_ci    
193e41f4b71Sopenharmony_ci    @Component
194e41f4b71Sopenharmony_ci    struct Parent {
195e41f4b71Sopenharmony_ci      @Link linkValue: ClassA
196e41f4b71Sopenharmony_ci      build() {
197e41f4b71Sopenharmony_ci        Column() {
198e41f4b71Sopenharmony_ci          /* ArkTS:ERROR The @Link property 'linkValue' cannot be assigned to
199e41f4b71Sopenharmony_ci            the @ObjectLink property 'varA'.*/
200e41f4b71Sopenharmony_ci          Child({ varA: this.linkValue })
201e41f4b71Sopenharmony_ci        }
202e41f4b71Sopenharmony_ci      }
203e41f4b71Sopenharmony_ci    }
204e41f4b71Sopenharmony_ci    ```
205e41f4b71Sopenharmony_ci
206e41f4b71Sopenharmony_ci**Key API/Component Changes**
207e41f4b71Sopenharmony_ci
208e41f4b71Sopenharmony_ciN/A
209e41f4b71Sopenharmony_ci
210e41f4b71Sopenharmony_ci**Adaptation Guide**
211e41f4b71Sopenharmony_ci1. When building a child component, do not perform the build on the variables decorated by **@LocalStorageLink** and **@LocalStorageProp** in the child component.
212e41f4b71Sopenharmony_ci
213e41f4b71Sopenharmony_ci  To change these variables from the parent component, use the API provided by the **LocalStorage** (such as the **set** API) to assign values to them.
214e41f4b71Sopenharmony_ci
215e41f4b71Sopenharmony_ci2. For details about how to use @ObjectLink, see @ObjectLink usage guide.
216e41f4b71Sopenharmony_ci
217e41f4b71Sopenharmony_ci
218e41f4b71Sopenharmony_ci## cl.arkui.LocalStorage.1 Return Type Change of the get API
219e41f4b71Sopenharmony_ci
220e41f4b71Sopenharmony_ci**Change Impact**
221e41f4b71Sopenharmony_ci
222e41f4b71Sopenharmony_ciChanged the return type from **get\<T>(propName: string): T** to **get<T>(propName: string): T | undefined**.
223e41f4b71Sopenharmony_ci
224e41f4b71Sopenharmony_ciNo adaptation is needed.
225e41f4b71Sopenharmony_ci
226e41f4b71Sopenharmony_ci## cl.arkui.LocalStorage.2 Mandatory/Optional Change of the newValue Parameter in setOrCreate
227e41f4b71Sopenharmony_ci**Change Impact**
228e41f4b71Sopenharmony_ci
229e41f4b71Sopenharmony_ciAPI declaration before change:
230e41f4b71Sopenharmony_ci```js
231e41f4b71Sopenharmony_cisetOrCreate<T>(propName: string, newValue?: T): boolean
232e41f4b71Sopenharmony_ci```
233e41f4b71Sopenharmony_ciAPI declaration after change:
234e41f4b71Sopenharmony_ci```js
235e41f4b71Sopenharmony_cisetOrCreate<T>(propName: string, newValue: T): boolean
236e41f4b71Sopenharmony_ci```
237e41f4b71Sopenharmony_ciThe **newValue** parameter becomes mandatory.
238e41f4b71Sopenharmony_ciIf it is not specified when an application calls the API, the build will fail after the SDK is replaced.
239e41f4b71Sopenharmony_ci
240e41f4b71Sopenharmony_ci**Adaptation Guide**
241e41f4b71Sopenharmony_ci
242e41f4b71Sopenharmony_ci```js
243e41f4b71Sopenharmony_cilet storage = new LocalStorage();
244e41f4b71Sopenharmony_cistorage.setOrCreate('propA', 'hello');
245e41f4b71Sopenharmony_ci```
246e41f4b71Sopenharmony_ci## cl.arkui.LocalStorage.3 link Parameter and Return Type Changes
247e41f4b71Sopenharmony_ci**Change Impact**
248e41f4b71Sopenharmony_ci
249e41f4b71Sopenharmony_ciAPI declaration before change:
250e41f4b71Sopenharmony_ci```js
251e41f4b71Sopenharmony_cilink<T>(propName: string, linkUser?: T, subscribersName?: string): T
252e41f4b71Sopenharmony_ci```
253e41f4b71Sopenharmony_ciAPI declaration after change:
254e41f4b71Sopenharmony_ci```js
255e41f4b71Sopenharmony_cilink<T>(propName: string): SubscribedAbstractProperty<T>
256e41f4b71Sopenharmony_ci```
257e41f4b71Sopenharmony_ci1. The second and third parameters of the **link** API are reserved for internal use by the framework. Therefore, the API is changed to contain only one parameter.
258e41f4b71Sopenharmony_ci2. The return type **T** is changed to **SubscribedAbstractProperty**.
259e41f4b71Sopenharmony_ci
260e41f4b71Sopenharmony_ci**Adaptation Guide**
261e41f4b71Sopenharmony_ci
262e41f4b71Sopenharmony_ci```js
263e41f4b71Sopenharmony_cilet storage = new LocalStorage({"PropA": "47"});
264e41f4b71Sopenharmony_cilet linA = storage.link("PropA");
265e41f4b71Sopenharmony_cilinA.set(50);
266e41f4b71Sopenharmony_ci```
267e41f4b71Sopenharmony_ci
268e41f4b71Sopenharmony_ci## cl.arkui.LocalStorage.4 setAndLink Parameter and Return Type Changes
269e41f4b71Sopenharmony_ci**Change Impact**
270e41f4b71Sopenharmony_ci
271e41f4b71Sopenharmony_ciAPI declaration before change:
272e41f4b71Sopenharmony_ci```js
273e41f4b71Sopenharmony_cisetAndLink<T>(propName: string, defaultValue: T, linkUser?: T, subscribersName?: string): T
274e41f4b71Sopenharmony_ci```
275e41f4b71Sopenharmony_ciAPI declaration after change:
276e41f4b71Sopenharmony_ci```js
277e41f4b71Sopenharmony_cisetAndLink<T>(propName: string, defaultValue: T): SubscribedAbstractProperty<T>
278e41f4b71Sopenharmony_ci```
279e41f4b71Sopenharmony_ci1. The third and fourth parameters of the **setAndLink** API are reserved for internal use by the framework. Therefore, the API is changed to contain two parameters.
280e41f4b71Sopenharmony_ci2. The return type **T** is changed to **SubscribedAbstractProperty**.
281e41f4b71Sopenharmony_ci
282e41f4b71Sopenharmony_ci**Adaptation Guide**
283e41f4b71Sopenharmony_ci
284e41f4b71Sopenharmony_ci```js
285e41f4b71Sopenharmony_cilet storage = new LocalStorage({"PropA": "47"});
286e41f4b71Sopenharmony_cilet linA = storage.setAndLink("PropA", "48")
287e41f4b71Sopenharmony_cilinA.set(50);
288e41f4b71Sopenharmony_ci```
289e41f4b71Sopenharmony_ci
290e41f4b71Sopenharmony_ci## cl.arkui.LocalStorage.5 prop Parameter and Return Type Changes
291e41f4b71Sopenharmony_ci**Change Impact**
292e41f4b71Sopenharmony_ci
293e41f4b71Sopenharmony_ciAPI declaration before change:
294e41f4b71Sopenharmony_ci```js
295e41f4b71Sopenharmony_ciprop<T>(propName: string, propUser?: T, subscribersName?: string): T
296e41f4b71Sopenharmony_ci```
297e41f4b71Sopenharmony_ciAPI declaration after change:
298e41f4b71Sopenharmony_ci```js
299e41f4b71Sopenharmony_ciprop<S>(propName: string): SubscribedAbstractProperty<S>
300e41f4b71Sopenharmony_ci```
301e41f4b71Sopenharmony_ci1. The second and third parameters of the **prop** API are reserved for internal use by the framework. Therefore, the API is changed to contain only one parameter.
302e41f4b71Sopenharmony_ci2. The return type **T** is changed to **SubscribedAbstractProperty**.
303e41f4b71Sopenharmony_ci
304e41f4b71Sopenharmony_ci**Adaptation Guide**
305e41f4b71Sopenharmony_ci
306e41f4b71Sopenharmony_ci```js
307e41f4b71Sopenharmony_cilet storage = new LocalStorage({"PropA": "47"});
308e41f4b71Sopenharmony_cilet propA = storage.prop("PropA");
309e41f4b71Sopenharmony_cipropA.set(51); // one-way sync
310e41f4b71Sopenharmony_ci```
311e41f4b71Sopenharmony_ci
312e41f4b71Sopenharmony_ci## cl.arkui.LocalStorage.6 setAndProp Parameter and Return Type Changes
313e41f4b71Sopenharmony_ci**Change Impact**
314e41f4b71Sopenharmony_ci
315e41f4b71Sopenharmony_ciAPI declaration before change:
316e41f4b71Sopenharmony_ci```js
317e41f4b71Sopenharmony_cisetAndProp<T>(propName: string, defaultValue: T, propUser?: T, subscribersName?: string): T
318e41f4b71Sopenharmony_ci```
319e41f4b71Sopenharmony_ciAPI declaration after change:
320e41f4b71Sopenharmony_ci```js
321e41f4b71Sopenharmony_cisetAndProp<S>(propName: string, defaultValue: S): SubscribedAbstractProperty<S>
322e41f4b71Sopenharmony_ci```
323e41f4b71Sopenharmony_ci1. The third and fourth parameters of the **setAndProp** API are reserved for internal use by the framework. Therefore, the API is changed to contain two parameters.
324e41f4b71Sopenharmony_ci2. The return type **T** is changed to **SubscribedAbstractProperty**.
325e41f4b71Sopenharmony_ci
326e41f4b71Sopenharmony_ci**Adaptation Guide**
327e41f4b71Sopenharmony_ci
328e41f4b71Sopenharmony_ci```js
329e41f4b71Sopenharmony_cilet storage = new LocalStorage({"PropA": "47"});
330e41f4b71Sopenharmony_cilet propA = storage.setAndProp("PropA", "48");
331e41f4b71Sopenharmony_cipropA.set(51); // one-way sync
332e41f4b71Sopenharmony_ci```
333