Skip to content

Commit 2ac8020

Browse files
committed
Merge branch 'master' into dangerzone
2 parents 67ea2ee + 6e088e8 commit 2ac8020

18 files changed

+1282
-273
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# TypeScript and JavaScript lib generator
22

3-
AppVeyor Status: [![Build status](https://ci.appveyor.com/api/projects/status/8oj3j7u6nvag1xvu/branch/master?svg=true)](https://ci.appveyor.com/project/zhengbli/tsjs-lib-generator/branch/master)
43
Travis CI Status: [![Build Status](https://travis-ci.org/Microsoft/TSJS-lib-generator.svg?branch=master)](https://travis-ci.org/Microsoft/TSJS-lib-generator)
54

65
This tool is used to generate `dom.generated.d.ts`, `webworker.generated.d.ts` and `dom.iterable.generated.d.ts` for TypeScript.
@@ -67,13 +66,14 @@ A "Living Standard" ([example](https://xhr.spec.whatwg.org/)) should be added he
6766
## Code Structure
6867

6968
- `src/index.ts`: handles the emitting of the `.d.ts` files.
70-
- `src/test.ts`: verifies the otuput by comparing the `generated/` and `baseline/` contents.
69+
- `src/test.ts`: verifies the output by comparing the `generated/` and `baseline/` contents.
7170

7271

7372
## Input Files
7473

7574
- `browser.webidl.preprocessed.json`: a JSON file generated by Microsoft Edge. **Do not edit this file**.
7675
- Due to the different update schedules between Edge and TypeScript, this may not be the most up-to-date version of the spec.
76+
- `mdn/apiDescriptions.json`: a JSON file generated by fetching API descriptions from [MDN](https://developer.mozilla.org/en-US/docs/Web/API). **Do not edit this file**.
7777
- `addedTypes.json`: types that should exist in either browser or webworker but are missing from the Edge spec. The format of the file mimics that of `browser.webidl.preprocessed.json`.
7878
- `overridingTypes.json`: types that are defined in the spec file but has a better or more up-to-date definitions in the json files.
7979
- `removedTypes.json`: types that are defined in the spec file but should be removed.

baselines/dom.generated.d.ts

Lines changed: 478 additions & 92 deletions
Large diffs are not rendered by default.

baselines/webworker.generated.d.ts

Lines changed: 115 additions & 9 deletions
Large diffs are not rendered by default.

inputfiles/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ Some files in this directory are generated.
44
Please do not edit them.
55
This specifically includes:
66

7-
* `browser.webidl.json`
8-
* Anything in the `idl/` directory
7+
* `browser.webidl.preprocessed.json`
8+
* `idl/*`
9+
* `mdn/*`
910

1011
Feel free to send a pull request with changes to any other files.

inputfiles/addedTypes.json

Lines changed: 69 additions & 136 deletions
Large diffs are not rendered by default.

inputfiles/comments.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
{
22
"mixins": {
33
"mixin": {
4+
"DocumentOrShadowRoot": {
5+
"properties": {
6+
"property": {
7+
"styleSheets": {
8+
"comment": "/**\r\n * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document.\r\n */"
9+
}
10+
}
11+
}
12+
},
413
"GlobalEventHandlers": {
514
"properties": {
615
"property": {
@@ -664,15 +673,6 @@
664673
}
665674
}
666675
},
667-
"DocumentOrShadowRoot": {
668-
"properties": {
669-
"property": {
670-
"styleSheets": {
671-
"comment": "/**\r\n * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document.\r\n */"
672-
}
673-
}
674-
}
675-
},
676676
"Document": {
677677
"properties": {
678678
"property": {

inputfiles/idl/Clipboard.widl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
dictionary ClipboardEventInit : EventInit {
2+
DataTransfer? clipboardData = null;
3+
};
4+
5+
[Constructor(DOMString type, optional ClipboardEventInit eventInitDict), Exposed=Window]
6+
interface ClipboardEvent : Event {
7+
readonly attribute DataTransfer? clipboardData;
8+
};
9+
10+
partial interface Navigator {
11+
[SecureContext, SameObject] readonly attribute Clipboard clipboard;
12+
};
13+
14+
[SecureContext, Exposed=Window] interface Clipboard : EventTarget {
15+
Promise<DataTransfer> read();
16+
Promise<DOMString> readText();
17+
Promise<void> write(DataTransfer data);
18+
Promise<void> writeText(DOMString data);
19+
};
20+
21+
dictionary ClipboardPermissionDescriptor : PermissionDescriptor {
22+
boolean allowWithoutGesture = false;
23+
};

inputfiles/idl/Pointer Lock.widl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
partial interface Element {
2+
void requestPointerLock();
3+
};
4+
5+
partial interface Document {
6+
attribute EventHandler onpointerlockchange;
7+
attribute EventHandler onpointerlockerror;
8+
void exitPointerLock();
9+
};
10+
11+
partial interface DocumentOrShadowRoot {
12+
readonly attribute Element? pointerLockElement;
13+
};
14+
15+
partial interface MouseEvent {
16+
readonly attribute long movementX;
17+
readonly attribute long movementY;
18+
};
19+
20+
partial dictionary MouseEventInit {
21+
long movementX = 0;
22+
long movementY = 0;
23+
};

inputfiles/idlSources.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
[
2+
{
3+
"url": "https://www.w3.org/TR/clipboard-apis/",
4+
"title": "Clipboard"
5+
},
26
{
37
"url": "https://compat.spec.whatwg.org/",
48
"title": "Compatibility",
@@ -190,6 +194,10 @@
190194
"url": "https://www.w3.org/TR/pointerevents2/",
191195
"title": "Pointer Events"
192196
},
197+
{
198+
"url": "https://www.w3.org/TR/pointerlock-2/",
199+
"title": "Pointer Lock"
200+
},
193201
{
194202
"url": "https://www.w3.org/TR/push-api/",
195203
"title": "Push"

0 commit comments

Comments
 (0)