Skip to content

General type updates #712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,10 @@ interface IIRFilterOptions extends AudioNodeOptions {
feedforward: number[];
}

interface ImageBitmapRenderingContextSettings {
alpha?: boolean;
}

interface ImageEncodeOptions {
quality?: number;
type?: string;
Expand Down Expand Up @@ -701,7 +705,6 @@ interface MediaTrackCapabilities {
resizeMode?: string[];
sampleRate?: ULongRange;
sampleSize?: ULongRange;
volume?: DoubleRange;
width?: ULongRange;
}

Expand All @@ -720,7 +723,6 @@ interface MediaTrackConstraintSet {
resizeMode?: ConstrainDOMString;
sampleRate?: ConstrainULong;
sampleSize?: ConstrainULong;
volume?: ConstrainDouble;
width?: ConstrainULong;
}

Expand All @@ -743,7 +745,6 @@ interface MediaTrackSettings {
resizeMode?: string;
sampleRate?: number;
sampleSize?: number;
volume?: number;
width?: number;
}

Expand All @@ -762,7 +763,6 @@ interface MediaTrackSupportedConstraints {
resizeMode?: boolean;
sampleRate?: boolean;
sampleSize?: boolean;
volume?: boolean;
width?: boolean;
}

Expand Down Expand Up @@ -3311,7 +3311,6 @@ interface CanvasRect {
/** The CanvasRenderingContext2D interface, part of the Canvas API, provides the 2D rendering context for the drawing surface of a <canvas> element. It is used for drawing shapes, text, images, and other objects. */
interface CanvasRenderingContext2D extends CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasUserInterface, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath {
readonly canvas: HTMLCanvasElement;
getContextAttributes(): CanvasRenderingContext2DSettings;
}

declare var CanvasRenderingContext2D: {
Expand Down Expand Up @@ -5258,7 +5257,7 @@ interface Event {
*/
readonly type: string;
/**
* Returns the item objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget.
* Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget.
*/
composedPath(): EventTarget[];
initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;
Expand Down Expand Up @@ -6350,9 +6349,11 @@ interface HTMLCanvasElement extends HTMLElement {
* Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas.
* @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl");
*/
getContext(contextId: "2d", contextAttributes?: CanvasRenderingContext2DSettings): CanvasRenderingContext2D | null;
getContext(contextId: "webgl" | "experimental-webgl", contextAttributes?: WebGLContextAttributes): WebGLRenderingContext | null;
getContext(contextId: string, contextAttributes?: {}): CanvasRenderingContext2D | WebGLRenderingContext | null;
getContext(contextId: "2d", options?: CanvasRenderingContext2DSettings): CanvasRenderingContext2D | null;
getContext(contextId: "bitmaprenderer", options?: ImageBitmapRenderingContextSettings): ImageBitmapRenderingContext | null;
getContext(contextId: "webgl", options?: WebGLContextAttributes): WebGLRenderingContext | null;
getContext(contextId: "webgl2", options?: WebGLContextAttributes): WebGL2RenderingContext | null;
getContext(contextId: string, options?: any): RenderingContext | null;
toBlob(callback: BlobCallback, type?: string, quality?: any): void;
/**
* Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element.
Expand Down Expand Up @@ -7851,7 +7852,6 @@ interface HTMLObjectElement extends HTMLElement {
* Sets or retrieves the MIME type of the object.
*/
type: string;
typeMustMatch: boolean;
/**
* Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.
*/
Expand Down Expand Up @@ -9586,7 +9586,7 @@ interface ImageBitmapRenderingContext {
/**
* Returns the canvas element that the context is bound to.
*/
readonly canvas: HTMLCanvasElement;
readonly canvas: HTMLCanvasElement | OffscreenCanvas;
/**
* Transfers the underlying bitmap data from imageBitmap to context, and the bitmap becomes the contents of the canvas element to which context is bound.
*/
Expand Down Expand Up @@ -10387,7 +10387,6 @@ interface MediaStreamTrackEventMap {
"ended": Event;
"isolationchange": Event;
"mute": Event;
"overconstrained": MediaStreamErrorEvent;
"unmute": Event;
}

Expand All @@ -10402,7 +10401,6 @@ interface MediaStreamTrack extends EventTarget {
onended: ((this: MediaStreamTrack, ev: Event) => any) | null;
onisolationchange: ((this: MediaStreamTrack, ev: Event) => any) | null;
onmute: ((this: MediaStreamTrack, ev: Event) => any) | null;
onoverconstrained: ((this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any) | null;
onunmute: ((this: MediaStreamTrack, ev: Event) => any) | null;
readonly readyState: MediaStreamTrackState;
applyConstraints(constraints?: MediaTrackConstraints): Promise<void>;
Expand Down Expand Up @@ -11216,12 +11214,16 @@ interface OffscreenCanvas extends EventTarget {
*/
convertToBlob(options?: ImageEncodeOptions): Promise<Blob>;
/**
* Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "webgl", or "webgl2". options is handled by that API.
* Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "bitmaprenderer", "webgl", or "webgl2". options is handled by that API.
*
* This specification defines the "2d" context below, which is similar but distinct from the "2d" context that is created from a canvas element. The WebGL specifications define the "webgl" and "webgl2" contexts. [WEBGL]
*
* Returns null if the canvas has already been initialized with another context type (e.g., trying to get a "2d" context after getting a "webgl" context).
*/
getContext(contextId: "2d", options?: CanvasRenderingContext2DSettings): OffscreenCanvasRenderingContext2D | null;
getContext(contextId: "bitmaprenderer", options?: ImageBitmapRenderingContextSettings): ImageBitmapRenderingContext | null;
getContext(contextId: "webgl", options?: WebGLContextAttributes): WebGLRenderingContext | null;
getContext(contextId: "webgl2", options?: WebGLContextAttributes): WebGL2RenderingContext | null;
getContext(contextId: OffscreenRenderingContextId, options?: any): OffscreenRenderingContext | null;
/**
* Returns a newly created ImageBitmap object with the image in the OffscreenCanvas object. The image in the OffscreenCanvas object is replaced with a new blank image.
Expand Down Expand Up @@ -19772,7 +19774,7 @@ type DOMHighResTimeStamp = number;
type RenderingContext = CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
type HTMLOrSVGImageElement = HTMLImageElement | SVGImageElement;
type CanvasImageSource = HTMLOrSVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas;
type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | WebGLRenderingContext | WebGL2RenderingContext;
type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
type MessageEventSource = WindowProxy | MessagePort | ServiceWorker;
type HTMLOrSVGScriptElement = HTMLScriptElement | SVGScriptElement;
type ImageBitmapSource = CanvasImageSource | Blob | ImageData;
Expand Down Expand Up @@ -19877,7 +19879,7 @@ type NavigationReason = "up" | "down" | "left" | "right";
type NavigationType = "navigate" | "reload" | "back_forward" | "prerender";
type NotificationDirection = "auto" | "ltr" | "rtl";
type NotificationPermission = "default" | "denied" | "granted";
type OffscreenRenderingContextId = "2d" | "webgl" | "webgl2";
type OffscreenRenderingContextId = "2d" | "bitmaprenderer" | "webgl" | "webgl2";
type OrientationLockType = "any" | "natural" | "landscape" | "portrait" | "portrait-primary" | "portrait-secondary" | "landscape-primary" | "landscape-secondary";
type OrientationType = "portrait-primary" | "portrait-secondary" | "landscape-primary" | "landscape-secondary";
type OscillatorType = "sine" | "square" | "sawtooth" | "triangle" | "custom";
Expand Down
37 changes: 33 additions & 4 deletions baselines/webworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ interface CacheQueryOptions {
ignoreVary?: boolean;
}

interface CanvasRenderingContext2DSettings {
alpha?: boolean;
desynchronized?: boolean;
}

interface ClientQueryOptions {
includeUncontrolled?: boolean;
type?: ClientTypes;
Expand Down Expand Up @@ -214,6 +219,10 @@ interface IDBVersionChangeEventInit extends EventInit {
oldVersion?: number;
}

interface ImageBitmapRenderingContextSettings {
alpha?: boolean;
}

interface ImageEncodeOptions {
quality?: number;
type?: string;
Expand Down Expand Up @@ -1359,7 +1368,7 @@ interface Event {
*/
readonly type: string;
/**
* Returns the item objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget.
* Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget.
*/
composedPath(): EventTarget[];
initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;
Expand Down Expand Up @@ -2162,6 +2171,22 @@ interface ImageBitmapOptions {
resizeWidth?: number;
}

interface ImageBitmapRenderingContext {
/**
* Returns the canvas element that the context is bound to.
*/
readonly canvas: OffscreenCanvas;
/**
* Transfers the underlying bitmap data from imageBitmap to context, and the bitmap becomes the contents of the canvas element to which context is bound.
*/
transferFromImageBitmap(bitmap: ImageBitmap | null): void;
}

declare var ImageBitmapRenderingContext: {
prototype: ImageBitmapRenderingContext;
new(): ImageBitmapRenderingContext;
};

/** The underlying pixel data of an area of a <canvas> element. It is created using the ImageData() constructor or creator methods on the CanvasRenderingContext2D object associated with a canvas: createImageData() and getImageData(). It can also be used to set a part of the canvas by using putImageData(). */
interface ImageData {
/**
Expand Down Expand Up @@ -2412,12 +2437,16 @@ interface OffscreenCanvas extends EventTarget {
*/
convertToBlob(options?: ImageEncodeOptions): Promise<Blob>;
/**
* Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "webgl", or "webgl2". options is handled by that API.
* Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "bitmaprenderer", "webgl", or "webgl2". options is handled by that API.
*
* This specification defines the "2d" context below, which is similar but distinct from the "2d" context that is created from a canvas element. The WebGL specifications define the "webgl" and "webgl2" contexts. [WEBGL]
*
* Returns null if the canvas has already been initialized with another context type (e.g., trying to get a "2d" context after getting a "webgl" context).
*/
getContext(contextId: "2d", options?: CanvasRenderingContext2DSettings): OffscreenCanvasRenderingContext2D | null;
getContext(contextId: "bitmaprenderer", options?: ImageBitmapRenderingContextSettings): ImageBitmapRenderingContext | null;
getContext(contextId: "webgl", options?: WebGLContextAttributes): WebGLRenderingContext | null;
getContext(contextId: "webgl2", options?: WebGLContextAttributes): WebGL2RenderingContext | null;
getContext(contextId: OffscreenRenderingContextId, options?: any): OffscreenRenderingContext | null;
/**
* Returns a newly created ImageBitmap object with the image in the OffscreenCanvas object. The image in the OffscreenCanvas object is replaced with a new blank image.
Expand Down Expand Up @@ -5767,7 +5796,7 @@ type RequestInfo = Request | string;
type BlobPart = BufferSource | Blob | string;
type DOMHighResTimeStamp = number;
type CanvasImageSource = ImageBitmap | OffscreenCanvas;
type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | WebGLRenderingContext | WebGL2RenderingContext;
type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
type MessageEventSource = MessagePort | ServiceWorker;
type ImageBitmapSource = CanvasImageSource | Blob | ImageData;
type TimerHandler = string | Function;
Expand Down Expand Up @@ -5818,7 +5847,7 @@ type KeyType = "public" | "private" | "secret";
type KeyUsage = "encrypt" | "decrypt" | "sign" | "verify" | "deriveKey" | "deriveBits" | "wrapKey" | "unwrapKey";
type NotificationDirection = "auto" | "ltr" | "rtl";
type NotificationPermission = "default" | "denied" | "granted";
type OffscreenRenderingContextId = "2d" | "webgl" | "webgl2";
type OffscreenRenderingContextId = "2d" | "bitmaprenderer" | "webgl" | "webgl2";
type PermissionName = "geolocation" | "notifications" | "push" | "midi" | "camera" | "microphone" | "speaker" | "device-info" | "background-sync" | "bluetooth" | "persistent-storage" | "ambient-light-sensor" | "accelerometer" | "gyroscope" | "magnetometer" | "clipboard";
type PermissionState = "granted" | "denied" | "prompt";
type PushEncryptionKeyName = "p256dh" | "auth";
Expand Down
34 changes: 0 additions & 34 deletions inputfiles/addedTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -2148,16 +2148,6 @@
]
}
},
"MediaStreamTrack": {
"events": {
"event": [
{
"name": "overconstrained",
"type": "MediaStreamErrorEvent"
}
]
}
},
"OverconstrainedError": {
"name": "OverconstrainedError",
"extends": "Error",
Expand Down Expand Up @@ -2190,30 +2180,6 @@
},
"dictionaries": {
"dictionary": {
"WebGLContextAttributes": {
"name": "WebGLContextAttributes",
"members": {
"member": {
"failIfMajorPerformanceCaveat": {
"name": "failIfMajorPerformanceCaveat",
"override-type": "boolean",
"required": 0
}
}
}
},
"EventInit": {
"name": "EventInit",
"members": {
"member": {
"composed": {
"name": "composed",
"override-type": "boolean",
"required": 0
}
}
}
},
"ShadowRootInit": {
"members": {
"member": {
Expand Down
12 changes: 6 additions & 6 deletions inputfiles/idl/DOM XPath.widl
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ callback interface XPathNSResolver {
};

interface mixin XPathEvaluatorBase {
XPathExpression createExpression(DOMString expression,
optional XPathNSResolver? resolver);
[NewObject] XPathExpression createExpression(DOMString expression,
optional XPathNSResolver? resolver);
XPathNSResolver createNSResolver(Node nodeResolver);
XPathResult evaluate(DOMString expression,
Node contextNode,
optional XPathNSResolver? resolver,
optional unsigned short type,
XPathResult evaluate(DOMString expression,
Node contextNode,
optional XPathNSResolver? resolver,
optional unsigned short type,
optional XPathResult? result);
};

Expand Down
2 changes: 1 addition & 1 deletion inputfiles/idl/DOM.commentmap.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"event-type": "Returns the type of event, e.g. \"click\", \"hashchange\", or \"submit\".",
"event-target": "Returns the object to which event is dispatched (its target).",
"event-currenttarget": "Returns the object whose event listener's callback is currently being invoked.",
"event-composedpath": "Returns the item objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is \"closed\" that are not reachable from event's currentTarget.",
"event-composedpath": "Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is \"closed\" that are not reachable from event's currentTarget.",
"event-eventphase": "Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE.",
"event-stoppropagation": "When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.",
"event-stopimmediatepropagation": "Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects.",
Expand Down
Loading