blob: 4f1e4bee835a23c5b7bcf54b5b05f4ded2b08023 [file] [log] [blame]
Victor Porof6e096922022-06-10 13:01:05 +00001// 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
6partial interface Navigator {
7 [SecureContext, SameObject] readonly attribute Presentation presentation;
8};
9
10[SecureContext, Exposed=Window]
11interface Presentation {
12};
13
14partial interface Presentation {
15 attribute PresentationRequest? defaultRequest;
16};
17
18partial interface Presentation {
19 readonly attribute PresentationReceiver? receiver;
20};
21
22[SecureContext, Exposed=Window]
23interface 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]
34interface PresentationAvailability : EventTarget {
35 readonly attribute boolean value;
36
37 attribute EventHandler onchange;
38};
39
40[SecureContext, Exposed=Window]
41interface PresentationConnectionAvailableEvent : Event {
42 constructor(DOMString type, PresentationConnectionAvailableEventInit eventInitDict);
43 [SameObject] readonly attribute PresentationConnection connection;
44};
45
46dictionary PresentationConnectionAvailableEventInit : EventInit {
47 required PresentationConnection connection;
48};
49
50enum PresentationConnectionState { "connecting", "connected", "closed", "terminated" };
51
52[SecureContext, Exposed=Window]
53interface 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
72enum PresentationConnectionCloseReason { "error", "closed", "wentaway" };
73
74[SecureContext, Exposed=Window]
75interface PresentationConnectionCloseEvent : Event {
76 constructor(DOMString type, PresentationConnectionCloseEventInit eventInitDict);
77 readonly attribute PresentationConnectionCloseReason reason;
78 readonly attribute DOMString message;
79};
80
81dictionary PresentationConnectionCloseEventInit : EventInit {
82 required PresentationConnectionCloseReason reason;
83 DOMString message = "";
84};
85
86[SecureContext, Exposed=Window]
87interface PresentationReceiver {
88 readonly attribute Promise<PresentationConnectionList> connectionList;
89};
90
91[SecureContext, Exposed=Window]
92interface PresentationConnectionList : EventTarget {
93 readonly attribute FrozenArray<PresentationConnection> connections;
94 attribute EventHandler onconnectionavailable;
95};