1 module libwasm.bindings.Reporting;
2 
3 import libwasm.types;
4 
5 import memutils.ct: tuple;
6 @safe:
7 nothrow:
8 
9 struct DeprecationReportBody {
10   nothrow:
11   libwasm.bindings.Reporting.ReportBody _parent;
12   alias _parent this;
13   this(Handle h) {
14     _parent = .ReportBody(h);
15   }
16   string id()() {
17     return Object_Getter__string(this._parent, "id");
18   }
19   auto anticipatedRemoval()() {
20     return recastOpt!(Date)(Object_Getter__OptionalHandle(this._parent, "anticipatedRemoval"));
21   }
22   string message()() {
23     return Object_Getter__string(this._parent, "message");
24   }
25   Optional!(string) sourceFile()() {
26     return Object_Getter__OptionalString(this._parent, "sourceFile");
27   }
28   Optional!(uint) lineNumber()() {
29     return Object_Getter__OptionalUint(this._parent, "lineNumber");
30   }
31   Optional!(uint) columnNumber()() {
32     return Object_Getter__OptionalUint(this._parent, "columnNumber");
33   }
34 }
35 struct Report {
36   nothrow:
37   JsHandle handle;
38   alias handle this;
39   this(Handle h) {
40     this.handle = JsHandle(h);
41   }
42   string type()() {
43     return Object_Getter__string(this.handle, "type");
44   }
45   string url()() {
46     return Object_Getter__string(this.handle, "url");
47   }
48   auto body_()() {
49     return recastOpt!(ReportBody)(Object_Getter__OptionalHandle(this.handle, "body"));
50   }
51 }
52 struct ReportBody {
53   nothrow:
54   JsHandle handle;
55   alias handle this;
56   this(Handle h) {
57     this.handle = JsHandle(h);
58   }
59 }
60 alias ReportList = Sequence!(Report);
61 struct ReportingEndpoint {
62   nothrow:
63   JsHandle handle;
64   alias handle this;
65   this(Handle h) {
66     this.handle = JsHandle(h);
67   }
68   static auto create() {
69     return ReportingEndpoint(libwasm_add__object());
70   }
71   void url(T0)(scope auto ref T0 url) {
72     import std.traits : isNumeric, isFloatingPoint, isSomeString;
73     if (isSomeString!T0) {
74       Object_Call_string__void(this.handle, "url", cast(string) url);
75       return;
76     } else if (isNumeric!T0 && !isFloatingPoint!T0) {
77       Object_Call_long__void(this.handle, "url", cast(long) url);
78       return;
79     } else if (isFloatingPoint!T0) {
80       Object_Call_double__void(this.handle, "url", cast(double) url);
81       return;
82     }
83     // Any
84     Handle _handle_url = getOrCreateHandle(url);
85     Object_Call_Handle__void(this.handle, "url", _handle_url);
86     dropHandle!(T0)(_handle_url);
87   }
88   auto url()() {
89     return Any(Object_Getter__Handle(this.handle, "url"));
90   }
91   void priority(T0)(scope auto ref T0 priority) {
92     import std.traits : isNumeric, isFloatingPoint, isSomeString;
93     if (isSomeString!T0) {
94       Object_Call_string__void(this.handle, "priority", cast(string) priority);
95       return;
96     } else if (isNumeric!T0 && !isFloatingPoint!T0) {
97       Object_Call_long__void(this.handle, "priority", cast(long) priority);
98       return;
99     } else if (isFloatingPoint!T0) {
100       Object_Call_double__void(this.handle, "priority", cast(double) priority);
101       return;
102     }
103     // Any
104     Handle _handle_priority = getOrCreateHandle(priority);
105     Object_Call_Handle__void(this.handle, "priority", _handle_priority);
106     dropHandle!(T0)(_handle_priority);
107   }
108   auto priority()() {
109     return Any(Object_Getter__Handle(this.handle, "priority"));
110   }
111   void weight(T0)(scope auto ref T0 weight) {
112     import std.traits : isNumeric, isFloatingPoint, isSomeString;
113     if (isSomeString!T0) {
114       Object_Call_string__void(this.handle, "weight", cast(string) weight);
115       return;
116     } else if (isNumeric!T0 && !isFloatingPoint!T0) {
117       Object_Call_long__void(this.handle, "weight", cast(long) weight);
118       return;
119     } else if (isFloatingPoint!T0) {
120       Object_Call_double__void(this.handle, "weight", cast(double) weight);
121       return;
122     }
123     // Any
124     Handle _handle_weight = getOrCreateHandle(weight);
125     Object_Call_Handle__void(this.handle, "weight", _handle_weight);
126     dropHandle!(T0)(_handle_weight);
127   }
128   auto weight()() {
129     return Any(Object_Getter__Handle(this.handle, "weight"));
130   }
131 }
132 struct ReportingHeaderValue {
133   nothrow:
134   JsHandle handle;
135   alias handle this;
136   this(Handle h) {
137     this.handle = JsHandle(h);
138   }
139   static auto create() {
140     return ReportingHeaderValue(libwasm_add__object());
141   }
142   void items()(scope ref Sequence!(ReportingItem) items) {
143     Object_Call_Handle__void(this.handle, "items", items.handle);
144   }
145   auto items()() {
146     return Sequence!(ReportingItem)(Object_Getter__Handle(this.handle, "items"));
147   }
148 }
149 struct ReportingItem {
150   nothrow:
151   JsHandle handle;
152   alias handle this;
153   this(Handle h) {
154     this.handle = JsHandle(h);
155   }
156   static auto create() {
157     return ReportingItem(libwasm_add__object());
158   }
159   void max_age(T0)(scope auto ref T0 max_age) {
160     import std.traits : isNumeric, isFloatingPoint, isSomeString;
161     if (isSomeString!T0) {
162       Object_Call_string__void(this.handle, "max_age", cast(string) max_age);
163       return;
164     } else if (isNumeric!T0 && !isFloatingPoint!T0) {
165       Object_Call_long__void(this.handle, "max_age", cast(long) max_age);
166       return;
167     } else if (isFloatingPoint!T0) {
168       Object_Call_double__void(this.handle, "max_age", cast(double) max_age);
169       return;
170     }
171     // Any
172     Handle _handle_max_age = getOrCreateHandle(max_age);
173     Object_Call_Handle__void(this.handle, "max_age", _handle_max_age);
174     dropHandle!(T0)(_handle_max_age);
175   }
176   auto max_age()() {
177     return Any(Object_Getter__Handle(this.handle, "max_age"));
178   }
179   void endpoints(T0)(scope auto ref T0 endpoints) {
180     import std.traits : isNumeric, isFloatingPoint, isSomeString;
181     if (isSomeString!T0) {
182       Object_Call_string__void(this.handle, "endpoints", cast(string) endpoints);
183       return;
184     } else if (isNumeric!T0 && !isFloatingPoint!T0) {
185       Object_Call_long__void(this.handle, "endpoints", cast(long) endpoints);
186       return;
187     } else if (isFloatingPoint!T0) {
188       Object_Call_double__void(this.handle, "endpoints", cast(double) endpoints);
189       return;
190     }
191     // Any
192     Handle _handle_endpoints = getOrCreateHandle(endpoints);
193     Object_Call_Handle__void(this.handle, "endpoints", _handle_endpoints);
194     dropHandle!(T0)(_handle_endpoints);
195   }
196   auto endpoints()() {
197     return Any(Object_Getter__Handle(this.handle, "endpoints"));
198   }
199   void group(T0)(scope auto ref T0 group) {
200     import std.traits : isNumeric, isFloatingPoint, isSomeString;
201     if (isSomeString!T0) {
202       Object_Call_string__void(this.handle, "group", cast(string) group);
203       return;
204     } else if (isNumeric!T0 && !isFloatingPoint!T0) {
205       Object_Call_long__void(this.handle, "group", cast(long) group);
206       return;
207     } else if (isFloatingPoint!T0) {
208       Object_Call_double__void(this.handle, "group", cast(double) group);
209       return;
210     }
211     // Any
212     Handle _handle_group = getOrCreateHandle(group);
213     Object_Call_Handle__void(this.handle, "group", _handle_group);
214     dropHandle!(T0)(_handle_group);
215   }
216   auto group()() {
217     return Any(Object_Getter__Handle(this.handle, "group"));
218   }
219   void include_subdomains()(bool include_subdomains) {
220     Object_Call_bool__void(this.handle, "include_subdomains", include_subdomains);
221   }
222   bool include_subdomains()() {
223     return Object_Getter__bool(this.handle, "include_subdomains");
224   }
225 }
226 struct ReportingObserver {
227   nothrow:
228   JsHandle handle;
229   alias handle this;
230   this(Handle h) {
231     this.handle = JsHandle(h);
232   }
233   void observe()() {
234     Object_Call__void(this.handle, "observe");
235   }
236   void disconnect()() {
237     Object_Call__void(this.handle, "disconnect");
238   }
239   auto takeRecords()() {
240     return ReportList(Object_Getter__Handle(this.handle, "takeRecords"));
241   }
242 }
243 alias ReportingObserverCallback = void delegate(Sequence!(Report), ReportingObserver);
244 struct ReportingObserverOptions {
245   nothrow:
246   JsHandle handle;
247   alias handle this;
248   this(Handle h) {
249     this.handle = JsHandle(h);
250   }
251   static auto create() {
252     return ReportingObserverOptions(libwasm_add__object());
253   }
254   void types()(scope ref Sequence!(string) types) {
255     Object_Call_Handle__void(this.handle, "types", types.handle);
256   }
257   auto types()() {
258     return Sequence!(string)(Object_Getter__Handle(this.handle, "types"));
259   }
260   void buffered()(bool buffered) {
261     Object_Call_bool__void(this.handle, "buffered", buffered);
262   }
263   bool buffered()() {
264     return Object_Getter__bool(this.handle, "buffered");
265   }
266 }
267 struct TestingDeprecatedInterface {
268   nothrow:
269   JsHandle handle;
270   alias handle this;
271   this(Handle h) {
272     this.handle = JsHandle(h);
273   }
274   void deprecatedMethod()() {
275     Object_Call__void(this.handle, "deprecatedMethod");
276   }
277   bool deprecatedAttribute()() {
278     return Object_Getter__bool(this.handle, "deprecatedAttribute");
279   }
280 }
281 
282