You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Travis CI Status: [](https://travis-ci.org/Microsoft/TSJS-lib-generator)
5
5
6
-
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.
6
+
This tool is used to generate `dom.generated.d.ts`, `webworker.generated.d.ts` and `dom.es6.generated.d.ts` for TypeScript.
7
7
The input file is the XML spec file generated by the Microsoft Edge browser.
8
8
9
9
## Build Instructions
@@ -15,12 +15,15 @@ Note: for OS X and Unix users, [Mono 4.2 or higher](http://www.mono-project.com/
15
15
16
16
## Contribution Guidelines
17
17
18
-
The `dom.generated.d.ts`and `webworker.generated.d.ts` files in the TypeScript repo are used as baselines.
18
+
The `dom.generated.d.ts`, `webworker.generated.d.ts`and `dom.es6.generated.d.ts` files from the TypeScript repo are used as baselines.
19
19
For each pull request, we will run the script and compare the generated files with the baseline files.
20
20
In order to make the tests pass, please update the baseline as well in any pull requests.
21
21
22
22
For common changes, it is sufficient to change the json files.
23
-
There are three json files that are used to alter the file generation: `addedTypes.json`, `overridingTypes.json`, and `removedTypes.json`.
23
+
There are three json files that are typically used to alter the type generation: `addedTypes.json`, `overridingTypes.json`, and `removedTypes.json`.
24
+
`comments.json` can used to add comments to the types.
25
+
Finally, `knownWorkerEnums` and `knownWorkerInterfaces` determine which types are available in a WebWorker environment.
26
+
24
27
The format of each file can be inferred from their existing content.
25
28
26
29
The common steps to send a pull request are:
@@ -50,9 +53,8 @@ A "Living Standard" ([example](https://xhr.spec.whatwg.org/)) should be added he
50
53
51
54
## Code Structure
52
55
53
-
-`Shared.fs`: handles the parsing from XML spec file, and stores the common data structures for later use.
54
-
-`TS.fs`: handles the emitting of the `lib.d.ts` file.
55
-
-`JS.fs`: handles the emitting of the `domWeb.js` and `domWindows.js`.
56
+
-`Build.fsx`: Runs `TS.fsx` for all targets, then does a snapshot test by comparing the `generated/` and `baseline/` contents.
57
+
-`TS.fsx`: handles the emitting of the `.d.ts` files.
56
58
57
59
## Input Files
58
60
@@ -63,5 +65,4 @@ A "Living Standard" ([example](https://xhr.spec.whatwg.org/)) should be added he
63
65
-`overridingTypes.json`: types that are defined in the spec file but has a better or more up-to-date definitions in the json files.
64
66
-`removedTypes.json`: types that are defined in the spec file but should be removed.
65
67
-`comments.json`: comment strings to be embedded in the generated .js files.
66
-
-`jsTemplate.js`: the initial templates for `domWeb.js` and `domWindows.js`, which contains the necessary helper functions.
67
-
-`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.
68
+
-`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. **Do not edit this file**.
0 commit comments