Class InspectableObject<T>

The InspectableField provides access and meta-data of a TypeScript object. The primary use-case for this class is type reflection within the Inspector APIs.

Type Parameters

  • T extends object

Constructors

Properties

fields: readonly InspectableField<T>[]

Returns all fields in the object.

methods: readonly InspectableMethod<T>[]

Returns all methods in the object.

parentProperty: InspectableProperty

Accessors

  • get object(): T
  • Returns T

  • get type(): Type
  • Type of the underlying object.

    Returns Type

Methods

  • Searches the object for a field with the specified name.

    Parameters

    • name: string

      Name of the field.

    Returns InspectableField<T>

    Object representing the field, if found, null otherwise.

  • Searches the object for a method with the specified name.

    Parameters

    • name: string

      Name of the method.

    Returns InspectableMethod<T>

    Object representing the method, if found, null otherwise.

  • Searches the object, and all child objects for a field or entry with the specified name.

    Parameters

    • path: string

      Slash separated path with field name(s) to search for. If a field contains an array, list or a map append its name with a "[x]" where x is the element index in the array/list, or a key name (surrounded by "") in case of a map. Only primitive map keys are supported.

      			Example path:
      			  `subObject/myDictionary["someElement"]/theArray[4]/fieldToGet`
      

    Returns InspectableProperty

    Property you can use for reading or modifying the property, or null if not found.

  • Searches the object hierarchy using the provided path elements. findProperty

    Parameters

    • pathElements: PropertyPathElement[]

      Path elements representing field names and keys to look for.

    • elementIndex: number

      Index in the pathElements array to start the search at.

    Returns InspectableProperty

    Property representing the final path element, or null if not found.

  • Returns the specific object instance this object is operating on.

    Returns any

    Object instance.