presentation-api.idl (2978B)
1 // GENERATED CONTENT - DO NOT EDIT 2 // Content was automatically extracted by Reffy into webref 3 // (https://github.com/w3c/webref) 4 // Source: Presentation API (https://w3c.github.io/presentation-api/) 5 6 partial interface Navigator { 7 [SecureContext, SameObject] readonly attribute Presentation presentation; 8 }; 9 10 [SecureContext, Exposed=Window] 11 interface Presentation { 12 }; 13 14 partial interface Presentation { 15 attribute PresentationRequest? defaultRequest; 16 }; 17 18 partial interface Presentation { 19 readonly attribute PresentationReceiver? receiver; 20 }; 21 22 [SecureContext, Exposed=Window] 23 interface PresentationRequest : EventTarget { 24 constructor(USVString url); 25 constructor(sequence<USVString> urls); 26 Promise<PresentationConnection> start(); 27 Promise<PresentationConnection> reconnect(USVString presentationId); 28 Promise<PresentationAvailability> getAvailability(); 29 30 attribute EventHandler onconnectionavailable; 31 }; 32 33 [SecureContext, Exposed=Window] 34 interface PresentationAvailability : EventTarget { 35 readonly attribute boolean value; 36 37 attribute EventHandler onchange; 38 }; 39 40 [SecureContext, Exposed=Window] 41 interface PresentationConnectionAvailableEvent : Event { 42 constructor(DOMString type, PresentationConnectionAvailableEventInit eventInitDict); 43 [SameObject] readonly attribute PresentationConnection connection; 44 }; 45 46 dictionary PresentationConnectionAvailableEventInit : EventInit { 47 required PresentationConnection connection; 48 }; 49 50 enum PresentationConnectionState { "connecting", "connected", "closed", "terminated" }; 51 52 [SecureContext, Exposed=Window] 53 interface PresentationConnection : EventTarget { 54 readonly attribute USVString id; 55 readonly attribute USVString url; 56 readonly attribute PresentationConnectionState state; 57 undefined close(); 58 undefined terminate(); 59 attribute EventHandler onconnect; 60 attribute EventHandler onclose; 61 attribute EventHandler onterminate; 62 63 // Communication 64 attribute BinaryType binaryType; 65 attribute EventHandler onmessage; 66 undefined send (DOMString message); 67 undefined send (Blob data); 68 undefined send (ArrayBuffer data); 69 undefined send (ArrayBufferView data); 70 }; 71 72 enum PresentationConnectionCloseReason { "error", "closed", "wentaway" }; 73 74 [SecureContext, Exposed=Window] 75 interface PresentationConnectionCloseEvent : Event { 76 constructor(DOMString type, PresentationConnectionCloseEventInit eventInitDict); 77 readonly attribute PresentationConnectionCloseReason reason; 78 readonly attribute DOMString message; 79 }; 80 81 dictionary PresentationConnectionCloseEventInit : EventInit { 82 required PresentationConnectionCloseReason reason; 83 DOMString message = ""; 84 }; 85 86 [SecureContext, Exposed=Window] 87 interface PresentationReceiver { 88 readonly attribute Promise<PresentationConnectionList> connectionList; 89 }; 90 91 [SecureContext, Exposed=Window] 92 interface PresentationConnectionList : EventTarget { 93 readonly attribute FrozenArray<PresentationConnection> connections; 94 attribute EventHandler onconnectionavailable; 95 };