diff --git a/api/arkui/component/customComponent.d.ets b/api/arkui/component/customComponent.d.ets index 9df05c821c7f53a4159e8101335d0ff6d88a6361..c1e92bd751c123cdcf00a214a64165d14bd1740e 100755 --- a/api/arkui/component/customComponent.d.ets +++ b/api/arkui/component/customComponent.d.ets @@ -20,11 +20,11 @@ -import { memo, ComponentBuilder, __memo_context_type, __memo_id_type } from "../stateManagement/runtime"; +import { memo, ComponentBuilder, __memo_context_type, __memo_id_type } from '../stateManagement/runtime'; -import { UIContext } from './../../../api/@ohos.arkui.UIContext' +import { UIContext } from './../../../api/@ohos.arkui.UIContext'; import { ExtendableComponent } from './extendableComponent'; - +import { LocalStorage } from '@ohos.arkui.stateManagement'; @Retention({policy: "SOURCE"}) export declare @interface Component { @@ -57,6 +57,7 @@ export interface CustomLayout { } export declare abstract class BaseCustomComponent extends ExtendableComponent { + public constructor(LocalStorage?: LocalStorage | undefined); } export declare abstract class CustomComponent, T_Options> extends BaseCustomComponent { @@ -69,6 +70,8 @@ export declare abstract class CustomComponent void ): S; + public constructor(LocalStorage?: LocalStorage | undefined); + // Life cycle for custom component aboutToAppear(): void aboutToDisappear(): void diff --git a/api/arkui/stateManagement/decorator.d.ets b/api/arkui/stateManagement/decorator.d.ets index fd7219e092fd9aad9d90ea6f398850b36a3b9115..f30b099741c8d079d5b215303dbca9800b3aa607 100644 --- a/api/arkui/stateManagement/decorator.d.ets +++ b/api/arkui/stateManagement/decorator.d.ets @@ -48,11 +48,6 @@ export declare @interface StorageLink { property: string; }; -@Retention({policy: "SOURCE"}) -export declare @interface LocalStorageProp { - property: string; -}; - @Retention({policy: "SOURCE"}) export declare @interface LocalStorageLink { property: string; @@ -123,6 +118,9 @@ export declare interface IObjectLinkDecoratedVariable extends IDecoratedImmut IDecoratedUpdatableVariable, IDecoratedV1Variable { } +export declare interface ILocalStorageLinkDecoratedVariable extends IDecoratedMutableVariable, IDecoratedV1Variable { +} + export declare interface IStorageLinkDecoratedVariable extends IDecoratedMutableVariable, IDecoratedV1Variable { } @@ -174,6 +172,8 @@ export declare interface IStateMgmtFactory { provideAlias: string, watchFunc?: WatchFuncType): IConsumeDecoratedVariable; makeObjectLink(owningView: ExtendableComponent, varName: string, initValue: T, wathcFunc?: WatchFuncType): IObjectLinkDecoratedVariable; + makeLocalStorageLink(owningView: ExtendableComponent, propName: string, + varName: string, initValue: T, watchFunc?: WatchFuncType): ILocalStorageLinkDecoratedVariable; makeStorageLink(owningView: ExtendableComponent, propName: string, varName: string, initValue: T, watchFunc?: WatchFuncType): IStorageLinkDecoratedVariable; makeStorageProp(owningView: ExtendableComponent, propName: string, diff --git a/api/arkui/stateManagement/storage/localStorage.d.ets b/api/arkui/stateManagement/storage/localStorage.d.ets index 4b9a33bab94141a71c2545f7d719d42c686dc2cf..497aa22b8a0d0c66fe3ee83827ffa7dd53f9caf1 100644 --- a/api/arkui/stateManagement/storage/localStorage.d.ets +++ b/api/arkui/stateManagement/storage/localStorage.d.ets @@ -21,8 +21,7 @@ import { AbstractProperty, SubscribedAbstractProperty } from '../decorator'; export declare class LocalStorage { - public constructor(initializingProperties?: Object); - public static getShared(): LocalStorage | undefined; + public constructor(initializingProperties?: Record); public ref(propName: string): AbstractProperty | undefined; public setAndRef(propName: string, defaultValue: T): AbstractProperty; public link(propName: string): SubscribedAbstractProperty | undefined;