0 | module Web.Internal.DomTypes
  1 |
  2 | import JS
  3 |
  4 | %default total
  5 |
  6 |
  7 | --------------------------------------------------------------------------------
  8 | --          Enums
  9 | --------------------------------------------------------------------------------
 10 |
 11 | namespace ShadowRootMode
 12 |
 13 |   public export
 14 |   data ShadowRootMode = Open | Closed
 15 |
 16 |   public export
 17 |   Show ShadowRootMode where
 18 |     show Open = "open"
 19 |     show Closed = "closed"
 20 |
 21 |   public export
 22 |   Eq ShadowRootMode where
 23 |     (==) = (==) `on` show
 24 |
 25 |   public export
 26 |   Ord ShadowRootMode where
 27 |     compare = compare `on` show
 28 |
 29 |   public export
 30 |   read : String -> Maybe ShadowRootMode
 31 |   read "open" = Just Open
 32 |   read "closed" = Just Closed
 33 |   read _ = Nothing
 34 |
 35 |   export
 36 |   ToFFI ShadowRootMode String where
 37 |     toFFI = show
 38 |
 39 |   export
 40 |   FromFFI ShadowRootMode String where
 41 |     fromFFI = read
 42 |
 43 |
 44 |
 45 | --------------------------------------------------------------------------------
 46 | --          Interfaces
 47 | --------------------------------------------------------------------------------
 48 |
 49 | export data AbortController : Type where [external]
 50 |
 51 | export
 52 | ToFFI AbortController AbortController where toFFI = id
 53 |
 54 | export
 55 | FromFFI AbortController AbortController where fromFFI = Just
 56 |
 57 | export
 58 | SafeCast AbortController where
 59 |   safeCast = unsafeCastOnPrototypeName "AbortController"
 60 |
 61 | export data AbortSignal : Type where [external]
 62 |
 63 | export
 64 | ToFFI AbortSignal AbortSignal where toFFI = id
 65 |
 66 | export
 67 | FromFFI AbortSignal AbortSignal where fromFFI = Just
 68 |
 69 | export
 70 | SafeCast AbortSignal where
 71 |   safeCast = unsafeCastOnPrototypeName "AbortSignal"
 72 |
 73 | export data AbstractRange : Type where [external]
 74 |
 75 | export
 76 | ToFFI AbstractRange AbstractRange where toFFI = id
 77 |
 78 | export
 79 | FromFFI AbstractRange AbstractRange where fromFFI = Just
 80 |
 81 | export
 82 | SafeCast AbstractRange where
 83 |   safeCast = unsafeCastOnPrototypeName "AbstractRange"
 84 |
 85 | export data Attr : Type where [external]
 86 |
 87 | export
 88 | ToFFI Attr Attr where toFFI = id
 89 |
 90 | export
 91 | FromFFI Attr Attr where fromFFI = Just
 92 |
 93 | export
 94 | SafeCast Attr where
 95 |   safeCast = unsafeCastOnPrototypeName "Attr"
 96 |
 97 | export data CDATASection : Type where [external]
 98 |
 99 | export
