Class BaseBindAbstract

The 'BaseBind' class provides basic binding functions and is an extension of the 'MetaObject'. This class handles events before and after executing commands, and provides serialization and deserialization.

Hierarchy (view full)

Constructors

  • Creates an instance of the MetaObject class.

    Returns BaseBind

Properties

_baseTable: MetaTable

Defines the default entity. This entity represents a meta table.

_guid: string

Unique identifier of the object (GUID). Uniquely identifies the object.

_type: Function

The generator function of the object. The function used when the object was created.

$event: EventEmitter

Event object. Processes the issuance and reception of events.

$KEYWORD: string[]

This is the collection reservation word. Defines the reserved words that you use by default.

_NS: string

Indicates the namespace.

'Meta'
_PARAM: []

List of parameters used for the constructor.

_UNION: []

List of implemented interfaces.

[IObject, IMarshal]

Methods

  • Event listener after command execution.

    Parameters

    • cmd: BaseBindCommand

      Command object executed.

    • result: object

      The result object of the command execution.

    Returns void

    BaseBind#onExecuted

  • Adds a column to the meta table.

    Parameters

    • Rest...args: any[]

      properties of the column to be added.

    Returns void

  • Compare the current object with the specified object.

    Parameters

    • target: object

      the object to be compared to.

    Returns boolean

    Returns whether the two objects are the same.

  • Method of obtaining the current object as a guide type object. (Circular references are replaced by $ref values.)

    Parameters

    • OptionalvOpt: number

      Import option.

      • opt=0: Reference structure (_guid: Yes, $ref: Yes)
      • opt=1: Redundant structure (_guid: Yes, $ref: Yes)
      • opt=2: Non-steep structure (_guid: No, $ref: No)
    • Optionalowned: object | object[]

    Returns object

    a.getObject(2) == b.getObject(2)
    
  • Returns the creators of the current object and all the creators of the prototype chain to the array.

    Returns Function[]

    Returns the array of generator functions.

    const types = obj.getTypes();
    console.log(types); // [Function: MetaObject]
  • Verify that the current object is an instance of the specified type (including _UNION)

    Parameters

    • target: string | object

      The type of object to be checked (object or string).

    Returns boolean

    Returns whether it is an instance of the specified type.

  • Sets the Guid type object to the current object. (The object is reset.)

    Parameters

    • oGuid: object

      Object of the guid type to serialize.

    • Optionalorigin: object

      The source object setting the current object.

    Returns void

Events

onExecute: ((cmd: BaseBindCommand) => void)

An event that is called before the command is executed.

Type declaration

    • (cmd): void
    • Parameters

      Returns void

onExecuted: ((cmd: BaseBindCommand, result: object) => void)

An event that is called after the command is executed.

Type declaration

    • (cmd, result): void
    • Parameters

      • cmd: BaseBindCommand

        Command object executed.

      • result: object

        The result object of the command execution.

      Returns void