Skip to content

Commit

Permalink
Dom update 2022-10-25 (#51300)
Browse files Browse the repository at this point in the history
* Update DOM

Looks like the changes are:

- AbortSignal.abort finally has the right type.
- Add OffscreenCanvas support
- Some new properties scattered around, some properties now allow `null`.
- rename VideoFrameMetadata -> VideoFrameCallbackMetadata
- Add CSSContainerRule, EXT_texture_norm16, OES_draw_buffers_indexed
- Some type aliases include more types in their union.

* Update baselines
  • Loading branch information
sandersn committed Oct 26, 2022
1 parent 9c4e14d commit 170a17f
Show file tree
Hide file tree
Showing 12 changed files with 332 additions and 36 deletions.
125 changes: 111 additions & 14 deletions src/lib/dom.generated.d.ts
Expand Up @@ -117,11 +117,13 @@ interface AudioWorkletNodeOptions extends AudioNodeOptions {
interface AuthenticationExtensionsClientInputs {
appid?: string;
credProps?: boolean;
hmacCreateSecret?: boolean;
}

interface AuthenticationExtensionsClientOutputs {
appid?: boolean;
credProps?: CredentialPropertiesOutput;
hmacCreateSecret?: boolean;
}

interface AuthenticatorSelectionCriteria {
Expand Down Expand Up @@ -1324,6 +1326,7 @@ interface RTCInboundRtpStreamStats extends RTCReceivedRtpStreamStats {
frameHeight?: number;
frameWidth?: number;
framesDecoded?: number;
framesDropped?: number;
framesPerSecond?: number;
framesReceived?: number;
headerBytesReceived?: number;
Expand All @@ -1343,6 +1346,7 @@ interface RTCInboundRtpStreamStats extends RTCReceivedRtpStreamStats {
totalAudioEnergy?: number;
totalDecodeTime?: number;
totalInterFrameDelay?: number;
totalProcessingDelay?: number;
totalSamplesDuration?: number;
totalSamplesReceived?: number;
totalSquaredInterFrameDelay?: number;
Expand Down Expand Up @@ -1401,7 +1405,6 @@ interface RTCPeerConnectionIceEventInit extends EventInit {
}

interface RTCReceivedRtpStreamStats extends RTCRtpStreamStats {
framesDropped?: number;
jitter?: number;
packetsLost?: number;
packetsReceived?: number;
Expand Down Expand Up @@ -1446,6 +1449,8 @@ interface RTCRtpContributingSource {
interface RTCRtpEncodingParameters extends RTCRtpCodingParameters {
active?: boolean;
maxBitrate?: number;
maxFramerate?: number;
networkPriority?: RTCPriorityType;
priority?: RTCPriorityType;
scaleResolutionDownBy?: number;
}
Expand Down Expand Up @@ -1866,10 +1871,10 @@ interface ValidityStateFlags {
}

interface VideoColorSpaceInit {
fullRange?: boolean;
matrix?: VideoMatrixCoefficients;
primaries?: VideoColorPrimaries;
transfer?: VideoTransferCharacteristics;
fullRange?: boolean | null;
matrix?: VideoMatrixCoefficients | null;
primaries?: VideoColorPrimaries | null;
transfer?: VideoTransferCharacteristics | null;
}

interface VideoConfiguration {
Expand All @@ -1884,7 +1889,7 @@ interface VideoConfiguration {
width: number;
}

interface VideoFrameMetadata {
interface VideoFrameCallbackMetadata {
captureTime?: DOMHighResTimeStamp;
expectedDisplayTime: DOMHighResTimeStamp;
height: number;
Expand Down Expand Up @@ -2046,7 +2051,7 @@ interface AbortSignal extends EventTarget {
declare var AbortSignal: {
prototype: AbortSignal;
new(): AbortSignal;
// abort(): AbortSignal; - To be re-added in the future
abort(reason?: any): AbortSignal;
timeout(milliseconds: number): AbortSignal;
};

Expand Down Expand Up @@ -2182,7 +2187,7 @@ declare var AnimationPlaybackEvent: {
};

interface AnimationTimeline {
readonly currentTime: number | null;
readonly currentTime: CSSNumberish | null;
}

declare var AnimationTimeline: {
Expand Down Expand Up @@ -2435,6 +2440,8 @@ declare var AuthenticatorAssertionResponse: {
interface AuthenticatorAttestationResponse extends AuthenticatorResponse {
readonly attestationObject: ArrayBuffer;
getAuthenticatorData(): ArrayBuffer;
getPublicKey(): ArrayBuffer | null;
getPublicKeyAlgorithm(): COSEAlgorithmIdentifier;
getTransports(): string[];
}

Expand Down Expand Up @@ -2634,6 +2641,14 @@ declare var CSSConditionRule: {
new(): CSSConditionRule;
};

interface CSSContainerRule extends CSSConditionRule {
}

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

interface CSSCounterStyleRule extends CSSRule {
additiveSymbols: string;
fallback: string;
Expand Down Expand Up @@ -2943,6 +2958,9 @@ interface CSSStyleDeclaration {
columnWidth: string;
columns: string;
contain: string;
container: string;
containerName: string;
containerType: string;
content: string;
counterIncrement: string;
counterReset: string;
Expand Down Expand Up @@ -3011,6 +3029,7 @@ interface CSSStyleDeclaration {
gridTemplateColumns: string;
gridTemplateRows: string;
height: string;
hyphenateCharacter: string;
hyphens: string;
/** @deprecated */
imageOrientation: string;
Expand Down Expand Up @@ -3087,6 +3106,7 @@ interface CSSStyleDeclaration {
outlineWidth: string;
overflow: string;
overflowAnchor: string;
overflowClipMargin: string;
overflowWrap: string;
overflowX: string;
overflowY: string;
Expand Down Expand Up @@ -3544,6 +3564,7 @@ interface CanvasPath {
moveTo(x: number, y: number): void;
quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;
rect(x: number, y: number, w: number, h: number): void;
roundRect(x: number, y: number, w: number, h: number, radii?: number | DOMPointInit | (number | DOMPointInit)[]): void;
}

interface CanvasPathDrawingStyles {
Expand Down Expand Up @@ -4950,6 +4971,17 @@ interface EXT_texture_filter_anisotropic {
readonly TEXTURE_MAX_ANISOTROPY_EXT: GLenum;
}

interface EXT_texture_norm16 {
readonly R16_EXT: GLenum;
readonly R16_SNORM_EXT: GLenum;
readonly RG16_EXT: GLenum;
readonly RG16_SNORM_EXT: GLenum;
readonly RGB16_EXT: GLenum;
readonly RGB16_SNORM_EXT: GLenum;
readonly RGBA16_EXT: GLenum;
readonly RGBA16_SNORM_EXT: GLenum;
}

interface ElementEventMap {
"fullscreenchange": Event;
"fullscreenerror": Event;
Expand Down Expand Up @@ -6290,6 +6322,7 @@ interface HTMLCanvasElement extends HTMLElement {
* @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image.
*/
toDataURL(type?: string, quality?: any): string;
transferControlToOffscreen(): OffscreenCanvas;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down Expand Up @@ -9004,7 +9037,7 @@ declare var ImageBitmap: {

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. */
transferFromImageBitmap(bitmap: ImageBitmap | null): void;
}
Expand Down Expand Up @@ -9035,6 +9068,7 @@ interface InnerHTML {
innerHTML: string;
}

/** Available only in secure contexts. */
interface InputDeviceInfo extends MediaDeviceInfo {
}

Expand Down Expand Up @@ -10239,6 +10273,16 @@ declare var Notification: {
requestPermission(deprecatedCallback?: NotificationPermissionCallback): Promise<NotificationPermission>;
};

interface OES_draw_buffers_indexed {
blendEquationSeparateiOES(buf: GLuint, modeRGB: GLenum, modeAlpha: GLenum): void;
blendEquationiOES(buf: GLuint, mode: GLenum): void;
blendFuncSeparateiOES(buf: GLuint, srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum): void;
blendFunciOES(buf: GLuint, src: GLenum, dst: GLenum): void;
colorMaskiOES(buf: GLuint, r: GLboolean, g: GLboolean, b: GLboolean, a: GLboolean): void;
disableiOES(target: GLenum, index: GLuint): void;
enableiOES(target: GLenum, index: GLuint): void;
}

/** The OES_element_index_uint extension is part of the WebGL API and adds support for gl.UNSIGNED_INT types to WebGLRenderingContext.drawElements(). */
interface OES_element_index_uint {
}
Expand Down Expand Up @@ -10317,6 +10361,57 @@ declare var OfflineAudioContext: {
new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext;
};

interface OffscreenCanvasEventMap {
"contextlost": Event;
"contextrestored": Event;
}

interface OffscreenCanvas extends EventTarget {
/**
* These attributes return the dimensions of the OffscreenCanvas object's bitmap.
*
* They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).
*/
height: number;
oncontextlost: ((this: OffscreenCanvas, ev: Event) => any) | null;
oncontextrestored: ((this: OffscreenCanvas, ev: Event) => any) | null;
/**
* These attributes return the dimensions of the OffscreenCanvas object's bitmap.
*
* They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).
*/
width: number;
/**
* 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: 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. */
transferToImageBitmap(): ImageBitmap;
addEventListener<K extends keyof OffscreenCanvasEventMap>(type: K, listener: (this: OffscreenCanvas, ev: OffscreenCanvasEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof OffscreenCanvasEventMap>(type: K, listener: (this: OffscreenCanvas, ev: OffscreenCanvasEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}

declare var OffscreenCanvas: {
prototype: OffscreenCanvas;
new(width: number, height: number): OffscreenCanvas;
};

interface OffscreenCanvasRenderingContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform {
readonly canvas: OffscreenCanvas;
commit(): void;
}

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

/** The OscillatorNode interface represents a periodic waveform, such as a sine wave. It is an AudioScheduledSourceNode audio-processing module that causes a specified frequency of a given wave to be created—in effect, a constant tone. */
interface OscillatorNode extends AudioScheduledSourceNode {
readonly detune: AudioParam;
Expand Down Expand Up @@ -16027,7 +16122,7 @@ declare var WebGLRenderingContext: {
};

interface WebGLRenderingContextBase {
readonly canvas: HTMLCanvasElement;
readonly canvas: HTMLCanvasElement | OffscreenCanvas;
readonly drawingBufferHeight: GLsizei;
readonly drawingBufferWidth: GLsizei;
activeTexture(texture: GLenum): void;
Expand Down Expand Up @@ -17505,7 +17600,7 @@ interface UnderlyingSourceStartCallback<R> {
}

interface VideoFrameRequestCallback {
(now: DOMHighResTimeStamp, metadata: VideoFrameMetadata): void;
(now: DOMHighResTimeStamp, metadata: VideoFrameCallbackMetadata): void;
}

interface VoidFunction {
Expand Down Expand Up @@ -18182,7 +18277,7 @@ type BodyInit = ReadableStream | XMLHttpRequestBodyInit;
type BufferSource = ArrayBufferView | ArrayBuffer;
type COSEAlgorithmIdentifier = number;
type CSSNumberish = number;
type CanvasImageSource = HTMLOrSVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap;
type CanvasImageSource = HTMLOrSVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas;
type ClipboardItemData = Promise<string | Blob>;
type ClipboardItems = ClipboardItem[];
type ConstrainBoolean = boolean | ConstrainBooleanParameters;
Expand Down Expand Up @@ -18219,6 +18314,7 @@ type MediaProvider = MediaStream | MediaSource | Blob;
type MessageEventSource = WindowProxy | MessagePort | ServiceWorker;
type MutationRecordType = "attributes" | "characterData" | "childList";
type NamedCurve = string;
type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
type OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull | null;
type OnErrorEventHandler = OnErrorEventHandlerNonNull | null;
type PerformanceEntryList = PerformanceEntry[];
Expand All @@ -18227,9 +18323,9 @@ type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableSt
type ReadableStreamReader<T> = ReadableStreamDefaultReader<T> | ReadableStreamBYOBReader;
type RenderingContext = CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
type RequestInfo = Request | string;
type TexImageSource = ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;
type TexImageSource = ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | OffscreenCanvas;
type TimerHandler = string | Function;
type Transferable = ImageBitmap | MessagePort | ReadableStream | WritableStream | TransformStream | ArrayBuffer;
type Transferable = OffscreenCanvas | ImageBitmap | MessagePort | ReadableStream | WritableStream | TransformStream | ArrayBuffer;
type Uint32List = Uint32Array | GLuint[];
type VibratePattern = number | number[];
type WindowProxy = Window;
Expand Down Expand Up @@ -18309,6 +18405,7 @@ type MediaStreamTrackState = "ended" | "live";
type NavigationTimingType = "back_forward" | "navigate" | "prerender" | "reload";
type NotificationDirection = "auto" | "ltr" | "rtl";
type NotificationPermission = "default" | "denied" | "granted";
type OffscreenRenderingContextId = "2d" | "bitmaprenderer" | "webgl" | "webgl2" | "webgpu";
type OrientationLockType = "any" | "landscape" | "landscape-primary" | "landscape-secondary" | "natural" | "portrait" | "portrait-primary" | "portrait-secondary";
type OrientationType = "landscape-primary" | "landscape-secondary" | "portrait-primary" | "portrait-secondary";
type OscillatorType = "custom" | "sawtooth" | "sine" | "square" | "triangle";
Expand Down
8 changes: 6 additions & 2 deletions src/lib/dom.iterable.generated.d.ts
Expand Up @@ -26,6 +26,10 @@ interface Cache {
addAll(requests: Iterable<RequestInfo>): Promise<void>;
}

interface CanvasPath {
roundRect(x: number, y: number, w: number, h: number, radii?: number | DOMPointInit | Iterable<number | DOMPointInit>): void;
}

interface CanvasPathDrawingStyles {
setLineDash(segments: Iterable<number>): void;
}
Expand Down Expand Up @@ -253,8 +257,8 @@ interface WEBGL_draw_buffers {
interface WEBGL_multi_draw {
multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: GLuint, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: GLuint, drawcount: GLsizei): void;
multiDrawArraysWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: GLuint, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, drawcount: GLsizei): void;
multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLint>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: GLuint, drawcount: GLsizei): void;
multiDrawElementsWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLint>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, drawcount: GLsizei): void;
multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: GLuint, drawcount: GLsizei): void;
multiDrawElementsWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, drawcount: GLsizei): void;
}

interface WebGL2RenderingContextBase {
Expand Down

0 comments on commit 170a17f

Please sign in to comment.