diff --git a/api/arkui/component/customComponent.static.d.ets b/api/arkui/component/customComponent.static.d.ets index 811c354462a1ff0656573bb406ddc15cc00713c3..49c267c2c69ae10615295361aa8cf6ac98b21e90 100644 --- a/api/arkui/component/customComponent.static.d.ets +++ b/api/arkui/component/customComponent.static.d.ets @@ -231,12 +231,12 @@ export declare abstract class CustomComponent T, - initializers?: T_Options, + static $_instantiate, OptionsS>( + factory: () => S, + initializers?: OptionsS, reuseId?: string, @Builder content?: () => void - ): T + ): S /** * aboutToReuse Method diff --git a/api/arkui/component/extendableComponent.static.d.ets b/api/arkui/component/extendableComponent.static.d.ets index 2dbd7d493d683560b00aa546ec46f786864733d6..17195b2574876ff8a9272b85becb12c79be7ffd4 100644 --- a/api/arkui/component/extendableComponent.static.d.ets +++ b/api/arkui/component/extendableComponent.static.d.ets @@ -149,4 +149,15 @@ export declare abstract class ExtendableComponent implements LifeCycle { * @since 20 */ queryRouterPageInfo(): RouterPageInfo | undefined; + + /** + * Customize the build process of the custom component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + @Builder + build(): void } \ No newline at end of file diff --git a/api/arkui/runtime-api/@koalaui.runtime.memo.remember.d.ets b/api/arkui/runtime-api/@koalaui.runtime.memo.remember.d.ets new file mode 100644 index 0000000000000000000000000000000000000000..fbeaaa31a6d8df581a84d8f1a28300c0064b59cb --- /dev/null +++ b/api/arkui/runtime-api/@koalaui.runtime.memo.remember.d.ets @@ -0,0 +1,4 @@ +@interface memo_intrinsic {} + +@memo_intrinsic +export declare function once(callback: () => void): void \ No newline at end of file diff --git a/api/arkui/runtime-api/@koalaui.runtime.states.State.d.ets b/api/arkui/runtime-api/@koalaui.runtime.states.State.d.ets index 648ab8004b378d4d0644fa7759510efa24dc00d4..5f057fca529cd94a08819a70f7baebbb7e8cbf3b 100755 --- a/api/arkui/runtime-api/@koalaui.runtime.states.State.d.ets +++ b/api/arkui/runtime-api/@koalaui.runtime.states.State.d.ets @@ -64,49 +64,44 @@ export interface ComputableState extends Disposable, State { readonly recomputeNeeded: boolean } export interface StateContext { - readonly node: IncrementalNode | undefined - attach( - id: KoalaCallsiteKey, create: () => Node, update: () => void, cleanup?: () => void): void - compute( - id: KoalaCallsiteKey, - compute: () => Value, - cleanup?: (value: Value | undefined) => void, - once?: boolean): Value - computableState( - compute: (context: StateContext) => Value, - cleanup?: (context: StateContext, - value: Value | undefined) => void): ComputableState - mutableState( - initial: Value, - global?: boolean, - equivalent?: Equivalent, - tracker?: ValueTracker): MutableState - arrayState( - initial?: ReadonlyArray, - global?: boolean, - equivalent?: Equivalent): ArrayState - namedState( - name: string, create: () => Value, - global?: boolean, - equivalent?: Equivalent, - tracker?: ValueTracker): MutableState + readonly node: IncrementalNode | undefined // defined for all scopes within the scope that creates a node + attach(id: KoalaCallsiteKey, create: () => Node, update: () => void, cleanup?: () => void): void + compute(id: KoalaCallsiteKey, compute: () => Value, cleanup?: (value: Value | undefined) => void, once?: boolean): Value + computableState(compute: (context: StateContext) => Value, cleanup?: (context: StateContext, value: Value | undefined) => void): ComputableState + mutableState(initial: Value, global?: boolean, equivalent?: Equivalent, tracker?: ValueTracker): MutableState + arrayState(initial?: ReadonlyArray, global?: boolean, equivalent?: Equivalent): ArrayState + namedState(name: string, create: () => Value, global?: boolean, equivalent?: Equivalent, tracker?: ValueTracker): MutableState stateBy(name: string, global?: boolean): MutableState | undefined valueBy(name: string, global?: boolean): Value - scope( + scope(id: KoalaCallsiteKey, paramCount: int32): IncrementalScope + /** @internal */ + scopeEx( id: KoalaCallsiteKey, - paramCount?: int32, + paramCount: int32, create?: () => IncrementalNode, compute?: () => Value, cleanup?: (value: Value | undefined) => void, once?: boolean, reuseKey?: string - ): InternalScope + ): IncrementalScope controlledScope(id: KoalaCallsiteKey, invalidate: () => void): ControlledScope } export interface ValueTracker { onCreate(value: Value): Value onUpdate(value: Value): Value } +/** @internal */ +export interface IncrementalScope { + /** @returns true if internal value can be returned as is */ + readonly unchanged: boolean + /** @returns internal value if it is already computed */ + readonly cached: Value + /** @returns internal value updated after the computation */ + recache(newValue?: Value): Value + /** @returns internal state for parameter */ + param(index: int32, value: V): State + paramEx(index: int32, value: V, equivalent?: Equivalent, name?: string, contextLocal?: boolean): State +} export interface InternalScope { readonly unchanged: boolean readonly cached: Value diff --git a/api/arkui/stateManagement/decorator.static.d.ets b/api/arkui/stateManagement/decorator.static.d.ets index 317516c31fc75d4e6b7bfc3cd7b8223117d90fae..a8d388e567f4f143051a873c8b429414545ee7ab 100644 --- a/api/arkui/stateManagement/decorator.static.d.ets +++ b/api/arkui/stateManagement/decorator.static.d.ets @@ -20,6 +20,8 @@ */ import { ExtendableComponent } from '../component/extendableComponent'; +import { LocalStorage } from './storage/localStorage'; +export { SubscribedAbstractProperty } from './storage/storageProperty'; /** * Defining State annotation @@ -30,6 +32,11 @@ import { ExtendableComponent } from '../component/extendableComponent'; @Retention({policy: "SOURCE"}) export declare @interface State {}; +@Retention({policy: "SOURCE"}) +export @interface BuilderLambda { + name: string +} + /** * Defining Prop annotation * Prop is an annotation which is mutable, and its changes will not be synchronized to the parent component. @@ -1304,3 +1311,150 @@ export declare interface IMonitorPathInfo { */ valueCallback: MonitorValueCallback; } + +export declare class PlainStructProperty implements SubscribedAbstractProperty { + constructor(name: string, value?: Value) + init(value: Value | undefined): void + info(): string + get(): Value + set(value: Value): void + subscribe(listener: () => void): void + unsubscribe(listener: () => void): void + aboutToBeDeleted(): void +} + +export declare class BuilderParamDecoratorProperty implements SubscribedAbstractProperty { + constructor(name: string, value?: Value) + init(value: Value | undefined): void + info(): string + get(): Value + set(value: Value): void + subscribe(listener: () => void): void + unsubscribe(listener: () => void): void + aboutToBeDeleted(): void +} + +export declare class LinkDecoratorProperty implements SubscribedAbstractProperty { + constructor(name: string, listener?: () => void) + linkTo(property: Value | SubscribedAbstractProperty | undefined): void + info(): string + get(): Value + set(value: Value): void + subscribe(listener: () => void): void + unsubscribe(listener: () => void): void + aboutToBeDeleted(): void +} + +export declare class StateDecoratorProperty implements SubscribedAbstractProperty { + constructor(name: string, listener?: () => void) + init(value?: Value, initial?: Value): void + info(): string + get(): Value + set(value: Value): void + subscribe(listener: () => void): void + unsubscribe(listener: () => void): void + aboutToBeDeleted(): void +} + +export declare class PropDecoratorProperty implements SubscribedAbstractProperty { + constructor(name: string, listener?: () => void) + init(value?: Value, initial?: Value): void + update(value?: Value): void + info(): string + get(): Value + set(value: Value): void + subscribe(listener: () => void): void + unsubscribe(listener: () => void): void + aboutToBeDeleted(): void +} + +export declare class ObjectLinkDecoratorProperty implements SubscribedAbstractProperty { + constructor(name: string, listener?: () => void) + init(value?: Value, initial?: Value): void + update(value?: Value): void + info(): string + get(): Value + set(value: Value): void + subscribe(listener: () => void): void + unsubscribe(listener: () => void): void + aboutToBeDeleted(): void +} + +export declare class ProvideDecoratorProperty implements SubscribedAbstractProperty { + constructor(name: string, listener?: () => void) + init(value?: Value, initial?: Value): void + provide(provideKey?: string): void + checkOverrides(provideKey?: string): void + info(): string + get(): Value + set(value: Value): void + subscribe(listener: () => void): void + unsubscribe(listener: () => void): void + aboutToBeDeleted(): void +} + +export declare class ConsumeDecoratorProperty implements SubscribedAbstractProperty { + constructor(name: string, listener?: () => void) + init(provideKey?: string): void + info(): string + get(): Value + set(value: Value): void + subscribe(listener: () => void): void + unsubscribe(listener: () => void): void + aboutToBeDeleted(): void +} + +export declare class ConsumerDecoratorProperty implements SubscribedAbstractProperty { + constructor(name: string, listener?: () => void) + init(defaultValue: Value, provideKey?: string): void + info(): string + get(): Value + set(value: Value): void + subscribe(listener: () => void): void + unsubscribe(listener: () => void): void + aboutToBeDeleted(): void +} + +export declare class StorageLinkDecoratorProperty implements SubscribedAbstractProperty { + constructor(name: string, listener?: () => void) + init(value: Value, storageKey?: string): void + info(): string + get(): Value + set(value: Value): void + subscribe(listener: () => void): void + unsubscribe(listener: () => void): void + aboutToBeDeleted(): void +} + +export declare class LocalStorageLinkDecoratorProperty implements SubscribedAbstractProperty { + constructor(name: string, listener?: () => void) + init(value: Value, storage: LocalStorage, storageKey?: string): void + info(): string + get(): Value + set(value: Value): void + subscribe(listener: () => void): void + unsubscribe(listener: () => void): void + aboutToBeDeleted(): void +} + +export declare class StoragePropDecoratorProperty implements SubscribedAbstractProperty { + constructor(name: string, listener?: () => void) + init(value: Value, storageKey?: string): void + info(): string + get(): Value + set(value: Value): void + subscribe(listener: () => void): void + unsubscribe(listener: () => void): void + aboutToBeDeleted(): void +} + +export declare class LocalStoragePropDecoratorProperty implements SubscribedAbstractProperty { + constructor(name: string, listener?: () => void) + init(value: Value, storage: LocalStorage, storageKey?: string): void + info(): string + get(): Value + set(value: Value): void + subscribe(listener: () => void): void + unsubscribe(listener: () => void): void + aboutToBeDeleted(): void +} \ No newline at end of file diff --git a/api/arkui/stateManagement/runtime.static.d.ets b/api/arkui/stateManagement/runtime.static.d.ets index 03990d892b4b0407479a3e472435a0101cff34de..ddac5b53a87e785751196971bbb09a01fa4eeacb 100644 --- a/api/arkui/stateManagement/runtime.static.d.ets +++ b/api/arkui/stateManagement/runtime.static.d.ets @@ -26,6 +26,21 @@ export { MemoState } from './memorize/state' @Retention({policy: "SOURCE"}) export declare @interface memo {}; +@Retention({policy: "SOURCE"}) +export @interface memo_intrinsic {} + +@Retention({policy: "SOURCE"}) +export @interface memo_entry {} + +@Retention({policy: "SOURCE"}) +export @interface memo_stable {} + +@Retention({policy: "SOURCE"}) +export @interface memo_skip {} + +@Retention({policy: "SOURCE"}) +export @interface memo_wrap {} + @Retention({policy: "SOURCE"}) export @interface ComponentBuilder {} @@ -88,4 +103,7 @@ export declare class SyncedProperty implements MutableState { * @since 20 */ @Retention({policy: "SOURCE"}) -export declare @interface MemoSkip {}; \ No newline at end of file +export declare @interface MemoSkip {}; + +@memo_intrinsic +export declare function once(callback: () => void): void