mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-11-04 07:10:57 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			33 lines
		
	
	
	
		
			1 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
	
		
			1 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
#import <DOM/EventTarget.idl>
 | 
						|
#import <DOM/EventHandler.idl>
 | 
						|
#import <FileAPI/Blob.idl>
 | 
						|
 | 
						|
// https://websockets.spec.whatwg.org/#websocket
 | 
						|
[Exposed=(Window,Worker)]
 | 
						|
interface WebSocket : EventTarget {
 | 
						|
 | 
						|
    constructor(USVString url, optional (DOMString or sequence<DOMString>) protocols);
 | 
						|
 | 
						|
    readonly attribute USVString url;
 | 
						|
 | 
						|
    // ready state
 | 
						|
    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;
 | 
						|
    // FIXME: readonly attribute unsigned long long bufferedAmount;
 | 
						|
 | 
						|
    // networking
 | 
						|
    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);
 | 
						|
 | 
						|
    // messaging
 | 
						|
    attribute EventHandler onmessage;
 | 
						|
    attribute DOMString binaryType;
 | 
						|
    undefined send((BufferSource or Blob or USVString) data);
 | 
						|
};
 |