@@ -129,12 +129,49 @@ type ClipboardEvents r =
129129 | r
130130 )
131131
132+ type MediaEvents r =
133+ ( onLoadStart :: Event
134+ , onProgress :: Event
135+ , onSuspend :: Event
136+ , onAbort :: Event
137+ , onError :: Event
138+ , onEmptied :: Event
139+ , onStalled :: Event
140+ , onLoadedMetadata :: Event
141+ , onLoadedData :: Event
142+ , onCanPlay :: Event
143+ , onCanPlayThrough :: Event
144+ , onPlaying :: Event
145+ , onWaiting :: Event
146+ , onSeeking :: Event
147+ , onSeeked :: Event
148+ , onEnded :: Event
149+ , onDurationChange :: Event
150+ , onTimeUpdate :: Event
151+ , onPlay :: Event
152+ , onPause :: Event
153+ , onRateChange :: Event
154+ , onResize :: Event
155+ , onVolumeChange :: Event
156+ | r
157+ )
158+
132159type InteractiveEvents r = ClipboardEvents (FocusEvents (TransitionEvents (KeyEvents (PointerEvents (TouchEvents (DragEvents (MouseEvents (onWheel :: WheelEvent | r ))))))))
133160
134161type GlobalProperties r = GlobalAttributes (GlobalEvents r )
135162
136163type Interactive r = InteractiveEvents (GlobalProperties r )
137164
165+ type Media r = Interactive (MediaEvents
166+ ( autoplay :: Boolean
167+ , controls :: Boolean
168+ , loop :: Boolean
169+ , muted :: Boolean
170+ , preload :: PreloadValue
171+ , src :: String
172+ | r
173+ ))
174+
138175type Noninteractive r = GlobalProperties r
139176
140177type HTMLa = Interactive
@@ -166,15 +203,7 @@ type HTMLarticle = Interactive ()
166203
167204type HTMLaside = Interactive ()
168205
169- type HTMLaudio = Interactive
170- ( autoplay :: Boolean
171- , controls :: Boolean
172- , loop :: Boolean
173- , muted :: Boolean
174- , preload :: PreloadValue
175- , src :: String
176- , onError :: Event
177- )
206+ type HTMLaudio = Media ()
178207
179208type HTMLb = Interactive ()
180209
@@ -630,19 +659,11 @@ type HTMLul = Interactive (onScroll :: Event)
630659
631660type HTMLvar = Interactive ()
632661
633- type HTMLvideo = Interactive
634- ( autoplay :: Boolean
635- , controls :: Boolean
636- , height :: CSSPixel
637- , loop :: Boolean
638- , muted :: Boolean
662+ type HTMLvideo = Media
663+ ( height :: CSSPixel
639664 , poster :: String
640- , preload :: PreloadValue
641- , src :: String
642665 , width :: CSSPixel
643666 , type :: MediaType
644- , onError :: Event
645- , onTimeUpdate :: Event
646667 )
647668
648669type HTMLwbr = Interactive ()
0 commit comments