Documentation

AppActivityList

class AppActivityList

extends Component

Component that encapsulates a list of child activities; emits events when the list changes (propagated from ManagedList), and a CHANGE event 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.

Example

The following example defines an activity class that instantiates three other activities when activated, as child components.

class MyActivity extends AppActivity {
  @compose(AppActivityList.with(
    OneActivity,
    TwoActivity,
    ThreeActivity
  ))
  activities?: AppActivityList;

  // ...
}

Constructor

(): AppActivityList

.add()

(...activities: AppActivity[]): this

Add one or more child activities to the list (see ManagedList.add).

.clear()

(): this

Clear the list (see ManagedList.clear).

.count

number

The number of activities currently in the list (see ManagedList.count).

.find()

(id: number): AppActivity

Returns the activity with given ID (see ManagedObject.managedId).

.first()

(): AppActivity

Returns the first activity in the list (see ManagedList.first).

.get()

(index: number): AppActivity

Returns the activity at given position in the list (0 based; see ManagedList.get).

.includes()

(activity: AppActivity): boolean

Returns true if given activity is currently included in this list (see ManagedList.includes).

.last()

(): AppActivity

Returns the last activity in the list (see ManagedList.last).

.remove()

(activity: AppActivity): this

Remove given activity from the list. Does not throw an error if the activity was not included in the list (see ManagedList.remove).

.replace()

(activities: Iterable<AppActivity>): this

Replace the activities in the list with given activities (see ManagedList.replace).

.toArray()

(): AppActivity[]

Returns an array with all activities currently in this list (see ManagedList.toArray).

.isPresetComponent() protected

(): boolean

Inherited from Component.isPresetComponent.

.getParentComponent()

[1]. (): Component
[2]. <TParent extends Component>(ParentClass: ComponentConstructor<TParent>): TParent

Inherited from Component.getParentComponent.

.getCompositeParent()

<TParent extends Component>(ParentClass?: ComponentConstructor<TParent>): TParent

Inherited from Component.getCompositeParent.

.propagateComponentEvent()

(name: string, inner?: ManagedEvent): void

Inherited from Component.propagateComponentEvent.

.managedId

number

Inherited from ManagedObject.managedId.

.managedState

ManagedState

Inherited from ManagedObject.managedState.

.getReferenceCount() protected

(): number

Inherited from ManagedObject.getReferenceCount.

.getManagedReferrers() protected

(): ManagedObject[]

Inherited from ManagedObject.getManagedReferrers.

.getManagedParent() protected

[1]. (): ManagedObject
[2]. <TParent extends 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.

.propagateChildEvents() protected

[1]. (f?: (this: this, e: ManagedEvent, propertyName: string) => void | ManagedEvent | ManagedEvent[]): this
[2]. (...types: (ManagedEvent | (new (...args: any[]) => ManagedEvent))[]): 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.