diff --git a/api/@ohos.arkui.stateManagement.d.ets b/api/@ohos.arkui.stateManagement.d.ets index 02653fb237eac2ec0b7b444a13795102d808e61d..c269289b2733c9ef791b3eb713c64870deb6b2da 100644 --- a/api/@ohos.arkui.stateManagement.d.ets +++ b/api/@ohos.arkui.stateManagement.d.ets @@ -22,4 +22,5 @@ export * from './arkui/stateManagement/decorator'; export * from './arkui/stateManagement/runtime'; export * from './arkui/stateManagement/storage/appStorage'; -export * from './arkui/stateManagement/storage/localStorage'; \ No newline at end of file +export * from './arkui/stateManagement/storage/localStorage'; +export * from './arkui/stateManagement/utils'; \ No newline at end of file diff --git a/api/arkui/stateManagement/decorator.d.ets b/api/arkui/stateManagement/decorator.d.ets index fd7219e092fd9aad9d90ea6f398850b36a3b9115..a626dc9e896980b020b846331d9af5753900d666 100644 --- a/api/arkui/stateManagement/decorator.d.ets +++ b/api/arkui/stateManagement/decorator.d.ets @@ -77,11 +77,6 @@ export declare @interface Watch { @Retention({policy: "SOURCE"}) export declare @interface Require {}; -export declare class UIUtils { - static getTarget(source: T): T; - static makeObserved(source: T): T; -} - export declare interface IDecoratedVariable { readonly varName: string; } diff --git a/api/arkui/stateManagement/utils.d.ets b/api/arkui/stateManagement/utils.d.ets new file mode 100644 index 0000000000000000000000000000000000000000..a764b6d316b92950f8612f463e077abf8841ef0c --- /dev/null +++ b/api/arkui/stateManagement/utils.d.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ + +/** + * UIUtils is a state management tool class for operating the observed data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class UIUtils { + /** + * Get raw object from the Object, like builtin type, objectLiteral. + * If input parameter is a regular Object without proxy, return Object itself. + * + * @param { T } source input source Object data. + * @returns { T } raw object. + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + static getTarget(source: T): T; + + /** + * Make non-observed data into observed data. + * Support builtin type and objectLiteral. + * + * @param { T } source input source object data. + * @returns { T } proxy object from the source object data. + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + static makeObserved(source: T): T; +} \ No newline at end of file