1 module spasm.bindings.serviceworker;
2 
3 import spasm.types;
4 import spasm.bindings.dom;
5 import spasm.bindings.fetch;
6 import spasm.bindings.html;
7 import spasm.bindings.notifications;
8 import spasm.bindings.pagevisibility;
9 
10 @safe:
11 nothrow:
12 
13 struct Cache {
14   nothrow:
15   JsHandle handle;
16   alias handle this;
17   this(Handle h) {
18     this.handle = JsHandle(h);
19   }
20   auto match()(scope ref RequestInfo request, scope ref CacheQueryOptions options) {
21     return Promise!(Any)(Cache_match(this.handle, request, options.handle));
22   }
23   auto match()(scope ref RequestInfo request) {
24     return Promise!(Any)(Cache_match_0(this.handle, request));
25   }
26   auto matchAll()(scope ref RequestInfo request, scope ref CacheQueryOptions options) {
27     return Promise!(FrozenArray!(Response))(Cache_matchAll(this.handle, request, options.handle));
28   }
29   auto matchAll()(scope ref RequestInfo request) {
30     return Promise!(FrozenArray!(Response))(Cache_matchAll_0(this.handle, request));
31   }
32   auto matchAll()() {
33     return Promise!(FrozenArray!(Response))(Cache_matchAll_1(this.handle));
34   }
35   auto add()(scope ref RequestInfo request) {
36     return Promise!(void)(Cache_add(this.handle, request));
37   }
38   auto addAll()(scope ref Sequence!(RequestInfo) requests) {
39     return Promise!(void)(Cache_addAll(this.handle, requests.handle));
40   }
41   auto put()(scope ref RequestInfo request, scope ref Response response) {
42     return Promise!(void)(Cache_put(this.handle, request, response.handle));
43   }
44   auto delete_()(scope ref RequestInfo request, scope ref CacheQueryOptions options) {
45     return Promise!(bool)(Cache_delete(this.handle, request, options.handle));
46   }
47   auto delete_()(scope ref RequestInfo request) {
48     return Promise!(bool)(Cache_delete_0(this.handle, request));
49   }
50   auto keys()(scope ref RequestInfo request, scope ref CacheQueryOptions options) {
51     return Promise!(FrozenArray!(Request))(Cache_keys(this.handle, request, options.handle));
52   }
53   auto keys()(scope ref RequestInfo request) {
54     return Promise!(FrozenArray!(Request))(Cache_keys_0(this.handle, request));
55   }
56   auto keys()() {
57     return Promise!(FrozenArray!(Request))(Cache_keys_1(this.handle));
58   }
59 }
60 struct CacheQueryOptions {
61   nothrow:
62   JsHandle handle;
63   alias handle this;
64   this(Handle h) {
65     this.handle = JsHandle(h);
66   }
67   static auto create() {
68     return CacheQueryOptions(spasm_add__object());
69   }
70   void ignoreSearch()(bool ignoreSearch) {
71     CacheQueryOptions_ignoreSearch_Set(this.handle, ignoreSearch);
72   }
73   auto ignoreSearch()() {
74     return CacheQueryOptions_ignoreSearch_Get(this.handle);
75   }
76   void ignoreMethod()(bool ignoreMethod) {
77     CacheQueryOptions_ignoreMethod_Set(this.handle, ignoreMethod);
78   }
79   auto ignoreMethod()() {
80     return CacheQueryOptions_ignoreMethod_Get(this.handle);
81   }
82   void ignoreVary()(bool ignoreVary) {
83     CacheQueryOptions_ignoreVary_Set(this.handle, ignoreVary);
84   }
85   auto ignoreVary()() {
86     return CacheQueryOptions_ignoreVary_Get(this.handle);
87   }
88 }
89 struct CacheStorage {
90   nothrow:
91   JsHandle handle;
92   alias handle this;
93   this(Handle h) {
94     this.handle = JsHandle(h);
95   }
96   auto match()(scope ref RequestInfo request, scope ref MultiCacheQueryOptions options) {
97     return Promise!(Any)(CacheStorage_match(this.handle, request, options._parent));
98   }
99   auto match()(scope ref RequestInfo request) {
100     return Promise!(Any)(CacheStorage_match_0(this.handle, request));
101   }
102   auto has()(string cacheName) {
103     return Promise!(bool)(CacheStorage_has(this.handle, cacheName));
104   }
105   auto open()(string cacheName) {
106     return Promise!(Cache)(CacheStorage_open(this.handle, cacheName));
107   }
108   auto delete_()(string cacheName) {
109     return Promise!(bool)(CacheStorage_delete(this.handle, cacheName));
110   }
111   auto keys()() {
112     return Promise!(Sequence!(string))(CacheStorage_keys(this.handle));
113   }
114 }
115 struct Client {
116   nothrow:
117   JsHandle handle;
118   alias handle this;
119   this(Handle h) {
120     this.handle = JsHandle(h);
121   }
122   auto url()() {
123     return Client_url_Get(this.handle);
124   }
125   auto frameType()() {
126     return Client_frameType_Get(this.handle);
127   }
128   auto id()() {
129     return Client_id_Get(this.handle);
130   }
131   auto type()() {
132     return Client_type_Get(this.handle);
133   }
134   void postMessage(T0)(scope auto ref T0 message, scope ref Sequence!(JsObject) transfer /* = [] */) {
135     Handle _handle_message = getOrCreateHandle(message);
136     Client_postMessage(this.handle, _handle_message, transfer.handle);
137     dropHandle!(T0)(_handle_message);
138   }
139   void postMessage(T0)(scope auto ref T0 message) {
140     Handle _handle_message = getOrCreateHandle(message);
141     Client_postMessage_0(this.handle, _handle_message);
142     dropHandle!(T0)(_handle_message);
143   }
144 }
145 struct ClientQueryOptions {
146   nothrow:
147   JsHandle handle;
148   alias handle this;
149   this(Handle h) {
150     this.handle = JsHandle(h);
151   }
152   static auto create() {
153     return ClientQueryOptions(spasm_add__object());
154   }
155   void includeUncontrolled()(bool includeUncontrolled) {
156     ClientQueryOptions_includeUncontrolled_Set(this.handle, includeUncontrolled);
157   }
158   auto includeUncontrolled()() {
159     return ClientQueryOptions_includeUncontrolled_Get(this.handle);
160   }
161   void type()(ClientType type) {
162     ClientQueryOptions_type_Set(this.handle, type);
163   }
164   auto type()() {
165     return ClientQueryOptions_type_Get(this.handle);
166   }
167 }
168 enum ClientType {
169   window,
170   worker,
171   sharedworker,
172   all
173 }
174 struct Clients {
175   nothrow:
176   JsHandle handle;
177   alias handle this;
178   this(Handle h) {
179     this.handle = JsHandle(h);
180   }
181   auto get()(string id) {
182     return Promise!(Any)(Clients_get(this.handle, id));
183   }
184   auto matchAll()(scope ref ClientQueryOptions options) {
185     return Promise!(FrozenArray!(Client))(Clients_matchAll(this.handle, options.handle));
186   }
187   auto matchAll()() {
188     return Promise!(FrozenArray!(Client))(Clients_matchAll_0(this.handle));
189   }
190   auto openWindow()(string url) {
191     return Promise!(Optional!(WindowClient))(Clients_openWindow(this.handle, url));
192   }
193   auto claim()() {
194     return Promise!(void)(Clients_claim(this.handle));
195   }
196 }
197 struct ExtendableEvent {
198   nothrow:
199   spasm.bindings.dom.Event _parent;
200   alias _parent this;
201   this(Handle h) {
202     _parent = .Event(h);
203   }
204   void waitUntil()(scope ref Promise!(Any) f) {
205     ExtendableEvent_waitUntil(this._parent, f.handle);
206   }
207 }
208 struct ExtendableEventInit {
209   nothrow:
210   spasm.bindings.dom.EventInit _parent;
211   alias _parent this;
212   this(Handle h) {
213     _parent = .EventInit(h);
214   }
215   static auto create() {
216     return ExtendableEventInit(spasm_add__object());
217   }
218 }
219 struct ExtendableMessageEvent {
220   nothrow:
221   spasm.bindings.serviceworker.ExtendableEvent _parent;
222   alias _parent this;
223   this(Handle h) {
224     _parent = .ExtendableEvent(h);
225   }
226   auto data()() {
227     return Any(ExtendableMessageEvent_data_Get(this._parent));
228   }
229   auto origin()() {
230     return ExtendableMessageEvent_origin_Get(this._parent);
231   }
232   auto lastEventId()() {
233     return ExtendableMessageEvent_lastEventId_Get(this._parent);
234   }
235   auto source()() {
236     return ExtendableMessageEvent_source_Get(this._parent);
237   }
238   auto ports()() {
239     return FrozenArray!(MessagePort)(ExtendableMessageEvent_ports_Get(this._parent));
240   }
241 }
242 struct ExtendableMessageEventInit {
243   nothrow:
244   spasm.bindings.serviceworker.ExtendableEventInit _parent;
245   alias _parent this;
246   this(Handle h) {
247     _parent = .ExtendableEventInit(h);
248   }
249   static auto create() {
250     return ExtendableMessageEventInit(spasm_add__object());
251   }
252   void data(T0)(scope auto ref T0 data) {
253     Handle _handle_data = getOrCreateHandle(data);
254     ExtendableMessageEventInit_data_Set(this._parent, _handle_data);
255     dropHandle!(T0)(_handle_data);
256   }
257   auto data()() {
258     return Any(ExtendableMessageEventInit_data_Get(this._parent));
259   }
260   void origin()(string origin) {
261     ExtendableMessageEventInit_origin_Set(this._parent, origin);
262   }
263   auto origin()() {
264     return ExtendableMessageEventInit_origin_Get(this._parent);
265   }
266   void lastEventId()(string lastEventId) {
267     ExtendableMessageEventInit_lastEventId_Set(this._parent, lastEventId);
268   }
269   auto lastEventId()() {
270     return ExtendableMessageEventInit_lastEventId_Get(this._parent);
271   }
272   void source(T0)(scope auto ref Optional!(T0) source) if (isTOrPointer!(T0, SumType!(Client, ServiceWorker, MessagePort))) {
273     ExtendableMessageEventInit_source_Set(this._parent, !source.empty, *source.frontRef);
274   }
275   auto source()() {
276     return ExtendableMessageEventInit_source_Get(this._parent);
277   }
278   void ports()(scope ref Sequence!(MessagePort) ports) {
279     ExtendableMessageEventInit_ports_Set(this._parent, ports.handle);
280   }
281   auto ports()() {
282     return Sequence!(MessagePort)(ExtendableMessageEventInit_ports_Get(this._parent));
283   }
284 }
285 struct FetchEvent {
286   nothrow:
287   spasm.bindings.serviceworker.ExtendableEvent _parent;
288   alias _parent this;
289   this(Handle h) {
290     _parent = .ExtendableEvent(h);
291   }
292   auto request()() {
293     return Request(FetchEvent_request_Get(this._parent));
294   }
295   auto preloadResponse()() {
296     return Promise!(Any)(FetchEvent_preloadResponse_Get(this._parent));
297   }
298   auto clientId()() {
299     return FetchEvent_clientId_Get(this._parent);
300   }
301   auto resultingClientId()() {
302     return FetchEvent_resultingClientId_Get(this._parent);
303   }
304   auto replacesClientId()() {
305     return FetchEvent_replacesClientId_Get(this._parent);
306   }
307   void respondWith()(scope ref Promise!(Response) r) {
308     FetchEvent_respondWith(this._parent, r.handle);
309   }
310 }
311 struct FetchEventInit {
312   nothrow:
313   spasm.bindings.serviceworker.ExtendableEventInit _parent;
314   alias _parent this;
315   this(Handle h) {
316     _parent = .ExtendableEventInit(h);
317   }
318   static auto create() {
319     return FetchEventInit(spasm_add__object());
320   }
321   void request()(scope ref Request request) {
322     FetchEventInit_request_Set(this._parent, request.handle);
323   }
324   auto request()() {
325     return Request(FetchEventInit_request_Get(this._parent));
326   }
327   void preloadResponse()(scope ref Promise!(Any) preloadResponse) {
328     FetchEventInit_preloadResponse_Set(this._parent, preloadResponse.handle);
329   }
330   auto preloadResponse()() {
331     return Promise!(Any)(FetchEventInit_preloadResponse_Get(this._parent));
332   }
333   void clientId()(string clientId) {
334     FetchEventInit_clientId_Set(this._parent, clientId);
335   }
336   auto clientId()() {
337     return FetchEventInit_clientId_Get(this._parent);
338   }
339   void resultingClientId()(string resultingClientId) {
340     FetchEventInit_resultingClientId_Set(this._parent, resultingClientId);
341   }
342   auto resultingClientId()() {
343     return FetchEventInit_resultingClientId_Get(this._parent);
344   }
345   void replacesClientId()(string replacesClientId) {
346     FetchEventInit_replacesClientId_Set(this._parent, replacesClientId);
347   }
348   auto replacesClientId()() {
349     return FetchEventInit_replacesClientId_Get(this._parent);
350   }
351 }
352 enum FrameType {
353   auxiliary,
354   top_level,
355   nested,
356   none
357 }
358 struct MultiCacheQueryOptions {
359   nothrow:
360   spasm.bindings.serviceworker.CacheQueryOptions _parent;
361   alias _parent this;
362   this(Handle h) {
363     _parent = .CacheQueryOptions(h);
364   }
365   static auto create() {
366     return MultiCacheQueryOptions(spasm_add__object());
367   }
368   void cacheName()(string cacheName) {
369     MultiCacheQueryOptions_cacheName_Set(this._parent, cacheName);
370   }
371   auto cacheName()() {
372     return MultiCacheQueryOptions_cacheName_Get(this._parent);
373   }
374 }
375 struct NavigationPreloadManager {
376   nothrow:
377   JsHandle handle;
378   alias handle this;
379   this(Handle h) {
380     this.handle = JsHandle(h);
381   }
382   auto enable()() {
383     return Promise!(void)(NavigationPreloadManager_enable(this.handle));
384   }
385   auto disable()() {
386     return Promise!(void)(NavigationPreloadManager_disable(this.handle));
387   }
388   auto setHeaderValue()(string value) {
389     return Promise!(void)(NavigationPreloadManager_setHeaderValue(this.handle, value));
390   }
391   auto getState()() {
392     return Promise!(NavigationPreloadState)(NavigationPreloadManager_getState(this.handle));
393   }
394 }
395 struct NavigationPreloadState {
396   nothrow:
397   JsHandle handle;
398   alias handle this;
399   this(Handle h) {
400     this.handle = JsHandle(h);
401   }
402   static auto create() {
403     return NavigationPreloadState(spasm_add__object());
404   }
405   void enabled()(bool enabled) {
406     NavigationPreloadState_enabled_Set(this.handle, enabled);
407   }
408   auto enabled()() {
409     return NavigationPreloadState_enabled_Get(this.handle);
410   }
411   void headerValue()(string headerValue) {
412     NavigationPreloadState_headerValue_Set(this.handle, headerValue);
413   }
414   auto headerValue()() {
415     return NavigationPreloadState_headerValue_Get(this.handle);
416   }
417 }
418 struct RegistrationOptions {
419   nothrow:
420   JsHandle handle;
421   alias handle this;
422   this(Handle h) {
423     this.handle = JsHandle(h);
424   }
425   static auto create() {
426     return RegistrationOptions(spasm_add__object());
427   }
428   void scope_()(string scope_) {
429     RegistrationOptions_scope_Set(this.handle, scope_);
430   }
431   auto scope_()() {
432     return RegistrationOptions_scope_Get(this.handle);
433   }
434   void type()(WorkerType type) {
435     RegistrationOptions_type_Set(this.handle, type);
436   }
437   auto type()() {
438     return RegistrationOptions_type_Get(this.handle);
439   }
440   void updateViaCache()(ServiceWorkerUpdateViaCache updateViaCache) {
441     RegistrationOptions_updateViaCache_Set(this.handle, updateViaCache);
442   }
443   auto updateViaCache()() {
444     return RegistrationOptions_updateViaCache_Get(this.handle);
445   }
446 }
447 struct ServiceWorker {
448   nothrow:
449   spasm.bindings.dom.EventTarget _parent;
450   alias _parent this;
451   this(Handle h) {
452     _parent = .EventTarget(h);
453   }
454   auto scriptURL()() {
455     return ServiceWorker_scriptURL_Get(this._parent);
456   }
457   auto state()() {
458     return ServiceWorker_state_Get(this._parent);
459   }
460   void postMessage(T0)(scope auto ref T0 message, scope ref Sequence!(JsObject) transfer /* = [] */) {
461     Handle _handle_message = getOrCreateHandle(message);
462     ServiceWorker_postMessage(this._parent, _handle_message, transfer.handle);
463     dropHandle!(T0)(_handle_message);
464   }
465   void postMessage(T0)(scope auto ref T0 message) {
466     Handle _handle_message = getOrCreateHandle(message);
467     ServiceWorker_postMessage_0(this._parent, _handle_message);
468     dropHandle!(T0)(_handle_message);
469   }
470   void onstatechange()(EventHandler onstatechange) {
471     ServiceWorker_onstatechange_Set(this._parent, onstatechange);
472   }
473   auto onstatechange()() {
474     return ServiceWorker_onstatechange_Get(this._parent);
475   }
476   void onerror()(EventHandler onerror) {
477     AbstractWorker_onerror_Set(this._parent, onerror);
478   }
479   auto onerror()() {
480     return AbstractWorker_onerror_Get(this._parent);
481   }
482 }
483 struct ServiceWorkerContainer {
484   nothrow:
485   spasm.bindings.dom.EventTarget _parent;
486   alias _parent this;
487   this(Handle h) {
488     _parent = .EventTarget(h);
489   }
490   auto controller()() {
491     return ServiceWorkerContainer_controller_Get(this._parent);
492   }
493   auto ready()() {
494     return Promise!(ServiceWorkerRegistration)(ServiceWorkerContainer_ready_Get(this._parent));
495   }
496   auto register()(string scriptURL, scope ref RegistrationOptions options) {
497     return Promise!(ServiceWorkerRegistration)(ServiceWorkerContainer_register(this._parent, scriptURL, options.handle));
498   }
499   auto register()(string scriptURL) {
500     return Promise!(ServiceWorkerRegistration)(ServiceWorkerContainer_register_0(this._parent, scriptURL));
501   }
502   auto getRegistration()(string clientURL /* = "" */) {
503     return Promise!(Any)(ServiceWorkerContainer_getRegistration(this._parent, clientURL));
504   }
505   auto getRegistration()() {
506     return Promise!(Any)(ServiceWorkerContainer_getRegistration_0(this._parent));
507   }
508   auto getRegistrations()() {
509     return Promise!(FrozenArray!(ServiceWorkerRegistration))(ServiceWorkerContainer_getRegistrations(this._parent));
510   }
511   void startMessages()() {
512     ServiceWorkerContainer_startMessages(this._parent);
513   }
514   void oncontrollerchange()(EventHandler oncontrollerchange) {
515     ServiceWorkerContainer_oncontrollerchange_Set(this._parent, oncontrollerchange);
516   }
517   auto oncontrollerchange()() {
518     return ServiceWorkerContainer_oncontrollerchange_Get(this._parent);
519   }
520   void onmessage()(EventHandler onmessage) {
521     ServiceWorkerContainer_onmessage_Set(this._parent, onmessage);
522   }
523   auto onmessage()() {
524     return ServiceWorkerContainer_onmessage_Get(this._parent);
525   }
526   void onmessageerror()(EventHandler onmessageerror) {
527     ServiceWorkerContainer_onmessageerror_Set(this._parent, onmessageerror);
528   }
529   auto onmessageerror()() {
530     return ServiceWorkerContainer_onmessageerror_Get(this._parent);
531   }
532 }
533 struct ServiceWorkerGlobalScope {
534   nothrow:
535   spasm.bindings.html.WorkerGlobalScope _parent;
536   alias _parent this;
537   this(Handle h) {
538     _parent = .WorkerGlobalScope(h);
539   }
540   auto clients()() {
541     return Clients(ServiceWorkerGlobalScope_clients_Get(this._parent));
542   }
543   auto registration()() {
544     return ServiceWorkerRegistration(ServiceWorkerGlobalScope_registration_Get(this._parent));
545   }
546   auto skipWaiting()() {
547     return Promise!(void)(ServiceWorkerGlobalScope_skipWaiting(this._parent));
548   }
549   void oninstall()(EventHandler oninstall) {
550     ServiceWorkerGlobalScope_oninstall_Set(this._parent, oninstall);
551   }
552   auto oninstall()() {
553     return ServiceWorkerGlobalScope_oninstall_Get(this._parent);
554   }
555   void onactivate()(EventHandler onactivate) {
556     ServiceWorkerGlobalScope_onactivate_Set(this._parent, onactivate);
557   }
558   auto onactivate()() {
559     return ServiceWorkerGlobalScope_onactivate_Get(this._parent);
560   }
561   void onfetch()(EventHandler onfetch) {
562     ServiceWorkerGlobalScope_onfetch_Set(this._parent, onfetch);
563   }
564   auto onfetch()() {
565     return ServiceWorkerGlobalScope_onfetch_Get(this._parent);
566   }
567   void onmessage()(EventHandler onmessage) {
568     ServiceWorkerGlobalScope_onmessage_Set(this._parent, onmessage);
569   }
570   auto onmessage()() {
571     return ServiceWorkerGlobalScope_onmessage_Get(this._parent);
572   }
573   void onmessageerror()(EventHandler onmessageerror) {
574     ServiceWorkerGlobalScope_onmessageerror_Set(this._parent, onmessageerror);
575   }
576   auto onmessageerror()() {
577     return ServiceWorkerGlobalScope_onmessageerror_Get(this._parent);
578   }
579   void onnotificationclick()(EventHandler onnotificationclick) {
580     ServiceWorkerGlobalScope_onnotificationclick_Set(this._parent, onnotificationclick);
581   }
582   auto onnotificationclick()() {
583     return ServiceWorkerGlobalScope_onnotificationclick_Get(this._parent);
584   }
585   void onnotificationclose()(EventHandler onnotificationclose) {
586     ServiceWorkerGlobalScope_onnotificationclose_Set(this._parent, onnotificationclose);
587   }
588   auto onnotificationclose()() {
589     return ServiceWorkerGlobalScope_onnotificationclose_Get(this._parent);
590   }
591 }
592 struct ServiceWorkerRegistration {
593   nothrow:
594   spasm.bindings.dom.EventTarget _parent;
595   alias _parent this;
596   this(Handle h) {
597     _parent = .EventTarget(h);
598   }
599   auto installing()() {
600     return ServiceWorkerRegistration_installing_Get(this._parent);
601   }
602   auto waiting()() {
603     return ServiceWorkerRegistration_waiting_Get(this._parent);
604   }
605   auto active()() {
606     return ServiceWorkerRegistration_active_Get(this._parent);
607   }
608   auto navigationPreload()() {
609     return NavigationPreloadManager(ServiceWorkerRegistration_navigationPreload_Get(this._parent));
610   }
611   auto scope_()() {
612     return ServiceWorkerRegistration_scope_Get(this._parent);
613   }
614   auto updateViaCache()() {
615     return ServiceWorkerRegistration_updateViaCache_Get(this._parent);
616   }
617   auto update()() {
618     return Promise!(void)(ServiceWorkerRegistration_update(this._parent));
619   }
620   auto unregister()() {
621     return Promise!(bool)(ServiceWorkerRegistration_unregister(this._parent));
622   }
623   void onupdatefound()(EventHandler onupdatefound) {
624     ServiceWorkerRegistration_onupdatefound_Set(this._parent, onupdatefound);
625   }
626   auto onupdatefound()() {
627     return ServiceWorkerRegistration_onupdatefound_Get(this._parent);
628   }
629   auto showNotification()(string title, scope ref NotificationOptions options) {
630     return Promise!(void)(ServiceWorkerRegistration_showNotification(this._parent, title, options.handle));
631   }
632   auto showNotification()(string title) {
633     return Promise!(void)(ServiceWorkerRegistration_showNotification_0(this._parent, title));
634   }
635   auto getNotifications()(scope ref GetNotificationOptions filter) {
636     return Promise!(Sequence!(Notification))(ServiceWorkerRegistration_getNotifications(this._parent, filter.handle));
637   }
638   auto getNotifications()() {
639     return Promise!(Sequence!(Notification))(ServiceWorkerRegistration_getNotifications_0(this._parent));
640   }
641 }
642 enum ServiceWorkerState {
643   installing,
644   installed,
645   activating,
646   activated,
647   redundant
648 }
649 enum ServiceWorkerUpdateViaCache {
650   imports,
651   all,
652   none
653 }
654 struct WindowClient {
655   nothrow:
656   spasm.bindings.serviceworker.Client _parent;
657   alias _parent this;
658   this(Handle h) {
659     _parent = .Client(h);
660   }
661   auto visibilityState()() {
662     return WindowClient_visibilityState_Get(this._parent);
663   }
664   auto focused()() {
665     return WindowClient_focused_Get(this._parent);
666   }
667   auto ancestorOrigins()() {
668     return FrozenArray!(string)(WindowClient_ancestorOrigins_Get(this._parent));
669   }
670   auto focus()() {
671     return Promise!(WindowClient)(WindowClient_focus(this._parent));
672   }
673   auto navigate()(string url) {
674     return Promise!(Optional!(WindowClient))(WindowClient_navigate(this._parent, url));
675   }
676 }
677 
678 
679 extern (C) Handle Cache_match(Handle, scope ref RequestInfo, Handle);
680 extern (C) Handle Cache_match_0(Handle, scope ref RequestInfo);
681 extern (C) Handle Cache_matchAll(Handle, scope ref RequestInfo, Handle);
682 extern (C) Handle Cache_matchAll_0(Handle, scope ref RequestInfo);
683 extern (C) Handle Cache_matchAll_1(Handle);
684 extern (C) Handle Cache_add(Handle, scope ref RequestInfo);
685 extern (C) Handle Cache_addAll(Handle, Handle);
686 extern (C) Handle Cache_put(Handle, scope ref RequestInfo, Handle);
687 extern (C) Handle Cache_delete(Handle, scope ref RequestInfo, Handle);
688 extern (C) Handle Cache_delete_0(Handle, scope ref RequestInfo);
689 extern (C) Handle Cache_keys(Handle, scope ref RequestInfo, Handle);
690 extern (C) Handle Cache_keys_0(Handle, scope ref RequestInfo);
691 extern (C) Handle Cache_keys_1(Handle);
692 extern (C) void CacheQueryOptions_ignoreSearch_Set(Handle, bool);
693 extern (C) bool CacheQueryOptions_ignoreSearch_Get(Handle);
694 extern (C) void CacheQueryOptions_ignoreMethod_Set(Handle, bool);
695 extern (C) bool CacheQueryOptions_ignoreMethod_Get(Handle);
696 extern (C) void CacheQueryOptions_ignoreVary_Set(Handle, bool);
697 extern (C) bool CacheQueryOptions_ignoreVary_Get(Handle);
698 extern (C) Handle CacheStorage_match(Handle, scope ref RequestInfo, Handle);
699 extern (C) Handle CacheStorage_match_0(Handle, scope ref RequestInfo);
700 extern (C) Handle CacheStorage_has(Handle, string);
701 extern (C) Handle CacheStorage_open(Handle, string);
702 extern (C) Handle CacheStorage_delete(Handle, string);
703 extern (C) Handle CacheStorage_keys(Handle);
704 extern (C) string Client_url_Get(Handle);
705 extern (C) FrameType Client_frameType_Get(Handle);
706 extern (C) string Client_id_Get(Handle);
707 extern (C) ClientType Client_type_Get(Handle);
708 extern (C) void Client_postMessage(Handle, Handle, Handle);
709 extern (C) void Client_postMessage_0(Handle, Handle);
710 extern (C) void ClientQueryOptions_includeUncontrolled_Set(Handle, bool);
711 extern (C) bool ClientQueryOptions_includeUncontrolled_Get(Handle);
712 extern (C) void ClientQueryOptions_type_Set(Handle, ClientType);
713 extern (C) ClientType ClientQueryOptions_type_Get(Handle);
714 extern (C) Handle Clients_get(Handle, string);
715 extern (C) Handle Clients_matchAll(Handle, Handle);
716 extern (C) Handle Clients_matchAll_0(Handle);
717 extern (C) Handle Clients_openWindow(Handle, string);
718 extern (C) Handle Clients_claim(Handle);
719 extern (C) void ExtendableEvent_waitUntil(Handle, Handle);
720 extern (C) Handle ExtendableMessageEvent_data_Get(Handle);
721 extern (C) string ExtendableMessageEvent_origin_Get(Handle);
722 extern (C) string ExtendableMessageEvent_lastEventId_Get(Handle);
723 extern (C) Optional!(SumType!(Client, ServiceWorker, MessagePort)) ExtendableMessageEvent_source_Get(Handle);
724 extern (C) Handle ExtendableMessageEvent_ports_Get(Handle);
725 extern (C) void ExtendableMessageEventInit_data_Set(Handle, Handle);
726 extern (C) Handle ExtendableMessageEventInit_data_Get(Handle);
727 extern (C) void ExtendableMessageEventInit_origin_Set(Handle, string);
728 extern (C) string ExtendableMessageEventInit_origin_Get(Handle);
729 extern (C) void ExtendableMessageEventInit_lastEventId_Set(Handle, string);
730 extern (C) string ExtendableMessageEventInit_lastEventId_Get(Handle);
731 extern (C) void ExtendableMessageEventInit_source_Set(Handle, bool, scope ref SumType!(Client, ServiceWorker, MessagePort));
732 extern (C) Optional!(SumType!(Client, ServiceWorker, MessagePort)) ExtendableMessageEventInit_source_Get(Handle);
733 extern (C) void ExtendableMessageEventInit_ports_Set(Handle, Handle);
734 extern (C) Handle ExtendableMessageEventInit_ports_Get(Handle);
735 extern (C) Handle FetchEvent_request_Get(Handle);
736 extern (C) Handle FetchEvent_preloadResponse_Get(Handle);
737 extern (C) string FetchEvent_clientId_Get(Handle);
738 extern (C) string FetchEvent_resultingClientId_Get(Handle);
739 extern (C) string FetchEvent_replacesClientId_Get(Handle);
740 extern (C) void FetchEvent_respondWith(Handle, Handle);
741 extern (C) void FetchEventInit_request_Set(Handle, Handle);
742 extern (C) Handle FetchEventInit_request_Get(Handle);
743 extern (C) void FetchEventInit_preloadResponse_Set(Handle, Handle);
744 extern (C) Handle FetchEventInit_preloadResponse_Get(Handle);
745 extern (C) void FetchEventInit_clientId_Set(Handle, string);
746 extern (C) string FetchEventInit_clientId_Get(Handle);
747 extern (C) void FetchEventInit_resultingClientId_Set(Handle, string);
748 extern (C) string FetchEventInit_resultingClientId_Get(Handle);
749 extern (C) void FetchEventInit_replacesClientId_Set(Handle, string);
750 extern (C) string FetchEventInit_replacesClientId_Get(Handle);
751 extern (C) void MultiCacheQueryOptions_cacheName_Set(Handle, string);
752 extern (C) string MultiCacheQueryOptions_cacheName_Get(Handle);
753 extern (C) Handle NavigationPreloadManager_enable(Handle);
754 extern (C) Handle NavigationPreloadManager_disable(Handle);
755 extern (C) Handle NavigationPreloadManager_setHeaderValue(Handle, string);
756 extern (C) Handle NavigationPreloadManager_getState(Handle);
757 extern (C) void NavigationPreloadState_enabled_Set(Handle, bool);
758 extern (C) bool NavigationPreloadState_enabled_Get(Handle);
759 extern (C) void NavigationPreloadState_headerValue_Set(Handle, string);
760 extern (C) string NavigationPreloadState_headerValue_Get(Handle);
761 extern (C) void RegistrationOptions_scope_Set(Handle, string);
762 extern (C) string RegistrationOptions_scope_Get(Handle);
763 extern (C) void RegistrationOptions_type_Set(Handle, WorkerType);
764 extern (C) WorkerType RegistrationOptions_type_Get(Handle);
765 extern (C) void RegistrationOptions_updateViaCache_Set(Handle, ServiceWorkerUpdateViaCache);
766 extern (C) ServiceWorkerUpdateViaCache RegistrationOptions_updateViaCache_Get(Handle);
767 extern (C) string ServiceWorker_scriptURL_Get(Handle);
768 extern (C) ServiceWorkerState ServiceWorker_state_Get(Handle);
769 extern (C) void ServiceWorker_postMessage(Handle, Handle, Handle);
770 extern (C) void ServiceWorker_postMessage_0(Handle, Handle);
771 extern (C) void ServiceWorker_onstatechange_Set(Handle, EventHandler);
772 extern (C) EventHandler ServiceWorker_onstatechange_Get(Handle);
773 extern (C) Optional!(ServiceWorker) ServiceWorkerContainer_controller_Get(Handle);
774 extern (C) Handle ServiceWorkerContainer_ready_Get(Handle);
775 extern (C) Handle ServiceWorkerContainer_register(Handle, string, Handle);
776 extern (C) Handle ServiceWorkerContainer_register_0(Handle, string);
777 extern (C) Handle ServiceWorkerContainer_getRegistration(Handle, string);
778 extern (C) Handle ServiceWorkerContainer_getRegistration_0(Handle);
779 extern (C) Handle ServiceWorkerContainer_getRegistrations(Handle);
780 extern (C) void ServiceWorkerContainer_startMessages(Handle);
781 extern (C) void ServiceWorkerContainer_oncontrollerchange_Set(Handle, EventHandler);
782 extern (C) EventHandler ServiceWorkerContainer_oncontrollerchange_Get(Handle);
783 extern (C) void ServiceWorkerContainer_onmessage_Set(Handle, EventHandler);
784 extern (C) EventHandler ServiceWorkerContainer_onmessage_Get(Handle);
785 extern (C) void ServiceWorkerContainer_onmessageerror_Set(Handle, EventHandler);
786 extern (C) EventHandler ServiceWorkerContainer_onmessageerror_Get(Handle);
787 extern (C) Handle ServiceWorkerGlobalScope_clients_Get(Handle);
788 extern (C) Handle ServiceWorkerGlobalScope_registration_Get(Handle);
789 extern (C) Handle ServiceWorkerGlobalScope_skipWaiting(Handle);
790 extern (C) void ServiceWorkerGlobalScope_oninstall_Set(Handle, EventHandler);
791 extern (C) EventHandler ServiceWorkerGlobalScope_oninstall_Get(Handle);
792 extern (C) void ServiceWorkerGlobalScope_onactivate_Set(Handle, EventHandler);
793 extern (C) EventHandler ServiceWorkerGlobalScope_onactivate_Get(Handle);
794 extern (C) void ServiceWorkerGlobalScope_onfetch_Set(Handle, EventHandler);
795 extern (C) EventHandler ServiceWorkerGlobalScope_onfetch_Get(Handle);
796 extern (C) void ServiceWorkerGlobalScope_onmessage_Set(Handle, EventHandler);
797 extern (C) EventHandler ServiceWorkerGlobalScope_onmessage_Get(Handle);
798 extern (C) void ServiceWorkerGlobalScope_onmessageerror_Set(Handle, EventHandler);
799 extern (C) EventHandler ServiceWorkerGlobalScope_onmessageerror_Get(Handle);
800 extern (C) void ServiceWorkerGlobalScope_onnotificationclick_Set(Handle, EventHandler);
801 extern (C) EventHandler ServiceWorkerGlobalScope_onnotificationclick_Get(Handle);
802 extern (C) void ServiceWorkerGlobalScope_onnotificationclose_Set(Handle, EventHandler);
803 extern (C) EventHandler ServiceWorkerGlobalScope_onnotificationclose_Get(Handle);
804 extern (C) Optional!(ServiceWorker) ServiceWorkerRegistration_installing_Get(Handle);
805 extern (C) Optional!(ServiceWorker) ServiceWorkerRegistration_waiting_Get(Handle);
806 extern (C) Optional!(ServiceWorker) ServiceWorkerRegistration_active_Get(Handle);
807 extern (C) Handle ServiceWorkerRegistration_navigationPreload_Get(Handle);
808 extern (C) string ServiceWorkerRegistration_scope_Get(Handle);
809 extern (C) ServiceWorkerUpdateViaCache ServiceWorkerRegistration_updateViaCache_Get(Handle);
810 extern (C) Handle ServiceWorkerRegistration_update(Handle);
811 extern (C) Handle ServiceWorkerRegistration_unregister(Handle);
812 extern (C) void ServiceWorkerRegistration_onupdatefound_Set(Handle, EventHandler);
813 extern (C) EventHandler ServiceWorkerRegistration_onupdatefound_Get(Handle);
814 extern (C) Handle ServiceWorkerRegistration_showNotification(Handle, string, Handle);
815 extern (C) Handle ServiceWorkerRegistration_showNotification_0(Handle, string);
816 extern (C) Handle ServiceWorkerRegistration_getNotifications(Handle, Handle);
817 extern (C) Handle ServiceWorkerRegistration_getNotifications_0(Handle);
818 extern (C) VisibilityState WindowClient_visibilityState_Get(Handle);
819 extern (C) bool WindowClient_focused_Get(Handle);
820 extern (C) Handle WindowClient_ancestorOrigins_Get(Handle);
821 extern (C) Handle WindowClient_focus(Handle);
822 extern (C) Handle WindowClient_navigate(Handle, string);