Skip to content

Commit

Permalink
Fix #1028: standardize WebSharper.JavaScript.Dom.* type names
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarmil committed Sep 24, 2018
1 parent 59e2b4b commit c8ee23f
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions src/stdlib/WebSharper.JavaScript/Dom.fs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ module private Util =

[<AutoOpen>]
module private Types =
let DOMClass name = Class ("DOM" + name) |> WithSourceName name
let DOMTimeStamp = T<System.DateTime>
let DocumentType = Class "DocumentType"
let Document = Class "Document"
let NodeList = Class "NodeList"
let NamedNodeMap = Class "NamedNodeMap"
let Element = Class "Element"
let TypeInfo = Class "TypeInfo"
let DOMLocator = Class "DOMLocator"
let Event = Class "Event"
let AbstractView = Class "AbstractView"
let NodeFilter = Class "NodeFilter"
Expand All @@ -64,7 +64,7 @@ module private Enumerations =
|> P.EnumInlines name

let DOMExceptionType =
Enum "DOMExceptionType" "DOMException." "_ERR" "\
Enum "ExceptionType" "DOMException." "_ERR" "\
INDEX_SIZE_ERR DOMSTRING_SIZE_ERR HIERARCHY_REQUEST_ERR
WRONG_DOCUMENT_ERR INVALID_CHARACTER_ERR NO_DATA_ALLOWED_ERR \
NO_MODIFICATION_ALLOWED_ERR NOT_FOUND_ERR NOT_SUPPORTED_ERR \
Expand Down Expand Up @@ -120,14 +120,15 @@ module private Enumerations =
module Interfaces =

let DOMException =
Class "DomException"
DOMClass "Exception"
|+> Static [
"code" =? DOMExceptionType
"message" =? T<string>
"name" =? T<string>
]

let DOMStringList =
Class "DomStringList"
DOMClass "StringList"
|+> Instance [
"length" =? T<int>
"contains" => T<string->bool>
Expand All @@ -145,7 +146,7 @@ module Interfaces =
]

let DOMImplementation =
Class "DOMImplementation"
DOMClass "Implementation"
|+> Instance [
"hasFeature" =>
T<string>?feature * T<string>?version ^-> T<bool>
Expand All @@ -162,14 +163,14 @@ module Interfaces =
]

let DOMImplementationList =
Class "DomImplementationList"
DOMClass "ImplementationList"
|+> Instance [
"item" => T<int> ^-> DOMImplementation
"length" =? T<int>
]

let DOMImpementationSource =
Class "DomImplementationSource"
DOMClass "ImplementationSource"
|+> Instance [
"getDOMImplementation" =>
T<string> ^-> DOMImplementation
Expand All @@ -178,7 +179,7 @@ module Interfaces =
]

let DOMRect =
Class "DomRect"
DOMClass "Rect"
|+> Instance [
"x" =? T<double>
"y" =? T<double>
Expand Down Expand Up @@ -307,7 +308,7 @@ module Interfaces =
]

let DOMTokenList =
Class "DOMTokenList"
DOMClass "TokenList"
|+> Instance [
"length" =? T<int>
"item" => T<int> ^-> T<string>
Expand Down Expand Up @@ -532,21 +533,22 @@ module Interfaces =
|> Obsolete

let DOMError =
Class "DOMError"
DOMClass "Error"
|+> Instance [
"name" =? T<string>
"message" =? T<string>
]

let DOMErrorHandler =
Class "DOMErrorHandler"
DOMClass "ErrorHandler"
|+> Instance [
"handleError" => DOMError ^-> T<bool>
]
|> Obsolete

let DOMLocator =
DOMLocator
DOMClass "Locator"
|> WithSourceName "Locator"
|+> Instance [
"lineNumber" =? T<int>
"columnNumber" =? T<int>
Expand All @@ -558,7 +560,7 @@ module Interfaces =
|> Obsolete

let DOMConfiguration =
Class "DOMConfiguration"
DOMClass "Configuration"
|+> Instance [
"setParameter" => T<string*obj->unit>
"getParameter" => T<string->obj>
Expand Down

0 comments on commit c8ee23f

Please sign in to comment.