diff options
Diffstat (limited to 'src/Lib/Dom/Document.ml')
-rw-r--r-- | src/Lib/Dom/Document.ml | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/Lib/Dom/Document.ml b/src/Lib/Dom/Document.ml index 39c1bb4..46f983a 100644 --- a/src/Lib/Dom/Document.ml +++ b/src/Lib/Dom/Document.ml @@ -1,16 +1,19 @@ -external createElement : string -> Dom.element = "createElement" +external body : Dom.element = "body" [@@bs.val] [@@bs.scope "document"] -external createElementNS : string -> string -> Dom.element = "createElementNS" +external create_element : string -> Dom.element = "createElement" [@@bs.val] [@@bs.scope "document"] -external querySelector : string -> Dom.element Js.Nullable.t = "querySelector" +external create_element_ns : string -> string -> Dom.element = "createElementNS" [@@bs.val] [@@bs.scope "document"] -let querySelectorUnsafe id = - querySelector id |> Js.Nullable.toOption |> Js.Option.getExn +external query_selector : string -> Dom.element Js.Nullable.t = "querySelector" + [@@bs.val] [@@bs.scope "document"] + +let query_selector_unsafe id = + query_selector id |> Js.Nullable.toOption |> Js.Option.getExn -external createTextNode : string -> Dom.element = "createTextNode" +external create_text_node : string -> Dom.element = "createTextNode" [@@bs.val] [@@bs.scope "document"] external location : Location.location = "location" |