/
Indexed.purs
646 lines (522 loc) · 12.8 KB
/
Indexed.purs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
module DOM.HTML.Indexed where
import DOM.HTML.Indexed.AutocompleteType (AutocompleteType)
import DOM.HTML.Indexed.ButtonType (ButtonType)
import DOM.HTML.Indexed.CrossOriginValue (CrossOriginValue)
import DOM.HTML.Indexed.DirValue (DirValue)
import DOM.HTML.Indexed.FormMethod (FormMethod)
import DOM.HTML.Indexed.InputAcceptType (InputAcceptType)
import DOM.HTML.Indexed.InputType (InputType)
import DOM.HTML.Indexed.KindValue (KindValue)
import DOM.HTML.Indexed.MenuType (MenuType)
import DOM.HTML.Indexed.MenuitemType (MenuitemType)
import DOM.HTML.Indexed.OrderedListType (OrderedListType)
import DOM.HTML.Indexed.PreloadValue (PreloadValue)
import DOM.HTML.Indexed.ScopeValue (ScopeValue)
import DOM.HTML.Indexed.StepValue (StepValue)
import DOM.HTML.Indexed.WrapValue (WrapValue)
import Data.DateTime (DateTime)
import Data.MediaType (MediaType)
import Web.Clipboard.ClipboardEvent (ClipboardEvent)
import Web.Event.Event (Event)
import Web.HTML.Event.DragEvent (DragEvent)
import Web.TouchEvent (TouchEvent)
import Web.UIEvent.FocusEvent (FocusEvent)
import Web.UIEvent.KeyboardEvent (KeyboardEvent)
import Web.UIEvent.MouseEvent (MouseEvent)
import Web.PointerEvent (PointerEvent)
import Web.UIEvent.WheelEvent (WheelEvent)
type CSSPixel = Int
type GlobalAttributes r =
( id :: String
, title :: String
, class :: String
, style :: String
, spellcheck :: Boolean
, draggable :: Boolean
, lang :: String
, dir :: DirValue
, hidden :: Boolean
, tabIndex :: Int
, accessKey :: String
, contentEditable :: Boolean
| r
)
type GlobalEvents r =
( onContextMenu :: Event
, onInput :: Event
| r
)
type MouseEvents r =
( onDoubleClick :: MouseEvent
, onClick :: MouseEvent
, onAuxClick :: MouseEvent
, onMouseDown :: MouseEvent
, onMouseEnter :: MouseEvent
, onMouseLeave :: MouseEvent
, onMouseMove :: MouseEvent
, onMouseOver :: MouseEvent
, onMouseOut :: MouseEvent
, onMouseUp :: MouseEvent
| r
)
type DragEvents r =
( onDrag :: DragEvent
, onDragEnd :: DragEvent
, onDragExit :: DragEvent
, onDragEnter :: DragEvent
, onDragLeave :: DragEvent
, onDragOver :: DragEvent
, onDragStart :: DragEvent
, onDrop :: DragEvent
| r
)
type TouchEvents r =
( onTouchCancel :: TouchEvent
, onTouchEnd :: TouchEvent
, onTouchEnter :: TouchEvent
, onTouchLeave :: TouchEvent
, onTouchMove :: TouchEvent
, onTouchStart :: TouchEvent
| r
)
type PointerEvents r =
( onPointerOver :: PointerEvent
, onPointerEnter :: PointerEvent
, onPointerDown :: PointerEvent
, onPointerMove :: PointerEvent
, onPointerUp :: PointerEvent
, onPointerCancel :: PointerEvent
, onPointerOut :: PointerEvent
, onPointerLeave :: PointerEvent
, onGotPointerCapture :: PointerEvent
, onLostPointerCapture :: PointerEvent
| r
)
type KeyEvents r =
( onKeyDown :: KeyboardEvent
, onKeyUp :: KeyboardEvent
, onKeyPress :: KeyboardEvent
| r
)
type TransitionEvents r =
( onTransitionEnd :: Event
| r
)
type FocusEvents r =
( onBlur :: FocusEvent
, onFocus :: FocusEvent
, onFocusIn :: FocusEvent
, onFocusOut :: FocusEvent
| r
)
type ClipboardEvents r =
( onCopy :: ClipboardEvent
, onCut :: ClipboardEvent
, onPaste :: ClipboardEvent
| r
)
type InteractiveEvents r = ClipboardEvents (FocusEvents (TransitionEvents (KeyEvents (PointerEvents (TouchEvents (DragEvents (MouseEvents (onWheel :: WheelEvent | r))))))))
type GlobalProperties r = GlobalAttributes (GlobalEvents r)
type Interactive r = InteractiveEvents (GlobalProperties r)
type Noninteractive r = GlobalProperties r
type HTMLa = Interactive
( download :: String
, href :: String
, hrefLang :: String
, rel :: String
, target :: String
, type :: MediaType
)
type HTMLabbr = Interactive ()
type HTMLaddress = Interactive (onScroll :: Event)
type HTMLarea = Interactive
( coords :: String
, download :: String
, href :: String
, hrefLang :: String
, media :: String
, rel :: String
, shape :: String
, target :: String
, type :: MediaType
)
type HTMLarticle = Interactive ()
type HTMLaside = Interactive ()
type HTMLaudio = Interactive
( autoplay :: Boolean
, controls :: Boolean
, loop :: Boolean
, muted :: Boolean
, preload :: PreloadValue
, src :: String
, onError :: Event
)
type HTMLb = Interactive ()
type HTMLbase = Noninteractive
( href :: String
, target :: String
)
type HTMLbdi = Interactive ()
type HTMLbdo = Noninteractive ()
type HTMLblockquote = Interactive
( cite :: String
, onScroll :: Event
)
type HTMLbody = Interactive
( onBeforeUnload :: Event
, onHashChange :: Event
, onLoad :: Event
, onPageShow :: Event
, onPageHide :: Event
, onResize :: Event
, onScroll :: Event
, onUnload :: Event
)
type HTMLbr = Noninteractive ()
type HTMLbutton = Interactive
( autofocus :: Boolean
, disabled :: Boolean
, form :: String
, formAction :: String
, formEncType :: MediaType
, formMethod :: FormMethod
, formNoValidate :: Boolean
, formTarget :: String
, name :: String
, type :: ButtonType
, value :: String
)
type HTMLcanvas = Interactive
( width :: CSSPixel
, height :: CSSPixel
)
type HTMLcaption = Interactive (onScroll :: Event)
type HTMLcite = Interactive ()
type HTMLcode = Interactive ()
type HTMLcol = Interactive ()
type HTMLcolgroup = Interactive (span :: Int)
type HTMLcommand = Interactive ()
type HTMLdatalist = Interactive ()
type HTMLdd = Interactive (onScroll :: Event)
type HTMLdel = Interactive
( cite :: String
, datetime :: String
)
type HTMLdetails = Interactive (open :: Boolean)
type HTMLdfn = Interactive ()
type HTMLdialog = Interactive (open :: Boolean)
type HTMLdiv = Interactive (onScroll :: Event)
type HTMLdl = Interactive (onScroll :: Event)
type HTMLdt = Interactive (onScroll :: Event)
type HTMLem = Interactive ()
type HTMLembed = Interactive
( height :: CSSPixel
, src :: String
, type :: MediaType
, width :: CSSPixel
)
type HTMLfieldset = Interactive
( disabled :: Boolean
, form :: String
, name :: String
, onScroll :: Event
)
type HTMLfigcaption = Interactive ()
type HTMLfigure = Interactive ()
type HTMLfooter = Interactive ()
type HTMLform = Interactive
( acceptCharset :: String
, action :: String
, autocomplete :: AutocompleteType
, enctype :: MediaType
, method :: FormMethod
, name :: String
, noValidate :: Boolean
, onReset :: Event
, onScroll :: Event
, onSubmit :: Event
, target :: String
)
type HTMLh1 = Interactive (onScroll :: Event)
type HTMLh2 = Interactive (onScroll :: Event)
type HTMLh3 = Interactive (onScroll :: Event)
type HTMLh4 = Interactive (onScroll :: Event)
type HTMLh5 = Interactive (onScroll :: Event)
type HTMLh6 = Interactive (onScroll :: Event)
type HTMLhead = Noninteractive ()
type HTMLheader = Interactive ()
type HTMLhr = Interactive ()
type HTMLhtml = Interactive
( manifest :: String
, onScroll :: Event
, xmlns :: String
)
type HTMLi = Interactive ()
type HTMLiframe = Noninteractive
( height :: CSSPixel
, name :: String
, onLoad :: Event
, sandbox :: String
, src :: String
, srcDoc :: String
, width :: CSSPixel
)
type HTMLimg = Interactive
( alt :: String
, crossOrigin :: CrossOriginValue
, height :: CSSPixel
, isMap :: Boolean
, longDesc :: String
, onAbort :: Event
, onError :: Event
, onLoad :: Event
, src :: String
, useMap :: String
, width :: CSSPixel
)
type HTMLinput = Interactive
( accept :: InputAcceptType
, autocomplete :: AutocompleteType
, autofocus :: Boolean
, checked :: Boolean
, disabled :: Boolean
, form :: String
, formAction :: String
, formEncType :: MediaType
, formMethod :: FormMethod
, formNoValidate :: Boolean
, formTarget :: String
, height :: CSSPixel
, list :: String
, max :: Number
, min :: Number
, maxLength :: Int
, minLength :: Int
, multiple :: Boolean
, name :: String
, onAbort :: Event
, onChange :: Event
, onError :: Event
, onInvalid :: Event
, onLoad :: Event
, onSearch :: Event
, onSelect :: Event
, pattern :: String
, placeholder :: String
, readOnly :: Boolean
, required :: Boolean
, size :: Int
, src :: String
, step :: StepValue
, type :: InputType
, value :: String
, width :: CSSPixel
)
type HTMLins = Interactive
( cite :: String
, datetime :: DateTime
)
type HTMLkbd = Interactive ()
type HTMLlabel = Interactive
( for :: String
, form :: String
)
type HTMLlegend = Interactive ()
type HTMLli = Interactive
( value :: Int
, onScroll :: Event
)
type HTMLlink = Noninteractive
( crossOrigin :: CrossOriginValue
, href :: String
, hreflang :: String
, media :: String
, onLoad :: Event
, rel :: String
, sizes :: String
, type :: MediaType
)
type HTMLmain = Interactive ()
type HTMLmap = Interactive (name :: String)
type HTMLmark = Interactive ()
type HTMLmenu = Interactive
( label :: String
, onScroll :: Event
, type :: MenuType
)
type HTMLmenuitem = Interactive
( checked :: Boolean
, command :: String
, default :: Boolean
, disabled :: Boolean
, icon :: String
, label :: String
, radioGroup :: String
, type :: MenuitemType
)
type HTMLmeta = Noninteractive
( charset :: String
, content :: String
, httpEquiv :: String
, name :: String
)
type HTMLmeter = Interactive
( form :: String
, high :: Number
, low :: Number
, max :: Number
, min :: Number
, optimum :: Number
, value :: Number
)
type HTMLnav = Interactive ()
type HTMLnoscript = Interactive ()
type HTMLobject = Interactive
( data :: String
, form :: String
, height :: CSSPixel
, name :: String
, onError :: Event
, onScroll :: Event
, type :: MediaType
, useMap :: String
, width :: CSSPixel
)
type HTMLol = Interactive
( onScroll :: Event
, reversed :: Boolean
, start :: Int
, type :: OrderedListType
)
type HTMLoptgroup = Interactive
( disabled :: Boolean
, label :: String
)
type HTMLoption = Interactive
( disabled :: Boolean
, label :: String
, selected :: Boolean
, value :: String
)
type HTMLoutput = Interactive
( for :: String
, form :: String
, name :: String
)
type HTMLp = Interactive (onScroll :: Event)
type HTMLparam = Noninteractive
( name :: String
, value :: String
)
type HTMLpre = Interactive (onScroll :: Event)
type HTMLprogress = Interactive
( max :: Number
, value :: Number
)
type HTMLq = Interactive (cite :: String)
type HTMLrp = Interactive ()
type HTMLrt = Interactive ()
type HTMLruby = Interactive ()
type HTMLsamp = Interactive ()
type HTMLscript = Noninteractive
( async :: Boolean
, charset :: String
, defer :: Boolean
, onError :: Event
, onLoad :: Event
, src :: String
, type :: MediaType
)
type HTMLsection = Interactive ()
type HTMLselect = Interactive
( autofocus :: Boolean
, disabled :: Boolean
, form :: String
, multiple :: Boolean
, name :: String
, onChange :: Event
, onScroll :: Event
, required :: Boolean
, selectedIndex :: Int
, size :: Int
, value :: String
)
type HTMLsmall = Interactive ()
type HTMLsource = Interactive
( media :: String
, src :: String
, type :: MediaType
)
type HTMLspan = Interactive ()
type HTMLstrong = Interactive ()
type HTMLstyle = Noninteractive
( media :: String
, onError :: Event
, onLoad :: Event
, scoped :: Boolean
, type :: MediaType
)
type HTMLsub = Interactive ()
type HTMLsummary = Interactive ()
type HTMLsup = Interactive ()
type HTMLtable = Interactive (sortable :: Boolean)
type HTMLtbody = Interactive (onScroll :: Event)
type HTMLtd = Interactive
( colSpan :: Int
, headers :: String
, rowSpan :: Int
)
type HTMLtextarea = Interactive
( autofocus :: Boolean
, cols :: Int
, disabled :: Boolean
, form :: String
, maxLength :: Int
, name :: String
, onChange :: Event
, onScroll :: Event
, onSelect :: Event
, placeholder :: String
, readOnly :: Boolean
, required :: Boolean
, rows :: Int
, value :: String
, wrap :: WrapValue
)
type HTMLtfoot = Interactive (onScroll :: Event)
type HTMLth = Interactive
( abbr :: String
, colSpan :: Int
, headers :: String
, rowSpan :: Int
, scope :: ScopeValue
, sorted :: Boolean
)
type HTMLthead = Interactive ()
type HTMLtime = Interactive (datetime :: DateTime)
type HTMLtitle = Noninteractive ()
type HTMLtr = Interactive ()
type HTMLtrack = Interactive
( default :: Boolean
, kind :: KindValue
, label :: String
, src :: String
, srcLang :: String
)
type HTMLu = Interactive ()
type HTMLul = Interactive (onScroll :: Event)
type HTMLvar = Interactive ()
type HTMLvideo = Interactive
( autoplay :: Boolean
, controls :: Boolean
, height :: CSSPixel
, loop :: Boolean
, muted :: Boolean
, poster :: String
, preload :: PreloadValue
, src :: String
, width :: CSSPixel
, type :: MediaType
, onError :: Event
)
type HTMLwbr = Interactive ()