Class Token

This class is entity for MML token. This class has token type, token data and token value if token is number.

Constructors

Accessors

Methods

Constructors

  • Parameters

    • id: string

      This argument is string that identifies MML token.

    • type: TokenType

      This argument is one of 'TEMPO', 'OCTAVE', 'NOTE', 'REST', 'NUMBER', 'TIE', 'SPACE', 'EOS', 'UNKNOWN'.

    • token: undefined | string

      This argument is string that constructs of token.

    Returns Token

Accessors

  • get token(): undefined | string
  • This method is getter for token.

    Returns undefined | string

  • get value(): number
  • This method is getter for token value if token is number.

    Returns number

Methods

  • This method returns fields that Token has as JSON.

    Returns string