diff --git a/api/@ohos.arkui.stateManagement.d.ets b/api/@ohos.arkui.stateManagement.d.ets index c269289b2733c9ef791b3eb713c64870deb6b2da..1684309c30a8baf402993826d48e7da68f929eaf 100644 --- a/api/@ohos.arkui.stateManagement.d.ets +++ b/api/@ohos.arkui.stateManagement.d.ets @@ -23,4 +23,5 @@ export * from './arkui/stateManagement/decorator'; export * from './arkui/stateManagement/runtime'; export * from './arkui/stateManagement/storage/appStorage'; export * from './arkui/stateManagement/storage/localStorage'; -export * from './arkui/stateManagement/utils'; \ No newline at end of file +export * from './arkui/stateManagement/utils'; +export * from './arkui/stateManagement/storage/storageProperty'; \ No newline at end of file diff --git a/api/arkui/stateManagement/decorator.d.ets b/api/arkui/stateManagement/decorator.d.ets index a626dc9e896980b020b846331d9af5753900d666..3c3659fd93a08ca3d2ab31336a0e0fe894711ea5 100644 --- a/api/arkui/stateManagement/decorator.d.ets +++ b/api/arkui/stateManagement/decorator.d.ets @@ -77,58 +77,238 @@ export declare @interface Watch { @Retention({policy: "SOURCE"}) export declare @interface Require {}; +/** + * Define decorated variable interface. + * + * @interface IDecoratedVariable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ export declare interface IDecoratedVariable { - readonly varName: string; + /** + * Decorated variable name. + * + * @type { string } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly varName: string; } +/** + * Define V1 decorated variable interface. + * + * @extends IDecoratedVariable + * @interface IDecoratedVariable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ export declare interface IDecoratedV1Variable extends IDecoratedVariable { - registerWatchToSource(me: IDecoratedV1Variable): void; + /** + * Registers the watch callback function with the data source. + * + * @param { IDecoratedV1Variable } decoratedVar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + registerWatchToSource(decoratedVar: IDecoratedV1Variable): void; } +/** + * Define decorated immutable variable interface. + * + * @interface IDecoratedImmutableVariable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ export declare interface IDecoratedImmutableVariable { - get(): T; + /** + * Get the state variable. + * + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get(): T; } +/** + * Define decorated mutable variable interface. + * + * @interface IDecoratedMutableVariable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ export declare interface IDecoratedMutableVariable { - get(): T; - set(newValue: T): void; + /** + * Get the state variable. + * + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get(): T; + /** + * Set the state variable with a new Value. + * + * @param { T } newValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set(newValue: T): void; } +/** + * Define decorated updatable variable interface. + * + * @interface IDecoratedUpdatableVariable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ export declare interface IDecoratedUpdatableVariable { - update(newValue: T): void; + /** + * Update the state variable with a new Value. + * + * @param { T } newValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + update(newValue: T): void; } -export declare interface IStateDecoratedVariable extends IDecoratedMutableVariable, IDecoratedV1Variable { -} +/** + * Define state decoration variable interface. + * + * @extends IDecoratedMutableVariable, IDecoratedV1Variable + * @interface IStateDecoratedVariable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface IStateDecoratedVariable extends IDecoratedMutableVariable, IDecoratedV1Variable {} export declare interface IPropDecoratedVariable extends IDecoratedMutableVariable, IDecoratedUpdatableVariable, IDecoratedV1Variable { } -export declare interface ILinkDecoratedVariable extends IDecoratedMutableVariable, IDecoratedV1Variable { -} +/** + * Define Link decoration variable interface. + * + * @extends IDecoratedMutableVariable, IDecoratedV1Variable + * @interface ILinkDecoratedVariable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ILinkDecoratedVariable extends IDecoratedMutableVariable, IDecoratedV1Variable {} -export declare interface IProvideDecoratedVariable extends IDecoratedMutableVariable, IDecoratedV1Variable { -} +/** + * Define Provide decoration variable interface. + * + * @extends IDecoratedMutableVariable, IDecoratedV1Variable + * @interface IProvideDecoratedVariable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface IProvideDecoratedVariable extends IDecoratedMutableVariable, IDecoratedV1Variable {} -export declare interface IConsumeDecoratedVariable extends IDecoratedMutableVariable, IDecoratedV1Variable { -} +/** + * Define Consume decoration variable interface. + * + * @extends IDecoratedMutableVariable, IDecoratedV1Variable + * @interface IConsumeDecoratedVariable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface IConsumeDecoratedVariable extends IDecoratedMutableVariable, IDecoratedV1Variable {} +/** + * Define ObjectLink decoration variable interface. + * + * @extends IDecoratedImmutableVariable, IDecoratedUpdatableVariable, IDecoratedV1Variable + * @interface IObjectLinkDecoratedVariable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ export declare interface IObjectLinkDecoratedVariable extends IDecoratedImmutableVariable, - IDecoratedUpdatableVariable, IDecoratedV1Variable { -} + IDecoratedUpdatableVariable, IDecoratedV1Variable {} -export declare interface IStorageLinkDecoratedVariable extends IDecoratedMutableVariable, IDecoratedV1Variable { -} +/** + * Define StorageLink decoration variable interface. + * + * @extends IDecoratedMutableVariable, IDecoratedV1Variable + * @interface IStorageLinkDecoratedVariable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface IStorageLinkDecoratedVariable extends IDecoratedMutableVariable, IDecoratedV1Variable {} +/** + * Define StorageProp decoration variable interface. + * + * @extends IDecoratedMutableVariable, IDecoratedV1Variable + * @interface IStoragePropDecoratedVariable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ export declare interface IStoragePropDecoratedVariable extends IDecoratedMutableVariable, IDecoratedV1Variable { } -export type LinkSourceType = IDecoratedV1Variable; +/** + * Define StoragePropRef decoration variable interface. + * + * @extends IDecoratedMutableVariable, IDecoratedV1Variable + * @interface IStoragePropRefDecoratedVariable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface IStoragePropRefDecoratedVariable extends IDecoratedMutableVariable, IDecoratedV1Variable {} + +/** + * Define LocalStorageLink decoration variable interface. + * + * @extends IDecoratedMutableVariable, IDecoratedV1Variable + * @interface ILocalStorageLinkDecoratedVariable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ILocalStorageLinkDecoratedVariable extends IDecoratedMutableVariable, IDecoratedV1Variable {} + +/** + * Define Link source type. + * + * @typedef { IStateDecoratedVariable | ILinkDecoratedVariable | IObjectLinkDecoratedVariable | + IPropDecoratedVariable | IStorageLinkDecoratedVariable | ILocalStorageLinkDecoratedVariable | IStoragePropRefDecoratedVariable | + IProvideDecoratedVariable | IConsumeDecoratedVariable } LinkSourceType + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type LinkSourceType = IStateDecoratedVariable | ILinkDecoratedVariable | IObjectLinkDecoratedVariable | + IPropDecoratedVariable | IStorageLinkDecoratedVariable | ILocalStorageLinkDecoratedVariable | IStoragePropRefDecoratedVariable | + IProvideDecoratedVariable | IConsumeDecoratedVariable; + +/** + * Define mutable state meta interface. + * + * @interface IMutableStateMeta + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ export declare interface IMutableStateMeta { - addRef(): void; - fireChange(): void; + /** + * Collect the dependancy for UI component with state variable + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + addRef(): void; + /** + * Notify UI component to update when state variable is changed + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + fireChange(): void; } export declare interface IMutableKeyedStateMeta { @@ -169,10 +349,53 @@ export declare interface IStateMgmtFactory { provideAlias: string, watchFunc?: WatchFuncType): IConsumeDecoratedVariable; makeObjectLink(owningView: ExtendableComponent, varName: string, initValue: T, wathcFunc?: WatchFuncType): IObjectLinkDecoratedVariable; + + /** + * Create a StorageLink variable instance. + * + * @param { ExtendableComponent } owningView - custom component. + * @param { string } propName - property name. + * @param { string } varName - state variable name. + * @param { T } initValue - init value. + * @param { Type } ttype - value type. + * @param { WatchFuncType } [watchFunc] - watch type + * @returns { IStorageLinkDecoratedVariable } StorageLink instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ makeStorageLink(owningView: ExtendableComponent, propName: string, - varName: string, initValue: T, watchFunc?: WatchFuncType): IStorageLinkDecoratedVariable; - makeStorageProp(owningView: ExtendableComponent, propName: string, - varName: string, initValue: T, watchFunc?: WatchFuncType): IStoragePropDecoratedVariable; + varName: string, initValue: T, ttype: Type, watchFunc?: WatchFuncType): IStorageLinkDecoratedVariable; + /** + * Create a StoragePropRef variable instance. + * + * @param { ExtendableComponent } owningView - custom component. + * @param { string } propName - property name. + * @param { string } varName - state variable name. + * @param { T } initValue - init value. + * @param { Type } ttype - value type. + * @param { WatchFuncType } [watchFunc] - watch type + * @returns { IStoragePropRefDecoratedVariable } StoragePropRef instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + makeStoragePropRef(owningView: ExtendableComponent, propName: string, + varName: string, initValue: T, ttype: Type, watchFunc?: WatchFuncType): IStoragePropRefDecoratedVariable; + + /** + * Create a LocalStorageLink variable instance. + * + * @param { ExtendableComponent } owningView - custom component. + * @param { string } propName - property name. + * @param { string } varName - state variable name. + * @param { T } initValue - init value. + * @param { Type } ttype - value type + * @param { WatchFuncType } [watchFunc] - watch type + * @returns { ILocalStorageLinkDecoratedVariable } LocalStorageLink instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + makeLocalStorageLink(owningView: ExtendableComponent, propName: string, + varName: string, initValue: T, ttype: Type, watchFunc?: WatchFuncType): ILocalStorageLinkDecoratedVariable; } export type WatchFuncType = ((propertyName: string) => void); diff --git a/api/arkui/stateManagement/storage/appStorage.d.ets b/api/arkui/stateManagement/storage/appStorage.d.ets index bf94b5e0e98c4d4492b6b57fbddf325505c19c24..4a3bf1b8ff53ca02c74ed1d69168e00fa44b1923 100644 --- a/api/arkui/stateManagement/storage/appStorage.d.ets +++ b/api/arkui/stateManagement/storage/appStorage.d.ets @@ -19,21 +19,5 @@ */ import { LocalStorage } from './localStorage'; -import { AbstractProperty, SubscribedAbstractProperty } from '../decorator'; -export declare class AppStorage extends LocalStorage { - public static ref(propName: string): AbstractProperty | undefined; - public static setAndRef(propName: string, defaultValue: T): AbstractProperty; - public static link(propName: string): SubscribedAbstractProperty | undefined; - public static setAndLink(propName: string, defaultValue: T): SubscribedAbstractProperty; - public static prop(propName: string): SubscribedAbstractProperty | undefined; - public static setAndProp(propName: string, defaultValue: T): SubscribedAbstractProperty; - public static has(propName: string): boolean; - public static get(propName: string): T | undefined; - public static set(propName: string, newValue: T): boolean; - public static setOrCreate(propName: string, newValue: T): void; - public static keys(): IterableIterator; - public static size(): number; - public static delete(propName: string): boolean; - public static clear(): boolean; -} \ No newline at end of file +export const AppStorage: LocalStorage = new LocalStorage(); diff --git a/api/arkui/stateManagement/storage/localStorage.d.ets b/api/arkui/stateManagement/storage/localStorage.d.ets index 4b9a33bab94141a71c2545f7d719d42c686dc2cf..4ddea45ee6a853c58ea43f43a4e65b7a441c6be1 100644 --- a/api/arkui/stateManagement/storage/localStorage.d.ets +++ b/api/arkui/stateManagement/storage/localStorage.d.ets @@ -18,23 +18,180 @@ * @arkts 1.2 */ -import { AbstractProperty, SubscribedAbstractProperty } from '../decorator'; +import { IStorageProperties, AbstractProperty, SubscribedAbstractProperty } from './storageProperty'; +/** + * LocalStorage + * Class implements a Map of ObservableObjectBase UI state variables. + * Instances can be created to manage UI state within a limited "local" + * access, and life cycle as defined by the app. + * AppStorage singleton is sub-class of LocalStorage for + * UI state of app-wide access and same life cycle as the app. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ export declare class LocalStorage { - public constructor(initializingProperties?: Object); - public static getShared(): LocalStorage | undefined; - public ref(propName: string): AbstractProperty | undefined; - public setAndRef(propName: string, defaultValue: T): AbstractProperty; - public link(propName: string): SubscribedAbstractProperty | undefined; - public setAndLink(propName: string, defaultValue: T): SubscribedAbstractProperty; - public prop(propName: string): SubscribedAbstractProperty | undefined; - public setAndProp(propName: string, defaultValue: T): SubscribedAbstractProperty; - public has(propName: string): boolean; - public get(propName: string): T | undefined; - public set(propName: string, newValue: T): boolean; - public setOrCreate(propName: string, newValue: T): boolean; - public keys(): IterableIterator; - public size(): number; - public delete(propName: string): boolean; - public clear(): boolean; + /** + * Construct new instance of LocalStorage + * initialize with all properties and their values that Object.keys(params) returns + * Property values must not be undefined. + * + * @param { Record } [initializingProperties] - Record + * containing keys and values. + * see set() for valid values + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + public constructor(initializingProperties?: Record); + /** + * Obtain a handler or an alias to LocalStorage property with given name. + * + * @param { string } propName LocalStorage property name + * @param {Type} ttype - data type + * @returns { AbstractProperty | undefined } AbstractProperty object if property with given name exists + * return undefined otherwise. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + public ref(propName: string, ttype: Type): AbstractProperty | undefined; + /** + * Obtain a handler or an alias to LocalStorage property with given name. + * + * If property does not exist in LocalStorage, create it with given default value. + * + * @param { string } propName LocalStorage property name + * @param { T } defaultValue If property does not exist in LocalStorage, + * create it with given default value. + * @param {Type} ttype - data type + * @returns { AbstractProperty } AbstractProperty object + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + public setAndRef(propName: string, defaultValue: T, ttype: Type): AbstractProperty; + /** + * Create and return a two-way sync "(link") to named property + * + * @param { string } propName - name of source property in LocalStorage + * @param { Type } ttype - data type + * @returns { SubscribedAbstractProperty | undefined } instance of SubscribedAbstractProperty + * return undefined if named property does not already exist in LocalStorage + * Apps can use SDK functions of base class SubscribedPropertyAbstract + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ + public link(propName: string, ttype: Type): SubscribedAbstractProperty | undefined; + + /** + * Like see link(), but will create and initialize a new source property in LocalStorage if missing + * + * @param { string } propName - name of source property in LocalStorage + * @param { T } defaultValue - value to be used for initializing new property in LocalStorage + * default value must be of type T, can be undefined or null. + * @param { Type } ttype - data type + * @returns { SubscribedAbstractProperty } instance of SubscribedAbstractProperty + * Apps can use SDK functions of base class SubscribedAbstractProperty + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + public setAndLink(propName: string, defaultValue: T, ttype: Type): SubscribedAbstractProperty; + + /** + * Check if LocalStorage has a property with given name + * return true if property with given name exists + * same as ES6 Map.prototype.has() + * + * @param { string } propName - searched property + * @param { Type } [ttype] - data type + * @returns { boolean } true if property with such name exists in LocalStorage + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + public has(propName: string, ttype?: Type): boolean; + /** + * Returns value of given property + * return undefined if no property with this name + * + * @param { string } propName - property name + * @param {Type} ttype - data type + * @returns { T | undefined } property value if found or undefined + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + public get(propName: string, ttype: Type): T | undefined; + /** + * Set value of given property in LocalStorage + * Method sets nothing and returns false if property with this name does not exist in LocalStorage + * newValue can be undefined or null from API 20. + * + * @param { string } propName + * @param { T } newValue - must be of type T, can be undefined or null + * @returns { boolean } true on success, i.e. when above conditions are satisfied, otherwise false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + public set(propName: string, newValue: T): boolean; + /** + * Set value of given property, if it exists, see set() . + * Add property if no property with given name and initialize with given value. + * newValue can be undefined or null from API 12 + * + * @param { string } propName + * @param { T } newValue - must be of type T, can be undefined or null + * @param { Type } ttype - data type + * @returns { boolean } true on success, i.e. when above conditions are satisfied, otherwise false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + public setOrCreate(propName: string, newValue: T, ttype: Type): boolean; + /** + * Provide names of all properties in LocalStorage + * same as ES6 Map.prototype.keys() + * + * @returns { IterableIterator } return a Map Iterator + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + public keys(): IterableIterator; + /** + * Returns number of properties in LocalStorage + * same as Map.prototype.size() + * + * @returns { number } return number of properties + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + public size(): number; + /** + * Delete property from StorageBase + * Use with caution: + * Before deleting a prop from LocalStorage all its subscribers need to + * unsubscribe from the property. + * This method fails and returns false if given property still has subscribers + * Another reason for failing is unknown property. + * Developer advise: + * Subscribers are created with see link(), see prop() + * and also via @LocalStorageLink and @LocalStorageProp state variable decorators. + * That means as long as their is a @Component instance that uses such decorated variable + * or a sync relationship with a SubscribedAbstractProperty variable the property can nit + * (and also should not!) be deleted from LocalStorage. + * + * @param { string } propName + * @returns { boolean } false if method failed + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + public delete(propName: string): boolean; + /** + * Delete all properties from the LocalStorage instance + * Precondition is that there are no subscribers. + * method returns false and deletes no properties if there is any property + * that still has subscribers + * + * @returns { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + public clear(): boolean; } \ No newline at end of file diff --git a/api/arkui/stateManagement/storage/storageProperty.d.ets b/api/arkui/stateManagement/storage/storageProperty.d.ets new file mode 100644 index 0000000000000000000000000000000000000000..191374a7e22d6df9a5e8b2507bed8f5d68382f05 --- /dev/null +++ b/api/arkui/stateManagement/storage/storageProperty.d.ets @@ -0,0 +1,144 @@ +/* + * 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 + */ + +/** + * Defines the callback that is called when state variable with value is change + * @typedef { function } OnChangeType + * @param {string} propertyName - property name + * @param {T} newValue - the new value of state variable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type OnChangeType = (propertyName: string, newValue: T) => void; + +/** + * Define AbstractProperty interface. + * + * AbstractProperty can be understood as a handler or an alias + * to a property inside LocalStorage / AppStorage singleton + * allows to read the value with @see get and to change the + * value with @see set. + * + * @interface AbstractProperty + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface AbstractProperty { + /** + * Returns the name of the referenced property + * + * @returns { string } name of the referenced property + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + info(): string { return ""; }; + + /** + * Returns the type of the referenced property + * + * @returns { Type } type of the referenced property + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + ttype(): Type { return Type.of(undefined); }; + + /** + * Reads value of the referenced AppStorage/LocalStorage property. + * + * @returns { T } value of the referenced AppStorage/LocalStorage property. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get(): T { return undefined; }; + + /** + * Assign a new value to the referenced property + * + * @param {T} newValue - a new value of the referenced property + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set(newValue: T): void {}; + /** + * Register callback function to be called on value change of the referenced property + * calling with value undefined clear the callback. + * + * @param {OnChangeType | undefined} onChangeFunc - register callback function + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onChange(onChangeFunc: OnChangeType | undefined): void {}; +} + +/** + * SubscribedAbstractProperty is the return value of + * - AppStorage static functions Link(), Prop(), SetAndLink(), and SetAndProp() + * - LocalStorage member methods link(), prop(), setAndLink(), and setAndProp() + * 'T' can be boolean, string, number or custom class. + * Main functions + * see get() reads the linked AppStorage/LocalStorage property value, + * see set(newValue) write a new value to the synched AppStorage/LocalStorage property + * see aboutToBeDeleted() ends the sync relationship with the AppStorage/LocalStorage property + * The app must call this function before the SubscribedAbstractProperty object + * goes out of scope. + * + * @extends AbstractProperty + * @interface SubscribedAbstractProperty + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface SubscribedAbstractProperty extends AbstractProperty { + /** + * An app needs to call this function before the instance of SubscribedAbstractProperty + * goes out of scope / is subject to garbage collection. Its purpose is to unregister the + * variable from the two-way/one-way sync relationship that AppStorage/LocalStorage.link()/prop() + * and related functions create. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + aboutToBeDeleted(): void {}; +} + +/** + * Define IStorageProperties interface + * + * @interface IStorageProperties + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface IStorageProperties { + /** + * Storage value. + * + * @type { NullishType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + value: NullishType; + /** + * Storage variable ttype. + * + * @type { Type } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + ttype: Type; +} \ No newline at end of file