1 module libwasm.bindings.TextDecoder; 2 3 import libwasm.types; 4 5 import memutils.ct: tuple; 6 @safe: 7 nothrow: 8 9 struct TextDecodeOptions { 10 nothrow: 11 JsHandle handle; 12 alias handle this; 13 this(Handle h) { 14 this.handle = JsHandle(h); 15 } 16 static auto create() { 17 return TextDecodeOptions(libwasm_add__object()); 18 } 19 void stream()(bool stream) { 20 Object_Call_bool__void(this.handle, "stream", stream); 21 } 22 bool stream()() { 23 return Object_Getter__bool(this.handle, "stream"); 24 } 25 } 26 struct TextDecoder { 27 nothrow: 28 JsHandle handle; 29 alias handle this; 30 this(Handle h) { 31 this.handle = JsHandle(h); 32 } 33 string encoding()() { 34 return Object_Getter__string(this.handle, "encoding"); 35 } 36 bool fatal()() { 37 return Object_Getter__bool(this.handle, "fatal"); 38 } 39 bool ignoreBOM()() { 40 return Object_Getter__bool(this.handle, "ignoreBOM"); 41 } 42 string decode()(scope ref BufferSource input, scope ref TextDecodeOptions options) { 43 return Serialize_Object_VarArgCall!string(this.handle, "decode", "Handle;Handle", tuple(cast(Handle)input.handle, cast(Handle)options.handle)); 44 } 45 string decode()(scope ref BufferSource input) { 46 return Serialize_Object_VarArgCall!string(this.handle, "decode", "Handle", tuple(cast(Handle)input.handle)); 47 } 48 string decode()() { 49 return Object_Getter__string(this.handle, "decode"); 50 } 51 } 52 struct TextDecoderOptions { 53 nothrow: 54 JsHandle handle; 55 alias handle this; 56 this(Handle h) { 57 this.handle = JsHandle(h); 58 } 59 static auto create() { 60 return TextDecoderOptions(libwasm_add__object()); 61 } 62 void fatal()(bool fatal) { 63 Object_Call_bool__void(this.handle, "fatal", fatal); 64 } 65 bool fatal()() { 66 return Object_Getter__bool(this.handle, "fatal"); 67 } 68 void ignoreBOM()(bool ignoreBOM) { 69 Object_Call_bool__void(this.handle, "ignoreBOM", ignoreBOM); 70 } 71 bool ignoreBOM()() { 72 return Object_Getter__bool(this.handle, "ignoreBOM"); 73 } 74 } 75 76