Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AbstractElement<TModel, TContainer>

Type parameters

Hierarchy

Implements

Index

Constructors

Properties

id: string
structureTypeName: string

Accessors

  • get container(): TContainer
  • get isLoaded(): boolean
  • Checks whether all properties are available at the moment

    • if false, a load is required to access these properties.

    Returns boolean

  • get model(): TModel

Methods

  • Transforms a IElement interface into a Element class, loading the containing unit if necessary. (Those are technically already the same, but this function makes sure its properties are available.)

    • If invoked without callback, it checks whether the properties are available or it will throw;
    • If invoked with callback, it will load the data from the server if needed, and then invoke the callback.

    Returns AbstractElement<TModel, TContainer>

  • delete(): void
  • Deletes this element from the model.

    Returns void

  • getContainerAs<T>(containerType: any): T
  • load(callback: (elem: AbstractElement<TModel, TContainer>) => void, forceRefresh?: boolean): void
  • load(forceRefresh?: boolean): Promise<AbstractElement<TModel, TContainer>>
  • Transforms a IElement interface into a Element class, loading the containing unit if necessary. (Those are technically already the same, but this function makes sure its properties are available.)

    • If invoked without callback, it checks whether the properties are available or it will throw;
    • If invoked with callback, it will load the data from the server if needed, and then invoke the callback.

    Parameters

    Returns void

  • Parameters

    • Optional forceRefresh: boolean

    Returns Promise<AbstractElement<TModel, TContainer>>

  • toJSON(): IStructureJSON
  • Renders the structure as plain JSON (without observables magic). This is intended for debugging and development convenience. Note that the resulting object is not of the interface type corresponding to this structure.

    Returns IStructureJSON

  • traverse(visit: (structure: IStructure) => void): void
  • Traverses this structure by calling the provided visitor function on itself and all the structures contained (as part) by it, in depth-first order, and it returns synchronously after that.

    Parameters

    Returns void

  • traverseFind<T>(visit: (structure: IStructure) => T): null | T
  • traversePublicParts(visit: (structure: IStructure) => void): void

Generated using TypeDoc