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
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.
12 See the Apache Version 2.0 License for specific language governing permissions
13 and limitations under the License.
14 ***************************************************************************** */
18 /// <reference no-default-lib="true"/>
\r
21 /////////////////////////////
22 /// Window Iterable APIs
23 /////////////////////////////
25 interface AudioParam {
26 setValueCurveAtTime(values: Iterable<number>, startTime: number, duration: number): AudioParam;
29 interface AudioParamMap extends ReadonlyMap<string, AudioParam> {
32 interface BaseAudioContext {
33 createIIRFilter(feedforward: Iterable<number>, feedback: Iterable<number>): IIRFilterNode;
34 createPeriodicWave(real: Iterable<number>, imag: Iterable<number>, constraints?: PeriodicWaveConstraints): PeriodicWave;
37 interface CSSRuleList {
38 [Symbol.iterator](): IterableIterator<CSSRule>;
41 interface CSSStyleDeclaration {
42 [Symbol.iterator](): IterableIterator<string>;
46 addAll(requests: Iterable<RequestInfo>): Promise<void>;
49 interface CanvasPathDrawingStyles {
50 setLineDash(segments: Iterable<number>): void;
53 interface DOMRectList {
54 [Symbol.iterator](): IterableIterator<DOMRect>;
57 interface DOMStringList {
58 [Symbol.iterator](): IterableIterator<string>;
61 interface DOMTokenList {
62 [Symbol.iterator](): IterableIterator<string>;
63 entries(): IterableIterator<[number, string]>;
64 keys(): IterableIterator<number>;
65 values(): IterableIterator<string>;
68 interface DataTransferItemList {
69 [Symbol.iterator](): IterableIterator<DataTransferItem>;
73 [Symbol.iterator](): IterableIterator<File>;
76 interface FontFaceSet extends Set<FontFace> {
80 [Symbol.iterator](): IterableIterator<[string, FormDataEntryValue]>;
81 /** Returns an array of key, value pairs for every entry in the list. */
82 entries(): IterableIterator<[string, FormDataEntryValue]>;
83 /** Returns a list of keys in the list. */
84 keys(): IterableIterator<string>;
85 /** Returns a list of values in the list. */
86 values(): IterableIterator<FormDataEntryValue>;
89 interface HTMLAllCollection {
90 [Symbol.iterator](): IterableIterator<Element>;
93 interface HTMLCollectionBase {
94 [Symbol.iterator](): IterableIterator<Element>;
97 interface HTMLCollectionOf<T extends Element> {
98 [Symbol.iterator](): IterableIterator<T>;
101 interface HTMLFormElement {
102 [Symbol.iterator](): IterableIterator<Element>;
105 interface HTMLSelectElement {
106 [Symbol.iterator](): IterableIterator<HTMLOptionElement>;
110 [Symbol.iterator](): IterableIterator<[string, string]>;
111 /** Returns an iterator allowing to go through all key/value pairs contained in this object. */
112 entries(): IterableIterator<[string, string]>;
113 /** Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
114 keys(): IterableIterator<string>;
115 /** Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
116 values(): IterableIterator<string>;
119 interface IDBDatabase {
120 /** 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. */
121 transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode): IDBTransaction;
124 interface IDBObjectStore {
126 * 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.
128 * Throws an "InvalidStateError" DOMException if not called within an upgrade transaction.
130 createIndex(name: string, keyPath: string | Iterable<string>, options?: IDBIndexParameters): IDBIndex;
133 interface MediaKeyStatusMap {
134 [Symbol.iterator](): IterableIterator<[BufferSource, MediaKeyStatus]>;
135 entries(): IterableIterator<[BufferSource, MediaKeyStatus]>;
136 keys(): IterableIterator<BufferSource>;
137 values(): IterableIterator<MediaKeyStatus>;
140 interface MediaList {
141 [Symbol.iterator](): IterableIterator<string>;
144 interface MessageEvent<T = any> {
146 initMessageEvent(type: string, bubbles?: boolean, cancelable?: boolean, data?: any, origin?: string, lastEventId?: string, source?: MessageEventSource | null, ports?: Iterable<MessagePort>): void;
149 interface MimeTypeArray {
150 [Symbol.iterator](): IterableIterator<MimeType>;
153 interface NamedNodeMap {
154 [Symbol.iterator](): IterableIterator<Attr>;
157 interface Navigator {
158 /** Available only in secure contexts. */
159 requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: Iterable<MediaKeySystemConfiguration>): Promise<MediaKeySystemAccess>;
160 vibrate(pattern: Iterable<number>): boolean;
164 [Symbol.iterator](): IterableIterator<Node>;
165 /** Returns an array of key, value pairs for every entry in the list. */
166 entries(): IterableIterator<[number, Node]>;
167 /** Returns an list of keys in the list. */
168 keys(): IterableIterator<number>;
169 /** Returns an list of values in the list. */
170 values(): IterableIterator<Node>;
173 interface NodeListOf<TNode extends Node> {
174 [Symbol.iterator](): IterableIterator<TNode>;
175 /** Returns an array of key, value pairs for every entry in the list. */
176 entries(): IterableIterator<[number, TNode]>;
177 /** Returns an list of keys in the list. */
178 keys(): IterableIterator<number>;
179 /** Returns an list of values in the list. */
180 values(): IterableIterator<TNode>;
184 [Symbol.iterator](): IterableIterator<MimeType>;
187 interface PluginArray {
188 [Symbol.iterator](): IterableIterator<Plugin>;
191 interface RTCStatsReport extends ReadonlyMap<string, any> {
194 interface SVGLengthList {
195 [Symbol.iterator](): IterableIterator<SVGLength>;
198 interface SVGNumberList {
199 [Symbol.iterator](): IterableIterator<SVGNumber>;
202 interface SVGPointList {
203 [Symbol.iterator](): IterableIterator<DOMPoint>;
206 interface SVGStringList {
207 [Symbol.iterator](): IterableIterator<string>;
210 interface SVGTransformList {
211 [Symbol.iterator](): IterableIterator<SVGTransform>;
214 interface SourceBufferList {
215 [Symbol.iterator](): IterableIterator<SourceBuffer>;
218 interface SpeechRecognitionResult {
219 [Symbol.iterator](): IterableIterator<SpeechRecognitionAlternative>;
222 interface SpeechRecognitionResultList {
223 [Symbol.iterator](): IterableIterator<SpeechRecognitionResult>;
226 interface StyleSheetList {
227 [Symbol.iterator](): IterableIterator<CSSStyleSheet>;
230 interface SubtleCrypto {
231 deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
232 generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>;
233 generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
234 generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>;
235 importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
236 importKey(format: Exclude<KeyFormat, "jwk">, keyData: BufferSource, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
237 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>;
240 interface TextTrackCueList {
241 [Symbol.iterator](): IterableIterator<TextTrackCue>;
244 interface TextTrackList {
245 [Symbol.iterator](): IterableIterator<TextTrack>;
248 interface TouchList {
249 [Symbol.iterator](): IterableIterator<Touch>;
252 interface URLSearchParams {
253 [Symbol.iterator](): IterableIterator<[string, string]>;
254 /** Returns an array of key, value pairs for every entry in the search params. */
255 entries(): IterableIterator<[string, string]>;
256 /** Returns a list of keys in the search params. */
257 keys(): IterableIterator<string>;
258 /** Returns a list of values in the search params. */
259 values(): IterableIterator<string>;
262 interface WEBGL_draw_buffers {
263 drawBuffersWEBGL(buffers: Iterable<GLenum>): void;
266 interface WebGL2RenderingContextBase {
267 clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLfloat>, srcOffset?: GLuint): void;
268 clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLint>, srcOffset?: GLuint): void;
269 clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLuint>, srcOffset?: GLuint): void;
270 drawBuffers(buffers: Iterable<GLenum>): void;
271 getActiveUniforms(program: WebGLProgram, uniformIndices: Iterable<GLuint>, pname: GLenum): any;
272 getUniformIndices(program: WebGLProgram, uniformNames: Iterable<string>): Iterable<GLuint> | null;
273 invalidateFramebuffer(target: GLenum, attachments: Iterable<GLenum>): void;
274 invalidateSubFramebuffer(target: GLenum, attachments: Iterable<GLenum>, x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
275 transformFeedbackVaryings(program: WebGLProgram, varyings: Iterable<string>, bufferMode: GLenum): void;
276 uniform1uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
277 uniform2uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
278 uniform3uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
279 uniform4uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
280 uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
281 uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
282 uniformMatrix3x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
283 uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
284 uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
285 uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
286 vertexAttribI4iv(index: GLuint, values: Iterable<GLint>): void;
287 vertexAttribI4uiv(index: GLuint, values: Iterable<GLuint>): void;
290 interface WebGL2RenderingContextOverloads {
291 uniform1fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
292 uniform1iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
293 uniform2fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
294 uniform2iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
295 uniform3fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
296 uniform3iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
297 uniform4fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
298 uniform4iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
299 uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
300 uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
301 uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
304 interface WebGLRenderingContextBase {
305 vertexAttrib1fv(index: GLuint, values: Iterable<GLfloat>): void;
306 vertexAttrib2fv(index: GLuint, values: Iterable<GLfloat>): void;
307 vertexAttrib3fv(index: GLuint, values: Iterable<GLfloat>): void;
308 vertexAttrib4fv(index: GLuint, values: Iterable<GLfloat>): void;
311 interface WebGLRenderingContextOverloads {
312 uniform1fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
313 uniform1iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
314 uniform2fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
315 uniform2iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
316 uniform3fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
317 uniform3iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
318 uniform4fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
319 uniform4iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
320 uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;
321 uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;
322 uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;