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