1 module libwasm.bindings.RTCSessionDescription; 2 3 import libwasm.types; 4 5 import memutils.ct: tuple; 6 @safe: 7 nothrow: 8 9 enum RTCSdpType { 10 offer, 11 pranswer, 12 answer, 13 rollback 14 } 15 struct RTCSessionDescription { 16 nothrow: 17 JsHandle handle; 18 alias handle this; 19 this(Handle h) { 20 this.handle = JsHandle(h); 21 } 22 void type()(RTCSdpType type) { 23 Object_Call_int__void(this.handle, "type", type); 24 } 25 RTCSdpType type()() { 26 return Object_Getter__int(this.handle, "type"); 27 } 28 void sdp()(string sdp) { 29 Object_Call_string__void(this.handle, "sdp", sdp); 30 } 31 string sdp()() { 32 return Object_Getter__string(this.handle, "sdp"); 33 } 34 auto toJSON()() { 35 return JsObject(Object_Getter__Handle(this.handle, "toJSON")); 36 } 37 } 38 struct RTCSessionDescriptionInit { 39 nothrow: 40 JsHandle handle; 41 alias handle this; 42 this(Handle h) { 43 this.handle = JsHandle(h); 44 } 45 static auto create() { 46 return RTCSessionDescriptionInit(libwasm_add__object()); 47 } 48 void type()(RTCSdpType type) { 49 Object_Call_int__void(this.handle, "type", type); 50 } 51 RTCSdpType type()() { 52 return Object_Getter__int(this.handle, "type"); 53 } 54 void sdp()(string sdp) { 55 Object_Call_string__void(this.handle, "sdp", sdp); 56 } 57 string sdp()() { 58 return Object_Getter__string(this.handle, "sdp"); 59 } 60 } 61 62