1 module libwasm.bindings.BrowserElement;
2 
3 import libwasm.types;
4 
5 import memutils.ct: tuple;
6 @safe:
7 nothrow:
8 
9 struct BrowserElement {
10   nothrow:
11   JsHandle handle;
12   alias handle this;
13   this(Handle h) {
14     this.handle = JsHandle(h);
15   }
16   void sendMouseEvent()(string type, uint x, uint y, uint button, uint clickCount, uint modifiers) {
17     Serialize_Object_VarArgCall!void(this.handle, "sendMouseEvent", "string;uint;uint;uint;uint;uint", tuple(type, x, y, button, clickCount, modifiers));
18   }
19   void goBack()() {
20     Object_Call__void(this.handle, "goBack");
21   }
22   void goForward()() {
23     Object_Call__void(this.handle, "goForward");
24   }
25   void reload()(bool hardReload /* = false */) {
26     Object_Call_bool__void(this.handle, "reload", hardReload);
27   }
28   void reload()() {
29     Object_Call__void(this.handle, "reload");
30   }
31   void stop()() {
32     Object_Call__void(this.handle, "stop");
33   }
34   auto getCanGoBack()() {
35     return JsPromise!(bool)(Object_Getter__Handle(this.handle, "getCanGoBack"));
36   }
37   auto getCanGoForward()() {
38     return JsPromise!(bool)(Object_Getter__Handle(this.handle, "getCanGoForward"));
39   }
40 }
41 struct BrowserElementPrivileged {
42   nothrow:
43   JsHandle handle;
44   alias handle this;
45   this(Handle h) {
46     this.handle = JsHandle(h);
47   }
48   void sendMouseEvent()(string type, uint x, uint y, uint button, uint clickCount, uint modifiers) {
49     Serialize_Object_VarArgCall!void(this.handle, "sendMouseEvent", "string;uint;uint;uint;uint;uint", tuple(type, x, y, button, clickCount, modifiers));
50   }
51   void goBack()() {
52     Object_Call__void(this.handle, "goBack");
53   }
54   void goForward()() {
55     Object_Call__void(this.handle, "goForward");
56   }
57   void reload()(bool hardReload /* = false */) {
58     Object_Call_bool__void(this.handle, "reload", hardReload);
59   }
60   void reload()() {
61     Object_Call__void(this.handle, "reload");
62   }
63   void stop()() {
64     Object_Call__void(this.handle, "stop");
65   }
66   auto getCanGoBack()() {
67     return JsPromise!(bool)(Object_Getter__Handle(this.handle, "getCanGoBack"));
68   }
69   auto getCanGoForward()() {
70     return JsPromise!(bool)(Object_Getter__Handle(this.handle, "getCanGoForward"));
71   }
72 }
73 
74