Skip to content

Commit 154a532

Browse files
committed
Dom_html: add window.matchMedia & MediaQueryList
1 parent cb5982c commit 154a532

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

lib/js_of_ocaml/dom_html.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2428,6 +2428,8 @@ class type window = object
24282428
method _URL : _URL t readonly_prop
24292429

24302430
method devicePixelRatio : number_t readonly_prop
2431+
2432+
method matchMedia : js_string t -> mediaQueryList t meth
24312433
end
24322434

24332435
let window : window t = Js.Unsafe.global

lib/js_of_ocaml/dom_html.mli

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2164,6 +2164,16 @@ class type _URL = object
21642164
method revokeObjectURL : js_string t -> unit meth
21652165
end
21662166

2167+
class type mediaQueryList = object
2168+
method media : js_string t prop
2169+
2170+
method matches : bool readonly_prop
2171+
2172+
method onchange : (mediaQueryList t, event t) event_listener prop
2173+
2174+
inherit eventTarget
2175+
end
2176+
21672177
(** Specification of window objects *)
21682178
class type window = object
21692179
inherit eventTarget
@@ -2285,6 +2295,8 @@ class type window = object
22852295
method _URL : _URL t readonly_prop
22862296

22872297
method devicePixelRatio : number_t readonly_prop
2298+
2299+
method matchMedia : js_string t -> mediaQueryList t meth
22882300
end
22892301

22902302
val window : window t

0 commit comments

Comments
 (0)