AppActivityList
class AppActivityList
extends
Component
Component that encapsulates a list of child activities; emits change events when the list changes (propagated from ManagedList
) and when one of the activities becomes active or inactive.
Note: This class is used internally to represent ‘preset’ activities of an Application
constructor. An instance of this class is available as Application.activities
.
Constructor
(): AppActivityList
.count
number
The number of activities currently in the list.
.add()
(...activities:
AppActivity
[]): this
Add one or more child activities to the list.
.remove()
(activity:
AppActivity
): this
Remove given activity from the list. Does not throw an error if the activity was not included in the list.
.clear()
(): this
Clear the list by removing all activities in one go.
.get()
(index: number):
AppActivity
Returns the activity at given position in the list.
.includes()
(activity:
AppActivity
): boolean
Returns true if the list includes given activity.
.forEach()
(callback: (target:
AppActivity
) => void): void
callback
— the function to be called, with a single activity as the only argument.
Iterates over the activities in this list and invokes given callback for each activity.
.map()
<TResult>(callback: (target:
AppActivity
) => TResult): TResult[]
callback
— the function to be called, with a single activity as the only argument.
Iterates over the activities in this list and invokes given callback for each activity, then returns an array with all callback return values.
Note: The behavior of this method is undefined if the activity list is changed while running.
.toArray()
():
AppActivity
[]
Returns an array with all activities currently in this list.
.delegateEvent()
(e:
ManagedEvent
): void
Re-emits given event on this component; called for each event that is emitted by the encapsulated list (which also propagates events of type ActionEvent
from all contained activities).
.isPresetComponent() protected
(): boolean
Inherited from Component.isPresetComponent
.
.getParentComponent()
<TParent extends Component = Component>(ParentClass?:
ComponentConstructor
<TParent>): TParent
Inherited from Component.getParentComponent
.
.getBoundParentComponent()
<TParent extends Component>(ParentClass?:
ComponentConstructor
<TParent>): TParent
Inherited from Component.getBoundParentComponent
.
.emitAction()
(name: string, inner?:
ManagedEvent
, context?:
ManagedObject
): void
Inherited from Component.emitAction
.
.propagateComponentEvent() deprecated
(name: string, inner?:
ManagedEvent
): void
Inherited from Component.propagateComponentEvent
.
.managedId
number
Inherited from ManagedObject.managedId
.
.managedState
Inherited from ManagedObject.managedState
.
.getReferenceCount() protected
(): number
Inherited from ManagedObject.getReferenceCount
.
.getManagedReferrers() protected
():
ManagedObject
[]
Inherited from ManagedObject.getManagedReferrers
.
.getManagedParent() protected
<TParent extends ManagedObject = ManagedObject>(ParentClass?:
ManagedObjectConstructor
<TParent>): TParent
Inherited from ManagedObject.getManagedParent
.
.emit()
<TEvent extends ManagedEvent = ManagedEvent, TConstructorArgs extends any[] = any[]>(e: string | TEvent | (new (...args: TConstructorArgs) => TEvent), ...constructorArgs: TConstructorArgs): this
Inherited from ManagedObject.emit
.
.emitChange()
(name?: string): void
Inherited from ManagedObject.emitChange
.
.propagateChildEvents() protected deprecated
(...types: ((new (...args: any[]) =>
ManagedEvent
) | ((e:
ManagedEvent
) => any))[]): this
Inherited from ManagedObject.propagateChildEvents
.
.activateManagedAsync() protected
(): Promise<any>
Inherited from ManagedObject.activateManagedAsync
.
.deactivateManagedAsync() protected
(): Promise<void>
Inherited from ManagedObject.deactivateManagedAsync
.
.destroyManagedAsync() protected
(): Promise<void>
Inherited from ManagedObject.destroyManagedAsync
.
.onManagedStateActivatingAsync() protected
(): Promise<void>
Inherited from ManagedObject.onManagedStateActivatingAsync
.
.onManagedStateActiveAsync() protected
(): Promise<void>
Inherited from ManagedObject.onManagedStateActiveAsync
.
.onManagedStateDeactivatingAsync() protected
(): Promise<void>
Inherited from ManagedObject.onManagedStateDeactivatingAsync
.
.onManagedStateInactiveAsync() protected
(): Promise<void>
Inherited from ManagedObject.onManagedStateInactiveAsync
.
.onManagedStateDestroyingAsync() protected
(): Promise<void>
Inherited from ManagedObject.onManagedStateDestroyingAsync
.