Skip to content

Commit 170a17f

Browse files
authoredOct 26, 2022
Dom update 2022-10-25 (#51300)
* 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
1 parent 9c4e14d commit 170a17f

12 files changed

+332
-36
lines changed
 

‎src/lib/dom.generated.d.ts

+111-14
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,13 @@ interface AudioWorkletNodeOptions extends AudioNodeOptions {
117117
interface AuthenticationExtensionsClientInputs {
118118
appid?: string;
119119
credProps?: boolean;
120+
hmacCreateSecret?: boolean;
120121
}
121122

122123
interface AuthenticationExtensionsClientOutputs {
123124
appid?: boolean;
124125
credProps?: CredentialPropertiesOutput;
126+
hmacCreateSecret?: boolean;
125127
}
126128

127129
interface AuthenticatorSelectionCriteria {
@@ -1324,6 +1326,7 @@ interface RTCInboundRtpStreamStats extends RTCReceivedRtpStreamStats {
13241326
frameHeight?: number;
13251327
frameWidth?: number;
13261328
framesDecoded?: number;
1329+
framesDropped?: number;
13271330
framesPerSecond?: number;
13281331
framesReceived?: number;
13291332
headerBytesReceived?: number;
@@ -1343,6 +1346,7 @@ interface RTCInboundRtpStreamStats extends RTCReceivedRtpStreamStats {
13431346
totalAudioEnergy?: number;
13441347
totalDecodeTime?: number;
13451348
totalInterFrameDelay?: number;
1349+
totalProcessingDelay?: number;
13461350
totalSamplesDuration?: number;
13471351
totalSamplesReceived?: number;
13481352
totalSquaredInterFrameDelay?: number;
@@ -1401,7 +1405,6 @@ interface RTCPeerConnectionIceEventInit extends EventInit {
14011405
}
14021406

14031407
interface RTCReceivedRtpStreamStats extends RTCRtpStreamStats {
1404-
framesDropped?: number;
14051408
jitter?: number;
14061409
packetsLost?: number;
14071410
packetsReceived?: number;
@@ -1446,6 +1449,8 @@ interface RTCRtpContributingSource {
14461449
interface RTCRtpEncodingParameters extends RTCRtpCodingParameters {
14471450
active?: boolean;
14481451
maxBitrate?: number;
1452+
maxFramerate?: number;
1453+
networkPriority?: RTCPriorityType;
14491454
priority?: RTCPriorityType;
14501455
scaleResolutionDownBy?: number;
14511456
}
@@ -1866,10 +1871,10 @@ interface ValidityStateFlags {
18661871
}
18671872

18681873
interface VideoColorSpaceInit {
1869-
fullRange?: boolean;
1870-
matrix?: VideoMatrixCoefficients;
1871-
primaries?: VideoColorPrimaries;
1872-
transfer?: VideoTransferCharacteristics;
1874+
fullRange?: boolean | null;
1875+
matrix?: VideoMatrixCoefficients | null;
1876+
primaries?: VideoColorPrimaries | null;
1877+
transfer?: VideoTransferCharacteristics | null;
18731878
}
18741879

18751880
interface VideoConfiguration {
@@ -1884,7 +1889,7 @@ interface VideoConfiguration {
18841889
width: number;
18851890
}
18861891

1887-
interface VideoFrameMetadata {
1892+
interface VideoFrameCallbackMetadata {
18881893
captureTime?: DOMHighResTimeStamp;
18891894
expectedDisplayTime: DOMHighResTimeStamp;
18901895
height: number;
@@ -2046,7 +2051,7 @@ interface AbortSignal extends EventTarget {
20462051
declare var AbortSignal: {
20472052
prototype: AbortSignal;
20482053
new(): AbortSignal;
2049-
// abort(): AbortSignal; - To be re-added in the future
2054+
abort(reason?: any): AbortSignal;
20502055
timeout(milliseconds: number): AbortSignal;
20512056
};
20522057

@@ -2182,7 +2187,7 @@ declare var AnimationPlaybackEvent: {
21822187
};
21832188

21842189
interface AnimationTimeline {
2185-
readonly currentTime: number | null;
2190+
readonly currentTime: CSSNumberish | null;
21862191
}
21872192

21882193
declare var AnimationTimeline: {
@@ -2435,6 +2440,8 @@ declare var AuthenticatorAssertionResponse: {
24352440
interface AuthenticatorAttestationResponse extends AuthenticatorResponse {
24362441
readonly attestationObject: ArrayBuffer;
24372442
getAuthenticatorData(): ArrayBuffer;
2443+
getPublicKey(): ArrayBuffer | null;
2444+
getPublicKeyAlgorithm(): COSEAlgorithmIdentifier;
24382445
getTransports(): string[];
24392446
}
24402447

@@ -2634,6 +2641,14 @@ declare var CSSConditionRule: {
26342641
new(): CSSConditionRule;
26352642
};
26362643

2644+
interface CSSContainerRule extends CSSConditionRule {
2645+
}
2646+
2647+
declare var CSSContainerRule: {
2648+
prototype: CSSContainerRule;
2649+
new(): CSSContainerRule;
2650+
};
2651+
26372652
interface CSSCounterStyleRule extends CSSRule {
26382653
additiveSymbols: string;
26392654
fallback: string;
@@ -2943,6 +2958,9 @@ interface CSSStyleDeclaration {
29432958
columnWidth: string;
29442959
columns: string;
29452960
contain: string;
2961+
container: string;
2962+
containerName: string;
2963+
containerType: string;
29462964
content: string;
29472965
counterIncrement: string;
29482966
counterReset: string;
@@ -3011,6 +3029,7 @@ interface CSSStyleDeclaration {
30113029
gridTemplateColumns: string;
30123030
gridTemplateRows: string;
30133031
height: string;
3032+
hyphenateCharacter: string;
30143033
hyphens: string;
30153034
/** @deprecated */
30163035
imageOrientation: string;
@@ -3087,6 +3106,7 @@ interface CSSStyleDeclaration {
30873106
outlineWidth: string;
30883107
overflow: string;
30893108
overflowAnchor: string;
3109+
overflowClipMargin: string;
30903110
overflowWrap: string;
30913111
overflowX: string;
30923112
overflowY: string;
@@ -3544,6 +3564,7 @@ interface CanvasPath {
35443564
moveTo(x: number, y: number): void;
35453565
quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;
35463566
rect(x: number, y: number, w: number, h: number): void;
3567+
roundRect(x: number, y: number, w: number, h: number, radii?: number | DOMPointInit | (number | DOMPointInit)[]): void;
35473568
}
35483569

35493570
interface CanvasPathDrawingStyles {
@@ -4950,6 +4971,17 @@ interface EXT_texture_filter_anisotropic {
49504971
readonly TEXTURE_MAX_ANISOTROPY_EXT: GLenum;
49514972
}
49524973

4974+
interface EXT_texture_norm16 {
4975+
readonly R16_EXT: GLenum;
4976+
readonly R16_SNORM_EXT: GLenum;
4977+
readonly RG16_EXT: GLenum;
4978+
readonly RG16_SNORM_EXT: GLenum;
4979+
readonly RGB16_EXT: GLenum;
4980+
readonly RGB16_SNORM_EXT: GLenum;
4981+
readonly RGBA16_EXT: GLenum;
4982+
readonly RGBA16_SNORM_EXT: GLenum;
4983+
}
4984+
49534985
interface ElementEventMap {
49544986
"fullscreenchange": Event;
49554987
"fullscreenerror": Event;
@@ -6290,6 +6322,7 @@ interface HTMLCanvasElement extends HTMLElement {
62906322
* @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.
62916323
*/
62926324
toDataURL(type?: string, quality?: any): string;
6325+
transferControlToOffscreen(): OffscreenCanvas;
62936326
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
62946327
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
62956328
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -9004,7 +9037,7 @@ declare var ImageBitmap: {
90049037

90059038
interface ImageBitmapRenderingContext {
90069039
/** Returns the canvas element that the context is bound to. */
9007-
readonly canvas: HTMLCanvasElement;
9040+
readonly canvas: HTMLCanvasElement | OffscreenCanvas;
90089041
/** Transfers the underlying bitmap data from imageBitmap to context, and the bitmap becomes the contents of the canvas element to which context is bound. */
90099042
transferFromImageBitmap(bitmap: ImageBitmap | null): void;
90109043
}
@@ -9035,6 +9068,7 @@ interface InnerHTML {
90359068
innerHTML: string;
90369069
}
90379070

9071+
/** Available only in secure contexts. */
90389072
interface InputDeviceInfo extends MediaDeviceInfo {
90399073
}
90409074

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

10276+
interface OES_draw_buffers_indexed {
10277+
blendEquationSeparateiOES(buf: GLuint, modeRGB: GLenum, modeAlpha: GLenum): void;
10278+
blendEquationiOES(buf: GLuint, mode: GLenum): void;
10279+
blendFuncSeparateiOES(buf: GLuint, srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum): void;
10280+
blendFunciOES(buf: GLuint, src: GLenum, dst: GLenum): void;
10281+
colorMaskiOES(buf: GLuint, r: GLboolean, g: GLboolean, b: GLboolean, a: GLboolean): void;
10282+
disableiOES(target: GLenum, index: GLuint): void;
10283+
enableiOES(target: GLenum, index: GLuint): void;
10284+
}
10285+
1024210286
/** The OES_element_index_uint extension is part of the WebGL API and adds support for gl.UNSIGNED_INT types to WebGLRenderingContext.drawElements(). */
1024310287
interface OES_element_index_uint {
1024410288
}
@@ -10317,6 +10361,57 @@ declare var OfflineAudioContext: {
1031710361
new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext;
1031810362
};
1031910363

10364+
interface OffscreenCanvasEventMap {
10365+
"contextlost": Event;
10366+
"contextrestored": Event;
10367+
}
10368+
10369+
interface OffscreenCanvas extends EventTarget {
10370+
/**
10371+
* These attributes return the dimensions of the OffscreenCanvas object's bitmap.
10372+
*
10373+
* They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).
10374+
*/
10375+
height: number;
10376+
oncontextlost: ((this: OffscreenCanvas, ev: Event) => any) | null;
10377+
oncontextrestored: ((this: OffscreenCanvas, ev: Event) => any) | null;
10378+
/**
10379+
* These attributes return the dimensions of the OffscreenCanvas object's bitmap.
10380+
*
10381+
* They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).
10382+
*/
10383+
width: number;
10384+
/**
10385+
* 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.
10386+
*
10387+
* 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]
10388+
*
10389+
* 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).
10390+
*/
10391+
getContext(contextId: OffscreenRenderingContextId, options?: any): OffscreenRenderingContext | null;
10392+
/** 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. */
10393+
transferToImageBitmap(): ImageBitmap;
10394+
addEventListener<K extends keyof OffscreenCanvasEventMap>(type: K, listener: (this: OffscreenCanvas, ev: OffscreenCanvasEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
10395+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
10396+
removeEventListener<K extends keyof OffscreenCanvasEventMap>(type: K, listener: (this: OffscreenCanvas, ev: OffscreenCanvasEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
10397+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
10398+
}
10399+
10400+
declare var OffscreenCanvas: {
10401+
prototype: OffscreenCanvas;
10402+
new(width: number, height: number): OffscreenCanvas;
10403+
};
10404+
10405+
interface OffscreenCanvasRenderingContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform {
10406+
readonly canvas: OffscreenCanvas;
10407+
commit(): void;
10408+
}
10409+
10410+
declare var OffscreenCanvasRenderingContext2D: {
10411+
prototype: OffscreenCanvasRenderingContext2D;
10412+
new(): OffscreenCanvasRenderingContext2D;
10413+
};
10414+
1032010415
/** 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. */
1032110416
interface OscillatorNode extends AudioScheduledSourceNode {
1032210417
readonly detune: AudioParam;
@@ -16027,7 +16122,7 @@ declare var WebGLRenderingContext: {
1602716122
};
1602816123

1602916124
interface WebGLRenderingContextBase {
16030-
readonly canvas: HTMLCanvasElement;
16125+
readonly canvas: HTMLCanvasElement | OffscreenCanvas;
1603116126
readonly drawingBufferHeight: GLsizei;
1603216127
readonly drawingBufferWidth: GLsizei;
1603316128
activeTexture(texture: GLenum): void;
@@ -17505,7 +17600,7 @@ interface UnderlyingSourceStartCallback<R> {
1750517600
}
1750617601

1750717602
interface VideoFrameRequestCallback {
17508-
(now: DOMHighResTimeStamp, metadata: VideoFrameMetadata): void;
17603+
(now: DOMHighResTimeStamp, metadata: VideoFrameCallbackMetadata): void;
1750917604
}
1751017605

1751117606
interface VoidFunction {
@@ -18182,7 +18277,7 @@ type BodyInit = ReadableStream | XMLHttpRequestBodyInit;
1818218277
type BufferSource = ArrayBufferView | ArrayBuffer;
1818318278
type COSEAlgorithmIdentifier = number;
1818418279
type CSSNumberish = number;
18185-
type CanvasImageSource = HTMLOrSVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap;
18280+
type CanvasImageSource = HTMLOrSVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas;
1818618281
type ClipboardItemData = Promise<string | Blob>;
1818718282
type ClipboardItems = ClipboardItem[];
1818818283
type ConstrainBoolean = boolean | ConstrainBooleanParameters;
@@ -18219,6 +18314,7 @@ type MediaProvider = MediaStream | MediaSource | Blob;
1821918314
type MessageEventSource = WindowProxy | MessagePort | ServiceWorker;
1822018315
type MutationRecordType = "attributes" | "characterData" | "childList";
1822118316
type NamedCurve = string;
18317+
type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
1822218318
type OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull | null;
1822318319
type OnErrorEventHandler = OnErrorEventHandlerNonNull | null;
1822418320
type PerformanceEntryList = PerformanceEntry[];
@@ -18227,9 +18323,9 @@ type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableSt
1822718323
type ReadableStreamReader<T> = ReadableStreamDefaultReader<T> | ReadableStreamBYOBReader;
1822818324
type RenderingContext = CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
1822918325
type RequestInfo = Request | string;
18230-
type TexImageSource = ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;
18326+
type TexImageSource = ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | OffscreenCanvas;
1823118327
type TimerHandler = string | Function;
18232-
type Transferable = ImageBitmap | MessagePort | ReadableStream | WritableStream | TransformStream | ArrayBuffer;
18328+
type Transferable = OffscreenCanvas | ImageBitmap | MessagePort | ReadableStream | WritableStream | TransformStream | ArrayBuffer;
1823318329
type Uint32List = Uint32Array | GLuint[];
1823418330
type VibratePattern = number | number[];
1823518331
type WindowProxy = Window;
@@ -18309,6 +18405,7 @@ type MediaStreamTrackState = "ended" | "live";
1830918405
type NavigationTimingType = "back_forward" | "navigate" | "prerender" | "reload";
1831018406
type NotificationDirection = "auto" | "ltr" | "rtl";
1831118407
type NotificationPermission = "default" | "denied" | "granted";
18408+
type OffscreenRenderingContextId = "2d" | "bitmaprenderer" | "webgl" | "webgl2" | "webgpu";
1831218409
type OrientationLockType = "any" | "landscape" | "landscape-primary" | "landscape-secondary" | "natural" | "portrait" | "portrait-primary" | "portrait-secondary";
1831318410
type OrientationType = "landscape-primary" | "landscape-secondary" | "portrait-primary" | "portrait-secondary";
1831418411
type OscillatorType = "custom" | "sawtooth" | "sine" | "square" | "triangle";

‎src/lib/dom.iterable.generated.d.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ interface Cache {
2626
addAll(requests: Iterable<RequestInfo>): Promise<void>;
2727
}
2828

29+
interface CanvasPath {
30+
roundRect(x: number, y: number, w: number, h: number, radii?: number | DOMPointInit | Iterable<number | DOMPointInit>): void;
31+
}
32+
2933
interface CanvasPathDrawingStyles {
3034
setLineDash(segments: Iterable<number>): void;
3135
}
@@ -253,8 +257,8 @@ interface WEBGL_draw_buffers {
253257
interface WEBGL_multi_draw {
254258
multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: GLuint, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: GLuint, drawcount: GLsizei): void;
255259
multiDrawArraysWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: GLuint, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, drawcount: GLsizei): void;
256-
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;
257-
multiDrawElementsWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLint>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, drawcount: GLsizei): void;
260+
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;
261+
multiDrawElementsWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, drawcount: GLsizei): void;
258262
}
259263

260264
interface WebGL2RenderingContextBase {

0 commit comments

Comments
 (0)
Please sign in to comment.