Skip to content

Commit

Permalink
#1281 - Add missing bindings (#1282)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jooseppi12 authored Nov 2, 2022
1 parent 84d0d5a commit 16b87d7
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 7 deletions.
13 changes: 11 additions & 2 deletions src/stdlib/WebSharper.JavaScript/Dom.fs
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,21 @@ module Interfaces =
]
|+> Instance [
"name" =@ T<string>

"assign" => !+Node ^-> T<unit>
"assignedNodes" => !?AssignedNodesOptions?options ^-> !|Node
"assignedElements" => !?AssignedNodesOptions?options ^-> !|Element
"replaceWith" => !+(Element + Text) ^-> T<unit>

"onslotchange" => Event ^-> T<unit>
]

let HTMLTemplateEvent =
Class "HTMLTemplateElement"
|=> Inherits Element
|+> Instance [
"content" =? DocumentFragment
]
let SlottableMixin =
Instance [
"assignedSlot" => HTMLSlotElement
Expand Down Expand Up @@ -962,6 +972,7 @@ module Interfaces =
"preventDefault" => T<unit->unit>
"stopImmediatePropagation" => T<unit->unit>
"stopPropagation" => T<unit->unit>
"composedPath" => T<unit> ^-> !|EventTarget
]

let CustomEvent =
Expand Down Expand Up @@ -1596,8 +1607,6 @@ module Definition =
I.HTMLCollection
I.TreeWalker
I.Range
I.AssignedNodesOptions
I.HTMLSlotElement
I.FullscreenNavigationUI
I.FullscreenOptions
I.ScrollAnimateMode
Expand Down
31 changes: 26 additions & 5 deletions src/stdlib/WebSharper.JavaScript/Html5.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2071,10 +2071,6 @@ module Elements =
Constructor T<string> |> WithInline "new Audio($0)"
]

let HTMLSlotElement =
Class "HTMLSlotElement"
|=> Inherits HTMLElement

module Geolocation =

let PositionOptions =
Expand Down Expand Up @@ -2633,6 +2629,25 @@ module General =
"fetch" => Fetch.Request ^-> EcmaPromise.[Fetch.Response]
]

let ElementDefinitionOptions =
Pattern.Config "ElementDefinitionOptions" {
Required = [
"extends", T<string>
]
Optional = []
}

let CustomElementConstructor = T<unit> ^-> Dom.Interfaces.Element

let CustomElementsRegistry =
Class "CustomElementsRegistry"
|+> Instance [
"define" => T<string>?name * CustomElementConstructor?constructor * ElementDefinitionOptions?options ^-> T<unit>
"get" => T<string>?name ^-> (T<unit> + CustomElementConstructor)
"whenDefined" => T<string>?name ^-> (EcmaPromise.[CustomElementConstructor])
"upgrade" => Dom.Interfaces.Node ^-> T<unit>
]

do
let f = Dom.Interfaces.Event ^-> T<unit>
Dom.Interfaces.Window
Expand Down Expand Up @@ -2718,6 +2733,8 @@ module General =
"postMessage" => T<string> * T<string> * Type.ArrayOf(MessagePort) ^-> T<unit>
"postMessage" => T<string> * T<string> ^-> T<unit>

"customElements" =? CustomElementsRegistry

"onabort" =@ f
"onauxclick" =@ f
"onafterprint" =@ f
Expand Down Expand Up @@ -3681,8 +3698,10 @@ module Definition =
Elements.HTMLOutputElement
Elements.HTMLProgressElement
Elements.HTMLSelectElement
Elements.HTMLSlotElement
Elements.HTMLTextAreaElement
Dom.Interfaces.AssignedNodesOptions
Dom.Interfaces.HTMLSlotElement
Dom.Interfaces.HTMLTemplateEvent
Elements.SelectionMode
EventSource.ReadyState
EventSource.EventSourceOptions
Expand Down Expand Up @@ -3729,6 +3748,8 @@ module Definition =
Dom.Interfaces.Window
General.CSSSD
General.MQL
General.CustomElementsRegistry
General.ElementDefinitionOptions

Media.MediaStream
Media.MediaStreamTrack
Expand Down

0 comments on commit 16b87d7

Please # to comment.