100 | ToFFI CDATASection CDATASection where toFFI = id
101 |
102 | export
103 | FromFFI CDATASection CDATASection where fromFFI = Just
104 |
105 | export
106 | SafeCast CDATASection where
107 |   safeCast = unsafeCastOnPrototypeName "CDATASection"
108 |
109 | export data CharacterData : Type where [external]
110 |
111 | export
112 | ToFFI CharacterData CharacterData where toFFI = id
113 |
114 | export
115 | FromFFI CharacterData CharacterData where fromFFI = Just
116 |
117 | export
118 | SafeCast CharacterData where
119 |   safeCast = unsafeCastOnPrototypeName "CharacterData"
120 |
121 | export data Comment : Type where [external]
122 |
123 | export
124 | ToFFI Comment Comment where toFFI = id
125 |
126 | export
127 | FromFFI Comment Comment where fromFFI = Just
128 |
129 | export
130 | SafeCast Comment where
131 |   safeCast = unsafeCastOnPrototypeName "Comment"
132 |
133 | export data CustomEvent : Type where [external]
134 |
135 | export
136 | ToFFI CustomEvent CustomEvent where toFFI = id
137 |
138 | export
139 | FromFFI CustomEvent CustomEvent where fromFFI = Just
140 |
141 | export
142 | SafeCast CustomEvent where
143 |   safeCast = unsafeCastOnPrototypeName "CustomEvent"
144 |
145 | export data DOMImplementation : Type where [external]
146 |
147 | export
148 | ToFFI DOMImplementation DOMImplementation where toFFI = id
149 |
150 | export
151 | FromFFI DOMImplementation DOMImplementation where fromFFI = Just
152 |
153 | export
154 | SafeCast DOMImplementation where
155 |   safeCast = unsafeCastOnPrototypeName "DOMImplementation"
156 |
157 | export data DOMTokenList : Type where [external]
158 |
159 | export
160 | ToFFI DOMTokenList DOMTokenList where toFFI = id
161 |
162 | export
163 | FromFFI DOMTokenList DOMTokenList where fromFFI = Just
164 |
165 | export
166 | SafeCast DOMTokenList where
167 |   safeCast = unsafeCastOnPrototypeName "DOMTokenList"
168 |
169 | export data Document : Type where [external]
170 |
171 | export
172 | ToFFI Document Document where toFFI = id
173 |
174 | export
175 | FromFFI Document Document where fromFFI = Just
176 |
177 | export
178 | SafeCast Document where
179 |   safeCast = unsafeCastOnPrototypeName "Document"
180 |
181 | export data DocumentFragment : Type where [external]
182 |
183 | export
184 | ToFFI DocumentFragment DocumentFragment where toFFI = id
185 |
186 | export
187 | FromFFI DocumentFragment DocumentFragment where fromFFI = Just
188 |
189 | export
190 | SafeCast DocumentFragment where
191 |   safeCast = unsafeCastOnPrototypeName "DocumentFragment"
192 |
193 | export data DocumentType : Type where [external]
194 |
195 | export
196 | ToFFI DocumentType DocumentType where toFFI = id
197 |
198 | export
199 | FromFFI DocumentType DocumentType where fromFFI = Just
200 |
201 | export
202 | SafeCast DocumentType where
203 |   safeCast = unsafeCastOnPrototypeName "DocumentType"
204 |
205 | export data Element : Type where [external]
206 |
207 | export
208 | ToFFI Element Element where toFFI = id
209 |
210 | export
211 | FromFFI Element Element where fromFFI = Just
212 |
213 | export
214 | SafeCast Element where
215 |   safeCast = unsafeCastOnPrototypeName "Element"
216 |
217 | export data Event : Type where [external]
218 |
219 | export
220 | ToFFI Event Event where toFFI = id
221 |
222 | export
223 | FromFFI Event Event where fromFFI = Just
224 |
225 | export
226 | SafeCast Event where
227 |   safeCast = unsafeCastOnPrototypeName "Event"
228 |
229 | export data EventTarget : Type where [external]
230 |
231 | export
232 | ToFFI EventTarget EventTarget where toFFI = id
233 |
234 | export
235 | FromFFI EventTarget EventTarget where fromFFI = Just
236 |
237 | export
238 | SafeCast EventTarget where
239 |   safeCast = unsafeCastOnPrototypeName "EventTarget"
240 |
241 | export data HTMLCollection : Type where [external]
242 |
243 | export
244 | ToFFI HTMLCollection HTMLCollection where toFFI = id
245 |
246 | export
247 | FromFFI HTMLCollection HTMLCollection where fromFFI = Just
248 |
249 | export
250 | SafeCast HTMLCollection where
251 |   safeCast = unsafeCastOnPrototypeName "HTMLCollection"
252 |
253 | export data MutationObserver : Type where [external]
254 |
255 | export
256 | ToFFI MutationObserver MutationObserver where toFFI = id
257 |
258 | export
259 | FromFFI MutationObserver MutationObserver where fromFFI = Just
260 |
261 | export
262 | SafeCast MutationObserver where
263 |   safeCast = unsafeCastOnPrototypeName "MutationObserver"
264 |
265 | export data MutationRecord : Type where [external]
266 |
267 | export
268 | ToFFI MutationRecord MutationRecord where toFFI = id
269 |
270 | export
271 | FromFFI MutationRecord MutationRecord where fromFFI = Just
272 |
273 | export
274 | SafeCast MutationRecord where
275 |   safeCast = unsafeCastOnPrototypeName "MutationRecord"
276 |
277 | export data NamedNodeMap : Type where [external]
278 |
279 | export
280 | ToFFI NamedNodeMap NamedNodeMap where toFFI = id
281 |
282 | export
283 | FromFFI NamedNodeMap NamedNodeMap where fromFFI = Just
284 |
285 | export
286 | SafeCast NamedNodeMap where
287 |   safeCast = unsafeCastOnPrototypeName "NamedNodeMap"
288 |
289 | export data Node : Type where [external]
290 |
291 | export
292 | ToFFI Node Node where toFFI = id
293 |
294 | export
295 | FromFFI Node Node where fromFFI = Just
296 |
297 | export
298 | SafeCast Node where
299 |   safeCast = unsafeCastOnPrototypeName "Node"
300 |
301 | export data NodeIterator : Type where [external]
302 |
303 | export
304 | ToFFI NodeIterator NodeIterator where toFFI = id
305 |
306 | export
307 | FromFFI NodeIterator NodeIterator where fromFFI = Just
308 |
309 | export
310 | SafeCast NodeIterator where
311 |   safeCast = unsafeCastOnPrototypeName "NodeIterator"
312 |
313 | export data NodeList : Type where [external]
314 |
315 | export
316 | ToFFI NodeList NodeList where toFFI = id
317 |
318 | export
319 | FromFFI NodeList NodeList where fromFFI = Just
320 |
321 | export
322 | SafeCast NodeList where
323 |   safeCast = unsafeCastOnPrototypeName "NodeList"
324 |
325 | export data Performance : Type where [external]
326 |
327 | export
328 | ToFFI Performance Performance where toFFI = id
329 |
330 | export
331 | FromFFI Performance Performance where fromFFI = Just
332 |
333 | export
334 | SafeCast Performance where
335 |   safeCast = unsafeCastOnPrototypeName "Performance"
336 |
337 | export data ProcessingInstruction : Type where [external]
338 |
339 | export
340 | ToFFI ProcessingInstruction ProcessingInstruction where toFFI = id
341 |
342 | export
343 | FromFFI ProcessingInstruction ProcessingInstruction where fromFFI = Just
344 |
345 | export
346 | SafeCast ProcessingInstruction where
347 |   safeCast = unsafeCastOnPrototypeName "ProcessingInstruction"
348 |
349 | export data Range : Type where [external]
350 |
351 | export
352 | ToFFI Range Range where toFFI = id
353 |
354 | export
355 | FromFFI Range Range where fromFFI = Just
356 |
357 | export
358 | SafeCast Range where
359 |   safeCast = unsafeCastOnPrototypeName "Range"
360 |
361 | export data ShadowRoot : Type where [external]
362 |
363 | export
364 | ToFFI ShadowRoot ShadowRoot where toFFI = id
365 |
366 | export
367 | FromFFI ShadowRoot ShadowRoot where fromFFI = Just
368 |
369 | export
370 | SafeCast ShadowRoot where
371 |   safeCast = unsafeCastOnPrototypeName "ShadowRoot"
372 |
373 | export data StaticRange : Type where [external]
374 |
375 | export
376 | ToFFI StaticRange StaticRange where toFFI = id
377 |
378 | export
379 | FromFFI StaticRange StaticRange where fromFFI = Just
380 |
381 | export
382 | SafeCast StaticRange where
383 |   safeCast = unsafeCastOnPrototypeName "StaticRange"
384 |
385 | export data Text : Type where [external]
386 |
387 | export
388 | ToFFI Text Text where toFFI = id
389 |
390 | export
391 | FromFFI Text Text where fromFFI = Just
392 |
393 | export
394 | SafeCast Text where
395 |   safeCast = unsafeCastOnPrototypeName "Text"
396 |
397 | export data TreeWalker : Type where [external]
398 |
399 | export
400 | ToFFI TreeWalker TreeWalker where toFFI = id
401 |
402 | export
403 | FromFFI TreeWalker TreeWalker where fromFFI = Just
404 |
405 | export
406 | SafeCast TreeWalker where
407 |   safeCast = unsafeCastOnPrototypeName "TreeWalker"
408 |
409 | export data XMLDocument : Type where [external]
410 |
411 | export
412 | ToFFI XMLDocument XMLDocument where toFFI = id
413 |
414 | export
415 | FromFFI XMLDocument XMLDocument where fromFFI = Just
416 |
417 | export
418 | SafeCast XMLDocument where
419 |   safeCast = unsafeCastOnPrototypeName "XMLDocument"
420 |
421 | export data XMLSerializer : Type where [external]
422 |
423 | export
424 | ToFFI XMLSerializer XMLSerializer where toFFI = id
425 |
426 | export
427 | FromFFI XMLSerializer XMLSerializer where fromFFI = Just
428 |
429 | export
430 | SafeCast XMLSerializer where
431 |   safeCast = unsafeCastOnPrototypeName "XMLSerializer"
432 |
433 | export data XPathEvaluator : Type where [external]
434 |
435 | export
436 | ToFFI XPathEvaluator XPathEvaluator where toFFI = id
437 |
438 | export
439 | FromFFI XPathEvaluator XPathEvaluator where fromFFI = Just
440 |
441 | export
442 | SafeCast XPathEvaluator where
443 |   safeCast = unsafeCastOnPrototypeName "XPathEvaluator"
444 |
445 | export data XPathExpression : Type where [external]
446 |
447 | export
448 | ToFFI XPathExpression XPathExpression where toFFI = id
449 |
450 | export
451 | FromFFI XPathExpression XPathExpression where fromFFI = Just
452 |
453 | export
454 | SafeCast XPathExpression where
455 |   safeCast = unsafeCastOnPrototypeName "XPathExpression"
456 |
457 | export data XPathResult : Type where [external]
458 |
459 | export
460 | ToFFI XPathResult XPathResult where toFFI = id
461 |
462 | export
463 | FromFFI XPathResult XPathResult where fromFFI = Just
464 |
465 | export
466 | SafeCast XPathResult where
467 |   safeCast = unsafeCastOnPrototypeName "XPathResult"
468 |
469 |
470 | --------------------------------------------------------------------------------
471 | --          Dictionaries
472 | --------------------------------------------------------------------------------
473 |
474 | export data AddEventListenerOptions : Type where [external]
475 |
476 | export
477 | ToFFI AddEventListenerOptions AddEventListenerOptions where toFFI = id
478 |
479 | export
480 | FromFFI AddEventListenerOptions AddEventListenerOptions where fromFFI = Just
481 |
482 | export data CustomEventInit : Type where [external]
483 |
484 | export
485 | ToFFI CustomEventInit CustomEventInit where toFFI = id
486 |
487 | export
488 | FromFFI CustomEventInit CustomEventInit where fromFFI = Just
489 |
490 | export data ElementCreationOptions : Type where [external]
491 |
492 | export
493 | ToFFI ElementCreationOptions ElementCreationOptions where toFFI = id
494 |
495 | export
496 | FromFFI ElementCreationOptions ElementCreationOptions where fromFFI = Just
497 |
498 | export data EventInit : Type where [external]
499 |
500 | export
501 | ToFFI EventInit EventInit where toFFI = id
502 |
503 | export
504 | FromFFI EventInit EventInit where fromFFI = Just
505 |
506 | export data EventListenerOptions : Type where [external]
507 |
508 | export
509 | ToFFI EventListenerOptions EventListenerOptions where toFFI = id
510 |
511 | export
512 | FromFFI EventListenerOptions EventListenerOptions where fromFFI = Just
513 |
514 | export data GetRootNodeOptions : Type where [external]
515 |
516 | export
517 | ToFFI GetRootNodeOptions GetRootNodeOptions where toFFI = id
518 |
519 | export
520 | FromFFI GetRootNodeOptions GetRootNodeOptions where fromFFI = Just
521 |
522 | export data MutationObserverInit : Type where [external]
523 |
524 | export
525 | ToFFI MutationObserverInit MutationObserverInit where toFFI = id
526 |
527 | export
528 | FromFFI MutationObserverInit MutationObserverInit where fromFFI = Just
529 |
530 | export data ShadowRootInit : Type where [external]
531 |
532 | export
533 | ToFFI ShadowRootInit ShadowRootInit where toFFI = id
534 |
535 | export
536 | FromFFI ShadowRootInit ShadowRootInit where fromFFI = Just
537 |
538 | export data StaticRangeInit : Type where [external]
539 |
540 | export
541 | ToFFI StaticRangeInit StaticRangeInit where toFFI = id
542 |
543 | export
544 | FromFFI StaticRangeInit StaticRangeInit where fromFFI = Just
545 |
546 |
547 | --------------------------------------------------------------------------------
548 | --          Mixins
549 | --------------------------------------------------------------------------------
550 |
551 | export data ChildNode : Type where [external]
552 |
553 | export
554 | ToFFI ChildNode ChildNode where toFFI = id
555 |
556 | export
557 | FromFFI ChildNode ChildNode where fromFFI = Just
558 |
559 | export data DocumentOrShadowRoot : Type where [external]
560 |
561 | export
562 | ToFFI DocumentOrShadowRoot DocumentOrShadowRoot where toFFI = id
563 |
564 | export
565 | FromFFI DocumentOrShadowRoot DocumentOrShadowRoot where fromFFI = Just
566 |
567 | export data InnerHTML : Type where [external]
568 |
569 | export
570 | ToFFI InnerHTML InnerHTML where toFFI = id
571 |
572 | export
573 | FromFFI InnerHTML InnerHTML where fromFFI = Just
574 |
575 | export data NonDocumentTypeChildNode : Type where [external]
576 |
577 | export
578 | ToFFI NonDocumentTypeChildNode NonDocumentTypeChildNode where toFFI = id
579 |
580 | export
581 | FromFFI NonDocumentTypeChildNode NonDocumentTypeChildNode where fromFFI = Just
582 |
583 | export data NonElementParentNode : Type where [external]
584 |
585 | export
586 | ToFFI NonElementParentNode NonElementParentNode where toFFI = id
587 |
588 | export
589 | FromFFI NonElementParentNode NonElementParentNode where fromFFI = Just
590 |
591 | export data ParentNode : Type where [external]
592 |
593 | export
594 | ToFFI ParentNode ParentNode where toFFI = id
595 |
596 | export
597 | FromFFI ParentNode ParentNode where fromFFI = Just
598 |
599 | export data Slottable : Type where [external]
600 |
601 | export
602 | ToFFI Slottable Slottable where toFFI = id
603 |
604 | export
605 | FromFFI Slottable Slottable where fromFFI = Just
606 |
607 | export data XPathEvaluatorBase : Type where [external]
608 |
609 | export
610 | ToFFI XPathEvaluatorBase XPathEvaluatorBase where toFFI = id
611 |
612 | export
613 | FromFFI XPathEvaluatorBase XPathEvaluatorBase where fromFFI = Just
614 |
615 |
616 | --------------------------------------------------------------------------------
617 | --          Callbacks
618 | --------------------------------------------------------------------------------
619 |
620 | export data EventListener : Type where [external]
621 |
622 | export
623 | ToFFI EventListener EventListener where toFFI = id
624 |
625 | export
626 | FromFFI EventListener EventListener where fromFFI = Just
627 |
628 | export data MutationCallback : Type where [external]
629 |
630 | export
631 | ToFFI MutationCallback MutationCallback where toFFI = id
632 |
633 | export
634 | FromFFI MutationCallback MutationCallback where fromFFI = Just
635 |
636 | export data NodeFilter : Type where [external]
637 |
638 | export
639 | ToFFI NodeFilter NodeFilter where toFFI = id
640 |
641 | export
642 | FromFFI NodeFilter NodeFilter where fromFFI = Just
643 |
644 | export data XPathNSResolver : Type where [external]
645 |
646 | export
647 | ToFFI XPathNSResolver XPathNSResolver where toFFI = id
648 |
649 | export
650 | FromFFI XPathNSResolver XPathNSResolver where fromFFI = Just
651 |