constructor (path, startOffset, endOffset, reverse, containerPath, surfaceId) {
    super()

    if (arguments.length === 1) {
      const data = arguments[0]
      path = data.path
      startOffset = data.startOffset
      endOffset = data.endOffset
      reverse = data.reverse
      containerPath = data.containerPath
      surfaceId = data.surfaceId
    }

    if (!path || !isNumber(startOffset)) {
      throw new Error('Invalid arguments: `path` and `startOffset` are mandatory')
    }

    this.start = new Coordinate(path, startOffset)
    this.end = new Coordinate(path, isNumber(endOffset) ? endOffset : startOffset)

    /**
      Selection direction.
      @type {Boolean}
    */
    this.reverse = Boolean(reverse)

    this.containerPath = containerPath

    /**
      Identifier of the surface this selection should be active in.
      @type {String}
    */
    this.surfaceId = surfaceId
  }
@param {array} path
@param {int} startOffset
@param {int} endOffset
@param {bool} reverse
@param {string} [containerPath]
@param {string} [surfaceId]