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..e4df091e050a136aa6b9dbaafb2c0af75358b59b 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