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.
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.
Shared.fs
: handles the parsing from XML spec file, and stores the common data structures for later use;TS.fs
: handles the emitting of thelib.d.ts
file;JS.fs
: handles the emitting of thedomWeb.js
anddomWindows.js
files used for Visual Studio JavaScript language service;Program.fs
: entry point of the tool;
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 beproperty
,method
,interface
,constructor
, orindexer
.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 filesjsTemplate.js
: the initial templates fordomWeb.js
anddomWindows.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.