toProxy method

JsObject toProxy()

Implementation

JsObject toProxy() {
  var m = <String, dynamic>{'text': text};
  if (displayText != null) m['displayText'] = displayText;
  if (className != null) m['className'] = className;
  if (from != null) m['from'] = from!.toProxy();
  if (to != null) m['to'] = to!.toProxy();

  if (hintApplier != null) {
    m['hint'] = (cm, data, completion) {
      var from = _createPos(data['from']);
      var to = _createPos(data['to']);
      hintApplier!(CodeMirror.fromJsObject(cm), this, from, to);
    };
  }

  if (hintRenderer != null) {
    m['render'] = (element, data, completion) {
      hintRenderer!(element, this);
    };
  }

  return jsify(m);
}