OLD | NEW |
(Empty) | |
| 1 |
| 2 class _EventSourceImpl extends _EventTargetImpl implements EventSource native "*
EventSource" { |
| 3 |
| 4 static final int CLOSED = 2; |
| 5 |
| 6 static final int CONNECTING = 0; |
| 7 |
| 8 static final int OPEN = 1; |
| 9 |
| 10 final String URL; |
| 11 |
| 12 final int readyState; |
| 13 |
| 14 final String url; |
| 15 |
| 16 _EventSourceEventsImpl get on() => |
| 17 new _EventSourceEventsImpl(this); |
| 18 |
| 19 void _addEventListener(String type, EventListener listener, [bool useCapture =
null]) native "this.addEventListener(type, listener, useCapture);"; |
| 20 |
| 21 void close() native; |
| 22 |
| 23 bool _dispatchEvent(_EventImpl evt) native "return this.dispatchEvent(evt);"; |
| 24 |
| 25 void _removeEventListener(String type, EventListener listener, [bool useCaptur
e = null]) native "this.removeEventListener(type, listener, useCapture);"; |
| 26 } |
| 27 |
| 28 class _EventSourceEventsImpl extends _EventsImpl implements EventSourceEvents { |
| 29 _EventSourceEventsImpl(_ptr) : super(_ptr); |
| 30 |
| 31 EventListenerList get error() => _get('error'); |
| 32 |
| 33 EventListenerList get message() => _get('message'); |
| 34 |
| 35 EventListenerList get open() => _get('open'); |
| 36 } |
OLD | NEW |