Skip to content

Commit 3437f71

Browse files
committed
Merge branch 'master' into fullscreenoptions
2 parents 14c4e3a + aefa61c commit 3437f71

23 files changed

+2437
-370
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: 641 additions & 140 deletions
Large diffs are not rendered by default.

baselines/webworker.generated.d.ts

Lines changed: 318 additions & 18 deletions
Large diffs are not rendered by default.

inputfiles/README.md

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

7-
* `browser.webidl.json`
7+
* `browser.webidl.preprocessed.json`
8+
* `idl/*`
9+
* `mdn/*`
810

9-
Feel free to send a pull request with changes to any other files.
11+
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+
};
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
enum GamepadHand {
2+
"", /* unknown, both hands, or not applicable */
3+
"left",
4+
"right"
5+
};
6+
7+
interface GamepadHapticActuator {
8+
readonly attribute GamepadHapticActuatorType type;
9+
Promise<boolean> pulse(double value, double duration);
10+
};
11+
12+
enum GamepadHapticActuatorType {
13+
"vibration"
14+
};
15+
16+
interface GamepadPose {
17+
readonly attribute boolean hasOrientation;
18+
readonly attribute boolean hasPosition;
19+
20+
readonly attribute Float32Array? position;
21+
readonly attribute Float32Array? linearVelocity;
22+
readonly attribute Float32Array? linearAcceleration;
23+
readonly attribute Float32Array? orientation;
24+
readonly attribute Float32Array? angularVelocity;
25+
readonly attribute Float32Array? angularAcceleration;
26+
};
27+
28+
partial interface Gamepad {
29+
readonly attribute GamepadHand hand;
30+
readonly attribute FrozenArray<GamepadHapticActuator> hapticActuators;
31+
readonly attribute GamepadPose? pose;
32+
};

inputfiles/idl/Gamepad.widl

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[Exposed=Window]
2+
interface Gamepad {
3+
readonly attribute DOMString id;
4+
readonly attribute long index;
5+
readonly attribute boolean connected;
6+
readonly attribute DOMHighResTimeStamp timestamp;
7+
readonly attribute GamepadMappingType mapping;
8+
readonly attribute FrozenArray<double> axes;
9+
readonly attribute FrozenArray<GamepadButton> buttons;
10+
};
11+
12+
[Exposed=Window]
13+
interface GamepadButton {
14+
readonly attribute boolean pressed;
15+
readonly attribute boolean touched;
16+
readonly attribute double value;
17+
};
18+
19+
enum GamepadMappingType {
20+
"",
21+
"standard",
22+
};
23+
24+
[Exposed=Window]
25+
partial interface Navigator {
26+
sequence<Gamepad?> getGamepads();
27+
};
28+
29+
[Constructor(DOMString type, GamepadEventInit eventInitDict), Exposed=Window]
30+
31+
interface GamepadEvent : Event {
32+
[SameObject] readonly attribute Gamepad gamepad;
33+
};
34+
35+
dictionary GamepadEventInit : EventInit {
36+
required Gamepad gamepad;
37+
};

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/idl/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# DANGER ZONE
2+
3+
Everything here is autogenerated by `npm run fetch` and MUST NOT be changed in a manual way.

