diff --git a/.gitignore b/.gitignore
index 6628e5048..993310191 100644
--- a/.gitignore
+++ b/.gitignore
@@ -189,4 +189,7 @@ FakesAssemblies/
# LightSwitch generated files
GeneratedArtifacts/
_Pvt_Extensions/
-ModelManifest.xml
\ No newline at end of file
+ModelManifest.xml
+
+.paket/
+.fake/
diff --git a/App.config b/App.config
deleted file mode 100644
index 9cfe68da8..000000000
--- a/App.config
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/AssemblyInfo.fs b/AssemblyInfo.fs
deleted file mode 100644
index 36e24b990..000000000
--- a/AssemblyInfo.fs
+++ /dev/null
@@ -1,41 +0,0 @@
-namespace CreateDomJs.AssemblyInfo
-
-open System.Reflection
-open System.Runtime.CompilerServices
-open System.Runtime.InteropServices
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[]
-[]
-[]
-[]
-[]
-[]
-[]
-[]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// []
-[]
-[]
-
-do
- ()
\ No newline at end of file
diff --git a/Generator.fsproj b/Generator.fsproj
deleted file mode 100644
index f7c161bc2..000000000
--- a/Generator.fsproj
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- 2.0
- 1bbe845e-5357-4a69-94cc-64f3d2a2ff02
- Exe
- createDomJs
- Generator
- v4.5
- true
- 4.4.0.0
- Generator
-
-
-
- true
- full
- false
- false
- bin\debug
- DEBUG;TRACE
- 3
- AnyCPU
-
-
- false
-
-
- pdbonly
- true
- true
- $(BinariesDirectory)\bin\$(BuildArchitecture)\bpt\LanguageService\Tools\CreateDomJs\Release
- TRACE
- 3
- AnyCPU
- $(BinariesDirectory)\bin\$(BuildArchitecture)\bpt\LanguageService\Tools\createDomJs.XML
- true
-
-
- 11
-
-
-
-
- $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets
-
-
-
-
- $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- packages\FSharp.Data.2.2.0\lib\net40\FSharp.Data.dll
- True
-
-
-
- True
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Generator.sln b/Generator.sln
deleted file mode 100644
index 896bb615d..000000000
--- a/Generator.sln
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Generator", "Generator.fsproj", "{1BBE845E-5357-4A69-94CC-64F3D2A2FF02}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {1BBE845E-5357-4A69-94CC-64F3D2A2FF02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1BBE845E-5357-4A69-94CC-64F3D2A2FF02}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1BBE845E-5357-4A69-94CC-64F3D2A2FF02}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1BBE845E-5357-4A69-94CC-64F3D2A2FF02}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/JS.fs b/JS.fsx
similarity index 89%
rename from JS.fs
rename to JS.fsx
index be9d42977..cdc418b31 100644
--- a/JS.fs
+++ b/JS.fsx
@@ -1,4 +1,4 @@
-module JS
+#load "Shared.fsx"
open System
open System.IO
@@ -9,7 +9,7 @@ open Shared
// Global Pt.print target
let Pt = StringPrinter()
-// When dump webworker interfaces dom types are ignored
+// When emit webworker interfaces dom types are ignored
let mutable ignoreDomType = false
/// Return a stringbuilder
@@ -117,8 +117,8 @@ let GetDefaultValue jsType =
let GetJsDefaultValueForDomType (domType:string) = domType |> DomTypeToJsType |> GetDefaultValue
-/// Dump event handlers that associated with an interface
-let DumpEvents (i:Browser.Interface) =
+/// Emit event handlers that associated with an interface
+let EmitEvents (i:Browser.Interface) =
match iNameToEhList.TryFind i.Name with
| Some ehList ->
ehList
@@ -132,7 +132,7 @@ let DumpEvents (i:Browser.Interface) =
else ())
| None -> ()
-let DumpProperties flavor (i:Browser.Interface) =
+let EmitProperties flavor (i:Browser.Interface) =
let propNameToElmentMap = function
| "images" -> Some "img"
| "rows" -> Some "tr"
@@ -146,7 +146,7 @@ let DumpProperties flavor (i:Browser.Interface) =
| "tBodies" -> Some "tbody"
| _ -> None
- let DumpProperty (p: Browser.Property) =
+ let EmitProperty (p: Browser.Property) =
let value = p.Type |> DomTypeToJsType |> GetDefaultValue
match p with
| _ when p.Type = "EventHandler" -> ()
@@ -179,10 +179,10 @@ let DumpProperties flavor (i:Browser.Interface) =
| Some propCollection ->
propCollection.Properties
|> Array.filter (ShouldKeep flavor)
- |> Array.iter DumpProperty
+ |> Array.iter EmitProperty
| None -> ()
-let DumpConstants suffix (i:Browser.Interface) =
+let EmitConstants suffix (i:Browser.Interface) =
match i.Constants with
| Some cCollection ->
for c in cCollection.Constants do
@@ -192,8 +192,8 @@ let DumpConstants suffix (i:Browser.Interface) =
| _ -> Pt.printl "%s%s.%s = %s;" i.Name suffix c.Name c.Value.Value
| None -> ()
-let DumpSignatureCommentDocs (jsFunction:Function) =
- let DumpSignatureDocForSingleParam (p: Param) =
+let EmitSignatureCommentDocs (jsFunction:Function) =
+ let EmitSignatureDocForSingleParam (p: Param) =
let pJsType = DomTypeToJsType p.Type
(sprintf "/// "
|> Pt.printl "%s"
- let DumpSignatureDocForSingleOverload (ol: Overload) =
+ let EmitSignatureDocForSingleOverload (ol: Overload) =
if not ol.IsEmpty then
Pt.increaseIndent()
match ol.ReturnTypes.Length with
| 0 ->
Pt.printl "/// "
- ol.ParamCombinations |> List.iter DumpSignatureDocForSingleParam
+ ol.ParamCombinations |> List.iter EmitSignatureDocForSingleParam
Pt.printl "/// "
| 1 ->
Pt.printl "/// "
- ol.ParamCombinations |> List.iter DumpSignatureDocForSingleParam
+ ol.ParamCombinations |> List.iter EmitSignatureDocForSingleParam
match ol.ReturnTypes.[0] with
| "void" | "" -> ()
| arrayType when arrayType.StartsWith("sequence<") -> Pt.printl "/// " (GetElementTypeForArray arrayType)
@@ -222,7 +222,7 @@ let DumpSignatureCommentDocs (jsFunction:Function) =
|> List.iter
(fun r ->
Pt.printl "/// "
- ol.ParamCombinations |> List.iter DumpSignatureDocForSingleParam
+ ol.ParamCombinations |> List.iter EmitSignatureDocForSingleParam
match r with
| "void" | "" -> ()
| arrayType when arrayType.StartsWith("sequence<") -> Pt.printl "/// " (GetElementTypeForArray arrayType)
@@ -233,15 +233,15 @@ let DumpSignatureCommentDocs (jsFunction:Function) =
else ()
let overloads = GetOverloads jsFunction true
- if not overloads.IsEmpty then List.iter DumpSignatureDocForSingleOverload overloads
+ if not overloads.IsEmpty then List.iter EmitSignatureDocForSingleOverload overloads
-let DumpMethods (i:Browser.Interface) =
- let DumpMethod (m:Browser.Method) =
+let EmitMethods (i:Browser.Interface) =
+ let EmitMethod (m:Browser.Method) =
// print declaration
let paramsStr = String.concat ", " [for p in m.Params do yield AdjustParamName p.Name]
Pt.printl "%s.%s = function(%s) {" i.Name m.Name.Value paramsStr
// print comment docs
- DumpSignatureCommentDocs (Method m)
+ EmitSignatureCommentDocs (Method m)
// print body
match i.Name, m.Name.Value with
| "EventTarget", "addEventListener" -> Pt.printWithAddedIndent "_eventManager.add(this, type, listener);"
@@ -337,7 +337,7 @@ let DumpMethods (i:Browser.Interface) =
Pt.printl "};"
match i.Methods with
- | Some ms -> Seq.iter DumpMethod ms.Methods
+ | Some ms -> Seq.iter EmitMethod ms.Methods
| _ -> ()
// Explicitly expose 'toString' method for 'window'
@@ -353,7 +353,7 @@ let DumpMethods (i:Browser.Interface) =
return '';
};"
-let DumpInterfaceInit (i:Browser.Interface) =
+let EmitInterfaceInit (i:Browser.Interface) =
let nodeType, nodeName =
match i.Name with
| "Text" -> "TEXT_NODE", "#text"
@@ -431,16 +431,16 @@ let RegisterPublicInterfaces flavor =
i.NoInterfaceObject.IsNone then
Pt.printl "_publicInterface('%s', {" i.Name
- // Dump constants
- let cDump =
+ // Emit constants
+ let cEmit =
match i.Constants with
| Some (cs) ->
[for c in cs.Constants do
yield "'" + c.Name + "' : " + c.Value.String.Value]
| _ -> []
- // Dump static methods
- let mDump =
+ // Emit static methods
+ let mEmit =
match i.Methods with
| Some (ms) ->
[for m in ms.Methods do
@@ -448,7 +448,7 @@ let RegisterPublicInterfaces flavor =
yield String.Format("'{0}' : {1}.{0}", m.Name.Value, i.Name)]
| _ -> []
- let combined = String.concat "," (List.append cDump mDump)
+ let combined = String.concat "," (List.append cEmit mEmit)
Pt.print "%s" (combined.Trim(','))
Pt.print "}, %s);" i.Name
@@ -459,29 +459,29 @@ let RegisterConstructors flavor =
| Some _ -> Pt.printl "_publicInterface('%s', %sCtor , %s);" i.Name i.Name i.Name
| _ -> ()
-let DumpConstructor (i: Browser.Interface) =
+let EmitConstructor (i: Browser.Interface) =
match i.Constructor with
- | Some _ -> DumpConstants "Ctor" i
+ | Some _ -> EmitConstants "Ctor" i
| None -> ()
-let DumpInterface flavor (i:Browser.Interface) =
+let EmitInterface flavor (i:Browser.Interface) =
Pt.printl ""
Pt.printl "/* -- type: %s -- */" i.Name
Pt.printl ""
- // Dump impletented interfaces
+ // Emit impletented interfaces
i.Implements |> Array.iter (fun im -> Pt.printl "_$implement(%s, %s);" i.Name im)
if i.Name = GetGlobalPollutorName flavor then
// if the interface is the global pollutor, inherits becomes implements
Pt.printl "_$implement(%s, %s);" i.Name i.Extends
- // Dump other contents
- DumpConstructor i
- DumpProperties flavor i
- DumpConstants "" i
- DumpMethods i
- DumpInterfaceInit i
- DumpEvents i
+ // Emit other contents
+ EmitConstructor i
+ EmitProperties flavor i
+ EmitConstants "" i
+ EmitMethods i
+ EmitInterfaceInit i
+ EmitEvents i
// Deal with array types
if i.Name.EndsWith("List") || i.Name.EndsWith("Collection") then
@@ -497,15 +497,15 @@ let DumpInterface flavor (i:Browser.Interface) =
| None -> ()
| None -> ()
-let DumpCallBackFunctions flavor =
- let DumpCallBackFunction (cb: Browser.CallbackFunction) =
+let EmitCallBackFunctions flavor =
+ let EmitCallBackFunction (cb: Browser.CallbackFunction) =
let paramsStr = cb.Params |> Array.map (fun p -> p.Name) |> String.concat ", "
Pt.printl "var %s = function(%s) {" cb.Name paramsStr
- DumpSignatureCommentDocs (CallBackFun cb)
+ EmitSignatureCommentDocs (CallBackFun cb)
if cb.Type <> "void" then Pt.printWithAddedIndent "return %s;" (DomTypeToJsType cb.Type)
Pt.printl "};"
GetCallbackFuncsByFlavor flavor
- |> Array.iter DumpCallBackFunction
+ |> Array.iter EmitCallBackFunction
let RegisterCallBackFunctions flavor =
let RegisterCallBackFunction (cb: Browser.CallbackFunction) =
@@ -521,26 +521,26 @@ let RegisterDictionaries () =
browser.Dictionaries
|> Array.iter RegisterDictionary
-let DumpDictionaries () =
- let DumpDictionary (d:Browser.Dictionary) =
+let EmitDictionaries () =
+ let EmitDictionary (d:Browser.Dictionary) =
Pt.printl ""
Pt.printl "/* -- type: %s -- */" d.Name
Pt.printl ""
- // Dump members
+ // Emit members
for m in d.Members do
let defaultValue = match m.Default.String with
| Some dv -> dv
| None -> GetJsDefaultValueForDomType m.Type
Pt.printl "%s.%s = %s;" d.Name m.Name defaultValue
- browser.Dictionaries |> Array.iter DumpDictionary
+ browser.Dictionaries |> Array.iter EmitDictionary
-let DumpInterfaces flavor =
+let EmitInterfaces flavor =
let sortedTypes = SortInterfaces (GetAllInterfacesByFlavor flavor)
- for t in sortedTypes do DumpInterface flavor t
+ for t in sortedTypes do EmitInterface flavor t
-let DumpEventTypeToObjSwitchStatement flavor ignoreCase =
+let EmitEventTypeToObjSwitchStatement flavor ignoreCase =
Pt.printl "switch (type) {"
Pt.increaseIndent()
@@ -570,7 +570,7 @@ let DumpEventTypeToObjSwitchStatement flavor ignoreCase =
Pt.decreaseIndent()
Pt.printl "}"
-let DumpGetElementByTagNameSwitchStatement () =
+let EmitGetElementByTagNameSwitchStatement () =
Pt.printl "switch (tagName.toLowerCase()) {"
Pt.increaseIndent()
@@ -581,9 +581,9 @@ let DumpGetElementByTagNameSwitchStatement () =
Pt.print "}"
-/// Dump the _createEvent function
-let DumpCreateEventSwitchStatement () =
- // Dump the switch statements
+/// Emit the _createEvent function
+let EmitCreateEventSwitchStatement () =
+ // Emit the switch statements
Pt.printl "switch(eventType.toLowerCase()) {"
distinctETypeList
@@ -603,8 +603,8 @@ let DumpCreateEventSwitchStatement () =
Pt.printl "}"
-let DumpDeclarations flavor =
- let DumpInterfaceDeclaration (i:Browser.Interface) =
+let EmitDeclarations flavor =
+ let EmitInterfaceDeclaration (i:Browser.Interface) =
let init =
match i.Name with
| name when name = GetGlobalPollutorName flavor -> "this"
@@ -623,7 +623,7 @@ let DumpDeclarations flavor =
"function(" + pList + ")"
Pt.printl "var %sCtor = %s { " i.Name functionDeclare
if ctor.Params.Length > 0 then
- DumpSignatureCommentDocs (Ctor ctor)
+ EmitSignatureCommentDocs (Ctor ctor)
Pt.printWithAddedIndent "return Object.create(%s);" i.Name
Pt.printl "};"
else
@@ -633,30 +633,30 @@ let DumpDeclarations flavor =
GetAllInterfacesByFlavor flavor
|> SortInterfaces
- |> Array.iter DumpInterfaceDeclaration
+ |> Array.iter EmitInterfaceDeclaration
if flavor <> Worker then
- let DumpDictDeclaration (d: Browser.Dictionary) =
+ let EmitDictDeclaration (d: Browser.Dictionary) =
match d.Extends with
| "Object" -> Pt.printl "var %s = {};" d.Name
| _ -> Pt.printl "var %s = _$inherit(%s);" d.Name d.Extends
browser.Dictionaries
|> SortDicts
- |> Array.iter DumpDictDeclaration
+ |> Array.iter EmitDictDeclaration
-let DumpXmlContent flavor =
- DumpDeclarations flavor
- DumpCallBackFunctions flavor
- DumpInterfaces flavor
+let EmitXmlContent flavor =
+ EmitDeclarations flavor
+ EmitCallBackFunctions flavor
+ EmitInterfaces flavor
if flavor <> Worker then
- DumpDictionaries ()
+ EmitDictionaries ()
let RegisterPublicObjs flavor =
RegisterPublicInterfaces flavor
RegisterConstructors flavor
-/// Adjust the indention of the printer, and dump the indented content in the printer,
+/// Adjust the indention of the printer, and emit the indented content in the printer,
/// and then replace the place holder text with the content in printer
let ReplaceWithIndentedFuncResult (placeHolder: String) func (sb: StringBuilder) =
let curText = sb.ToString()
@@ -667,7 +667,7 @@ let ReplaceWithIndentedFuncResult (placeHolder: String) func (sb: StringBuilder)
func() |> ignore
sb.Replace(placeHolder, Pt.getResult())
-let DumpTheWholeThing flavor (target: TextWriter) =
+let EmitTheWholeThing flavor (target: TextWriter) =
Pt.reset()
let template = LoadTemplate ( __SOURCE_DIRECTORY__ + @"\inputfiles\jsTemplate.js")
@@ -675,15 +675,15 @@ let DumpTheWholeThing flavor (target: TextWriter) =
let content =
template
|> ReplaceWithIndentedFuncResult "<@ EventTypeToObjSwitchStatements @>"
- (fun () -> DumpEventTypeToObjSwitchStatement flavor false)
+ (fun () -> EmitEventTypeToObjSwitchStatement flavor false)
|> ReplaceWithIndentedFuncResult "<@ EventTypeToObjSwitchStatementsIgnoreCase @>"
- (fun () -> DumpEventTypeToObjSwitchStatement flavor true)
+ (fun () -> EmitEventTypeToObjSwitchStatement flavor true)
|> ReplaceWithIndentedFuncResult "<@ CreateEventSwitchStatements @>"
- DumpCreateEventSwitchStatement
+ EmitCreateEventSwitchStatement
|> ReplaceWithIndentedFuncResult "<@ GetElementsByTagNameSwitchStatements @>"
- DumpGetElementByTagNameSwitchStatement
+ EmitGetElementByTagNameSwitchStatement
|> ReplaceWithIndentedFuncResult "<@ XMLContents @>"
- (fun () -> DumpXmlContent flavor)
+ (fun () -> EmitXmlContent flavor)
|> ReplaceWithIndentedFuncResult "<@ Public Interfaces @>"
(fun () -> RegisterPublicObjs flavor)
|> (fun sb -> sb.Replace("<@ GlobalPolluter @>", GetGlobalPollutorName flavor))
@@ -691,14 +691,15 @@ let DumpTheWholeThing flavor (target: TextWriter) =
fprintf target "%s" content
target.Flush()
+ target.Close()
-let DumpDomWeb () =
- DumpTheWholeThing Web GlobalVars.jsWebOutput
+let EmitDomWeb () =
+ EmitTheWholeThing Flavor.Web GlobalVars.jsWebOutput
-let DumpDomWin () =
- DumpTheWholeThing Windows GlobalVars.jsWinOutput
+let EmitDomWin () =
+ EmitTheWholeThing Flavor.All GlobalVars.jsWinOutput
-let DumpDomWorker () =
+let EmitDomWorker () =
Pt.reset()
ignoreDomType <- true
@@ -707,9 +708,9 @@ let DumpDomWorker () =
let content =
template
|> ReplaceWithIndentedFuncResult "<@ EventTypeToObjSwitchStatements @>"
- (fun () -> DumpEventTypeToObjSwitchStatement Worker false)
+ (fun () -> EmitEventTypeToObjSwitchStatement Worker false)
|> ReplaceWithIndentedFuncResult "<@ XMLContents @>"
- (fun () -> DumpXmlContent Worker)
+ (fun () -> EmitXmlContent Worker)
|> ReplaceWithIndentedFuncResult "<@ Public Interfaces @>"
(fun () -> RegisterPublicObjs Worker)
|> (fun sb -> sb.Replace("<@ GlobalPolluter @>", GetGlobalPollutorName Worker))
diff --git a/Program.fs b/Program.fs
deleted file mode 100644
index f77f17baa..000000000
--- a/Program.fs
+++ /dev/null
@@ -1,10 +0,0 @@
-
-[]
-let main argv =
- JS.DumpDomWeb()
- JS.DumpDomWin()
- JS.DumpDomWorker()
- // For typescript only generate for Dom
- TS.DumpDomWeb()
- TS.DumpDomWorker()
- 0
\ No newline at end of file
diff --git a/README.md b/README.md
index 6c8f8a841..567428f21 100644
--- a/README.md
+++ b/README.md
@@ -1,22 +1,23 @@
-# CreateDomJSTS
-This tool is used to generate the DOM related part of `lib.d.ts` for TypeScript, and `domWeb.js` and `domWindows.js` for Visual Studio JavaScript language service. The input file is the XML spec file generated by the Microsoft Edge browser.
+# TypeScript and JavaScript lib generator
+This tool is used to generate `dom.generated.d.ts` and `webworker.generated.d.ts` for TypeScript, and `domWeb.js` and `domWindows.js` for Visual Studio JavaScript language service. The input file is the XML spec file generated by the Microsoft Edge browser.
## Build Instruction
-**Required Software**: Visual Studio 2015 Community Version (with Visual F# installed)
-
-To build the tool, simply open the `Generator.sln` in Visual Studio and build the solution. A nuget restore should be done automatically before the build.
-
-Press `F5` in Visual Studio to run the tool. If it runs successfully, the output files will be generated under the `generated` folder.
+To build the tool, simply clone the repo, and run `build.cmd` in command line or powershell. If it runs successfully, the output files will be generated under the `generated` folder.
## Code Structure
- `Shared.fs`: handles the parsing from XML spec file, and stores the common data structures for later use;
- `TS.fs`: handles the emitting of the `lib.d.ts` file;
- `JS.fs`: handles the emitting of the `domWeb.js` and `domWindows.js`
-files used for Visual Studio JavaScript language service;
-- `Program.fs`: entry point of the tool;
-- Inside the `inputfiles` folder:
- - `browser.webidl.xml`: the XML spec file generated by Microsoft Edge (due to the different updating schedules between Edge and TypeScript, this is **not** the most up-to-date version of the spec);
- - `jsTemplate.js`: the initial templates for `domWeb.js` and `domWindows.js`, which contains the necessary helper functions;
- - `additionalSharedTypes.ts`: types should exist in both browser and webworker that are missing from the Edge spec.
- - `additionalDomTypes.ts`: types should exist in only browser that are missing from the Edge spec.
- - `additionalWorkerTypes.ts`: types should exist in only webworker that are missing from the Edge spec.
+
+## Contribution Guide
+The `dom.generated.d.ts` and `webworker.generated.d.ts` files that are used in TypeScript repo `master` branch are used as baselines. For each pull request, we will try run the script and compare the generated files with the baseline files. So to make the tests passed, please update the baseline and the code at the same pull request.
+
+## Input Files:
+- `browser.webidl.xml`: the XML spec file generated by Microsoft Edge (due to the different updating schedules between Edge and TypeScript, this may **not** be the most up-to-date version of the spec.);
+- `webworker.webidl.xml`: contains additional types for webworker.
+- `addedTypes.json`: types that should exist in either browser or webworker but are missing from the Edge spec. The type can be `property`, `method`, `interface`, `constructor`, or `indexer`.
+- `overridingTypes.json`: types that are defined in the spec file but has a better or more up-to-date definitions in the json files.
+- `removedTypes.json`: types that are defined in the spec file but should be removed.
+- `comments.json`: comment strings to be embedded in the generated .js files
+- `jsTemplate.js`: the initial templates for `domWeb.js` and `domWindows.js`, which contains the necessary helper functions;
+- `sample.json`: sample json file used to tell F# json type provider that structure of the json files. The content of it is not used anywhere.
diff --git a/Shared.fs b/Shared.fsx
similarity index 79%
rename from Shared.fs
rename to Shared.fsx
index bc8d1107b..c990befea 100644
--- a/Shared.fs
+++ b/Shared.fsx
@@ -1,4 +1,5 @@
-module Shared
+#r @"packages\FSharp.Data\lib\net40\FSharp.Data.dll"
+#r "System.Xml.Linq.dll"
open FSharp.Data
open System.IO
@@ -16,9 +17,9 @@ module GlobalVars =
let inputFolder = __SOURCE_DIRECTORY__ + @"\inputfiles"
let makeTextWriter fileName = File.CreateText(__SOURCE_DIRECTORY__ + @"\generated\" + fileName) :> TextWriter
- let jsWebOutput = makeTextWriter "domWeb.js"
- let jsWinOutput = makeTextWriter "domWindows.js"
- let jsWorkerOutput = makeTextWriter "dedicatedworker.js"
+ // let jsWebOutput = makeTextWriter "domWeb.js"
+ // let jsWinOutput = makeTextWriter "domWindows.js"
+ // let jsWorkerOutput = makeTextWriter "dedicatedworker.js"
let tsWebOutput = makeTextWriter "dom.generated.d.ts"
let tsWorkerOutput = makeTextWriter "webworker.generated.d.ts"
let defaultEventType = "Event"
@@ -26,62 +27,91 @@ module GlobalVars =
/// ===========================================
/// Types
/// ===========================================
+
+/// Quick checker for option type values
+let OptionCheckValue value = function
+ | Some v when v = value -> true
+ | _ -> false
+
+let unionToString (x: 'a) =
+ match FSharpValue.GetUnionFields(x, typeof<'a>) with
+ | case, _ -> case.Name
+
type Flavor =
| Worker
| Web
- | Windows
- override x.ToString() =
- match FSharpValue.GetUnionFields(x, typeof) with
- | case, _ -> case.Name
+ | All
+ override x.ToString() = unionToString x
+
+type Browser = XmlProvider<"sample.xml", Global=true>
+
+module JsonItems =
+ type ItemsType = JsonProvider<"inputfiles/sample.json">
-type Browser = XmlProvider< "sample.xml", Global=true >
+ let overriddenItems =
+ File.ReadAllText(GlobalVars.inputFolder + @"\overridingTypes.json") |> ItemsType.Parse
-type CommentType = JsonProvider<"inputfiles/comments.json">
+ let removedItems =
+ File.ReadAllText(GlobalVars.inputFolder + @"\removedTypes.json") |> ItemsType.Parse
-type TypesFromJsonFile = JsonProvider<"inputfiles/sample.json">
+ let addedItems =
+ File.ReadAllText(GlobalVars.inputFolder + @"\addedTypes.json") |> ItemsType.Parse
-let overridingTypes =
- File.ReadAllText(__SOURCE_DIRECTORY__ + @"\inputfiles\overridingTypes.json") |> TypesFromJsonFile.Parse
+ // This is the kind of items in the external json files that are used as a
+ // correction for the spec.
+ type ItemKind =
+ Property | Method | Constant | Constructor | Interface | Callback | Indexer
+ override x.ToString() = (unionToString x).ToLower()
-let removedTypes =
- File.ReadAllText(__SOURCE_DIRECTORY__ + @"\inputfiles\removedTypes.json") |> TypesFromJsonFile.Parse
+ let findItem (allItems: ItemsType.Root []) (itemName: string) (kind: ItemKind) otherFilter =
+ let filter (item: ItemsType.Root) =
+ OptionCheckValue itemName item.Name &&
+ item.Kind.ToLower() = kind.ToString() &&
+ otherFilter item
+ allItems |> Array.tryFind filter
-let addedTypes =
- File.ReadAllText(__SOURCE_DIRECTORY__ + @"\inputfiles\addedTypes.json") |> TypesFromJsonFile.Parse
+ let matchInterface iName (item: ItemsType.Root) =
+ item.Interface.IsNone || item.Interface.Value = iName
-type MemberKind =
- Property | Method
- member this.ToString = if this = Property then "property" else "method"
+ let findOverriddenItem itemName (kind: ItemKind) iName =
+ findItem overriddenItems itemName kind (matchInterface iName)
-let findTypeFromJsonArray (jsonArray: TypesFromJsonFile.Root []) mName iName (kind: MemberKind) =
- jsonArray
- |> Array.tryFind (fun t ->
- t.Name = mName && (t.Interface.IsNone || t.Interface.Value = iName) && t.Kind = kind.ToString)
+ let findRemovedItem itemName (kind: ItemKind) iName =
+ findItem removedItems itemName kind (matchInterface iName)
-let findOverridingType mName iName (kind: MemberKind) = findTypeFromJsonArray overridingTypes mName iName kind
-let findRemovedType mName iName (kind: MemberKind) = findTypeFromJsonArray removedTypes mName iName kind
-let findAddedType mName iName (kind: MemberKind) = findTypeFromJsonArray addedTypes mName iName kind
+ let findAddedItem itemName (kind: ItemKind) iName =
+ findItem addedItems itemName kind (matchInterface iName)
-let getAllAddedInterfaces (flavor: Flavor) =
- addedTypes |> Array.filter (fun t -> t.Kind = "interface" && (t.Flavor.IsNone || t.Flavor.Value = flavor.ToString() || flavor = Windows))
+ let getItems (allItems: ItemsType.Root []) (kind: ItemKind) (flavor: Flavor) =
+ allItems
+ |> Array.filter (fun t ->
+ t.Kind.ToLower() = kind.ToString() &&
+ (t.Flavor.IsNone || t.Flavor.Value = flavor.ToString() || flavor = All))
-let comments = File.ReadAllText(__SOURCE_DIRECTORY__ + @"\inputfiles\comments.json") |> CommentType.Parse
+ let getOverriddenItems kind flavor = getItems overriddenItems kind flavor
+ let getAddedItems kind flavor = getItems addedItems kind flavor
+ let getRemovedItems kind flavor = getItems removedItems kind flavor
-let GetCommentForProperty iName pName =
- match comments.Interfaces |> Array.tryFind (fun i -> i.Name = iName) with
- | Some i ->
- match i.Members.Property |> Array.tryFind (fun p -> p.Name = pName) with
- | Some p -> Some p.Comment
+module Comments =
+ type CommentType = JsonProvider<"inputfiles/comments.json">
+
+ let comments = File.ReadAllText(__SOURCE_DIRECTORY__ + @"\inputfiles\comments.json") |> CommentType.Parse
+
+ let GetCommentForProperty iName pName =
+ match comments.Interfaces |> Array.tryFind (fun i -> i.Name = iName) with
+ | Some i ->
+ match i.Members.Property |> Array.tryFind (fun p -> p.Name = pName) with
+ | Some p -> Some p.Comment
+ | _ -> None
| _ -> None
- | _ -> None
-let GetCommentForMethod iName mName =
- match comments.Interfaces |> Array.tryFind (fun i -> i.Name = iName) with
- | Some i ->
- match i.Members.Method |> Array.tryFind (fun m -> m.Name = mName) with
- | Some m -> Some m.Comment
+ let GetCommentForMethod iName mName =
+ match comments.Interfaces |> Array.tryFind (fun i -> i.Name = iName) with
+ | Some i ->
+ match i.Members.Method |> Array.tryFind (fun m -> m.Name = mName) with
+ | Some m -> Some m.Comment
+ | _ -> None
| _ -> None
- | _ -> None
// Printer for print to file
type Printer(target : TextWriter) =
@@ -107,7 +137,7 @@ type Printer(target : TextWriter) =
member this.printWithAddedIndent content =
Printf.kprintf (fun s -> output.Append("\r\n" + this.getCurIndent() + " " + s) |> ignore) content
- member this.dump() =
+ member this.emit() =
fprintf this.target "%s" (output.ToString())
this.target.Flush()
@@ -163,20 +193,23 @@ type EventHandler =
EventName : string
EventType : string }
-/// Decide which members of a function to dump
-type DumpScope =
+/// Decide which members of a function to emit
+type EmitScope =
| StaticOnly
| InstanceOnly
| All
// Used to decide if a member should be emitted given its static property and
// the intended scope level.
-let inline matchScope scope (x: ^a when ^a: (member Static: Option)) =
- if scope = DumpScope.All then true
+let inline matchScope scope (x: ^a when ^a: (member Static: Option<'b>)) =
+ if scope = EmitScope.All then true
else
- let isStatic = (^a: (member Static: Option)x)
- if isStatic.IsSome then scope = DumpScope.StaticOnly
- else scope = DumpScope.InstanceOnly
+ let isStatic = (^a: (member Static: Option<'b>)x)
+ if isStatic.IsSome then scope = EmitScope.StaticOnly
+ else scope = EmitScope.InstanceOnly
+
+let matchInterface iName (x: JsonItems.ItemsType.Root) =
+ x.Interface.IsNone || x.Interface.Value = iName
/// ===========================================
/// Shared data and helper functions
@@ -198,11 +231,6 @@ let AdjustParamName name =
| "continue" -> "_continue"
| _ -> name
-/// Quick checker for option type values
-let OptionCheckValue value = function
- | Some v when v = value -> true
- | _ -> false
-
/// Parse the xml input file
let browser =
(new StreamReader(Path.Combine(GlobalVars.inputFolder, "browser.webidl.xml"))).ReadToEnd() |> Browser.Parse
@@ -214,18 +242,18 @@ let worker =
/// (Member constraint aka duck typing)
/// reason is that ^a can be an interface, property or method, but they
/// all share a 'tag' property
-let inline ShouldKeep flavor (i : ^a when ^a : (member Tags : string option) and ^a : (member Name : string)) =
+let inline ShouldKeep flavor (i : ^a when ^a : (member Tags : string option)) =
let filterByTag =
match ((((((^a : (member Tags : string option) i)))))) with
| Some tags ->
// Check if should be included
match flavor with
- | Web ->
+ | Flavor.Web ->
[ "MSAppOnly"; "WinPhoneOnly" ]
|> Seq.exists (fun t -> tags.Contains t)
|> not
- | Windows -> true
- | Worker ->
+ | Flavor.All -> true
+ | Flavor.Worker ->
[ "IEOnly" ]
|> Seq.exists (fun t -> tags.Contains t)
|> not
@@ -277,29 +305,32 @@ let knownWorkerInterfaces =
let GetAllInterfacesByFlavor flavor =
match flavor with
- | Web -> allWebInterfaces |> Array.filter (ShouldKeep Web)
- | Windows -> allWebInterfaces |> Array.filter (ShouldKeep Windows)
- | Worker ->
+ | Flavor.Web -> allWebInterfaces |> Array.filter (ShouldKeep Web)
+ | Flavor.All -> allWebInterfaces |> Array.filter (ShouldKeep Flavor.All)
+ | Flavor.Worker ->
let isFromBrowserXml = allWebInterfaces |> Array.filter (fun i -> knownWorkerInterfaces.Contains i.Name)
Array.append isFromBrowserXml allWorkerAdditionalInterfaces
let GetNonCallbackInterfacesByFlavor flavor =
match flavor with
- | Web -> allWebNonCallbackInterfaces |> Array.filter (ShouldKeep Web)
- | Windows -> allWebNonCallbackInterfaces |> Array.filter (ShouldKeep Windows)
- | Worker ->
+ | Flavor.Web -> allWebNonCallbackInterfaces |> Array.filter (ShouldKeep Flavor.Web)
+ | Flavor.All -> allWebNonCallbackInterfaces |> Array.filter (ShouldKeep Flavor.All)
+ | Flavor.Worker ->
let isFromBrowserXml =
allWebNonCallbackInterfaces |> Array.filter (fun i -> knownWorkerInterfaces.Contains i.Name)
Array.append isFromBrowserXml allWorkerAdditionalInterfaces
let GetPublicInterfacesByFlavor flavor =
match flavor with
- | Web | Windows -> browser.Interfaces |> Array.filter (ShouldKeep flavor)
- | Worker ->
+ | Flavor.Web | Flavor.All -> browser.Interfaces |> Array.filter (ShouldKeep flavor)
+ | Flavor.Worker ->
let isFromBrowserXml = browser.Interfaces |> Array.filter (fun i -> knownWorkerInterfaces.Contains i.Name)
Array.append isFromBrowserXml worker.Interfaces
-let GetCallbackFuncsByFlavor flavor = browser.CallbackFunctions |> Array.filter (ShouldKeep flavor)
+let GetCallbackFuncsByFlavor flavor =
+ browser.CallbackFunctions
+ |> Array.filter (ShouldKeep flavor)
+ |> Array.filter (fun cb -> flavor <> Flavor.Worker || knownWorkerInterfaces.Contains cb.Name)
/// Event name to event type map
let eNameToEType =
@@ -342,7 +373,7 @@ let tagNameToEleName =
| name when Seq.contains name iNames -> name
| _ -> raise (Exception("Element conflict occured! Typename: " + tagName))
- [ for i in GetNonCallbackInterfacesByFlavor Windows do
+ [ for i in GetNonCallbackInterfacesByFlavor Flavor.All do
yield! [ for e in i.Elements do
yield (e.Name, i.Name) ] ]
|> Seq.groupBy fst
@@ -380,7 +411,7 @@ let iNameToIDependList =
/// Distinct event type list, used in the "createEvent" function
let distinctETypeList =
let usedEvents =
- [ for i in GetNonCallbackInterfacesByFlavor Windows do
+ [ for i in GetNonCallbackInterfacesByFlavor Flavor.All do
match i.Events with
| Some es -> yield! es.Events
| _ -> () ]
@@ -388,7 +419,7 @@ let distinctETypeList =
|> List.distinct
let unUsedEvents =
- GetNonCallbackInterfacesByFlavor Windows
+ GetNonCallbackInterfacesByFlavor Flavor.All
|> Array.filter (fun i -> i.Extends = "Event")
|> Array.map (fun i -> i.Name)
|> Array.filter (fun n -> n.EndsWith("Event") && not (List.contains n usedEvents))
@@ -475,8 +506,8 @@ let ehNameToEType =
let GetGlobalPollutor flavor =
match flavor with
- | Web | Windows -> browser.Interfaces |> Array.tryFind (fun i -> i.PrimaryGlobal.IsSome)
- | Worker -> worker.Interfaces |> Array.tryFind (fun i -> i.Global.IsSome)
+ | Flavor.Web | Flavor.All -> browser.Interfaces |> Array.tryFind (fun i -> i.PrimaryGlobal.IsSome)
+ | Flavor.Worker -> worker.Interfaces |> Array.tryFind (fun i -> i.Global.IsSome)
let GetGlobalPollutorName flavor =
match GetGlobalPollutor flavor with
diff --git a/TS.fs b/TS.fsx
similarity index 53%
rename from TS.fs
rename to TS.fsx
index e21f99b62..a913ede63 100644
--- a/TS.fs
+++ b/TS.fsx
@@ -1,14 +1,16 @@
-module TS
+#load "Shared.fsx"
open System
open System.Text.RegularExpressions
open Shared
+open Shared.Comments
+open Shared.JsonItems
open System.IO
// Global print target
let Pt = StringPrinter()
-// When dump webworker types the dom types are ignored
+// When emit webworker types the dom types are ignored
let mutable ignoreDOMTypes = false
// Extended types used but not defined in the spec
@@ -47,8 +49,9 @@ let rec DomTypeToTsType (objDomType: string) =
allCallbackFuncs.ContainsKey objDomType ||
allDictionariesMap.ContainsKey objDomType then
objDomType
+ // Enum types are all treated as string
elif allEnumsMap.ContainsKey objDomType then "string"
- // Deal with union type
+ // Union types
elif (objDomType.Contains(" or ")) then
let allTypes = objDomType.Trim('(', ')').Split([|" or "|], StringSplitOptions.None)
|> Array.map DomTypeToTsType
@@ -69,45 +72,48 @@ let rec DomTypeToTsType (objDomType: string) =
elementType + "[]"
else "any"
-let DumpConstants (i: Browser.Interface) =
- let dumpConstant (c: Browser.Constant) = Pt.printl "%s: %s;" c.Name (DomTypeToTsType c.Type)
+let EmitConstants (i: Browser.Interface) =
+ let emitConstantFromJson (c: ItemsType.Root) = Pt.printl "%s: %s;" c.Name.Value c.Type.Value
+
+ let emitConstant (c: Browser.Constant) =
+ if Option.isNone (findRemovedItem c.Name ItemKind.Constant i.Name) then
+ match findOverriddenItem c.Name ItemKind.Constant i.Name with
+ | Some c' -> emitConstantFromJson c'
+ | None -> Pt.printl "%s: %s;" c.Name (DomTypeToTsType c.Type)
+
+ // Emit the constants added in the json files
+
+ let addedConstants = getAddedItems ItemKind.Constant Flavor.All
+ Array.iter emitConstantFromJson addedConstants
+
if i.Constants.IsSome then
- Array.iter dumpConstant i.Constants.Value.Constants
-
-/// Dump overloads for the createElement method
-let DumpCreateElementOverloads (m: Browser.Method) =
- if not (OptionCheckValue "createElement" m.Name) ||
- (DomTypeToTsType m.Type) <> "Element" ||
- m.Params.Length <> 1 ||
- (DomTypeToTsType m.Params.[0].Type) <> "string" then
- raise (Exception "createElement method signature does not match expected.")
- else
+ Array.iter emitConstant i.Constants.Value.Constants
+
+let matchSingleParamMethodSignature (m: Browser.Method) expectedMName expectedMType expectedParamType =
+ OptionCheckValue expectedMName m.Name &&
+ (DomTypeToTsType m.Type) = expectedMType &&
+ m.Params.Length = 1 &&
+ (DomTypeToTsType m.Params.[0].Type) = expectedParamType
+
+/// Emit overloads for the createElement method
+let EmitCreateElementOverloads (m: Browser.Method) =
+ if matchSingleParamMethodSignature m "createElement" "Element" "string" then
for e in tagNameToEleName do
if iNameToIDependList.ContainsKey e.Value && Seq.contains "HTMLElement" iNameToIDependList.[e.Value] then
Pt.printl "createElement(tagName: \"%s\"): %s;" e.Key e.Value
Pt.printl "createElement(tagName: string): HTMLElement;"
-/// Dump overloads for the getElementsByTagName method
-let DumpGetElementsByTagNameOverloads (m: Browser.Method) =
- if not (OptionCheckValue "getElementsByTagName" m.Name) ||
- (DomTypeToTsType m.Type) <> "NodeList" ||
- m.Params.Length <> 1 ||
- (DomTypeToTsType m.Params.[0].Type) <> "string" then
- raise (Exception "getElementsByTagName method signature does not match expected.")
- else
+/// Emit overloads for the getElementsByTagName method
+let EmitGetElementsByTagNameOverloads (m: Browser.Method) =
+ if matchSingleParamMethodSignature m "getElementsByTagName" "NodeList" "string" then
for e in tagNameToEleName do
Pt.printl "getElementsByTagName(%s: \"%s\"): NodeListOf<%s>;" m.Params.[0].Name (e.Key.ToLower()) e.Value
Pt.printl "getElementsByTagName(%s: string): NodeListOf;" m.Params.[0].Name
-/// Dump overloads for the createEvent method
-let DumpCreateEventOverloads (m: Browser.Method) =
- if not (OptionCheckValue "createEvent" m.Name) ||
- (DomTypeToTsType m.Type) <> "Event" ||
- m.Params.Length <> 1 ||
- (DomTypeToTsType m.Params.[0].Type) <> "string" then
- raise (Exception "createEvent method signature does not match expected.")
- else
- // Dump plurals. For example, "Events", "MutationEvents"
+/// Emit overloads for the createEvent method
+let EmitCreateEventOverloads (m: Browser.Method) =
+ if matchSingleParamMethodSignature m "createEvent" "Event" "string" then
+ // Emit plurals. For example, "Events", "MutationEvents"
let hasPlurals = ["Event"; "MutationEvent"; "MouseEvent"; "SVGZoomEvent"; "UIEvent"]
for x in distinctETypeList do
Pt.printl "createEvent(eventInterface:\"%s\"): %s;" x x
@@ -125,7 +131,7 @@ let ParamsToString (ps: Param list) =
(if p.Variadic then "[]" else "")
String.Join(", ", (List.map paramToString ps))
-let DumpMethod flavor prefix (i:Browser.Interface) (m:Browser.Method) =
+let EmitMethod flavor prefix (i:Browser.Interface) (m:Browser.Method) =
// print comment
if m.Name.IsSome then
match GetCommentForMethod i.Name m.Name.Value with
@@ -133,110 +139,104 @@ let DumpMethod flavor prefix (i:Browser.Interface) (m:Browser.Method) =
| _ -> ()
// Find if there are overriding signatures in the external json file
- // - overridenType: meaning there is a better definition of this type in the external json file
- // - removedType: meaning the type is marked as removed in the external json file
+ // - overriddenType: meaning there is a better definition of this type in the json file
+ // - removedType: meaning the type is marked as removed in the json file
// if there is any conflicts between the two, the "removedType" has a higher priority over
// the "overridenType".
- let removedType = Option.bind (fun mName -> findRemovedType mName i.Name MemberKind.Method) m.Name
- let overridenType = Option.bind (fun mName -> findOverridingType mName i.Name MemberKind.Method) m.Name
+ let removedType = Option.bind (fun name -> JsonItems.findRemovedItem name JsonItems.ItemKind.Method i.Name) m.Name
+ let overridenType = Option.bind (fun mName -> JsonItems.findOverriddenItem mName JsonItems.ItemKind.Method i.Name) m.Name
if removedType.IsNone then
match overridenType with
| Some t ->
match flavor with
- | Windows | Web -> t.WebOnlySignatures |> Array.iter (Pt.printl "%s%s;" prefix)
+ | Flavor.All | Flavor.Web -> t.WebOnlySignatures |> Array.iter (Pt.printl "%s%s;" prefix)
| _ -> ()
t.Signatures |> Array.iter (Pt.printl "%s%s;" prefix)
| None ->
match i.Name, m.Name with
- | _, Some "createElement" -> DumpCreateElementOverloads m
- | _, Some "createEvent" -> DumpCreateEventOverloads m
- | _, Some "getElementsByTagName" -> DumpGetElementsByTagNameOverloads m
+ | _, Some "createElement" -> EmitCreateElementOverloads m
+ | _, Some "createEvent" -> EmitCreateEventOverloads m
+ | _, Some "getElementsByTagName" -> EmitGetElementsByTagNameOverloads m
| _ ->
- let consoleMethodsNeedToReplaceStringWithAny = [|"dir"; "dirxml"; "error"; "info"; "log"; "warn"|]
- GetOverloads (Method m) false
- |> List.iter
- (fun { ParamCombinations = pCombList; ReturnTypes = rTypes } ->
- let paramsString =
- // Some console methods should accept "any" instead of "string" for convenience, although
- // it is said to be string in the spec
- if i.Name = "Console" && m.Name.IsSome && Array.contains m.Name.Value consoleMethodsNeedToReplaceStringWithAny then
- (ParamsToString pCombList).Replace("string", "any")
- else
- ParamsToString pCombList
- let returnString = rTypes |> List.map DomTypeToTsType |> String.concat " | "
- Pt.printl "%s%s(%s): %s;" prefix (if m.Name.IsSome then m.Name.Value else "") paramsString returnString)
-
-let DumpCallBackInterface (i:Browser.Interface) =
+ let overloads = GetOverloads (Function.Method m) false
+ for { ParamCombinations = pCombList; ReturnTypes = rTypes } in overloads do
+ let paramsString = ParamsToString pCombList
+ let returnString = rTypes |> List.map DomTypeToTsType |> String.concat " | "
+ Pt.printl "%s%s(%s): %s;" prefix (if m.Name.IsSome then m.Name.Value else "") paramsString returnString
+
+let EmitCallBackInterface (i:Browser.Interface) =
Pt.printl "interface %s {" i.Name
Pt.printWithAddedIndent "(evt: Event): void;"
Pt.printl "}"
Pt.printl ""
-let DumpCallBackFunctions flavor =
- let DumpCallBackFunction (cb: Browser.CallbackFunction) =
- Pt.printl "interface %s {" cb.Name
- match cb.Name with
- | "ErrorEventHandler" ->
- Pt.printWithAddedIndent "(message: string, filename?: string, lineno?: number, colno?: number, error?:Error): void;"
- | _ ->
- for { ParamCombinations = pCombList } in GetOverloads (CallBackFun cb) false do
- let paramsString = ParamsToString pCombList
- match cb.Type with
- | "void" ->
- Pt.printWithAddedIndent "(%s): void;" paramsString
- | _ ->
- Pt.printWithAddedIndent "(%s): %s;" paramsString (DomTypeToTsType cb.Type)
+let EmitCallBackFunctions flavor =
+ let emitCallbackFunctionsFromJson (cb: JsonItems.ItemsType.Root) =
+ Pt.printl "interface %s {" cb.Name.Value
+ cb.Signatures |> Array.iter (Pt.printWithAddedIndent "%s;")
Pt.printl "}"
-
- GetCallbackFuncsByFlavor flavor
- |> Array.filter (fun cb -> flavor <> Worker || knownWorkerInterfaces.Contains cb.Name)
- |> Array.iter DumpCallBackFunction
-
-let DumpEnums () =
- let dumpEnum (e: Browser.Enum) = Pt.printl "declare var %s: string;" e.Name
- browser.Enums |> Array.iter dumpEnum
-
-/// Dump the properties and methods of a given interface
-let DumpMembers flavor prefix (dumpScope: DumpScope) (i:Browser.Interface) =
- // -------- Dump properties --------
- // Note: the schema file shows the property doesn't have static attribute
- let dumpProperty (p: Browser.Property) =
+
+ let emitCallBackFunction (cb: Browser.CallbackFunction) =
+ if Option.isNone (findRemovedItem cb.Name ItemKind.Callback "")then
+ match findOverriddenItem cb.Name ItemKind.Callback "" with
+ | Some cb' -> emitCallbackFunctionsFromJson cb'
+ | _ ->
+ Pt.printl "interface %s {" cb.Name
+ let overloads = GetOverloads (CallBackFun cb) false
+ for { ParamCombinations = pCombList } in overloads do
+ let paramsString = ParamsToString pCombList
+ Pt.printWithAddedIndent "(%s): %s;" paramsString (DomTypeToTsType cb.Type)
+ Pt.printl "}"
+
+ getAddedItems ItemKind.Callback flavor
+ |> Array.iter emitCallbackFunctionsFromJson
+
+ GetCallbackFuncsByFlavor flavor |> Array.iter emitCallBackFunction
+
+let EmitEnums () =
+ let emitEnum (e: Browser.Enum) = Pt.printl "declare var %s: string;" e.Name
+ browser.Enums |> Array.iter emitEnum
+
+let EmitProperties flavor prefix (emitScope: EmitScope) (i: Browser.Interface)=
+ let emitPropertyFromJson (p: ItemsType.Root) =
+ Pt.printl "%s%s: %s;" prefix p.Name.Value p.Type.Value
+
+ let emitProperty (p: Browser.Property) =
match GetCommentForProperty i.Name p.Name with
| Some comment -> Pt.printl "%s" comment
| _ -> ()
- match findRemovedType p.Name i.Name MemberKind.Property with
- | Some _ -> ()
- | None ->
- match findOverridingType p.Name i.Name MemberKind.Property with
- | Some t -> Pt.printl "%s%s: %s;" prefix t.Name t.Type.Value
+ if Option.isNone (findRemovedItem p.Name ItemKind.Property i.Name) then
+ match findOverriddenItem p.Name ItemKind.Property i.Name with
+ | Some p' -> emitPropertyFromJson p'
| None ->
- let pType = match p.Type with
+ let pType =
+ match p.Type with
| "EventHandler" -> String.Format("(ev: {0}) => any", ehNameToEType.[p.Name])
| _ -> DomTypeToTsType p.Type
Pt.printl "%s%s: %s;" prefix p.Name pType
- if dumpScope <> StaticOnly then
+ // Note: the schema file shows the property doesn't have "static" attribute,
+ // therefore all properties are emited for the instance type.
+ if emitScope <> StaticOnly then
match i.Properties with
| Some ps ->
ps.Properties
|> Array.filter (ShouldKeep flavor)
- |> Array.iter dumpProperty
+ |> Array.iter emitProperty
| None -> ()
- addedTypes
- |> Array.filter (fun t -> t.Kind = "property" && (t.Interface.IsNone || t.Interface.Value = i.Name))
- |> Array.iter (fun t -> Pt.printl "%s%s: %s;" prefix t.Name t.Type.Value)
+ getAddedItems ItemKind.Property flavor
+ |> Array.filter (matchInterface i.Name)
+ |> Array.iter emitPropertyFromJson
- // -------- Dump methods --------
+let EmitMethods flavor prefix (emitScope: EmitScope) (i: Browser.Interface) =
// Note: two cases:
- // 1. dump the members inside a interface -> no need to add prefix
- // 2. dump the members outside to expose them (for "Window") -> need to add "declare"
- let methodPrefix =
- match prefix with
- | pf when pf.StartsWith("declare var") -> "declare function "
- | _ -> ""
+ // 1. emit the members inside a interface -> no need to add prefix
+ // 2. emit the members outside to expose them (for "Window") -> need to add "declare"
+ let emitMethodFromJson (m: ItemsType.Root) =
+ m.Signatures |> Array.iter (Pt.printl "%s%s;" prefix)
// Because eventhandler overload are not inherited between interfaces,
// they need to be taken care of seperately
@@ -245,42 +245,42 @@ let DumpMembers flavor prefix (dumpScope: DumpScope) (i:Browser.Interface) =
not iNameToEhList.[i.Name].IsEmpty
let mFilter (m:Browser.Method) =
- matchScope dumpScope m
- &&
+ matchScope emitScope m &&
not (hasEventHandlers && OptionCheckValue "addEventListener" m.Name)
- match i.Methods with
- | Some ms ->
- ms.Methods
- |> Array.filter mFilter
- |> Array.iter (DumpMethod flavor methodPrefix i)
- | _ -> ()
+ if i.Methods.IsSome then
+ i.Methods.Value.Methods
+ |> Array.filter mFilter
+ |> Array.iter (EmitMethod flavor prefix i)
+
+ getAddedItems ItemKind.Method flavor
+ |> Array.filter (fun m -> matchInterface i.Name m && matchScope emitScope m)
+ |> Array.iter emitMethodFromJson
// The window interface inherited some methods from "Object",
// which need to explicitly exposed
- if i.Name = "Window" && methodPrefix = "declare function " then
- Pt.printl "%stoString(): string;" methodPrefix
+ if i.Name = "Window" && prefix = "declare function " then
+ Pt.printl "%stoString(): string;" prefix
- // Issue4401:
- // Add "getElementsByClassName" to Element
- if i.Name = "Element" && dumpScope <> DumpScope.StaticOnly then
- Pt.printl "%sgetElementsByClassName(classNames: string): NodeListOf;" methodPrefix
+/// Emit the properties and methods of a given interface
+let EmitMembers flavor (prefix: string) (emitScope: EmitScope) (i:Browser.Interface) =
+ EmitProperties flavor prefix emitScope i
+ let methodPrefix = if prefix.StartsWith("declare var") then "declare function " else ""
+ EmitMethods flavor methodPrefix emitScope i
-/// Dump all members of every interfaces at the root level.
+/// Emit all members of every interfaces at the root level.
/// Called only once on the global polluter object
-let rec DumpAllMembers flavor (i:Browser.Interface) =
+let rec EmitAllMembers flavor (i:Browser.Interface) =
let prefix = "declare var "
- DumpMembers flavor prefix DumpScope.All i
+ EmitMembers flavor prefix EmitScope.All i
- iNameToIDependList.[i.Name]
- |> List.iter
- (fun relatedIName ->
- match GetInterfaceByName relatedIName with
- | Some i' -> DumpAllMembers flavor i'
- | _ -> ())
+ for relatedIName in iNameToIDependList.[i.Name] do
+ match GetInterfaceByName relatedIName with
+ | Some i' -> EmitAllMembers flavor i'
+ | _ -> ()
-let DumpEventHandlers (prefix: string) (i:Browser.Interface) =
- let DumpEventHandler prefix (eHandler: EventHandler) =
+let EmitEventHandlers (prefix: string) (i:Browser.Interface) =
+ let emitEventHandler prefix (eHandler: EventHandler) =
let actualEventType =
match i.Name, eHandler.EventName with
| "IDBDatabase", "abort"
@@ -302,16 +302,16 @@ let DumpEventHandlers (prefix: string) (i:Browser.Interface) =
// 2. Has own eventhandlers -> TypeScript's inherit mechanism erases all inherited eventhandler overloads
// so they need to be reprinted.
if iNameToEhList.ContainsKey i.Name then
- iNameToEhList.[i.Name] |> List.sortBy (fun eh -> eh.EventName) |> List.iter (DumpEventHandler fPrefix)
+ iNameToEhList.[i.Name] |> List.sortBy (fun eh -> eh.EventName) |> List.iter (emitEventHandler fPrefix)
let shouldPrintAddEventListener =
if iNameToEhList.[i.Name].Length > 0 then true
else
match i.Extends, i.Implements.Length with
| _, 0 -> false
| "Object", 1 -> false
- | _, _ ->
+ | _ ->
let allParents = Array.append [|i.Extends|] i.Implements
- match allParents |> Array.filter (fun iName -> iNameToEhList.ContainsKey iName) |> Array.length with
+ match allParents |> Array.filter iNameToEhList.ContainsKey |> Array.length with
// only one of the implemented interface has EventHandlers
| 0 | 1 -> false
// multiple implemented interfaces have EventHandlers
@@ -319,54 +319,44 @@ let DumpEventHandlers (prefix: string) (i:Browser.Interface) =
if shouldPrintAddEventListener then
Pt.printl "%saddEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;" fPrefix
-let DumpConstructorSignature (i:Browser.Interface) =
- //Dump constructor signature
- match i.Name, i.Constructor with
- // HOTFIX: The spec is not looking correct regarding the 'Blob' constructor. Filed a bug
- // and waiting for the IE team to respond
- | "Blob", _ ->
- Pt.printl "new (blobParts?: any[], options?: BlobPropertyBag): Blob;"
- | "FormData", _ ->
- Pt.printl "new (form?: HTMLFormElement): FormData;"
- | "MessageEvent", _ ->
- Pt.printl "new(type: string, eventInitDict?: MessageEventInit): MessageEvent;"
- | "ProgressEvent", _ ->
- Pt.printl "new(type: string, eventInitDict?: ProgressEventInit): ProgressEvent;"
- | "File", _ ->
- Pt.printl "new (parts: (ArrayBuffer | ArrayBufferView | Blob | string)[], filename: string, properties?: FilePropertyBag): File;"
- | _, Some ctor ->
- for { ParamCombinations = pCombList } in GetOverloads (Ctor ctor) false do
- let paramsString = ParamsToString pCombList
- Pt.printl "new(%s): %s;" paramsString i.Name
- | _ -> Pt.printl "new(): %s;" i.Name
-
-let DumpConstructor flavor (i:Browser.Interface) =
- match i.Name with
- | "ImageData" ->
- Pt.printl "interface ImageDataConstructor {"
- Pt.printWithAddedIndent "prototype: ImageData;"
- Pt.printWithAddedIndent "new(width: number, height: number): ImageData;"
- Pt.printWithAddedIndent "new(array: Uint8ClampedArray, width: number, height: number): ImageData;"
- Pt.printl "}"
- Pt.printl ""
- Pt.printl "declare var ImageData: ImageDataConstructor; "
- Pt.printl ""
- | _ ->
- Pt.printl "declare var %s: {" i.Name
- Pt.increaseIndent()
+let EmitConstructorSignature (i:Browser.Interface) =
+ let emitConstructorSigFromJson (c: ItemsType.Root) =
+ c.Signatures |> Array.iter (Pt.printl "%s;")
+
+ let removedCtor = getRemovedItems ItemKind.Constructor Flavor.All |> Array.tryFind (matchInterface i.Name)
+ if Option.isNone removedCtor then
+ let overriddenCtor = getOverriddenItems ItemKind.Constructor Flavor.All |> Array.tryFind (matchInterface i.Name)
+ match overriddenCtor with
+ | Some c' -> emitConstructorSigFromJson c'
+ | _ ->
+ //Emit constructor signature
+ match i.Constructor with
+ | Some ctor ->
+ for { ParamCombinations = pCombList } in GetOverloads (Ctor ctor) false do
+ let paramsString = ParamsToString pCombList
+ Pt.printl "new(%s): %s;" paramsString i.Name
+ | _ -> Pt.printl "new(): %s;" i.Name
+
+ getAddedItems ItemKind.Constructor Flavor.All
+ |> Array.filter (matchInterface i.Name)
+ |> Array.iter emitConstructorSigFromJson
+
+let EmitConstructor flavor (i:Browser.Interface) =
+ Pt.printl "declare var %s: {" i.Name
+ Pt.increaseIndent()
- Pt.printl "prototype: %s;" i.Name
- DumpConstructorSignature i
- DumpConstants i
- let prefix = ""
- DumpMembers flavor prefix DumpScope.StaticOnly i
+ Pt.printl "prototype: %s;" i.Name
+ EmitConstructorSignature i
+ EmitConstants i
+ let prefix = ""
+ EmitMembers flavor prefix EmitScope.StaticOnly i
- Pt.decreaseIndent()
- Pt.printl "}"
- Pt.printl ""
+ Pt.decreaseIndent()
+ Pt.printl "}"
+ Pt.printl ""
-/// Dump all the named constructors at root level
-let DumpNamedConstructors () =
+/// Emit all the named constructors at root level
+let EmitNamedConstructors () =
browser.Interfaces
|> Array.filter (fun i -> i.NamedConstructor.IsSome)
|> Array.iter
@@ -377,14 +367,15 @@ let DumpNamedConstructors () =
yield {Type = p.Type; Name = p.Name; Optional = p.Optional.IsSome; Variadic = p.Variadic.IsSome}]
Pt.printl "declare var %s: {new(%s): %s; };" nc.Name (ParamsToString ncParams) i.Name)
-let DumpInterfaceDeclaration (i:Browser.Interface) =
+let EmitInterfaceDeclaration (i:Browser.Interface) =
Pt.printl "interface %s" i.Name
match i.Extends::(List.ofArray i.Implements) with
| [""] | [] | ["Object"] -> ()
| allExtends -> Pt.print " extends %s" (String.Join(", ", allExtends))
Pt.print " {"
-let ShouldDumpIndexerSignature (i: Browser.Interface) (m: Browser.Method) =
+/// To decide if a given method is an indexer and should be emited
+let ShouldEmitIndexerSignature (i: Browser.Interface) (m: Browser.Method) =
if m.Getter.IsSome && m.Params.Length = 1 then
// TypeScript array indexer can only be number or string
// for string, it must return a more generic type then all
@@ -422,40 +413,49 @@ let ShouldDumpIndexerSignature (i: Browser.Interface) (m: Browser.Method) =
else
false
-let DumpIndexers dumpScope (i: Browser.Interface) =
- // The indices could be within either Methods or Anonymous Methods
- let ms = if i.Methods.IsSome then i.Methods.Value.Methods else [||]
- let ams = if i.AnonymousMethods.IsSome then i.AnonymousMethods.Value.Methods else [||]
+let EmitIndexers emitScope (i: Browser.Interface) =
+ let emitIndexerFromJson (id: ItemsType.Root) =
+ id.Signatures |> Array.iter (Pt.printl "%s;")
+
+ let removedIndexer = getRemovedItems ItemKind.Indexer Flavor.All |> Array.tryFind (matchInterface i.Name)
+ if removedIndexer.IsNone then
+ let overriddenIndexer = getOverriddenItems ItemKind.Indexer Flavor.All |> Array.tryFind (matchInterface i.Name)
+ match overriddenIndexer with
+ | Some id -> emitIndexerFromJson id
+ | _ ->
+ // The indices could be within either Methods or Anonymous Methods
+ let ms = if i.Methods.IsSome then i.Methods.Value.Methods else [||]
+ let ams = if i.AnonymousMethods.IsSome then i.AnonymousMethods.Value.Methods else [||]
- Array.concat [|ms; ams|]
- |> Array.filter (ShouldDumpIndexerSignature i)
- |> Array.filter (matchScope dumpScope)
- |> Array.iter (fun m ->
- let indexer = m.Params.[0]
- Pt.printl "[%s: %s]: %s;"
- indexer.Name
- (DomTypeToTsType indexer.Type)
- (DomTypeToTsType m.Type))
-
- if i.Name = "HTMLCollection" then
- Pt.printl "[index: number]: Element;"
-
-let DumpInterface flavor (i:Browser.Interface) =
+ Array.concat [|ms; ams|]
+ |> Array.filter (fun m -> ShouldEmitIndexerSignature i m && matchScope emitScope m)
+ |> Array.iter (fun m ->
+ let indexer = m.Params.[0]
+ Pt.printl "[%s: %s]: %s;"
+ indexer.Name
+ (DomTypeToTsType indexer.Type)
+ (DomTypeToTsType m.Type))
+
+ getAddedItems ItemKind.Indexer Flavor.All
+ |> Array.filter (matchInterface i.Name)
+ |> Array.iter emitIndexerFromJson
+
+let EmitInterface flavor (i:Browser.Interface) =
Pt.resetIndent()
- DumpInterfaceDeclaration i
+ EmitInterfaceDeclaration i
Pt.increaseIndent()
let prefix = ""
- DumpMembers flavor prefix DumpScope.InstanceOnly i
- DumpConstants i
- DumpEventHandlers prefix i
- DumpIndexers DumpScope.InstanceOnly i
+ EmitMembers flavor prefix EmitScope.InstanceOnly i
+ EmitConstants i
+ EmitEventHandlers prefix i
+ EmitIndexers EmitScope.InstanceOnly i
Pt.decreaseIndent()
Pt.printl "}"
Pt.printl ""
-let DumpStaticInterface flavor (i:Browser.Interface) =
+let EmitStaticInterface flavor (i:Browser.Interface) =
// Some types are static types with non-static members. For example,
// NodeFilter is a static method itself, however it has an "acceptNode" method
// that expects the user to implement.
@@ -469,58 +469,58 @@ let DumpStaticInterface flavor (i:Browser.Interface) =
// For static types with only static members, we put everything in the interface.
// Because in the two cases the interface contains different things, it might be easier to
// read to seperate them into two functions.
- let dumpStaticInterfaceWithNonStaticMembers () =
+ let emitStaticInterfaceWithNonStaticMembers () =
Pt.resetIndent()
- DumpInterfaceDeclaration i
+ EmitInterfaceDeclaration i
Pt.increaseIndent()
let prefix = ""
- DumpMembers flavor prefix DumpScope.InstanceOnly i
- DumpEventHandlers prefix i
- DumpIndexers DumpScope.InstanceOnly i
+ EmitMembers flavor prefix EmitScope.InstanceOnly i
+ EmitEventHandlers prefix i
+ EmitIndexers EmitScope.InstanceOnly i
Pt.decreaseIndent()
Pt.printl "}"
Pt.printl ""
Pt.printl "declare var %s: {" i.Name
Pt.increaseIndent()
- DumpConstants i
- DumpMembers flavor prefix DumpScope.StaticOnly i
+ EmitConstants i
+ EmitMembers flavor prefix EmitScope.StaticOnly i
Pt.decreaseIndent()
Pt.printl "}"
Pt.printl ""
- let dumpPureStaticInterface () =
+ let emitPureStaticInterface () =
Pt.resetIndent()
- DumpInterfaceDeclaration i
+ EmitInterfaceDeclaration i
Pt.increaseIndent()
let prefix = ""
- DumpMembers flavor prefix DumpScope.StaticOnly i
- DumpConstants i
- DumpEventHandlers prefix i
- DumpIndexers DumpScope.StaticOnly i
+ EmitMembers flavor prefix EmitScope.StaticOnly i
+ EmitConstants i
+ EmitEventHandlers prefix i
+ EmitIndexers EmitScope.StaticOnly i
Pt.decreaseIndent()
Pt.printl "}"
Pt.printl "declare var %s: %s;" i.Name i.Name
Pt.printl ""
- if hasNonStaticMember then dumpStaticInterfaceWithNonStaticMembers() else dumpPureStaticInterface()
+ if hasNonStaticMember then emitStaticInterfaceWithNonStaticMembers() else emitPureStaticInterface()
-let DumpNonCallbackInterfaces flavor =
+let EmitNonCallbackInterfaces flavor =
for i in GetNonCallbackInterfacesByFlavor flavor do
// If the static attribute has a value, it means the type doesn't have a constructor
if i.Static.IsSome then
- DumpStaticInterface flavor i
+ EmitStaticInterface flavor i
elif i.NoInterfaceObject.IsSome then
- DumpInterface flavor i
+ EmitInterface flavor i
else
- DumpInterface flavor i
- DumpConstructor flavor i
+ EmitInterface flavor i
+ EmitConstructor flavor i
-let DumpDictionaries flavor =
- let DumpDictionary (dict:Browser.Dictionary) =
+let EmitDictionaries flavor =
+ let emitDictionary (dict:Browser.Dictionary) =
match dict.Extends with
| "Object" -> Pt.printl "interface %s {" dict.Name
| _ -> Pt.printl "interface %s extends %s {" dict.Name dict.Extends
@@ -533,20 +533,20 @@ let DumpDictionaries flavor =
browser.Dictionaries
|> Array.filter (fun dict -> flavor <> Worker || knownWorkerInterfaces.Contains dict.Name)
- |> Array.iter DumpDictionary
+ |> Array.iter emitDictionary
-let DumpAddedInterface (t: TypesFromJsonFile.Root) =
- match t.Extends with
- | Some e -> Pt.printl "interface %s extends %s {" t.Name t.Extends.Value
- | None -> Pt.printl "interface %s {" t.Name
+let EmitAddedInterface (ai: JsonItems.ItemsType.Root) =
+ match ai.Extends with
+ | Some e -> Pt.printl "interface %s extends %s {" ai.Name.Value ai.Extends.Value
+ | None -> Pt.printl "interface %s {" ai.Name.Value
- t.Properties |> Array.iter (fun p -> Pt.printWithAddedIndent "%s: %s;" p.Name p.Type)
- t.Methods |> Array.collect (fun m -> m.Signatures) |> Array.iter (Pt.printWithAddedIndent "%s;")
- t.Indexer |> Array.collect (fun i -> i.Signatures) |> Array.iter (Pt.printWithAddedIndent "%s;")
+ ai.Properties |> Array.iter (fun p -> Pt.printWithAddedIndent "%s: %s;" p.Name p.Type)
+ ai.Methods |> Array.collect (fun m -> m.Signatures) |> Array.iter (Pt.printWithAddedIndent "%s;")
+ ai.Indexer |> Array.collect (fun i -> i.Signatures) |> Array.iter (Pt.printWithAddedIndent "%s;")
Pt.printl "}"
Pt.printl ""
-let DumpTheWholeThing flavor (target:TextWriter) =
+let EmitTheWholeThing flavor (target:TextWriter) =
Pt.reset()
Pt.printl "/////////////////////////////"
match flavor with
@@ -555,33 +555,34 @@ let DumpTheWholeThing flavor (target:TextWriter) =
Pt.printl "/////////////////////////////"
Pt.printl ""
- DumpDictionaries flavor
- DumpCallBackInterface browser.CallbackInterfaces.Interface
- DumpNonCallbackInterfaces flavor
+ EmitDictionaries flavor
+ EmitCallBackInterface browser.CallbackInterfaces.Interface
+ EmitNonCallbackInterfaces flavor
// Add missed interface definition from the spec
- getAllAddedInterfaces flavor |> Array.iter DumpAddedInterface
+ JsonItems.getAddedItems JsonItems.Interface flavor |> Array.iter EmitAddedInterface
Pt.printl "declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;"
Pt.printl ""
- DumpCallBackFunctions flavor
+ EmitCallBackFunctions flavor
if flavor <> Worker then
- DumpNamedConstructors()
+ EmitNamedConstructors()
match GetGlobalPollutor flavor with
| Some gp ->
- DumpAllMembers flavor gp
- DumpEventHandlers "declare var " gp
+ EmitAllMembers flavor gp
+ EmitEventHandlers "declare var " gp
| _ -> ()
fprintf target "%s" (Pt.getResult())
target.Flush()
+ target.Close()
-let DumpDomWeb () =
- DumpTheWholeThing Windows GlobalVars.tsWebOutput
+let EmitDomWeb () =
+ EmitTheWholeThing Flavor.All GlobalVars.tsWebOutput
-let DumpDomWorker () =
+let EmitDomWorker () =
ignoreDOMTypes <- true
- DumpTheWholeThing Worker GlobalVars.tsWorkerOutput
\ No newline at end of file
+ EmitTheWholeThing Flavor.Worker GlobalVars.tsWorkerOutput
\ No newline at end of file
diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts
new file mode 100644
index 000000000..3453d0ba5
--- /dev/null
+++ b/baselines/dom.generated.d.ts
@@ -0,0 +1,12878 @@
+
+/////////////////////////////
+/// IE DOM APIs
+/////////////////////////////
+
+interface Algorithm {
+ name?: string;
+}
+
+interface AriaRequestEventInit extends EventInit {
+ attributeName?: string;
+ attributeValue?: string;
+}
+
+interface ClipboardEventInit extends EventInit {
+ data?: string;
+ dataType?: string;
+}
+
+interface CommandEventInit extends EventInit {
+ commandName?: string;
+ detail?: string;
+}
+
+interface CompositionEventInit extends UIEventInit {
+ data?: string;
+}
+
+interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation {
+ arrayOfDomainStrings?: string[];
+}
+
+interface CustomEventInit extends EventInit {
+ detail?: any;
+}
+
+interface DeviceAccelerationDict {
+ x?: number;
+ y?: number;
+ z?: number;
+}
+
+interface DeviceRotationRateDict {
+ alpha?: number;
+ beta?: number;
+ gamma?: number;
+}
+
+interface EventInit {
+ bubbles?: boolean;
+ cancelable?: boolean;
+}
+
+interface ExceptionInformation {
+ domain?: string;
+}
+
+interface FocusEventInit extends UIEventInit {
+ relatedTarget?: EventTarget;
+}
+
+interface HashChangeEventInit extends EventInit {
+ newURL?: string;
+ oldURL?: string;
+}
+
+interface KeyAlgorithm {
+ name?: string;
+}
+
+interface KeyboardEventInit extends SharedKeyboardAndMouseEventInit {
+ key?: string;
+ location?: number;
+ repeat?: boolean;
+}
+
+interface MouseEventInit extends SharedKeyboardAndMouseEventInit {
+ screenX?: number;
+ screenY?: number;
+ clientX?: number;
+ clientY?: number;
+ button?: number;
+ buttons?: number;
+ relatedTarget?: EventTarget;
+}
+
+interface MsZoomToOptions {
+ contentX?: number;
+ contentY?: number;
+ viewportX?: string;
+ viewportY?: string;
+ scaleFactor?: number;
+ animate?: string;
+}
+
+interface MutationObserverInit {
+ childList?: boolean;
+ attributes?: boolean;
+ characterData?: boolean;
+ subtree?: boolean;
+ attributeOldValue?: boolean;
+ characterDataOldValue?: boolean;
+ attributeFilter?: string[];
+}
+
+interface ObjectURLOptions {
+ oneTimeOnly?: boolean;
+}
+
+interface PointerEventInit extends MouseEventInit {
+ pointerId?: number;
+ width?: number;
+ height?: number;
+ pressure?: number;
+ tiltX?: number;
+ tiltY?: number;
+ pointerType?: string;
+ isPrimary?: boolean;
+}
+
+interface PositionOptions {
+ enableHighAccuracy?: boolean;
+ timeout?: number;
+ maximumAge?: number;
+}
+
+interface SharedKeyboardAndMouseEventInit extends UIEventInit {
+ ctrlKey?: boolean;
+ shiftKey?: boolean;
+ altKey?: boolean;
+ metaKey?: boolean;
+ keyModifierStateAltGraph?: boolean;
+ keyModifierStateCapsLock?: boolean;
+ keyModifierStateFn?: boolean;
+ keyModifierStateFnLock?: boolean;
+ keyModifierStateHyper?: boolean;
+ keyModifierStateNumLock?: boolean;
+ keyModifierStateOS?: boolean;
+ keyModifierStateScrollLock?: boolean;
+ keyModifierStateSuper?: boolean;
+ keyModifierStateSymbol?: boolean;
+ keyModifierStateSymbolLock?: boolean;
+}
+
+interface StoreExceptionsInformation extends ExceptionInformation {
+ siteName?: string;
+ explanationString?: string;
+ detailURI?: string;
+}
+
+interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation {
+ arrayOfDomainStrings?: string[];
+}
+
+interface UIEventInit extends EventInit {
+ view?: Window;
+ detail?: number;
+}
+
+interface WebGLContextAttributes {
+ alpha?: boolean;
+ depth?: boolean;
+ stencil?: boolean;
+ antialias?: boolean;
+ premultipliedAlpha?: boolean;
+ preserveDrawingBuffer?: boolean;
+}
+
+interface WebGLContextEventInit extends EventInit {
+ statusMessage?: string;
+}
+
+interface WheelEventInit extends MouseEventInit {
+ deltaX?: number;
+ deltaY?: number;
+ deltaZ?: number;
+ deltaMode?: number;
+}
+
+interface EventListener {
+ (evt: Event): void;
+}
+
+interface ANGLE_instanced_arrays {
+ drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void;
+ drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void;
+ vertexAttribDivisorANGLE(index: number, divisor: number): void;
+ VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number;
+}
+
+declare var ANGLE_instanced_arrays: {
+ prototype: ANGLE_instanced_arrays;
+ new(): ANGLE_instanced_arrays;
+ VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number;
+}
+
+interface AnalyserNode extends AudioNode {
+ fftSize: number;
+ frequencyBinCount: number;
+ maxDecibels: number;
+ minDecibels: number;
+ smoothingTimeConstant: number;
+ getByteFrequencyData(array: Uint8Array): void;
+ getByteTimeDomainData(array: Uint8Array): void;
+ getFloatFrequencyData(array: Float32Array): void;
+ getFloatTimeDomainData(array: Float32Array): void;
+}
+
+declare var AnalyserNode: {
+ prototype: AnalyserNode;
+ new(): AnalyserNode;
+}
+
+interface AnimationEvent extends Event {
+ animationName: string;
+ elapsedTime: number;
+ initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void;
+}
+
+declare var AnimationEvent: {
+ prototype: AnimationEvent;
+ new(): AnimationEvent;
+}
+
+interface ApplicationCache extends EventTarget {
+ oncached: (ev: Event) => any;
+ onchecking: (ev: Event) => any;
+ ondownloading: (ev: Event) => any;
+ onerror: (ev: Event) => any;
+ onnoupdate: (ev: Event) => any;
+ onobsolete: (ev: Event) => any;
+ onprogress: (ev: ProgressEvent) => any;
+ onupdateready: (ev: Event) => any;
+ status: number;
+ abort(): void;
+ swapCache(): void;
+ update(): void;
+ CHECKING: number;
+ DOWNLOADING: number;
+ IDLE: number;
+ OBSOLETE: number;
+ UNCACHED: number;
+ UPDATEREADY: number;
+ addEventListener(type: "cached", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "checking", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "downloading", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "noupdate", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "obsolete", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "updateready", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var ApplicationCache: {
+ prototype: ApplicationCache;
+ new(): ApplicationCache;
+ CHECKING: number;
+ DOWNLOADING: number;
+ IDLE: number;
+ OBSOLETE: number;
+ UNCACHED: number;
+ UPDATEREADY: number;
+}
+
+interface AriaRequestEvent extends Event {
+ attributeName: string;
+ attributeValue: string;
+}
+
+declare var AriaRequestEvent: {
+ prototype: AriaRequestEvent;
+ new(type: string, eventInitDict?: AriaRequestEventInit): AriaRequestEvent;
+}
+
+interface Attr extends Node {
+ name: string;
+ ownerElement: Element;
+ specified: boolean;
+ value: string;
+}
+
+declare var Attr: {
+ prototype: Attr;
+ new(): Attr;
+}
+
+interface AudioBuffer {
+ duration: number;
+ length: number;
+ numberOfChannels: number;
+ sampleRate: number;
+ getChannelData(channel: number): Float32Array;
+}
+
+declare var AudioBuffer: {
+ prototype: AudioBuffer;
+ new(): AudioBuffer;
+}
+
+interface AudioBufferSourceNode extends AudioNode {
+ buffer: AudioBuffer;
+ loop: boolean;
+ loopEnd: number;
+ loopStart: number;
+ onended: (ev: Event) => any;
+ playbackRate: AudioParam;
+ start(when?: number, offset?: number, duration?: number): void;
+ stop(when?: number): void;
+ addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var AudioBufferSourceNode: {
+ prototype: AudioBufferSourceNode;
+ new(): AudioBufferSourceNode;
+}
+
+interface AudioContext extends EventTarget {
+ currentTime: number;
+ destination: AudioDestinationNode;
+ listener: AudioListener;
+ sampleRate: number;
+ createAnalyser(): AnalyserNode;
+ createBiquadFilter(): BiquadFilterNode;
+ createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer;
+ createBufferSource(): AudioBufferSourceNode;
+ createChannelMerger(numberOfInputs?: number): ChannelMergerNode;
+ createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode;
+ createConvolver(): ConvolverNode;
+ createDelay(maxDelayTime?: number): DelayNode;
+ createDynamicsCompressor(): DynamicsCompressorNode;
+ createGain(): GainNode;
+ createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode;
+ createOscillator(): OscillatorNode;
+ createPanner(): PannerNode;
+ createPeriodicWave(real: Float32Array, imag: Float32Array): PeriodicWave;
+ createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode;
+ createStereoPanner(): StereoPannerNode;
+ createWaveShaper(): WaveShaperNode;
+ decodeAudioData(audioData: ArrayBuffer, successCallback: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): void;
+}
+
+declare var AudioContext: {
+ prototype: AudioContext;
+ new(): AudioContext;
+}
+
+interface AudioDestinationNode extends AudioNode {
+ maxChannelCount: number;
+}
+
+declare var AudioDestinationNode: {
+ prototype: AudioDestinationNode;
+ new(): AudioDestinationNode;
+}
+
+interface AudioListener {
+ dopplerFactor: number;
+ speedOfSound: number;
+ setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void;
+ setPosition(x: number, y: number, z: number): void;
+ setVelocity(x: number, y: number, z: number): void;
+}
+
+declare var AudioListener: {
+ prototype: AudioListener;
+ new(): AudioListener;
+}
+
+interface AudioNode extends EventTarget {
+ channelCount: number;
+ channelCountMode: string;
+ channelInterpretation: string;
+ context: AudioContext;
+ numberOfInputs: number;
+ numberOfOutputs: number;
+ connect(destination: AudioNode, output?: number, input?: number): void;
+ disconnect(output?: number): void;
+}
+
+declare var AudioNode: {
+ prototype: AudioNode;
+ new(): AudioNode;
+}
+
+interface AudioParam {
+ defaultValue: number;
+ value: number;
+ cancelScheduledValues(startTime: number): void;
+ exponentialRampToValueAtTime(value: number, endTime: number): void;
+ linearRampToValueAtTime(value: number, endTime: number): void;
+ setTargetAtTime(target: number, startTime: number, timeConstant: number): void;
+ setValueAtTime(value: number, startTime: number): void;
+ setValueCurveAtTime(values: Float32Array, startTime: number, duration: number): void;
+}
+
+declare var AudioParam: {
+ prototype: AudioParam;
+ new(): AudioParam;
+}
+
+interface AudioProcessingEvent extends Event {
+ inputBuffer: AudioBuffer;
+ outputBuffer: AudioBuffer;
+ playbackTime: number;
+}
+
+declare var AudioProcessingEvent: {
+ prototype: AudioProcessingEvent;
+ new(): AudioProcessingEvent;
+}
+
+interface AudioTrack {
+ enabled: boolean;
+ id: string;
+ kind: string;
+ label: string;
+ language: string;
+ sourceBuffer: SourceBuffer;
+}
+
+declare var AudioTrack: {
+ prototype: AudioTrack;
+ new(): AudioTrack;
+}
+
+interface AudioTrackList extends EventTarget {
+ length: number;
+ onaddtrack: (ev: TrackEvent) => any;
+ onchange: (ev: Event) => any;
+ onremovetrack: (ev: TrackEvent) => any;
+ getTrackById(id: string): AudioTrack;
+ item(index: number): AudioTrack;
+ addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "removetrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+ [index: number]: AudioTrack;
+}
+
+declare var AudioTrackList: {
+ prototype: AudioTrackList;
+ new(): AudioTrackList;
+}
+
+interface BarProp {
+ visible: boolean;
+}
+
+declare var BarProp: {
+ prototype: BarProp;
+ new(): BarProp;
+}
+
+interface BeforeUnloadEvent extends Event {
+ returnValue: any;
+}
+
+declare var BeforeUnloadEvent: {
+ prototype: BeforeUnloadEvent;
+ new(): BeforeUnloadEvent;
+}
+
+interface BiquadFilterNode extends AudioNode {
+ Q: AudioParam;
+ detune: AudioParam;
+ frequency: AudioParam;
+ gain: AudioParam;
+ type: string;
+ getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void;
+}
+
+declare var BiquadFilterNode: {
+ prototype: BiquadFilterNode;
+ new(): BiquadFilterNode;
+}
+
+interface Blob {
+ size: number;
+ type: string;
+ msClose(): void;
+ msDetachStream(): any;
+ slice(start?: number, end?: number, contentType?: string): Blob;
+}
+
+declare var Blob: {
+ prototype: Blob;
+ new (blobParts?: any[], options?: BlobPropertyBag): Blob;
+}
+
+interface CDATASection extends Text {
+}
+
+declare var CDATASection: {
+ prototype: CDATASection;
+ new(): CDATASection;
+}
+
+interface CSS {
+ supports(property: string, value?: string): boolean;
+}
+declare var CSS: CSS;
+
+interface CSSConditionRule extends CSSGroupingRule {
+ conditionText: string;
+}
+
+declare var CSSConditionRule: {
+ prototype: CSSConditionRule;
+ new(): CSSConditionRule;
+}
+
+interface CSSFontFaceRule extends CSSRule {
+ style: CSSStyleDeclaration;
+}
+
+declare var CSSFontFaceRule: {
+ prototype: CSSFontFaceRule;
+ new(): CSSFontFaceRule;
+}
+
+interface CSSGroupingRule extends CSSRule {
+ cssRules: CSSRuleList;
+ deleteRule(index?: number): void;
+ insertRule(rule: string, index?: number): number;
+}
+
+declare var CSSGroupingRule: {
+ prototype: CSSGroupingRule;
+ new(): CSSGroupingRule;
+}
+
+interface CSSImportRule extends CSSRule {
+ href: string;
+ media: MediaList;
+ styleSheet: CSSStyleSheet;
+}
+
+declare var CSSImportRule: {
+ prototype: CSSImportRule;
+ new(): CSSImportRule;
+}
+
+interface CSSKeyframeRule extends CSSRule {
+ keyText: string;
+ style: CSSStyleDeclaration;
+}
+
+declare var CSSKeyframeRule: {
+ prototype: CSSKeyframeRule;
+ new(): CSSKeyframeRule;
+}
+
+interface CSSKeyframesRule extends CSSRule {
+ cssRules: CSSRuleList;
+ name: string;
+ appendRule(rule: string): void;
+ deleteRule(rule: string): void;
+ findRule(rule: string): CSSKeyframeRule;
+}
+
+declare var CSSKeyframesRule: {
+ prototype: CSSKeyframesRule;
+ new(): CSSKeyframesRule;
+}
+
+interface CSSMediaRule extends CSSConditionRule {
+ media: MediaList;
+}
+
+declare var CSSMediaRule: {
+ prototype: CSSMediaRule;
+ new(): CSSMediaRule;
+}
+
+interface CSSNamespaceRule extends CSSRule {
+ namespaceURI: string;
+ prefix: string;
+}
+
+declare var CSSNamespaceRule: {
+ prototype: CSSNamespaceRule;
+ new(): CSSNamespaceRule;
+}
+
+interface CSSPageRule extends CSSRule {
+ pseudoClass: string;
+ selector: string;
+ selectorText: string;
+ style: CSSStyleDeclaration;
+}
+
+declare var CSSPageRule: {
+ prototype: CSSPageRule;
+ new(): CSSPageRule;
+}
+
+interface CSSRule {
+ cssText: string;
+ parentRule: CSSRule;
+ parentStyleSheet: CSSStyleSheet;
+ type: number;
+ CHARSET_RULE: number;
+ FONT_FACE_RULE: number;
+ IMPORT_RULE: number;
+ KEYFRAMES_RULE: number;
+ KEYFRAME_RULE: number;
+ MEDIA_RULE: number;
+ NAMESPACE_RULE: number;
+ PAGE_RULE: number;
+ STYLE_RULE: number;
+ SUPPORTS_RULE: number;
+ UNKNOWN_RULE: number;
+ VIEWPORT_RULE: number;
+}
+
+declare var CSSRule: {
+ prototype: CSSRule;
+ new(): CSSRule;
+ CHARSET_RULE: number;
+ FONT_FACE_RULE: number;
+ IMPORT_RULE: number;
+ KEYFRAMES_RULE: number;
+ KEYFRAME_RULE: number;
+ MEDIA_RULE: number;
+ NAMESPACE_RULE: number;
+ PAGE_RULE: number;
+ STYLE_RULE: number;
+ SUPPORTS_RULE: number;
+ UNKNOWN_RULE: number;
+ VIEWPORT_RULE: number;
+}
+
+interface CSSRuleList {
+ length: number;
+ item(index: number): CSSRule;
+ [index: number]: CSSRule;
+}
+
+declare var CSSRuleList: {
+ prototype: CSSRuleList;
+ new(): CSSRuleList;
+}
+
+interface CSSStyleDeclaration {
+ alignContent: string;
+ alignItems: string;
+ alignSelf: string;
+ alignmentBaseline: string;
+ animation: string;
+ animationDelay: string;
+ animationDirection: string;
+ animationDuration: string;
+ animationFillMode: string;
+ animationIterationCount: string;
+ animationName: string;
+ animationPlayState: string;
+ animationTimingFunction: string;
+ backfaceVisibility: string;
+ background: string;
+ backgroundAttachment: string;
+ backgroundClip: string;
+ backgroundColor: string;
+ backgroundImage: string;
+ backgroundOrigin: string;
+ backgroundPosition: string;
+ backgroundPositionX: string;
+ backgroundPositionY: string;
+ backgroundRepeat: string;
+ backgroundSize: string;
+ baselineShift: string;
+ border: string;
+ borderBottom: string;
+ borderBottomColor: string;
+ borderBottomLeftRadius: string;
+ borderBottomRightRadius: string;
+ borderBottomStyle: string;
+ borderBottomWidth: string;
+ borderCollapse: string;
+ borderColor: string;
+ borderImage: string;
+ borderImageOutset: string;
+ borderImageRepeat: string;
+ borderImageSlice: string;
+ borderImageSource: string;
+ borderImageWidth: string;
+ borderLeft: string;
+ borderLeftColor: string;
+ borderLeftStyle: string;
+ borderLeftWidth: string;
+ borderRadius: string;
+ borderRight: string;
+ borderRightColor: string;
+ borderRightStyle: string;
+ borderRightWidth: string;
+ borderSpacing: string;
+ borderStyle: string;
+ borderTop: string;
+ borderTopColor: string;
+ borderTopLeftRadius: string;
+ borderTopRightRadius: string;
+ borderTopStyle: string;
+ borderTopWidth: string;
+ borderWidth: string;
+ bottom: string;
+ boxShadow: string;
+ boxSizing: string;
+ breakAfter: string;
+ breakBefore: string;
+ breakInside: string;
+ captionSide: string;
+ clear: string;
+ clip: string;
+ clipPath: string;
+ clipRule: string;
+ color: string;
+ colorInterpolationFilters: string;
+ columnCount: any;
+ columnFill: string;
+ columnGap: any;
+ columnRule: string;
+ columnRuleColor: any;
+ columnRuleStyle: string;
+ columnRuleWidth: any;
+ columnSpan: string;
+ columnWidth: any;
+ columns: string;
+ content: string;
+ counterIncrement: string;
+ counterReset: string;
+ cssFloat: string;
+ cssText: string;
+ cursor: string;
+ direction: string;
+ display: string;
+ dominantBaseline: string;
+ emptyCells: string;
+ enableBackground: string;
+ fill: string;
+ fillOpacity: string;
+ fillRule: string;
+ filter: string;
+ flex: string;
+ flexBasis: string;
+ flexDirection: string;
+ flexFlow: string;
+ flexGrow: string;
+ flexShrink: string;
+ flexWrap: string;
+ floodColor: string;
+ floodOpacity: string;
+ font: string;
+ fontFamily: string;
+ fontFeatureSettings: string;
+ fontSize: string;
+ fontSizeAdjust: string;
+ fontStretch: string;
+ fontStyle: string;
+ fontVariant: string;
+ fontWeight: string;
+ glyphOrientationHorizontal: string;
+ glyphOrientationVertical: string;
+ height: string;
+ imeMode: string;
+ justifyContent: string;
+ kerning: string;
+ left: string;
+ length: number;
+ letterSpacing: string;
+ lightingColor: string;
+ lineHeight: string;
+ listStyle: string;
+ listStyleImage: string;
+ listStylePosition: string;
+ listStyleType: string;
+ margin: string;
+ marginBottom: string;
+ marginLeft: string;
+ marginRight: string;
+ marginTop: string;
+ marker: string;
+ markerEnd: string;
+ markerMid: string;
+ markerStart: string;
+ mask: string;
+ maxHeight: string;
+ maxWidth: string;
+ minHeight: string;
+ minWidth: string;
+ msContentZoomChaining: string;
+ msContentZoomLimit: string;
+ msContentZoomLimitMax: any;
+ msContentZoomLimitMin: any;
+ msContentZoomSnap: string;
+ msContentZoomSnapPoints: string;
+ msContentZoomSnapType: string;
+ msContentZooming: string;
+ msFlowFrom: string;
+ msFlowInto: string;
+ msFontFeatureSettings: string;
+ msGridColumn: any;
+ msGridColumnAlign: string;
+ msGridColumnSpan: any;
+ msGridColumns: string;
+ msGridRow: any;
+ msGridRowAlign: string;
+ msGridRowSpan: any;
+ msGridRows: string;
+ msHighContrastAdjust: string;
+ msHyphenateLimitChars: string;
+ msHyphenateLimitLines: any;
+ msHyphenateLimitZone: any;
+ msHyphens: string;
+ msImeAlign: string;
+ msOverflowStyle: string;
+ msScrollChaining: string;
+ msScrollLimit: string;
+ msScrollLimitXMax: any;
+ msScrollLimitXMin: any;
+ msScrollLimitYMax: any;
+ msScrollLimitYMin: any;
+ msScrollRails: string;
+ msScrollSnapPointsX: string;
+ msScrollSnapPointsY: string;
+ msScrollSnapType: string;
+ msScrollSnapX: string;
+ msScrollSnapY: string;
+ msScrollTranslation: string;
+ msTextCombineHorizontal: string;
+ msTextSizeAdjust: any;
+ msTouchAction: string;
+ msTouchSelect: string;
+ msUserSelect: string;
+ msWrapFlow: string;
+ msWrapMargin: any;
+ msWrapThrough: string;
+ opacity: string;
+ order: string;
+ orphans: string;
+ outline: string;
+ outlineColor: string;
+ outlineStyle: string;
+ outlineWidth: string;
+ overflow: string;
+ overflowX: string;
+ overflowY: string;
+ padding: string;
+ paddingBottom: string;
+ paddingLeft: string;
+ paddingRight: string;
+ paddingTop: string;
+ pageBreakAfter: string;
+ pageBreakBefore: string;
+ pageBreakInside: string;
+ parentRule: CSSRule;
+ perspective: string;
+ perspectiveOrigin: string;
+ pointerEvents: string;
+ position: string;
+ quotes: string;
+ right: string;
+ rubyAlign: string;
+ rubyOverhang: string;
+ rubyPosition: string;
+ stopColor: string;
+ stopOpacity: string;
+ stroke: string;
+ strokeDasharray: string;
+ strokeDashoffset: string;
+ strokeLinecap: string;
+ strokeLinejoin: string;
+ strokeMiterlimit: string;
+ strokeOpacity: string;
+ strokeWidth: string;
+ tableLayout: string;
+ textAlign: string;
+ textAlignLast: string;
+ textAnchor: string;
+ textDecoration: string;
+ textFillColor: string;
+ textIndent: string;
+ textJustify: string;
+ textKashida: string;
+ textKashidaSpace: string;
+ textOverflow: string;
+ textShadow: string;
+ textTransform: string;
+ textUnderlinePosition: string;
+ top: string;
+ touchAction: string;
+ transform: string;
+ transformOrigin: string;
+ transformStyle: string;
+ transition: string;
+ transitionDelay: string;
+ transitionDuration: string;
+ transitionProperty: string;
+ transitionTimingFunction: string;
+ unicodeBidi: string;
+ verticalAlign: string;
+ visibility: string;
+ webkitAlignContent: string;
+ webkitAlignItems: string;
+ webkitAlignSelf: string;
+ webkitAnimation: string;
+ webkitAnimationDelay: string;
+ webkitAnimationDirection: string;
+ webkitAnimationDuration: string;
+ webkitAnimationFillMode: string;
+ webkitAnimationIterationCount: string;
+ webkitAnimationName: string;
+ webkitAnimationPlayState: string;
+ webkitAnimationTimingFunction: string;
+ webkitAppearance: string;
+ webkitBackfaceVisibility: string;
+ webkitBackground: string;
+ webkitBackgroundAttachment: string;
+ webkitBackgroundClip: string;
+ webkitBackgroundColor: string;
+ webkitBackgroundImage: string;
+ webkitBackgroundOrigin: string;
+ webkitBackgroundPosition: string;
+ webkitBackgroundPositionX: string;
+ webkitBackgroundPositionY: string;
+ webkitBackgroundRepeat: string;
+ webkitBackgroundSize: string;
+ webkitBorderBottomLeftRadius: string;
+ webkitBorderBottomRightRadius: string;
+ webkitBorderImage: string;
+ webkitBorderImageOutset: string;
+ webkitBorderImageRepeat: string;
+ webkitBorderImageSlice: string;
+ webkitBorderImageSource: string;
+ webkitBorderImageWidth: string;
+ webkitBorderRadius: string;
+ webkitBorderTopLeftRadius: string;
+ webkitBorderTopRightRadius: string;
+ webkitBoxAlign: string;
+ webkitBoxDirection: string;
+ webkitBoxFlex: string;
+ webkitBoxOrdinalGroup: string;
+ webkitBoxOrient: string;
+ webkitBoxPack: string;
+ webkitBoxSizing: string;
+ webkitColumnBreakAfter: string;
+ webkitColumnBreakBefore: string;
+ webkitColumnBreakInside: string;
+ webkitColumnCount: any;
+ webkitColumnGap: any;
+ webkitColumnRule: string;
+ webkitColumnRuleColor: any;
+ webkitColumnRuleStyle: string;
+ webkitColumnRuleWidth: any;
+ webkitColumnSpan: string;
+ webkitColumnWidth: any;
+ webkitColumns: string;
+ webkitFilter: string;
+ webkitFlex: string;
+ webkitFlexBasis: string;
+ webkitFlexDirection: string;
+ webkitFlexFlow: string;
+ webkitFlexGrow: string;
+ webkitFlexShrink: string;
+ webkitFlexWrap: string;
+ webkitJustifyContent: string;
+ webkitOrder: string;
+ webkitPerspective: string;
+ webkitPerspectiveOrigin: string;
+ webkitTapHighlightColor: string;
+ webkitTextFillColor: string;
+ webkitTextSizeAdjust: any;
+ webkitTransform: string;
+ webkitTransformOrigin: string;
+ webkitTransformStyle: string;
+ webkitTransition: string;
+ webkitTransitionDelay: string;
+ webkitTransitionDuration: string;
+ webkitTransitionProperty: string;
+ webkitTransitionTimingFunction: string;
+ webkitUserSelect: string;
+ webkitWritingMode: string;
+ whiteSpace: string;
+ widows: string;
+ width: string;
+ wordBreak: string;
+ wordSpacing: string;
+ wordWrap: string;
+ writingMode: string;
+ zIndex: string;
+ zoom: string;
+ getPropertyPriority(propertyName: string): string;
+ getPropertyValue(propertyName: string): string;
+ item(index: number): string;
+ removeProperty(propertyName: string): string;
+ setProperty(propertyName: string, value: string, priority?: string): void;
+ [index: number]: string;
+}
+
+declare var CSSStyleDeclaration: {
+ prototype: CSSStyleDeclaration;
+ new(): CSSStyleDeclaration;
+}
+
+interface CSSStyleRule extends CSSRule {
+ readOnly: boolean;
+ selectorText: string;
+ style: CSSStyleDeclaration;
+}
+
+declare var CSSStyleRule: {
+ prototype: CSSStyleRule;
+ new(): CSSStyleRule;
+}
+
+interface CSSStyleSheet extends StyleSheet {
+ cssRules: CSSRuleList;
+ cssText: string;
+ href: string;
+ id: string;
+ imports: StyleSheetList;
+ isAlternate: boolean;
+ isPrefAlternate: boolean;
+ ownerRule: CSSRule;
+ owningElement: Element;
+ pages: StyleSheetPageList;
+ readOnly: boolean;
+ rules: CSSRuleList;
+ addImport(bstrURL: string, lIndex?: number): number;
+ addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number;
+ addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number;
+ deleteRule(index?: number): void;
+ insertRule(rule: string, index?: number): number;
+ removeImport(lIndex: number): void;
+ removeRule(lIndex: number): void;
+}
+
+declare var CSSStyleSheet: {
+ prototype: CSSStyleSheet;
+ new(): CSSStyleSheet;
+}
+
+interface CSSSupportsRule extends CSSConditionRule {
+}
+
+declare var CSSSupportsRule: {
+ prototype: CSSSupportsRule;
+ new(): CSSSupportsRule;
+}
+
+interface CanvasGradient {
+ addColorStop(offset: number, color: string): void;
+}
+
+declare var CanvasGradient: {
+ prototype: CanvasGradient;
+ new(): CanvasGradient;
+}
+
+interface CanvasPattern {
+}
+
+declare var CanvasPattern: {
+ prototype: CanvasPattern;
+ new(): CanvasPattern;
+}
+
+interface CanvasRenderingContext2D {
+ canvas: HTMLCanvasElement;
+ fillStyle: string | CanvasGradient | CanvasPattern;
+ font: string;
+ globalAlpha: number;
+ globalCompositeOperation: string;
+ lineCap: string;
+ lineDashOffset: number;
+ lineJoin: string;
+ lineWidth: number;
+ miterLimit: number;
+ msFillRule: string;
+ msImageSmoothingEnabled: boolean;
+ shadowBlur: number;
+ shadowColor: string;
+ shadowOffsetX: number;
+ shadowOffsetY: number;
+ strokeStyle: string | CanvasGradient | CanvasPattern;
+ textAlign: string;
+ textBaseline: string;
+ arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;
+ arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;
+ beginPath(): void;
+ bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void;
+ clearRect(x: number, y: number, w: number, h: number): void;
+ clip(fillRule?: string): void;
+ closePath(): void;
+ createImageData(imageDataOrSw: number | ImageData, sh?: number): ImageData;
+ createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient;
+ createPattern(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, repetition: string): CanvasPattern;
+ createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient;
+ drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void;
+ fill(fillRule?: string): void;
+ fillRect(x: number, y: number, w: number, h: number): void;
+ fillText(text: string, x: number, y: number, maxWidth?: number): void;
+ getImageData(sx: number, sy: number, sw: number, sh: number): ImageData;
+ getLineDash(): number[];
+ isPointInPath(x: number, y: number, fillRule?: string): boolean;
+ lineTo(x: number, y: number): void;
+ measureText(text: string): TextMetrics;
+ moveTo(x: number, y: number): void;
+ putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void;
+ quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;
+ rect(x: number, y: number, w: number, h: number): void;
+ restore(): void;
+ rotate(angle: number): void;
+ save(): void;
+ scale(x: number, y: number): void;
+ setLineDash(segments: number[]): void;
+ setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void;
+ stroke(): void;
+ strokeRect(x: number, y: number, w: number, h: number): void;
+ strokeText(text: string, x: number, y: number, maxWidth?: number): void;
+ transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void;
+ translate(x: number, y: number): void;
+}
+
+declare var CanvasRenderingContext2D: {
+ prototype: CanvasRenderingContext2D;
+ new(): CanvasRenderingContext2D;
+}
+
+interface ChannelMergerNode extends AudioNode {
+}
+
+declare var ChannelMergerNode: {
+ prototype: ChannelMergerNode;
+ new(): ChannelMergerNode;
+}
+
+interface ChannelSplitterNode extends AudioNode {
+}
+
+declare var ChannelSplitterNode: {
+ prototype: ChannelSplitterNode;
+ new(): ChannelSplitterNode;
+}
+
+interface CharacterData extends Node, ChildNode {
+ data: string;
+ length: number;
+ appendData(arg: string): void;
+ deleteData(offset: number, count: number): void;
+ insertData(offset: number, arg: string): void;
+ replaceData(offset: number, count: number, arg: string): void;
+ substringData(offset: number, count: number): string;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var CharacterData: {
+ prototype: CharacterData;
+ new(): CharacterData;
+}
+
+interface ClientRect {
+ bottom: number;
+ height: number;
+ left: number;
+ right: number;
+ top: number;
+ width: number;
+}
+
+declare var ClientRect: {
+ prototype: ClientRect;
+ new(): ClientRect;
+}
+
+interface ClientRectList {
+ length: number;
+ item(index: number): ClientRect;
+ [index: number]: ClientRect;
+}
+
+declare var ClientRectList: {
+ prototype: ClientRectList;
+ new(): ClientRectList;
+}
+
+interface ClipboardEvent extends Event {
+ clipboardData: DataTransfer;
+}
+
+declare var ClipboardEvent: {
+ prototype: ClipboardEvent;
+ new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent;
+}
+
+interface CloseEvent extends Event {
+ code: number;
+ reason: string;
+ wasClean: boolean;
+ initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void;
+}
+
+declare var CloseEvent: {
+ prototype: CloseEvent;
+ new(): CloseEvent;
+}
+
+interface CommandEvent extends Event {
+ commandName: string;
+ detail: string;
+}
+
+declare var CommandEvent: {
+ prototype: CommandEvent;
+ new(type: string, eventInitDict?: CommandEventInit): CommandEvent;
+}
+
+interface Comment extends CharacterData {
+ text: string;
+}
+
+declare var Comment: {
+ prototype: Comment;
+ new(): Comment;
+}
+
+interface CompositionEvent extends UIEvent {
+ data: string;
+ locale: string;
+ initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void;
+}
+
+declare var CompositionEvent: {
+ prototype: CompositionEvent;
+ new(typeArg: string, eventInitDict?: CompositionEventInit): CompositionEvent;
+}
+
+interface Console {
+ assert(test?: boolean, message?: string, ...optionalParams: any[]): void;
+ clear(): void;
+ count(countTitle?: string): void;
+ debug(message?: string, ...optionalParams: any[]): void;
+ dir(value?: any, ...optionalParams: any[]): void;
+ dirxml(value: any): void;
+ error(message?: any, ...optionalParams: any[]): void;
+ group(groupTitle?: string): void;
+ groupCollapsed(groupTitle?: string): void;
+ groupEnd(): void;
+ info(message?: any, ...optionalParams: any[]): void;
+ log(message?: any, ...optionalParams: any[]): void;
+ msIsIndependentlyComposed(element: Element): boolean;
+ profile(reportName?: string): void;
+ profileEnd(): void;
+ select(element: Element): void;
+ time(timerName?: string): void;
+ timeEnd(timerName?: string): void;
+ trace(): void;
+ warn(message?: any, ...optionalParams: any[]): void;
+}
+
+declare var Console: {
+ prototype: Console;
+ new(): Console;
+}
+
+interface ConvolverNode extends AudioNode {
+ buffer: AudioBuffer;
+ normalize: boolean;
+}
+
+declare var ConvolverNode: {
+ prototype: ConvolverNode;
+ new(): ConvolverNode;
+}
+
+interface Coordinates {
+ accuracy: number;
+ altitude: number;
+ altitudeAccuracy: number;
+ heading: number;
+ latitude: number;
+ longitude: number;
+ speed: number;
+}
+
+declare var Coordinates: {
+ prototype: Coordinates;
+ new(): Coordinates;
+}
+
+interface Crypto extends Object, RandomSource {
+ subtle: SubtleCrypto;
+}
+
+declare var Crypto: {
+ prototype: Crypto;
+ new(): Crypto;
+}
+
+interface CryptoKey {
+ algorithm: KeyAlgorithm;
+ extractable: boolean;
+ type: string;
+ usages: string[];
+}
+
+declare var CryptoKey: {
+ prototype: CryptoKey;
+ new(): CryptoKey;
+}
+
+interface CryptoKeyPair {
+ privateKey: CryptoKey;
+ publicKey: CryptoKey;
+}
+
+declare var CryptoKeyPair: {
+ prototype: CryptoKeyPair;
+ new(): CryptoKeyPair;
+}
+
+interface CustomEvent extends Event {
+ detail: any;
+ initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void;
+}
+
+declare var CustomEvent: {
+ prototype: CustomEvent;
+ new(typeArg: string, eventInitDict?: CustomEventInit): CustomEvent;
+}
+
+interface DOMError {
+ name: string;
+ toString(): string;
+}
+
+declare var DOMError: {
+ prototype: DOMError;
+ new(): DOMError;
+}
+
+interface DOMException {
+ code: number;
+ message: string;
+ name: string;
+ toString(): string;
+ ABORT_ERR: number;
+ DATA_CLONE_ERR: number;
+ DOMSTRING_SIZE_ERR: number;
+ HIERARCHY_REQUEST_ERR: number;
+ INDEX_SIZE_ERR: number;
+ INUSE_ATTRIBUTE_ERR: number;
+ INVALID_ACCESS_ERR: number;
+ INVALID_CHARACTER_ERR: number;
+ INVALID_MODIFICATION_ERR: number;
+ INVALID_NODE_TYPE_ERR: number;
+ INVALID_STATE_ERR: number;
+ NAMESPACE_ERR: number;
+ NETWORK_ERR: number;
+ NOT_FOUND_ERR: number;
+ NOT_SUPPORTED_ERR: number;
+ NO_DATA_ALLOWED_ERR: number;
+ NO_MODIFICATION_ALLOWED_ERR: number;
+ PARSE_ERR: number;
+ QUOTA_EXCEEDED_ERR: number;
+ SECURITY_ERR: number;
+ SERIALIZE_ERR: number;
+ SYNTAX_ERR: number;
+ TIMEOUT_ERR: number;
+ TYPE_MISMATCH_ERR: number;
+ URL_MISMATCH_ERR: number;
+ VALIDATION_ERR: number;
+ WRONG_DOCUMENT_ERR: number;
+}
+
+declare var DOMException: {
+ prototype: DOMException;
+ new(): DOMException;
+ ABORT_ERR: number;
+ DATA_CLONE_ERR: number;
+ DOMSTRING_SIZE_ERR: number;
+ HIERARCHY_REQUEST_ERR: number;
+ INDEX_SIZE_ERR: number;
+ INUSE_ATTRIBUTE_ERR: number;
+ INVALID_ACCESS_ERR: number;
+ INVALID_CHARACTER_ERR: number;
+ INVALID_MODIFICATION_ERR: number;
+ INVALID_NODE_TYPE_ERR: number;
+ INVALID_STATE_ERR: number;
+ NAMESPACE_ERR: number;
+ NETWORK_ERR: number;
+ NOT_FOUND_ERR: number;
+ NOT_SUPPORTED_ERR: number;
+ NO_DATA_ALLOWED_ERR: number;
+ NO_MODIFICATION_ALLOWED_ERR: number;
+ PARSE_ERR: number;
+ QUOTA_EXCEEDED_ERR: number;
+ SECURITY_ERR: number;
+ SERIALIZE_ERR: number;
+ SYNTAX_ERR: number;
+ TIMEOUT_ERR: number;
+ TYPE_MISMATCH_ERR: number;
+ URL_MISMATCH_ERR: number;
+ VALIDATION_ERR: number;
+ WRONG_DOCUMENT_ERR: number;
+}
+
+interface DOMImplementation {
+ createDocument(namespaceURI: string, qualifiedName: string, doctype: DocumentType): Document;
+ createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType;
+ createHTMLDocument(title: string): Document;
+ hasFeature(feature: string, version: string): boolean;
+}
+
+declare var DOMImplementation: {
+ prototype: DOMImplementation;
+ new(): DOMImplementation;
+}
+
+interface DOMParser {
+ parseFromString(source: string, mimeType: string): Document;
+}
+
+declare var DOMParser: {
+ prototype: DOMParser;
+ new(): DOMParser;
+}
+
+interface DOMSettableTokenList extends DOMTokenList {
+ value: string;
+}
+
+declare var DOMSettableTokenList: {
+ prototype: DOMSettableTokenList;
+ new(): DOMSettableTokenList;
+}
+
+interface DOMStringList {
+ length: number;
+ contains(str: string): boolean;
+ item(index: number): string;
+ [index: number]: string;
+}
+
+declare var DOMStringList: {
+ prototype: DOMStringList;
+ new(): DOMStringList;
+}
+
+interface DOMStringMap {
+ [name: string]: string;
+}
+
+declare var DOMStringMap: {
+ prototype: DOMStringMap;
+ new(): DOMStringMap;
+}
+
+interface DOMTokenList {
+ length: number;
+ add(...token: string[]): void;
+ contains(token: string): boolean;
+ item(index: number): string;
+ remove(...token: string[]): void;
+ toString(): string;
+ toggle(token: string, force?: boolean): boolean;
+ [index: number]: string;
+}
+
+declare var DOMTokenList: {
+ prototype: DOMTokenList;
+ new(): DOMTokenList;
+}
+
+interface DataCue extends TextTrackCue {
+ data: ArrayBuffer;
+}
+
+declare var DataCue: {
+ prototype: DataCue;
+ new(): DataCue;
+}
+
+interface DataTransfer {
+ dropEffect: string;
+ effectAllowed: string;
+ files: FileList;
+ items: DataTransferItemList;
+ types: DOMStringList;
+ clearData(format?: string): boolean;
+ getData(format: string): string;
+ setData(format: string, data: string): boolean;
+}
+
+declare var DataTransfer: {
+ prototype: DataTransfer;
+ new(): DataTransfer;
+}
+
+interface DataTransferItem {
+ kind: string;
+ type: string;
+ getAsFile(): File;
+ getAsString(_callback: FunctionStringCallback): void;
+}
+
+declare var DataTransferItem: {
+ prototype: DataTransferItem;
+ new(): DataTransferItem;
+}
+
+interface DataTransferItemList {
+ length: number;
+ add(data: File): DataTransferItem;
+ clear(): void;
+ item(index: number): File;
+ remove(index: number): void;
+ [index: number]: File;
+}
+
+declare var DataTransferItemList: {
+ prototype: DataTransferItemList;
+ new(): DataTransferItemList;
+}
+
+interface DeferredPermissionRequest {
+ id: number;
+ type: string;
+ uri: string;
+ allow(): void;
+ deny(): void;
+}
+
+declare var DeferredPermissionRequest: {
+ prototype: DeferredPermissionRequest;
+ new(): DeferredPermissionRequest;
+}
+
+interface DelayNode extends AudioNode {
+ delayTime: AudioParam;
+}
+
+declare var DelayNode: {
+ prototype: DelayNode;
+ new(): DelayNode;
+}
+
+interface DeviceAcceleration {
+ x: number;
+ y: number;
+ z: number;
+}
+
+declare var DeviceAcceleration: {
+ prototype: DeviceAcceleration;
+ new(): DeviceAcceleration;
+}
+
+interface DeviceMotionEvent extends Event {
+ acceleration: DeviceAcceleration;
+ accelerationIncludingGravity: DeviceAcceleration;
+ interval: number;
+ rotationRate: DeviceRotationRate;
+ initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict, accelerationIncludingGravity: DeviceAccelerationDict, rotationRate: DeviceRotationRateDict, interval: number): void;
+}
+
+declare var DeviceMotionEvent: {
+ prototype: DeviceMotionEvent;
+ new(): DeviceMotionEvent;
+}
+
+interface DeviceOrientationEvent extends Event {
+ absolute: boolean;
+ alpha: number;
+ beta: number;
+ gamma: number;
+ initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number, beta: number, gamma: number, absolute: boolean): void;
+}
+
+declare var DeviceOrientationEvent: {
+ prototype: DeviceOrientationEvent;
+ new(): DeviceOrientationEvent;
+}
+
+interface DeviceRotationRate {
+ alpha: number;
+ beta: number;
+ gamma: number;
+}
+
+declare var DeviceRotationRate: {
+ prototype: DeviceRotationRate;
+ new(): DeviceRotationRate;
+}
+
+interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEvent {
+ /**
+ * Sets or gets the URL for the current document.
+ */
+ URL: string;
+ /**
+ * Gets the URL for the document, stripped of any character encoding.
+ */
+ URLUnencoded: string;
+ /**
+ * Gets the object that has the focus when the parent document has focus.
+ */
+ activeElement: Element;
+ /**
+ * Sets or gets the color of all active links in the document.
+ */
+ alinkColor: string;
+ /**
+ * Returns a reference to the collection of elements contained by the object.
+ */
+ all: HTMLCollection;
+ /**
+ * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order.
+ */
+ anchors: HTMLCollection;
+ /**
+ * Retrieves a collection of all applet objects in the document.
+ */
+ applets: HTMLCollection;
+ /**
+ * Deprecated. Sets or retrieves a value that indicates the background color behind the object.
+ */
+ bgColor: string;
+ /**
+ * Specifies the beginning and end of the document body.
+ */
+ body: HTMLElement;
+ characterSet: string;
+ /**
+ * Gets or sets the character set used to encode the object.
+ */
+ charset: string;
+ /**
+ * Gets a value that indicates whether standards-compliant mode is switched on for the object.
+ */
+ compatMode: string;
+ cookie: string;
+ /**
+ * Gets the default character set from the current regional language settings.
+ */
+ defaultCharset: string;
+ defaultView: Window;
+ /**
+ * Sets or gets a value that indicates whether the document can be edited.
+ */
+ designMode: string;
+ /**
+ * Sets or retrieves a value that indicates the reading order of the object.
+ */
+ dir: string;
+ /**
+ * Gets an object representing the document type declaration associated with the current document.
+ */
+ doctype: DocumentType;
+ /**
+ * Gets a reference to the root node of the document.
+ */
+ documentElement: HTMLElement;
+ /**
+ * Sets or gets the security domain of the document.
+ */
+ domain: string;
+ /**
+ * Retrieves a collection of all embed objects in the document.
+ */
+ embeds: HTMLCollection;
+ /**
+ * Sets or gets the foreground (text) color of the document.
+ */
+ fgColor: string;
+ /**
+ * Retrieves a collection, in source order, of all form objects in the document.
+ */
+ forms: HTMLCollection;
+ fullscreenElement: Element;
+ fullscreenEnabled: boolean;
+ head: HTMLHeadElement;
+ hidden: boolean;
+ /**
+ * Retrieves a collection, in source order, of img objects in the document.
+ */
+ images: HTMLCollection;
+ /**
+ * Gets the implementation object of the current document.
+ */
+ implementation: DOMImplementation;
+ /**
+ * Returns the character encoding used to create the webpage that is loaded into the document object.
+ */
+ inputEncoding: string;
+ /**
+ * Gets the date that the page was last modified, if the page supplies one.
+ */
+ lastModified: string;
+ /**
+ * Sets or gets the color of the document links.
+ */
+ linkColor: string;
+ /**
+ * Retrieves a collection of all a objects that specify the href property and all area objects in the document.
+ */
+ links: HTMLCollection;
+ /**
+ * Contains information about the current URL.
+ */
+ location: Location;
+ media: string;
+ msCSSOMElementFloatMetrics: boolean;
+ msCapsLockWarningOff: boolean;
+ msHidden: boolean;
+ msVisibilityState: string;
+ /**
+ * Fires when the user aborts the download.
+ * @param ev The event.
+ */
+ onabort: (ev: Event) => any;
+ /**
+ * Fires when the object is set as the active element.
+ * @param ev The event.
+ */
+ onactivate: (ev: UIEvent) => any;
+ /**
+ * Fires immediately before the object is set as the active element.
+ * @param ev The event.
+ */
+ onbeforeactivate: (ev: UIEvent) => any;
+ /**
+ * Fires immediately before the activeElement is changed from the current object to another object in the parent document.
+ * @param ev The event.
+ */
+ onbeforedeactivate: (ev: UIEvent) => any;
+ /**
+ * Fires when the object loses the input focus.
+ * @param ev The focus event.
+ */
+ onblur: (ev: FocusEvent) => any;
+ /**
+ * Occurs when playback is possible, but would require further buffering.
+ * @param ev The event.
+ */
+ oncanplay: (ev: Event) => any;
+ oncanplaythrough: (ev: Event) => any;
+ /**
+ * Fires when the contents of the object or selection have changed.
+ * @param ev The event.
+ */
+ onchange: (ev: Event) => any;
+ /**
+ * Fires when the user clicks the left mouse button on the object
+ * @param ev The mouse event.
+ */
+ onclick: (ev: MouseEvent) => any;
+ /**
+ * Fires when the user clicks the right mouse button in the client area, opening the context menu.
+ * @param ev The mouse event.
+ */
+ oncontextmenu: (ev: PointerEvent) => any;
+ /**
+ * Fires when the user double-clicks the object.
+ * @param ev The mouse event.
+ */
+ ondblclick: (ev: MouseEvent) => any;
+ /**
+ * Fires when the activeElement is changed from the current object to another object in the parent document.
+ * @param ev The UI Event
+ */
+ ondeactivate: (ev: UIEvent) => any;
+ /**
+ * Fires on the source object continuously during a drag operation.
+ * @param ev The event.
+ */
+ ondrag: (ev: DragEvent) => any;
+ /**
+ * Fires on the source object when the user releases the mouse at the close of a drag operation.
+ * @param ev The event.
+ */
+ ondragend: (ev: DragEvent) => any;
+ /**
+ * Fires on the target element when the user drags the object to a valid drop target.
+ * @param ev The drag event.
+ */
+ ondragenter: (ev: DragEvent) => any;
+ /**
+ * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.
+ * @param ev The drag event.
+ */
+ ondragleave: (ev: DragEvent) => any;
+ /**
+ * Fires on the target element continuously while the user drags the object over a valid drop target.
+ * @param ev The event.
+ */
+ ondragover: (ev: DragEvent) => any;
+ /**
+ * Fires on the source object when the user starts to drag a text selection or selected object.
+ * @param ev The event.
+ */
+ ondragstart: (ev: DragEvent) => any;
+ ondrop: (ev: DragEvent) => any;
+ /**
+ * Occurs when the duration attribute is updated.
+ * @param ev The event.
+ */
+ ondurationchange: (ev: Event) => any;
+ /**
+ * Occurs when the media element is reset to its initial state.
+ * @param ev The event.
+ */
+ onemptied: (ev: Event) => any;
+ /**
+ * Occurs when the end of playback is reached.
+ * @param ev The event
+ */
+ onended: (ev: Event) => any;
+ /**
+ * Fires when an error occurs during object loading.
+ * @param ev The event.
+ */
+ onerror: (ev: Event) => any;
+ /**
+ * Fires when the object receives focus.
+ * @param ev The event.
+ */
+ onfocus: (ev: FocusEvent) => any;
+ onfullscreenchange: (ev: Event) => any;
+ onfullscreenerror: (ev: Event) => any;
+ oninput: (ev: Event) => any;
+ /**
+ * Fires when the user presses a key.
+ * @param ev The keyboard event
+ */
+ onkeydown: (ev: KeyboardEvent) => any;
+ /**
+ * Fires when the user presses an alphanumeric key.
+ * @param ev The event.
+ */
+ onkeypress: (ev: KeyboardEvent) => any;
+ /**
+ * Fires when the user releases a key.
+ * @param ev The keyboard event
+ */
+ onkeyup: (ev: KeyboardEvent) => any;
+ /**
+ * Fires immediately after the browser loads the object.
+ * @param ev The event.
+ */
+ onload: (ev: Event) => any;
+ /**
+ * Occurs when media data is loaded at the current playback position.
+ * @param ev The event.
+ */
+ onloadeddata: (ev: Event) => any;
+ /**
+ * Occurs when the duration and dimensions of the media have been determined.
+ * @param ev The event.
+ */
+ onloadedmetadata: (ev: Event) => any;
+ /**
+ * Occurs when Internet Explorer begins looking for media data.
+ * @param ev The event.
+ */
+ onloadstart: (ev: Event) => any;
+ /**
+ * Fires when the user clicks the object with either mouse button.
+ * @param ev The mouse event.
+ */
+ onmousedown: (ev: MouseEvent) => any;
+ /**
+ * Fires when the user moves the mouse over the object.
+ * @param ev The mouse event.
+ */
+ onmousemove: (ev: MouseEvent) => any;
+ /**
+ * Fires when the user moves the mouse pointer outside the boundaries of the object.
+ * @param ev The mouse event.
+ */
+ onmouseout: (ev: MouseEvent) => any;
+ /**
+ * Fires when the user moves the mouse pointer into the object.
+ * @param ev The mouse event.
+ */
+ onmouseover: (ev: MouseEvent) => any;
+ /**
+ * Fires when the user releases a mouse button while the mouse is over the object.
+ * @param ev The mouse event.
+ */
+ onmouseup: (ev: MouseEvent) => any;
+ /**
+ * Fires when the wheel button is rotated.
+ * @param ev The mouse event
+ */
+ onmousewheel: (ev: MouseWheelEvent) => any;
+ onmscontentzoom: (ev: UIEvent) => any;
+ onmsgesturechange: (ev: MSGestureEvent) => any;
+ onmsgesturedoubletap: (ev: MSGestureEvent) => any;
+ onmsgestureend: (ev: MSGestureEvent) => any;
+ onmsgesturehold: (ev: MSGestureEvent) => any;
+ onmsgesturestart: (ev: MSGestureEvent) => any;
+ onmsgesturetap: (ev: MSGestureEvent) => any;
+ onmsinertiastart: (ev: MSGestureEvent) => any;
+ onmsmanipulationstatechanged: (ev: MSManipulationEvent) => any;
+ onmspointercancel: (ev: MSPointerEvent) => any;
+ onmspointerdown: (ev: MSPointerEvent) => any;
+ onmspointerenter: (ev: MSPointerEvent) => any;
+ onmspointerleave: (ev: MSPointerEvent) => any;
+ onmspointermove: (ev: MSPointerEvent) => any;
+ onmspointerout: (ev: MSPointerEvent) => any;
+ onmspointerover: (ev: MSPointerEvent) => any;
+ onmspointerup: (ev: MSPointerEvent) => any;
+ /**
+ * Occurs when an item is removed from a Jump List of a webpage running in Site Mode.
+ * @param ev The event.
+ */
+ onmssitemodejumplistitemremoved: (ev: MSSiteModeEvent) => any;
+ /**
+ * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode.
+ * @param ev The event.
+ */
+ onmsthumbnailclick: (ev: MSSiteModeEvent) => any;
+ /**
+ * Occurs when playback is paused.
+ * @param ev The event.
+ */
+ onpause: (ev: Event) => any;
+ /**
+ * Occurs when the play method is requested.
+ * @param ev The event.
+ */
+ onplay: (ev: Event) => any;
+ /**
+ * Occurs when the audio or video has started playing.
+ * @param ev The event.
+ */
+ onplaying: (ev: Event) => any;
+ onpointerlockchange: (ev: Event) => any;
+ onpointerlockerror: (ev: Event) => any;
+ /**
+ * Occurs to indicate progress while downloading media data.
+ * @param ev The event.
+ */
+ onprogress: (ev: ProgressEvent) => any;
+ /**
+ * Occurs when the playback rate is increased or decreased.
+ * @param ev The event.
+ */
+ onratechange: (ev: Event) => any;
+ /**
+ * Fires when the state of the object has changed.
+ * @param ev The event
+ */
+ onreadystatechange: (ev: ProgressEvent) => any;
+ /**
+ * Fires when the user resets a form.
+ * @param ev The event.
+ */
+ onreset: (ev: Event) => any;
+ /**
+ * Fires when the user repositions the scroll box in the scroll bar on the object.
+ * @param ev The event.
+ */
+ onscroll: (ev: UIEvent) => any;
+ /**
+ * Occurs when the seek operation ends.
+ * @param ev The event.
+ */
+ onseeked: (ev: Event) => any;
+ /**
+ * Occurs when the current playback position is moved.
+ * @param ev The event.
+ */
+ onseeking: (ev: Event) => any;
+ /**
+ * Fires when the current selection changes.
+ * @param ev The event.
+ */
+ onselect: (ev: UIEvent) => any;
+ onselectstart: (ev: Event) => any;
+ /**
+ * Occurs when the download has stopped.
+ * @param ev The event.
+ */
+ onstalled: (ev: Event) => any;
+ /**
+ * Fires when the user clicks the Stop button or leaves the Web page.
+ * @param ev The event.
+ */
+ onstop: (ev: Event) => any;
+ onsubmit: (ev: Event) => any;
+ /**
+ * Occurs if the load operation has been intentionally halted.
+ * @param ev The event.
+ */
+ onsuspend: (ev: Event) => any;
+ /**
+ * Occurs to indicate the current playback position.
+ * @param ev The event.
+ */
+ ontimeupdate: (ev: Event) => any;
+ ontouchcancel: (ev: TouchEvent) => any;
+ ontouchend: (ev: TouchEvent) => any;
+ ontouchmove: (ev: TouchEvent) => any;
+ ontouchstart: (ev: TouchEvent) => any;
+ /**
+ * Occurs when the volume is changed, or playback is muted or unmuted.
+ * @param ev The event.
+ */
+ onvolumechange: (ev: Event) => any;
+ /**
+ * Occurs when playback stops because the next frame of a video resource is not available.
+ * @param ev The event.
+ */
+ onwaiting: (ev: Event) => any;
+ onwebkitfullscreenchange: (ev: Event) => any;
+ onwebkitfullscreenerror: (ev: Event) => any;
+ plugins: HTMLCollection;
+ pointerLockElement: Element;
+ /**
+ * Retrieves a value that indicates the current state of the object.
+ */
+ readyState: string;
+ /**
+ * Gets the URL of the location that referred the user to the current page.
+ */
+ referrer: string;
+ /**
+ * Gets the root svg element in the document hierarchy.
+ */
+ rootElement: SVGSVGElement;
+ /**
+ * Retrieves a collection of all script objects in the document.
+ */
+ scripts: HTMLCollection;
+ security: string;
+ /**
+ * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document.
+ */
+ styleSheets: StyleSheetList;
+ /**
+ * Contains the title of the document.
+ */
+ title: string;
+ visibilityState: string;
+ /**
+ * Sets or gets the color of the links that the user has visited.
+ */
+ vlinkColor: string;
+ webkitCurrentFullScreenElement: Element;
+ webkitFullscreenElement: Element;
+ webkitFullscreenEnabled: boolean;
+ webkitIsFullScreen: boolean;
+ xmlEncoding: string;
+ xmlStandalone: boolean;
+ /**
+ * Gets or sets the version attribute specified in the declaration of an XML document.
+ */
+ xmlVersion: string;
+ adoptNode(source: Node): Node;
+ captureEvents(): void;
+ clear(): void;
+ /**
+ * Closes an output stream and forces the sent data to display.
+ */
+ close(): void;
+ /**
+ * Creates an attribute object with a specified name.
+ * @param name String that sets the attribute object's name.
+ */
+ createAttribute(name: string): Attr;
+ createAttributeNS(namespaceURI: string, qualifiedName: string): Attr;
+ createCDATASection(data: string): CDATASection;
+ /**
+ * Creates a comment object with the specified data.
+ * @param data Sets the comment object's data.
+ */
+ createComment(data: string): Comment;
+ /**
+ * Creates a new document.
+ */
+ createDocumentFragment(): DocumentFragment;
+ /**
+ * Creates an instance of the element for the specified tag.
+ * @param tagName The name of an element.
+ */
+ createElement(tagName: "a"): HTMLAnchorElement;
+ createElement(tagName: "abbr"): HTMLPhraseElement;
+ createElement(tagName: "acronym"): HTMLPhraseElement;
+ createElement(tagName: "address"): HTMLBlockElement;
+ createElement(tagName: "applet"): HTMLAppletElement;
+ createElement(tagName: "area"): HTMLAreaElement;
+ createElement(tagName: "audio"): HTMLAudioElement;
+ createElement(tagName: "b"): HTMLPhraseElement;
+ createElement(tagName: "base"): HTMLBaseElement;
+ createElement(tagName: "basefont"): HTMLBaseFontElement;
+ createElement(tagName: "bdo"): HTMLPhraseElement;
+ createElement(tagName: "big"): HTMLPhraseElement;
+ createElement(tagName: "blockquote"): HTMLBlockElement;
+ createElement(tagName: "body"): HTMLBodyElement;
+ createElement(tagName: "br"): HTMLBRElement;
+ createElement(tagName: "button"): HTMLButtonElement;
+ createElement(tagName: "canvas"): HTMLCanvasElement;
+ createElement(tagName: "caption"): HTMLTableCaptionElement;
+ createElement(tagName: "center"): HTMLBlockElement;
+ createElement(tagName: "cite"): HTMLPhraseElement;
+ createElement(tagName: "code"): HTMLPhraseElement;
+ createElement(tagName: "col"): HTMLTableColElement;
+ createElement(tagName: "colgroup"): HTMLTableColElement;
+ createElement(tagName: "datalist"): HTMLDataListElement;
+ createElement(tagName: "dd"): HTMLDDElement;
+ createElement(tagName: "del"): HTMLModElement;
+ createElement(tagName: "dfn"): HTMLPhraseElement;
+ createElement(tagName: "dir"): HTMLDirectoryElement;
+ createElement(tagName: "div"): HTMLDivElement;
+ createElement(tagName: "dl"): HTMLDListElement;
+ createElement(tagName: "dt"): HTMLDTElement;
+ createElement(tagName: "em"): HTMLPhraseElement;
+ createElement(tagName: "embed"): HTMLEmbedElement;
+ createElement(tagName: "fieldset"): HTMLFieldSetElement;
+ createElement(tagName: "font"): HTMLFontElement;
+ createElement(tagName: "form"): HTMLFormElement;
+ createElement(tagName: "frame"): HTMLFrameElement;
+ createElement(tagName: "frameset"): HTMLFrameSetElement;
+ createElement(tagName: "h1"): HTMLHeadingElement;
+ createElement(tagName: "h2"): HTMLHeadingElement;
+ createElement(tagName: "h3"): HTMLHeadingElement;
+ createElement(tagName: "h4"): HTMLHeadingElement;
+ createElement(tagName: "h5"): HTMLHeadingElement;
+ createElement(tagName: "h6"): HTMLHeadingElement;
+ createElement(tagName: "head"): HTMLHeadElement;
+ createElement(tagName: "hr"): HTMLHRElement;
+ createElement(tagName: "html"): HTMLHtmlElement;
+ createElement(tagName: "i"): HTMLPhraseElement;
+ createElement(tagName: "iframe"): HTMLIFrameElement;
+ createElement(tagName: "img"): HTMLImageElement;
+ createElement(tagName: "input"): HTMLInputElement;
+ createElement(tagName: "ins"): HTMLModElement;
+ createElement(tagName: "isindex"): HTMLIsIndexElement;
+ createElement(tagName: "kbd"): HTMLPhraseElement;
+ createElement(tagName: "keygen"): HTMLBlockElement;
+ createElement(tagName: "label"): HTMLLabelElement;
+ createElement(tagName: "legend"): HTMLLegendElement;
+ createElement(tagName: "li"): HTMLLIElement;
+ createElement(tagName: "link"): HTMLLinkElement;
+ createElement(tagName: "listing"): HTMLBlockElement;
+ createElement(tagName: "map"): HTMLMapElement;
+ createElement(tagName: "marquee"): HTMLMarqueeElement;
+ createElement(tagName: "menu"): HTMLMenuElement;
+ createElement(tagName: "meta"): HTMLMetaElement;
+ createElement(tagName: "nextid"): HTMLNextIdElement;
+ createElement(tagName: "nobr"): HTMLPhraseElement;
+ createElement(tagName: "object"): HTMLObjectElement;
+ createElement(tagName: "ol"): HTMLOListElement;
+ createElement(tagName: "optgroup"): HTMLOptGroupElement;
+ createElement(tagName: "option"): HTMLOptionElement;
+ createElement(tagName: "p"): HTMLParagraphElement;
+ createElement(tagName: "param"): HTMLParamElement;
+ createElement(tagName: "plaintext"): HTMLBlockElement;
+ createElement(tagName: "pre"): HTMLPreElement;
+ createElement(tagName: "progress"): HTMLProgressElement;
+ createElement(tagName: "q"): HTMLQuoteElement;
+ createElement(tagName: "rt"): HTMLPhraseElement;
+ createElement(tagName: "ruby"): HTMLPhraseElement;
+ createElement(tagName: "s"): HTMLPhraseElement;
+ createElement(tagName: "samp"): HTMLPhraseElement;
+ createElement(tagName: "script"): HTMLScriptElement;
+ createElement(tagName: "select"): HTMLSelectElement;
+ createElement(tagName: "small"): HTMLPhraseElement;
+ createElement(tagName: "source"): HTMLSourceElement;
+ createElement(tagName: "span"): HTMLSpanElement;
+ createElement(tagName: "strike"): HTMLPhraseElement;
+ createElement(tagName: "strong"): HTMLPhraseElement;
+ createElement(tagName: "style"): HTMLStyleElement;
+ createElement(tagName: "sub"): HTMLPhraseElement;
+ createElement(tagName: "sup"): HTMLPhraseElement;
+ createElement(tagName: "table"): HTMLTableElement;
+ createElement(tagName: "tbody"): HTMLTableSectionElement;
+ createElement(tagName: "td"): HTMLTableDataCellElement;
+ createElement(tagName: "textarea"): HTMLTextAreaElement;
+ createElement(tagName: "tfoot"): HTMLTableSectionElement;
+ createElement(tagName: "th"): HTMLTableHeaderCellElement;
+ createElement(tagName: "thead"): HTMLTableSectionElement;
+ createElement(tagName: "title"): HTMLTitleElement;
+ createElement(tagName: "tr"): HTMLTableRowElement;
+ createElement(tagName: "track"): HTMLTrackElement;
+ createElement(tagName: "tt"): HTMLPhraseElement;
+ createElement(tagName: "u"): HTMLPhraseElement;
+ createElement(tagName: "ul"): HTMLUListElement;
+ createElement(tagName: "var"): HTMLPhraseElement;
+ createElement(tagName: "video"): HTMLVideoElement;
+ createElement(tagName: "x-ms-webview"): MSHTMLWebViewElement;
+ createElement(tagName: "xmp"): HTMLBlockElement;
+ createElement(tagName: string): HTMLElement;
+ createElementNS(namespaceURI: string, qualifiedName: string): Element;
+ createExpression(expression: string, resolver: XPathNSResolver): XPathExpression;
+ createNSResolver(nodeResolver: Node): XPathNSResolver;
+ /**
+ * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
+ * @param root The root element or node to start traversing on.
+ * @param whatToShow The type of nodes or elements to appear in the node list
+ * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter.
+ * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded.
+ */
+ createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): NodeIterator;
+ createProcessingInstruction(target: string, data: string): ProcessingInstruction;
+ /**
+ * Returns an empty range object that has both of its boundary points positioned at the beginning of the document.
+ */
+ createRange(): Range;
+ /**
+ * Creates a text string from the specified value.
+ * @param data String that specifies the nodeValue property of the text node.
+ */
+ createTextNode(data: string): Text;
+ createTouch(view: any, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch;
+ createTouchList(...touches: Touch[]): TouchList;
+ /**
+ * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document.
+ * @param root The root element or node to start traversing on.
+ * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow.
+ * @param filter A custom NodeFilter function to use.
+ * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded.
+ */
+ createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker;
+ /**
+ * Returns the element for the specified x coordinate and the specified y coordinate.
+ * @param x The x-offset
+ * @param y The y-offset
+ */
+ elementFromPoint(x: number, y: number): Element;
+ evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver, type: number, result: XPathResult): XPathResult;
+ /**
+ * Executes a command on the current document, current selection, or the given range.
+ * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script.
+ * @param showUI Display the user interface, defaults to false.
+ * @param value Value to assign.
+ */
+ execCommand(commandId: string, showUI?: boolean, value?: any): boolean;
+ /**
+ * Displays help information for the given command identifier.
+ * @param commandId Displays help information for the given command identifier.
+ */
+ execCommandShowHelp(commandId: string): boolean;
+ exitFullscreen(): void;
+ exitPointerLock(): void;
+ /**
+ * Causes the element to receive the focus and executes the code specified by the onfocus event.
+ */
+ focus(): void;
+ /**
+ * Returns a reference to the first object with the specified value of the ID or NAME attribute.
+ * @param elementId String that specifies the ID value. Case-insensitive.
+ */
+ getElementById(elementId: string): HTMLElement;
+ getElementsByClassName(classNames: string): NodeListOf;
+ /**
+ * Gets a collection of objects based on the value of the NAME or ID attribute.
+ * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute.
+ */
+ getElementsByName(elementName: string): NodeListOf;
+ /**
+ * Retrieves a collection of objects based on the specified element name.
+ * @param name Specifies the name of an element.
+ */
+ getElementsByTagName(tagname: "a"): NodeListOf;
+ getElementsByTagName(tagname: "abbr"): NodeListOf;
+ getElementsByTagName(tagname: "acronym"): NodeListOf;
+ getElementsByTagName(tagname: "address"): NodeListOf;
+ getElementsByTagName(tagname: "applet"): NodeListOf;
+ getElementsByTagName(tagname: "area"): NodeListOf;
+ getElementsByTagName(tagname: "article"): NodeListOf;
+ getElementsByTagName(tagname: "aside"): NodeListOf;
+ getElementsByTagName(tagname: "audio"): NodeListOf;
+ getElementsByTagName(tagname: "b"): NodeListOf;
+ getElementsByTagName(tagname: "base"): NodeListOf;
+ getElementsByTagName(tagname: "basefont"): NodeListOf;
+ getElementsByTagName(tagname: "bdo"): NodeListOf;
+ getElementsByTagName(tagname: "big"): NodeListOf;
+ getElementsByTagName(tagname: "blockquote"): NodeListOf;
+ getElementsByTagName(tagname: "body"): NodeListOf;
+ getElementsByTagName(tagname: "br"): NodeListOf;
+ getElementsByTagName(tagname: "button"): NodeListOf;
+ getElementsByTagName(tagname: "canvas"): NodeListOf;
+ getElementsByTagName(tagname: "caption"): NodeListOf;
+ getElementsByTagName(tagname: "center"): NodeListOf;
+ getElementsByTagName(tagname: "circle"): NodeListOf;
+ getElementsByTagName(tagname: "cite"): NodeListOf;
+ getElementsByTagName(tagname: "clippath"): NodeListOf;
+ getElementsByTagName(tagname: "code"): NodeListOf;
+ getElementsByTagName(tagname: "col"): NodeListOf;
+ getElementsByTagName(tagname: "colgroup"): NodeListOf;
+ getElementsByTagName(tagname: "datalist"): NodeListOf;
+ getElementsByTagName(tagname: "dd"): NodeListOf;
+ getElementsByTagName(tagname: "defs"): NodeListOf;
+ getElementsByTagName(tagname: "del"): NodeListOf;
+ getElementsByTagName(tagname: "desc"): NodeListOf;
+ getElementsByTagName(tagname: "dfn"): NodeListOf;
+ getElementsByTagName(tagname: "dir"): NodeListOf;
+ getElementsByTagName(tagname: "div"): NodeListOf;
+ getElementsByTagName(tagname: "dl"): NodeListOf;
+ getElementsByTagName(tagname: "dt"): NodeListOf;
+ getElementsByTagName(tagname: "ellipse"): NodeListOf;
+ getElementsByTagName(tagname: "em"): NodeListOf;
+ getElementsByTagName(tagname: "embed"): NodeListOf;
+ getElementsByTagName(tagname: "feblend"): NodeListOf;
+ getElementsByTagName(tagname: "fecolormatrix"): NodeListOf;
+ getElementsByTagName(tagname: "fecomponenttransfer"): NodeListOf;
+ getElementsByTagName(tagname: "fecomposite"): NodeListOf;
+ getElementsByTagName(tagname: "feconvolvematrix"): NodeListOf;
+ getElementsByTagName(tagname: "fediffuselighting"): NodeListOf;
+ getElementsByTagName(tagname: "fedisplacementmap"): NodeListOf;
+ getElementsByTagName(tagname: "fedistantlight"): NodeListOf;
+ getElementsByTagName(tagname: "feflood"): NodeListOf;
+ getElementsByTagName(tagname: "fefunca"): NodeListOf;
+ getElementsByTagName(tagname: "fefuncb"): NodeListOf;
+ getElementsByTagName(tagname: "fefuncg"): NodeListOf;
+ getElementsByTagName(tagname: "fefuncr"): NodeListOf;
+ getElementsByTagName(tagname: "fegaussianblur"): NodeListOf;
+ getElementsByTagName(tagname: "feimage"): NodeListOf;
+ getElementsByTagName(tagname: "femerge"): NodeListOf;
+ getElementsByTagName(tagname: "femergenode"): NodeListOf;
+ getElementsByTagName(tagname: "femorphology"): NodeListOf;
+ getElementsByTagName(tagname: "feoffset"): NodeListOf;
+ getElementsByTagName(tagname: "fepointlight"): NodeListOf;
+ getElementsByTagName(tagname: "fespecularlighting"): NodeListOf;
+ getElementsByTagName(tagname: "fespotlight"): NodeListOf;
+ getElementsByTagName(tagname: "fetile"): NodeListOf;
+ getElementsByTagName(tagname: "feturbulence"): NodeListOf;
+ getElementsByTagName(tagname: "fieldset"): NodeListOf;
+ getElementsByTagName(tagname: "figcaption"): NodeListOf;
+ getElementsByTagName(tagname: "figure"): NodeListOf;
+ getElementsByTagName(tagname: "filter"): NodeListOf;
+ getElementsByTagName(tagname: "font"): NodeListOf;
+ getElementsByTagName(tagname: "footer"): NodeListOf;
+ getElementsByTagName(tagname: "foreignobject"): NodeListOf;
+ getElementsByTagName(tagname: "form"): NodeListOf;
+ getElementsByTagName(tagname: "frame"): NodeListOf;
+ getElementsByTagName(tagname: "frameset"): NodeListOf;
+ getElementsByTagName(tagname: "g"): NodeListOf;
+ getElementsByTagName(tagname: "h1"): NodeListOf;
+ getElementsByTagName(tagname: "h2"): NodeListOf;
+ getElementsByTagName(tagname: "h3"): NodeListOf;
+ getElementsByTagName(tagname: "h4"): NodeListOf;
+ getElementsByTagName(tagname: "h5"): NodeListOf;
+ getElementsByTagName(tagname: "h6"): NodeListOf;
+ getElementsByTagName(tagname: "head"): NodeListOf;
+ getElementsByTagName(tagname: "header"): NodeListOf;
+ getElementsByTagName(tagname: "hgroup"): NodeListOf;
+ getElementsByTagName(tagname: "hr"): NodeListOf;
+ getElementsByTagName(tagname: "html"): NodeListOf;
+ getElementsByTagName(tagname: "i"): NodeListOf;
+ getElementsByTagName(tagname: "iframe"): NodeListOf;
+ getElementsByTagName(tagname: "image"): NodeListOf;
+ getElementsByTagName(tagname: "img"): NodeListOf;
+ getElementsByTagName(tagname: "input"): NodeListOf;
+ getElementsByTagName(tagname: "ins"): NodeListOf;
+ getElementsByTagName(tagname: "isindex"): NodeListOf;
+ getElementsByTagName(tagname: "kbd"): NodeListOf;
+ getElementsByTagName(tagname: "keygen"): NodeListOf;
+ getElementsByTagName(tagname: "label"): NodeListOf;
+ getElementsByTagName(tagname: "legend"): NodeListOf;
+ getElementsByTagName(tagname: "li"): NodeListOf;
+ getElementsByTagName(tagname: "line"): NodeListOf;
+ getElementsByTagName(tagname: "lineargradient"): NodeListOf;
+ getElementsByTagName(tagname: "link"): NodeListOf;
+ getElementsByTagName(tagname: "listing"): NodeListOf;
+ getElementsByTagName(tagname: "map"): NodeListOf;
+ getElementsByTagName(tagname: "mark"): NodeListOf;
+ getElementsByTagName(tagname: "marker"): NodeListOf;
+ getElementsByTagName(tagname: "marquee"): NodeListOf;
+ getElementsByTagName(tagname: "mask"): NodeListOf;
+ getElementsByTagName(tagname: "menu"): NodeListOf;
+ getElementsByTagName(tagname: "meta"): NodeListOf;
+ getElementsByTagName(tagname: "metadata"): NodeListOf;
+ getElementsByTagName(tagname: "nav"): NodeListOf;
+ getElementsByTagName(tagname: "nextid"): NodeListOf;
+ getElementsByTagName(tagname: "nobr"): NodeListOf;
+ getElementsByTagName(tagname: "noframes"): NodeListOf;
+ getElementsByTagName(tagname: "noscript"): NodeListOf;
+ getElementsByTagName(tagname: "object"): NodeListOf;
+ getElementsByTagName(tagname: "ol"): NodeListOf;
+ getElementsByTagName(tagname: "optgroup"): NodeListOf;
+ getElementsByTagName(tagname: "option"): NodeListOf;
+ getElementsByTagName(tagname: "p"): NodeListOf;
+ getElementsByTagName(tagname: "param"): NodeListOf;
+ getElementsByTagName(tagname: "path"): NodeListOf;
+ getElementsByTagName(tagname: "pattern"): NodeListOf;
+ getElementsByTagName(tagname: "plaintext"): NodeListOf;
+ getElementsByTagName(tagname: "polygon"): NodeListOf;
+ getElementsByTagName(tagname: "polyline"): NodeListOf;
+ getElementsByTagName(tagname: "pre"): NodeListOf;
+ getElementsByTagName(tagname: "progress"): NodeListOf;
+ getElementsByTagName(tagname: "q"): NodeListOf;
+ getElementsByTagName(tagname: "radialgradient"): NodeListOf;
+ getElementsByTagName(tagname: "rect"): NodeListOf;
+ getElementsByTagName(tagname: "rt"): NodeListOf;
+ getElementsByTagName(tagname: "ruby"): NodeListOf;
+ getElementsByTagName(tagname: "s"): NodeListOf;
+ getElementsByTagName(tagname: "samp"): NodeListOf;
+ getElementsByTagName(tagname: "script"): NodeListOf;
+ getElementsByTagName(tagname: "section"): NodeListOf;
+ getElementsByTagName(tagname: "select"): NodeListOf;
+ getElementsByTagName(tagname: "small"): NodeListOf;
+ getElementsByTagName(tagname: "source"): NodeListOf;
+ getElementsByTagName(tagname: "span"): NodeListOf;
+ getElementsByTagName(tagname: "stop"): NodeListOf;
+ getElementsByTagName(tagname: "strike"): NodeListOf;
+ getElementsByTagName(tagname: "strong"): NodeListOf;
+ getElementsByTagName(tagname: "style"): NodeListOf;
+ getElementsByTagName(tagname: "sub"): NodeListOf;
+ getElementsByTagName(tagname: "sup"): NodeListOf;
+ getElementsByTagName(tagname: "svg"): NodeListOf;
+ getElementsByTagName(tagname: "switch"): NodeListOf;
+ getElementsByTagName(tagname: "symbol"): NodeListOf;
+ getElementsByTagName(tagname: "table"): NodeListOf;
+ getElementsByTagName(tagname: "tbody"): NodeListOf;
+ getElementsByTagName(tagname: "td"): NodeListOf;
+ getElementsByTagName(tagname: "text"): NodeListOf;
+ getElementsByTagName(tagname: "textpath"): NodeListOf;
+ getElementsByTagName(tagname: "textarea"): NodeListOf;
+ getElementsByTagName(tagname: "tfoot"): NodeListOf;
+ getElementsByTagName(tagname: "th"): NodeListOf;
+ getElementsByTagName(tagname: "thead"): NodeListOf;
+ getElementsByTagName(tagname: "title"): NodeListOf;
+ getElementsByTagName(tagname: "tr"): NodeListOf;
+ getElementsByTagName(tagname: "track"): NodeListOf;
+ getElementsByTagName(tagname: "tspan"): NodeListOf;
+ getElementsByTagName(tagname: "tt"): NodeListOf;
+ getElementsByTagName(tagname: "u"): NodeListOf;
+ getElementsByTagName(tagname: "ul"): NodeListOf;
+ getElementsByTagName(tagname: "use"): NodeListOf;
+ getElementsByTagName(tagname: "var"): NodeListOf;
+ getElementsByTagName(tagname: "video"): NodeListOf;
+ getElementsByTagName(tagname: "view"): NodeListOf;
+ getElementsByTagName(tagname: "wbr"): NodeListOf;
+ getElementsByTagName(tagname: "x-ms-webview"): NodeListOf;
+ getElementsByTagName(tagname: "xmp"): NodeListOf;
+ getElementsByTagName(tagname: string): NodeListOf;
+ getElementsByTagNameNS(namespaceURI: string, localName: string): NodeListOf;
+ /**
+ * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.
+ */
+ getSelection(): Selection;
+ /**
+ * Gets a value indicating whether the object currently has focus.
+ */
+ hasFocus(): boolean;
+ importNode(importedNode: Node, deep: boolean): Node;
+ msElementsFromPoint(x: number, y: number): NodeList;
+ msElementsFromRect(left: number, top: number, width: number, height: number): NodeList;
+ /**
+ * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method.
+ * @param url Specifies a MIME type for the document.
+ * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element.
+ * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported.
+ * @param replace Specifies whether the existing entry for the document is replaced in the history list.
+ */
+ open(url?: string, name?: string, features?: string, replace?: boolean): Document;
+ /**
+ * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document.
+ * @param commandId Specifies a command identifier.
+ */
+ queryCommandEnabled(commandId: string): boolean;
+ /**
+ * Returns a Boolean value that indicates whether the specified command is in the indeterminate state.
+ * @param commandId String that specifies a command identifier.
+ */
+ queryCommandIndeterm(commandId: string): boolean;
+ /**
+ * Returns a Boolean value that indicates the current state of the command.
+ * @param commandId String that specifies a command identifier.
+ */
+ queryCommandState(commandId: string): boolean;
+ /**
+ * Returns a Boolean value that indicates whether the current command is supported on the current range.
+ * @param commandId Specifies a command identifier.
+ */
+ queryCommandSupported(commandId: string): boolean;
+ /**
+ * Retrieves the string associated with a command.
+ * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers.
+ */
+ queryCommandText(commandId: string): string;
+ /**
+ * Returns the current value of the document, range, or current selection for the given command.
+ * @param commandId String that specifies a command identifier.
+ */
+ queryCommandValue(commandId: string): string;
+ releaseEvents(): void;
+ /**
+ * Allows updating the print settings for the page.
+ */
+ updateSettings(): void;
+ webkitCancelFullScreen(): void;
+ webkitExitFullscreen(): void;
+ /**
+ * Writes one or more HTML expressions to a document in the specified window.
+ * @param content Specifies the text and HTML tags to write.
+ */
+ write(...content: string[]): void;
+ /**
+ * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window.
+ * @param content The text and HTML tags to write.
+ */
+ writeln(...content: string[]): void;
+ addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "fullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "fullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mssitemodejumplistitemremoved", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "msthumbnailclick", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerlockchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerlockerror", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "stop", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var Document: {
+ prototype: Document;
+ new(): Document;
+}
+
+interface DocumentFragment extends Node, NodeSelector {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var DocumentFragment: {
+ prototype: DocumentFragment;
+ new(): DocumentFragment;
+}
+
+interface DocumentType extends Node, ChildNode {
+ entities: NamedNodeMap;
+ internalSubset: string;
+ name: string;
+ notations: NamedNodeMap;
+ publicId: string;
+ systemId: string;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var DocumentType: {
+ prototype: DocumentType;
+ new(): DocumentType;
+}
+
+interface DragEvent extends MouseEvent {
+ dataTransfer: DataTransfer;
+ initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void;
+ msConvertURL(file: File, targetType: string, targetURL?: string): void;
+}
+
+declare var DragEvent: {
+ prototype: DragEvent;
+ new(): DragEvent;
+}
+
+interface DynamicsCompressorNode extends AudioNode {
+ attack: AudioParam;
+ knee: AudioParam;
+ ratio: AudioParam;
+ reduction: AudioParam;
+ release: AudioParam;
+ threshold: AudioParam;
+}
+
+declare var DynamicsCompressorNode: {
+ prototype: DynamicsCompressorNode;
+ new(): DynamicsCompressorNode;
+}
+
+interface EXT_texture_filter_anisotropic {
+ MAX_TEXTURE_MAX_ANISOTROPY_EXT: number;
+ TEXTURE_MAX_ANISOTROPY_EXT: number;
+}
+
+declare var EXT_texture_filter_anisotropic: {
+ prototype: EXT_texture_filter_anisotropic;
+ new(): EXT_texture_filter_anisotropic;
+ MAX_TEXTURE_MAX_ANISOTROPY_EXT: number;
+ TEXTURE_MAX_ANISOTROPY_EXT: number;
+}
+
+interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelector, ChildNode {
+ classList: DOMTokenList;
+ clientHeight: number;
+ clientLeft: number;
+ clientTop: number;
+ clientWidth: number;
+ msContentZoomFactor: number;
+ msRegionOverflow: string;
+ onariarequest: (ev: AriaRequestEvent) => any;
+ oncommand: (ev: CommandEvent) => any;
+ ongotpointercapture: (ev: PointerEvent) => any;
+ onlostpointercapture: (ev: PointerEvent) => any;
+ onmsgesturechange: (ev: MSGestureEvent) => any;
+ onmsgesturedoubletap: (ev: MSGestureEvent) => any;
+ onmsgestureend: (ev: MSGestureEvent) => any;
+ onmsgesturehold: (ev: MSGestureEvent) => any;
+ onmsgesturestart: (ev: MSGestureEvent) => any;
+ onmsgesturetap: (ev: MSGestureEvent) => any;
+ onmsgotpointercapture: (ev: MSPointerEvent) => any;
+ onmsinertiastart: (ev: MSGestureEvent) => any;
+ onmslostpointercapture: (ev: MSPointerEvent) => any;
+ onmspointercancel: (ev: MSPointerEvent) => any;
+ onmspointerdown: (ev: MSPointerEvent) => any;
+ onmspointerenter: (ev: MSPointerEvent) => any;
+ onmspointerleave: (ev: MSPointerEvent) => any;
+ onmspointermove: (ev: MSPointerEvent) => any;
+ onmspointerout: (ev: MSPointerEvent) => any;
+ onmspointerover: (ev: MSPointerEvent) => any;
+ onmspointerup: (ev: MSPointerEvent) => any;
+ ontouchcancel: (ev: TouchEvent) => any;
+ ontouchend: (ev: TouchEvent) => any;
+ ontouchmove: (ev: TouchEvent) => any;
+ ontouchstart: (ev: TouchEvent) => any;
+ onwebkitfullscreenchange: (ev: Event) => any;
+ onwebkitfullscreenerror: (ev: Event) => any;
+ scrollHeight: number;
+ scrollLeft: number;
+ scrollTop: number;
+ scrollWidth: number;
+ tagName: string;
+ id: string;
+ className: string;
+ getAttribute(name?: string): string;
+ getAttributeNS(namespaceURI: string, localName: string): string;
+ getAttributeNode(name: string): Attr;
+ getAttributeNodeNS(namespaceURI: string, localName: string): Attr;
+ getBoundingClientRect(): ClientRect;
+ getClientRects(): ClientRectList;
+ getElementsByTagName(name: "a"): NodeListOf;
+ getElementsByTagName(name: "abbr"): NodeListOf;
+ getElementsByTagName(name: "acronym"): NodeListOf;
+ getElementsByTagName(name: "address"): NodeListOf;
+ getElementsByTagName(name: "applet"): NodeListOf;
+ getElementsByTagName(name: "area"): NodeListOf;
+ getElementsByTagName(name: "article"): NodeListOf;
+ getElementsByTagName(name: "aside"): NodeListOf;
+ getElementsByTagName(name: "audio"): NodeListOf;
+ getElementsByTagName(name: "b"): NodeListOf;
+ getElementsByTagName(name: "base"): NodeListOf;
+ getElementsByTagName(name: "basefont"): NodeListOf;
+ getElementsByTagName(name: "bdo"): NodeListOf;
+ getElementsByTagName(name: "big"): NodeListOf;
+ getElementsByTagName(name: "blockquote"): NodeListOf;
+ getElementsByTagName(name: "body"): NodeListOf;
+ getElementsByTagName(name: "br"): NodeListOf;
+ getElementsByTagName(name: "button"): NodeListOf;
+ getElementsByTagName(name: "canvas"): NodeListOf;
+ getElementsByTagName(name: "caption"): NodeListOf;
+ getElementsByTagName(name: "center"): NodeListOf;
+ getElementsByTagName(name: "circle"): NodeListOf;
+ getElementsByTagName(name: "cite"): NodeListOf;
+ getElementsByTagName(name: "clippath"): NodeListOf;
+ getElementsByTagName(name: "code"): NodeListOf;
+ getElementsByTagName(name: "col"): NodeListOf;
+ getElementsByTagName(name: "colgroup"): NodeListOf;
+ getElementsByTagName(name: "datalist"): NodeListOf;
+ getElementsByTagName(name: "dd"): NodeListOf;
+ getElementsByTagName(name: "defs"): NodeListOf;
+ getElementsByTagName(name: "del"): NodeListOf;
+ getElementsByTagName(name: "desc"): NodeListOf;
+ getElementsByTagName(name: "dfn"): NodeListOf;
+ getElementsByTagName(name: "dir"): NodeListOf;
+ getElementsByTagName(name: "div"): NodeListOf;
+ getElementsByTagName(name: "dl"): NodeListOf;
+ getElementsByTagName(name: "dt"): NodeListOf;
+ getElementsByTagName(name: "ellipse"): NodeListOf;
+ getElementsByTagName(name: "em"): NodeListOf;
+ getElementsByTagName(name: "embed"): NodeListOf;
+ getElementsByTagName(name: "feblend"): NodeListOf;
+ getElementsByTagName(name: "fecolormatrix"): NodeListOf;
+ getElementsByTagName(name: "fecomponenttransfer"): NodeListOf;
+ getElementsByTagName(name: "fecomposite"): NodeListOf;
+ getElementsByTagName(name: "feconvolvematrix"): NodeListOf;
+ getElementsByTagName(name: "fediffuselighting"): NodeListOf;
+ getElementsByTagName(name: "fedisplacementmap"): NodeListOf;
+ getElementsByTagName(name: "fedistantlight"): NodeListOf;
+ getElementsByTagName(name: "feflood"): NodeListOf;
+ getElementsByTagName(name: "fefunca"): NodeListOf;
+ getElementsByTagName(name: "fefuncb"): NodeListOf;
+ getElementsByTagName(name: "fefuncg"): NodeListOf;
+ getElementsByTagName(name: "fefuncr"): NodeListOf;
+ getElementsByTagName(name: "fegaussianblur"): NodeListOf;
+ getElementsByTagName(name: "feimage"): NodeListOf;
+ getElementsByTagName(name: "femerge"): NodeListOf;
+ getElementsByTagName(name: "femergenode"): NodeListOf