This tool is used to generate
webworker.generated.d.ts for TypeScript, and
To build the tool, simply clone the repo, and run
build.cmd (Windows) or
build.sh (OS X/Unix) in command line. If it runs successfully, the output files will be generated under the
Note: for OS X/ Unix users, Mono 4.2 is required.
webworker.generated.d.ts files in the TypeScript repo are used as baselines.
For each pull request, we will run the script and compare the generated files with the baseline files.
In order to make the tests pass, please update the baseline as well in any pull requests.
For common changes, it is sufficient to change the json files.
There are three json files that are used to alter the file generation:
The format of each file can be inferred from their existing content.
The common steps to send a pull request are: 0. Open or refer to an issue in the TypeScript repo.
- Add missing elements to
inputfiles/addedTypes.json, overriding elements to
inputfiles/overridingTypes.json, or elements to remove to
- Run the script locally to obtain new
- Update the files in the
baselinesfolder using the newly generated files.
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
JS.fs: handles the emitting of the
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
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
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.