Faye externs

30 views
Skip to first unread message

Axel Huizinga

unread,
Apr 24, 2014, 2:20:41 AM4/24/14
to haxe...@googlegroups.com
How will I have to write Haxe externs for this class?
The docs say Class means static but the initialize function refers to this so I am not really getting the syntax here.

Faye.NodeAdapter = Faye.Class({
  DEFAULT_ENDPOINT: '/bayeux',
  SCRIPT_PATH:      'faye-browser-min.js',

  TYPE_JSON:    {'Content-Type': 'application/json; charset=utf-8'},
  TYPE_SCRIPT:  {'Content-Type': 'text/javascript; charset=utf-8'},
  TYPE_TEXT:    {'Content-Type': 'text/plain; charset=utf-8'},

  initialize: function(options) {
    this._options    = options || {};
    this._endpoint   = this._options.mount || this.DEFAULT_ENDPOINT;
    this._endpointRe = new RegExp('^' + this._endpoint.replace(/\/$/, '') + '(/[^/]*)*(\\.[^\\.]+)?$');
    this._server     = new Faye.Server(this._options);
....

Cordially,
Axel

Reply all
Reply to author
Forward
0 new messages