addEventListener (type, listener, options) {
        if (typeof listener !== 'function') return;
        function onMessage(data) {
            listener.call(this, new $1b2804d101e5ab5c$var$MessageEvent(data, this));
        }
        function onClose(code, message) {
            listener.call(this, new $1b2804d101e5ab5c$var$CloseEvent(code, message, this));
        }
        function onError(error) {
            listener.call(this, new $1b2804d101e5ab5c$var$ErrorEvent(error, this));
        }
        function onOpen() {
            listener.call(this, new $1b2804d101e5ab5c$var$OpenEvent(this));
        }
        const method = options && options.once ? 'once' : 'on';
        if (type === 'message') {
            onMessage._listener = listener;
            this[method](type, onMessage);
        } else if (type === 'close') {
            onClose._listener = listener;
            this[method](type, onClose);
        } else if (type === 'error') {
            onError._listener = listener;
            this[method](type, onError);
        } else if (type === 'open') {
            onOpen._listener = listener;
            this[method](type, onOpen);
        } else this[method](type, listener);
    }
/**
   * Register an event listener.
   *
   * @param {String} type A string representing the event type to listen for
   * @param {Function} listener The listener to add
   * @param {Object} [options] An options object specifies characteristics about
   *     the event listener
   * @param {Boolean} [options.once=false] A `Boolean`` indicating that the
   *     listener should be invoked at most once after being added. If `true`,
   *     the listener would be automatically removed when invoked.
   * @public
   */
Register an event listener.
@param {String} type A string representing the event type to listen for
@param {Function} listener The listener to add
@param {Object} [options] An options object specifies characteristics about
the event listener
@param {Boolean} [options.once=false] A `Boolean`` indicating that the
listener should be invoked at most once after being added. If `true`,
the listener would be automatically removed when invoked.
@public
Register an event listener . @param { String } type A string representing the event type to listen for @param { Function } listener The listener to add @param { Object } [ options ] An options object specifies characteristics about the event listener @param { Boolean } [ options . once = false ] A ` Boolean ` ` indicating that the listener should be invoked at most once after being added . If ` true ` the listener would be automatically removed when invoked . @public
addEventListener (type, listener, options) {
        if (typeof listener !== 'function') return;
        function onMessage(data) {
            listener.call(this, new $1b2804d101e5ab5c$var$MessageEvent(data, this));
        }
        function onClose(code, message) {
            listener.call(this, new $1b2804d101e5ab5c$var$CloseEvent(code, message, this));
        }
        function onError(error) {
            listener.call(this, new $1b2804d101e5ab5c$var$ErrorEvent(error, this));
        }
        function onOpen() {
            listener.call(this, new $1b2804d101e5ab5c$var$OpenEvent(this));
        }
        const method = options && options.once ? 'once' : 'on';
        if (type === 'message') {
            onMessage._listener = listener;
            this[method](type, onMessage);
        } else if (type === 'close') {
            onClose._listener = listener;
            this[method](type, onClose);
        } else if (type === 'error') {
            onError._listener = listener;
            this[method](type, onError);
        } else if (type === 'open') {
            onOpen._listener = listener;
            this[method](type, onOpen);
        } else this[method](type, listener);
    }
addEventListener ( type , listener , options ) { if ( typeof listener !== 'function' ) return ; function onMessage ( data ) { listener . call ( this , new $1b2804d101e5ab5c$var$MessageEvent ( data , this ) ) ; } function onClose ( code , message ) { listener . call ( this , new $1b2804d101e5ab5c$var$CloseEvent ( code , message , this ) ) ; } function onError ( error ) { listener . call ( this , new $1b2804d101e5ab5c$var$ErrorEvent ( error , this ) ) ; } function onOpen ( ) { listener . call ( this , new $1b2804d101e5ab5c$var$OpenEvent ( this ) ) ; } const method = options && options . once ? 'once' : 'on' ; if ( type === 'message' ) { onMessage . _listener = listener ; this [ method ] ( type , onMessage ) ; } else if ( type === 'close' ) { onClose . _listener = listener ; this [ method ] ( type , onClose ) ; } else if ( type === 'error' ) { onError . _listener = listener ; this [ method ] ( type , onError ) ; } else if ( type === 'open' ) { onOpen . _listener = listener ; this [ method ] ( type , onOpen ) ; } else this [ method ] ( type , listener ) ; }
Register an event listener.
Register an event listener .