forked from fable-compiler/fable-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBrowser.Event.fs
More file actions
128 lines (101 loc) · 4.27 KB
/
Browser.Event.fs
File metadata and controls
128 lines (101 loc) · 4.27 KB
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
namespace rec Browser.Types
open System
open Fable.Core
type [<Global;AllowNullLiteral>] Event =
abstract bubbles: bool with get, set
abstract cancelBubble: bool with get, set
abstract cancelable: bool with get, set
abstract currentTarget: EventTarget with get, set
abstract defaultPrevented: bool with get, set
abstract eventPhase: float with get, set
abstract isTrusted: bool with get, set
abstract returnValue: bool with get, set
abstract target: EventTarget with get, set
abstract timeStamp: float with get, set
abstract ``type``: string with get, set
abstract AT_TARGET: float with get, set
abstract BUBBLING_PHASE: float with get, set
abstract CAPTURING_PHASE: float with get, set
abstract initEvent: eventTypeArg: string * canBubbleArg: bool * cancelableArg: bool -> unit
abstract preventDefault: unit -> unit
abstract stopImmediatePropagation: unit -> unit
abstract stopPropagation: unit -> unit
type [<AllowNullLiteral>] EventInit =
abstract bubbles: bool with get, set
abstract cancelable: bool with get, set
abstract composed: bool with get, set
type [<AllowNullLiteral>] EventType =
[<Emit("new $0($1...)")>]
abstract Create: ``type``: string * ?eventInitDict: EventInit -> Event
abstract AT_TARGET: float with get, set
abstract BUBBLING_PHASE: float with get, set
abstract CAPTURING_PHASE: float with get, set
type [<AllowNullLiteral>] AddEventListenerOptions =
abstract capture: bool with get, set
abstract once: bool with get, set
abstract passive: bool with get, set
type [<AllowNullLiteral>] RemoveEventListenerOptions =
abstract capture: bool with get, set
type [<Global;AllowNullLiteral>] EventTarget =
abstract addEventListener: ``type``: string * listener: (Event->unit) -> unit
abstract addEventListener: ``type``: string * listener: (Event->unit) * useCapture: bool -> unit
abstract addEventListener: ``type``: string * listener: (Event->unit) * options: AddEventListenerOptions -> unit
abstract dispatchEvent: evt: Event -> bool
abstract removeEventListener: ``type``: string * listener: (Event->unit) -> unit
abstract removeEventListener: ``type``: string * listener: (Event->unit) * useCapture: bool -> unit
abstract removeEventListener: ``type``: string * listener: (Event->unit) * options: RemoveEventListenerOptions -> unit
type [<Global;AllowNullLiteral>] EventTargetType =
[<Emit("new $0($1...)")>]
abstract Create: unit -> EventTarget
type [<Global;AllowNullLiteral>] CustomEvent =
inherit Event
abstract detail: obj
type [<AllowNullLiteral>] CustomEventInit =
inherit EventInit
abstract detail: obj with get, set
type [<Global;AllowNullLiteral>] CustomEvent<'T> =
inherit Event
abstract detail: 'T option
type [<AllowNullLiteral>] CustomEventInit<'T> =
inherit EventInit
abstract detail: 'T option with get, set
type [<AllowNullLiteral>] CustomEventType =
[<Emit("new $0($1...)")>]
abstract Create : typeArg: string * ?eventInitDict: CustomEventInit -> CustomEvent
[<Emit("new $0($1...)")>]
abstract Create : typeArg: string * ?eventInitDict: CustomEventInit<'T> -> CustomEvent<'T>
type [<Global;AllowNullLiteral>] ErrorEvent =
inherit Event
abstract colno: int
abstract error: obj
abstract filename: string
abstract lineno: int
abstract message: string
// MessageEvent is used by several packages (WebSockets, Dom)
type [<Global;AllowNullLiteral>] MessageEvent =
inherit Event
abstract data: obj
abstract origin: string
// TODO: Add it as extension in Channel Messaging API
// abstract ports: MessagePort[]
abstract source: obj
[<StringEnum>]
type GamepadEventType =
| [<CompiledName("gamepadconnected")>] GamepadConnected
| [<CompiledName("gamepaddisconnected")>] GamepadDisconnected
type [<Global;AllowNullLiteral>] GamepadEvent =
inherit Event
[<Emit("new $0($1...)")>]
abstract Create: typeArg: GamepadEventType * ?options: Gamepad
abstract gamepad: Gamepad
namespace Browser
open Fable.Core
open Browser.Types
[<AutoOpen>]
module Event =
let [<Global>] Event: EventType =
jsNative
let [<Global>] EventTarget: EventTargetType =
jsNative
let [<Global>] CustomEvent : CustomEventType =
jsNative