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