namespace videocall {
string hello_world();
string get_version();
};
[Error]
enum WebTransportError {
"ConnectionError",
"TlsError",
"StreamError",
"InvalidUrl",
"RuntimeError",
"CertificateError",
"ClientError",
"QueueError",
};
interface DatagramQueue {
constructor();
[Throws=WebTransportError]
sequence<u8> receive_datagram();
[Throws=WebTransportError]
void add_datagram(sequence<u8> data);
[Throws=WebTransportError]
boolean has_datagrams();
};
interface WebTransportClient {
constructor();
[Throws=WebTransportError]
void connect(string url);
[Throws=WebTransportError]
void send_datagram(sequence<u8> data);
[Throws=WebTransportError]
void subscribe_to_datagrams(DatagramQueue queue);
[Throws=WebTransportError]
void stop_datagram_listener();
};