Skip to content

Commit fa9b42a

Browse files
committed
Dom_html: add window.matchMedia & MediaQueryList
1 parent 059fe7d commit fa9b42a

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

lib/js_of_ocaml/dom_html.ml

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

2315+
class type mediaQueryList = object
2316+
method media : js_string t prop
2317+
2318+
method matches : bool readonly_prop
2319+
2320+
method onchange : (mediaQueryList t, event t) event_listener prop
2321+
2322+
inherit eventTarget
2323+
end
2324+
23152325
class type window = object
23162326
inherit eventTarget
23172327

@@ -2428,6 +2438,8 @@ class type window = object
24282438
method _URL : _URL t readonly_prop
24292439

24302440
method devicePixelRatio : number_t readonly_prop
2441+
2442+
method matchMedia : js_string t -> mediaQueryList t meth
24312443
end
24322444

24332445
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)