123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203(* Adapted from reason-react ReactEvent.re, commit 0f73a307 *)type'asynthetic=Ojs.tmoduleCommonApi=structinclude[%js:typetag=Ojs.ttypet=Ojs.tvalt_of_js:Ojs.t->tvalt_to_js:t->Ojs.tvalbubbles:Ojs.t->bool[@@js.get"bubbles"]valcancelable:t->bool[@@js.get"cancelable"]valcurrent_target:t->Ojs.t[@@js.get"currentTarget"](* Should return Dom.eventTarget *)valdefault_prevented:t->bool[@@js.get"defaultPrevented"]valevent_phase:t->int[@@js.get"eventPhase"]valis_trusted:t->bool[@@js.get"isTrusted"]valnative_event:t->Ojs.t[@@js.get"nativeEvent"](* Should return Dom.event *)valprevent_default:t->unit[@@js.call"preventDefault"]valis_default_prevented:t->bool[@@js.call"isDefaultPrevented"]valstop_propagation:t->unit[@@js.call"stopPropagation"]valis_propagation_stopped:t->bool[@@js.call"isPropagationStopped"]valtarget:t->Ojs.t[@@js.get"target"](* Should return Dom.eventTarget *)valtime_stamp:t->float[@@js.get"timeStamp"]valtype_:t->string[@@js.get"type"]valpersist:t->unit[@@js.call"persist"]]endmoduleSynthetic=CommonApi(* Cast any event type to the general synthetic type. This is safe, since synthetic is more general *)externalto_synthetic_event:'asynthetic->Synthetic.t="%identity"moduleClipboard=structincludeCommonApiinclude[%js:valclipboard_data:t->Ojs.t[@@js.get"clipboardData"]](* Should return Dom.dataTransfer *)endmoduleComposition=structincludeCommonApiinclude[%js:valdata:t->string[@@js.get"data"]]endmoduleKeyboard=structincludeCommonApiinclude[%js:valalt_key:t->bool[@@js.get"altKey"]valchar_code:t->int[@@js.get"charCode"]valctrl_key:t->bool[@@js.get"ctrlKey"]valget_modifier_state:t->string->bool[@@js.call"getModifierState"]valkey:t->string[@@js.get"key"]valkey_code:t->int[@@js.get"keyCode"]vallocale:t->string[@@js.get"locale"]vallocation:t->int[@@js.get"location"]valmeta_key:t->bool[@@js.get"metaKey"]valrepeat:t->bool[@@js.get"repeat"]valshift_key:t->bool[@@js.get"shiftKey"]valwhich:t->int[@@js.get"which"]]endmoduleFocus=structincludeCommonApiinclude[%js:valrelated_target:t->Ojs.toption[@@js.get"relatedTarget"]](* Should return Dom.eventTarget *)endmoduleForm=structincludeCommonApiendmoduleMouse=structincludeCommonApiinclude[%js:valalt_key:t->bool[@@js.get"altKey"]valbutton:t->int[@@js.get"button"]valbuttons:t->int[@@js.get"buttons"]valclient_x:t->int[@@js.get"clientX"]valclient_y:t->int[@@js.get"clientY"]valctrl_key:t->bool[@@js.get"ctrlKey"]valget_modifier_state:t->string->bool[@@js.call"getModifierState"]valmeta_key:t->bool[@@js.get"metaKey"]valpage_x:t->int[@@js.get"pageX"]valpage_y:t->int[@@js.get"pageY"]valrelated_target:t->Ojs.toption[@@js.get"relatedTarget"](* Should return Dom.eventTarget *)valscreen_x:t->int[@@js.get"screenX"]valscreen_y:t->int[@@js.get"screenY"]valshift_key:t->bool[@@js.get"shiftKey"]]endmoduleSelection=structincludeCommonApiendmoduleTouch=structincludeCommonApiinclude[%js:valalt_key:t->bool[@@js.get"altKey"]valchanged_touches:t->Ojs.t[@@js.get"changedTouches"](* Should return Dom.touchList *)valctrl_key:t->bool[@@js.get"ctrlKey"]valget_modifier_state:t->string->bool[@@js.call"getModifierState"]valmeta_key:t->bool[@@js.get"metaKey"]valshift_key:t->bool[@@js.get"shiftKey"]valtarget_touches:t->Ojs.t[@@js.get"targetTouches"](* Should return Dom.touchList *)valtouches:t->Ojs.t[@@js.get"touches"]](* Should return Dom.touchList *)endmodulePointer=structincludeMouseinclude[%js:valpointerId:t->int[@@js.get]valpressure:t->float[@@js.get]valtangentialPressure:t->float[@@js.get]valtiltX:t->float[@@js.get]valtiltY:t->float[@@js.get]valtwist:t->float[@@js.get]valwidth:t->float[@@js.get]valheight:t->float[@@js.get]valpointerType:t->string[@@js.get]valisPrimary:t->bool[@@js.get]]endtypewindow=Js_of_ocaml.Dom_html.windowmoduleUI=structexternalwindow_of_js:Ojs.t->Js_of_ocaml.Dom_html.window="%identity"includeCommonApiinclude[%js:valdetail:t->int[@@js.get"detail"]valview:t->window[@@js.get"view"]](* Should return DOMAbstractView/WindowProxy *)endmoduleWheel=structincludeCommonApiinclude[%js:valdelta_mode:t->int[@@js.get"deltaMode"]valdelta_x:t->float[@@js.get"deltaX"]valdelta_y:t->float[@@js.get"deltaY"]valdelta_z:t->float[@@js.get"deltaZ"]]endmoduleMedia=structincludeCommonApiendmoduleImage=structincludeCommonApiendmoduleAnimation=structincludeCommonApiinclude[%js:valanimation_name:t->string[@@js.get"animationName"]valpseudo_element:t->string[@@js.get"pseudoElement"]valelapsed_time:t->float[@@js.get"elapsedTime"]]endmoduleTransition=structincludeCommonApiinclude[%js:valproperty_name:t->string[@@js.get"propertyName"]valpseudo_element:t->string[@@js.get"pseudoElement"]valelapsed_time:t->float[@@js.get"elapsedTime"]]end