APIs

Show:

Constructor

TypeSchema

(
  • options
)

Parameters:

  • options Object

Methods

computer_default_value

(
  • defaultValue
)

Parameters:

  • defaultValue

    the default value

Returns:

:

findBuiltInType find the Builtin Type that this

(
  • datatypeName
)

Parameters:

  • datatypeName Object

Returns:

:

findSimpleType

(
  • name
)
TypeSchema | Null

Parameters:

  • name Object

Returns:

TypeSchema | Null:

initialize_value

(
  • value
  • defaultValue
)

Parameters:

  • value Object
  • defaultValue Object

Returns:

:

registerBasicType

(
  • schema
)

register a Basic Type , A basic type is new entity type that resolved to a SubType

Parameters:

  • schema Object
    • name String
    • subtype String

      mandatory, the basic type from which the new type derives.

    • [encode] Function optional

      optional,a specific encoder function to encode an instance of this type.

      • value
      • stream Stream
    • [decode] Function optional

      optional,a specific decoder function that returns the decode value out of the stream.

      • [stream] Stream optional
    • [coerce] Function optional

      optional, a method to convert a value into the request type.

      • value
        the value to coerce.
    • [random] Function optional

      optional, a method to construct a random object of this type

    • [toJSONFunc] Function optional

      optional, a method to convert a value into the request type.

Example:

:

registerBasicType({name:"Duration" ,subtype:"Double"});

registerType

(
  • schema
)

Parameters: