diff --git a/api/arkui/stateManagement/decorator.d.ets b/api/arkui/stateManagement/decorator.d.ets index c6cc8bc552d873a6c25f0d7ea750c9ecee825d73..43e461b57a1be146e97bc142d71b26886a15e4a5 100644 --- a/api/arkui/stateManagement/decorator.d.ets +++ b/api/arkui/stateManagement/decorator.d.ets @@ -981,14 +981,13 @@ export declare interface IStateMgmtFactory { * @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, ttype: Type, watchFunc?: WatchFuncType): IStorageLinkDecoratedVariable; + varName: string, initValue: T, watchFunc?: WatchFuncType): IStorageLinkDecoratedVariable; /** * Create a StoragePropRef variable instance. * @@ -996,14 +995,13 @@ export declare interface IStateMgmtFactory { * @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; + varName: string, initValue: T, watchFunc?: WatchFuncType): IStoragePropRefDecoratedVariable; /** * Create a LocalStoragePropRef variable instance. * @@ -1011,14 +1009,13 @@ export declare interface IStateMgmtFactory { * @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 { ILocalStoragePropRefDecoratedVariable } LocalStoragePropRef instance * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ makeLocalStoragePropRef(owningView: ExtendableComponent, propName: string, - varName: string, initValue: T, ttype: Type, watchFunc?: WatchFuncType): ILocalStoragePropRefDecoratedVariable; + varName: string, initValue: T, watchFunc?: WatchFuncType): ILocalStoragePropRefDecoratedVariable; /** * Create a LocalStorageLink variable instance. @@ -1027,14 +1024,13 @@ export declare interface IStateMgmtFactory { * @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; + varName: string, initValue: T, watchFunc?: WatchFuncType): ILocalStorageLinkDecoratedVariable; /** * Create a Local variable instance. diff --git a/api/arkui/stateManagement/storage/localStorage.d.ets b/api/arkui/stateManagement/storage/localStorage.d.ets index 4ddea45ee6a853c58ea43f43a4e65b7a441c6be1..5a02a1a379ac25cbcaf7ab67cc5884996d8eb2d7 100644 --- a/api/arkui/stateManagement/storage/localStorage.d.ets +++ b/api/arkui/stateManagement/storage/localStorage.d.ets @@ -18,7 +18,7 @@ * @arkts 1.2 */ -import { IStorageProperties, AbstractProperty, SubscribedAbstractProperty } from './storageProperty'; +import { AbstractProperty, SubscribedAbstractProperty } from './storageProperty'; /** * LocalStorage @@ -37,24 +37,23 @@ export declare class 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. + * @param { Record } [initializingProperties] - Record + * containing keys and values. * see set() for valid values * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - public constructor(initializingProperties?: Record); + 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; + public ref(propName: string): AbstractProperty | undefined; /** * Obtain a handler or an alias to LocalStorage property with given name. * @@ -62,18 +61,16 @@ export declare class LocalStorage { * * @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 + * create it with given default value.pe * @returns { AbstractProperty } AbstractProperty object * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - public setAndRef(propName: string, defaultValue: T, ttype: Type): AbstractProperty; + public setAndRef(propName: string, defaultValue: T): 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 @@ -81,7 +78,7 @@ export declare class LocalStorage { * @crossplatform * @since 20 */ - public link(propName: string, ttype: Type): SubscribedAbstractProperty | undefined; + public link(propName: string): SubscribedAbstractProperty | undefined; /** * Like see link(), but will create and initialize a new source property in LocalStorage if missing @@ -89,13 +86,12 @@ export declare class LocalStorage { * @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; + public setAndLink(propName: string, defaultValue: T): SubscribedAbstractProperty; /** * Check if LocalStorage has a property with given name @@ -103,23 +99,21 @@ export declare class LocalStorage { * 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; + public has(propName: string): 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; + public get(propName: string): 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 @@ -139,12 +133,11 @@ export declare class LocalStorage { * * @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; + public setOrCreate(propName: string, newValue: T): boolean; /** * Provide names of all properties in LocalStorage * same as ES6 Map.prototype.keys() diff --git a/api/arkui/stateManagement/storage/persistentStorage.d.ets b/api/arkui/stateManagement/storage/persistentStorage.d.ets index fcb91d1ec523ca4c97f9436b0cde85ca23dc8999..b9bda0af68625a680c2907a93eefc848a370fe11 100644 --- a/api/arkui/stateManagement/storage/persistentStorage.d.ets +++ b/api/arkui/stateManagement/storage/persistentStorage.d.ets @@ -33,7 +33,6 @@ export declare class PersistentStorage { * with given value * * @param { string } key - property name - * @param { Type } ttype - persist value type * @param { T } defaultValue - If AppStorage does not include this property it will be initialized with this value * @param { ToJSONType } [toJson] - serialization function * @param { FromJSONType } [fromJson] - deserialization function @@ -42,8 +41,7 @@ export declare class PersistentStorage { * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - static persistProp(key: string, ttype: Type, defaultValue: T, - toJson?: ToJSONType, fromJson?: FromJSONType): boolean; + static persistProp(key: string, defaultValue: T, toJson?: ToJSONType, fromJson?: FromJSONType): boolean; /** * Reverse of @see persistProp diff --git a/api/arkui/stateManagement/storage/storageProperty.d.ets b/api/arkui/stateManagement/storage/storageProperty.d.ets index 191374a7e22d6df9a5e8b2507bed8f5d68382f05..56e874225e9da9a8b8aa7b5aaec03adb14d9d1b5 100644 --- a/api/arkui/stateManagement/storage/storageProperty.d.ets +++ b/api/arkui/stateManagement/storage/storageProperty.d.ets @@ -49,15 +49,6 @@ export interface AbstractProperty { * @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. @@ -115,30 +106,4 @@ export interface SubscribedAbstractProperty extends AbstractProperty { * @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