Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-tsserver / node_modules / typescript / lib / lib.webworker.d.ts
1 /*! *****************************************************************************
2 Copyright (c) Microsoft Corporation. All rights reserved.
3 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 this file except in compliance with the License. You may obtain a copy of the
5 License at http://www.apache.org/licenses/LICENSE-2.0
6
7 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8 KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9 WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10 MERCHANTABLITY OR NON-INFRINGEMENT.
11
12 See the Apache Version 2.0 License for specific language governing permissions
13 and limitations under the License.
14 ***************************************************************************** */
15
16
17
18 /// <reference no-default-lib="true"/>\r
19
20
21 /////////////////////////////
22 /// Worker APIs
23 /////////////////////////////
24
25 interface AddEventListenerOptions extends EventListenerOptions {
26     once?: boolean;
27     passive?: boolean;
28 }
29
30 interface AesCbcParams extends Algorithm {
31     iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
32 }
33
34 interface AesCtrParams extends Algorithm {
35     counter: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
36     length: number;
37 }
38
39 interface AesDerivedKeyParams extends Algorithm {
40     length: number;
41 }
42
43 interface AesGcmParams extends Algorithm {
44     additionalData?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
45     iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
46     tagLength?: number;
47 }
48
49 interface AesKeyAlgorithm extends KeyAlgorithm {
50     length: number;
51 }
52
53 interface AesKeyGenParams extends Algorithm {
54     length: number;
55 }
56
57 interface Algorithm {
58     name: string;
59 }
60
61 interface BlobPropertyBag {
62     endings?: EndingType;
63     type?: string;
64 }
65
66 interface CacheQueryOptions {
67     ignoreMethod?: boolean;
68     ignoreSearch?: boolean;
69     ignoreVary?: boolean;
70 }
71
72 interface CanvasRenderingContext2DSettings {
73     alpha?: boolean;
74     desynchronized?: boolean;
75 }
76
77 interface ClientQueryOptions {
78     includeUncontrolled?: boolean;
79     type?: ClientTypes;
80 }
81
82 interface CloseEventInit extends EventInit {
83     code?: number;
84     reason?: string;
85     wasClean?: boolean;
86 }
87
88 interface CryptoKeyPair {
89     privateKey?: CryptoKey;
90     publicKey?: CryptoKey;
91 }
92
93 interface CustomEventInit<T = any> extends EventInit {
94     detail?: T;
95 }
96
97 interface DOMMatrix2DInit {
98     a?: number;
99     b?: number;
100     c?: number;
101     d?: number;
102     e?: number;
103     f?: number;
104     m11?: number;
105     m12?: number;
106     m21?: number;
107     m22?: number;
108     m41?: number;
109     m42?: number;
110 }
111
112 interface DOMMatrixInit extends DOMMatrix2DInit {
113     is2D?: boolean;
114     m13?: number;
115     m14?: number;
116     m23?: number;
117     m24?: number;
118     m31?: number;
119     m32?: number;
120     m33?: number;
121     m34?: number;
122     m43?: number;
123     m44?: number;
124 }
125
126 interface DOMPointInit {
127     w?: number;
128     x?: number;
129     y?: number;
130     z?: number;
131 }
132
133 interface DOMQuadInit {
134     p1?: DOMPointInit;
135     p2?: DOMPointInit;
136     p3?: DOMPointInit;
137     p4?: DOMPointInit;
138 }
139
140 interface DOMRectInit {
141     height?: number;
142     width?: number;
143     x?: number;
144     y?: number;
145 }
146
147 interface DevicePermissionDescriptor extends PermissionDescriptor {
148     deviceId?: string;
149     name: "camera" | "microphone" | "speaker";
150 }
151
152 interface EcKeyGenParams extends Algorithm {
153     namedCurve: NamedCurve;
154 }
155
156 interface EcKeyImportParams extends Algorithm {
157     namedCurve: NamedCurve;
158 }
159
160 interface EcdhKeyDeriveParams extends Algorithm {
161     public: CryptoKey;
162 }
163
164 interface EcdsaParams extends Algorithm {
165     hash: HashAlgorithmIdentifier;
166 }
167
168 interface ErrorEventInit extends EventInit {
169     colno?: number;
170     error?: any;
171     filename?: string;
172     lineno?: number;
173     message?: string;
174 }
175
176 interface EventInit {
177     bubbles?: boolean;
178     cancelable?: boolean;
179     composed?: boolean;
180 }
181
182 interface EventListenerOptions {
183     capture?: boolean;
184 }
185
186 interface EventSourceInit {
187     withCredentials?: boolean;
188 }
189
190 interface ExtendableEventInit extends EventInit {
191 }
192
193 interface ExtendableMessageEventInit extends ExtendableEventInit {
194     data?: any;
195     lastEventId?: string;
196     origin?: string;
197     ports?: MessagePort[];
198     source?: Client | ServiceWorker | MessagePort | null;
199 }
200
201 interface FetchEventInit extends ExtendableEventInit {
202     clientId?: string;
203     preloadResponse?: Promise<any>;
204     replacesClientId?: string;
205     request: Request;
206     resultingClientId?: string;
207 }
208
209 interface FilePropertyBag extends BlobPropertyBag {
210     lastModified?: number;
211 }
212
213 interface GetNotificationOptions {
214     tag?: string;
215 }
216
217 interface HkdfParams extends Algorithm {
218     hash: HashAlgorithmIdentifier;
219     info: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
220     salt: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
221 }
222
223 interface HmacImportParams extends Algorithm {
224     hash: HashAlgorithmIdentifier;
225     length?: number;
226 }
227
228 interface HmacKeyGenParams extends Algorithm {
229     hash: HashAlgorithmIdentifier;
230     length?: number;
231 }
232
233 interface IDBIndexParameters {
234     multiEntry?: boolean;
235     unique?: boolean;
236 }
237
238 interface IDBObjectStoreParameters {
239     autoIncrement?: boolean;
240     keyPath?: string | string[] | null;
241 }
242
243 interface IDBVersionChangeEventInit extends EventInit {
244     newVersion?: number | null;
245     oldVersion?: number;
246 }
247
248 interface ImageBitmapOptions {
249     colorSpaceConversion?: ColorSpaceConversion;
250     imageOrientation?: ImageOrientation;
251     premultiplyAlpha?: PremultiplyAlpha;
252     resizeHeight?: number;
253     resizeQuality?: ResizeQuality;
254     resizeWidth?: number;
255 }
256
257 interface ImageBitmapRenderingContextSettings {
258     alpha?: boolean;
259 }
260
261 interface ImageEncodeOptions {
262     quality?: number;
263     type?: string;
264 }
265
266 interface JsonWebKey {
267     alg?: string;
268     crv?: string;
269     d?: string;
270     dp?: string;
271     dq?: string;
272     e?: string;
273     ext?: boolean;
274     k?: string;
275     key_ops?: string[];
276     kty?: string;
277     n?: string;
278     oth?: RsaOtherPrimesInfo[];
279     p?: string;
280     q?: string;
281     qi?: string;
282     use?: string;
283     x?: string;
284     y?: string;
285 }
286
287 interface KeyAlgorithm {
288     name: string;
289 }
290
291 interface MessageEventInit<T = any> extends EventInit {
292     data?: T;
293     lastEventId?: string;
294     origin?: string;
295     ports?: MessagePort[];
296     source?: MessageEventSource | null;
297 }
298
299 interface MidiPermissionDescriptor extends PermissionDescriptor {
300     name: "midi";
301     sysex?: boolean;
302 }
303
304 interface MultiCacheQueryOptions extends CacheQueryOptions {
305     cacheName?: string;
306 }
307
308 interface NavigationPreloadState {
309     enabled?: boolean;
310     headerValue?: string;
311 }
312
313 interface NotificationAction {
314     action: string;
315     icon?: string;
316     title: string;
317 }
318
319 interface NotificationEventInit extends ExtendableEventInit {
320     action?: string;
321     notification: Notification;
322 }
323
324 interface NotificationOptions {
325     actions?: NotificationAction[];
326     badge?: string;
327     body?: string;
328     data?: any;
329     dir?: NotificationDirection;
330     icon?: string;
331     image?: string;
332     lang?: string;
333     renotify?: boolean;
334     requireInteraction?: boolean;
335     silent?: boolean;
336     tag?: string;
337     timestamp?: number;
338     vibrate?: VibratePattern;
339 }
340
341 interface Pbkdf2Params extends Algorithm {
342     hash: HashAlgorithmIdentifier;
343     iterations: number;
344     salt: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
345 }
346
347 interface PerformanceObserverInit {
348     buffered?: boolean;
349     entryTypes?: string[];
350     type?: string;
351 }
352
353 interface PermissionDescriptor {
354     name: PermissionName;
355 }
356
357 interface PipeOptions {
358     preventAbort?: boolean;
359     preventCancel?: boolean;
360     preventClose?: boolean;
361     signal?: AbortSignal;
362 }
363
364 interface PostMessageOptions {
365     transfer?: any[];
366 }
367
368 interface ProgressEventInit extends EventInit {
369     lengthComputable?: boolean;
370     loaded?: number;
371     total?: number;
372 }
373
374 interface PromiseRejectionEventInit extends EventInit {
375     promise: Promise<any>;
376     reason?: any;
377 }
378
379 interface PushEventInit extends ExtendableEventInit {
380     data?: PushMessageDataInit;
381 }
382
383 interface PushPermissionDescriptor extends PermissionDescriptor {
384     name: "push";
385     userVisibleOnly?: boolean;
386 }
387
388 interface PushSubscriptionChangeEventInit extends ExtendableEventInit {
389     newSubscription?: PushSubscription;
390     oldSubscription?: PushSubscription;
391 }
392
393 interface PushSubscriptionJSON {
394     endpoint?: string;
395     expirationTime?: number | null;
396     keys?: Record<string, string>;
397 }
398
399 interface PushSubscriptionOptionsInit {
400     applicationServerKey?: BufferSource | string | null;
401     userVisibleOnly?: boolean;
402 }
403
404 interface QueuingStrategy<T = any> {
405     highWaterMark?: number;
406     size?: QueuingStrategySizeCallback<T>;
407 }
408
409 interface ReadableStreamReadDoneResult<T> {
410     done: true;
411     value?: T;
412 }
413
414 interface ReadableStreamReadValueResult<T> {
415     done: false;
416     value: T;
417 }
418
419 interface RegistrationOptions {
420     scope?: string;
421     type?: WorkerType;
422     updateViaCache?: ServiceWorkerUpdateViaCache;
423 }
424
425 interface RequestInit {
426     /**
427      * A BodyInit object or null to set request's body.
428      */
429     body?: BodyInit | null;
430     /**
431      * A string indicating how the request will interact with the browser's cache to set request's cache.
432      */
433     cache?: RequestCache;
434     /**
435      * A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials.
436      */
437     credentials?: RequestCredentials;
438     /**
439      * A Headers object, an object literal, or an array of two-item arrays to set request's headers.
440      */
441     headers?: HeadersInit;
442     /**
443      * A cryptographic hash of the resource to be fetched by request. Sets request's integrity.
444      */
445     integrity?: string;
446     /**
447      * A boolean to set request's keepalive.
448      */
449     keepalive?: boolean;
450     /**
451      * A string to set request's method.
452      */
453     method?: string;
454     /**
455      * A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode.
456      */
457     mode?: RequestMode;
458     /**
459      * A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect.
460      */
461     redirect?: RequestRedirect;
462     /**
463      * A string whose value is a same-origin URL, "about:client", or the empty string, to set request's referrer.
464      */
465     referrer?: string;
466     /**
467      * A referrer policy to set request's referrerPolicy.
468      */
469     referrerPolicy?: ReferrerPolicy;
470     /**
471      * An AbortSignal to set request's signal.
472      */
473     signal?: AbortSignal | null;
474     /**
475      * Can only be null. Used to disassociate request from any Window.
476      */
477     window?: any;
478 }
479
480 interface ResponseInit {
481     headers?: HeadersInit;
482     status?: number;
483     statusText?: string;
484 }
485
486 interface RsaHashedImportParams extends Algorithm {
487     hash: HashAlgorithmIdentifier;
488 }
489
490 interface RsaHashedKeyGenParams extends RsaKeyGenParams {
491     hash: HashAlgorithmIdentifier;
492 }
493
494 interface RsaKeyGenParams extends Algorithm {
495     modulusLength: number;
496     publicExponent: BigInteger;
497 }
498
499 interface RsaOaepParams extends Algorithm {
500     label?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
501 }
502
503 interface RsaOtherPrimesInfo {
504     d?: string;
505     r?: string;
506     t?: string;
507 }
508
509 interface RsaPssParams extends Algorithm {
510     saltLength: number;
511 }
512
513 interface StorageEstimate {
514     quota?: number;
515     usage?: number;
516 }
517
518 interface SyncEventInit extends ExtendableEventInit {
519     lastChance?: boolean;
520     tag: string;
521 }
522
523 interface TextDecodeOptions {
524     stream?: boolean;
525 }
526
527 interface TextDecoderOptions {
528     fatal?: boolean;
529     ignoreBOM?: boolean;
530 }
531
532 interface TextEncoderEncodeIntoResult {
533     read?: number;
534     written?: number;
535 }
536
537 interface Transformer<I = any, O = any> {
538     flush?: TransformStreamDefaultControllerCallback<O>;
539     readableType?: undefined;
540     start?: TransformStreamDefaultControllerCallback<O>;
541     transform?: TransformStreamDefaultControllerTransformCallback<I, O>;
542     writableType?: undefined;
543 }
544
545 interface UnderlyingByteSource {
546     autoAllocateChunkSize?: number;
547     cancel?: ReadableStreamErrorCallback;
548     pull?: ReadableByteStreamControllerCallback;
549     start?: ReadableByteStreamControllerCallback;
550     type: "bytes";
551 }
552
553 interface UnderlyingSink<W = any> {
554     abort?: WritableStreamErrorCallback;
555     close?: WritableStreamDefaultControllerCloseCallback;
556     start?: WritableStreamDefaultControllerStartCallback;
557     type?: undefined;
558     write?: WritableStreamDefaultControllerWriteCallback<W>;
559 }
560
561 interface UnderlyingSource<R = any> {
562     cancel?: ReadableStreamErrorCallback;
563     pull?: ReadableStreamDefaultControllerCallback<R>;
564     start?: ReadableStreamDefaultControllerCallback<R>;
565     type?: undefined;
566 }
567
568 interface WebGLContextAttributes {
569     alpha?: boolean;
570     antialias?: boolean;
571     depth?: boolean;
572     desynchronized?: boolean;
573     failIfMajorPerformanceCaveat?: boolean;
574     powerPreference?: WebGLPowerPreference;
575     premultipliedAlpha?: boolean;
576     preserveDrawingBuffer?: boolean;
577     stencil?: boolean;
578 }
579
580 interface WebGLContextEventInit extends EventInit {
581     statusMessage?: string;
582 }
583
584 interface WorkerOptions {
585     credentials?: RequestCredentials;
586     name?: string;
587     type?: WorkerType;
588 }
589
590 interface EventListener {
591     (evt: Event): void;
592 }
593
594 /** The ANGLE_instanced_arrays extension is part of the WebGL API and allows to draw the same object, or groups of similar objects multiple times, if they share the same vertex data, primitive count and type. */
595 interface ANGLE_instanced_arrays {
596     drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei): void;
597     drawElementsInstancedANGLE(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, primcount: GLsizei): void;
598     vertexAttribDivisorANGLE(index: GLuint, divisor: GLuint): void;
599     readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: GLenum;
600 }
601
602 /** A controller object that allows you to abort one or more DOM requests as and when desired. */
603 interface AbortController {
604     /**
605      * Returns the AbortSignal object associated with this object.
606      */
607     readonly signal: AbortSignal;
608     /**
609      * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
610      */
611     abort(): void;
612 }
613
614 declare var AbortController: {
615     prototype: AbortController;
616     new(): AbortController;
617 };
618
619 interface AbortSignalEventMap {
620     "abort": Event;
621 }
622
623 /** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */
624 interface AbortSignal extends EventTarget {
625     /**
626      * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
627      */
628     readonly aborted: boolean;
629     onabort: ((this: AbortSignal, ev: Event) => any) | null;
630     addEventListener<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
631     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
632     removeEventListener<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
633     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
634 }
635
636 declare var AbortSignal: {
637     prototype: AbortSignal;
638     new(): AbortSignal;
639 };
640
641 interface AbstractWorkerEventMap {
642     "error": ErrorEvent;
643 }
644
645 interface AbstractWorker {
646     onerror: ((this: AbstractWorker, ev: ErrorEvent) => any) | null;
647     addEventListener<K extends keyof AbstractWorkerEventMap>(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
648     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
649     removeEventListener<K extends keyof AbstractWorkerEventMap>(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
650     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
651 }
652
653 interface AesCfbParams extends Algorithm {
654     iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
655 }
656
657 interface AesCmacParams extends Algorithm {
658     length: number;
659 }
660
661 interface AnimationFrameProvider {
662     cancelAnimationFrame(handle: number): void;
663     requestAnimationFrame(callback: FrameRequestCallback): number;
664 }
665
666 /** A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system. */
667 interface Blob {
668     readonly size: number;
669     readonly type: string;
670     arrayBuffer(): Promise<ArrayBuffer>;
671     slice(start?: number, end?: number, contentType?: string): Blob;
672     stream(): ReadableStream;
673     text(): Promise<string>;
674 }
675
676 declare var Blob: {
677     prototype: Blob;
678     new(blobParts?: BlobPart[], options?: BlobPropertyBag): Blob;
679 };
680
681 interface Body {
682     readonly body: ReadableStream<Uint8Array> | null;
683     readonly bodyUsed: boolean;
684     arrayBuffer(): Promise<ArrayBuffer>;
685     blob(): Promise<Blob>;
686     formData(): Promise<FormData>;
687     json(): Promise<any>;
688     text(): Promise<string>;
689 }
690
691 interface BroadcastChannelEventMap {
692     "message": MessageEvent;
693     "messageerror": MessageEvent;
694 }
695
696 interface BroadcastChannel extends EventTarget {
697     /**
698      * Returns the channel name (as passed to the constructor).
699      */
700     readonly name: string;
701     onmessage: ((this: BroadcastChannel, ev: MessageEvent) => any) | null;
702     onmessageerror: ((this: BroadcastChannel, ev: MessageEvent) => any) | null;
703     /**
704      * Closes the BroadcastChannel object, opening it up to garbage collection.
705      */
706     close(): void;
707     /**
708      * Sends the given message to other BroadcastChannel objects set up for this channel. Messages can be structured objects, e.g. nested objects and arrays.
709      */
710     postMessage(message: any): void;
711     addEventListener<K extends keyof BroadcastChannelEventMap>(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
712     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
713     removeEventListener<K extends keyof BroadcastChannelEventMap>(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
714     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
715 }
716
717 declare var BroadcastChannel: {
718     prototype: BroadcastChannel;
719     new(name: string): BroadcastChannel;
720 };
721
722 /** This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams. */
723 interface ByteLengthQueuingStrategy extends QueuingStrategy<ArrayBufferView> {
724     highWaterMark: number;
725     size(chunk: ArrayBufferView): number;
726 }
727
728 declare var ByteLengthQueuingStrategy: {
729     prototype: ByteLengthQueuingStrategy;
730     new(options: { highWaterMark: number }): ByteLengthQueuingStrategy;
731 };
732
733 /** Provides a storage mechanism for Request / Response object pairs that are cached, for example as part of the ServiceWorker life cycle. Note that the Cache interface is exposed to windowed scopes as well as workers. You don't have to use it in conjunction with service workers, even though it is defined in the service worker spec. */
734 interface Cache {
735     add(request: RequestInfo): Promise<void>;
736     addAll(requests: RequestInfo[]): Promise<void>;
737     delete(request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>;
738     keys(request?: RequestInfo, options?: CacheQueryOptions): Promise<ReadonlyArray<Request>>;
739     match(request: RequestInfo, options?: CacheQueryOptions): Promise<Response | undefined>;
740     matchAll(request?: RequestInfo, options?: CacheQueryOptions): Promise<ReadonlyArray<Response>>;
741     put(request: RequestInfo, response: Response): Promise<void>;
742 }
743
744 declare var Cache: {
745     prototype: Cache;
746     new(): Cache;
747 };
748
749 /** The storage for Cache objects. */
750 interface CacheStorage {
751     delete(cacheName: string): Promise<boolean>;
752     has(cacheName: string): Promise<boolean>;
753     keys(): Promise<string[]>;
754     match(request: RequestInfo, options?: MultiCacheQueryOptions): Promise<Response | undefined>;
755     open(cacheName: string): Promise<Cache>;
756 }
757
758 declare var CacheStorage: {
759     prototype: CacheStorage;
760     new(): CacheStorage;
761 };
762
763 interface CanvasCompositing {
764     globalAlpha: number;
765     globalCompositeOperation: string;
766 }
767
768 interface CanvasDrawImage {
769     drawImage(image: CanvasImageSource, dx: number, dy: number): void;
770     drawImage(image: CanvasImageSource, dx: number, dy: number, dw: number, dh: number): void;
771     drawImage(image: CanvasImageSource, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void;
772 }
773
774 interface CanvasDrawPath {
775     beginPath(): void;
776     clip(fillRule?: CanvasFillRule): void;
777     clip(path: Path2D, fillRule?: CanvasFillRule): void;
778     fill(fillRule?: CanvasFillRule): void;
779     fill(path: Path2D, fillRule?: CanvasFillRule): void;
780     isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean;
781     isPointInPath(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean;
782     isPointInStroke(x: number, y: number): boolean;
783     isPointInStroke(path: Path2D, x: number, y: number): boolean;
784     stroke(): void;
785     stroke(path: Path2D): void;
786 }
787
788 interface CanvasFillStrokeStyles {
789     fillStyle: string | CanvasGradient | CanvasPattern;
790     strokeStyle: string | CanvasGradient | CanvasPattern;
791     createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient;
792     createPattern(image: CanvasImageSource, repetition: string | null): CanvasPattern | null;
793     createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient;
794 }
795
796 interface CanvasFilters {
797     filter: string;
798 }
799
800 /** An opaque object describing a gradient. It is returned by the methods CanvasRenderingContext2D.createLinearGradient() or CanvasRenderingContext2D.createRadialGradient(). */
801 interface CanvasGradient {
802     /**
803      * Adds a color stop with the given color to the gradient at the given offset. 0.0 is the offset at one end of the gradient, 1.0 is the offset at the other end.
804      * 
805      * Throws an "IndexSizeError" DOMException if the offset is out of range. Throws a "SyntaxError" DOMException if the color cannot be parsed.
806      */
807     addColorStop(offset: number, color: string): void;
808 }
809
810 declare var CanvasGradient: {
811     prototype: CanvasGradient;
812     new(): CanvasGradient;
813 };
814
815 interface CanvasImageData {
816     createImageData(sw: number, sh: number): ImageData;
817     createImageData(imagedata: ImageData): ImageData;
818     getImageData(sx: number, sy: number, sw: number, sh: number): ImageData;
819     putImageData(imagedata: ImageData, dx: number, dy: number): void;
820     putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX: number, dirtyY: number, dirtyWidth: number, dirtyHeight: number): void;
821 }
822
823 interface CanvasImageSmoothing {
824     imageSmoothingEnabled: boolean;
825     imageSmoothingQuality: ImageSmoothingQuality;
826 }
827
828 interface CanvasPath {
829     arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;
830     arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;
831     bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void;
832     closePath(): void;
833     ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;
834     lineTo(x: number, y: number): void;
835     moveTo(x: number, y: number): void;
836     quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;
837     rect(x: number, y: number, w: number, h: number): void;
838 }
839
840 interface CanvasPathDrawingStyles {
841     lineCap: CanvasLineCap;
842     lineDashOffset: number;
843     lineJoin: CanvasLineJoin;
844     lineWidth: number;
845     miterLimit: number;
846     getLineDash(): number[];
847     setLineDash(segments: number[]): void;
848 }
849
850 /** An opaque object describing a pattern, based on an image, a canvas, or a video, created by the CanvasRenderingContext2D.createPattern() method. */
851 interface CanvasPattern {
852     /**
853      * Sets the transformation matrix that will be used when rendering the pattern during a fill or stroke painting operation.
854      */
855     setTransform(transform?: DOMMatrix2DInit): void;
856 }
857
858 declare var CanvasPattern: {
859     prototype: CanvasPattern;
860     new(): CanvasPattern;
861 };
862
863 interface CanvasRect {
864     clearRect(x: number, y: number, w: number, h: number): void;
865     fillRect(x: number, y: number, w: number, h: number): void;
866     strokeRect(x: number, y: number, w: number, h: number): void;
867 }
868
869 interface CanvasShadowStyles {
870     shadowBlur: number;
871     shadowColor: string;
872     shadowOffsetX: number;
873     shadowOffsetY: number;
874 }
875
876 interface CanvasState {
877     restore(): void;
878     save(): void;
879 }
880
881 interface CanvasText {
882     fillText(text: string, x: number, y: number, maxWidth?: number): void;
883     measureText(text: string): TextMetrics;
884     strokeText(text: string, x: number, y: number, maxWidth?: number): void;
885 }
886
887 interface CanvasTextDrawingStyles {
888     direction: CanvasDirection;
889     font: string;
890     textAlign: CanvasTextAlign;
891     textBaseline: CanvasTextBaseline;
892 }
893
894 interface CanvasTransform {
895     getTransform(): DOMMatrix;
896     resetTransform(): void;
897     rotate(angle: number): void;
898     scale(x: number, y: number): void;
899     setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void;
900     setTransform(transform?: DOMMatrix2DInit): void;
901     transform(a: number, b: number, c: number, d: number, e: number, f: number): void;
902     translate(x: number, y: number): void;
903 }
904
905 /** The Client interface represents an executable context such as a Worker, or a SharedWorker. Window clients are represented by the more-specific WindowClient. You can get Client/WindowClient objects from methods such as Clients.matchAll() and Clients.get(). */
906 interface Client {
907     readonly frameType: FrameType;
908     readonly id: string;
909     readonly type: ClientTypes;
910     readonly url: string;
911     postMessage(message: any, transfer?: Transferable[]): void;
912 }
913
914 declare var Client: {
915     prototype: Client;
916     new(): Client;
917 };
918
919 /** Provides access to Client objects. Access it via self.clients within a service worker. */
920 interface Clients {
921     claim(): Promise<void>;
922     get(id: string): Promise<Client | undefined>;
923     matchAll(options?: ClientQueryOptions): Promise<ReadonlyArray<Client>>;
924     openWindow(url: string): Promise<WindowClient | null>;
925 }
926
927 declare var Clients: {
928     prototype: Clients;
929     new(): Clients;
930 };
931
932 /** A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute. */
933 interface CloseEvent extends Event {
934     /**
935      * Returns the WebSocket connection close code provided by the server.
936      */
937     readonly code: number;
938     /**
939      * Returns the WebSocket connection close reason provided by the server.
940      */
941     readonly reason: string;
942     /**
943      * Returns true if the connection closed cleanly; false otherwise.
944      */
945     readonly wasClean: boolean;
946 }
947
948 declare var CloseEvent: {
949     prototype: CloseEvent;
950     new(type: string, eventInitDict?: CloseEventInit): CloseEvent;
951 };
952
953 interface ConcatParams extends Algorithm {
954     algorithmId: Uint8Array;
955     hash?: string | Algorithm;
956     partyUInfo: Uint8Array;
957     partyVInfo: Uint8Array;
958     privateInfo?: Uint8Array;
959     publicInfo?: Uint8Array;
960 }
961
962 /** This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams. */
963 interface CountQueuingStrategy extends QueuingStrategy {
964     highWaterMark: number;
965     size(chunk: any): 1;
966 }
967
968 declare var CountQueuingStrategy: {
969     prototype: CountQueuingStrategy;
970     new(options: { highWaterMark: number }): CountQueuingStrategy;
971 };
972
973 /** Basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives. */
974 interface Crypto {
975     readonly subtle: SubtleCrypto;
976     getRandomValues<T extends Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null>(array: T): T;
977 }
978
979 declare var Crypto: {
980     prototype: Crypto;
981     new(): Crypto;
982 };
983
984 /** The CryptoKey dictionary of the Web Crypto API represents a cryptographic key. */
985 interface CryptoKey {
986     readonly algorithm: KeyAlgorithm;
987     readonly extractable: boolean;
988     readonly type: KeyType;
989     readonly usages: KeyUsage[];
990 }
991
992 declare var CryptoKey: {
993     prototype: CryptoKey;
994     new(): CryptoKey;
995 };
996
997 interface CustomEvent<T = any> extends Event {
998     /**
999      * Returns any custom data event was created with. Typically used for synthetic events.
1000      */
1001     readonly detail: T;
1002     initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: T): void;
1003 }
1004
1005 declare var CustomEvent: {
1006     prototype: CustomEvent;
1007     new<T>(typeArg: string, eventInitDict?: CustomEventInit<T>): CustomEvent<T>;
1008 };
1009
1010 /** An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API. */
1011 interface DOMException {
1012     readonly code: number;
1013     readonly message: string;
1014     readonly name: string;
1015     readonly ABORT_ERR: number;
1016     readonly DATA_CLONE_ERR: number;
1017     readonly DOMSTRING_SIZE_ERR: number;
1018     readonly HIERARCHY_REQUEST_ERR: number;
1019     readonly INDEX_SIZE_ERR: number;
1020     readonly INUSE_ATTRIBUTE_ERR: number;
1021     readonly INVALID_ACCESS_ERR: number;
1022     readonly INVALID_CHARACTER_ERR: number;
1023     readonly INVALID_MODIFICATION_ERR: number;
1024     readonly INVALID_NODE_TYPE_ERR: number;
1025     readonly INVALID_STATE_ERR: number;
1026     readonly NAMESPACE_ERR: number;
1027     readonly NETWORK_ERR: number;
1028     readonly NOT_FOUND_ERR: number;
1029     readonly NOT_SUPPORTED_ERR: number;
1030     readonly NO_DATA_ALLOWED_ERR: number;
1031     readonly NO_MODIFICATION_ALLOWED_ERR: number;
1032     readonly QUOTA_EXCEEDED_ERR: number;
1033     readonly SECURITY_ERR: number;
1034     readonly SYNTAX_ERR: number;
1035     readonly TIMEOUT_ERR: number;
1036     readonly TYPE_MISMATCH_ERR: number;
1037     readonly URL_MISMATCH_ERR: number;
1038     readonly VALIDATION_ERR: number;
1039     readonly WRONG_DOCUMENT_ERR: number;
1040 }
1041
1042 declare var DOMException: {
1043     prototype: DOMException;
1044     new(message?: string, name?: string): DOMException;
1045     readonly ABORT_ERR: number;
1046     readonly DATA_CLONE_ERR: number;
1047     readonly DOMSTRING_SIZE_ERR: number;
1048     readonly HIERARCHY_REQUEST_ERR: number;
1049     readonly INDEX_SIZE_ERR: number;
1050     readonly INUSE_ATTRIBUTE_ERR: number;
1051     readonly INVALID_ACCESS_ERR: number;
1052     readonly INVALID_CHARACTER_ERR: number;
1053     readonly INVALID_MODIFICATION_ERR: number;
1054     readonly INVALID_NODE_TYPE_ERR: number;
1055     readonly INVALID_STATE_ERR: number;
1056     readonly NAMESPACE_ERR: number;
1057     readonly NETWORK_ERR: number;
1058     readonly NOT_FOUND_ERR: number;
1059     readonly NOT_SUPPORTED_ERR: number;
1060     readonly NO_DATA_ALLOWED_ERR: number;
1061     readonly NO_MODIFICATION_ALLOWED_ERR: number;
1062     readonly QUOTA_EXCEEDED_ERR: number;
1063     readonly SECURITY_ERR: number;
1064     readonly SYNTAX_ERR: number;
1065     readonly TIMEOUT_ERR: number;
1066     readonly TYPE_MISMATCH_ERR: number;
1067     readonly URL_MISMATCH_ERR: number;
1068     readonly VALIDATION_ERR: number;
1069     readonly WRONG_DOCUMENT_ERR: number;
1070 };
1071
1072 interface DOMMatrix extends DOMMatrixReadOnly {
1073     a: number;
1074     b: number;
1075     c: number;
1076     d: number;
1077     e: number;
1078     f: number;
1079     m11: number;
1080     m12: number;
1081     m13: number;
1082     m14: number;
1083     m21: number;
1084     m22: number;
1085     m23: number;
1086     m24: number;
1087     m31: number;
1088     m32: number;
1089     m33: number;
1090     m34: number;
1091     m41: number;
1092     m42: number;
1093     m43: number;
1094     m44: number;
1095     invertSelf(): DOMMatrix;
1096     multiplySelf(other?: DOMMatrixInit): DOMMatrix;
1097     preMultiplySelf(other?: DOMMatrixInit): DOMMatrix;
1098     rotateAxisAngleSelf(x?: number, y?: number, z?: number, angle?: number): DOMMatrix;
1099     rotateFromVectorSelf(x?: number, y?: number): DOMMatrix;
1100     rotateSelf(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix;
1101     scale3dSelf(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;
1102     scaleSelf(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;
1103     skewXSelf(sx?: number): DOMMatrix;
1104     skewYSelf(sy?: number): DOMMatrix;
1105     translateSelf(tx?: number, ty?: number, tz?: number): DOMMatrix;
1106 }
1107
1108 declare var DOMMatrix: {
1109     prototype: DOMMatrix;
1110     new(init?: string | number[]): DOMMatrix;
1111     fromFloat32Array(array32: Float32Array): DOMMatrix;
1112     fromFloat64Array(array64: Float64Array): DOMMatrix;
1113     fromMatrix(other?: DOMMatrixInit): DOMMatrix;
1114 };
1115
1116 interface DOMMatrixReadOnly {
1117     readonly a: number;
1118     readonly b: number;
1119     readonly c: number;
1120     readonly d: number;
1121     readonly e: number;
1122     readonly f: number;
1123     readonly is2D: boolean;
1124     readonly isIdentity: boolean;
1125     readonly m11: number;
1126     readonly m12: number;
1127     readonly m13: number;
1128     readonly m14: number;
1129     readonly m21: number;
1130     readonly m22: number;
1131     readonly m23: number;
1132     readonly m24: number;
1133     readonly m31: number;
1134     readonly m32: number;
1135     readonly m33: number;
1136     readonly m34: number;
1137     readonly m41: number;
1138     readonly m42: number;
1139     readonly m43: number;
1140     readonly m44: number;
1141     flipX(): DOMMatrix;
1142     flipY(): DOMMatrix;
1143     inverse(): DOMMatrix;
1144     multiply(other?: DOMMatrixInit): DOMMatrix;
1145     rotate(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix;
1146     rotateAxisAngle(x?: number, y?: number, z?: number, angle?: number): DOMMatrix;
1147     rotateFromVector(x?: number, y?: number): DOMMatrix;
1148     scale(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;
1149     scale3d(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;
1150     /** @deprecated */
1151     scaleNonUniform(scaleX?: number, scaleY?: number): DOMMatrix;
1152     skewX(sx?: number): DOMMatrix;
1153     skewY(sy?: number): DOMMatrix;
1154     toFloat32Array(): Float32Array;
1155     toFloat64Array(): Float64Array;
1156     toJSON(): any;
1157     transformPoint(point?: DOMPointInit): DOMPoint;
1158     translate(tx?: number, ty?: number, tz?: number): DOMMatrix;
1159 }
1160
1161 declare var DOMMatrixReadOnly: {
1162     prototype: DOMMatrixReadOnly;
1163     new(init?: string | number[]): DOMMatrixReadOnly;
1164     fromFloat32Array(array32: Float32Array): DOMMatrixReadOnly;
1165     fromFloat64Array(array64: Float64Array): DOMMatrixReadOnly;
1166     fromMatrix(other?: DOMMatrixInit): DOMMatrixReadOnly;
1167 };
1168
1169 interface DOMPoint extends DOMPointReadOnly {
1170     w: number;
1171     x: number;
1172     y: number;
1173     z: number;
1174 }
1175
1176 declare var DOMPoint: {
1177     prototype: DOMPoint;
1178     new(x?: number, y?: number, z?: number, w?: number): DOMPoint;
1179     fromPoint(other?: DOMPointInit): DOMPoint;
1180 };
1181
1182 interface DOMPointReadOnly {
1183     readonly w: number;
1184     readonly x: number;
1185     readonly y: number;
1186     readonly z: number;
1187     matrixTransform(matrix?: DOMMatrixInit): DOMPoint;
1188     toJSON(): any;
1189 }
1190
1191 declare var DOMPointReadOnly: {
1192     prototype: DOMPointReadOnly;
1193     new(x?: number, y?: number, z?: number, w?: number): DOMPointReadOnly;
1194     fromPoint(other?: DOMPointInit): DOMPointReadOnly;
1195 };
1196
1197 interface DOMQuad {
1198     readonly p1: DOMPoint;
1199     readonly p2: DOMPoint;
1200     readonly p3: DOMPoint;
1201     readonly p4: DOMPoint;
1202     getBounds(): DOMRect;
1203     toJSON(): any;
1204 }
1205
1206 declare var DOMQuad: {
1207     prototype: DOMQuad;
1208     new(p1?: DOMPointInit, p2?: DOMPointInit, p3?: DOMPointInit, p4?: DOMPointInit): DOMQuad;
1209     fromQuad(other?: DOMQuadInit): DOMQuad;
1210     fromRect(other?: DOMRectInit): DOMQuad;
1211 };
1212
1213 interface DOMRect extends DOMRectReadOnly {
1214     height: number;
1215     width: number;
1216     x: number;
1217     y: number;
1218 }
1219
1220 declare var DOMRect: {
1221     prototype: DOMRect;
1222     new(x?: number, y?: number, width?: number, height?: number): DOMRect;
1223     fromRect(other?: DOMRectInit): DOMRect;
1224 };
1225
1226 interface DOMRectReadOnly {
1227     readonly bottom: number;
1228     readonly height: number;
1229     readonly left: number;
1230     readonly right: number;
1231     readonly top: number;
1232     readonly width: number;
1233     readonly x: number;
1234     readonly y: number;
1235     toJSON(): any;
1236 }
1237
1238 declare var DOMRectReadOnly: {
1239     prototype: DOMRectReadOnly;
1240     new(x?: number, y?: number, width?: number, height?: number): DOMRectReadOnly;
1241     fromRect(other?: DOMRectInit): DOMRectReadOnly;
1242 };
1243
1244 /** A type returned by some APIs which contains a list of DOMString (strings). */
1245 interface DOMStringList {
1246     /**
1247      * Returns the number of strings in strings.
1248      */
1249     readonly length: number;
1250     /**
1251      * Returns true if strings contains string, and false otherwise.
1252      */
1253     contains(string: string): boolean;
1254     /**
1255      * Returns the string with index index from strings.
1256      */
1257     item(index: number): string | null;
1258     [index: number]: string;
1259 }
1260
1261 declare var DOMStringList: {
1262     prototype: DOMStringList;
1263     new(): DOMStringList;
1264 };
1265
1266 interface DedicatedWorkerGlobalScopeEventMap extends WorkerGlobalScopeEventMap {
1267     "message": MessageEvent;
1268     "messageerror": MessageEvent;
1269 }
1270
1271 /** (the Worker global scope) is accessible through the self keyword. Some additional global functions, namespaces objects, and constructors, not typically associated with the worker global scope, but available on it, are listed in the JavaScript Reference. See also: Functions available to workers. */
1272 interface DedicatedWorkerGlobalScope extends WorkerGlobalScope, AnimationFrameProvider {
1273     /**
1274      * Returns dedicatedWorkerGlobal's name, i.e. the value given to the Worker constructor. Primarily useful for debugging.
1275      */
1276     readonly name: string;
1277     onmessage: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null;
1278     onmessageerror: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null;
1279     /**
1280      * Aborts dedicatedWorkerGlobal.
1281      */
1282     close(): void;
1283     /**
1284      * Clones message and transmits it to the Worker object associated with dedicatedWorkerGlobal. transfer can be passed as a list of objects that are to be transferred rather than cloned.
1285      */
1286     postMessage(message: any, transfer: Transferable[]): void;
1287     postMessage(message: any, options?: PostMessageOptions): void;
1288     addEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1289     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
1290     removeEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
1291     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
1292 }
1293
1294 declare var DedicatedWorkerGlobalScope: {
1295     prototype: DedicatedWorkerGlobalScope;
1296     new(): DedicatedWorkerGlobalScope;
1297 };
1298
1299 interface DhImportKeyParams extends Algorithm {
1300     generator: Uint8Array;
1301     prime: Uint8Array;
1302 }
1303
1304 interface DhKeyAlgorithm extends KeyAlgorithm {
1305     generator: Uint8Array;
1306     prime: Uint8Array;
1307 }
1308
1309 interface DhKeyDeriveParams extends Algorithm {
1310     public: CryptoKey;
1311 }
1312
1313 interface DhKeyGenParams extends Algorithm {
1314     generator: Uint8Array;
1315     prime: Uint8Array;
1316 }
1317
1318 interface EXT_blend_minmax {
1319     readonly MAX_EXT: GLenum;
1320     readonly MIN_EXT: GLenum;
1321 }
1322
1323 /** The EXT_frag_depth extension is part of the WebGL API and enables to set a depth value of a fragment from within the fragment shader. */
1324 interface EXT_frag_depth {
1325 }
1326
1327 interface EXT_sRGB {
1328     readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: GLenum;
1329     readonly SRGB8_ALPHA8_EXT: GLenum;
1330     readonly SRGB_ALPHA_EXT: GLenum;
1331     readonly SRGB_EXT: GLenum;
1332 }
1333
1334 interface EXT_shader_texture_lod {
1335 }
1336
1337 /** The EXT_texture_filter_anisotropic extension is part of the WebGL API and exposes two constants for anisotropic filtering (AF). */
1338 interface EXT_texture_filter_anisotropic {
1339     readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: GLenum;
1340     readonly TEXTURE_MAX_ANISOTROPY_EXT: GLenum;
1341 }
1342
1343 /** Events providing information related to errors in scripts or in files. */
1344 interface ErrorEvent extends Event {
1345     readonly colno: number;
1346     readonly error: any;
1347     readonly filename: string;
1348     readonly lineno: number;
1349     readonly message: string;
1350 }
1351
1352 declare var ErrorEvent: {
1353     prototype: ErrorEvent;
1354     new(type: string, eventInitDict?: ErrorEventInit): ErrorEvent;
1355 };
1356
1357 /** An event which takes place in the DOM. */
1358 interface Event {
1359     /**
1360      * Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise.
1361      */
1362     readonly bubbles: boolean;
1363     cancelBubble: boolean;
1364     /**
1365      * Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method.
1366      */
1367     readonly cancelable: boolean;
1368     /**
1369      * Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise.
1370      */
1371     readonly composed: boolean;
1372     /**
1373      * Returns the object whose event listener's callback is currently being invoked.
1374      */
1375     readonly currentTarget: EventTarget | null;
1376     /**
1377      * Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise.
1378      */
1379     readonly defaultPrevented: boolean;
1380     /**
1381      * Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE.
1382      */
1383     readonly eventPhase: number;
1384     /**
1385      * Returns true if event was dispatched by the user agent, and false otherwise.
1386      */
1387     readonly isTrusted: boolean;
1388     returnValue: boolean;
1389     /** @deprecated */
1390     readonly srcElement: EventTarget | null;
1391     /**
1392      * Returns the object to which event is dispatched (its target).
1393      */
1394     readonly target: EventTarget | null;
1395     /**
1396      * Returns the event's timestamp as the number of milliseconds measured relative to the time origin.
1397      */
1398     readonly timeStamp: number;
1399     /**
1400      * Returns the type of event, e.g. "click", "hashchange", or "submit".
1401      */
1402     readonly type: string;
1403     /**
1404      * 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.
1405      */
1406     composedPath(): EventTarget[];
1407     initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;
1408     /**
1409      * If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.
1410      */
1411     preventDefault(): void;
1412     /**
1413      * 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.
1414      */
1415     stopImmediatePropagation(): void;
1416     /**
1417      * When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.
1418      */
1419     stopPropagation(): void;
1420     readonly AT_TARGET: number;
1421     readonly BUBBLING_PHASE: number;
1422     readonly CAPTURING_PHASE: number;
1423     readonly NONE: number;
1424 }
1425
1426 declare var Event: {
1427     prototype: Event;
1428     new(type: string, eventInitDict?: EventInit): Event;
1429     readonly AT_TARGET: number;
1430     readonly BUBBLING_PHASE: number;
1431     readonly CAPTURING_PHASE: number;
1432     readonly NONE: number;
1433 };
1434
1435 interface EventListenerObject {
1436     handleEvent(evt: Event): void;
1437 }
1438
1439 interface EventSourceEventMap {
1440     "error": Event;
1441     "message": MessageEvent;
1442     "open": Event;
1443 }
1444
1445 interface EventSource extends EventTarget {
1446     onerror: ((this: EventSource, ev: Event) => any) | null;
1447     onmessage: ((this: EventSource, ev: MessageEvent) => any) | null;
1448     onopen: ((this: EventSource, ev: Event) => any) | null;
1449     /**
1450      * Returns the state of this EventSource object's connection. It can have the values described below.
1451      */
1452     readonly readyState: number;
1453     /**
1454      * Returns the URL providing the event stream.
1455      */
1456     readonly url: string;
1457     /**
1458      * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
1459      */
1460     readonly withCredentials: boolean;
1461     /**
1462      * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
1463      */
1464     close(): void;
1465     readonly CLOSED: number;
1466     readonly CONNECTING: number;
1467     readonly OPEN: number;
1468     addEventListener<K extends keyof EventSourceEventMap>(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1469     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
1470     removeEventListener<K extends keyof EventSourceEventMap>(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
1471     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
1472 }
1473
1474 declare var EventSource: {
1475     prototype: EventSource;
1476     new(url: string, eventSourceInitDict?: EventSourceInit): EventSource;
1477     readonly CLOSED: number;
1478     readonly CONNECTING: number;
1479     readonly OPEN: number;
1480 };
1481
1482 /** EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them. */
1483 interface EventTarget {
1484     /**
1485      * Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
1486      * 
1487      * The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
1488      * 
1489      * When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
1490      * 
1491      * When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in Â§ 2.8 Observing event listeners.
1492      * 
1493      * When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
1494      * 
1495      * The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
1496      */
1497     addEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;
1498     /**
1499      * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
1500      */
1501     dispatchEvent(event: Event): boolean;
1502     /**
1503      * Removes the event listener in target's event listener list with the same type, callback, and options.
1504      */
1505     removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void;
1506 }
1507
1508 declare var EventTarget: {
1509     prototype: EventTarget;
1510     new(): EventTarget;
1511 };
1512
1513 /** Extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries. */
1514 interface ExtendableEvent extends Event {
1515     waitUntil(f: any): void;
1516 }
1517
1518 declare var ExtendableEvent: {
1519     prototype: ExtendableEvent;
1520     new(type: string, eventInitDict?: ExtendableEventInit): ExtendableEvent;
1521 };
1522
1523 /** This ServiceWorker API interface represents the event object of a message event fired on a service worker (when a channel message is received on the ServiceWorkerGlobalScope from another context) â€” extends the lifetime of such events. */
1524 interface ExtendableMessageEvent extends ExtendableEvent {
1525     readonly data: any;
1526     readonly lastEventId: string;
1527     readonly origin: string;
1528     readonly ports: ReadonlyArray<MessagePort>;
1529     readonly source: Client | ServiceWorker | MessagePort | null;
1530 }
1531
1532 declare var ExtendableMessageEvent: {
1533     prototype: ExtendableMessageEvent;
1534     new(type: string, eventInitDict?: ExtendableMessageEventInit): ExtendableMessageEvent;
1535 };
1536
1537 /** This is the event type for fetch events dispatched on the service worker global scope. It contains information about the fetch, including the request and how the receiver will treat the response. It provides the event.respondWith() method, which allows us to provide a response to this fetch. */
1538 interface FetchEvent extends ExtendableEvent {
1539     readonly clientId: string;
1540     readonly preloadResponse: Promise<any>;
1541     readonly replacesClientId: string;
1542     readonly request: Request;
1543     readonly resultingClientId: string;
1544     respondWith(r: Response | Promise<Response>): void;
1545 }
1546
1547 declare var FetchEvent: {
1548     prototype: FetchEvent;
1549     new(type: string, eventInitDict: FetchEventInit): FetchEvent;
1550 };
1551
1552 /** Provides information about files and allows JavaScript in a web page to access their content. */
1553 interface File extends Blob {
1554     readonly lastModified: number;
1555     readonly name: string;
1556 }
1557
1558 declare var File: {
1559     prototype: File;
1560     new(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File;
1561 };
1562
1563 /** An object of this type is returned by the files property of the HTML <input> element; this lets you access the list of files selected with the <input type="file"> element. It's also used for a list of files dropped into web content when using the drag and drop API; see the DataTransfer object for details on this usage. */
1564 interface FileList {
1565     readonly length: number;
1566     item(index: number): File | null;
1567     [index: number]: File;
1568 }
1569
1570 declare var FileList: {
1571     prototype: FileList;
1572     new(): FileList;
1573 };
1574
1575 interface FileReaderEventMap {
1576     "abort": ProgressEvent<FileReader>;
1577     "error": ProgressEvent<FileReader>;
1578     "load": ProgressEvent<FileReader>;
1579     "loadend": ProgressEvent<FileReader>;
1580     "loadstart": ProgressEvent<FileReader>;
1581     "progress": ProgressEvent<FileReader>;
1582 }
1583
1584 /** Lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using File or Blob objects to specify the file or data to read. */
1585 interface FileReader extends EventTarget {
1586     readonly error: DOMException | null;
1587     onabort: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;
1588     onerror: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;
1589     onload: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;
1590     onloadend: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;
1591     onloadstart: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;
1592     onprogress: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;
1593     readonly readyState: number;
1594     readonly result: string | ArrayBuffer | null;
1595     abort(): void;
1596     readAsArrayBuffer(blob: Blob): void;
1597     readAsBinaryString(blob: Blob): void;
1598     readAsDataURL(blob: Blob): void;
1599     readAsText(blob: Blob, encoding?: string): void;
1600     readonly DONE: number;
1601     readonly EMPTY: number;
1602     readonly LOADING: number;
1603     addEventListener<K extends keyof FileReaderEventMap>(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1604     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
1605     removeEventListener<K extends keyof FileReaderEventMap>(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
1606     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
1607 }
1608
1609 declare var FileReader: {
1610     prototype: FileReader;
1611     new(): FileReader;
1612     readonly DONE: number;
1613     readonly EMPTY: number;
1614     readonly LOADING: number;
1615 };
1616
1617 /** Allows to read File or Blob objects in a synchronous way. */
1618 interface FileReaderSync {
1619     readAsArrayBuffer(blob: Blob): ArrayBuffer;
1620     readAsBinaryString(blob: Blob): string;
1621     readAsDataURL(blob: Blob): string;
1622     readAsText(blob: Blob, encoding?: string): string;
1623 }
1624
1625 declare var FileReaderSync: {
1626     prototype: FileReaderSync;
1627     new(): FileReaderSync;
1628 };
1629
1630 /** Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data". */
1631 interface FormData {
1632     append(name: string, value: string | Blob, fileName?: string): void;
1633     delete(name: string): void;
1634     get(name: string): FormDataEntryValue | null;
1635     getAll(name: string): FormDataEntryValue[];
1636     has(name: string): boolean;
1637     set(name: string, value: string | Blob, fileName?: string): void;
1638     forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;
1639 }
1640
1641 declare var FormData: {
1642     prototype: FormData;
1643     new(): FormData;
1644 };
1645
1646 interface GenericTransformStream {
1647     /**
1648      * Returns a readable stream whose chunks are strings resulting from running encoding's decoder on the chunks written to writable.
1649      */
1650     readonly readable: ReadableStream;
1651     /**
1652      * Returns a writable stream which accepts [AllowShared] BufferSource chunks and runs them through encoding's decoder before making them available to readable.
1653      * 
1654      * Typically this will be used via the pipeThrough() method on a ReadableStream source.
1655      * 
1656      * ```
1657      * var decoder = new TextDecoderStream(encoding);
1658      * byteReadable
1659      *   .pipeThrough(decoder)
1660      *   .pipeTo(textWritable);
1661      * ```
1662      * 
1663      * If the error mode is "fatal" and encoding's decoder returns error, both readable and writable will be errored with a TypeError.
1664      */
1665     readonly writable: WritableStream;
1666 }
1667
1668 /** This Fetch API interface allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs. Â You can add to this using methods like append() (see Examples.) In all methods of this interface, header names are matched by case-insensitive byte sequence. */
1669 interface Headers {
1670     append(name: string, value: string): void;
1671     delete(name: string): void;
1672     get(name: string): string | null;
1673     has(name: string): boolean;
1674     set(name: string, value: string): void;
1675     forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
1676 }
1677
1678 declare var Headers: {
1679     prototype: Headers;
1680     new(init?: HeadersInit): Headers;
1681 };
1682
1683 interface IDBArrayKey extends Array<IDBValidKey> {
1684 }
1685
1686 /** This IndexedDB API interface represents a cursor for traversing or iterating over multiple records in a database. */
1687 interface IDBCursor {
1688     /**
1689      * Returns the direction ("next", "nextunique", "prev" or "prevunique") of the cursor.
1690      */
1691     readonly direction: IDBCursorDirection;
1692     /**
1693      * Returns the key of the cursor. Throws a "InvalidStateError" DOMException if the cursor is advancing or is finished.
1694      */
1695     readonly key: IDBValidKey;
1696     /**
1697      * Returns the effective key of the cursor. Throws a "InvalidStateError" DOMException if the cursor is advancing or is finished.
1698      */
1699     readonly primaryKey: IDBValidKey;
1700     /**
1701      * Returns the IDBObjectStore or IDBIndex the cursor was opened from.
1702      */
1703     readonly source: IDBObjectStore | IDBIndex;
1704     /**
1705      * Advances the cursor through the next count records in range.
1706      */
1707     advance(count: number): void;
1708     /**
1709      * Advances the cursor to the next record in range.
1710      */
1711     continue(key?: IDBValidKey): void;
1712     /**
1713      * Advances the cursor to the next record in range matching or after key and primaryKey. Throws an "InvalidAccessError" DOMException if the source is not an index.
1714      */
1715     continuePrimaryKey(key: IDBValidKey, primaryKey: IDBValidKey): void;
1716     /**
1717      * Delete the record pointed at by the cursor with a new value.
1718      * 
1719      * If successful, request's result will be undefined.
1720      */
1721     delete(): IDBRequest<undefined>;
1722     /**
1723      * Updated the record pointed at by the cursor with a new value.
1724      * 
1725      * Throws a "DataError" DOMException if the effective object store uses in-line keys and the key would have changed.
1726      * 
1727      * If successful, request's result will be the record's key.
1728      */
1729     update(value: any): IDBRequest<IDBValidKey>;
1730 }
1731
1732 declare var IDBCursor: {
1733     prototype: IDBCursor;
1734     new(): IDBCursor;
1735 };
1736
1737 /** This IndexedDB API interface represents a cursor for traversing or iterating over multiple records in a database. It is the same as the IDBCursor, except that it includes the value property. */
1738 interface IDBCursorWithValue extends IDBCursor {
1739     /**
1740      * Returns the cursor's current value.
1741      */
1742     readonly value: any;
1743 }
1744
1745 declare var IDBCursorWithValue: {
1746     prototype: IDBCursorWithValue;
1747     new(): IDBCursorWithValue;
1748 };
1749
1750 interface IDBDatabaseEventMap {
1751     "abort": Event;
1752     "close": Event;
1753     "error": Event;
1754     "versionchange": IDBVersionChangeEvent;
1755 }
1756
1757 /** This IndexedDB API interface provides a connection to a database; you can use an IDBDatabase object to open a transaction on your database then create, manipulate, and delete objects (data) in that database. The interface provides the only way to get and manage versions of the database. */
1758 interface IDBDatabase extends EventTarget {
1759     /**
1760      * Returns the name of the database.
1761      */
1762     readonly name: string;
1763     /**
1764      * Returns a list of the names of object stores in the database.
1765      */
1766     readonly objectStoreNames: DOMStringList;
1767     onabort: ((this: IDBDatabase, ev: Event) => any) | null;
1768     onclose: ((this: IDBDatabase, ev: Event) => any) | null;
1769     onerror: ((this: IDBDatabase, ev: Event) => any) | null;
1770     onversionchange: ((this: IDBDatabase, ev: IDBVersionChangeEvent) => any) | null;
1771     /**
1772      * Returns the version of the database.
1773      */
1774     readonly version: number;
1775     /**
1776      * Closes the connection once all running transactions have finished.
1777      */
1778     close(): void;
1779     /**
1780      * Creates a new object store with the given name and options and returns a new IDBObjectStore.
1781      * 
1782      * Throws a "InvalidStateError" DOMException if not called within an upgrade transaction.
1783      */
1784     createObjectStore(name: string, options?: IDBObjectStoreParameters): IDBObjectStore;
1785     /**
1786      * Deletes the object store with the given name.
1787      * 
1788      * Throws a "InvalidStateError" DOMException if not called within an upgrade transaction.
1789      */
1790     deleteObjectStore(name: string): void;
1791     /**
1792      * Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names.
1793      */
1794     transaction(storeNames: string | string[], mode?: IDBTransactionMode): IDBTransaction;
1795     addEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1796     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
1797     removeEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
1798     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
1799 }
1800
1801 declare var IDBDatabase: {
1802     prototype: IDBDatabase;
1803     new(): IDBDatabase;
1804 };
1805
1806 /** In the following code snippet, we make a request to open a database, and include handlers for the success and error cases. For a full working example, see our To-do Notifications app (view example live.) */
1807 interface IDBFactory {
1808     /**
1809      * Compares two values as keys. Returns -1 if key1 precedes key2, 1 if key2 precedes key1, and 0 if the keys are equal.
1810      * 
1811      * Throws a "DataError" DOMException if either input is not a valid key.
1812      */
1813     cmp(first: any, second: any): number;
1814     /**
1815      * Attempts to delete the named database. If the database already exists and there are open connections that don't close in response to a versionchange event, the request will be blocked until all they close. If the request is successful request's result will be null.
1816      */
1817     deleteDatabase(name: string): IDBOpenDBRequest;
1818     /**
1819      * Attempts to open a connection to the named database with the current version, or 1 if it does not already exist. If the request is successful request's result will be the connection.
1820      */
1821     open(name: string, version?: number): IDBOpenDBRequest;
1822 }
1823
1824 declare var IDBFactory: {
1825     prototype: IDBFactory;
1826     new(): IDBFactory;
1827 };
1828
1829 /** IDBIndex interface of the IndexedDB API provides asynchronous access to an index in a database. An index is a kind of object store for looking up records in another object store, called the referenced object store. You use this interface to retrieve data. */
1830 interface IDBIndex {
1831     readonly keyPath: string | string[];
1832     readonly multiEntry: boolean;
1833     /**
1834      * Returns the name of the index.
1835      */
1836     name: string;
1837     /**
1838      * Returns the IDBObjectStore the index belongs to.
1839      */
1840     readonly objectStore: IDBObjectStore;
1841     readonly unique: boolean;
1842     /**
1843      * Retrieves the number of records matching the given key or key range in query.
1844      * 
1845      * If successful, request's result will be the count.
1846      */
1847     count(key?: IDBValidKey | IDBKeyRange): IDBRequest<number>;
1848     /**
1849      * Retrieves the value of the first record matching the given key or key range in query.
1850      * 
1851      * If successful, request's result will be the value, or undefined if there was no matching record.
1852      */
1853     get(key: IDBValidKey | IDBKeyRange): IDBRequest<any | undefined>;
1854     /**
1855      * Retrieves the values of the records matching the given key or key range in query (up to count if given).
1856      * 
1857      * If successful, request's result will be an Array of the values.
1858      */
1859     getAll(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<any[]>;
1860     /**
1861      * Retrieves the keys of records matching the given key or key range in query (up to count if given).
1862      * 
1863      * If successful, request's result will be an Array of the keys.
1864      */
1865     getAllKeys(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<IDBValidKey[]>;
1866     /**
1867      * Retrieves the key of the first record matching the given key or key range in query.
1868      * 
1869      * If successful, request's result will be the key, or undefined if there was no matching record.
1870      */
1871     getKey(key: IDBValidKey | IDBKeyRange): IDBRequest<IDBValidKey | undefined>;
1872     /**
1873      * Opens a cursor over the records matching query, ordered by direction. If query is null, all records in index are matched.
1874      * 
1875      * If successful, request's result will be an IDBCursorWithValue, or null if there were no matching records.
1876      */
1877     openCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursorWithValue | null>;
1878     /**
1879      * Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in index are matched.
1880      * 
1881      * If successful, request's result will be an IDBCursor, or null if there were no matching records.
1882      */
1883     openKeyCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null>;
1884 }
1885
1886 declare var IDBIndex: {
1887     prototype: IDBIndex;
1888     new(): IDBIndex;
1889 };
1890
1891 /** A key range can be a single value or a range with upper and lower bounds or endpoints. If the key range has both upper and lower bounds, then it is bounded; if it has no bounds, it is unbounded. A bounded key range can either be open (the endpoints are excluded) or closed (the endpoints are included). To retrieve all keys within a certain range, you can use the following code constructs: */
1892 interface IDBKeyRange {
1893     /**
1894      * Returns lower bound, or undefined if none.
1895      */
1896     readonly lower: any;
1897     /**
1898      * Returns true if the lower open flag is set, and false otherwise.
1899      */
1900     readonly lowerOpen: boolean;
1901     /**
1902      * Returns upper bound, or undefined if none.
1903      */
1904     readonly upper: any;
1905     /**
1906      * Returns true if the upper open flag is set, and false otherwise.
1907      */
1908     readonly upperOpen: boolean;
1909     /**
1910      * Returns true if key is included in the range, and false otherwise.
1911      */
1912     includes(key: any): boolean;
1913 }
1914
1915 declare var IDBKeyRange: {
1916     prototype: IDBKeyRange;
1917     new(): IDBKeyRange;
1918     /**
1919      * Returns a new IDBKeyRange spanning from lower to upper. If lowerOpen is true, lower is not included in the range. If upperOpen is true, upper is not included in the range.
1920      */
1921     bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange;
1922     /**
1923      * Returns a new IDBKeyRange starting at key with no upper bound. If open is true, key is not included in the range.
1924      */
1925     lowerBound(lower: any, open?: boolean): IDBKeyRange;
1926     /**
1927      * Returns a new IDBKeyRange spanning only key.
1928      */
1929     only(value: any): IDBKeyRange;
1930     /**
1931      * Returns a new IDBKeyRange with no lower bound and ending at key. If open is true, key is not included in the range.
1932      */
1933     upperBound(upper: any, open?: boolean): IDBKeyRange;
1934 };
1935
1936 /** This example shows a variety of different uses of object stores, from updating the data structure with IDBObjectStore.createIndex inside an onupgradeneeded function, to adding a new item to our object store with IDBObjectStore.add. For a full working example, see our To-do Notifications app (view example live.) */
1937 interface IDBObjectStore {
1938     /**
1939      * Returns true if the store has a key generator, and false otherwise.
1940      */
1941     readonly autoIncrement: boolean;
1942     /**
1943      * Returns a list of the names of indexes in the store.
1944      */
1945     readonly indexNames: DOMStringList;
1946     /**
1947      * Returns the key path of the store, or null if none.
1948      */
1949     readonly keyPath: string | string[];
1950     /**
1951      * Returns the name of the store.
1952      */
1953     name: string;
1954     /**
1955      * Returns the associated transaction.
1956      */
1957     readonly transaction: IDBTransaction;
1958     /**
1959      * Adds or updates a record in store with the given value and key.
1960      * 
1961      * If the store uses in-line keys and key is specified a "DataError" DOMException will be thrown.
1962      * 
1963      * If put() is used, any existing record with the key will be replaced. If add() is used, and if a record with the key already exists the request will fail, with request's error set to a "ConstraintError" DOMException.
1964      * 
1965      * If successful, request's result will be the record's key.
1966      */
1967     add(value: any, key?: IDBValidKey): IDBRequest<IDBValidKey>;
1968     /**
1969      * Deletes all records in store.
1970      * 
1971      * If successful, request's result will be undefined.
1972      */
1973     clear(): IDBRequest<undefined>;
1974     /**
1975      * Retrieves the number of records matching the given key or key range in query.
1976      * 
1977      * If successful, request's result will be the count.
1978      */
1979     count(key?: IDBValidKey | IDBKeyRange): IDBRequest<number>;
1980     /**
1981      * Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a "ConstraintError" DOMException.
1982      * 
1983      * Throws an "InvalidStateError" DOMException if not called within an upgrade transaction.
1984      */
1985     createIndex(name: string, keyPath: string | string[], options?: IDBIndexParameters): IDBIndex;
1986     /**
1987      * Deletes records in store with the given key or in the given key range in query.
1988      * 
1989      * If successful, request's result will be undefined.
1990      */
1991     delete(key: IDBValidKey | IDBKeyRange): IDBRequest<undefined>;
1992     /**
1993      * Deletes the index in store with the given name.
1994      * 
1995      * Throws an "InvalidStateError" DOMException if not called within an upgrade transaction.
1996      */
1997     deleteIndex(name: string): void;
1998     /**
1999      * Retrieves the value of the first record matching the given key or key range in query.
2000      * 
2001      * If successful, request's result will be the value, or undefined if there was no matching record.
2002      */
2003     get(query: IDBValidKey | IDBKeyRange): IDBRequest<any | undefined>;
2004     /**
2005      * Retrieves the values of the records matching the given key or key range in query (up to count if given).
2006      * 
2007      * If successful, request's result will be an Array of the values.
2008      */
2009     getAll(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<any[]>;
2010     /**
2011      * Retrieves the keys of records matching the given key or key range in query (up to count if given).
2012      * 
2013      * If successful, request's result will be an Array of the keys.
2014      */
2015     getAllKeys(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<IDBValidKey[]>;
2016     /**
2017      * Retrieves the key of the first record matching the given key or key range in query.
2018      * 
2019      * If successful, request's result will be the key, or undefined if there was no matching record.
2020      */
2021     getKey(query: IDBValidKey | IDBKeyRange): IDBRequest<IDBValidKey | undefined>;
2022     index(name: string): IDBIndex;
2023     /**
2024      * Opens a cursor over the records matching query, ordered by direction. If query is null, all records in store are matched.
2025      * 
2026      * If successful, request's result will be an IDBCursorWithValue pointing at the first matching record, or null if there were no matching records.
2027      */
2028     openCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursorWithValue | null>;
2029     /**
2030      * Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in store are matched.
2031      * 
2032      * If successful, request's result will be an IDBCursor pointing at the first matching record, or null if there were no matching records.
2033      */
2034     openKeyCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null>;
2035     /**
2036      * Adds or updates a record in store with the given value and key.
2037      * 
2038      * If the store uses in-line keys and key is specified a "DataError" DOMException will be thrown.
2039      * 
2040      * If put() is used, any existing record with the key will be replaced. If add() is used, and if a record with the key already exists the request will fail, with request's error set to a "ConstraintError" DOMException.
2041      * 
2042      * If successful, request's result will be the record's key.
2043      */
2044     put(value: any, key?: IDBValidKey): IDBRequest<IDBValidKey>;
2045 }
2046
2047 declare var IDBObjectStore: {
2048     prototype: IDBObjectStore;
2049     new(): IDBObjectStore;
2050 };
2051
2052 interface IDBOpenDBRequestEventMap extends IDBRequestEventMap {
2053     "blocked": Event;
2054     "upgradeneeded": IDBVersionChangeEvent;
2055 }
2056
2057 /** Also inherits methods from its parents IDBRequest and EventTarget. */
2058 interface IDBOpenDBRequest extends IDBRequest<IDBDatabase> {
2059     onblocked: ((this: IDBOpenDBRequest, ev: Event) => any) | null;
2060     onupgradeneeded: ((this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any) | null;
2061     addEventListener<K extends keyof IDBOpenDBRequestEventMap>(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2062     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
2063     removeEventListener<K extends keyof IDBOpenDBRequestEventMap>(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2064     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
2065 }
2066
2067 declare var IDBOpenDBRequest: {
2068     prototype: IDBOpenDBRequest;
2069     new(): IDBOpenDBRequest;
2070 };
2071
2072 interface IDBRequestEventMap {
2073     "error": Event;
2074     "success": Event;
2075 }
2076
2077 /** The request object does not initially contain any information about the result of the operation, but once information becomes available, an event is fired on the request, and the information becomes available through the properties of the IDBRequest instance. */
2078 interface IDBRequest<T = any> extends EventTarget {
2079     /**
2080      * When a request is completed, returns the error (a DOMException), or null if the request succeeded. Throws a "InvalidStateError" DOMException if the request is still pending.
2081      */
2082     readonly error: DOMException | null;
2083     onerror: ((this: IDBRequest<T>, ev: Event) => any) | null;
2084     onsuccess: ((this: IDBRequest<T>, ev: Event) => any) | null;
2085     /**
2086      * Returns "pending" until a request is complete, then returns "done".
2087      */
2088     readonly readyState: IDBRequestReadyState;
2089     /**
2090      * When a request is completed, returns the result, or undefined if the request failed. Throws a "InvalidStateError" DOMException if the request is still pending.
2091      */
2092     readonly result: T;
2093     /**
2094      * Returns the IDBObjectStore, IDBIndex, or IDBCursor the request was made against, or null if is was an open request.
2095      */
2096     readonly source: IDBObjectStore | IDBIndex | IDBCursor;
2097     /**
2098      * Returns the IDBTransaction the request was made within. If this as an open request, then it returns an upgrade transaction while it is running, or null otherwise.
2099      */
2100     readonly transaction: IDBTransaction | null;
2101     addEventListener<K extends keyof IDBRequestEventMap>(type: K, listener: (this: IDBRequest<T>, ev: IDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2102     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
2103     removeEventListener<K extends keyof IDBRequestEventMap>(type: K, listener: (this: IDBRequest<T>, ev: IDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2104     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
2105 }
2106
2107 declare var IDBRequest: {
2108     prototype: IDBRequest;
2109     new(): IDBRequest;
2110 };
2111
2112 interface IDBTransactionEventMap {
2113     "abort": Event;
2114     "complete": Event;
2115     "error": Event;
2116 }
2117
2118 interface IDBTransaction extends EventTarget {
2119     /**
2120      * Returns the transaction's connection.
2121      */
2122     readonly db: IDBDatabase;
2123     /**
2124      * If the transaction was aborted, returns the error (a DOMException) providing the reason.
2125      */
2126     readonly error: DOMException;
2127     /**
2128      * Returns the mode the transaction was created with ("readonly" or "readwrite"), or "versionchange" for an upgrade transaction.
2129      */
2130     readonly mode: IDBTransactionMode;
2131     /**
2132      * Returns a list of the names of object stores in the transaction's scope. For an upgrade transaction this is all object stores in the database.
2133      */
2134     readonly objectStoreNames: DOMStringList;
2135     onabort: ((this: IDBTransaction, ev: Event) => any) | null;
2136     oncomplete: ((this: IDBTransaction, ev: Event) => any) | null;
2137     onerror: ((this: IDBTransaction, ev: Event) => any) | null;
2138     /**
2139      * Aborts the transaction. All pending requests will fail with a "AbortError" DOMException and all changes made to the database will be reverted.
2140      */
2141     abort(): void;
2142     /**
2143      * Returns an IDBObjectStore in the transaction's scope.
2144      */
2145     objectStore(name: string): IDBObjectStore;
2146     addEventListener<K extends keyof IDBTransactionEventMap>(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2147     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
2148     removeEventListener<K extends keyof IDBTransactionEventMap>(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2149     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
2150 }
2151
2152 declare var IDBTransaction: {
2153     prototype: IDBTransaction;
2154     new(): IDBTransaction;
2155 };
2156
2157 /** This IndexedDB API interface indicates that the version of the database has changed, as the result of an IDBOpenDBRequest.onupgradeneeded event handler function. */
2158 interface IDBVersionChangeEvent extends Event {
2159     readonly newVersion: number | null;
2160     readonly oldVersion: number;
2161 }
2162
2163 declare var IDBVersionChangeEvent: {
2164     prototype: IDBVersionChangeEvent;
2165     new(type: string, eventInitDict?: IDBVersionChangeEventInit): IDBVersionChangeEvent;
2166 };
2167
2168 interface ImageBitmap {
2169     /**
2170      * Returns the intrinsic height of the image, in CSS pixels.
2171      */
2172     readonly height: number;
2173     /**
2174      * Returns the intrinsic width of the image, in CSS pixels.
2175      */
2176     readonly width: number;
2177     /**
2178      * Releases imageBitmap's underlying bitmap data.
2179      */
2180     close(): void;
2181 }
2182
2183 declare var ImageBitmap: {
2184     prototype: ImageBitmap;
2185     new(): ImageBitmap;
2186 };
2187
2188 interface ImageBitmapRenderingContext {
2189     /**
2190      * Returns the canvas element that the context is bound to.
2191      */
2192     readonly canvas: OffscreenCanvas;
2193     /**
2194      * Transfers the underlying bitmap data from imageBitmap to context, and the bitmap becomes the contents of the canvas element to which context is bound.
2195      */
2196     transferFromImageBitmap(bitmap: ImageBitmap | null): void;
2197 }
2198
2199 declare var ImageBitmapRenderingContext: {
2200     prototype: ImageBitmapRenderingContext;
2201     new(): ImageBitmapRenderingContext;
2202 };
2203
2204 /** 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(). */
2205 interface ImageData {
2206     /**
2207      * Returns the one-dimensional array containing the data in RGBA order, as integers in the range 0 to 255.
2208      */
2209     readonly data: Uint8ClampedArray;
2210     /**
2211      * Returns the actual dimensions of the data in the ImageData object, in pixels.
2212      */
2213     readonly height: number;
2214     /**
2215      * Returns the actual dimensions of the data in the ImageData object, in pixels.
2216      */
2217     readonly width: number;
2218 }
2219
2220 declare var ImageData: {
2221     prototype: ImageData;
2222     new(sw: number, sh: number): ImageData;
2223     new(data: Uint8ClampedArray, sw: number, sh?: number): ImageData;
2224 };
2225
2226 /** This Channel Messaging API interface allows us to create a new message channel and send data through it via its two MessagePort properties. */
2227 interface MessageChannel {
2228     /**
2229      * Returns the first MessagePort object.
2230      */
2231     readonly port1: MessagePort;
2232     /**
2233      * Returns the second MessagePort object.
2234      */
2235     readonly port2: MessagePort;
2236 }
2237
2238 declare var MessageChannel: {
2239     prototype: MessageChannel;
2240     new(): MessageChannel;
2241 };
2242
2243 /** A message received by a target object. */
2244 interface MessageEvent<T = any> extends Event {
2245     /**
2246      * Returns the data of the message.
2247      */
2248     readonly data: T;
2249     /**
2250      * Returns the last event ID string, for server-sent events.
2251      */
2252     readonly lastEventId: string;
2253     /**
2254      * Returns the origin of the message, for server-sent events and cross-document messaging.
2255      */
2256     readonly origin: string;
2257     /**
2258      * Returns the MessagePort array sent with the message, for cross-document messaging and channel messaging.
2259      */
2260     readonly ports: ReadonlyArray<MessagePort>;
2261     /**
2262      * Returns the WindowProxy of the source window, for cross-document messaging, and the MessagePort being attached, in the connect event fired at SharedWorkerGlobalScope objects.
2263      */
2264     readonly source: MessageEventSource | null;
2265 }
2266
2267 declare var MessageEvent: {
2268     prototype: MessageEvent;
2269     new<T>(type: string, eventInitDict?: MessageEventInit<T>): MessageEvent<T>;
2270 };
2271
2272 interface MessagePortEventMap {
2273     "message": MessageEvent;
2274     "messageerror": MessageEvent;
2275 }
2276
2277 /** This Channel Messaging API interface represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other. */
2278 interface MessagePort extends EventTarget {
2279     onmessage: ((this: MessagePort, ev: MessageEvent) => any) | null;
2280     onmessageerror: ((this: MessagePort, ev: MessageEvent) => any) | null;
2281     /**
2282      * Disconnects the port, so that it is no longer active.
2283      */
2284     close(): void;
2285     /**
2286      * Posts a message through the channel. Objects listed in transfer are transferred, not just cloned, meaning that they are no longer usable on the sending side.
2287      * 
2288      * Throws a "DataCloneError" DOMException if transfer contains duplicate objects or port, or if message could not be cloned.
2289      */
2290     postMessage(message: any, transfer: Transferable[]): void;
2291     postMessage(message: any, options?: PostMessageOptions): void;
2292     /**
2293      * Begins dispatching messages received on the port.
2294      */
2295     start(): void;
2296     addEventListener<K extends keyof MessagePortEventMap>(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2297     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
2298     removeEventListener<K extends keyof MessagePortEventMap>(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2299     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
2300 }
2301
2302 declare var MessagePort: {
2303     prototype: MessagePort;
2304     new(): MessagePort;
2305 };
2306
2307 interface NavigationPreloadManager {
2308     disable(): Promise<void>;
2309     enable(): Promise<void>;
2310     getState(): Promise<NavigationPreloadState>;
2311     setHeaderValue(value: string): Promise<void>;
2312 }
2313
2314 declare var NavigationPreloadManager: {
2315     prototype: NavigationPreloadManager;
2316     new(): NavigationPreloadManager;
2317 };
2318
2319 interface NavigatorConcurrentHardware {
2320     readonly hardwareConcurrency: number;
2321 }
2322
2323 interface NavigatorID {
2324     readonly appCodeName: string;
2325     readonly appName: string;
2326     readonly appVersion: string;
2327     readonly platform: string;
2328     readonly product: string;
2329     readonly userAgent: string;
2330 }
2331
2332 interface NavigatorLanguage {
2333     readonly language: string;
2334     readonly languages: ReadonlyArray<string>;
2335 }
2336
2337 interface NavigatorOnLine {
2338     readonly onLine: boolean;
2339 }
2340
2341 interface NavigatorStorage {
2342     readonly storage: StorageManager;
2343 }
2344
2345 interface NotificationEventMap {
2346     "click": Event;
2347     "close": Event;
2348     "error": Event;
2349     "show": Event;
2350 }
2351
2352 /** This Notifications API interface is used to configure and display desktop notifications to the user. */
2353 interface Notification extends EventTarget {
2354     readonly actions: ReadonlyArray<NotificationAction>;
2355     readonly badge: string;
2356     readonly body: string;
2357     readonly data: any;
2358     readonly dir: NotificationDirection;
2359     readonly icon: string;
2360     readonly image: string;
2361     readonly lang: string;
2362     onclick: ((this: Notification, ev: Event) => any) | null;
2363     onclose: ((this: Notification, ev: Event) => any) | null;
2364     onerror: ((this: Notification, ev: Event) => any) | null;
2365     onshow: ((this: Notification, ev: Event) => any) | null;
2366     readonly renotify: boolean;
2367     readonly requireInteraction: boolean;
2368     readonly silent: boolean;
2369     readonly tag: string;
2370     readonly timestamp: number;
2371     readonly title: string;
2372     readonly vibrate: ReadonlyArray<number>;
2373     close(): void;
2374     addEventListener<K extends keyof NotificationEventMap>(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2375     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
2376     removeEventListener<K extends keyof NotificationEventMap>(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2377     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
2378 }
2379
2380 declare var Notification: {
2381     prototype: Notification;
2382     new(title: string, options?: NotificationOptions): Notification;
2383     readonly maxActions: number;
2384     readonly permission: NotificationPermission;
2385 };
2386
2387 /** The parameter passed into the onnotificationclick handler, the NotificationEvent interface represents a notification click event that is dispatched on the ServiceWorkerGlobalScope of a ServiceWorker. */
2388 interface NotificationEvent extends ExtendableEvent {
2389     readonly action: string;
2390     readonly notification: Notification;
2391 }
2392
2393 declare var NotificationEvent: {
2394     prototype: NotificationEvent;
2395     new(type: string, eventInitDict: NotificationEventInit): NotificationEvent;
2396 };
2397
2398 /** The OES_element_index_uint extension is part of the WebGL API and adds support for gl.UNSIGNED_INT types to WebGLRenderingContext.drawElements(). */
2399 interface OES_element_index_uint {
2400 }
2401
2402 /** The OES_standard_derivatives extension is part of the WebGL API and adds the GLSL derivative functions dFdx, dFdy, and fwidth. */
2403 interface OES_standard_derivatives {
2404     readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: GLenum;
2405 }
2406
2407 /** The OES_texture_float extension is part of the WebGL API and exposes floating-point pixel types for textures. */
2408 interface OES_texture_float {
2409 }
2410
2411 /** The OES_texture_float_linear extension is part of the WebGL API and allows linear filtering with floating-point pixel types for textures. */
2412 interface OES_texture_float_linear {
2413 }
2414
2415 /** The OES_texture_half_float extension is part of the WebGL API and adds texture formats with 16- (aka half float) and 32-bit floating-point components. */
2416 interface OES_texture_half_float {
2417     readonly HALF_FLOAT_OES: GLenum;
2418 }
2419
2420 /** The OES_texture_half_float_linear extension is part of the WebGL API and allows linear filtering with half floating-point pixel types for textures. */
2421 interface OES_texture_half_float_linear {
2422 }
2423
2424 interface OES_vertex_array_object {
2425     bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): void;
2426     createVertexArrayOES(): WebGLVertexArrayObjectOES | null;
2427     deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): void;
2428     isVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): GLboolean;
2429     readonly VERTEX_ARRAY_BINDING_OES: GLenum;
2430 }
2431
2432 interface OffscreenCanvas extends EventTarget {
2433     /**
2434      * These attributes return the dimensions of the OffscreenCanvas object's bitmap.
2435      * 
2436      * They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).
2437      */
2438     height: number;
2439     /**
2440      * These attributes return the dimensions of the OffscreenCanvas object's bitmap.
2441      * 
2442      * They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).
2443      */
2444     width: number;
2445     /**
2446      * Returns a promise that will fulfill with a new Blob object representing a file containing the image in the OffscreenCanvas object.
2447      * 
2448      * The argument, if provided, is a dictionary that controls the encoding options of the image file to be created. The type field specifies the file format and has a default value of "image/png"; that type is also used if the requested type isn't supported. If the image format supports variable quality (such as "image/jpeg"), then the quality field is a number in the range 0.0 to 1.0 inclusive indicating the desired quality level for the resulting image.
2449      */
2450     convertToBlob(options?: ImageEncodeOptions): Promise<Blob>;
2451     /**
2452      * 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.
2453      * 
2454      * 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]
2455      * 
2456      * 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).
2457      */
2458     getContext(contextId: "2d", options?: CanvasRenderingContext2DSettings): OffscreenCanvasRenderingContext2D | null;
2459     getContext(contextId: "bitmaprenderer", options?: ImageBitmapRenderingContextSettings): ImageBitmapRenderingContext | null;
2460     getContext(contextId: "webgl", options?: WebGLContextAttributes): WebGLRenderingContext | null;
2461     getContext(contextId: "webgl2", options?: WebGLContextAttributes): WebGL2RenderingContext | null;
2462     getContext(contextId: OffscreenRenderingContextId, options?: any): OffscreenRenderingContext | null;
2463     /**
2464      * 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.
2465      */
2466     transferToImageBitmap(): ImageBitmap;
2467 }
2468
2469 declare var OffscreenCanvas: {
2470     prototype: OffscreenCanvas;
2471     new(width: number, height: number): OffscreenCanvas;
2472 };
2473
2474 interface OffscreenCanvasRenderingContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform {
2475     readonly canvas: OffscreenCanvas;
2476     commit(): void;
2477 }
2478
2479 declare var OffscreenCanvasRenderingContext2D: {
2480     prototype: OffscreenCanvasRenderingContext2D;
2481     new(): OffscreenCanvasRenderingContext2D;
2482 };
2483
2484 /** This Canvas 2D API interface is used to declare a path that can then be used on a CanvasRenderingContext2D object. The path methods of the CanvasRenderingContext2D interface are also present on this interface, which gives you the convenience of being able to retain and replay your path whenever desired. */
2485 interface Path2D extends CanvasPath {
2486     /**
2487      * Adds to the path the path given by the argument.
2488      */
2489     addPath(path: Path2D, transform?: DOMMatrix2DInit): void;
2490 }
2491
2492 declare var Path2D: {
2493     prototype: Path2D;
2494     new(path?: Path2D | string): Path2D;
2495 };
2496
2497 interface PerformanceEventMap {
2498     "resourcetimingbufferfull": Event;
2499 }
2500
2501 /** Provides access to performance-related information for the current page. It's part of the High Resolution Time API, but is enhanced by the Performance Timeline API, the Navigation Timing API, the User Timing API, and the Resource Timing API. */
2502 interface Performance extends EventTarget {
2503     onresourcetimingbufferfull: ((this: Performance, ev: Event) => any) | null;
2504     readonly timeOrigin: number;
2505     clearMarks(markName?: string): void;
2506     clearMeasures(measureName?: string): void;
2507     clearResourceTimings(): void;
2508     getEntries(): PerformanceEntryList;
2509     getEntriesByName(name: string, type?: string): PerformanceEntryList;
2510     getEntriesByType(type: string): PerformanceEntryList;
2511     mark(markName: string): void;
2512     measure(measureName: string, startMark?: string, endMark?: string): void;
2513     now(): number;
2514     setResourceTimingBufferSize(maxSize: number): void;
2515     toJSON(): any;
2516     addEventListener<K extends keyof PerformanceEventMap>(type: K, listener: (this: Performance, ev: PerformanceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2517     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
2518     removeEventListener<K extends keyof PerformanceEventMap>(type: K, listener: (this: Performance, ev: PerformanceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2519     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
2520 }
2521
2522 declare var Performance: {
2523     prototype: Performance;
2524     new(): Performance;
2525 };
2526
2527 /** Encapsulates a single performance metric that is part of the performance timeline. A performance entry can be directly created by making a performance mark or measure (for example by calling the mark() method) at an explicit point in an application. Performance entries are also created in indirect ways such as loading a resource (such as an image). */
2528 interface PerformanceEntry {
2529     readonly duration: number;
2530     readonly entryType: string;
2531     readonly name: string;
2532     readonly startTime: number;
2533     toJSON(): any;
2534 }
2535
2536 declare var PerformanceEntry: {
2537     prototype: PerformanceEntry;
2538     new(): PerformanceEntry;
2539 };
2540
2541 /** PerformanceMark is an abstract interface for PerformanceEntry objects with an entryType of "mark". Entries of this type are created by calling performance.mark() to add a named DOMHighResTimeStamp (the mark) to the browser's performance timeline. */
2542 interface PerformanceMark extends PerformanceEntry {
2543 }
2544
2545 declare var PerformanceMark: {
2546     prototype: PerformanceMark;
2547     new(): PerformanceMark;
2548 };
2549
2550 /** PerformanceMeasure is an abstract interface for PerformanceEntry objects with an entryType of "measure". Entries of this type are created by calling performance.measure() to add a named DOMHighResTimeStamp (the measure) between two marks to the browser's performance timeline. */
2551 interface PerformanceMeasure extends PerformanceEntry {
2552 }
2553
2554 declare var PerformanceMeasure: {
2555     prototype: PerformanceMeasure;
2556     new(): PerformanceMeasure;
2557 };
2558
2559 interface PerformanceObserver {
2560     disconnect(): void;
2561     observe(options?: PerformanceObserverInit): void;
2562     takeRecords(): PerformanceEntryList;
2563 }
2564
2565 declare var PerformanceObserver: {
2566     prototype: PerformanceObserver;
2567     new(callback: PerformanceObserverCallback): PerformanceObserver;
2568     readonly supportedEntryTypes: ReadonlyArray<string>;
2569 };
2570
2571 interface PerformanceObserverEntryList {
2572     getEntries(): PerformanceEntryList;
2573     getEntriesByName(name: string, type?: string): PerformanceEntryList;
2574     getEntriesByType(type: string): PerformanceEntryList;
2575 }
2576
2577 declare var PerformanceObserverEntryList: {
2578     prototype: PerformanceObserverEntryList;
2579     new(): PerformanceObserverEntryList;
2580 };
2581
2582 /** Enables retrieval and analysis of detailed network timing data regarding the loading of an application's resources. An application can use the timing metrics to determine, for example, the length of time it takes to fetch a specific resource, such as an XMLHttpRequest, <SVG>, image, or script. */
2583 interface PerformanceResourceTiming extends PerformanceEntry {
2584     readonly connectEnd: number;
2585     readonly connectStart: number;
2586     readonly decodedBodySize: number;
2587     readonly domainLookupEnd: number;
2588     readonly domainLookupStart: number;
2589     readonly encodedBodySize: number;
2590     readonly fetchStart: number;
2591     readonly initiatorType: string;
2592     readonly nextHopProtocol: string;
2593     readonly redirectEnd: number;
2594     readonly redirectStart: number;
2595     readonly requestStart: number;
2596     readonly responseEnd: number;
2597     readonly responseStart: number;
2598     readonly secureConnectionStart: number;
2599     readonly transferSize: number;
2600     readonly workerStart: number;
2601     toJSON(): any;
2602 }
2603
2604 declare var PerformanceResourceTiming: {
2605     prototype: PerformanceResourceTiming;
2606     new(): PerformanceResourceTiming;
2607 };
2608
2609 interface PermissionStatusEventMap {
2610     "change": Event;
2611 }
2612
2613 interface PermissionStatus extends EventTarget {
2614     onchange: ((this: PermissionStatus, ev: Event) => any) | null;
2615     readonly state: PermissionState;
2616     addEventListener<K extends keyof PermissionStatusEventMap>(type: K, listener: (this: PermissionStatus, ev: PermissionStatusEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2617     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
2618     removeEventListener<K extends keyof PermissionStatusEventMap>(type: K, listener: (this: PermissionStatus, ev: PermissionStatusEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2619     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
2620 }
2621
2622 declare var PermissionStatus: {
2623     prototype: PermissionStatus;
2624     new(): PermissionStatus;
2625 };
2626
2627 interface Permissions {
2628     query(permissionDesc: PermissionDescriptor | DevicePermissionDescriptor | MidiPermissionDescriptor | PushPermissionDescriptor): Promise<PermissionStatus>;
2629 }
2630
2631 declare var Permissions: {
2632     prototype: Permissions;
2633     new(): Permissions;
2634 };
2635
2636 /** Events measuring progress of an underlying process, like an HTTP request (for an XMLHttpRequest, or the loading of the underlying resource of an <img>, <audio>, <video>, <style> or <link>). */
2637 interface ProgressEvent<T extends EventTarget = EventTarget> extends Event {
2638     readonly lengthComputable: boolean;
2639     readonly loaded: number;
2640     readonly target: T | null;
2641     readonly total: number;
2642 }
2643
2644 declare var ProgressEvent: {
2645     prototype: ProgressEvent;
2646     new(type: string, eventInitDict?: ProgressEventInit): ProgressEvent;
2647 };
2648
2649 interface PromiseRejectionEvent extends Event {
2650     readonly promise: Promise<any>;
2651     readonly reason: any;
2652 }
2653
2654 declare var PromiseRejectionEvent: {
2655     prototype: PromiseRejectionEvent;
2656     new(type: string, eventInitDict: PromiseRejectionEventInit): PromiseRejectionEvent;
2657 };
2658
2659 /** This Push API interface represents a push message that has been received. This event is sent to the global scope of a ServiceWorker. It contains the information sent from an application server to a PushSubscription. */
2660 interface PushEvent extends ExtendableEvent {
2661     readonly data: PushMessageData | null;
2662 }
2663
2664 declare var PushEvent: {
2665     prototype: PushEvent;
2666     new(type: string, eventInitDict?: PushEventInit): PushEvent;
2667 };
2668
2669 /** This Push API interface provides a way to receive notifications from third-party servers as well as request URLs for push notifications. */
2670 interface PushManager {
2671     getSubscription(): Promise<PushSubscription | null>;
2672     permissionState(options?: PushSubscriptionOptionsInit): Promise<PushPermissionState>;
2673     subscribe(options?: PushSubscriptionOptionsInit): Promise<PushSubscription>;
2674 }
2675
2676 declare var PushManager: {
2677     prototype: PushManager;
2678     new(): PushManager;
2679     readonly supportedContentEncodings: ReadonlyArray<string>;
2680 };
2681
2682 /** This Push API interface provides methods which let you retrieve the push data sent by a server in various formats. */
2683 interface PushMessageData {
2684     arrayBuffer(): ArrayBuffer;
2685     blob(): Blob;
2686     json(): any;
2687     text(): string;
2688 }
2689
2690 declare var PushMessageData: {
2691     prototype: PushMessageData;
2692     new(): PushMessageData;
2693 };
2694
2695 /** This Push API interface provides a subcription's URL endpoint and allows unsubscription from a push service. */
2696 interface PushSubscription {
2697     readonly endpoint: string;
2698     readonly expirationTime: number | null;
2699     readonly options: PushSubscriptionOptions;
2700     getKey(name: PushEncryptionKeyName): ArrayBuffer | null;
2701     toJSON(): PushSubscriptionJSON;
2702     unsubscribe(): Promise<boolean>;
2703 }
2704
2705 declare var PushSubscription: {
2706     prototype: PushSubscription;
2707     new(): PushSubscription;
2708 };
2709
2710 interface PushSubscriptionChangeEvent extends ExtendableEvent {
2711     readonly newSubscription: PushSubscription | null;
2712     readonly oldSubscription: PushSubscription | null;
2713 }
2714
2715 declare var PushSubscriptionChangeEvent: {
2716     prototype: PushSubscriptionChangeEvent;
2717     new(type: string, eventInitDict?: PushSubscriptionChangeEventInit): PushSubscriptionChangeEvent;
2718 };
2719
2720 interface PushSubscriptionOptions {
2721     readonly applicationServerKey: ArrayBuffer | null;
2722     readonly userVisibleOnly: boolean;
2723 }
2724
2725 declare var PushSubscriptionOptions: {
2726     prototype: PushSubscriptionOptions;
2727     new(): PushSubscriptionOptions;
2728 };
2729
2730 interface ReadableByteStreamController {
2731     readonly byobRequest: ReadableStreamBYOBRequest | undefined;
2732     readonly desiredSize: number | null;
2733     close(): void;
2734     enqueue(chunk: ArrayBufferView): void;
2735     error(error?: any): void;
2736 }
2737
2738 declare var ReadableByteStreamController: {
2739     prototype: ReadableByteStreamController;
2740     new(): ReadableByteStreamController;
2741 };
2742
2743 /** This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object. */
2744 interface ReadableStream<R = any> {
2745     readonly locked: boolean;
2746     cancel(reason?: any): Promise<void>;
2747     getReader(options: { mode: "byob" }): ReadableStreamBYOBReader;
2748     getReader(): ReadableStreamDefaultReader<R>;
2749     pipeThrough<T>({ writable, readable }: { writable: WritableStream<R>, readable: ReadableStream<T> }, options?: PipeOptions): ReadableStream<T>;
2750     pipeTo(dest: WritableStream<R>, options?: PipeOptions): Promise<void>;
2751     tee(): [ReadableStream<R>, ReadableStream<R>];
2752 }
2753
2754 declare var ReadableStream: {
2755     prototype: ReadableStream;
2756     new(underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number, size?: undefined }): ReadableStream<Uint8Array>;
2757     new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
2758 };
2759
2760 interface ReadableStreamBYOBReader {
2761     readonly closed: Promise<void>;
2762     cancel(reason?: any): Promise<void>;
2763     read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
2764     releaseLock(): void;
2765 }
2766
2767 declare var ReadableStreamBYOBReader: {
2768     prototype: ReadableStreamBYOBReader;
2769     new(): ReadableStreamBYOBReader;
2770 };
2771
2772 interface ReadableStreamBYOBRequest {
2773     readonly view: ArrayBufferView;
2774     respond(bytesWritten: number): void;
2775     respondWithNewView(view: ArrayBufferView): void;
2776 }
2777
2778 declare var ReadableStreamBYOBRequest: {
2779     prototype: ReadableStreamBYOBRequest;
2780     new(): ReadableStreamBYOBRequest;
2781 };
2782
2783 interface ReadableStreamDefaultController<R = any> {
2784     readonly desiredSize: number | null;
2785     close(): void;
2786     enqueue(chunk: R): void;
2787     error(error?: any): void;
2788 }
2789
2790 declare var ReadableStreamDefaultController: {
2791     prototype: ReadableStreamDefaultController;
2792     new(): ReadableStreamDefaultController;
2793 };
2794
2795 interface ReadableStreamDefaultReader<R = any> {
2796     readonly closed: Promise<void>;
2797     cancel(reason?: any): Promise<void>;
2798     read(): Promise<ReadableStreamReadResult<R>>;
2799     releaseLock(): void;
2800 }
2801
2802 declare var ReadableStreamDefaultReader: {
2803     prototype: ReadableStreamDefaultReader;
2804     new(): ReadableStreamDefaultReader;
2805 };
2806
2807 interface ReadableStreamReader<R = any> {
2808     cancel(): Promise<void>;
2809     read(): Promise<ReadableStreamReadResult<R>>;
2810     releaseLock(): void;
2811 }
2812
2813 declare var ReadableStreamReader: {
2814     prototype: ReadableStreamReader;
2815     new(): ReadableStreamReader;
2816 };
2817
2818 /** This Fetch API interface represents a resource request. */
2819 interface Request extends Body {
2820     /**
2821      * Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.
2822      */
2823     readonly cache: RequestCache;
2824     /**
2825      * Returns the credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL.
2826      */
2827     readonly credentials: RequestCredentials;
2828     /**
2829      * Returns the kind of resource requested by request, e.g., "document" or "script".
2830      */
2831     readonly destination: RequestDestination;
2832     /**
2833      * Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the "Host" header.
2834      */
2835     readonly headers: Headers;
2836     /**
2837      * Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI]
2838      */
2839     readonly integrity: string;
2840     /**
2841      * Returns a boolean indicating whether or not request is for a history navigation (a.k.a. back-foward navigation).
2842      */
2843     readonly isHistoryNavigation: boolean;
2844     /**
2845      * Returns a boolean indicating whether or not request is for a reload navigation.
2846      */
2847     readonly isReloadNavigation: boolean;
2848     /**
2849      * Returns a boolean indicating whether or not request can outlive the global in which it was created.
2850      */
2851     readonly keepalive: boolean;
2852     /**
2853      * Returns request's HTTP method, which is "GET" by default.
2854      */
2855     readonly method: string;
2856     /**
2857      * Returns the mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs.
2858      */
2859     readonly mode: RequestMode;
2860     /**
2861      * Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.
2862      */
2863     readonly redirect: RequestRedirect;
2864     /**
2865      * Returns the referrer of request. Its value can be a same-origin URL if explicitly set in init, the empty string to indicate no referrer, and "about:client" when defaulting to the global's default. This is used during fetching to determine the value of the `Referer` header of the request being made.
2866      */
2867     readonly referrer: string;
2868     /**
2869      * Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer.
2870      */
2871     readonly referrerPolicy: ReferrerPolicy;
2872     /**
2873      * Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
2874      */
2875     readonly signal: AbortSignal;
2876     /**
2877      * Returns the URL of request as a string.
2878      */
2879     readonly url: string;
2880     clone(): Request;
2881 }
2882
2883 declare var Request: {
2884     prototype: Request;
2885     new(input: RequestInfo, init?: RequestInit): Request;
2886 };
2887
2888 /** This Fetch API interface represents the response to a request. */
2889 interface Response extends Body {
2890     readonly headers: Headers;
2891     readonly ok: boolean;
2892     readonly redirected: boolean;
2893     readonly status: number;
2894     readonly statusText: string;
2895     readonly trailer: Promise<Headers>;
2896     readonly type: ResponseType;
2897     readonly url: string;
2898     clone(): Response;
2899 }
2900
2901 declare var Response: {
2902     prototype: Response;
2903     new(body?: BodyInit | null, init?: ResponseInit): Response;
2904     error(): Response;
2905     redirect(url: string, status?: number): Response;
2906 };
2907
2908 interface ServiceWorkerEventMap extends AbstractWorkerEventMap {
2909     "statechange": Event;
2910 }
2911
2912 /** This ServiceWorker API interface provides a reference to a service worker. Multiple browsing contexts (e.g. pages, workers, etc.) can be associated with the same service worker, each through a unique ServiceWorker object. */
2913 interface ServiceWorker extends EventTarget, AbstractWorker {
2914     onstatechange: ((this: ServiceWorker, ev: Event) => any) | null;
2915     readonly scriptURL: string;
2916     readonly state: ServiceWorkerState;
2917     postMessage(message: any, transfer: Transferable[]): void;
2918     postMessage(message: any, options?: PostMessageOptions): void;
2919     addEventListener<K extends keyof ServiceWorkerEventMap>(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2920     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
2921     removeEventListener<K extends keyof ServiceWorkerEventMap>(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2922     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
2923 }
2924
2925 declare var ServiceWorker: {
2926     prototype: ServiceWorker;
2927     new(): ServiceWorker;
2928 };
2929
2930 interface ServiceWorkerContainerEventMap {
2931     "controllerchange": Event;
2932     "message": MessageEvent;
2933     "messageerror": MessageEvent;
2934 }
2935
2936 /** The ServiceWorkerContainer interface of the ServiceWorker API provides an object representing the service worker as an overall unit in the network ecosystem, including facilities to register, unregister and update service workers, and access the state of service workers and their registrations. */
2937 interface ServiceWorkerContainer extends EventTarget {
2938     readonly controller: ServiceWorker | null;
2939     oncontrollerchange: ((this: ServiceWorkerContainer, ev: Event) => any) | null;
2940     onmessage: ((this: ServiceWorkerContainer, ev: MessageEvent) => any) | null;
2941     onmessageerror: ((this: ServiceWorkerContainer, ev: MessageEvent) => any) | null;
2942     readonly ready: Promise<ServiceWorkerRegistration>;
2943     getRegistration(clientURL?: string): Promise<ServiceWorkerRegistration | undefined>;
2944     getRegistrations(): Promise<ReadonlyArray<ServiceWorkerRegistration>>;
2945     register(scriptURL: string, options?: RegistrationOptions): Promise<ServiceWorkerRegistration>;
2946     startMessages(): void;
2947     addEventListener<K extends keyof ServiceWorkerContainerEventMap>(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2948     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
2949     removeEventListener<K extends keyof ServiceWorkerContainerEventMap>(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2950     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
2951 }
2952
2953 declare var ServiceWorkerContainer: {
2954     prototype: ServiceWorkerContainer;
2955     new(): ServiceWorkerContainer;
2956 };
2957
2958 interface ServiceWorkerGlobalScopeEventMap extends WorkerGlobalScopeEventMap {
2959     "activate": ExtendableEvent;
2960     "fetch": FetchEvent;
2961     "install": ExtendableEvent;
2962     "message": ExtendableMessageEvent;
2963     "messageerror": MessageEvent;
2964     "notificationclick": NotificationEvent;
2965     "notificationclose": NotificationEvent;
2966     "push": PushEvent;
2967     "pushsubscriptionchange": PushSubscriptionChangeEvent;
2968     "sync": SyncEvent;
2969 }
2970
2971 /** This ServiceWorker API interface represents the global execution context of a service worker. */
2972 interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
2973     readonly clients: Clients;
2974     onactivate: ((this: ServiceWorkerGlobalScope, ev: ExtendableEvent) => any) | null;
2975     onfetch: ((this: ServiceWorkerGlobalScope, ev: FetchEvent) => any) | null;
2976     oninstall: ((this: ServiceWorkerGlobalScope, ev: ExtendableEvent) => any) | null;
2977     onmessage: ((this: ServiceWorkerGlobalScope, ev: ExtendableMessageEvent) => any) | null;
2978     onmessageerror: ((this: ServiceWorkerGlobalScope, ev: MessageEvent) => any) | null;
2979     onnotificationclick: ((this: ServiceWorkerGlobalScope, ev: NotificationEvent) => any) | null;
2980     onnotificationclose: ((this: ServiceWorkerGlobalScope, ev: NotificationEvent) => any) | null;
2981     onpush: ((this: ServiceWorkerGlobalScope, ev: PushEvent) => any) | null;
2982     onpushsubscriptionchange: ((this: ServiceWorkerGlobalScope, ev: PushSubscriptionChangeEvent) => any) | null;
2983     onsync: ((this: ServiceWorkerGlobalScope, ev: SyncEvent) => any) | null;
2984     readonly registration: ServiceWorkerRegistration;
2985     readonly serviceWorker: ServiceWorker;
2986     skipWaiting(): Promise<void>;
2987     addEventListener<K extends keyof ServiceWorkerGlobalScopeEventMap>(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2988     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
2989     removeEventListener<K extends keyof ServiceWorkerGlobalScopeEventMap>(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2990     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
2991 }
2992
2993 declare var ServiceWorkerGlobalScope: {
2994     prototype: ServiceWorkerGlobalScope;
2995     new(): ServiceWorkerGlobalScope;
2996 };
2997
2998 interface ServiceWorkerRegistrationEventMap {
2999     "updatefound": Event;
3000 }
3001
3002 /** This ServiceWorker API interface represents the service worker registration. You register a service worker to control one or more pages that share the same origin. */
3003 interface ServiceWorkerRegistration extends EventTarget {
3004     readonly active: ServiceWorker | null;
3005     readonly installing: ServiceWorker | null;
3006     readonly navigationPreload: NavigationPreloadManager;
3007     onupdatefound: ((this: ServiceWorkerRegistration, ev: Event) => any) | null;
3008     readonly pushManager: PushManager;
3009     readonly scope: string;
3010     readonly sync: SyncManager;
3011     readonly updateViaCache: ServiceWorkerUpdateViaCache;
3012     readonly waiting: ServiceWorker | null;
3013     getNotifications(filter?: GetNotificationOptions): Promise<Notification[]>;
3014     showNotification(title: string, options?: NotificationOptions): Promise<void>;
3015     unregister(): Promise<boolean>;
3016     update(): Promise<void>;
3017     addEventListener<K extends keyof ServiceWorkerRegistrationEventMap>(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
3018     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
3019     removeEventListener<K extends keyof ServiceWorkerRegistrationEventMap>(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
3020     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
3021 }
3022
3023 declare var ServiceWorkerRegistration: {
3024     prototype: ServiceWorkerRegistration;
3025     new(): ServiceWorkerRegistration;
3026 };
3027
3028 interface SharedWorker extends EventTarget, AbstractWorker {
3029     /**
3030      * Returns sharedWorker's MessagePort object which can be used to communicate with the global environment.
3031      */
3032     readonly port: MessagePort;
3033     addEventListener<K extends keyof AbstractWorkerEventMap>(type: K, listener: (this: SharedWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
3034     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
3035     removeEventListener<K extends keyof AbstractWorkerEventMap>(type: K, listener: (this: SharedWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
3036     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
3037 }
3038
3039 declare var SharedWorker: {
3040     prototype: SharedWorker;
3041     new(scriptURL: string, options?: string | WorkerOptions): SharedWorker;
3042 };
3043
3044 interface SharedWorkerGlobalScopeEventMap extends WorkerGlobalScopeEventMap {
3045     "connect": MessageEvent;
3046 }
3047
3048 interface SharedWorkerGlobalScope extends WorkerGlobalScope {
3049     /**
3050      * Returns sharedWorkerGlobal's name, i.e. the value given to the SharedWorker constructor. Multiple SharedWorker objects can correspond to the same shared worker (and SharedWorkerGlobalScope), by reusing the same name.
3051      */
3052     readonly name: string;
3053     onconnect: ((this: SharedWorkerGlobalScope, ev: MessageEvent) => any) | null;
3054     /**
3055      * Aborts sharedWorkerGlobal.
3056      */
3057     close(): void;
3058     addEventListener<K extends keyof SharedWorkerGlobalScopeEventMap>(type: K, listener: (this: SharedWorkerGlobalScope, ev: SharedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
3059     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
3060     removeEventListener<K extends keyof SharedWorkerGlobalScopeEventMap>(type: K, listener: (this: SharedWorkerGlobalScope, ev: SharedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
3061     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
3062 }
3063
3064 declare var SharedWorkerGlobalScope: {
3065     prototype: SharedWorkerGlobalScope;
3066     new(): SharedWorkerGlobalScope;
3067 };
3068
3069 interface StorageManager {
3070     estimate(): Promise<StorageEstimate>;
3071     persisted(): Promise<boolean>;
3072 }
3073
3074 declare var StorageManager: {
3075     prototype: StorageManager;
3076     new(): StorageManager;
3077 };
3078
3079 /** This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto). */
3080 interface SubtleCrypto {
3081     decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise<ArrayBuffer>;
3082     deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>;
3083     deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
3084     digest(algorithm: AlgorithmIdentifier, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise<ArrayBuffer>;
3085     encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise<ArrayBuffer>;
3086     exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
3087     exportKey(format: "raw" | "pkcs8" | "spki", key: CryptoKey): Promise<ArrayBuffer>;
3088     exportKey(format: string, key: CryptoKey): Promise<JsonWebKey | ArrayBuffer>;
3089     generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>;
3090     generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
3091     generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;
3092     importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
3093     importKey(format: "raw" | "pkcs8" | "spki", keyData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
3094     importKey(format: string, keyData: JsonWebKey | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
3095     sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise<ArrayBuffer>;
3096     unwrapKey(format: "raw" | "pkcs8" | "spki" | "jwk" | string, wrappedKey: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
3097     verify(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, signature: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise<boolean>;
3098     wrapKey(format: "raw" | "pkcs8" | "spki" | "jwk" | string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams): Promise<ArrayBuffer>;
3099 }
3100
3101 declare var SubtleCrypto: {
3102     prototype: SubtleCrypto;
3103     new(): SubtleCrypto;
3104 };
3105
3106 /** A sync action that is dispatched on the ServiceWorkerGlobalScope of a ServiceWorker.  */
3107 interface SyncEvent extends ExtendableEvent {
3108     readonly lastChance: boolean;
3109     readonly tag: string;
3110 }
3111
3112 declare var SyncEvent: {
3113     prototype: SyncEvent;
3114     new(type: string, init: SyncEventInit): SyncEvent;
3115 };
3116
3117 /** This ServiceWorker API interface provides an interface for registering and listing sync registrations. */
3118 interface SyncManager {
3119     getTags(): Promise<string[]>;
3120     register(tag: string): Promise<void>;
3121 }
3122
3123 declare var SyncManager: {
3124     prototype: SyncManager;
3125     new(): SyncManager;
3126 };
3127
3128 /** A decoder for a specific method, that is a specific character encoding, like utf-8, iso-8859-2, koi8, cp1261, gbk, etc. A decoder takes a stream of bytes as input and emits a stream of code points. For a more scalable, non-native library, see StringView â€“ a C-like representation of strings based on typed arrays. */
3129 interface TextDecoder extends TextDecoderCommon {
3130     /**
3131      * Returns the result of running encoding's decoder. The method can be invoked zero or more times with options's stream set to true, and then once without options's stream (or set to false), to process a fragmented stream. If the invocation without options's stream (or set to false) has no input, it's clearest to omit both arguments.
3132      * 
3133      * ```
3134      * var string = "", decoder = new TextDecoder(encoding), buffer;
3135      * while(buffer = next_chunk()) {
3136      *   string += decoder.decode(buffer, {stream:true});
3137      * }
3138      * string += decoder.decode(); // end-of-stream
3139      * ```
3140      * 
3141      * If the error mode is "fatal" and encoding's decoder returns error, throws a TypeError.
3142      */
3143     decode(input?: BufferSource, options?: TextDecodeOptions): string;
3144 }
3145
3146 declare var TextDecoder: {
3147     prototype: TextDecoder;
3148     new(label?: string, options?: TextDecoderOptions): TextDecoder;
3149 };
3150
3151 interface TextDecoderCommon {
3152     /**
3153      * Returns encoding's name, lowercased.
3154      */
3155     readonly encoding: string;
3156     /**
3157      * Returns true if error mode is "fatal", and false otherwise.
3158      */
3159     readonly fatal: boolean;
3160     /**
3161      * Returns true if ignore BOM flag is set, and false otherwise.
3162      */
3163     readonly ignoreBOM: boolean;
3164 }
3165
3166 interface TextDecoderStream extends GenericTransformStream, TextDecoderCommon {
3167     readonly readable: ReadableStream<string>;
3168     readonly writable: WritableStream<BufferSource>;
3169 }
3170
3171 declare var TextDecoderStream: {
3172     prototype: TextDecoderStream;
3173     new(label?: string, options?: TextDecoderOptions): TextDecoderStream;
3174 };
3175
3176 /** TextEncoder takes a stream of code points as input and emits a stream of bytes. For a more scalable, non-native library, see StringView â€“ a C-like representation of strings based on typed arrays. */
3177 interface TextEncoder extends TextEncoderCommon {
3178     /**
3179      * Returns the result of running UTF-8's encoder.
3180      */
3181     encode(input?: string): Uint8Array;
3182     /**
3183      * Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as a dictionary whereby read is the number of converted code units of source and written is the number of bytes modified in destination.
3184      */
3185     encodeInto(source: string, destination: Uint8Array): TextEncoderEncodeIntoResult;
3186 }
3187
3188 declare var TextEncoder: {
3189     prototype: TextEncoder;
3190     new(): TextEncoder;
3191 };
3192
3193 interface TextEncoderCommon {
3194     /**
3195      * Returns "utf-8".
3196      */
3197     readonly encoding: string;
3198 }
3199
3200 interface TextEncoderStream extends GenericTransformStream, TextEncoderCommon {
3201     readonly readable: ReadableStream<Uint8Array>;
3202     readonly writable: WritableStream<string>;
3203 }
3204
3205 declare var TextEncoderStream: {
3206     prototype: TextEncoderStream;
3207     new(): TextEncoderStream;
3208 };
3209
3210 /** The dimensions of a piece of text in the canvas, as created by the CanvasRenderingContext2D.measureText() method. */
3211 interface TextMetrics {
3212     /**
3213      * Returns the measurement described below.
3214      */
3215     readonly actualBoundingBoxAscent: number;
3216     /**
3217      * Returns the measurement described below.
3218      */
3219     readonly actualBoundingBoxDescent: number;
3220     /**
3221      * Returns the measurement described below.
3222      */
3223     readonly actualBoundingBoxLeft: number;
3224     /**
3225      * Returns the measurement described below.
3226      */
3227     readonly actualBoundingBoxRight: number;
3228     /**
3229      * Returns the measurement described below.
3230      */
3231     readonly alphabeticBaseline: number;
3232     /**
3233      * Returns the measurement described below.
3234      */
3235     readonly emHeightAscent: number;
3236     /**
3237      * Returns the measurement described below.
3238      */
3239     readonly emHeightDescent: number;
3240     /**
3241      * Returns the measurement described below.
3242      */
3243     readonly fontBoundingBoxAscent: number;
3244     /**
3245      * Returns the measurement described below.
3246      */
3247     readonly fontBoundingBoxDescent: number;
3248     /**
3249      * Returns the measurement described below.
3250      */
3251     readonly hangingBaseline: number;
3252     /**
3253      * Returns the measurement described below.
3254      */
3255     readonly ideographicBaseline: number;
3256     /**
3257      * Returns the measurement described below.
3258      */
3259     readonly width: number;
3260 }
3261
3262 declare var TextMetrics: {
3263     prototype: TextMetrics;
3264     new(): TextMetrics;
3265 };
3266
3267 interface TransformStream<I = any, O = any> {
3268     readonly readable: ReadableStream<O>;
3269     readonly writable: WritableStream<I>;
3270 }
3271
3272 declare var TransformStream: {
3273     prototype: TransformStream;
3274     new<I = any, O = any>(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>): TransformStream<I, O>;
3275 };
3276
3277 interface TransformStreamDefaultController<O = any> {
3278     readonly desiredSize: number | null;
3279     enqueue(chunk: O): void;
3280     error(reason?: any): void;
3281     terminate(): void;
3282 }
3283
3284 declare var TransformStreamDefaultController: {
3285     prototype: TransformStreamDefaultController;
3286     new(): TransformStreamDefaultController;
3287 };
3288
3289 /** The URL interface represents an object providing static methods used for creating object URLs. */
3290 interface URL {
3291     hash: string;
3292     host: string;
3293     hostname: string;
3294     href: string;
3295     toString(): string;
3296     readonly origin: string;
3297     password: string;
3298     pathname: string;
3299     port: string;
3300     protocol: string;
3301     search: string;
3302     readonly searchParams: URLSearchParams;
3303     username: string;
3304     toJSON(): string;
3305 }
3306
3307 declare var URL: {
3308     prototype: URL;
3309     new(url: string, base?: string | URL): URL;
3310     createObjectURL(object: any): string;
3311     revokeObjectURL(url: string): void;
3312 };
3313
3314 interface URLSearchParams {
3315     /**
3316      * Appends a specified key/value pair as a new search parameter.
3317      */
3318     append(name: string, value: string): void;
3319     /**
3320      * Deletes the given search parameter, and its associated value, from the list of all search parameters.
3321      */
3322     delete(name: string): void;
3323     /**
3324      * Returns the first value associated to the given search parameter.
3325      */
3326     get(name: string): string | null;
3327     /**
3328      * Returns all the values association with a given search parameter.
3329      */
3330     getAll(name: string): string[];
3331     /**
3332      * Returns a Boolean indicating if such a search parameter exists.
3333      */
3334     has(name: string): boolean;
3335     /**
3336      * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
3337      */
3338     set(name: string, value: string): void;
3339     sort(): void;
3340     /**
3341      * Returns a string containing a query string suitable for use in a URL. Does not include the question mark.
3342      */
3343     toString(): string;
3344     forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void;
3345 }
3346
3347 declare var URLSearchParams: {
3348     prototype: URLSearchParams;
3349     new(init?: string[][] | Record<string, string> | string | URLSearchParams): URLSearchParams;
3350     toString(): string;
3351 };
3352
3353 interface WEBGL_color_buffer_float {
3354     readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: GLenum;
3355     readonly RGBA32F_EXT: GLenum;
3356     readonly UNSIGNED_NORMALIZED_EXT: GLenum;
3357 }
3358
3359 interface WEBGL_compressed_texture_astc {
3360     getSupportedProfiles(): string[];
3361     readonly COMPRESSED_RGBA_ASTC_10x10_KHR: GLenum;
3362     readonly COMPRESSED_RGBA_ASTC_10x5_KHR: GLenum;
3363     readonly COMPRESSED_RGBA_ASTC_10x6_KHR: GLenum;
3364     readonly COMPRESSED_RGBA_ASTC_10x8_KHR: GLenum;
3365     readonly COMPRESSED_RGBA_ASTC_12x10_KHR: GLenum;
3366     readonly COMPRESSED_RGBA_ASTC_12x12_KHR: GLenum;
3367     readonly COMPRESSED_RGBA_ASTC_4x4_KHR: GLenum;
3368     readonly COMPRESSED_RGBA_ASTC_5x4_KHR: GLenum;
3369     readonly COMPRESSED_RGBA_ASTC_5x5_KHR: GLenum;
3370     readonly COMPRESSED_RGBA_ASTC_6x5_KHR: GLenum;
3371     readonly COMPRESSED_RGBA_ASTC_6x6_KHR: GLenum;
3372     readonly COMPRESSED_RGBA_ASTC_8x5_KHR: GLenum;
3373     readonly COMPRESSED_RGBA_ASTC_8x6_KHR: GLenum;
3374     readonly COMPRESSED_RGBA_ASTC_8x8_KHR: GLenum;
3375     readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: GLenum;
3376     readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: GLenum;
3377     readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: GLenum;
3378     readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: GLenum;
3379     readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: GLenum;
3380     readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: GLenum;
3381     readonly COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: GLenum;
3382     readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: GLenum;
3383     readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: GLenum;
3384     readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: GLenum;
3385     readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: GLenum;
3386     readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: GLenum;
3387     readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: GLenum;
3388     readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: GLenum;
3389 }
3390
3391 /** The WEBGL_compressed_texture_s3tc extension is part of the WebGL API and exposes four S3TC compressed texture formats. */
3392 interface WEBGL_compressed_texture_s3tc {
3393     readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: GLenum;
3394     readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: GLenum;
3395     readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: GLenum;
3396     readonly COMPRESSED_RGB_S3TC_DXT1_EXT: GLenum;
3397 }
3398
3399 interface WEBGL_compressed_texture_s3tc_srgb {
3400     readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: GLenum;
3401     readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: GLenum;
3402     readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: GLenum;
3403     readonly COMPRESSED_SRGB_S3TC_DXT1_EXT: GLenum;
3404 }
3405
3406 /** The WEBGL_debug_renderer_info extension is part of the WebGL API and exposes two constants with information about the graphics driver for debugging purposes. */
3407 interface WEBGL_debug_renderer_info {
3408     readonly UNMASKED_RENDERER_WEBGL: GLenum;
3409     readonly UNMASKED_VENDOR_WEBGL: GLenum;
3410 }
3411
3412 interface WEBGL_debug_shaders {
3413     getTranslatedShaderSource(shader: WebGLShader): string;
3414 }
3415
3416 /** The WEBGL_depth_texture extension is part of the WebGL API and defines 2D depth and depth-stencil textures. */
3417 interface WEBGL_depth_texture {
3418     readonly UNSIGNED_INT_24_8_WEBGL: GLenum;
3419 }
3420
3421 interface WEBGL_draw_buffers {
3422     drawBuffersWEBGL(buffers: GLenum[]): void;
3423     readonly COLOR_ATTACHMENT0_WEBGL: GLenum;
3424     readonly COLOR_ATTACHMENT10_WEBGL: GLenum;
3425     readonly COLOR_ATTACHMENT11_WEBGL: GLenum;
3426     readonly COLOR_ATTACHMENT12_WEBGL: GLenum;
3427     readonly COLOR_ATTACHMENT13_WEBGL: GLenum;
3428     readonly COLOR_ATTACHMENT14_WEBGL: GLenum;
3429     readonly COLOR_ATTACHMENT15_WEBGL: GLenum;
3430     readonly COLOR_ATTACHMENT1_WEBGL: GLenum;
3431     readonly COLOR_ATTACHMENT2_WEBGL: GLenum;
3432     readonly COLOR_ATTACHMENT3_WEBGL: GLenum;
3433     readonly COLOR_ATTACHMENT4_WEBGL: GLenum;
3434     readonly COLOR_ATTACHMENT5_WEBGL: GLenum;
3435     readonly COLOR_ATTACHMENT6_WEBGL: GLenum;
3436     readonly COLOR_ATTACHMENT7_WEBGL: GLenum;
3437     readonly COLOR_ATTACHMENT8_WEBGL: GLenum;
3438     readonly COLOR_ATTACHMENT9_WEBGL: GLenum;
3439     readonly DRAW_BUFFER0_WEBGL: GLenum;
3440     readonly DRAW_BUFFER10_WEBGL: GLenum;
3441     readonly DRAW_BUFFER11_WEBGL: GLenum;
3442     readonly DRAW_BUFFER12_WEBGL: GLenum;
3443     readonly DRAW_BUFFER13_WEBGL: GLenum;
3444     readonly DRAW_BUFFER14_WEBGL: GLenum;
3445     readonly DRAW_BUFFER15_WEBGL: GLenum;
3446     readonly DRAW_BUFFER1_WEBGL: GLenum;
3447     readonly DRAW_BUFFER2_WEBGL: GLenum;
3448     readonly DRAW_BUFFER3_WEBGL: GLenum;
3449     readonly DRAW_BUFFER4_WEBGL: GLenum;
3450     readonly DRAW_BUFFER5_WEBGL: GLenum;
3451     readonly DRAW_BUFFER6_WEBGL: GLenum;
3452     readonly DRAW_BUFFER7_WEBGL: GLenum;
3453     readonly DRAW_BUFFER8_WEBGL: GLenum;
3454     readonly DRAW_BUFFER9_WEBGL: GLenum;
3455     readonly MAX_COLOR_ATTACHMENTS_WEBGL: GLenum;
3456     readonly MAX_DRAW_BUFFERS_WEBGL: GLenum;
3457 }
3458
3459 interface WEBGL_lose_context {
3460     loseContext(): void;
3461     restoreContext(): void;
3462 }
3463
3464 interface WebGL2RenderingContext extends WebGL2RenderingContextBase, WebGL2RenderingContextOverloads, WebGLRenderingContextBase {
3465 }
3466
3467 declare var WebGL2RenderingContext: {
3468     prototype: WebGL2RenderingContext;
3469     new(): WebGL2RenderingContext;
3470     readonly ACTIVE_ATTRIBUTES: GLenum;
3471     readonly ACTIVE_TEXTURE: GLenum;
3472     readonly ACTIVE_UNIFORMS: GLenum;
3473     readonly ALIASED_LINE_WIDTH_RANGE: GLenum;
3474     readonly ALIASED_POINT_SIZE_RANGE: GLenum;
3475     readonly ALPHA: GLenum;
3476     readonly ALPHA_BITS: GLenum;
3477     readonly ALWAYS: GLenum;
3478     readonly ARRAY_BUFFER: GLenum;
3479     readonly ARRAY_BUFFER_BINDING: GLenum;
3480     readonly ATTACHED_SHADERS: GLenum;
3481     readonly BACK: GLenum;
3482     readonly BLEND: GLenum;
3483     readonly BLEND_COLOR: GLenum;
3484     readonly BLEND_DST_ALPHA: GLenum;
3485     readonly BLEND_DST_RGB: GLenum;
3486     readonly BLEND_EQUATION: GLenum;
3487     readonly BLEND_EQUATION_ALPHA: GLenum;
3488     readonly BLEND_EQUATION_RGB: GLenum;
3489     readonly BLEND_SRC_ALPHA: GLenum;
3490     readonly BLEND_SRC_RGB: GLenum;
3491     readonly BLUE_BITS: GLenum;
3492     readonly BOOL: GLenum;
3493     readonly BOOL_VEC2: GLenum;
3494     readonly BOOL_VEC3: GLenum;
3495     readonly BOOL_VEC4: GLenum;
3496     readonly BROWSER_DEFAULT_WEBGL: GLenum;
3497     readonly BUFFER_SIZE: GLenum;
3498     readonly BUFFER_USAGE: GLenum;
3499     readonly BYTE: GLenum;
3500     readonly CCW: GLenum;
3501     readonly CLAMP_TO_EDGE: GLenum;
3502     readonly COLOR_ATTACHMENT0: GLenum;
3503     readonly COLOR_BUFFER_BIT: GLenum;
3504     readonly COLOR_CLEAR_VALUE: GLenum;
3505     readonly COLOR_WRITEMASK: GLenum;
3506     readonly COMPILE_STATUS: GLenum;
3507     readonly COMPRESSED_TEXTURE_FORMATS: GLenum;
3508     readonly CONSTANT_ALPHA: GLenum;
3509     readonly CONSTANT_COLOR: GLenum;
3510     readonly CONTEXT_LOST_WEBGL: GLenum;
3511     readonly CULL_FACE: GLenum;
3512     readonly CULL_FACE_MODE: GLenum;
3513     readonly CURRENT_PROGRAM: GLenum;
3514     readonly CURRENT_VERTEX_ATTRIB: GLenum;
3515     readonly CW: GLenum;
3516     readonly DECR: GLenum;
3517     readonly DECR_WRAP: GLenum;
3518     readonly DELETE_STATUS: GLenum;
3519     readonly DEPTH_ATTACHMENT: GLenum;
3520     readonly DEPTH_BITS: GLenum;
3521     readonly DEPTH_BUFFER_BIT: GLenum;
3522     readonly DEPTH_CLEAR_VALUE: GLenum;
3523     readonly DEPTH_COMPONENT: GLenum;
3524     readonly DEPTH_COMPONENT16: GLenum;
3525     readonly DEPTH_FUNC: GLenum;
3526     readonly DEPTH_RANGE: GLenum;
3527     readonly DEPTH_STENCIL: GLenum;
3528     readonly DEPTH_STENCIL_ATTACHMENT: GLenum;
3529     readonly DEPTH_TEST: GLenum;
3530     readonly DEPTH_WRITEMASK: GLenum;
3531     readonly DITHER: GLenum;
3532     readonly DONT_CARE: GLenum;
3533     readonly DST_ALPHA: GLenum;
3534     readonly DST_COLOR: GLenum;
3535     readonly DYNAMIC_DRAW: GLenum;
3536     readonly ELEMENT_ARRAY_BUFFER: GLenum;
3537     readonly ELEMENT_ARRAY_BUFFER_BINDING: GLenum;
3538     readonly EQUAL: GLenum;
3539     readonly FASTEST: GLenum;
3540     readonly FLOAT: GLenum;
3541     readonly FLOAT_MAT2: GLenum;
3542     readonly FLOAT_MAT3: GLenum;
3543     readonly FLOAT_MAT4: GLenum;
3544     readonly FLOAT_VEC2: GLenum;
3545     readonly FLOAT_VEC3: GLenum;
3546     readonly FLOAT_VEC4: GLenum;
3547     readonly FRAGMENT_SHADER: GLenum;
3548     readonly FRAMEBUFFER: GLenum;
3549     readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum;
3550     readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum;
3551     readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum;
3552     readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum;
3553     readonly FRAMEBUFFER_BINDING: GLenum;
3554     readonly FRAMEBUFFER_COMPLETE: GLenum;
3555     readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum;
3556     readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum;
3557     readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum;
3558     readonly FRAMEBUFFER_UNSUPPORTED: GLenum;
3559     readonly FRONT: GLenum;
3560     readonly FRONT_AND_BACK: GLenum;
3561     readonly FRONT_FACE: GLenum;
3562     readonly FUNC_ADD: GLenum;
3563     readonly FUNC_REVERSE_SUBTRACT: GLenum;
3564     readonly FUNC_SUBTRACT: GLenum;
3565     readonly GENERATE_MIPMAP_HINT: GLenum;
3566     readonly GEQUAL: GLenum;
3567     readonly GREATER: GLenum;
3568     readonly GREEN_BITS: GLenum;
3569     readonly HIGH_FLOAT: GLenum;
3570     readonly HIGH_INT: GLenum;
3571     readonly IMPLEMENTATION_COLOR_READ_FORMAT: GLenum;
3572     readonly IMPLEMENTATION_COLOR_READ_TYPE: GLenum;
3573     readonly INCR: GLenum;
3574     readonly INCR_WRAP: GLenum;
3575     readonly INT: GLenum;
3576     readonly INT_VEC2: GLenum;
3577     readonly INT_VEC3: GLenum;
3578     readonly INT_VEC4: GLenum;
3579     readonly INVALID_ENUM: GLenum;
3580     readonly INVALID_FRAMEBUFFER_OPERATION: GLenum;
3581     readonly INVALID_OPERATION: GLenum;
3582     readonly INVALID_VALUE: GLenum;
3583     readonly INVERT: GLenum;
3584     readonly KEEP: GLenum;
3585     readonly LEQUAL: GLenum;
3586     readonly LESS: GLenum;
3587     readonly LINEAR: GLenum;
3588     readonly LINEAR_MIPMAP_LINEAR: GLenum;
3589     readonly LINEAR_MIPMAP_NEAREST: GLenum;
3590     readonly LINES: GLenum;
3591     readonly LINE_LOOP: GLenum;
3592     readonly LINE_STRIP: GLenum;
3593     readonly LINE_WIDTH: GLenum;
3594     readonly LINK_STATUS: GLenum;
3595     readonly LOW_FLOAT: GLenum;
3596     readonly LOW_INT: GLenum;
3597     readonly LUMINANCE: GLenum;
3598     readonly LUMINANCE_ALPHA: GLenum;
3599     readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum;
3600     readonly MAX_CUBE_MAP_TEXTURE_SIZE: GLenum;
3601     readonly MAX_FRAGMENT_UNIFORM_VECTORS: GLenum;
3602     readonly MAX_RENDERBUFFER_SIZE: GLenum;
3603     readonly MAX_TEXTURE_IMAGE_UNITS: GLenum;
3604     readonly MAX_TEXTURE_SIZE: GLenum;
3605     readonly MAX_VARYING_VECTORS: GLenum;
3606     readonly MAX_VERTEX_ATTRIBS: GLenum;
3607     readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum;
3608     readonly MAX_VERTEX_UNIFORM_VECTORS: GLenum;
3609     readonly MAX_VIEWPORT_DIMS: GLenum;
3610     readonly MEDIUM_FLOAT: GLenum;
3611     readonly MEDIUM_INT: GLenum;
3612     readonly MIRRORED_REPEAT: GLenum;
3613     readonly NEAREST: GLenum;
3614     readonly NEAREST_MIPMAP_LINEAR: GLenum;
3615     readonly NEAREST_MIPMAP_NEAREST: GLenum;
3616     readonly NEVER: GLenum;
3617     readonly NICEST: GLenum;
3618     readonly NONE: GLenum;
3619     readonly NOTEQUAL: GLenum;
3620     readonly NO_ERROR: GLenum;
3621     readonly ONE: GLenum;
3622     readonly ONE_MINUS_CONSTANT_ALPHA: GLenum;
3623     readonly ONE_MINUS_CONSTANT_COLOR: GLenum;
3624     readonly ONE_MINUS_DST_ALPHA: GLenum;
3625     readonly ONE_MINUS_DST_COLOR: GLenum;
3626     readonly ONE_MINUS_SRC_ALPHA: GLenum;
3627     readonly ONE_MINUS_SRC_COLOR: GLenum;
3628     readonly OUT_OF_MEMORY: GLenum;
3629     readonly PACK_ALIGNMENT: GLenum;
3630     readonly POINTS: GLenum;
3631     readonly POLYGON_OFFSET_FACTOR: GLenum;
3632     readonly POLYGON_OFFSET_FILL: GLenum;
3633     readonly POLYGON_OFFSET_UNITS: GLenum;
3634     readonly RED_BITS: GLenum;
3635     readonly RENDERBUFFER: GLenum;
3636     readonly RENDERBUFFER_ALPHA_SIZE: GLenum;
3637     readonly RENDERBUFFER_BINDING: GLenum;
3638     readonly RENDERBUFFER_BLUE_SIZE: GLenum;
3639     readonly RENDERBUFFER_DEPTH_SIZE: GLenum;
3640     readonly RENDERBUFFER_GREEN_SIZE: GLenum;
3641     readonly RENDERBUFFER_HEIGHT: GLenum;
3642     readonly RENDERBUFFER_INTERNAL_FORMAT: GLenum;
3643     readonly RENDERBUFFER_RED_SIZE: GLenum;
3644     readonly RENDERBUFFER_STENCIL_SIZE: GLenum;
3645     readonly RENDERBUFFER_WIDTH: GLenum;
3646     readonly RENDERER: GLenum;
3647     readonly REPEAT: GLenum;
3648     readonly REPLACE: GLenum;
3649     readonly RGB: GLenum;
3650     readonly RGB565: GLenum;
3651     readonly RGB5_A1: GLenum;
3652     readonly RGBA: GLenum;
3653     readonly RGBA4: GLenum;
3654     readonly SAMPLER_2D: GLenum;
3655     readonly SAMPLER_CUBE: GLenum;
3656     readonly SAMPLES: GLenum;
3657     readonly SAMPLE_ALPHA_TO_COVERAGE: GLenum;
3658     readonly SAMPLE_BUFFERS: GLenum;
3659     readonly SAMPLE_COVERAGE: GLenum;
3660     readonly SAMPLE_COVERAGE_INVERT: GLenum;
3661     readonly SAMPLE_COVERAGE_VALUE: GLenum;
3662     readonly SCISSOR_BOX: GLenum;
3663     readonly SCISSOR_TEST: GLenum;
3664     readonly SHADER_TYPE: GLenum;
3665     readonly SHADING_LANGUAGE_VERSION: GLenum;
3666     readonly SHORT: GLenum;
3667     readonly SRC_ALPHA: GLenum;
3668     readonly SRC_ALPHA_SATURATE: GLenum;
3669     readonly SRC_COLOR: GLenum;
3670     readonly STATIC_DRAW: GLenum;
3671     readonly STENCIL_ATTACHMENT: GLenum;
3672     readonly STENCIL_BACK_FAIL: GLenum;
3673     readonly STENCIL_BACK_FUNC: GLenum;
3674     readonly STENCIL_BACK_PASS_DEPTH_FAIL: GLenum;
3675     readonly STENCIL_BACK_PASS_DEPTH_PASS: GLenum;
3676     readonly STENCIL_BACK_REF: GLenum;
3677     readonly STENCIL_BACK_VALUE_MASK: GLenum;
3678     readonly STENCIL_BACK_WRITEMASK: GLenum;
3679     readonly STENCIL_BITS: GLenum;
3680     readonly STENCIL_BUFFER_BIT: GLenum;
3681     readonly STENCIL_CLEAR_VALUE: GLenum;
3682     readonly STENCIL_FAIL: GLenum;
3683     readonly STENCIL_FUNC: GLenum;
3684     readonly STENCIL_INDEX8: GLenum;
3685     readonly STENCIL_PASS_DEPTH_FAIL: GLenum;
3686     readonly STENCIL_PASS_DEPTH_PASS: GLenum;
3687     readonly STENCIL_REF: GLenum;
3688     readonly STENCIL_TEST: GLenum;
3689     readonly STENCIL_VALUE_MASK: GLenum;
3690     readonly STENCIL_WRITEMASK: GLenum;
3691     readonly STREAM_DRAW: GLenum;
3692     readonly SUBPIXEL_BITS: GLenum;
3693     readonly TEXTURE: GLenum;
3694     readonly TEXTURE0: GLenum;
3695     readonly TEXTURE1: GLenum;
3696     readonly TEXTURE10: GLenum;
3697     readonly TEXTURE11: GLenum;
3698     readonly TEXTURE12: GLenum;
3699     readonly TEXTURE13: GLenum;
3700     readonly TEXTURE14: GLenum;
3701     readonly TEXTURE15: GLenum;
3702     readonly TEXTURE16: GLenum;
3703     readonly TEXTURE17: GLenum;
3704     readonly TEXTURE18: GLenum;
3705     readonly TEXTURE19: GLenum;
3706     readonly TEXTURE2: GLenum;
3707     readonly TEXTURE20: GLenum;
3708     readonly TEXTURE21: GLenum;
3709     readonly TEXTURE22: GLenum;
3710     readonly TEXTURE23: GLenum;
3711     readonly TEXTURE24: GLenum;
3712     readonly TEXTURE25: GLenum;
3713     readonly TEXTURE26: GLenum;
3714     readonly TEXTURE27: GLenum;
3715     readonly TEXTURE28: GLenum;
3716     readonly TEXTURE29: GLenum;
3717     readonly TEXTURE3: GLenum;
3718     readonly TEXTURE30: GLenum;
3719     readonly TEXTURE31: GLenum;
3720     readonly TEXTURE4: GLenum;
3721     readonly TEXTURE5: GLenum;
3722     readonly TEXTURE6: GLenum;
3723     readonly TEXTURE7: GLenum;
3724     readonly TEXTURE8: GLenum;
3725     readonly TEXTURE9: GLenum;
3726     readonly TEXTURE_2D: GLenum;
3727     readonly TEXTURE_BINDING_2D: GLenum;
3728     readonly TEXTURE_BINDING_CUBE_MAP: GLenum;
3729     readonly TEXTURE_CUBE_MAP: GLenum;
3730     readonly TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum;
3731     readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum;
3732     readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum;
3733     readonly TEXTURE_CUBE_MAP_POSITIVE_X: GLenum;
3734     readonly TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum;
3735     readonly TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum;
3736     readonly TEXTURE_MAG_FILTER: GLenum;
3737     readonly TEXTURE_MIN_FILTER: GLenum;
3738     readonly TEXTURE_WRAP_S: GLenum;
3739     readonly TEXTURE_WRAP_T: GLenum;
3740     readonly TRIANGLES: GLenum;
3741     readonly TRIANGLE_FAN: GLenum;
3742     readonly TRIANGLE_STRIP: GLenum;
3743     readonly UNPACK_ALIGNMENT: GLenum;
3744     readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum;
3745     readonly UNPACK_FLIP_Y_WEBGL: GLenum;
3746     readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum;
3747     readonly UNSIGNED_BYTE: GLenum;
3748     readonly UNSIGNED_INT: GLenum;
3749     readonly UNSIGNED_SHORT: GLenum;
3750     readonly UNSIGNED_SHORT_4_4_4_4: GLenum;
3751     readonly UNSIGNED_SHORT_5_5_5_1: GLenum;
3752     readonly UNSIGNED_SHORT_5_6_5: GLenum;
3753     readonly VALIDATE_STATUS: GLenum;
3754     readonly VENDOR: GLenum;
3755     readonly VERSION: GLenum;
3756     readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum;
3757     readonly VERTEX_ATTRIB_ARRAY_ENABLED: GLenum;
3758     readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum;
3759     readonly VERTEX_ATTRIB_ARRAY_POINTER: GLenum;
3760     readonly VERTEX_ATTRIB_ARRAY_SIZE: GLenum;
3761     readonly VERTEX_ATTRIB_ARRAY_STRIDE: GLenum;
3762     readonly VERTEX_ATTRIB_ARRAY_TYPE: GLenum;
3763     readonly VERTEX_SHADER: GLenum;
3764     readonly VIEWPORT: GLenum;
3765     readonly ZERO: GLenum;
3766     readonly ACTIVE_UNIFORM_BLOCKS: GLenum;
3767     readonly ALREADY_SIGNALED: GLenum;
3768     readonly ANY_SAMPLES_PASSED: GLenum;
3769     readonly ANY_SAMPLES_PASSED_CONSERVATIVE: GLenum;
3770     readonly COLOR: GLenum;
3771     readonly COLOR_ATTACHMENT1: GLenum;
3772     readonly COLOR_ATTACHMENT10: GLenum;
3773     readonly COLOR_ATTACHMENT11: GLenum;
3774     readonly COLOR_ATTACHMENT12: GLenum;
3775     readonly COLOR_ATTACHMENT13: GLenum;
3776     readonly COLOR_ATTACHMENT14: GLenum;
3777     readonly COLOR_ATTACHMENT15: GLenum;
3778     readonly COLOR_ATTACHMENT2: GLenum;
3779     readonly COLOR_ATTACHMENT3: GLenum;
3780     readonly COLOR_ATTACHMENT4: GLenum;
3781     readonly COLOR_ATTACHMENT5: GLenum;
3782     readonly COLOR_ATTACHMENT6: GLenum;
3783     readonly COLOR_ATTACHMENT7: GLenum;
3784     readonly COLOR_ATTACHMENT8: GLenum;
3785     readonly COLOR_ATTACHMENT9: GLenum;
3786     readonly COMPARE_REF_TO_TEXTURE: GLenum;
3787     readonly CONDITION_SATISFIED: GLenum;
3788     readonly COPY_READ_BUFFER: GLenum;
3789     readonly COPY_READ_BUFFER_BINDING: GLenum;
3790     readonly COPY_WRITE_BUFFER: GLenum;
3791     readonly COPY_WRITE_BUFFER_BINDING: GLenum;
3792     readonly CURRENT_QUERY: GLenum;
3793     readonly DEPTH: GLenum;
3794     readonly DEPTH24_STENCIL8: GLenum;
3795     readonly DEPTH32F_STENCIL8: GLenum;
3796     readonly DEPTH_COMPONENT24: GLenum;
3797     readonly DEPTH_COMPONENT32F: GLenum;
3798     readonly DRAW_BUFFER0: GLenum;
3799     readonly DRAW_BUFFER1: GLenum;
3800     readonly DRAW_BUFFER10: GLenum;
3801     readonly DRAW_BUFFER11: GLenum;
3802     readonly DRAW_BUFFER12: GLenum;
3803     readonly DRAW_BUFFER13: GLenum;
3804     readonly DRAW_BUFFER14: GLenum;
3805     readonly DRAW_BUFFER15: GLenum;
3806     readonly DRAW_BUFFER2: GLenum;
3807     readonly DRAW_BUFFER3: GLenum;
3808     readonly DRAW_BUFFER4: GLenum;
3809     readonly DRAW_BUFFER5: GLenum;
3810     readonly DRAW_BUFFER6: GLenum;
3811     readonly DRAW_BUFFER7: GLenum;
3812     readonly DRAW_BUFFER8: GLenum;
3813     readonly DRAW_BUFFER9: GLenum;
3814     readonly DRAW_FRAMEBUFFER: GLenum;
3815     readonly DRAW_FRAMEBUFFER_BINDING: GLenum;
3816     readonly DYNAMIC_COPY: GLenum;
3817     readonly DYNAMIC_READ: GLenum;
3818     readonly FLOAT_32_UNSIGNED_INT_24_8_REV: GLenum;
3819     readonly FLOAT_MAT2x3: GLenum;
3820     readonly FLOAT_MAT2x4: GLenum;
3821     readonly FLOAT_MAT3x2: GLenum;
3822     readonly FLOAT_MAT3x4: GLenum;
3823     readonly FLOAT_MAT4x2: GLenum;
3824     readonly FLOAT_MAT4x3: GLenum;
3825     readonly FRAGMENT_SHADER_DERIVATIVE_HINT: GLenum;
3826     readonly FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: GLenum;
3827     readonly FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: GLenum;
3828     readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: GLenum;
3829     readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: GLenum;
3830     readonly FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: GLenum;
3831     readonly FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: GLenum;
3832     readonly FRAMEBUFFER_ATTACHMENT_RED_SIZE: GLenum;
3833     readonly FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: GLenum;
3834     readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: GLenum;
3835     readonly FRAMEBUFFER_DEFAULT: GLenum;
3836     readonly FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: GLenum;
3837     readonly HALF_FLOAT: GLenum;
3838     readonly INTERLEAVED_ATTRIBS: GLenum;
3839     readonly INT_2_10_10_10_REV: GLenum;
3840     readonly INT_SAMPLER_2D: GLenum;
3841     readonly INT_SAMPLER_2D_ARRAY: GLenum;
3842     readonly INT_SAMPLER_3D: GLenum;
3843     readonly INT_SAMPLER_CUBE: GLenum;
3844     readonly INVALID_INDEX: GLenum;
3845     readonly MAX: GLenum;
3846     readonly MAX_3D_TEXTURE_SIZE: GLenum;
3847     readonly MAX_ARRAY_TEXTURE_LAYERS: GLenum;
3848     readonly MAX_CLIENT_WAIT_TIMEOUT_WEBGL: GLenum;
3849     readonly MAX_COLOR_ATTACHMENTS: GLenum;
3850     readonly MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: GLenum;
3851     readonly MAX_COMBINED_UNIFORM_BLOCKS: GLenum;
3852     readonly MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: GLenum;
3853     readonly MAX_DRAW_BUFFERS: GLenum;
3854     readonly MAX_ELEMENTS_INDICES: GLenum;
3855     readonly MAX_ELEMENTS_VERTICES: GLenum;
3856     readonly MAX_ELEMENT_INDEX: GLenum;
3857     readonly MAX_FRAGMENT_INPUT_COMPONENTS: GLenum;
3858     readonly MAX_FRAGMENT_UNIFORM_BLOCKS: GLenum;
3859     readonly MAX_FRAGMENT_UNIFORM_COMPONENTS: GLenum;
3860     readonly MAX_PROGRAM_TEXEL_OFFSET: GLenum;
3861     readonly MAX_SAMPLES: GLenum;
3862     readonly MAX_SERVER_WAIT_TIMEOUT: GLenum;
3863     readonly MAX_TEXTURE_LOD_BIAS: GLenum;
3864     readonly MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: GLenum;
3865     readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: GLenum;
3866     readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: GLenum;
3867     readonly MAX_UNIFORM_BLOCK_SIZE: GLenum;
3868     readonly MAX_UNIFORM_BUFFER_BINDINGS: GLenum;
3869     readonly MAX_VARYING_COMPONENTS: GLenum;
3870     readonly MAX_VERTEX_OUTPUT_COMPONENTS: GLenum;
3871     readonly MAX_VERTEX_UNIFORM_BLOCKS: GLenum;
3872     readonly MAX_VERTEX_UNIFORM_COMPONENTS: GLenum;
3873     readonly MIN: GLenum;
3874     readonly MIN_PROGRAM_TEXEL_OFFSET: GLenum;
3875     readonly OBJECT_TYPE: GLenum;
3876     readonly PACK_ROW_LENGTH: GLenum;
3877     readonly PACK_SKIP_PIXELS: GLenum;
3878     readonly PACK_SKIP_ROWS: GLenum;
3879     readonly PIXEL_PACK_BUFFER: GLenum;
3880     readonly PIXEL_PACK_BUFFER_BINDING: GLenum;
3881     readonly PIXEL_UNPACK_BUFFER: GLenum;
3882     readonly PIXEL_UNPACK_BUFFER_BINDING: GLenum;
3883     readonly QUERY_RESULT: GLenum;
3884     readonly QUERY_RESULT_AVAILABLE: GLenum;
3885     readonly R11F_G11F_B10F: GLenum;
3886     readonly R16F: GLenum;
3887     readonly R16I: GLenum;
3888     readonly R16UI: GLenum;
3889     readonly R32F: GLenum;
3890     readonly R32I: GLenum;
3891     readonly R32UI: GLenum;
3892     readonly R8: GLenum;
3893     readonly R8I: GLenum;
3894     readonly R8UI: GLenum;
3895     readonly R8_SNORM: GLenum;
3896     readonly RASTERIZER_DISCARD: GLenum;
3897     readonly READ_BUFFER: GLenum;
3898     readonly READ_FRAMEBUFFER: GLenum;
3899     readonly READ_FRAMEBUFFER_BINDING: GLenum;
3900     readonly RED: GLenum;
3901     readonly RED_INTEGER: GLenum;
3902     readonly RENDERBUFFER_SAMPLES: GLenum;
3903     readonly RG: GLenum;
3904     readonly RG16F: GLenum;
3905     readonly RG16I: GLenum;
3906     readonly RG16UI: GLenum;
3907     readonly RG32F: GLenum;
3908     readonly RG32I: GLenum;
3909     readonly RG32UI: GLenum;
3910     readonly RG8: GLenum;
3911     readonly RG8I: GLenum;
3912     readonly RG8UI: GLenum;
3913     readonly RG8_SNORM: GLenum;
3914     readonly RGB10_A2: GLenum;
3915     readonly RGB10_A2UI: GLenum;
3916     readonly RGB16F: GLenum;
3917     readonly RGB16I: GLenum;
3918     readonly RGB16UI: GLenum;
3919     readonly RGB32F: GLenum;
3920     readonly RGB32I: GLenum;
3921     readonly RGB32UI: GLenum;
3922     readonly RGB8: GLenum;
3923     readonly RGB8I: GLenum;
3924     readonly RGB8UI: GLenum;
3925     readonly RGB8_SNORM: GLenum;
3926     readonly RGB9_E5: GLenum;
3927     readonly RGBA16F: GLenum;
3928     readonly RGBA16I: GLenum;
3929     readonly RGBA16UI: GLenum;
3930     readonly RGBA32F: GLenum;
3931     readonly RGBA32I: GLenum;
3932     readonly RGBA32UI: GLenum;
3933     readonly RGBA8: GLenum;
3934     readonly RGBA8I: GLenum;
3935     readonly RGBA8UI: GLenum;
3936     readonly RGBA8_SNORM: GLenum;
3937     readonly RGBA_INTEGER: GLenum;
3938     readonly RGB_INTEGER: GLenum;
3939     readonly RG_INTEGER: GLenum;
3940     readonly SAMPLER_2D_ARRAY: GLenum;
3941     readonly SAMPLER_2D_ARRAY_SHADOW: GLenum;
3942     readonly SAMPLER_2D_SHADOW: GLenum;
3943     readonly SAMPLER_3D: GLenum;
3944     readonly SAMPLER_BINDING: GLenum;
3945     readonly SAMPLER_CUBE_SHADOW: GLenum;
3946     readonly SEPARATE_ATTRIBS: GLenum;
3947     readonly SIGNALED: GLenum;
3948     readonly SIGNED_NORMALIZED: GLenum;
3949     readonly SRGB: GLenum;
3950     readonly SRGB8: GLenum;
3951     readonly SRGB8_ALPHA8: GLenum;
3952     readonly STATIC_COPY: GLenum;
3953     readonly STATIC_READ: GLenum;
3954     readonly STENCIL: GLenum;
3955     readonly STREAM_COPY: GLenum;
3956     readonly STREAM_READ: GLenum;
3957     readonly SYNC_CONDITION: GLenum;
3958     readonly SYNC_FENCE: GLenum;
3959     readonly SYNC_FLAGS: GLenum;
3960     readonly SYNC_FLUSH_COMMANDS_BIT: GLenum;
3961     readonly SYNC_GPU_COMMANDS_COMPLETE: GLenum;
3962     readonly SYNC_STATUS: GLenum;
3963     readonly TEXTURE_2D_ARRAY: GLenum;
3964     readonly TEXTURE_3D: GLenum;
3965     readonly TEXTURE_BASE_LEVEL: GLenum;
3966     readonly TEXTURE_BINDING_2D_ARRAY: GLenum;
3967     readonly TEXTURE_BINDING_3D: GLenum;
3968     readonly TEXTURE_COMPARE_FUNC: GLenum;
3969     readonly TEXTURE_COMPARE_MODE: GLenum;
3970     readonly TEXTURE_IMMUTABLE_FORMAT: GLenum;
3971     readonly TEXTURE_IMMUTABLE_LEVELS: GLenum;
3972     readonly TEXTURE_MAX_LEVEL: GLenum;
3973     readonly TEXTURE_MAX_LOD: GLenum;
3974     readonly TEXTURE_MIN_LOD: GLenum;
3975     readonly TEXTURE_WRAP_R: GLenum;
3976     readonly TIMEOUT_EXPIRED: GLenum;
3977     readonly TIMEOUT_IGNORED: GLint64;
3978     readonly TRANSFORM_FEEDBACK: GLenum;
3979     readonly TRANSFORM_FEEDBACK_ACTIVE: GLenum;
3980     readonly TRANSFORM_FEEDBACK_BINDING: GLenum;
3981     readonly TRANSFORM_FEEDBACK_BUFFER: GLenum;
3982     readonly TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum;
3983     readonly TRANSFORM_FEEDBACK_BUFFER_MODE: GLenum;
3984     readonly TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum;
3985     readonly TRANSFORM_FEEDBACK_BUFFER_START: GLenum;
3986     readonly TRANSFORM_FEEDBACK_PAUSED: GLenum;
3987     readonly TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: GLenum;
3988     readonly TRANSFORM_FEEDBACK_VARYINGS: GLenum;
3989     readonly UNIFORM_ARRAY_STRIDE: GLenum;
3990     readonly UNIFORM_BLOCK_ACTIVE_UNIFORMS: GLenum;
3991     readonly UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: GLenum;
3992     readonly UNIFORM_BLOCK_BINDING: GLenum;
3993     readonly UNIFORM_BLOCK_DATA_SIZE: GLenum;
3994     readonly UNIFORM_BLOCK_INDEX: GLenum;
3995     readonly UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: GLenum;
3996     readonly UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: GLenum;
3997     readonly UNIFORM_BUFFER: GLenum;
3998     readonly UNIFORM_BUFFER_BINDING: GLenum;
3999     readonly UNIFORM_BUFFER_OFFSET_ALIGNMENT: GLenum;
4000     readonly UNIFORM_BUFFER_SIZE: GLenum;
4001     readonly UNIFORM_BUFFER_START: GLenum;
4002     readonly UNIFORM_IS_ROW_MAJOR: GLenum;
4003     readonly UNIFORM_MATRIX_STRIDE: GLenum;
4004     readonly UNIFORM_OFFSET: GLenum;
4005     readonly UNIFORM_SIZE: GLenum;
4006     readonly UNIFORM_TYPE: GLenum;
4007     readonly UNPACK_IMAGE_HEIGHT: GLenum;
4008     readonly UNPACK_ROW_LENGTH: GLenum;
4009     readonly UNPACK_SKIP_IMAGES: GLenum;
4010     readonly UNPACK_SKIP_PIXELS: GLenum;
4011     readonly UNPACK_SKIP_ROWS: GLenum;
4012     readonly UNSIGNALED: GLenum;
4013     readonly UNSIGNED_INT_10F_11F_11F_REV: GLenum;
4014     readonly UNSIGNED_INT_24_8: GLenum;
4015     readonly UNSIGNED_INT_2_10_10_10_REV: GLenum;
4016     readonly UNSIGNED_INT_5_9_9_9_REV: GLenum;
4017     readonly UNSIGNED_INT_SAMPLER_2D: GLenum;
4018     readonly UNSIGNED_INT_SAMPLER_2D_ARRAY: GLenum;
4019     readonly UNSIGNED_INT_SAMPLER_3D: GLenum;
4020     readonly UNSIGNED_INT_SAMPLER_CUBE: GLenum;
4021     readonly UNSIGNED_INT_VEC2: GLenum;
4022     readonly UNSIGNED_INT_VEC3: GLenum;
4023     readonly UNSIGNED_INT_VEC4: GLenum;
4024     readonly UNSIGNED_NORMALIZED: GLenum;
4025     readonly VERTEX_ARRAY_BINDING: GLenum;
4026     readonly VERTEX_ATTRIB_ARRAY_DIVISOR: GLenum;
4027     readonly VERTEX_ATTRIB_ARRAY_INTEGER: GLenum;
4028     readonly WAIT_FAILED: GLenum;
4029 };
4030
4031 interface WebGL2RenderingContextBase {
4032     beginQuery(target: GLenum, query: WebGLQuery): void;
4033     beginTransformFeedback(primitiveMode: GLenum): void;
4034     bindBufferBase(target: GLenum, index: GLuint, buffer: WebGLBuffer | null): void;
4035     bindBufferRange(target: GLenum, index: GLuint, buffer: WebGLBuffer | null, offset: GLintptr, size: GLsizeiptr): void;
4036     bindSampler(unit: GLuint, sampler: WebGLSampler | null): void;
4037     bindTransformFeedback(target: GLenum, tf: WebGLTransformFeedback | null): void;
4038     bindVertexArray(array: WebGLVertexArrayObject | null): void;
4039     blitFramebuffer(srcX0: GLint, srcY0: GLint, srcX1: GLint, srcY1: GLint, dstX0: GLint, dstY0: GLint, dstX1: GLint, dstY1: GLint, mask: GLbitfield, filter: GLenum): void;
4040     clearBufferfi(buffer: GLenum, drawbuffer: GLint, depth: GLfloat, stencil: GLint): void;
4041     clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Float32List, srcOffset?: GLuint): void;
4042     clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Int32List, srcOffset?: GLuint): void;
4043     clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Uint32List, srcOffset?: GLuint): void;
4044     clientWaitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLuint64): GLenum;
4045     compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr): void;
4046     compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset?: GLuint, srcLengthOverride?: GLuint): void;
4047     compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr): void;
4048     compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset?: GLuint, srcLengthOverride?: GLuint): void;
4049     copyBufferSubData(readTarget: GLenum, writeTarget: GLenum, readOffset: GLintptr, writeOffset: GLintptr, size: GLsizeiptr): void;
4050     copyTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
4051     createQuery(): WebGLQuery | null;
4052     createSampler(): WebGLSampler | null;
4053     createTransformFeedback(): WebGLTransformFeedback | null;
4054     createVertexArray(): WebGLVertexArrayObject | null;
4055     deleteQuery(query: WebGLQuery | null): void;
4056     deleteSampler(sampler: WebGLSampler | null): void;
4057     deleteSync(sync: WebGLSync | null): void;
4058     deleteTransformFeedback(tf: WebGLTransformFeedback | null): void;
4059     deleteVertexArray(vertexArray: WebGLVertexArrayObject | null): void;
4060     drawArraysInstanced(mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei): void;
4061     drawBuffers(buffers: GLenum[]): void;
4062     drawElementsInstanced(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei): void;
4063     drawRangeElements(mode: GLenum, start: GLuint, end: GLuint, count: GLsizei, type: GLenum, offset: GLintptr): void;
4064     endQuery(target: GLenum): void;
4065     endTransformFeedback(): void;
4066     fenceSync(condition: GLenum, flags: GLbitfield): WebGLSync | null;
4067     framebufferTextureLayer(target: GLenum, attachment: GLenum, texture: WebGLTexture | null, level: GLint, layer: GLint): void;
4068     getActiveUniformBlockName(program: WebGLProgram, uniformBlockIndex: GLuint): string | null;
4069     getActiveUniformBlockParameter(program: WebGLProgram, uniformBlockIndex: GLuint, pname: GLenum): any;
4070     getActiveUniforms(program: WebGLProgram, uniformIndices: GLuint[], pname: GLenum): any;
4071     getBufferSubData(target: GLenum, srcByteOffset: GLintptr, dstBuffer: ArrayBufferView, dstOffset?: GLuint, length?: GLuint): void;
4072     getFragDataLocation(program: WebGLProgram, name: string): GLint;
4073     getIndexedParameter(target: GLenum, index: GLuint): any;
4074     getInternalformatParameter(target: GLenum, internalformat: GLenum, pname: GLenum): any;
4075     getQuery(target: GLenum, pname: GLenum): WebGLQuery | null;
4076     getQueryParameter(query: WebGLQuery, pname: GLenum): any;
4077     getSamplerParameter(sampler: WebGLSampler, pname: GLenum): any;
4078     getSyncParameter(sync: WebGLSync, pname: GLenum): any;
4079     getTransformFeedbackVarying(program: WebGLProgram, index: GLuint): WebGLActiveInfo | null;
4080     getUniformBlockIndex(program: WebGLProgram, uniformBlockName: string): GLuint;
4081     getUniformIndices(program: WebGLProgram, uniformNames: string[]): GLuint[] | null;
4082     invalidateFramebuffer(target: GLenum, attachments: GLenum[]): void;
4083     invalidateSubFramebuffer(target: GLenum, attachments: GLenum[], x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
4084     isQuery(query: WebGLQuery | null): GLboolean;
4085     isSampler(sampler: WebGLSampler | null): GLboolean;
4086     isSync(sync: WebGLSync | null): GLboolean;
4087     isTransformFeedback(tf: WebGLTransformFeedback | null): GLboolean;
4088     isVertexArray(vertexArray: WebGLVertexArrayObject | null): GLboolean;
4089     pauseTransformFeedback(): void;
4090     readBuffer(src: GLenum): void;
4091     renderbufferStorageMultisample(target: GLenum, samples: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei): void;
4092     resumeTransformFeedback(): void;
4093     samplerParameterf(sampler: WebGLSampler, pname: GLenum, param: GLfloat): void;
4094     samplerParameteri(sampler: WebGLSampler, pname: GLenum, param: GLint): void;
4095     texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr): void;
4096     texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, source: TexImageSource): void;
4097     texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView | null): void;
4098     texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint): void;
4099     texStorage2D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei): void;
4100     texStorage3D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei): void;
4101     texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr): void;
4102     texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, source: TexImageSource): void;
4103     texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView | null, srcOffset?: GLuint): void;
4104     transformFeedbackVaryings(program: WebGLProgram, varyings: string[], bufferMode: GLenum): void;
4105     uniform1ui(location: WebGLUniformLocation | null, v0: GLuint): void;
4106     uniform1uiv(location: WebGLUniformLocation | null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint): void;
4107     uniform2ui(location: WebGLUniformLocation | null, v0: GLuint, v1: GLuint): void;
4108     uniform2uiv(location: WebGLUniformLocation | null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint): void;
4109     uniform3ui(location: WebGLUniformLocation | null, v0: GLuint, v1: GLuint, v2: GLuint): void;
4110     uniform3uiv(location: WebGLUniformLocation | null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint): void;
4111     uniform4ui(location: WebGLUniformLocation | null, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint): void;
4112     uniform4uiv(location: WebGLUniformLocation | null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint): void;
4113     uniformBlockBinding(program: WebGLProgram, uniformBlockIndex: GLuint, uniformBlockBinding: GLuint): void;
4114     uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;
4115     uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;
4116     uniformMatrix3x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;
4117     uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;
4118     uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;
4119     uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;
4120     vertexAttribDivisor(index: GLuint, divisor: GLuint): void;
4121     vertexAttribI4i(index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint): void;
4122     vertexAttribI4iv(index: GLuint, values: Int32List): void;
4123     vertexAttribI4ui(index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint): void;
4124     vertexAttribI4uiv(index: GLuint, values: Uint32List): void;
4125     vertexAttribIPointer(index: GLuint, size: GLint, type: GLenum, stride: GLsizei, offset: GLintptr): void;
4126     waitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLint64): void;
4127     readonly ACTIVE_UNIFORM_BLOCKS: GLenum;
4128     readonly ALREADY_SIGNALED: GLenum;
4129     readonly ANY_SAMPLES_PASSED: GLenum;
4130     readonly ANY_SAMPLES_PASSED_CONSERVATIVE: GLenum;
4131     readonly COLOR: GLenum;
4132     readonly COLOR_ATTACHMENT1: GLenum;
4133     readonly COLOR_ATTACHMENT10: GLenum;
4134     readonly COLOR_ATTACHMENT11: GLenum;
4135     readonly COLOR_ATTACHMENT12: GLenum;
4136     readonly COLOR_ATTACHMENT13: GLenum;
4137     readonly COLOR_ATTACHMENT14: GLenum;
4138     readonly COLOR_ATTACHMENT15: GLenum;
4139     readonly COLOR_ATTACHMENT2: GLenum;
4140     readonly COLOR_ATTACHMENT3: GLenum;
4141     readonly COLOR_ATTACHMENT4: GLenum;
4142     readonly COLOR_ATTACHMENT5: GLenum;
4143     readonly COLOR_ATTACHMENT6: GLenum;
4144     readonly COLOR_ATTACHMENT7: GLenum;
4145     readonly COLOR_ATTACHMENT8: GLenum;
4146     readonly COLOR_ATTACHMENT9: GLenum;
4147     readonly COMPARE_REF_TO_TEXTURE: GLenum;
4148     readonly CONDITION_SATISFIED: GLenum;
4149     readonly COPY_READ_BUFFER: GLenum;
4150     readonly COPY_READ_BUFFER_BINDING: GLenum;
4151     readonly COPY_WRITE_BUFFER: GLenum;
4152     readonly COPY_WRITE_BUFFER_BINDING: GLenum;
4153     readonly CURRENT_QUERY: GLenum;
4154     readonly DEPTH: GLenum;
4155     readonly DEPTH24_STENCIL8: GLenum;
4156     readonly DEPTH32F_STENCIL8: GLenum;
4157     readonly DEPTH_COMPONENT24: GLenum;
4158     readonly DEPTH_COMPONENT32F: GLenum;
4159     readonly DRAW_BUFFER0: GLenum;
4160     readonly DRAW_BUFFER1: GLenum;
4161     readonly DRAW_BUFFER10: GLenum;
4162     readonly DRAW_BUFFER11: GLenum;
4163     readonly DRAW_BUFFER12: GLenum;
4164     readonly DRAW_BUFFER13: GLenum;
4165     readonly DRAW_BUFFER14: GLenum;
4166     readonly DRAW_BUFFER15: GLenum;
4167     readonly DRAW_BUFFER2: GLenum;
4168     readonly DRAW_BUFFER3: GLenum;
4169     readonly DRAW_BUFFER4: GLenum;
4170     readonly DRAW_BUFFER5: GLenum;
4171     readonly DRAW_BUFFER6: GLenum;
4172     readonly DRAW_BUFFER7: GLenum;
4173     readonly DRAW_BUFFER8: GLenum;
4174     readonly DRAW_BUFFER9: GLenum;
4175     readonly DRAW_FRAMEBUFFER: GLenum;
4176     readonly DRAW_FRAMEBUFFER_BINDING: GLenum;
4177     readonly DYNAMIC_COPY: GLenum;
4178     readonly DYNAMIC_READ: GLenum;
4179     readonly FLOAT_32_UNSIGNED_INT_24_8_REV: GLenum;
4180     readonly FLOAT_MAT2x3: GLenum;
4181     readonly FLOAT_MAT2x4: GLenum;
4182     readonly FLOAT_MAT3x2: GLenum;
4183     readonly FLOAT_MAT3x4: GLenum;
4184     readonly FLOAT_MAT4x2: GLenum;
4185     readonly FLOAT_MAT4x3: GLenum;
4186     readonly FRAGMENT_SHADER_DERIVATIVE_HINT: GLenum;
4187     readonly FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: GLenum;
4188     readonly FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: GLenum;
4189     readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: GLenum;
4190     readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: GLenum;
4191     readonly FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: GLenum;
4192     readonly FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: GLenum;
4193     readonly FRAMEBUFFER_ATTACHMENT_RED_SIZE: GLenum;
4194     readonly FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: GLenum;
4195     readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: GLenum;
4196     readonly FRAMEBUFFER_DEFAULT: GLenum;
4197     readonly FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: GLenum;
4198     readonly HALF_FLOAT: GLenum;
4199     readonly INTERLEAVED_ATTRIBS: GLenum;
4200     readonly INT_2_10_10_10_REV: GLenum;
4201     readonly INT_SAMPLER_2D: GLenum;
4202     readonly INT_SAMPLER_2D_ARRAY: GLenum;
4203     readonly INT_SAMPLER_3D: GLenum;
4204     readonly INT_SAMPLER_CUBE: GLenum;
4205     readonly INVALID_INDEX: GLenum;
4206     readonly MAX: GLenum;
4207     readonly MAX_3D_TEXTURE_SIZE: GLenum;
4208     readonly MAX_ARRAY_TEXTURE_LAYERS: GLenum;
4209     readonly MAX_CLIENT_WAIT_TIMEOUT_WEBGL: GLenum;
4210     readonly MAX_COLOR_ATTACHMENTS: GLenum;
4211     readonly MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: GLenum;
4212     readonly MAX_COMBINED_UNIFORM_BLOCKS: GLenum;
4213     readonly MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: GLenum;
4214     readonly MAX_DRAW_BUFFERS: GLenum;
4215     readonly MAX_ELEMENTS_INDICES: GLenum;
4216     readonly MAX_ELEMENTS_VERTICES: GLenum;
4217     readonly MAX_ELEMENT_INDEX: GLenum;
4218     readonly MAX_FRAGMENT_INPUT_COMPONENTS: GLenum;
4219     readonly MAX_FRAGMENT_UNIFORM_BLOCKS: GLenum;
4220     readonly MAX_FRAGMENT_UNIFORM_COMPONENTS: GLenum;
4221     readonly MAX_PROGRAM_TEXEL_OFFSET: GLenum;
4222     readonly MAX_SAMPLES: GLenum;
4223     readonly MAX_SERVER_WAIT_TIMEOUT: GLenum;
4224     readonly MAX_TEXTURE_LOD_BIAS: GLenum;
4225     readonly MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: GLenum;
4226     readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: GLenum;
4227     readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: GLenum;
4228     readonly MAX_UNIFORM_BLOCK_SIZE: GLenum;
4229     readonly MAX_UNIFORM_BUFFER_BINDINGS: GLenum;
4230     readonly MAX_VARYING_COMPONENTS: GLenum;
4231     readonly MAX_VERTEX_OUTPUT_COMPONENTS: GLenum;
4232     readonly MAX_VERTEX_UNIFORM_BLOCKS: GLenum;
4233     readonly MAX_VERTEX_UNIFORM_COMPONENTS: GLenum;
4234     readonly MIN: GLenum;
4235     readonly MIN_PROGRAM_TEXEL_OFFSET: GLenum;
4236     readonly OBJECT_TYPE: GLenum;
4237     readonly PACK_ROW_LENGTH: GLenum;
4238     readonly PACK_SKIP_PIXELS: GLenum;
4239     readonly PACK_SKIP_ROWS: GLenum;
4240     readonly PIXEL_PACK_BUFFER: GLenum;
4241     readonly PIXEL_PACK_BUFFER_BINDING: GLenum;
4242     readonly PIXEL_UNPACK_BUFFER: GLenum;
4243     readonly PIXEL_UNPACK_BUFFER_BINDING: GLenum;
4244     readonly QUERY_RESULT: GLenum;
4245     readonly QUERY_RESULT_AVAILABLE: GLenum;
4246     readonly R11F_G11F_B10F: GLenum;
4247     readonly R16F: GLenum;
4248     readonly R16I: GLenum;
4249     readonly R16UI: GLenum;
4250     readonly R32F: GLenum;
4251     readonly R32I: GLenum;
4252     readonly R32UI: GLenum;
4253     readonly R8: GLenum;
4254     readonly R8I: GLenum;
4255     readonly R8UI: GLenum;
4256     readonly R8_SNORM: GLenum;
4257     readonly RASTERIZER_DISCARD: GLenum;
4258     readonly READ_BUFFER: GLenum;
4259     readonly READ_FRAMEBUFFER: GLenum;
4260     readonly READ_FRAMEBUFFER_BINDING: GLenum;
4261     readonly RED: GLenum;
4262     readonly RED_INTEGER: GLenum;
4263     readonly RENDERBUFFER_SAMPLES: GLenum;
4264     readonly RG: GLenum;
4265     readonly RG16F: GLenum;
4266     readonly RG16I: GLenum;
4267     readonly RG16UI: GLenum;
4268     readonly RG32F: GLenum;
4269     readonly RG32I: GLenum;
4270     readonly RG32UI: GLenum;
4271     readonly RG8: GLenum;
4272     readonly RG8I: GLenum;
4273     readonly RG8UI: GLenum;
4274     readonly RG8_SNORM: GLenum;
4275     readonly RGB10_A2: GLenum;
4276     readonly RGB10_A2UI: GLenum;
4277     readonly RGB16F: GLenum;
4278     readonly RGB16I: GLenum;
4279     readonly RGB16UI: GLenum;
4280     readonly RGB32F: GLenum;
4281     readonly RGB32I: GLenum;
4282     readonly RGB32UI: GLenum;
4283     readonly RGB8: GLenum;
4284     readonly RGB8I: GLenum;
4285     readonly RGB8UI: GLenum;
4286     readonly RGB8_SNORM: GLenum;
4287     readonly RGB9_E5: GLenum;
4288     readonly RGBA16F: GLenum;
4289     readonly RGBA16I: GLenum;
4290     readonly RGBA16UI: GLenum;
4291     readonly RGBA32F: GLenum;
4292     readonly RGBA32I: GLenum;
4293     readonly RGBA32UI: GLenum;
4294     readonly RGBA8: GLenum;
4295     readonly RGBA8I: GLenum;
4296     readonly RGBA8UI: GLenum;
4297     readonly RGBA8_SNORM: GLenum;
4298     readonly RGBA_INTEGER: GLenum;
4299     readonly RGB_INTEGER: GLenum;
4300     readonly RG_INTEGER: GLenum;
4301     readonly SAMPLER_2D_ARRAY: GLenum;
4302     readonly SAMPLER_2D_ARRAY_SHADOW: GLenum;
4303     readonly SAMPLER_2D_SHADOW: GLenum;
4304     readonly SAMPLER_3D: GLenum;
4305     readonly SAMPLER_BINDING: GLenum;
4306     readonly SAMPLER_CUBE_SHADOW: GLenum;
4307     readonly SEPARATE_ATTRIBS: GLenum;
4308     readonly SIGNALED: GLenum;
4309     readonly SIGNED_NORMALIZED: GLenum;
4310     readonly SRGB: GLenum;
4311     readonly SRGB8: GLenum;
4312     readonly SRGB8_ALPHA8: GLenum;
4313     readonly STATIC_COPY: GLenum;
4314     readonly STATIC_READ: GLenum;
4315     readonly STENCIL: GLenum;
4316     readonly STREAM_COPY: GLenum;
4317     readonly STREAM_READ: GLenum;
4318     readonly SYNC_CONDITION: GLenum;
4319     readonly SYNC_FENCE: GLenum;
4320     readonly SYNC_FLAGS: GLenum;
4321     readonly SYNC_FLUSH_COMMANDS_BIT: GLenum;
4322     readonly SYNC_GPU_COMMANDS_COMPLETE: GLenum;
4323     readonly SYNC_STATUS: GLenum;
4324     readonly TEXTURE_2D_ARRAY: GLenum;
4325     readonly TEXTURE_3D: GLenum;
4326     readonly TEXTURE_BASE_LEVEL: GLenum;
4327     readonly TEXTURE_BINDING_2D_ARRAY: GLenum;
4328     readonly TEXTURE_BINDING_3D: GLenum;
4329     readonly TEXTURE_COMPARE_FUNC: GLenum;
4330     readonly TEXTURE_COMPARE_MODE: GLenum;
4331     readonly TEXTURE_IMMUTABLE_FORMAT: GLenum;
4332     readonly TEXTURE_IMMUTABLE_LEVELS: GLenum;
4333     readonly TEXTURE_MAX_LEVEL: GLenum;
4334     readonly TEXTURE_MAX_LOD: GLenum;
4335     readonly TEXTURE_MIN_LOD: GLenum;
4336     readonly TEXTURE_WRAP_R: GLenum;
4337     readonly TIMEOUT_EXPIRED: GLenum;
4338     readonly TIMEOUT_IGNORED: GLint64;
4339     readonly TRANSFORM_FEEDBACK: GLenum;
4340     readonly TRANSFORM_FEEDBACK_ACTIVE: GLenum;
4341     readonly TRANSFORM_FEEDBACK_BINDING: GLenum;
4342     readonly TRANSFORM_FEEDBACK_BUFFER: GLenum;
4343     readonly TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum;
4344     readonly TRANSFORM_FEEDBACK_BUFFER_MODE: GLenum;
4345     readonly TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum;
4346     readonly TRANSFORM_FEEDBACK_BUFFER_START: GLenum;
4347     readonly TRANSFORM_FEEDBACK_PAUSED: GLenum;
4348     readonly TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: GLenum;
4349     readonly TRANSFORM_FEEDBACK_VARYINGS: GLenum;
4350     readonly UNIFORM_ARRAY_STRIDE: GLenum;
4351     readonly UNIFORM_BLOCK_ACTIVE_UNIFORMS: GLenum;
4352     readonly UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: GLenum;
4353     readonly UNIFORM_BLOCK_BINDING: GLenum;
4354     readonly UNIFORM_BLOCK_DATA_SIZE: GLenum;
4355     readonly UNIFORM_BLOCK_INDEX: GLenum;
4356     readonly UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: GLenum;
4357     readonly UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: GLenum;
4358     readonly UNIFORM_BUFFER: GLenum;
4359     readonly UNIFORM_BUFFER_BINDING: GLenum;
4360     readonly UNIFORM_BUFFER_OFFSET_ALIGNMENT: GLenum;
4361     readonly UNIFORM_BUFFER_SIZE: GLenum;
4362     readonly UNIFORM_BUFFER_START: GLenum;
4363     readonly UNIFORM_IS_ROW_MAJOR: GLenum;
4364     readonly UNIFORM_MATRIX_STRIDE: GLenum;
4365     readonly UNIFORM_OFFSET: GLenum;
4366     readonly UNIFORM_SIZE: GLenum;
4367     readonly UNIFORM_TYPE: GLenum;
4368     readonly UNPACK_IMAGE_HEIGHT: GLenum;
4369     readonly UNPACK_ROW_LENGTH: GLenum;
4370     readonly UNPACK_SKIP_IMAGES: GLenum;
4371     readonly UNPACK_SKIP_PIXELS: GLenum;
4372     readonly UNPACK_SKIP_ROWS: GLenum;
4373     readonly UNSIGNALED: GLenum;
4374     readonly UNSIGNED_INT_10F_11F_11F_REV: GLenum;
4375     readonly UNSIGNED_INT_24_8: GLenum;
4376     readonly UNSIGNED_INT_2_10_10_10_REV: GLenum;
4377     readonly UNSIGNED_INT_5_9_9_9_REV: GLenum;
4378     readonly UNSIGNED_INT_SAMPLER_2D: GLenum;
4379     readonly UNSIGNED_INT_SAMPLER_2D_ARRAY: GLenum;
4380     readonly UNSIGNED_INT_SAMPLER_3D: GLenum;
4381     readonly UNSIGNED_INT_SAMPLER_CUBE: GLenum;
4382     readonly UNSIGNED_INT_VEC2: GLenum;
4383     readonly UNSIGNED_INT_VEC3: GLenum;
4384     readonly UNSIGNED_INT_VEC4: GLenum;
4385     readonly UNSIGNED_NORMALIZED: GLenum;
4386     readonly VERTEX_ARRAY_BINDING: GLenum;
4387     readonly VERTEX_ATTRIB_ARRAY_DIVISOR: GLenum;
4388     readonly VERTEX_ATTRIB_ARRAY_INTEGER: GLenum;
4389     readonly WAIT_FAILED: GLenum;
4390 }
4391
4392 interface WebGL2RenderingContextOverloads {
4393     bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum): void;
4394     bufferData(target: GLenum, srcData: BufferSource | null, usage: GLenum): void;
4395     bufferData(target: GLenum, srcData: ArrayBufferView, usage: GLenum, srcOffset: GLuint, length?: GLuint): void;
4396     bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: BufferSource): void;
4397     bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: ArrayBufferView, srcOffset: GLuint, length?: GLuint): void;
4398     compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr): void;
4399     compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset?: GLuint, srcLengthOverride?: GLuint): void;
4400     compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr): void;
4401     compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset?: GLuint, srcLengthOverride?: GLuint): void;
4402     readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: ArrayBufferView | null): void;
4403     readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, offset: GLintptr): void;
4404     readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: ArrayBufferView, dstOffset: GLuint): void;
4405     texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;
4406     texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: TexImageSource): void;
4407     texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr): void;
4408     texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, source: TexImageSource): void;
4409     texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint): void;
4410     texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;
4411     texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: TexImageSource): void;
4412     texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr): void;
4413     texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, source: TexImageSource): void;
4414     texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint): void;
4415     uniform1fv(location: WebGLUniformLocation | null, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;
4416     uniform1iv(location: WebGLUniformLocation | null, data: Int32List, srcOffset?: GLuint, srcLength?: GLuint): void;
4417     uniform2fv(location: WebGLUniformLocation | null, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;
4418     uniform2iv(location: WebGLUniformLocation | null, data: Int32List, srcOffset?: GLuint, srcLength?: GLuint): void;
4419     uniform3fv(location: WebGLUniformLocation | null, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;
4420     uniform3iv(location: WebGLUniformLocation | null, data: Int32List, srcOffset?: GLuint, srcLength?: GLuint): void;
4421     uniform4fv(location: WebGLUniformLocation | null, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;
4422     uniform4iv(location: WebGLUniformLocation | null, data: Int32List, srcOffset?: GLuint, srcLength?: GLuint): void;
4423     uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;
4424     uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;
4425     uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;
4426 }
4427
4428 /** Part of the WebGL API and represents the information returned by calling the WebGLRenderingContext.getActiveAttrib() and WebGLRenderingContext.getActiveUniform() methods. */
4429 interface WebGLActiveInfo {
4430     readonly name: string;
4431     readonly size: GLint;
4432     readonly type: GLenum;
4433 }
4434
4435 declare var WebGLActiveInfo: {
4436     prototype: WebGLActiveInfo;
4437     new(): WebGLActiveInfo;
4438 };
4439
4440 /** Part of the WebGL API and represents an opaque buffer object storing data such as vertices or colors. */
4441 interface WebGLBuffer extends WebGLObject {
4442 }
4443
4444 declare var WebGLBuffer: {
4445     prototype: WebGLBuffer;
4446     new(): WebGLBuffer;
4447 };
4448
4449 /** The WebContextEvent interface is part of the WebGL API and is an interface for an event that is generated in response to a status change to the WebGL rendering context. */
4450 interface WebGLContextEvent extends Event {
4451     readonly statusMessage: string;
4452 }
4453
4454 declare var WebGLContextEvent: {
4455     prototype: WebGLContextEvent;
4456     new(type: string, eventInit?: WebGLContextEventInit): WebGLContextEvent;
4457 };
4458
4459 /** Part of the WebGL API and represents a collection of buffers that serve as a rendering destination. */
4460 interface WebGLFramebuffer extends WebGLObject {
4461 }
4462
4463 declare var WebGLFramebuffer: {
4464     prototype: WebGLFramebuffer;
4465     new(): WebGLFramebuffer;
4466 };
4467
4468 interface WebGLObject {
4469 }
4470
4471 declare var WebGLObject: {
4472     prototype: WebGLObject;
4473     new(): WebGLObject;
4474 };
4475
4476 /** The WebGLProgram is part of the WebGL API and is a combination of two compiled WebGLShaders consisting of a vertex shader and a fragment shader (both written in GLSL). */
4477 interface WebGLProgram extends WebGLObject {
4478 }
4479
4480 declare var WebGLProgram: {
4481     prototype: WebGLProgram;
4482     new(): WebGLProgram;
4483 };
4484
4485 interface WebGLQuery extends WebGLObject {
4486 }
4487
4488 declare var WebGLQuery: {
4489     prototype: WebGLQuery;
4490     new(): WebGLQuery;
4491 };
4492
4493 /** Part of the WebGL API and represents a buffer that can contain an image, or can be source or target of an rendering operation. */
4494 interface WebGLRenderbuffer extends WebGLObject {
4495 }
4496
4497 declare var WebGLRenderbuffer: {
4498     prototype: WebGLRenderbuffer;
4499     new(): WebGLRenderbuffer;
4500 };
4501
4502 /** Provides an interface to the OpenGL ES 2.0 graphics rendering context for the drawing surface of an HTML <canvas> element. */
4503 interface WebGLRenderingContext extends WebGLRenderingContextBase, WebGLRenderingContextOverloads {
4504 }
4505
4506 declare var WebGLRenderingContext: {
4507     prototype: WebGLRenderingContext;
4508     new(): WebGLRenderingContext;
4509     readonly ACTIVE_ATTRIBUTES: GLenum;
4510     readonly ACTIVE_TEXTURE: GLenum;
4511     readonly ACTIVE_UNIFORMS: GLenum;
4512     readonly ALIASED_LINE_WIDTH_RANGE: GLenum;
4513     readonly ALIASED_POINT_SIZE_RANGE: GLenum;
4514     readonly ALPHA: GLenum;
4515     readonly ALPHA_BITS: GLenum;
4516     readonly ALWAYS: GLenum;
4517     readonly ARRAY_BUFFER: GLenum;
4518     readonly ARRAY_BUFFER_BINDING: GLenum;
4519     readonly ATTACHED_SHADERS: GLenum;
4520     readonly BACK: GLenum;
4521     readonly BLEND: GLenum;
4522     readonly BLEND_COLOR: GLenum;
4523     readonly BLEND_DST_ALPHA: GLenum;
4524     readonly BLEND_DST_RGB: GLenum;
4525     readonly BLEND_EQUATION: GLenum;
4526     readonly BLEND_EQUATION_ALPHA: GLenum;
4527     readonly BLEND_EQUATION_RGB: GLenum;
4528     readonly BLEND_SRC_ALPHA: GLenum;
4529     readonly BLEND_SRC_RGB: GLenum;
4530     readonly BLUE_BITS: GLenum;
4531     readonly BOOL: GLenum;
4532     readonly BOOL_VEC2: GLenum;
4533     readonly BOOL_VEC3: GLenum;
4534     readonly BOOL_VEC4: GLenum;
4535     readonly BROWSER_DEFAULT_WEBGL: GLenum;
4536     readonly BUFFER_SIZE: GLenum;
4537     readonly BUFFER_USAGE: GLenum;
4538     readonly BYTE: GLenum;
4539     readonly CCW: GLenum;
4540     readonly CLAMP_TO_EDGE: GLenum;
4541     readonly COLOR_ATTACHMENT0: GLenum;
4542     readonly COLOR_BUFFER_BIT: GLenum;
4543     readonly COLOR_CLEAR_VALUE: GLenum;
4544     readonly COLOR_WRITEMASK: GLenum;
4545     readonly COMPILE_STATUS: GLenum;
4546     readonly COMPRESSED_TEXTURE_FORMATS: GLenum;
4547     readonly CONSTANT_ALPHA: GLenum;
4548     readonly CONSTANT_COLOR: GLenum;
4549     readonly CONTEXT_LOST_WEBGL: GLenum;
4550     readonly CULL_FACE: GLenum;
4551     readonly CULL_FACE_MODE: GLenum;
4552     readonly CURRENT_PROGRAM: GLenum;
4553     readonly CURRENT_VERTEX_ATTRIB: GLenum;
4554     readonly CW: GLenum;
4555     readonly DECR: GLenum;
4556     readonly DECR_WRAP: GLenum;
4557     readonly DELETE_STATUS: GLenum;
4558     readonly DEPTH_ATTACHMENT: GLenum;
4559     readonly DEPTH_BITS: GLenum;
4560     readonly DEPTH_BUFFER_BIT: GLenum;
4561     readonly DEPTH_CLEAR_VALUE: GLenum;
4562     readonly DEPTH_COMPONENT: GLenum;
4563     readonly DEPTH_COMPONENT16: GLenum;
4564     readonly DEPTH_FUNC: GLenum;
4565     readonly DEPTH_RANGE: GLenum;
4566     readonly DEPTH_STENCIL: GLenum;
4567     readonly DEPTH_STENCIL_ATTACHMENT: GLenum;
4568     readonly DEPTH_TEST: GLenum;
4569     readonly DEPTH_WRITEMASK: GLenum;
4570     readonly DITHER: GLenum;
4571     readonly DONT_CARE: GLenum;
4572     readonly DST_ALPHA: GLenum;
4573     readonly DST_COLOR: GLenum;
4574     readonly DYNAMIC_DRAW: GLenum;
4575     readonly ELEMENT_ARRAY_BUFFER: GLenum;
4576     readonly ELEMENT_ARRAY_BUFFER_BINDING: GLenum;
4577     readonly EQUAL: GLenum;
4578     readonly FASTEST: GLenum;
4579     readonly FLOAT: GLenum;
4580     readonly FLOAT_MAT2: GLenum;
4581     readonly FLOAT_MAT3: GLenum;
4582     readonly FLOAT_MAT4: GLenum;
4583     readonly FLOAT_VEC2: GLenum;
4584     readonly FLOAT_VEC3: GLenum;
4585     readonly FLOAT_VEC4: GLenum;
4586     readonly FRAGMENT_SHADER: GLenum;
4587     readonly FRAMEBUFFER: GLenum;
4588     readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum;
4589     readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum;
4590     readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum;
4591     readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum;
4592     readonly FRAMEBUFFER_BINDING: GLenum;
4593     readonly FRAMEBUFFER_COMPLETE: GLenum;
4594     readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum;
4595     readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum;
4596     readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum;
4597     readonly FRAMEBUFFER_UNSUPPORTED: GLenum;
4598     readonly FRONT: GLenum;
4599     readonly FRONT_AND_BACK: GLenum;
4600     readonly FRONT_FACE: GLenum;
4601     readonly FUNC_ADD: GLenum;
4602     readonly FUNC_REVERSE_SUBTRACT: GLenum;
4603     readonly FUNC_SUBTRACT: GLenum;
4604     readonly GENERATE_MIPMAP_HINT: GLenum;
4605     readonly GEQUAL: GLenum;
4606     readonly GREATER: GLenum;
4607     readonly GREEN_BITS: GLenum;
4608     readonly HIGH_FLOAT: GLenum;
4609     readonly HIGH_INT: GLenum;
4610     readonly IMPLEMENTATION_COLOR_READ_FORMAT: GLenum;
4611     readonly IMPLEMENTATION_COLOR_READ_TYPE: GLenum;
4612     readonly INCR: GLenum;
4613     readonly INCR_WRAP: GLenum;
4614     readonly INT: GLenum;
4615     readonly INT_VEC2: GLenum;
4616     readonly INT_VEC3: GLenum;
4617     readonly INT_VEC4: GLenum;
4618     readonly INVALID_ENUM: GLenum;
4619     readonly INVALID_FRAMEBUFFER_OPERATION: GLenum;
4620     readonly INVALID_OPERATION: GLenum;
4621     readonly INVALID_VALUE: GLenum;
4622     readonly INVERT: GLenum;
4623     readonly KEEP: GLenum;
4624     readonly LEQUAL: GLenum;
4625     readonly LESS: GLenum;
4626     readonly LINEAR: GLenum;
4627     readonly LINEAR_MIPMAP_LINEAR: GLenum;
4628     readonly LINEAR_MIPMAP_NEAREST: GLenum;
4629     readonly LINES: GLenum;
4630     readonly LINE_LOOP: GLenum;
4631     readonly LINE_STRIP: GLenum;
4632     readonly LINE_WIDTH: GLenum;
4633     readonly LINK_STATUS: GLenum;
4634     readonly LOW_FLOAT: GLenum;
4635     readonly LOW_INT: GLenum;
4636     readonly LUMINANCE: GLenum;
4637     readonly LUMINANCE_ALPHA: GLenum;
4638     readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum;
4639     readonly MAX_CUBE_MAP_TEXTURE_SIZE: GLenum;
4640     readonly MAX_FRAGMENT_UNIFORM_VECTORS: GLenum;
4641     readonly MAX_RENDERBUFFER_SIZE: GLenum;
4642     readonly MAX_TEXTURE_IMAGE_UNITS: GLenum;
4643     readonly MAX_TEXTURE_SIZE: GLenum;
4644     readonly MAX_VARYING_VECTORS: GLenum;
4645     readonly MAX_VERTEX_ATTRIBS: GLenum;
4646     readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum;
4647     readonly MAX_VERTEX_UNIFORM_VECTORS: GLenum;
4648     readonly MAX_VIEWPORT_DIMS: GLenum;
4649     readonly MEDIUM_FLOAT: GLenum;
4650     readonly MEDIUM_INT: GLenum;
4651     readonly MIRRORED_REPEAT: GLenum;
4652     readonly NEAREST: GLenum;
4653     readonly NEAREST_MIPMAP_LINEAR: GLenum;
4654     readonly NEAREST_MIPMAP_NEAREST: GLenum;
4655     readonly NEVER: GLenum;
4656     readonly NICEST: GLenum;
4657     readonly NONE: GLenum;
4658     readonly NOTEQUAL: GLenum;
4659     readonly NO_ERROR: GLenum;
4660     readonly ONE: GLenum;
4661     readonly ONE_MINUS_CONSTANT_ALPHA: GLenum;
4662     readonly ONE_MINUS_CONSTANT_COLOR: GLenum;
4663     readonly ONE_MINUS_DST_ALPHA: GLenum;
4664     readonly ONE_MINUS_DST_COLOR: GLenum;
4665     readonly ONE_MINUS_SRC_ALPHA: GLenum;
4666     readonly ONE_MINUS_SRC_COLOR: GLenum;
4667     readonly OUT_OF_MEMORY: GLenum;
4668     readonly PACK_ALIGNMENT: GLenum;
4669     readonly POINTS: GLenum;
4670     readonly POLYGON_OFFSET_FACTOR: GLenum;
4671     readonly POLYGON_OFFSET_FILL: GLenum;
4672     readonly POLYGON_OFFSET_UNITS: GLenum;
4673     readonly RED_BITS: GLenum;
4674     readonly RENDERBUFFER: GLenum;
4675     readonly RENDERBUFFER_ALPHA_SIZE: GLenum;
4676     readonly RENDERBUFFER_BINDING: GLenum;
4677     readonly RENDERBUFFER_BLUE_SIZE: GLenum;
4678     readonly RENDERBUFFER_DEPTH_SIZE: GLenum;
4679     readonly RENDERBUFFER_GREEN_SIZE: GLenum;
4680     readonly RENDERBUFFER_HEIGHT: GLenum;
4681     readonly RENDERBUFFER_INTERNAL_FORMAT: GLenum;
4682     readonly RENDERBUFFER_RED_SIZE: GLenum;
4683     readonly RENDERBUFFER_STENCIL_SIZE: GLenum;
4684     readonly RENDERBUFFER_WIDTH: GLenum;
4685     readonly RENDERER: GLenum;
4686     readonly REPEAT: GLenum;
4687     readonly REPLACE: GLenum;
4688     readonly RGB: GLenum;
4689     readonly RGB565: GLenum;
4690     readonly RGB5_A1: GLenum;
4691     readonly RGBA: GLenum;
4692     readonly RGBA4: GLenum;
4693     readonly SAMPLER_2D: GLenum;
4694     readonly SAMPLER_CUBE: GLenum;
4695     readonly SAMPLES: GLenum;
4696     readonly SAMPLE_ALPHA_TO_COVERAGE: GLenum;
4697     readonly SAMPLE_BUFFERS: GLenum;
4698     readonly SAMPLE_COVERAGE: GLenum;
4699     readonly SAMPLE_COVERAGE_INVERT: GLenum;
4700     readonly SAMPLE_COVERAGE_VALUE: GLenum;
4701     readonly SCISSOR_BOX: GLenum;
4702     readonly SCISSOR_TEST: GLenum;
4703     readonly SHADER_TYPE: GLenum;
4704     readonly SHADING_LANGUAGE_VERSION: GLenum;
4705     readonly SHORT: GLenum;
4706     readonly SRC_ALPHA: GLenum;
4707     readonly SRC_ALPHA_SATURATE: GLenum;
4708     readonly SRC_COLOR: GLenum;
4709     readonly STATIC_DRAW: GLenum;
4710     readonly STENCIL_ATTACHMENT: GLenum;
4711     readonly STENCIL_BACK_FAIL: GLenum;
4712     readonly STENCIL_BACK_FUNC: GLenum;
4713     readonly STENCIL_BACK_PASS_DEPTH_FAIL: GLenum;
4714     readonly STENCIL_BACK_PASS_DEPTH_PASS: GLenum;
4715     readonly STENCIL_BACK_REF: GLenum;
4716     readonly STENCIL_BACK_VALUE_MASK: GLenum;
4717     readonly STENCIL_BACK_WRITEMASK: GLenum;
4718     readonly STENCIL_BITS: GLenum;
4719     readonly STENCIL_BUFFER_BIT: GLenum;
4720     readonly STENCIL_CLEAR_VALUE: GLenum;
4721     readonly STENCIL_FAIL: GLenum;
4722     readonly STENCIL_FUNC: GLenum;
4723     readonly STENCIL_INDEX8: GLenum;
4724     readonly STENCIL_PASS_DEPTH_FAIL: GLenum;
4725     readonly STENCIL_PASS_DEPTH_PASS: GLenum;
4726     readonly STENCIL_REF: GLenum;
4727     readonly STENCIL_TEST: GLenum;
4728     readonly STENCIL_VALUE_MASK: GLenum;
4729     readonly STENCIL_WRITEMASK: GLenum;
4730     readonly STREAM_DRAW: GLenum;
4731     readonly SUBPIXEL_BITS: GLenum;
4732     readonly TEXTURE: GLenum;
4733     readonly TEXTURE0: GLenum;
4734     readonly TEXTURE1: GLenum;
4735     readonly TEXTURE10: GLenum;
4736     readonly TEXTURE11: GLenum;
4737     readonly TEXTURE12: GLenum;
4738     readonly TEXTURE13: GLenum;
4739     readonly TEXTURE14: GLenum;
4740     readonly TEXTURE15: GLenum;
4741     readonly TEXTURE16: GLenum;
4742     readonly TEXTURE17: GLenum;
4743     readonly TEXTURE18: GLenum;
4744     readonly TEXTURE19: GLenum;
4745     readonly TEXTURE2: GLenum;
4746     readonly TEXTURE20: GLenum;
4747     readonly TEXTURE21: GLenum;
4748     readonly TEXTURE22: GLenum;
4749     readonly TEXTURE23: GLenum;
4750     readonly TEXTURE24: GLenum;
4751     readonly TEXTURE25: GLenum;
4752     readonly TEXTURE26: GLenum;
4753     readonly TEXTURE27: GLenum;
4754     readonly TEXTURE28: GLenum;
4755     readonly TEXTURE29: GLenum;
4756     readonly TEXTURE3: GLenum;
4757     readonly TEXTURE30: GLenum;
4758     readonly TEXTURE31: GLenum;
4759     readonly TEXTURE4: GLenum;
4760     readonly TEXTURE5: GLenum;
4761     readonly TEXTURE6: GLenum;
4762     readonly TEXTURE7: GLenum;
4763     readonly TEXTURE8: GLenum;
4764     readonly TEXTURE9: GLenum;
4765     readonly TEXTURE_2D: GLenum;
4766     readonly TEXTURE_BINDING_2D: GLenum;
4767     readonly TEXTURE_BINDING_CUBE_MAP: GLenum;
4768     readonly TEXTURE_CUBE_MAP: GLenum;
4769     readonly TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum;
4770     readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum;
4771     readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum;
4772     readonly TEXTURE_CUBE_MAP_POSITIVE_X: GLenum;
4773     readonly TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum;
4774     readonly TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum;
4775     readonly TEXTURE_MAG_FILTER: GLenum;
4776     readonly TEXTURE_MIN_FILTER: GLenum;
4777     readonly TEXTURE_WRAP_S: GLenum;
4778     readonly TEXTURE_WRAP_T: GLenum;
4779     readonly TRIANGLES: GLenum;
4780     readonly TRIANGLE_FAN: GLenum;
4781     readonly TRIANGLE_STRIP: GLenum;
4782     readonly UNPACK_ALIGNMENT: GLenum;
4783     readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum;
4784     readonly UNPACK_FLIP_Y_WEBGL: GLenum;
4785     readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum;
4786     readonly UNSIGNED_BYTE: GLenum;
4787     readonly UNSIGNED_INT: GLenum;
4788     readonly UNSIGNED_SHORT: GLenum;
4789     readonly UNSIGNED_SHORT_4_4_4_4: GLenum;
4790     readonly UNSIGNED_SHORT_5_5_5_1: GLenum;
4791     readonly UNSIGNED_SHORT_5_6_5: GLenum;
4792     readonly VALIDATE_STATUS: GLenum;
4793     readonly VENDOR: GLenum;
4794     readonly VERSION: GLenum;
4795     readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum;
4796     readonly VERTEX_ATTRIB_ARRAY_ENABLED: GLenum;
4797     readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum;
4798     readonly VERTEX_ATTRIB_ARRAY_POINTER: GLenum;
4799     readonly VERTEX_ATTRIB_ARRAY_SIZE: GLenum;
4800     readonly VERTEX_ATTRIB_ARRAY_STRIDE: GLenum;
4801     readonly VERTEX_ATTRIB_ARRAY_TYPE: GLenum;
4802     readonly VERTEX_SHADER: GLenum;
4803     readonly VIEWPORT: GLenum;
4804     readonly ZERO: GLenum;
4805 };
4806
4807 interface WebGLRenderingContextBase {
4808     readonly canvas: OffscreenCanvas;
4809     readonly drawingBufferHeight: GLsizei;
4810     readonly drawingBufferWidth: GLsizei;
4811     activeTexture(texture: GLenum): void;
4812     attachShader(program: WebGLProgram, shader: WebGLShader): void;
4813     bindAttribLocation(program: WebGLProgram, index: GLuint, name: string): void;
4814     bindBuffer(target: GLenum, buffer: WebGLBuffer | null): void;
4815     bindFramebuffer(target: GLenum, framebuffer: WebGLFramebuffer | null): void;
4816     bindRenderbuffer(target: GLenum, renderbuffer: WebGLRenderbuffer | null): void;
4817     bindTexture(target: GLenum, texture: WebGLTexture | null): void;
4818     blendColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf): void;
4819     blendEquation(mode: GLenum): void;
4820     blendEquationSeparate(modeRGB: GLenum, modeAlpha: GLenum): void;
4821     blendFunc(sfactor: GLenum, dfactor: GLenum): void;
4822     blendFuncSeparate(srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum): void;
4823     checkFramebufferStatus(target: GLenum): GLenum;
4824     clear(mask: GLbitfield): void;
4825     clearColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf): void;
4826     clearDepth(depth: GLclampf): void;
4827     clearStencil(s: GLint): void;
4828     colorMask(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean): void;
4829     compileShader(shader: WebGLShader): void;
4830     copyTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei, height: GLsizei, border: GLint): void;
4831     copyTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
4832     createBuffer(): WebGLBuffer | null;
4833     createFramebuffer(): WebGLFramebuffer | null;
4834     createProgram(): WebGLProgram | null;
4835     createRenderbuffer(): WebGLRenderbuffer | null;
4836     createShader(type: GLenum): WebGLShader | null;
4837     createTexture(): WebGLTexture | null;
4838     cullFace(mode: GLenum): void;
4839     deleteBuffer(buffer: WebGLBuffer | null): void;
4840     deleteFramebuffer(framebuffer: WebGLFramebuffer | null): void;
4841     deleteProgram(program: WebGLProgram | null): void;
4842     deleteRenderbuffer(renderbuffer: WebGLRenderbuffer | null): void;
4843     deleteShader(shader: WebGLShader | null): void;
4844     deleteTexture(texture: WebGLTexture | null): void;
4845     depthFunc(func: GLenum): void;
4846     depthMask(flag: GLboolean): void;
4847     depthRange(zNear: GLclampf, zFar: GLclampf): void;
4848     detachShader(program: WebGLProgram, shader: WebGLShader): void;
4849     disable(cap: GLenum): void;
4850     disableVertexAttribArray(index: GLuint): void;
4851     drawArrays(mode: GLenum, first: GLint, count: GLsizei): void;
4852     drawElements(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr): void;
4853     enable(cap: GLenum): void;
4854     enableVertexAttribArray(index: GLuint): void;
4855     finish(): void;
4856     flush(): void;
4857     framebufferRenderbuffer(target: GLenum, attachment: GLenum, renderbuffertarget: GLenum, renderbuffer: WebGLRenderbuffer | null): void;
4858     framebufferTexture2D(target: GLenum, attachment: GLenum, textarget: GLenum, texture: WebGLTexture | null, level: GLint): void;
4859     frontFace(mode: GLenum): void;
4860     generateMipmap(target: GLenum): void;
4861     getActiveAttrib(program: WebGLProgram, index: GLuint): WebGLActiveInfo | null;
4862     getActiveUniform(program: WebGLProgram, index: GLuint): WebGLActiveInfo | null;
4863     getAttachedShaders(program: WebGLProgram): WebGLShader[] | null;
4864     getAttribLocation(program: WebGLProgram, name: string): GLint;
4865     getBufferParameter(target: GLenum, pname: GLenum): any;
4866     getContextAttributes(): WebGLContextAttributes | null;
4867     getError(): GLenum;
4868     getExtension(extensionName: "EXT_blend_minmax"): EXT_blend_minmax | null;
4869     getExtension(extensionName: "EXT_texture_filter_anisotropic"): EXT_texture_filter_anisotropic | null;
4870     getExtension(extensionName: "EXT_frag_depth"): EXT_frag_depth | null;
4871     getExtension(extensionName: "EXT_shader_texture_lod"): EXT_shader_texture_lod | null;
4872     getExtension(extensionName: "EXT_sRGB"): EXT_sRGB | null;
4873     getExtension(extensionName: "OES_vertex_array_object"): OES_vertex_array_object | null;
4874     getExtension(extensionName: "WEBGL_color_buffer_float"): WEBGL_color_buffer_float | null;
4875     getExtension(extensionName: "WEBGL_compressed_texture_astc"): WEBGL_compressed_texture_astc | null;
4876     getExtension(extensionName: "WEBGL_compressed_texture_s3tc_srgb"): WEBGL_compressed_texture_s3tc_srgb | null;
4877     getExtension(extensionName: "WEBGL_debug_shaders"): WEBGL_debug_shaders | null;
4878     getExtension(extensionName: "WEBGL_draw_buffers"): WEBGL_draw_buffers | null;
4879     getExtension(extensionName: "WEBGL_lose_context"): WEBGL_lose_context | null;
4880     getExtension(extensionName: "WEBGL_depth_texture"): WEBGL_depth_texture | null;
4881     getExtension(extensionName: "WEBGL_debug_renderer_info"): WEBGL_debug_renderer_info | null;
4882     getExtension(extensionName: "WEBGL_compressed_texture_s3tc"): WEBGL_compressed_texture_s3tc | null;
4883     getExtension(extensionName: "OES_texture_half_float_linear"): OES_texture_half_float_linear | null;
4884     getExtension(extensionName: "OES_texture_half_float"): OES_texture_half_float | null;
4885     getExtension(extensionName: "OES_texture_float_linear"): OES_texture_float_linear | null;
4886     getExtension(extensionName: "OES_texture_float"): OES_texture_float | null;
4887     getExtension(extensionName: "OES_standard_derivatives"): OES_standard_derivatives | null;
4888     getExtension(extensionName: "OES_element_index_uint"): OES_element_index_uint | null;
4889     getExtension(extensionName: "ANGLE_instanced_arrays"): ANGLE_instanced_arrays | null;
4890     getExtension(extensionName: string): any;
4891     getFramebufferAttachmentParameter(target: GLenum, attachment: GLenum, pname: GLenum): any;
4892     getParameter(pname: GLenum): any;
4893     getProgramInfoLog(program: WebGLProgram): string | null;
4894     getProgramParameter(program: WebGLProgram, pname: GLenum): any;
4895     getRenderbufferParameter(target: GLenum, pname: GLenum): any;
4896     getShaderInfoLog(shader: WebGLShader): string | null;
4897     getShaderParameter(shader: WebGLShader, pname: GLenum): any;
4898     getShaderPrecisionFormat(shadertype: GLenum, precisiontype: GLenum): WebGLShaderPrecisionFormat | null;
4899     getShaderSource(shader: WebGLShader): string | null;
4900     getSupportedExtensions(): string[] | null;
4901     getTexParameter(target: GLenum, pname: GLenum): any;
4902     getUniform(program: WebGLProgram, location: WebGLUniformLocation): any;
4903     getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation | null;
4904     getVertexAttrib(index: GLuint, pname: GLenum): any;
4905     getVertexAttribOffset(index: GLuint, pname: GLenum): GLintptr;
4906     hint(target: GLenum, mode: GLenum): void;
4907     isBuffer(buffer: WebGLBuffer | null): GLboolean;
4908     isContextLost(): boolean;
4909     isEnabled(cap: GLenum): GLboolean;
4910     isFramebuffer(framebuffer: WebGLFramebuffer | null): GLboolean;
4911     isProgram(program: WebGLProgram | null): GLboolean;
4912     isRenderbuffer(renderbuffer: WebGLRenderbuffer | null): GLboolean;
4913     isShader(shader: WebGLShader | null): GLboolean;
4914     isTexture(texture: WebGLTexture | null): GLboolean;
4915     lineWidth(width: GLfloat): void;
4916     linkProgram(program: WebGLProgram): void;
4917     pixelStorei(pname: GLenum, param: GLint | GLboolean): void;
4918     polygonOffset(factor: GLfloat, units: GLfloat): void;
4919     renderbufferStorage(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei): void;
4920     sampleCoverage(value: GLclampf, invert: GLboolean): void;
4921     scissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
4922     shaderSource(shader: WebGLShader, source: string): void;
4923     stencilFunc(func: GLenum, ref: GLint, mask: GLuint): void;
4924     stencilFuncSeparate(face: GLenum, func: GLenum, ref: GLint, mask: GLuint): void;
4925     stencilMask(mask: GLuint): void;
4926     stencilMaskSeparate(face: GLenum, mask: GLuint): void;
4927     stencilOp(fail: GLenum, zfail: GLenum, zpass: GLenum): void;
4928     stencilOpSeparate(face: GLenum, fail: GLenum, zfail: GLenum, zpass: GLenum): void;
4929     texParameterf(target: GLenum, pname: GLenum, param: GLfloat): void;
4930     texParameteri(target: GLenum, pname: GLenum, param: GLint): void;
4931     uniform1f(location: WebGLUniformLocation | null, x: GLfloat): void;
4932     uniform1i(location: WebGLUniformLocation | null, x: GLint): void;
4933     uniform2f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat): void;
4934     uniform2i(location: WebGLUniformLocation | null, x: GLint, y: GLint): void;
4935     uniform3f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat, z: GLfloat): void;
4936     uniform3i(location: WebGLUniformLocation | null, x: GLint, y: GLint, z: GLint): void;
4937     uniform4f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat): void;
4938     uniform4i(location: WebGLUniformLocation | null, x: GLint, y: GLint, z: GLint, w: GLint): void;
4939     useProgram(program: WebGLProgram | null): void;
4940     validateProgram(program: WebGLProgram): void;
4941     vertexAttrib1f(index: GLuint, x: GLfloat): void;
4942     vertexAttrib1fv(index: GLuint, values: Float32List): void;
4943     vertexAttrib2f(index: GLuint, x: GLfloat, y: GLfloat): void;
4944     vertexAttrib2fv(index: GLuint, values: Float32List): void;
4945     vertexAttrib3f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat): void;
4946     vertexAttrib3fv(index: GLuint, values: Float32List): void;
4947     vertexAttrib4f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat): void;
4948     vertexAttrib4fv(index: GLuint, values: Float32List): void;
4949     vertexAttribPointer(index: GLuint, size: GLint, type: GLenum, normalized: GLboolean, stride: GLsizei, offset: GLintptr): void;
4950     viewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
4951     readonly ACTIVE_ATTRIBUTES: GLenum;
4952     readonly ACTIVE_TEXTURE: GLenum;
4953     readonly ACTIVE_UNIFORMS: GLenum;
4954     readonly ALIASED_LINE_WIDTH_RANGE: GLenum;
4955     readonly ALIASED_POINT_SIZE_RANGE: GLenum;
4956     readonly ALPHA: GLenum;
4957     readonly ALPHA_BITS: GLenum;
4958     readonly ALWAYS: GLenum;
4959     readonly ARRAY_BUFFER: GLenum;
4960     readonly ARRAY_BUFFER_BINDING: GLenum;
4961     readonly ATTACHED_SHADERS: GLenum;
4962     readonly BACK: GLenum;
4963     readonly BLEND: GLenum;
4964     readonly BLEND_COLOR: GLenum;
4965     readonly BLEND_DST_ALPHA: GLenum;
4966     readonly BLEND_DST_RGB: GLenum;
4967     readonly BLEND_EQUATION: GLenum;
4968     readonly BLEND_EQUATION_ALPHA: GLenum;
4969     readonly BLEND_EQUATION_RGB: GLenum;
4970     readonly BLEND_SRC_ALPHA: GLenum;
4971     readonly BLEND_SRC_RGB: GLenum;
4972     readonly BLUE_BITS: GLenum;
4973     readonly BOOL: GLenum;
4974     readonly BOOL_VEC2: GLenum;
4975     readonly BOOL_VEC3: GLenum;
4976     readonly BOOL_VEC4: GLenum;
4977     readonly BROWSER_DEFAULT_WEBGL: GLenum;
4978     readonly BUFFER_SIZE: GLenum;
4979     readonly BUFFER_USAGE: GLenum;
4980     readonly BYTE: GLenum;
4981     readonly CCW: GLenum;
4982     readonly CLAMP_TO_EDGE: GLenum;
4983     readonly COLOR_ATTACHMENT0: GLenum;
4984     readonly COLOR_BUFFER_BIT: GLenum;
4985     readonly COLOR_CLEAR_VALUE: GLenum;
4986     readonly COLOR_WRITEMASK: GLenum;
4987     readonly COMPILE_STATUS: GLenum;
4988     readonly COMPRESSED_TEXTURE_FORMATS: GLenum;
4989     readonly CONSTANT_ALPHA: GLenum;
4990     readonly CONSTANT_COLOR: GLenum;
4991     readonly CONTEXT_LOST_WEBGL: GLenum;
4992     readonly CULL_FACE: GLenum;
4993     readonly CULL_FACE_MODE: GLenum;
4994     readonly CURRENT_PROGRAM: GLenum;
4995     readonly CURRENT_VERTEX_ATTRIB: GLenum;
4996     readonly CW: GLenum;
4997     readonly DECR: GLenum;
4998     readonly DECR_WRAP: GLenum;
4999     readonly DELETE_STATUS: GLenum;
5000     readonly DEPTH_ATTACHMENT: GLenum;
5001     readonly DEPTH_BITS: GLenum;
5002     readonly DEPTH_BUFFER_BIT: GLenum;
5003     readonly DEPTH_CLEAR_VALUE: GLenum;
5004     readonly DEPTH_COMPONENT: GLenum;
5005     readonly DEPTH_COMPONENT16: GLenum;
5006     readonly DEPTH_FUNC: GLenum;
5007     readonly DEPTH_RANGE: GLenum;
5008     readonly DEPTH_STENCIL: GLenum;
5009     readonly DEPTH_STENCIL_ATTACHMENT: GLenum;
5010     readonly DEPTH_TEST: GLenum;
5011     readonly DEPTH_WRITEMASK: GLenum;
5012     readonly DITHER: GLenum;
5013     readonly DONT_CARE: GLenum;
5014     readonly DST_ALPHA: GLenum;
5015     readonly DST_COLOR: GLenum;
5016     readonly DYNAMIC_DRAW: GLenum;
5017     readonly ELEMENT_ARRAY_BUFFER: GLenum;
5018     readonly ELEMENT_ARRAY_BUFFER_BINDING: GLenum;
5019     readonly EQUAL: GLenum;
5020     readonly FASTEST: GLenum;
5021     readonly FLOAT: GLenum;
5022     readonly FLOAT_MAT2: GLenum;
5023     readonly FLOAT_MAT3: GLenum;
5024     readonly FLOAT_MAT4: GLenum;
5025     readonly FLOAT_VEC2: GLenum;
5026     readonly FLOAT_VEC3: GLenum;
5027     readonly FLOAT_VEC4: GLenum;
5028     readonly FRAGMENT_SHADER: GLenum;
5029     readonly FRAMEBUFFER: GLenum;
5030     readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum;
5031     readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum;
5032     readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum;
5033     readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum;
5034     readonly FRAMEBUFFER_BINDING: GLenum;
5035     readonly FRAMEBUFFER_COMPLETE: GLenum;
5036     readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum;
5037     readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum;
5038     readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum;
5039     readonly FRAMEBUFFER_UNSUPPORTED: GLenum;
5040     readonly FRONT: GLenum;
5041     readonly FRONT_AND_BACK: GLenum;
5042     readonly FRONT_FACE: GLenum;
5043     readonly FUNC_ADD: GLenum;
5044     readonly FUNC_REVERSE_SUBTRACT: GLenum;
5045     readonly FUNC_SUBTRACT: GLenum;
5046     readonly GENERATE_MIPMAP_HINT: GLenum;
5047     readonly GEQUAL: GLenum;
5048     readonly GREATER: GLenum;
5049     readonly GREEN_BITS: GLenum;
5050     readonly HIGH_FLOAT: GLenum;
5051     readonly HIGH_INT: GLenum;
5052     readonly IMPLEMENTATION_COLOR_READ_FORMAT: GLenum;
5053     readonly IMPLEMENTATION_COLOR_READ_TYPE: GLenum;
5054     readonly INCR: GLenum;
5055     readonly INCR_WRAP: GLenum;
5056     readonly INT: GLenum;
5057     readonly INT_VEC2: GLenum;
5058     readonly INT_VEC3: GLenum;
5059     readonly INT_VEC4: GLenum;
5060     readonly INVALID_ENUM: GLenum;
5061     readonly INVALID_FRAMEBUFFER_OPERATION: GLenum;
5062     readonly INVALID_OPERATION: GLenum;
5063     readonly INVALID_VALUE: GLenum;
5064     readonly INVERT: GLenum;
5065     readonly KEEP: GLenum;
5066     readonly LEQUAL: GLenum;
5067     readonly LESS: GLenum;
5068     readonly LINEAR: GLenum;
5069     readonly LINEAR_MIPMAP_LINEAR: GLenum;
5070     readonly LINEAR_MIPMAP_NEAREST: GLenum;
5071     readonly LINES: GLenum;
5072     readonly LINE_LOOP: GLenum;
5073     readonly LINE_STRIP: GLenum;
5074     readonly LINE_WIDTH: GLenum;
5075     readonly LINK_STATUS: GLenum;
5076     readonly LOW_FLOAT: GLenum;
5077     readonly LOW_INT: GLenum;
5078     readonly LUMINANCE: GLenum;
5079     readonly LUMINANCE_ALPHA: GLenum;
5080     readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum;
5081     readonly MAX_CUBE_MAP_TEXTURE_SIZE: GLenum;
5082     readonly MAX_FRAGMENT_UNIFORM_VECTORS: GLenum;
5083     readonly MAX_RENDERBUFFER_SIZE: GLenum;
5084     readonly MAX_TEXTURE_IMAGE_UNITS: GLenum;
5085     readonly MAX_TEXTURE_SIZE: GLenum;
5086     readonly MAX_VARYING_VECTORS: GLenum;
5087     readonly MAX_VERTEX_ATTRIBS: GLenum;
5088     readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum;
5089     readonly MAX_VERTEX_UNIFORM_VECTORS: GLenum;
5090     readonly MAX_VIEWPORT_DIMS: GLenum;
5091     readonly MEDIUM_FLOAT: GLenum;
5092     readonly MEDIUM_INT: GLenum;
5093     readonly MIRRORED_REPEAT: GLenum;
5094     readonly NEAREST: GLenum;
5095     readonly NEAREST_MIPMAP_LINEAR: GLenum;
5096     readonly NEAREST_MIPMAP_NEAREST: GLenum;
5097     readonly NEVER: GLenum;
5098     readonly NICEST: GLenum;
5099     readonly NONE: GLenum;
5100     readonly NOTEQUAL: GLenum;
5101     readonly NO_ERROR: GLenum;
5102     readonly ONE: GLenum;
5103     readonly ONE_MINUS_CONSTANT_ALPHA: GLenum;
5104     readonly ONE_MINUS_CONSTANT_COLOR: GLenum;
5105     readonly ONE_MINUS_DST_ALPHA: GLenum;
5106     readonly ONE_MINUS_DST_COLOR: GLenum;
5107     readonly ONE_MINUS_SRC_ALPHA: GLenum;
5108     readonly ONE_MINUS_SRC_COLOR: GLenum;
5109     readonly OUT_OF_MEMORY: GLenum;
5110     readonly PACK_ALIGNMENT: GLenum;
5111     readonly POINTS: GLenum;
5112     readonly POLYGON_OFFSET_FACTOR: GLenum;
5113     readonly POLYGON_OFFSET_FILL: GLenum;
5114     readonly POLYGON_OFFSET_UNITS: GLenum;
5115     readonly RED_BITS: GLenum;
5116     readonly RENDERBUFFER: GLenum;
5117     readonly RENDERBUFFER_ALPHA_SIZE: GLenum;
5118     readonly RENDERBUFFER_BINDING: GLenum;
5119     readonly RENDERBUFFER_BLUE_SIZE: GLenum;
5120     readonly RENDERBUFFER_DEPTH_SIZE: GLenum;
5121     readonly RENDERBUFFER_GREEN_SIZE: GLenum;
5122     readonly RENDERBUFFER_HEIGHT: GLenum;
5123     readonly RENDERBUFFER_INTERNAL_FORMAT: GLenum;
5124     readonly RENDERBUFFER_RED_SIZE: GLenum;
5125     readonly RENDERBUFFER_STENCIL_SIZE: GLenum;
5126     readonly RENDERBUFFER_WIDTH: GLenum;
5127     readonly RENDERER: GLenum;
5128     readonly REPEAT: GLenum;
5129     readonly REPLACE: GLenum;
5130     readonly RGB: GLenum;
5131     readonly RGB565: GLenum;
5132     readonly RGB5_A1: GLenum;
5133     readonly RGBA: GLenum;
5134     readonly RGBA4: GLenum;
5135     readonly SAMPLER_2D: GLenum;
5136     readonly SAMPLER_CUBE: GLenum;
5137     readonly SAMPLES: GLenum;
5138     readonly SAMPLE_ALPHA_TO_COVERAGE: GLenum;
5139     readonly SAMPLE_BUFFERS: GLenum;
5140     readonly SAMPLE_COVERAGE: GLenum;
5141     readonly SAMPLE_COVERAGE_INVERT: GLenum;
5142     readonly SAMPLE_COVERAGE_VALUE: GLenum;
5143     readonly SCISSOR_BOX: GLenum;
5144     readonly SCISSOR_TEST: GLenum;
5145     readonly SHADER_TYPE: GLenum;
5146     readonly SHADING_LANGUAGE_VERSION: GLenum;
5147     readonly SHORT: GLenum;
5148     readonly SRC_ALPHA: GLenum;
5149     readonly SRC_ALPHA_SATURATE: GLenum;
5150     readonly SRC_COLOR: GLenum;
5151     readonly STATIC_DRAW: GLenum;
5152     readonly STENCIL_ATTACHMENT: GLenum;
5153     readonly STENCIL_BACK_FAIL: GLenum;
5154     readonly STENCIL_BACK_FUNC: GLenum;
5155     readonly STENCIL_BACK_PASS_DEPTH_FAIL: GLenum;
5156     readonly STENCIL_BACK_PASS_DEPTH_PASS: GLenum;
5157     readonly STENCIL_BACK_REF: GLenum;
5158     readonly STENCIL_BACK_VALUE_MASK: GLenum;
5159     readonly STENCIL_BACK_WRITEMASK: GLenum;
5160     readonly STENCIL_BITS: GLenum;
5161     readonly STENCIL_BUFFER_BIT: GLenum;
5162     readonly STENCIL_CLEAR_VALUE: GLenum;
5163     readonly STENCIL_FAIL: GLenum;
5164     readonly STENCIL_FUNC: GLenum;
5165     readonly STENCIL_INDEX8: GLenum;
5166     readonly STENCIL_PASS_DEPTH_FAIL: GLenum;
5167     readonly STENCIL_PASS_DEPTH_PASS: GLenum;
5168     readonly STENCIL_REF: GLenum;
5169     readonly STENCIL_TEST: GLenum;
5170     readonly STENCIL_VALUE_MASK: GLenum;
5171     readonly STENCIL_WRITEMASK: GLenum;
5172     readonly STREAM_DRAW: GLenum;
5173     readonly SUBPIXEL_BITS: GLenum;
5174     readonly TEXTURE: GLenum;
5175     readonly TEXTURE0: GLenum;
5176     readonly TEXTURE1: GLenum;
5177     readonly TEXTURE10: GLenum;
5178     readonly TEXTURE11: GLenum;
5179     readonly TEXTURE12: GLenum;
5180     readonly TEXTURE13: GLenum;
5181     readonly TEXTURE14: GLenum;
5182     readonly TEXTURE15: GLenum;
5183     readonly TEXTURE16: GLenum;
5184     readonly TEXTURE17: GLenum;
5185     readonly TEXTURE18: GLenum;
5186     readonly TEXTURE19: GLenum;
5187     readonly TEXTURE2: GLenum;
5188     readonly TEXTURE20: GLenum;
5189     readonly TEXTURE21: GLenum;
5190     readonly TEXTURE22: GLenum;
5191     readonly TEXTURE23: GLenum;
5192     readonly TEXTURE24: GLenum;
5193     readonly TEXTURE25: GLenum;
5194     readonly TEXTURE26: GLenum;
5195     readonly TEXTURE27: GLenum;
5196     readonly TEXTURE28: GLenum;
5197     readonly TEXTURE29: GLenum;
5198     readonly TEXTURE3: GLenum;
5199     readonly TEXTURE30: GLenum;
5200     readonly TEXTURE31: GLenum;
5201     readonly TEXTURE4: GLenum;
5202     readonly TEXTURE5: GLenum;
5203     readonly TEXTURE6: GLenum;
5204     readonly TEXTURE7: GLenum;
5205     readonly TEXTURE8: GLenum;
5206     readonly TEXTURE9: GLenum;
5207     readonly TEXTURE_2D: GLenum;
5208     readonly TEXTURE_BINDING_2D: GLenum;
5209     readonly TEXTURE_BINDING_CUBE_MAP: GLenum;
5210     readonly TEXTURE_CUBE_MAP: GLenum;
5211     readonly TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum;
5212     readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum;
5213     readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum;
5214     readonly TEXTURE_CUBE_MAP_POSITIVE_X: GLenum;
5215     readonly TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum;
5216     readonly TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum;
5217     readonly TEXTURE_MAG_FILTER: GLenum;
5218     readonly TEXTURE_MIN_FILTER: GLenum;
5219     readonly TEXTURE_WRAP_S: GLenum;
5220     readonly TEXTURE_WRAP_T: GLenum;
5221     readonly TRIANGLES: GLenum;
5222     readonly TRIANGLE_FAN: GLenum;
5223     readonly TRIANGLE_STRIP: GLenum;
5224     readonly UNPACK_ALIGNMENT: GLenum;
5225     readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum;
5226     readonly UNPACK_FLIP_Y_WEBGL: GLenum;
5227     readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum;
5228     readonly UNSIGNED_BYTE: GLenum;
5229     readonly UNSIGNED_INT: GLenum;
5230     readonly UNSIGNED_SHORT: GLenum;
5231     readonly UNSIGNED_SHORT_4_4_4_4: GLenum;
5232     readonly UNSIGNED_SHORT_5_5_5_1: GLenum;
5233     readonly UNSIGNED_SHORT_5_6_5: GLenum;
5234     readonly VALIDATE_STATUS: GLenum;
5235     readonly VENDOR: GLenum;
5236     readonly VERSION: GLenum;
5237     readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum;
5238     readonly VERTEX_ATTRIB_ARRAY_ENABLED: GLenum;
5239     readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum;
5240     readonly VERTEX_ATTRIB_ARRAY_POINTER: GLenum;
5241     readonly VERTEX_ATTRIB_ARRAY_SIZE: GLenum;
5242     readonly VERTEX_ATTRIB_ARRAY_STRIDE: GLenum;
5243     readonly VERTEX_ATTRIB_ARRAY_TYPE: GLenum;
5244     readonly VERTEX_SHADER: GLenum;
5245     readonly VIEWPORT: GLenum;
5246     readonly ZERO: GLenum;
5247 }
5248
5249 interface WebGLRenderingContextOverloads {
5250     bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum): void;
5251     bufferData(target: GLenum, data: BufferSource | null, usage: GLenum): void;
5252     bufferSubData(target: GLenum, offset: GLintptr, data: BufferSource): void;
5253     compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: ArrayBufferView): void;
5254     compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: ArrayBufferView): void;
5255     readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;
5256     texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;
5257     texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: TexImageSource): void;
5258     texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;
5259     texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: TexImageSource): void;
5260     uniform1fv(location: WebGLUniformLocation | null, v: Float32List): void;
5261     uniform1iv(location: WebGLUniformLocation | null, v: Int32List): void;
5262     uniform2fv(location: WebGLUniformLocation | null, v: Float32List): void;
5263     uniform2iv(location: WebGLUniformLocation | null, v: Int32List): void;
5264     uniform3fv(location: WebGLUniformLocation | null, v: Float32List): void;
5265     uniform3iv(location: WebGLUniformLocation | null, v: Int32List): void;
5266     uniform4fv(location: WebGLUniformLocation | null, v: Float32List): void;
5267     uniform4iv(location: WebGLUniformLocation | null, v: Int32List): void;
5268     uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;
5269     uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;
5270     uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;
5271 }
5272
5273 interface WebGLSampler extends WebGLObject {
5274 }
5275
5276 declare var WebGLSampler: {
5277     prototype: WebGLSampler;
5278     new(): WebGLSampler;
5279 };
5280
5281 /** The WebGLShader is part of the WebGL API and can either be a vertex or a fragment shader. A WebGLProgram requires both types of shaders. */
5282 interface WebGLShader extends WebGLObject {
5283 }
5284
5285 declare var WebGLShader: {
5286     prototype: WebGLShader;
5287     new(): WebGLShader;
5288 };
5289
5290 /** Part of the WebGL API and represents the information returned by calling the WebGLRenderingContext.getShaderPrecisionFormat() method. */
5291 interface WebGLShaderPrecisionFormat {
5292     readonly precision: GLint;
5293     readonly rangeMax: GLint;
5294     readonly rangeMin: GLint;
5295 }
5296
5297 declare var WebGLShaderPrecisionFormat: {
5298     prototype: WebGLShaderPrecisionFormat;
5299     new(): WebGLShaderPrecisionFormat;
5300 };
5301
5302 interface WebGLSync extends WebGLObject {
5303 }
5304
5305 declare var WebGLSync: {
5306     prototype: WebGLSync;
5307     new(): WebGLSync;
5308 };
5309
5310 /** Part of the WebGL API and represents an opaque texture object providing storage and state for texturing operations. */
5311 interface WebGLTexture extends WebGLObject {
5312 }
5313
5314 declare var WebGLTexture: {
5315     prototype: WebGLTexture;
5316     new(): WebGLTexture;
5317 };
5318
5319 interface WebGLTransformFeedback extends WebGLObject {
5320 }
5321
5322 declare var WebGLTransformFeedback: {
5323     prototype: WebGLTransformFeedback;
5324     new(): WebGLTransformFeedback;
5325 };
5326
5327 /** Part of the WebGL API and represents the location of a uniform variable in a shader program. */
5328 interface WebGLUniformLocation {
5329 }
5330
5331 declare var WebGLUniformLocation: {
5332     prototype: WebGLUniformLocation;
5333     new(): WebGLUniformLocation;
5334 };
5335
5336 interface WebGLVertexArrayObject extends WebGLObject {
5337 }
5338
5339 declare var WebGLVertexArrayObject: {
5340     prototype: WebGLVertexArrayObject;
5341     new(): WebGLVertexArrayObject;
5342 };
5343
5344 interface WebGLVertexArrayObjectOES extends WebGLObject {
5345 }
5346
5347 interface WebSocketEventMap {
5348     "close": CloseEvent;
5349     "error": Event;
5350     "message": MessageEvent;
5351     "open": Event;
5352 }
5353
5354 /** Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection. */
5355 interface WebSocket extends EventTarget {
5356     /**
5357      * Returns a string that indicates how binary data from the WebSocket object is exposed to scripts:
5358      * 
5359      * Can be set, to change how binary data is returned. The default is "blob".
5360      */
5361     binaryType: BinaryType;
5362     /**
5363      * Returns the number of bytes of application data (UTF-8 text and binary data) that have been queued using send() but not yet been transmitted to the network.
5364      * 
5365      * If the WebSocket connection is closed, this attribute's value will only increase with each call to the send() method. (The number does not reset to zero once the connection closes.)
5366      */
5367     readonly bufferedAmount: number;
5368     /**
5369      * Returns the extensions selected by the server, if any.
5370      */
5371     readonly extensions: string;
5372     onclose: ((this: WebSocket, ev: CloseEvent) => any) | null;
5373     onerror: ((this: WebSocket, ev: Event) => any) | null;
5374     onmessage: ((this: WebSocket, ev: MessageEvent) => any) | null;
5375     onopen: ((this: WebSocket, ev: Event) => any) | null;
5376     /**
5377      * Returns the subprotocol selected by the server, if any. It can be used in conjunction with the array form of the constructor's second argument to perform subprotocol negotiation.
5378      */
5379     readonly protocol: string;
5380     /**
5381      * Returns the state of the WebSocket object's connection. It can have the values described below.
5382      */
5383     readonly readyState: number;
5384     /**
5385      * Returns the URL that was used to establish the WebSocket connection.
5386      */
5387     readonly url: string;
5388     /**
5389      * Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason.
5390      */
5391     close(code?: number, reason?: string): void;
5392     /**
5393      * Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
5394      */
5395     send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void;
5396     readonly CLOSED: number;
5397     readonly CLOSING: number;
5398     readonly CONNECTING: number;
5399     readonly OPEN: number;
5400     addEventListener<K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
5401     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
5402     removeEventListener<K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
5403     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
5404 }
5405
5406 declare var WebSocket: {
5407     prototype: WebSocket;
5408     new(url: string, protocols?: string | string[]): WebSocket;
5409     readonly CLOSED: number;
5410     readonly CLOSING: number;
5411     readonly CONNECTING: number;
5412     readonly OPEN: number;
5413 };
5414
5415 /** This ServiceWorker API interface represents the scope of a service worker client that is a document in a browser context, controlled by an active worker. The service worker client independently selects and uses a service worker for its own loading and sub-resources. */
5416 interface WindowClient extends Client {
5417     readonly ancestorOrigins: ReadonlyArray<string>;
5418     readonly focused: boolean;
5419     readonly visibilityState: VisibilityState;
5420     focus(): Promise<WindowClient>;
5421     navigate(url: string): Promise<WindowClient | null>;
5422 }
5423
5424 declare var WindowClient: {
5425     prototype: WindowClient;
5426     new(): WindowClient;
5427 };
5428
5429 interface WindowOrWorkerGlobalScope {
5430     readonly caches: CacheStorage;
5431     readonly crypto: Crypto;
5432     readonly indexedDB: IDBFactory;
5433     readonly isSecureContext: boolean;
5434     readonly origin: string;
5435     readonly performance: Performance;
5436     atob(data: string): string;
5437     btoa(data: string): string;
5438     clearInterval(handle?: number): void;
5439     clearTimeout(handle?: number): void;
5440     createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
5441     createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
5442     fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
5443     queueMicrotask(callback: VoidFunction): void;
5444     setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
5445     setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
5446 }
5447
5448 interface WorkerEventMap extends AbstractWorkerEventMap {
5449     "message": MessageEvent;
5450     "messageerror": MessageEvent;
5451 }
5452
5453 /** This Web Workers API interface represents a background task that can be easily created and can send messages back to its creator. Creating a worker is as simple as calling the Worker() constructor and specifying a script to be run in the worker thread. */
5454 interface Worker extends EventTarget, AbstractWorker {
5455     onmessage: ((this: Worker, ev: MessageEvent) => any) | null;
5456     onmessageerror: ((this: Worker, ev: MessageEvent) => any) | null;
5457     /**
5458      * Clones message and transmits it to worker's global environment. transfer can be passed as a list of objects that are to be transferred rather than cloned.
5459      */
5460     postMessage(message: any, transfer: Transferable[]): void;
5461     postMessage(message: any, options?: PostMessageOptions): void;
5462     /**
5463      * Aborts worker's associated global environment.
5464      */
5465     terminate(): void;
5466     addEventListener<K extends keyof WorkerEventMap>(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
5467     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
5468     removeEventListener<K extends keyof WorkerEventMap>(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
5469     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
5470 }
5471
5472 declare var Worker: {
5473     prototype: Worker;
5474     new(stringUrl: string | URL, options?: WorkerOptions): Worker;
5475 };
5476
5477 interface WorkerGlobalScopeEventMap {
5478     "error": ErrorEvent;
5479     "languagechange": Event;
5480     "offline": Event;
5481     "online": Event;
5482     "rejectionhandled": PromiseRejectionEvent;
5483     "unhandledrejection": PromiseRejectionEvent;
5484 }
5485
5486 /** This Web Workers API interface is an interface representing the scope of any worker. Workers have no browsing context; this scope contains the information usually conveyed by Window objects â€” in this case event handlers, the console or the associated WorkerNavigator object. Each WorkerGlobalScope has its own event loop. */
5487 interface WorkerGlobalScope extends EventTarget, WindowOrWorkerGlobalScope {
5488     /**
5489      * Returns workerGlobal's WorkerLocation object.
5490      */
5491     readonly location: WorkerLocation;
5492     readonly navigator: WorkerNavigator;
5493     onerror: ((this: WorkerGlobalScope, ev: ErrorEvent) => any) | null;
5494     onlanguagechange: ((this: WorkerGlobalScope, ev: Event) => any) | null;
5495     onoffline: ((this: WorkerGlobalScope, ev: Event) => any) | null;
5496     ononline: ((this: WorkerGlobalScope, ev: Event) => any) | null;
5497     onrejectionhandled: ((this: WorkerGlobalScope, ev: PromiseRejectionEvent) => any) | null;
5498     onunhandledrejection: ((this: WorkerGlobalScope, ev: PromiseRejectionEvent) => any) | null;
5499     /**
5500      * Returns workerGlobal.
5501      */
5502     readonly self: WorkerGlobalScope & typeof globalThis;
5503     /**
5504      * Fetches each URL in urls, executes them one-by-one in the order they are passed, and then returns (or throws if something went amiss).
5505      */
5506     importScripts(...urls: string[]): void;
5507     addEventListener<K extends keyof WorkerGlobalScopeEventMap>(type: K, listener: (this: WorkerGlobalScope, ev: WorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
5508     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
5509     removeEventListener<K extends keyof WorkerGlobalScopeEventMap>(type: K, listener: (this: WorkerGlobalScope, ev: WorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
5510     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
5511 }
5512
5513 declare var WorkerGlobalScope: {
5514     prototype: WorkerGlobalScope;
5515     new(): WorkerGlobalScope;
5516 };
5517
5518 /** The absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.location property obtained by calling self.location. */
5519 interface WorkerLocation {
5520     readonly hash: string;
5521     readonly host: string;
5522     readonly hostname: string;
5523     readonly href: string;
5524     toString(): string;
5525     readonly origin: string;
5526     readonly pathname: string;
5527     readonly port: string;
5528     readonly protocol: string;
5529     readonly search: string;
5530 }
5531
5532 declare var WorkerLocation: {
5533     prototype: WorkerLocation;
5534     new(): WorkerLocation;
5535 };
5536
5537 /** A subset of the Navigator interface allowed to be accessed from a Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.navigator property obtained by calling window.self.navigator. */
5538 interface WorkerNavigator extends NavigatorConcurrentHardware, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorStorage {
5539     readonly permissions: Permissions;
5540     readonly serviceWorker: ServiceWorkerContainer;
5541 }
5542
5543 declare var WorkerNavigator: {
5544     prototype: WorkerNavigator;
5545     new(): WorkerNavigator;
5546 };
5547
5548 /** This Streams API interface provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing. */
5549 interface WritableStream<W = any> {
5550     readonly locked: boolean;
5551     abort(reason?: any): Promise<void>;
5552     getWriter(): WritableStreamDefaultWriter<W>;
5553 }
5554
5555 declare var WritableStream: {
5556     prototype: WritableStream;
5557     new<W = any>(underlyingSink?: UnderlyingSink<W>, strategy?: QueuingStrategy<W>): WritableStream<W>;
5558 };
5559
5560 /** This Streams API interface represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate. */
5561 interface WritableStreamDefaultController {
5562     error(error?: any): void;
5563 }
5564
5565 declare var WritableStreamDefaultController: {
5566     prototype: WritableStreamDefaultController;
5567     new(): WritableStreamDefaultController;
5568 };
5569
5570 /** This Streams API interface is the object returned by WritableStream.getWriter() and once created locks the < writer to the WritableStream ensuring that no other streams can write to the underlying sink. */
5571 interface WritableStreamDefaultWriter<W = any> {
5572     readonly closed: Promise<void>;
5573     readonly desiredSize: number | null;
5574     readonly ready: Promise<void>;
5575     abort(reason?: any): Promise<void>;
5576     close(): Promise<void>;
5577     releaseLock(): void;
5578     write(chunk: W): Promise<void>;
5579 }
5580
5581 declare var WritableStreamDefaultWriter: {
5582     prototype: WritableStreamDefaultWriter;
5583     new(): WritableStreamDefaultWriter;
5584 };
5585
5586 interface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap {
5587     "readystatechange": Event;
5588 }
5589
5590 /** Use XMLHttpRequest (XHR) objects to interact with servers. You can retrieve data from a URL without having to do a full page refresh. This enables a Web page to update just part of a page without disrupting what the user is doing. */
5591 interface XMLHttpRequest extends XMLHttpRequestEventTarget {
5592     onreadystatechange: ((this: XMLHttpRequest, ev: Event) => any) | null;
5593     /**
5594      * Returns client's state.
5595      */
5596     readonly readyState: number;
5597     /**
5598      * Returns the response's body.
5599      */
5600     readonly response: any;
5601     /**
5602      * Returns the text response.
5603      * 
5604      * Throws an "InvalidStateError" DOMException if responseType is not the empty string or "text".
5605      */
5606     readonly responseText: string;
5607     /**
5608      * Returns the response type.
5609      * 
5610      * Can be set to change the response type. Values are: the empty string (default), "arraybuffer", "blob", "document", "json", and "text".
5611      * 
5612      * When set: setting to "document" is ignored if current global object is not a Window object.
5613      * 
5614      * When set: throws an "InvalidStateError" DOMException if state is loading or done.
5615      * 
5616      * When set: throws an "InvalidAccessError" DOMException if the synchronous flag is set and current global object is a Window object.
5617      */
5618     responseType: XMLHttpRequestResponseType;
5619     readonly responseURL: string;
5620     readonly status: number;
5621     readonly statusText: string;
5622     /**
5623      * Can be set to a time in milliseconds. When set to a non-zero value will cause fetching to terminate after the given time has passed. When the time has passed, the request has not yet completed, and the synchronous flag is unset, a timeout event will then be dispatched, or a "TimeoutError" DOMException will be thrown otherwise (for the send() method).
5624      * 
5625      * When set: throws an "InvalidAccessError" DOMException if the synchronous flag is set and current global object is a Window object.
5626      */
5627     timeout: number;
5628     /**
5629      * Returns the associated XMLHttpRequestUpload object. It can be used to gather transmission information when data is transferred to a server.
5630      */
5631     readonly upload: XMLHttpRequestUpload;
5632     /**
5633      * True when credentials are to be included in a cross-origin request. False when they are to be excluded in a cross-origin request and when cookies are to be ignored in its response. Initially false.
5634      * 
5635      * When set: throws an "InvalidStateError" DOMException if state is not unsent or opened, or if the send() flag is set.
5636      */
5637     withCredentials: boolean;
5638     /**
5639      * Cancels any network activity.
5640      */
5641     abort(): void;
5642     getAllResponseHeaders(): string;
5643     getResponseHeader(name: string): string | null;
5644     /**
5645      * Sets the request method, request URL, and synchronous flag.
5646      * 
5647      * Throws a "SyntaxError" DOMException if either method is not a valid HTTP method or url cannot be parsed.
5648      * 
5649      * Throws a "SecurityError" DOMException if method is a case-insensitive match for `CONNECT`, `TRACE`, or `TRACK`.
5650      * 
5651      * Throws an "InvalidAccessError" DOMException if async is false, current global object is a Window object, and the timeout attribute is not zero or the responseType attribute is not the empty string.
5652      */
5653     open(method: string, url: string): void;
5654     open(method: string, url: string, async: boolean, username?: string | null, password?: string | null): void;
5655     /**
5656      * Acts as if the `Content-Type` header value for response is mime. (It does not actually change the header though.)
5657      * 
5658      * Throws an "InvalidStateError" DOMException if state is loading or done.
5659      */
5660     overrideMimeType(mime: string): void;
5661     /**
5662      * Initiates the request. The body argument provides the request body, if any, and is ignored if the request method is GET or HEAD.
5663      * 
5664      * Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set.
5665      */
5666     send(body?: BodyInit | null): void;
5667     /**
5668      * Combines a header in author request headers.
5669      * 
5670      * Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set.
5671      * 
5672      * Throws a "SyntaxError" DOMException if name is not a header name or if value is not a header value.
5673      */
5674     setRequestHeader(name: string, value: string): void;
5675     readonly DONE: number;
5676     readonly HEADERS_RECEIVED: number;
5677     readonly LOADING: number;
5678     readonly OPENED: number;
5679     readonly UNSENT: number;
5680     addEventListener<K extends keyof XMLHttpRequestEventMap>(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
5681     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
5682     removeEventListener<K extends keyof XMLHttpRequestEventMap>(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
5683     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
5684 }
5685
5686 declare var XMLHttpRequest: {
5687     prototype: XMLHttpRequest;
5688     new(): XMLHttpRequest;
5689     readonly DONE: number;
5690     readonly HEADERS_RECEIVED: number;
5691     readonly LOADING: number;
5692     readonly OPENED: number;
5693     readonly UNSENT: number;
5694 };
5695
5696 interface XMLHttpRequestEventTargetEventMap {
5697     "abort": ProgressEvent<XMLHttpRequestEventTarget>;
5698     "error": ProgressEvent<XMLHttpRequestEventTarget>;
5699     "load": ProgressEvent<XMLHttpRequestEventTarget>;
5700     "loadend": ProgressEvent<XMLHttpRequestEventTarget>;
5701     "loadstart": ProgressEvent<XMLHttpRequestEventTarget>;
5702     "progress": ProgressEvent<XMLHttpRequestEventTarget>;
5703     "timeout": ProgressEvent<XMLHttpRequestEventTarget>;
5704 }
5705
5706 interface XMLHttpRequestEventTarget extends EventTarget {
5707     onabort: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
5708     onerror: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
5709     onload: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
5710     onloadend: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
5711     onloadstart: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
5712     onprogress: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
5713     ontimeout: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
5714     addEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
5715     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
5716     removeEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
5717     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
5718 }
5719
5720 declare var XMLHttpRequestEventTarget: {
5721     prototype: XMLHttpRequestEventTarget;
5722     new(): XMLHttpRequestEventTarget;
5723 };
5724
5725 interface XMLHttpRequestUpload extends XMLHttpRequestEventTarget {
5726     addEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
5727     addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
5728     removeEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
5729     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
5730 }
5731
5732 declare var XMLHttpRequestUpload: {
5733     prototype: XMLHttpRequestUpload;
5734     new(): XMLHttpRequestUpload;
5735 };
5736
5737 declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
5738
5739 interface Console {
5740     memory: any;
5741     assert(condition?: boolean, ...data: any[]): void;
5742     clear(): void;
5743     count(label?: string): void;
5744     countReset(label?: string): void;
5745     debug(...data: any[]): void;
5746     dir(item?: any, options?: any): void;
5747     dirxml(...data: any[]): void;
5748     error(...data: any[]): void;
5749     exception(message?: string, ...optionalParams: any[]): void;
5750     group(...data: any[]): void;
5751     groupCollapsed(...data: any[]): void;
5752     groupEnd(): void;
5753     info(...data: any[]): void;
5754     log(...data: any[]): void;
5755     table(tabularData?: any, properties?: string[]): void;
5756     time(label?: string): void;
5757     timeEnd(label?: string): void;
5758     timeLog(label?: string, ...data: any[]): void;
5759     timeStamp(label?: string): void;
5760     trace(...data: any[]): void;
5761     warn(...data: any[]): void;
5762 }
5763
5764 declare var console: Console;
5765
5766 declare namespace WebAssembly {
5767     interface Global {
5768         value: any;
5769         valueOf(): any;
5770     }
5771     
5772     var Global: {
5773         prototype: Global;
5774         new(descriptor: GlobalDescriptor, v?: any): Global;
5775     };
5776     
5777     interface Instance {
5778         readonly exports: Exports;
5779     }
5780     
5781     var Instance: {
5782         prototype: Instance;
5783         new(module: Module, importObject?: Imports): Instance;
5784     };
5785     
5786     interface Memory {
5787         readonly buffer: ArrayBuffer;
5788         grow(delta: number): number;
5789     }
5790     
5791     var Memory: {
5792         prototype: Memory;
5793         new(descriptor: MemoryDescriptor): Memory;
5794     };
5795     
5796     interface Module {
5797     }
5798     
5799     var Module: {
5800         prototype: Module;
5801         new(bytes: BufferSource): Module;
5802         customSections(moduleObject: Module, sectionName: string): ArrayBuffer[];
5803         exports(moduleObject: Module): ModuleExportDescriptor[];
5804         imports(moduleObject: Module): ModuleImportDescriptor[];
5805     };
5806     
5807     interface Table {
5808         readonly length: number;
5809         get(index: number): Function | null;
5810         grow(delta: number): number;
5811         set(index: number, value: Function | null): void;
5812     }
5813     
5814     var Table: {
5815         prototype: Table;
5816         new(descriptor: TableDescriptor): Table;
5817     };
5818     
5819     interface GlobalDescriptor {
5820         mutable?: boolean;
5821         value: ValueType;
5822     }
5823     
5824     interface MemoryDescriptor {
5825         initial: number;
5826         maximum?: number;
5827     }
5828     
5829     interface ModuleExportDescriptor {
5830         kind: ImportExportKind;
5831         name: string;
5832     }
5833     
5834     interface ModuleImportDescriptor {
5835         kind: ImportExportKind;
5836         module: string;
5837         name: string;
5838     }
5839     
5840     interface TableDescriptor {
5841         element: TableKind;
5842         initial: number;
5843         maximum?: number;
5844     }
5845     
5846     interface WebAssemblyInstantiatedSource {
5847         instance: Instance;
5848         module: Module;
5849     }
5850     
5851     type ImportExportKind = "function" | "global" | "memory" | "table";
5852     type TableKind = "anyfunc";
5853     type ValueType = "f32" | "f64" | "i32" | "i64";
5854     type ExportValue = Function | Global | Memory | Table;
5855     type Exports = Record<string, ExportValue>;
5856     type ImportValue = ExportValue | number;
5857     type ModuleImports = Record<string, ImportValue>;
5858     type Imports = Record<string, ModuleImports>;
5859     function compile(bytes: BufferSource): Promise<Module>;
5860     function compileStreaming(source: Response | Promise<Response>): Promise<Module>;
5861     function instantiate(bytes: BufferSource, importObject?: Imports): Promise<WebAssemblyInstantiatedSource>;
5862     function instantiate(moduleObject: Module, importObject?: Imports): Promise<Instance>;
5863     function instantiateStreaming(response: Response | PromiseLike<Response>, importObject?: Imports): Promise<WebAssemblyInstantiatedSource>;
5864     function validate(bytes: BufferSource): boolean;
5865 }
5866
5867 interface FrameRequestCallback {
5868     (time: number): void;
5869 }
5870
5871 interface OnErrorEventHandlerNonNull {
5872     (event: Event | string, source?: string, lineno?: number, colno?: number, error?: Error): any;
5873 }
5874
5875 interface PerformanceObserverCallback {
5876     (entries: PerformanceObserverEntryList, observer: PerformanceObserver): void;
5877 }
5878
5879 interface QueuingStrategySizeCallback<T = any> {
5880     (chunk: T): number;
5881 }
5882
5883 interface ReadableByteStreamControllerCallback {
5884     (controller: ReadableByteStreamController): void | PromiseLike<void>;
5885 }
5886
5887 interface ReadableStreamDefaultControllerCallback<R> {
5888     (controller: ReadableStreamDefaultController<R>): void | PromiseLike<void>;
5889 }
5890
5891 interface ReadableStreamErrorCallback {
5892     (reason: any): void | PromiseLike<void>;
5893 }
5894
5895 interface TransformStreamDefaultControllerCallback<O> {
5896     (controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
5897 }
5898
5899 interface TransformStreamDefaultControllerTransformCallback<I, O> {
5900     (chunk: I, controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
5901 }
5902
5903 interface VoidFunction {
5904     (): void;
5905 }
5906
5907 interface WritableStreamDefaultControllerCloseCallback {
5908     (): void | PromiseLike<void>;
5909 }
5910
5911 interface WritableStreamDefaultControllerStartCallback {
5912     (controller: WritableStreamDefaultController): void | PromiseLike<void>;
5913 }
5914
5915 interface WritableStreamDefaultControllerWriteCallback<W> {
5916     (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike<void>;
5917 }
5918
5919 interface WritableStreamErrorCallback {
5920     (reason: any): void | PromiseLike<void>;
5921 }
5922
5923 /**
5924  * Returns dedicatedWorkerGlobal's name, i.e. the value given to the Worker constructor. Primarily useful for debugging.
5925  */
5926 declare var name: string;
5927 declare var onmessage: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null;
5928 declare var onmessageerror: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null;
5929 /**
5930  * Aborts dedicatedWorkerGlobal.
5931  */
5932 declare function close(): void;
5933 /**
5934  * Clones message and transmits it to the Worker object associated with dedicatedWorkerGlobal. transfer can be passed as a list of objects that are to be transferred rather than cloned.
5935  */
5936 declare function postMessage(message: any, transfer: Transferable[]): void;
5937 declare function postMessage(message: any, options?: PostMessageOptions): void;
5938 /**
5939  * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
5940  */
5941 declare function dispatchEvent(event: Event): boolean;
5942 /**
5943  * Returns workerGlobal's WorkerLocation object.
5944  */
5945 declare var location: WorkerLocation;
5946 declare var navigator: WorkerNavigator;
5947 declare var onerror: ((this: DedicatedWorkerGlobalScope, ev: ErrorEvent) => any) | null;
5948 declare var onlanguagechange: ((this: DedicatedWorkerGlobalScope, ev: Event) => any) | null;
5949 declare var onoffline: ((this: DedicatedWorkerGlobalScope, ev: Event) => any) | null;
5950 declare var ononline: ((this: DedicatedWorkerGlobalScope, ev: Event) => any) | null;
5951 declare var onrejectionhandled: ((this: DedicatedWorkerGlobalScope, ev: PromiseRejectionEvent) => any) | null;
5952 declare var onunhandledrejection: ((this: DedicatedWorkerGlobalScope, ev: PromiseRejectionEvent) => any) | null;
5953 /**
5954  * Returns workerGlobal.
5955  */
5956 declare var self: WorkerGlobalScope & typeof globalThis;
5957 /**
5958  * Fetches each URL in urls, executes them one-by-one in the order they are passed, and then returns (or throws if something went amiss).
5959  */
5960 declare function importScripts(...urls: string[]): void;
5961 /**
5962  * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
5963  */
5964 declare function dispatchEvent(event: Event): boolean;
5965 declare var caches: CacheStorage;
5966 declare var crypto: Crypto;
5967 declare var indexedDB: IDBFactory;
5968 declare var isSecureContext: boolean;
5969 declare var origin: string;
5970 declare var performance: Performance;
5971 declare function atob(data: string): string;
5972 declare function btoa(data: string): string;
5973 declare function clearInterval(handle?: number): void;
5974 declare function clearTimeout(handle?: number): void;
5975 declare function createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
5976 declare function createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
5977 declare function fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
5978 declare function queueMicrotask(callback: VoidFunction): void;
5979 declare function setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
5980 declare function setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
5981 declare function cancelAnimationFrame(handle: number): void;
5982 declare function requestAnimationFrame(callback: FrameRequestCallback): number;
5983 declare function addEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
5984 declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
5985 declare function removeEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
5986 declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
5987 type HeadersInit = Headers | string[][] | Record<string, string>;
5988 type BodyInit = Blob | BufferSource | FormData | URLSearchParams | ReadableStream<Uint8Array> | string;
5989 type RequestInfo = Request | string;
5990 type BlobPart = BufferSource | Blob | string;
5991 type DOMHighResTimeStamp = number;
5992 type CanvasImageSource = ImageBitmap | OffscreenCanvas;
5993 type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
5994 type MessageEventSource = MessagePort | ServiceWorker;
5995 type ImageBitmapSource = CanvasImageSource | Blob | ImageData;
5996 type OnErrorEventHandler = OnErrorEventHandlerNonNull | null;
5997 type TimerHandler = string | Function;
5998 type PerformanceEntryList = PerformanceEntry[];
5999 type PushMessageDataInit = BufferSource | string;
6000 type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>;
6001 type VibratePattern = number | number[];
6002 type AlgorithmIdentifier = string | Algorithm;
6003 type HashAlgorithmIdentifier = AlgorithmIdentifier;
6004 type BigInteger = Uint8Array;
6005 type NamedCurve = string;
6006 type GLenum = number;
6007 type GLboolean = boolean;
6008 type GLbitfield = number;
6009 type GLint = number;
6010 type GLsizei = number;
6011 type GLintptr = number;
6012 type GLsizeiptr = number;
6013 type GLuint = number;
6014 type GLfloat = number;
6015 type GLclampf = number;
6016 type TexImageSource = ImageBitmap | ImageData | OffscreenCanvas;
6017 type Float32List = Float32Array | GLfloat[];
6018 type Int32List = Int32Array | GLint[];
6019 type GLint64 = number;
6020 type GLuint64 = number;
6021 type Uint32List = Uint32Array | GLuint[];
6022 type BufferSource = ArrayBufferView | ArrayBuffer;
6023 type DOMTimeStamp = number;
6024 type FormDataEntryValue = File | string;
6025 type IDBValidKey = number | string | Date | BufferSource | IDBArrayKey;
6026 type Transferable = ArrayBuffer | MessagePort | ImageBitmap | OffscreenCanvas;
6027 type BinaryType = "arraybuffer" | "blob";
6028 type CanvasDirection = "inherit" | "ltr" | "rtl";
6029 type CanvasFillRule = "evenodd" | "nonzero";
6030 type CanvasLineCap = "butt" | "round" | "square";
6031 type CanvasLineJoin = "bevel" | "miter" | "round";
6032 type CanvasTextAlign = "center" | "end" | "left" | "right" | "start";
6033 type CanvasTextBaseline = "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top";
6034 type ClientTypes = "all" | "sharedworker" | "window" | "worker";
6035 type ColorSpaceConversion = "default" | "none";
6036 type EndingType = "native" | "transparent";
6037 type FrameType = "auxiliary" | "nested" | "none" | "top-level";
6038 type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";
6039 type IDBRequestReadyState = "done" | "pending";
6040 type IDBTransactionMode = "readonly" | "readwrite" | "versionchange";
6041 type ImageOrientation = "flipY" | "none";
6042 type ImageSmoothingQuality = "high" | "low" | "medium";
6043 type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki";
6044 type KeyType = "private" | "public" | "secret";
6045 type KeyUsage = "decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey";
6046 type NotificationDirection = "auto" | "ltr" | "rtl";
6047 type NotificationPermission = "default" | "denied" | "granted";
6048 type OffscreenRenderingContextId = "2d" | "bitmaprenderer" | "webgl" | "webgl2";
6049 type PermissionName = "accelerometer" | "ambient-light-sensor" | "background-sync" | "bluetooth" | "camera" | "clipboard" | "device-info" | "geolocation" | "gyroscope" | "magnetometer" | "microphone" | "midi" | "notifications" | "persistent-storage" | "push" | "speaker";
6050 type PermissionState = "denied" | "granted" | "prompt";
6051 type PremultiplyAlpha = "default" | "none" | "premultiply";
6052 type PushEncryptionKeyName = "auth" | "p256dh";
6053 type PushPermissionState = "denied" | "granted" | "prompt";
6054 type ReferrerPolicy = "" | "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url";
6055 type RequestCache = "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload";
6056 type RequestCredentials = "include" | "omit" | "same-origin";
6057 type RequestDestination = "" | "audio" | "audioworklet" | "document" | "embed" | "font" | "image" | "manifest" | "object" | "paintworklet" | "report" | "script" | "sharedworker" | "style" | "track" | "video" | "worker" | "xslt";
6058 type RequestMode = "cors" | "navigate" | "no-cors" | "same-origin";
6059 type RequestRedirect = "error" | "follow" | "manual";
6060 type ResizeQuality = "high" | "low" | "medium" | "pixelated";
6061 type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect";
6062 type ServiceWorkerState = "activated" | "activating" | "installed" | "installing" | "parsed" | "redundant";
6063 type ServiceWorkerUpdateViaCache = "all" | "imports" | "none";
6064 type VisibilityState = "hidden" | "visible";
6065 type WebGLPowerPreference = "default" | "high-performance" | "low-power";
6066 type WorkerType = "classic" | "module";
6067 type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text";