- Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathdom.nim
1843 lines (1663 loc) · 54.7 KB
/
dom.nim
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
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#
#
# Nim's Runtime Library
# (c) Copyright 2012 Andreas Rumpf
#
# See the file "copying.txt", included in this
# distribution, for details about the copyright.
#
## Declaration of the Document Object Model for the `JavaScript backend
## <backends.html#backends-the-javascript-target>`_.
##
##
## Document Ready
## --------------
##
## * Basic example of a document ready:
runnableExamples"-b:js -r:off":
procexample(e: Event) =echo"Document is ready"
document.addEventListener("DOMContentLoaded", example) # You can also use "load" event.
## * This example runs 5 seconds after the document ready:
runnableExamples"-b:js -r:off":
procexample() =echo"5 seconds after document ready"
procdomReady(e: Event) =discardsetTimeout(example, 5_000) # Document is ready.
document.addEventListener("DOMContentLoaded", domReady)
## Document onUnload
## -----------------
##
## * Simple example of how to implement code that runs when the page unloads:
runnableExamples"-b:js -r:off":
procexample(e: Event) =echo"Document is unloaded"
document.addEventListener("unload", example) # You can also use "beforeunload".
## Document Autorefresh
## --------------------
##
## * Minimal example of a document autorefresh:
runnableExamples"-b:js -r:off":
procexample() = window.location.reload()
discardsetTimeout(example, 5_000)
## - For more examples, see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
import std/private/since
whennotdefined(js):
{.error: "This module only works on the JavaScript platform".}
const
DomApiVersion*=3## the version of DOM API we try to follow. No guarantees though.
type
EventTarget* {.importc.} =refobjectofRootObj
onabort*: proc (event: Event) {.closure.}
onblur*: proc (event: Event) {.closure.}
onchange*: proc (event: Event) {.closure.}
onclick*: proc (event: Event) {.closure.}
ondblclick*: proc (event: Event) {.closure.}
onerror*: proc (event: Event) {.closure.}
onfocus*: proc (event: Event) {.closure.}
onkeydown*: proc (event: Event) {.closure.}
onkeypress*: proc (event: Event) {.closure.}
onkeyup*: proc (event: Event) {.closure.}
onload*: proc (event: Event) {.closure.}
onmousedown*: proc (event: Event) {.closure.}
onmousemove*: proc (event: Event) {.closure.}
onmouseout*: proc (event: Event) {.closure.}
onmouseover*: proc (event: Event) {.closure.}
onmouseup*: proc (event: Event) {.closure.}
onreset*: proc (event: Event) {.closure.}
onselect*: proc (event: Event) {.closure.}
onstorage*: proc (event: Event) {.closure.}
onsubmit*: proc (event: Event) {.closure.}
onunload*: proc (event: Event) {.closure.}
onloadstart*: proc (event: Event) {.closure.}
onprogress*: proc (event: Event) {.closure.}
onloadend*: proc (event: Event) {.closure.}
DomEvent* {.pure.} =enum
## see `docs<https://developer.mozilla.org/en-US/docs/Web/Events>`_
Abort="abort",
BeforeInput="beforeinput",
Blur="blur",
Click="click",
CompositionEnd="compositionend",
CompositionStart="compositionstart",
CompositionUpdate="compositionupdate",
DblClick="dblclick",
Error="error",
Focus="focus",
FocusIn="focusin",
FocusOut="focusout",
Input="input",
KeyDown="keydown",
KeyPress="keypress",
KeyUp="keyup",
Load="load",
MouseDown="mousedown",
MouseEnter="mouseenter",
MouseLeave="mouseleave",
MouseMove="mousemove",
MouseOut="mouseout",
MouseOver="mouseover",
MouseUp="mouseup",
Resize="resize",
Scroll="scroll",
Select="select",
Storage="storage",
Unload="unload",
Wheel="wheel"
PerformanceMemory* {.importc.} =refobject
jsHeapSizeLimit*: float
totalJSHeapSize*: float
usedJSHeapSize*: float
PerformanceTiming* {.importc.} =refobject
connectStart*: float
domComplete*: float
domContentLoadedEventEnd*: float
domContentLoadedEventStart*: float
domInteractive*: float
domLoading*: float
domainLookupEnd*: float
domainLookupStart*: float
fetchStart*: float
loadEventEnd*: float
loadEventStart*: float
navigationStart*: float
redirectEnd*: float
redirectStart*: float
requestStart*: float
responseEnd*: float
responseStart*: float
secureConnectionStart*: float
unloadEventEnd*: float
unloadEventStart*: float
Performance* {.importc.} =refobject
memory*: PerformanceMemory
timing*: PerformanceTiming
Range* {.importc.} =refobject
## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/Range>`_
collapsed*: bool
commonAncestorContainer*: Node
endContainer*: Node
endOffset*: int
startContainer*: Node
startOffset*: int
Selection* {.importc.} =refobject
## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/Selection>`_
anchorNode*: Node
anchorOffset*: int
focusNode*: Node
focusOffset*: int
isCollapsed*: bool
rangeCount*: int
`type`*: cstring
Storage* {.importc.} =refobject
Window* {.importc.} =refobjectofEventTarget
document*: Document
event*: Event
history*: History
location*: Location
closed*: bool
defaultStatus*: cstring
devicePixelRatio*: float
innerHeight*, innerWidth*: int
locationbar*: refLocationBar
menubar*: refMenuBar
name*: cstring
outerHeight*, outerWidth*: int
pageXOffset*, pageYOffset*: int
scrollX*: float
scrollY*: float
personalbar*: refPersonalBar
scrollbars*: refScrollBars
statusbar*: refStatusBar
status*: cstring
toolbar*: refToolBar
frames*: seq[Frame]
screen*: Screen
performance*: Performance
onpopstate*: proc (event: Event)
localStorage*: Storage
sessionStorage*: Storage
parent*: Window
Frame* {.importc.} =refobjectofWindow
ClassList* {.importc.} =refobjectofRootObj
NodeType*=enum
ElementNode=1,
AttributeNode,
TextNode,
CDATANode,
EntityRefNode,
EntityNode,
ProcessingInstructionNode,
CommentNode,
DocumentNode,
DocumentTypeNode,
DocumentFragmentNode,
NotationNode
Node* {.importc.} =refobjectofEventTarget
attributes*: seq[Node]
childNodes*: seq[Node]
children*: seq[Node]
data*: cstring
firstChild*: Node
lastChild*: Node
nextSibling*: Node
nodeName*: cstring
nodeType*: NodeType
nodeValue*: cstring
parentNode*: Node
content*: Node
previousSibling*: Node
ownerDocument*: Document
innerHTML*: cstring
outerHTML*: cstring
innerText*: cstring
textContent*: cstring
style*: Style
baseURI*: cstring
parentElement*: Element
isConnected*: bool
Document* {.importc.} =refobjectofNode
activeElement*: Element
documentElement*: Element
alinkColor*: cstring
bgColor*: cstring
body*: Element
charset*: cstring
cookie*: cstring
defaultCharset*: cstring
fgColor*: cstring
head*: Element
hidden*: bool
lastModified*: cstring
linkColor*: cstring
referrer*: cstring
title*: cstring
URL*: cstring
visibilityState*: cstring
vlinkColor*: cstring
anchors*: seq[AnchorElement]
forms*: seq[FormElement]
images*: seq[ImageElement]
applets*: seq[Element]
embeds*: seq[EmbedElement]
links*: seq[LinkElement]
fonts*: FontFaceSet
Element* {.importc.} =refobjectofNode
className*: cstring
classList*: ClassList
checked*: bool
defaultChecked*: bool
defaultValue*: cstring
disabled*: bool
form*: FormElement
name*: cstring
readOnly*: bool
options*: seq[OptionElement]
selectedOptions*: seq[OptionElement]
clientWidth*, clientHeight*: int
contentEditable*: cstring
isContentEditable*: bool
dir*: cstring
offsetHeight*: int
offsetWidth*: int
offsetLeft*: int
offsetTop*: int
ValidityState* {.importc.} =refobject## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/ValidityState>`_
badInput*: bool
customError*: bool
patternMismatch*: bool
rangeOverflow*: bool
rangeUnderflow*: bool
stepMismatch*: bool
tooLong*: bool
tooShort*: bool
typeMismatch*: bool
valid*: bool
valueMissing*: bool
Blob* {.importc.} =refobjectofRootObj## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/Blob>`_
size*: int
`type`*: cstring
File* {.importc.} =refobjectofBlob## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/File>`_
lastModified*: int
name*: cstring
TextAreaElement* {.importc.} =refobjectofElement## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement>`_
value*: cstring
selectionStart*, selectionEnd*: int
selectionDirection*: cstring
rows*, cols*: int
InputElement* {.importc.} =refobjectofElement## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement>`_
# Properties related to the parent form
formAction*: cstring
formEncType*: cstring
formMethod*: cstring
formNoValidate*: bool
formTarget*: cstring
# Properties that apply to any type of input element that is not hidden
`type`*: cstring
autofocus*: bool
required*: bool
value*: cstring
validity*: ValidityState
validationMessage*: cstring
willValidate*: bool
# Properties that apply only to elements of type "checkbox" or "radio"
indeterminate*: bool
# Properties that apply only to elements of type "image"
alt*: cstring
height*: cstring
src*: cstring
width*: cstring
# Properties that apply only to elements of type "file"
accept*: cstring
files*: seq[Blob]
# Properties that apply only to text/number-containing or elements
autocomplete*: cstring
maxLength*: int
size*: int
pattern*: cstring
placeholder*: cstring
min*: cstring
max*: cstring
selectionStart*: int
selectionEnd*: int
selectionDirection*: cstring
# Properties not yet categorized
dirName*: cstring
accessKey*: cstring
list*: Element
multiple*: bool
labels*: seq[Element]
step*: cstring
valueAsDate*: cstring
valueAsNumber*: float
LinkElement* {.importc.} =refobjectofElement
target*: cstring
text*: cstring
x*: int
y*: int
EmbedElement* {.importc.} =refobjectofElement
height*: int
hspace*: int
src*: cstring
width*: int
`type`*: cstring
vspace*: int
AnchorElement* {.importc.} =refobjectofElement
text*: cstring
x*, y*: int
OptionElement* {.importc.} =refobjectofElement
defaultSelected*: bool
selected*: bool
selectedIndex*: int
text*: cstring
value*: cstring
FormElement* {.importc.} =refobjectofElement## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement>`_
acceptCharset*: cstring
action*: cstring
autocomplete*: cstring
elements*: seq[Element]
encoding*: cstring
enctype*: cstring
length*: int
`method`*: cstring
noValidate*: bool
target*: cstring
ImageElement* {.importc.} =refobjectofElement
border*: int
complete*: bool
height*: int
hspace*: int
lowsrc*: cstring
src*: cstring
vspace*: int
width*: int
Style* {.importc.} =refobjectofRootObj
alignContent*: cstring
alignItems*: cstring
alignSelf*: cstring
all*: cstring
animation*: cstring
animationDelay*: cstring
animationDirection*: cstring
animationDuration*: cstring
animationFillMode*: cstring
animationIterationCount*: cstring
animationName*: cstring
animationPlayState*: cstring
animationTimingFunction*: cstring
backdropFilter*: cstring
backfaceVisibility*: cstring
background*: cstring
backgroundAttachment*: cstring
backgroundBlendMode*: cstring
backgroundClip*: cstring
backgroundColor*: cstring
backgroundImage*: cstring
backgroundOrigin*: cstring
backgroundPosition*: cstring
backgroundRepeat*: cstring
backgroundSize*: cstring
blockSize*: cstring
border*: cstring
borderBlock*: cstring
borderBlockColor*: cstring
borderBlockEnd*: cstring
borderBlockEndColor*: cstring
borderBlockEndStyle*: cstring
borderBlockEndWidth*: cstring
borderBlockStart*: cstring
borderBlockStartColor*: cstring
borderBlockStartStyle*: cstring
borderBlockStartWidth*: cstring
borderBlockStyle*: cstring
borderBlockWidth*: cstring
borderBottom*: cstring
borderBottomColor*: cstring
borderBottomLeftRadius*: cstring
borderBottomRightRadius*: cstring
borderBottomStyle*: cstring
borderBottomWidth*: cstring
borderCollapse*: cstring
borderColor*: cstring
borderEndEndRadius*: cstring
borderEndStartRadius*: cstring
borderImage*: cstring
borderImageOutset*: cstring
borderImageRepeat*: cstring
borderImageSlice*: cstring
borderImageSource*: cstring
borderImageWidth*: cstring
borderInline*: cstring
borderInlineColor*: cstring
borderInlineEnd*: cstring
borderInlineEndColor*: cstring
borderInlineEndStyle*: cstring
borderInlineEndWidth*: cstring
borderInlineStart*: cstring
borderInlineStartColor*: cstring
borderInlineStartStyle*: cstring
borderInlineStartWidth*: cstring
borderInlineStyle*: cstring
borderInlineWidth*: cstring
borderLeft*: cstring
borderLeftColor*: cstring
borderLeftStyle*: cstring
borderLeftWidth*: cstring
borderRadius*: cstring
borderRight*: cstring
borderRightColor*: cstring
borderRightStyle*: cstring
borderRightWidth*: cstring
borderSpacing*: cstring
borderStartEndRadius*: cstring
borderStartStartRadius*: cstring
borderStyle*: cstring
borderTop*: cstring
borderTopColor*: cstring
borderTopLeftRadius*: cstring
borderTopRightRadius*: cstring
borderTopStyle*: cstring
borderTopWidth*: cstring
borderWidth*: cstring
bottom*: cstring
boxDecorationBreak*: cstring
boxShadow*: cstring
boxSizing*: cstring
breakAfter*: cstring
breakBefore*: cstring
breakInside*: cstring
captionSide*: cstring
caretColor*: cstring
clear*: cstring
clip*: cstring
clipPath*: cstring
color*: cstring
colorAdjust*: cstring
columnCount*: cstring
columnFill*: cstring
columnGap*: cstring
columnRule*: cstring
columnRuleColor*: cstring
columnRuleStyle*: cstring
columnRuleWidth*: cstring
columnSpan*: cstring
columnWidth*: cstring
columns*: cstring
contain*: cstring
content*: cstring
counterIncrement*: cstring
counterReset*: cstring
counterSet*: cstring
cursor*: cstring
direction*: cstring
display*: cstring
emptyCells*: cstring
filter*: cstring
flex*: cstring
flexBasis*: cstring
flexDirection*: cstring
flexFlow*: cstring
flexGrow*: cstring
flexShrink*: cstring
flexWrap*: cstring
cssFloat*: cstring
font*: cstring
fontFamily*: cstring
fontFeatureSettings*: cstring
fontKerning*: cstring
fontLanguageOverride*: cstring
fontOpticalSizing*: cstring
fontSize*: cstring
fontSizeAdjust*: cstring
fontStretch*: cstring
fontStyle*: cstring
fontSynthesis*: cstring
fontVariant*: cstring
fontVariantAlternates*: cstring
fontVariantCaps*: cstring
fontVariantEastAsian*: cstring
fontVariantLigatures*: cstring
fontVariantNumeric*: cstring
fontVariantPosition*: cstring
fontVariationSettings*: cstring
fontWeight*: cstring
gap*: cstring
grid*: cstring
gridArea*: cstring
gridAutoColumns*: cstring
gridAutoFlow*: cstring
gridAutoRows*: cstring
gridColumn*: cstring
gridColumnEnd*: cstring
gridColumnStart*: cstring
gridRow*: cstring
gridRowEnd*: cstring
gridRowStart*: cstring
gridTemplate*: cstring
gridTemplateAreas*: cstring
gridTemplateColumns*: cstring
gridTemplateRows*: cstring
hangingPunctuation*: cstring
height*: cstring
hyphens*: cstring
imageOrientation*: cstring
imageRendering*: cstring
inlineSize*: cstring
inset*: cstring
insetBlock*: cstring
insetBlockEnd*: cstring
insetBlockStart*: cstring
insetInline*: cstring
insetInlineEnd*: cstring
insetInlineStart*: cstring
isolation*: cstring
justifyContent*: cstring
justifyItems*: cstring
justifySelf*: cstring
left*: cstring
letterSpacing*: cstring
lineBreak*: cstring
lineHeight*: cstring
listStyle*: cstring
listStyleImage*: cstring
listStylePosition*: cstring
listStyleType*: cstring
margin*: cstring
marginBlock*: cstring
marginBlockEnd*: cstring
marginBlockStart*: cstring
marginBottom*: cstring
marginInline*: cstring
marginInlineEnd*: cstring
marginInlineStart*: cstring
marginLeft*: cstring
marginRight*: cstring
marginTop*: cstring
mask*: cstring
maskBorder*: cstring
maskBorderMode*: cstring
maskBorderOutset*: cstring
maskBorderRepeat*: cstring
maskBorderSlice*: cstring
maskBorderSource*: cstring
maskBorderWidth*: cstring
maskClip*: cstring
maskComposite*: cstring
maskImage*: cstring
maskMode*: cstring
maskOrigin*: cstring
maskPosition*: cstring
maskRepeat*: cstring
maskSize*: cstring
maskType*: cstring
maxBlockSize*: cstring
maxHeight*: cstring
maxInlineSize*: cstring
maxWidth*: cstring
minBlockSize*: cstring
minHeight*: cstring
minInlineSize*: cstring
minWidth*: cstring
mixBlendMode*: cstring
objectFit*: cstring
objectPosition*: cstring
offset*: cstring
offsetAnchor*: cstring
offsetDistance*: cstring
offsetPath*: cstring
offsetRotate*: cstring
opacity*: cstring
order*: cstring
orphans*: cstring
outline*: cstring
outlineColor*: cstring
outlineOffset*: cstring
outlineStyle*: cstring
outlineWidth*: cstring
overflow*: cstring
overflowAnchor*: cstring
overflowBlock*: cstring
overflowInline*: cstring
overflowWrap*: cstring
overflowX*: cstring
overflowY*: cstring
overscrollBehavior*: cstring
overscrollBehaviorBlock*: cstring
overscrollBehaviorInline*: cstring
overscrollBehaviorX*: cstring
overscrollBehaviorY*: cstring
padding*: cstring
paddingBlock*: cstring
paddingBlockEnd*: cstring
paddingBlockStart*: cstring
paddingBottom*: cstring
paddingInline*: cstring
paddingInlineEnd*: cstring
paddingInlineStart*: cstring
paddingLeft*: cstring
paddingRight*: cstring
paddingTop*: cstring
pageBreakAfter*: cstring
pageBreakBefore*: cstring
pageBreakInside*: cstring
paintOrder*: cstring
perspective*: cstring
perspectiveOrigin*: cstring
placeContent*: cstring
placeItems*: cstring
placeSelf*: cstring
pointerEvents*: cstring
position*: cstring
quotes*: cstring
resize*: cstring
right*: cstring
rotate*: cstring
rowGap*: cstring
scale*: cstring
scrollBehavior*: cstring
scrollMargin*: cstring
scrollMarginBlock*: cstring
scrollMarginBlockEnd*: cstring
scrollMarginBlockStart*: cstring
scrollMarginBottom*: cstring
scrollMarginInline*: cstring
scrollMarginInlineEnd*: cstring
scrollMarginInlineStart*: cstring
scrollMarginLeft*: cstring
scrollMarginRight*: cstring
scrollMarginTop*: cstring
scrollPadding*: cstring
scrollPaddingBlock*: cstring
scrollPaddingBlockEnd*: cstring
scrollPaddingBlockStart*: cstring
scrollPaddingBottom*: cstring
scrollPaddingInline*: cstring
scrollPaddingInlineEnd*: cstring
scrollPaddingInlineStart*: cstring
scrollPaddingLeft*: cstring
scrollPaddingRight*: cstring
scrollPaddingTop*: cstring
scrollSnapAlign*: cstring
scrollSnapStop*: cstring
scrollSnapType*: cstring
scrollbar3dLightColor*: cstring
scrollbarArrowColor*: cstring
scrollbarBaseColor*: cstring
scrollbarColor*: cstring
scrollbarDarkshadowColor*: cstring
scrollbarFaceColor*: cstring
scrollbarHighlightColor*: cstring
scrollbarShadowColor*: cstring
scrollbarTrackColor*: cstring
scrollbarWidth*: cstring
shapeImageThreshold*: cstring
shapeMargin*: cstring
shapeOutside*: cstring
tabSize*: cstring
tableLayout*: cstring
textAlign*: cstring
textAlignLast*: cstring
textCombineUpright*: cstring
textDecoration*: cstring
textDecorationColor*: cstring
textDecorationLine*: cstring
textDecorationSkipInk*: cstring
textDecorationStyle*: cstring
textDecorationThickness*: cstring
textEmphasis*: cstring
textEmphasisColor*: cstring
textEmphasisPosition*: cstring
textEmphasisStyle*: cstring
textIndent*: cstring
textJustify*: cstring
textOrientation*: cstring
textOverflow*: cstring
textRendering*: cstring
textShadow*: cstring
textTransform*: cstring
textUnderlineOffset*: cstring
textUnderlinePosition*: cstring
top*: cstring
touchAction*: cstring
transform*: cstring
transformBox*: cstring
transformOrigin*: cstring
transformStyle*: cstring
transition*: cstring
transitionDelay*: cstring
transitionDuration*: cstring
transitionProperty*: cstring
transitionTimingFunction*: cstring
translate*: cstring
unicodeBidi*: cstring
verticalAlign*: cstring
visibility*: cstring
whiteSpace*: cstring
widows*: cstring
width*: cstring
willChange*: cstring
wordBreak*: cstring
wordSpacing*: cstring
writingMode*: cstring
zIndex*: cstring
EventPhase*=enum
None=0,
CapturingPhase,
AtTarget,
BubblingPhase
Event* {.importc.} =refobjectofRootObj## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/Event>`_
bubbles*: bool
cancelBubble*: bool
cancelable*: bool
composed*: bool
currentTarget*: Node
defaultPrevented*: bool
eventPhase*: int
target*: Node
`type`*: cstring
isTrusted*: bool
UIEvent* {.importc.} =refobjectofEvent## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/UIEvent>`_
detail*: int64
view*: Window
KeyboardEvent* {.importc.} =refobjectofUIEvent## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent>`_
altKey*, ctrlKey*, metaKey*, shiftKey*: bool
code*: cstring
isComposing*: bool
key*: cstring
keyCode*: int
location*: int
KeyboardEventKey* {.pure.} =enum## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values>`_
# Modifier keys
Alt,
AltGraph,
CapsLock,
Control,
Fn,
FnLock,
Hyper,
Meta,
NumLock,
ScrollLock,
Shift,
Super,
Symbol,
SymbolLock,
# Whitespace keys
ArrowDown,
ArrowLeft,
ArrowRight,
ArrowUp,
End,
Home,
PageDown,
PageUp,
# Editing keys
Backspace,
Clear,
Copy,
CrSel,
Cut,
Delete,
EraseEof,
ExSel,
Insert,
Paste,
Redo,
Undo,
# UI keys
Accept,
Again,
Attn,
Cancel,
ContextMenu,
Escape,
Execute,
Find,
Finish,
Help,
Pause,
Play,
Props,
Select,
ZoomIn,
ZoomOut,
# Device keys
BrigtnessDown,
BrigtnessUp,
Eject,
LogOff,
Power,
PowerOff,
PrintScreen,
Hibernate,
Standby,
WakeUp,
# Common IME keys
AllCandidates,
Alphanumeric,
CodeInput,
Compose,
Convert,
Dead,
FinalMode,
GroupFirst,
GroupLast,
GroupNext,
GroupPrevious,
ModeChange,
NextCandidate,
NonConvert,
PreviousCandidate,
Process,
SingleCandidate,
# Korean keyboards only
HangulMode,
HanjaMode,
JunjaMode,
# Japanese keyboards only
Eisu,
Hankaku,
Hiragana,
HiraganaKatakana,
KanaMode,
KanjiMode,
Katakana,
Romaji,
Zenkaku,
ZenkakuHanaku,
# Function keys
F1,
F2,
F3,
F4,
F5,
F6,
F7,
F8,
F9,
F10,
F11,
F12,
F13,
F14,
F15,
F16,
F17,
F18,
F19,
F20,
Soft1,
Soft2,
Soft3,
Soft4,
# Phone keys
AppSwitch,
Call,
Camera,
CameraFocus,
EndCall,
GoBack,
GoHome,
HeadsetHook,
LastNumberRedial,
Notification,
MannerMode,
VoiceDial,
# Multimedia keys
ChannelDown,
ChannelUp,
MediaFastForward,
MediaPause,
MediaPlay,
MediaPlayPause,
MediaRecord,
MediaRewind,
MediaStop,
MediaTrackNext,
MediaTrackPrevious,
# Audio control keys
AudioBalanceLeft,
AudioBalanceRight,
AudioBassDown,
AudioBassBoostDown,
AudioBassBoostToggle,
AudioBassBoostUp,
AudioBassUp,
AudioFaderFront,
AudioFaderRear,
AudioSurroundModeNext,
AudioTrebleDown,
AudioTrebleUp,
AudioVolumeDown,
AUdioVolumeMute,
AudioVolumeUp,
MicrophoneToggle,
MicrophoneVolumeDown,
MicrophoneVolumeMute,
MicrophoneVolumeUp,
# TV control keys
TV,
TV3DMode,
TVAntennaCable,
TVAudioDescription,
TVAudioDescriptionMixDown,
TVAudioDescriptionMixUp,
TVContentsMenu,
TVDataService,
TVInput,
TVInputComponent1,
TVInputComponent2,
TVInputComposite1,