1 module libwasm.bindings.ErrorEvent;
2 
3 import libwasm.types;
4 
5 import memutils.ct: tuple;
6 import libwasm.bindings.Event;
7 
8 @safe:
9 nothrow:
10 
11 struct ErrorEvent {
12   nothrow:
13   libwasm.bindings.Event.Event _parent;
14   alias _parent this;
15   this(Handle h) {
16     _parent = .Event(h);
17   }
18   string message()() {
19     return Object_Getter__string(this._parent, "message");
20   }
21   string filename()() {
22     return Object_Getter__string(this._parent, "filename");
23   }
24   uint lineno()() {
25     return Object_Getter__uint(this._parent, "lineno");
26   }
27   uint colno()() {
28     return Object_Getter__uint(this._parent, "colno");
29   }
30   auto error()() {
31     return Any(Object_Getter__Handle(this._parent, "error"));
32   }
33 }
34 struct ErrorEventInit {
35   nothrow:
36   libwasm.bindings.Event.EventInit _parent;
37   alias _parent this;
38   this(Handle h) {
39     _parent = .EventInit(h);
40   }
41   static auto create() {
42     return ErrorEventInit(libwasm_add__object());
43   }
44   void message()(string message) {
45     Object_Call_string__void(this._parent, "message", message);
46   }
47   string message()() {
48     return Object_Getter__string(this._parent, "message");
49   }
50   void filename()(string filename) {
51     Object_Call_string__void(this._parent, "filename", filename);
52   }
53   string filename()() {
54     return Object_Getter__string(this._parent, "filename");
55   }
56   void lineno()(uint lineno) {
57     Object_Call_uint__void(this._parent, "lineno", lineno);
58   }
59   uint lineno()() {
60     return Object_Getter__uint(this._parent, "lineno");
61   }
62   void colno()(uint colno) {
63     Object_Call_uint__void(this._parent, "colno", colno);
64   }
65   uint colno()() {
66     return Object_Getter__uint(this._parent, "colno");
67   }
68   void error(T0)(scope auto ref T0 error) {
69     import std.traits : isNumeric, isFloatingPoint, isSomeString;
70     if (isSomeString!T0) {
71       Object_Call_string__void(this._parent, "error", cast(string) error);
72       return;
73     } else if (isNumeric!T0 && !isFloatingPoint!T0) {
74       Object_Call_long__void(this._parent, "error", cast(long) error);
75       return;
76     } else if (isFloatingPoint!T0) {
77       Object_Call_double__void(this._parent, "error", cast(double) error);
78       return;
79     }
80     // Any
81     Handle _handle_error = getOrCreateHandle(error);
82     Object_Call_Handle__void(this._parent, "error", _handle_error);
83     dropHandle!(T0)(_handle_error);
84   }
85   auto error()() {
86     return Any(Object_Getter__Handle(this._parent, "error"));
87   }
88 }
89 
90