• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*! *****************************************************************************
2Copyright (c) Microsoft Corporation. All rights reserved.
3Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4this file except in compliance with the License. You may obtain a copy of the
5License at http://www.apache.org/licenses/LICENSE-2.0
6
7THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10MERCHANTABLITY OR NON-INFRINGEMENT.
11
12See the Apache Version 2.0 License for specific language governing permissions
13and limitations under the License.
14***************************************************************************** */
15
16
17
18/// <reference no-default-lib="true"/>
19
20
21/////////////////////////////
22/// Window Iterable APIs
23/////////////////////////////
24
25interface AudioParam {
26    setValueCurveAtTime(values: Iterable<number>, startTime: number, duration: number): AudioParam;
27}
28
29interface AudioParamMap extends ReadonlyMap<string, AudioParam> {
30}
31
32interface BaseAudioContext {
33    createIIRFilter(feedforward: Iterable<number>, feedback: Iterable<number>): IIRFilterNode;
34    createPeriodicWave(real: Iterable<number>, imag: Iterable<number>, constraints?: PeriodicWaveConstraints): PeriodicWave;
35}
36
37interface CSSRuleList {
38    [Symbol.iterator](): IterableIterator<CSSRule>;
39}
40
41interface CSSStyleDeclaration {
42    [Symbol.iterator](): IterableIterator<string>;
43}
44
45interface Cache {
46    addAll(requests: Iterable<RequestInfo>): Promise<void>;
47}
48
49interface CanvasPath {
50    roundRect(x: number, y: number, w: number, h: number, radii?: number | DOMPointInit | Iterable<number | DOMPointInit>): void;
51}
52
53interface CanvasPathDrawingStyles {
54    setLineDash(segments: Iterable<number>): void;
55}
56
57interface DOMRectList {
58    [Symbol.iterator](): IterableIterator<DOMRect>;
59}
60
61interface DOMStringList {
62    [Symbol.iterator](): IterableIterator<string>;
63}
64
65interface DOMTokenList {
66    [Symbol.iterator](): IterableIterator<string>;
67    entries(): IterableIterator<[number, string]>;
68    keys(): IterableIterator<number>;
69    values(): IterableIterator<string>;
70}
71
72interface DataTransferItemList {
73    [Symbol.iterator](): IterableIterator<DataTransferItem>;
74}
75
76interface EventCounts extends ReadonlyMap<string, number> {
77}
78
79interface FileList {
80    [Symbol.iterator](): IterableIterator<File>;
81}
82
83interface FontFaceSet extends Set<FontFace> {
84}
85
86interface FormData {
87    [Symbol.iterator](): IterableIterator<[string, FormDataEntryValue]>;
88    /** Returns an array of key, value pairs for every entry in the list. */
89    entries(): IterableIterator<[string, FormDataEntryValue]>;
90    /** Returns a list of keys in the list. */
91    keys(): IterableIterator<string>;
92    /** Returns a list of values in the list. */
93    values(): IterableIterator<FormDataEntryValue>;
94}
95
96interface HTMLAllCollection {
97    [Symbol.iterator](): IterableIterator<Element>;
98}
99
100interface HTMLCollectionBase {
101    [Symbol.iterator](): IterableIterator<Element>;
102}
103
104interface HTMLCollectionOf<T extends Element> {
105    [Symbol.iterator](): IterableIterator<T>;
106}
107
108interface HTMLFormElement {
109    [Symbol.iterator](): IterableIterator<Element>;
110}
111
112interface HTMLSelectElement {
113    [Symbol.iterator](): IterableIterator<HTMLOptionElement>;
114}
115
116interface Headers {
117    [Symbol.iterator](): IterableIterator<[string, string]>;
118    /** Returns an iterator allowing to go through all key/value pairs contained in this object. */
119    entries(): IterableIterator<[string, string]>;
120    /** Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
121    keys(): IterableIterator<string>;
122    /** Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
123    values(): IterableIterator<string>;
124}
125
126interface IDBDatabase {
127    /** 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. */
128    transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
129}
130
131interface IDBObjectStore {
132    /**
133     * 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.
134     *
135     * Throws an "InvalidStateError" DOMException if not called within an upgrade transaction.
136     */
137    createIndex(name: string, keyPath: string | Iterable<string>, options?: IDBIndexParameters): IDBIndex;
138}
139
140interface MediaKeyStatusMap {
141    [Symbol.iterator](): IterableIterator<[BufferSource, MediaKeyStatus]>;
142    entries(): IterableIterator<[BufferSource, MediaKeyStatus]>;
143    keys(): IterableIterator<BufferSource>;
144    values(): IterableIterator<MediaKeyStatus>;
145}
146
147interface MediaList {
148    [Symbol.iterator](): IterableIterator<string>;
149}
150
151interface MessageEvent<T = any> {
152    /** @deprecated */
153    initMessageEvent(type: string, bubbles?: boolean, cancelable?: boolean, data?: any, origin?: string, lastEventId?: string, source?: MessageEventSource | null, ports?: Iterable<MessagePort>): void;
154}
155
156interface MimeTypeArray {
157    [Symbol.iterator](): IterableIterator<MimeType>;
158}
159
160interface NamedNodeMap {
161    [Symbol.iterator](): IterableIterator<Attr>;
162}
163
164interface Navigator {
165    /** Available only in secure contexts. */
166    requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: Iterable<MediaKeySystemConfiguration>): Promise<MediaKeySystemAccess>;
167    vibrate(pattern: Iterable<number>): boolean;
168}
169
170interface NodeList {
171    [Symbol.iterator](): IterableIterator<Node>;
172    /** Returns an array of key, value pairs for every entry in the list. */
173    entries(): IterableIterator<[number, Node]>;
174    /** Returns an list of keys in the list. */
175    keys(): IterableIterator<number>;
176    /** Returns an list of values in the list. */
177    values(): IterableIterator<Node>;
178}
179
180interface NodeListOf<TNode extends Node> {
181    [Symbol.iterator](): IterableIterator<TNode>;
182    /** Returns an array of key, value pairs for every entry in the list. */
183    entries(): IterableIterator<[number, TNode]>;
184    /** Returns an list of keys in the list. */
185    keys(): IterableIterator<number>;
186    /** Returns an list of values in the list. */
187    values(): IterableIterator<TNode>;
188}
189
190interface Plugin {
191    [Symbol.iterator](): IterableIterator<MimeType>;
192}
193
194interface PluginArray {
195    [Symbol.iterator](): IterableIterator<Plugin>;
196}
197
198interface RTCRtpTransceiver {
199    setCodecPreferences(codecs: Iterable<RTCRtpCodecCapability>): void;
200}
201
202interface RTCStatsReport extends ReadonlyMap<string, any> {
203}
204
205interface SVGLengthList {
206    [Symbol.iterator](): IterableIterator<SVGLength>;
207}
208
209interface SVGNumberList {
210    [Symbol.iterator](): IterableIterator<SVGNumber>;
211}
212
213interface SVGPointList {
214    [Symbol.iterator](): IterableIterator<DOMPoint>;
215}
216
217interface SVGStringList {
218    [Symbol.iterator](): IterableIterator<string>;
219}
220
221interface SVGTransformList {
222    [Symbol.iterator](): IterableIterator<SVGTransform>;
223}
224
225interface SourceBufferList {
226    [Symbol.iterator](): IterableIterator<SourceBuffer>;
227}
228
229interface SpeechRecognitionResult {
230    [Symbol.iterator](): IterableIterator<SpeechRecognitionAlternative>;
231}
232
233interface SpeechRecognitionResultList {
234    [Symbol.iterator](): IterableIterator<SpeechRecognitionResult>;
235}
236
237interface StyleSheetList {
238    [Symbol.iterator](): IterableIterator<CSSStyleSheet>;
239}
240
241interface SubtleCrypto {
242    deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
243    generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
244    generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
245    generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>;
246    importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
247    importKey(format: Exclude<KeyFormat, "jwk">, keyData: BufferSource, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
248    unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
249}
250
251interface TextTrackCueList {
252    [Symbol.iterator](): IterableIterator<TextTrackCue>;
253}
254
255interface TextTrackList {
256    [Symbol.iterator](): IterableIterator<TextTrack>;
257}
258
259interface TouchList {
260    [Symbol.iterator](): IterableIterator<Touch>;
261}
262
263interface URLSearchParams {
264    [Symbol.iterator](): IterableIterator<[string, string]>;
265    /** Returns an array of key, value pairs for every entry in the search params. */
266    entries(): IterableIterator<[string, string]>;
267    /** Returns a list of keys in the search params. */
268    keys(): IterableIterator<string>;
269    /** Returns a list of values in the search params. */
270    values(): IterableIterator<string>;
271}
272
273interface WEBGL_draw_buffers {
274    drawBuffersWEBGL(buffers: Iterable<GLenum>): void;
275}
276
277interface WEBGL_multi_draw {
278    multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: GLuint, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: GLuint, drawcount: GLsizei): void;
279    multiDrawArraysWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: GLuint, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, drawcount: GLsizei): void;
280    multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: GLuint, drawcount: GLsizei): void;
281    multiDrawElementsWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, drawcount: GLsizei): void;
282}
283
284interface WebGL2RenderingContextBase {
285    clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLfloat>, srcOffset?: GLuint): void;
286    clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLint>, srcOffset?: GLuint): void;
287    clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLuint>, srcOffset?: GLuint): void;
288    drawBuffers(buffers: Iterable<GLenum>): void;
289    getActiveUniforms(program: WebGLProgram, uniformIndices: Iterable<GLuint>, pname: GLenum): any;
290    getUniformIndices(program: WebGLProgram, uniformNames: Iterable<string>): Iterable<GLuint> | null;
291    invalidateFramebuffer(target: GLenum, attachments: Iterable<GLenum>): void;
292    invalidateSubFramebuffer(target: GLenum, attachments: Iterable<GLenum>, x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
293    transformFeedbackVaryings(program: WebGLProgram, varyings: Iterable<string>, bufferMode: GLenum): void;
294    uniform1uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
295    uniform2uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
296    uniform3uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
297    uniform4uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
298    uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
299    uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
300    uniformMatrix3x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
301    uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
302    uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
303    uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
304    vertexAttribI4iv(index: GLuint, values: Iterable<GLint>): void;
305    vertexAttribI4uiv(index: GLuint, values: Iterable<GLuint>): void;
306}
307
308interface WebGL2RenderingContextOverloads {
309    uniform1fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
310    uniform1iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
311    uniform2fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
312    uniform2iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
313    uniform3fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
314    uniform3iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
315    uniform4fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
316    uniform4iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
317    uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
318    uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
319    uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
320}
321
322interface WebGLRenderingContextBase {
323    vertexAttrib1fv(index: GLuint, values: Iterable<GLfloat>): void;
324    vertexAttrib2fv(index: GLuint, values: Iterable<GLfloat>): void;
325    vertexAttrib3fv(index: GLuint, values: Iterable<GLfloat>): void;
326    vertexAttrib4fv(index: GLuint, values: Iterable<GLfloat>): void;
327}
328
329interface WebGLRenderingContextOverloads {
330    uniform1fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
331    uniform1iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
332    uniform2fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
333    uniform2iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
334    uniform3fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
335    uniform3iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
336    uniform4fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
337    uniform4iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
338    uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;
339    uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;
340    uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;
341}
342