@haxall/haxall
    Preparing search index...

    Class CompAbstract

    Component or function block

    Hierarchy (View Summary)

    Implemented by

    Index

    Constructors

    Properties

    type$: Type

    Methods

    • Add a slot. If name is null one is auto-generated otherwise the name must be unique.

      Parameters

      • val: JsObj
      • Optionalname: string

      Returns this

    • Call a method slot synchronously. If slot is not found then silently ignore and return null. If slot is defined but not a Function or the Function must be called asynchronously then raise exception.

      Parameters

      • name: string
      • Optionalarg: JsObj

      Returns JsObj

    • Call a method slot asynchronously. If slot is not found then silently ignore and return null. If slot is defined but not an Function then raise exception.

      Parameters

      Returns void

    • Lookup a child component by name

      Parameters

      • name: string
      • Optionalchecked: boolean

      Returns Comp

    • Return a negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified object:

      this < that   =>  <0
      this == that => 0
      this > that => >0

      This method may also be accessed via the < <= <=> >= and > shortcut operators. If not overridden the default implementation compares the toStr representations. Also see docLang.

      Examples:

      3.compare(8)  =>  -1
      8.compare(3) => 1
      8.compare(8) => 0
      3 <=> 8 => -1 // shortcut for 3.compare(8)

      Parameters

      Returns number

    • Return display string for this component

      Returns string

    • Iterate slot name/value pairs using same semantics as get.

      Parameters

      • f: (arg0: JsObj, arg1: string) => void

      Returns void

    • Iterate children components in the tree structure

      Parameters

      • f: (arg0: Comp, arg1: string) => void

      Returns void

    • Iterate name/value pairs until callback returns non-null

      Parameters

      Returns JsObj

    • Compare this object to the specified for equality. This method may be accessed via the == and != shortcut operators. If not overridden the default implementation compares for reference equality using the === operator. If this method is overridden, then hash() must also be overridden such that any two objects which return true for equals() must return the same value for hash(). This method must accept null and return false.

      Parameters

      Returns boolean

    • Get the given slot value or null if slot name not defined.

      Parameters

      • name: string

      Returns JsObj

    • Return true if this component has a slot by given name.

      Parameters

      • name: string

      Returns boolean

    • Check if a child component is mapped by the given name

      Parameters

      • name: string

      Returns boolean

    • Return a unique hashcode for this object. If a class overrides hash() then it must ensure if equals() returns true for any two objects then they have same hash code.

      Returns number

    • Return id that uniquely identifies this component within its space.

      Returns Ref

    • Is this is an ancestor in the tree of the given component. If the given component is this, then return true.

      Parameters

      Returns boolean

    • Is this component is a descendant in the tree of the given component. If the given component is this, then return true.

      Parameters

      Returns boolean

    • Return if this Obj is immutable and safe to share between threads:

      • an instance of a const class
      • the result of toImmutable on List, Map, or Buf
      • a Func object may or may not be immutable - see sys::Func.
      • other instances are assumed mutable and return false

      Returns boolean

    • Return if this component is mounted into a component space

      Returns boolean

    • Gets links slot as dict of incoming component links

      Returns Links

    • Return true if the component does not have a slot by given name.

      Parameters

      • name: string

      Returns boolean

    • Slot name under parent or "" if parent is null

      Returns string

    • Callback when a method is called. This is an observer callback only and will not determine the result value of calling a method.

      Parameters

      • name: string
      • cb: (arg0: this, arg1: JsObj) => void

      Returns void

    • Remove an onCall callback

      Parameters

      Returns void

    • Callback on instance itself when a call is invoked.

      Parameters

      Returns void

    • Callback when a slot is modified. The newVal is null if the slot was removed.

      Parameters

      • name: string
      • cb: (arg0: this, arg1: JsObj) => void

      Returns void

    • Remove an onChange callback

      Parameters

      Returns void

    • Callback on instance itself when a slot is modified. Value is null if slot removed.

      Parameters

      • name: string
      • newVal: JsObj

      Returns void

    • Callback to recompute component state.

      Parameters

      Returns void

    • How often should this component have its onExecute callback invoked. Return null if this component has no time based computation.

      Returns Duration

    • Parent component or null if root/unmounted

      Returns Comp

    • Remove a slot by name. Do nothing is name isn't mapped.

      Parameters

      • name: string

      Returns this

    • Set a slot by name. If val is null, then this is a convenience for remove.

      Parameters

      Returns this

    • Xeto type for this component

      Returns Spec

    • Get an immutable representation of this instance or throw NotImmutableErr if this object cannot be represented as an immutable:

      • if type is const, return this
      • if already an immutable List, Map, Buf, or Func return this
      • if a List, then attempt to perform a deep clone by calling toImmutable on all items
      • if a Map, then attempt to perform a deep clone by calling toImmutable on all values (keys are already immutable)
      • some Funcs can be made immutable - see sys::Func
      • if a Buf create immutable copy, see sys::Buf
      • any other object throws NotImmutableErr

      Returns Readonly<this>

    • Return debug string

      Returns string

    • Get or set the slot mapped by the given name.

      Parameters

      Returns JsObj

    • Get the Type instance which represents this object's class. Also seeType.of or Pod.of.

      Returns Type

    • This method called whenever an it-block is applied to an object. The default implementation calls the function with this, and then returns this.

      Parameters

      • f: (arg0: this) => void

      Returns this

    • Write x.toStr to standard output followed by newline. If x is null then print "null". If no argument is provided then print an empty line.

      Parameters

      Returns void