inputfiles/idl/Streams.widl

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
[Constructor(optional UnderlyingSource underlyingSource, optional QueuingStrategy strategy),
2+
Constructor(optional UnderlyingByteSource underlyingSource, optional QueuingStrategy strategy),
3+
Exposed=(Window,Worker)]
4+
interface ReadableStream {
5+
readonly attribute boolean locked;
6+
Promise<void> cancel(optional any reason);
7+
ReadableStreamBYOBReader getReader(any options);
8+
ReadableStreamDefaultReader getReader();
9+
any pipeThrough(any pair, optional PipeOptions options);
10+
Promise<void> pipeTo(WritableStream dest, optional PipeOptions options);
11+
[ReadableStream, ReadableStream] tee();
12+
};
13+
14+
callback QueuingStrategySizeCallback = double (any chunk);
15+
16+
dictionary QueuingStrategy {
17+
unrestricted double? highWaterMark;
18+
QueuingStrategySizeCallback? size;
19+
};
20+
21+
callback ReadableByteStreamControllerCallback = any (ReadableByteStreamController controller);
22+
callback ReadableStreamDefaultControllerCallback = any (ReadableStreamDefaultController controller);
23+
callback ReadableStreamErrorCallback = any (any reason);
24+
25+
dictionary UnderlyingSource {
26+
ReadableStreamDefaultControllerCallback? start;
27+
ReadableStreamDefaultControllerCallback? pull;
28+
ReadableStreamErrorCallback? cancel;
29+
30+
any type;
31+
};
32+
33+
dictionary UnderlyingByteSource {
34+
ReadableByteStreamControllerCallback? start;
35+
ReadableByteStreamControllerCallback? pull;
36+
ReadableStreamErrorCallback? cancel;
37+
38+
required DOMString type;
39+
unsigned long? autoAllocateChunkSize;
40+
};
41+
42+
dictionary PipeOptions {
43+
boolean? preventClose;
44+
boolean? preventAbort;
45+
boolean? preventCancel;
46+
};
47+
48+
[Exposed=(Window,Worker)]
49+
interface ReadableStreamReadResult {
50+
attribute boolean done;
51+
attribute any value;
52+
};
53+
54+
[Constructor(ReadableStream stream),
55+
Exposed=(Window,Worker)]
56+
interface ReadableStreamDefaultReader {
57+
readonly attribute Promise<void> closed;
58+
59+
Promise<void> cancel(optional any reason);
60+
Promise<ReadableStreamReadResult> read();
61+
void releaseLock();
62+
};
63+
64+
[Constructor(ReadableStream stream),
65+
Exposed=(Window,Worker)]
66+
interface ReadableStreamBYOBReader {
67+
readonly attribute Promise<void> closed;
68+
69+
Promise<void> cancel(optional any reason);
70+
Promise<ReadableStreamReadResult> read(ArrayBufferView view);
71+
void releaseLock();
72+
};
73+
74+
[Exposed=(Window,Worker)]
75+
interface ReadableStreamDefaultController {
76+
readonly attribute unrestricted double? desiredSize;
77+
78+
void close();
79+
void enqueue(any chunk);
80+
void error(optional any error);
81+
};
82+
83+
[Exposed=(Window,Worker)]
84+
interface ReadableByteStreamController {
85+
readonly attribute ReadableStreamBYOBRequest byobRequest;
86+
readonly attribute unrestricted double? desiredSize;
87+
88+
void close();
89+
void enqueue(ArrayBufferView chunk);
90+
void error(optional any error);
91+
};
92+
93+
[Exposed=(Window,Worker)]
94+
interface ReadableStreamBYOBRequest {
95+
readonly attribute ArrayBufferView view;
96+
97+
void respond(unsigned long bytesWritten);
98+
void respondWithNewView(ArrayBufferView view);
99+
};
100+
101+
[Constructor(optional UnderlyingSink underlyingSink, optional QueuingStrategy strategy),
102+
Exposed=(Window,Worker)]
103+
interface WritableStream {
104+
readonly attribute boolean locked;
105+
Promise<void> abort(optional any reason);
106+
WritableStreamDefaultWriter getWriter();
107+
};
108+
109+
callback WritableStreamDefaultControllerStartCallback = any (WritableStreamDefaultController controller);
110+
callback WritableStreamDefaultControllerWriteCallback = any (any chunk, WritableStreamDefaultController controller);
111+
callback WritableStreamDefaultControllerCloseCallback = any ();
112+
callback WritableStreamErrorCallback = any (any reason);
113+
114+
dictionary UnderlyingSink {
115+
WritableStreamDefaultControllerStartCallback? start;
116+
WritableStreamDefaultControllerWriteCallback? write;
117+
WritableStreamDefaultControllerCloseCallback? close;
118+
WritableStreamErrorCallback? abort;
119+
120+
any type;
121+
};
122+
123+
[Constructor(ReadableStream stream),
124+
Exposed=(Window,Worker)]
125+
interface WritableStreamDefaultWriter {
126+
readonly attribute Promise<void> closed;
127+
readonly attribute unrestricted double? desiredSize;
128+
readonly attribute Promise<void> ready;
129+
130+
Promise<void> abort(optional any reason);
131+
Promise<void> close();
132+
void releaseLock();
133+
Promise<void> write(any chunk);
134+
};
135+
136+
[Exposed=(Window,Worker)]
137+
interface WritableStreamDefaultController {
138+
void error(optional any error);
139+
};
140+
141+
[Constructor(optional Transformer transformer, optional QueuingStrategy writableStrategy, optional QueuingStrategy readableStrategy),
142+
Exposed=(Window,Worker)]
143+
interface TransformStream {
144+
readonly attribute ReadableStream readable;
145+
readonly attribute WritableStream writable;
146+
};
147+
148+
callback TransformStreamDefaultControllerCallback = any (TransformStreamDefaultController controller);
149+
callback TransformStreamDefaultControllerTransformCallback = any (any chunk, TransformStreamDefaultController controller);
150+
151+
dictionary Transformer {
152+
TransformStreamDefaultControllerCallback? start;
153+
TransformStreamDefaultControllerTransformCallback? transform;
154+
TransformStreamDefaultControllerCallback? flush;
155+
156+
any readableType;
157+
any writableType;
158+
};
159+
160+
[Exposed=(Window,Worker)]
161+
interface TransformStreamDefaultController {
162+
readonly attribute unrestricted double? desiredSize;
163+
164+
void enqueue(any chunk);
165+
void error(optional any reason);
166+
void terminate();
167+
};
168+
169+
[Constructor(any options),
170+
Exposed=(Window,Worker)]
171+
interface ByteLengthQueuingStrategy: QueuingStrategy {
172+
attribute unrestricted double highWaterMark;
173+
double size(ArrayBufferView chunk);
174+
};
175+
176+
[Constructor(any options),
177+
Exposed=(Window,Worker)]
178+
interface CountQueuingStrategy: QueuingStrategy {
179+
attribute unrestricted double highWaterMark;
180+
double size(any chunk);
181+
};

0 commit comments

Comments
 (0)