mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 21:22:46 +00:00 
			
		
		
		
	 67ceba2e6a
			
		
	
	
		67ceba2e6a
		
	
	
	
	
		
			
			The intent is to use these to autogenerate prototype declarations for Window and WorkerGlobalScope classes. And the spec links are just nice to have :^)
		
			
				
	
	
		
			34 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
| #import <DOM/EventTarget.idl>
 | |
| #import <DOM/EventHandler.idl>
 | |
| 
 | |
| // https://websockets.spec.whatwg.org/#websocket
 | |
| [Exposed=(Window,Worker)]
 | |
| interface WebSocket : EventTarget {
 | |
| 
 | |
|     // FIXME: A second "protocols" argument should be added once supported
 | |
|     constructor(USVString url);
 | |
| 
 | |
|     readonly attribute USVString url;
 | |
| 
 | |
|     const unsigned short CONNECTING = 0;
 | |
|     const unsigned short OPEN = 1;
 | |
|     const unsigned short CLOSING = 2;
 | |
|     const unsigned short CLOSED = 3;
 | |
|     readonly attribute unsigned short readyState;
 | |
|     // readonly attribute unsigned long long bufferedAmount;
 | |
| 
 | |
|     attribute EventHandler onopen;
 | |
|     attribute EventHandler onerror;
 | |
|     attribute EventHandler onclose;
 | |
|     readonly attribute DOMString extensions;
 | |
|     readonly attribute DOMString protocol;
 | |
|     undefined close(optional unsigned short code, optional USVString reason);
 | |
| 
 | |
|     attribute EventHandler onmessage;
 | |
|     attribute DOMString binaryType;
 | |
|     undefined send(USVString data);
 | |
|     // FIXME: Support other kinds of send() calls
 | |
|     // undefined send(Blob data);
 | |
|     // undefined send(ArrayBuffer data);
 | |
|     // undefined send(ArrayBufferView data);
 | |
| };
 |