From 661524822f1dea090095823e168389404852fcb6 Mon Sep 17 00:00:00 2001 From: puyajun Date: Tue, 8 Mar 2022 09:30:43 +0800 Subject: [PATCH 1/2] puyajun@huawei.com Signed-off-by: puyajun Change-Id: I1e6902f3cffce3633f0b3d65e9a24dcd08351479 --- api/@internal/component/ets/common.d.ts | 33 ++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index e74d918213..16ec38e211 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -22,7 +22,7 @@ declare const Component: ClassDecorator; * Defining Entry ClassDecorator. * @since 7 */ -declare const Entry: ClassDecorator; +declare const Entry: ClassDecorator & ((value: any) => ClassDecorator); /** * Defining Observed ClassDecorator. @@ -120,6 +120,37 @@ declare const Extend: MethodDecorator & ((value: any) => MethodDecorator); */ declare const CustomDialog: ClassDecorator; +/** + * Defining LocalStorageLink PropertyDecorator. + * @since 8 + */ +declare const LocalStorageLink: PropertyDecorator & ((value: string) => PropertyDecorator); + +/** + * Defining LocalStorageProp PropertyDecorator. + * @since 8 + */ +declare const LocalStorageProp: PropertyDecorator & ((value: string) => PropertyDecorator); + + +/** + * Defining LocalStorage. + * @since 8 + */ +declare class LocalStorage { + /** + * constructor. + * @since 8 + */ + constructor(value?: Object); + + /** + * Set GetShared. + * @since 8 + */ + static GetShared(): any; +} + /** * Defines the data type of the interface restriction. * @since 7 -- Gitee From aa64692b047865638defddcf5d4e0fdb226ef3d6 Mon Sep 17 00:00:00 2001 From: puyajun Date: Fri, 8 Apr 2022 10:30:11 +0800 Subject: [PATCH 2/2] puyajun@huawei.com Signed-off-by: puyajun Change-Id: I77eb25eaa606ce6fb9436c033d80618122a77e54 --- api/@internal/component/ets/common.d.ts | 89 ++++++++++++++++++++++--- 1 file changed, 81 insertions(+), 8 deletions(-) diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index 91c1a40462..6ad69bced4 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -122,33 +122,106 @@ declare const CustomDialog: ClassDecorator; /** * Defining LocalStorageLink PropertyDecorator. - * @since 8 + * @since 9 */ declare const LocalStorageLink: PropertyDecorator & ((value: string) => PropertyDecorator); /** * Defining LocalStorageProp PropertyDecorator. - * @since 8 + * @since 9 */ declare const LocalStorageProp: PropertyDecorator & ((value: string) => PropertyDecorator); - /** * Defining LocalStorage. - * @since 8 + * @since 9 */ declare class LocalStorage { + /** * constructor. - * @since 8 + * @since 9 */ - constructor(value?: Object); + constructor(initializingProperties?: Object); /** - * Set GetShared. - * @since 8 + * Set GetShared(@StageModelOnly). + * @since 9 */ static GetShared(): any; + + /** + * return true if prooperty with given name exists + * @since 9 + */ + has(propName: string): boolean; + + /** + * return a Map Iterator + * @since 9 + */ + keys(): IterableIterator; + + /** + * return number of properties + * @since 9 + */ + size(): number; + + /** + * returns value of given property + * @since 9 + */ + get(propName: string): T | undefined; + + /** + * Set value of given property + * @since 9 + */ + set(propName: string, newValue: T): boolean; + + /** + * add property if not property with given name + * @since 9 + */ + setOrCreate(propName: string, newValue: T): boolean; + + /** + * create and return a 'link' (two-way sync) to named property + * @since 9 + */ + link(propName: string, linkUser?: T, subscribersName?: string): T| undefined; + + /** + * Like link(), will create and initialize a new source property in LocalStorge if missing + * @since 9 + */ + setAndLink(propName: string, defaultValue: T, linkUser?: T, subscribersName?: string): T; + + /** + * create and return a 'prop' (one-way sync) to named property + * @since 9 + */ + prop(propName: string, propUser?: T, subscribersName?: string): T | undefined; + + /** + * Like prop(), will create and initialize a new source property in LocalStorage if missing + * @since 9 + */ + setAndProp(propName: string, defaultValue: T, propUser?: T, subscribersName?: string): T; + + /** + * Delete property from StorageBase + * @since 9 + * @returns false if method failed + */ + delete(propName: string): boolean; + + /** + * delete all properties from the StorageBase + * @since 9 + */ + clear(): boolean; } /** -- Gitee