1 module libwasm.bindings.ServiceWorkerGlobalScope; 2 3 import libwasm.types; 4 5 import memutils.ct: tuple; 6 import libwasm.bindings.Clients; 7 import libwasm.bindings.EventHandler; 8 import libwasm.bindings.ServiceWorkerRegistration; 9 import libwasm.bindings.WorkerGlobalScope; 10 11 @safe: 12 nothrow: 13 14 struct ServiceWorkerGlobalScope { 15 nothrow: 16 libwasm.bindings.WorkerGlobalScope.WorkerGlobalScope _parent; 17 alias _parent this; 18 this(Handle h) { 19 _parent = .WorkerGlobalScope(h); 20 } 21 auto clients()() { 22 return Clients(Object_Getter__Handle(this._parent, "clients")); 23 } 24 auto registration()() { 25 return ServiceWorkerRegistration(Object_Getter__Handle(this._parent, "registration")); 26 } 27 auto skipWaiting()() { 28 return JsPromise!(void)(Object_Getter__Handle(this._parent, "skipWaiting")); 29 } 30 void oninstall(T0)(scope auto ref Optional!(T0) oninstall) if (isTOrPointer!(T0, EventHandlerNonNull)) { 31 Object_Call_EventHandler__void(this._parent, "oninstall", !oninstall.empty, oninstall.front); 32 } 33 EventHandler oninstall()() { 34 return Object_Getter__EventHandler(this._parent, "oninstall"); 35 } 36 void onactivate(T0)(scope auto ref Optional!(T0) onactivate) if (isTOrPointer!(T0, EventHandlerNonNull)) { 37 Object_Call_EventHandler__void(this._parent, "onactivate", !onactivate.empty, onactivate.front); 38 } 39 EventHandler onactivate()() { 40 return Object_Getter__EventHandler(this._parent, "onactivate"); 41 } 42 void onfetch(T0)(scope auto ref Optional!(T0) onfetch) if (isTOrPointer!(T0, EventHandlerNonNull)) { 43 Object_Call_EventHandler__void(this._parent, "onfetch", !onfetch.empty, onfetch.front); 44 } 45 EventHandler onfetch()() { 46 return Object_Getter__EventHandler(this._parent, "onfetch"); 47 } 48 void onmessage(T0)(scope auto ref Optional!(T0) onmessage) if (isTOrPointer!(T0, EventHandlerNonNull)) { 49 Object_Call_EventHandler__void(this._parent, "onmessage", !onmessage.empty, onmessage.front); 50 } 51 EventHandler onmessage()() { 52 return Object_Getter__EventHandler(this._parent, "onmessage"); 53 } 54 void onmessageerror(T0)(scope auto ref Optional!(T0) onmessageerror) if (isTOrPointer!(T0, EventHandlerNonNull)) { 55 Object_Call_EventHandler__void(this._parent, "onmessageerror", !onmessageerror.empty, onmessageerror.front); 56 } 57 EventHandler onmessageerror()() { 58 return Object_Getter__EventHandler(this._parent, "onmessageerror"); 59 } 60 void onpush(T0)(scope auto ref Optional!(T0) onpush) if (isTOrPointer!(T0, EventHandlerNonNull)) { 61 Object_Call_EventHandler__void(this._parent, "onpush", !onpush.empty, onpush.front); 62 } 63 EventHandler onpush()() { 64 return Object_Getter__EventHandler(this._parent, "onpush"); 65 } 66 void onpushsubscriptionchange(T0)(scope auto ref Optional!(T0) onpushsubscriptionchange) if (isTOrPointer!(T0, EventHandlerNonNull)) { 67 Object_Call_EventHandler__void(this._parent, "onpushsubscriptionchange", !onpushsubscriptionchange.empty, onpushsubscriptionchange.front); 68 } 69 EventHandler onpushsubscriptionchange()() { 70 return Object_Getter__EventHandler(this._parent, "onpushsubscriptionchange"); 71 } 72 void onnotificationclick(T0)(scope auto ref Optional!(T0) onnotificationclick) if (isTOrPointer!(T0, EventHandlerNonNull)) { 73 Object_Call_EventHandler__void(this._parent, "onnotificationclick", !onnotificationclick.empty, onnotificationclick.front); 74 } 75 EventHandler onnotificationclick()() { 76 return Object_Getter__EventHandler(this._parent, "onnotificationclick"); 77 } 78 void onnotificationclose(T0)(scope auto ref Optional!(T0) onnotificationclose) if (isTOrPointer!(T0, EventHandlerNonNull)) { 79 Object_Call_EventHandler__void(this._parent, "onnotificationclose", !onnotificationclose.empty, onnotificationclose.front); 80 } 81 EventHandler onnotificationclose()() { 82 return Object_Getter__EventHandler(this._parent, "onnotificationclose"); 83 } 84 } 85 86