123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081(* Js_of_ocaml library
* http://www.ocsigen.org/js_of_ocaml/
* Copyright (C) 2019 Alexander Yanin
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, with linking exception;
* either version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*)open!ImportclasstyperesizeObserverSize=objectmethodinlineSize:floatJs.readonly_propmethodblockSize:floatJs.readonly_propendclasstyperesizeObserverEntry=objectmethodtarget:Dom.nodeJs.tJs.readonly_propmethodcontentRect:Dom_html.clientRectJs.tJs.readonly_propmethodborderBoxSize:resizeObserverSizeJs.tJs.readonly_propmethodcontentBoxSize:resizeObserverSizeJs.tJs.readonly_propendclasstyperesizeObserverOptions=objectmethodbox:Js.js_stringJs.tJs.writeonly_propendclasstyperesizeObserver=objectmethodobserve:#Dom.nodeJs.t->unitJs.methmethodobserve_withOptions:#Dom.nodeJs.t->resizeObserverOptionsJs.t->unitJs.methmethodunobserve:#Dom.nodeJs.t->unitJs.methmethoddisconnect:unitJs.methendletempty_resize_observer_options():resizeObserverOptionsJs.t=Js.Unsafe.obj[||]letresizeObserver=Js.Unsafe.global##._ResizeObserverletis_supported()=Js.Optdef.testresizeObserverletresizeObserver:((resizeObserverEntryJs.tJs.js_arrayJs.t->resizeObserverJs.t->unit)Js.callback->resizeObserverJs.t)Js.constr=resizeObserverletobserve~(node:#Dom.nodeJs.t)~(f:resizeObserverEntryJs.tJs.js_arrayJs.t->resizeObserverJs.t->unit)?(box:Js.js_stringJs.toption)():resizeObserverJs.t=letobs=new%jsresizeObserver(Js.wrap_callbackf)in(matchboxwith|None->obs##observenode|Somebox->letopts=empty_resize_observer_options()inopts##.box:=box;obs##observe_withOptionsnodeopts);obs