UNPKG

16.4 kBTypeScriptView Raw
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 CanvasPathDrawingStyles {
50 setLineDash(segments: Iterable<number>): void;
51}
52
53interface DOMRectList {
54 [Symbol.iterator](): IterableIterator<DOMRect>;
55}
56
57interface DOMStringList {
58 [Symbol.iterator](): IterableIterator<string>;
59}
60
61interface DOMTokenList {
62 [Symbol.iterator](): IterableIterator<string>;
63 entries(): IterableIterator<[number, string]>;
64 keys(): IterableIterator<number>;
65 values(): IterableIterator<string>;
66}
67
68interface DataTransferItemList {
69 [Symbol.iterator](): IterableIterator<DataTransferItem>;
70}
71
72interface EventCounts extends ReadonlyMap<string, number> {
73}
74
75interface FileList {
76 [Symbol.iterator](): IterableIterator<File>;
77}
78
79interface FontFaceSet extends Set<FontFace> {
80}
81
82interface FormData {
83 [Symbol.iterator](): IterableIterator<[string, FormDataEntryValue]>;
84 /** Returns an array of key, value pairs for every entry in the list. */
85 entries(): IterableIterator<[string, FormDataEntryValue]>;
86 /** Returns a list of keys in the list. */
87 keys(): IterableIterator<string>;
88 /** Returns a list of values in the list. */
89 values(): IterableIterator<FormDataEntryValue>;
90}
91
92interface HTMLAllCollection {
93 [Symbol.iterator](): IterableIterator<Element>;
94}
95
96interface HTMLCollectionBase {
97 [Symbol.iterator](): IterableIterator<Element>;
98}
99
100interface HTMLCollectionOf<T extends Element> {
101 [Symbol.iterator](): IterableIterator<T>;
102}
103
104interface HTMLFormElement {
105 [Symbol.iterator](): IterableIterator<Element>;
106}
107
108interface HTMLSelectElement {
109 [Symbol.iterator](): IterableIterator<HTMLOptionElement>;
110}
111
112interface Headers {
113 [Symbol.iterator](): IterableIterator<[string, string]>;
114 /** Returns an iterator allowing to go through all key/value pairs contained in this object. */
115 entries(): IterableIterator<[string, string]>;
116 /** Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
117 keys(): IterableIterator<string>;
118 /** Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
119 values(): IterableIterator<string>;
120}
121
122interface IDBDatabase {
123 /** 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. */
124 transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
125}
126
127interface IDBObjectStore {
128 /**
129 * 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.
130 *
131 * Throws an "InvalidStateError" DOMException if not called within an upgrade transaction.
132 */
133 createIndex(name: string, keyPath: string | Iterable<string>, options?: IDBIndexParameters): IDBIndex;
134}
135
136interface MediaKeyStatusMap {
137 [Symbol.iterator](): IterableIterator<[BufferSource, MediaKeyStatus]>;
138 entries(): IterableIterator<[BufferSource, MediaKeyStatus]>;
139 keys(): IterableIterator<BufferSource>;
140 values(): IterableIterator<MediaKeyStatus>;
141}
142
143interface MediaList {
144 [Symbol.iterator](): IterableIterator<string>;
145}
146
147interface MessageEvent<T = any> {
148 /** @deprecated */
149 initMessageEvent(type: string, bubbles?: boolean, cancelable?: boolean, data?: any, origin?: string, lastEventId?: string, source?: MessageEventSource | null, ports?: Iterable<MessagePort>): void;
150}
151
152interface MimeTypeArray {
153 [Symbol.iterator](): IterableIterator<MimeType>;
154}
155
156interface NamedNodeMap {
157 [Symbol.iterator](): IterableIterator<Attr>;
158}
159
160interface Navigator {
161 /** Available only in secure contexts. */
162 requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: Iterable<MediaKeySystemConfiguration>): Promise<MediaKeySystemAccess>;
163 vibrate(pattern: Iterable<number>): boolean;
164}
165
166interface NodeList {
167 [Symbol.iterator](): IterableIterator<Node>;
168 /** Returns an array of key, value pairs for every entry in the list. */
169 entries(): IterableIterator<[number, Node]>;
170 /** Returns an list of keys in the list. */
171 keys(): IterableIterator<number>;
172 /** Returns an list of values in the list. */
173 values(): IterableIterator<Node>;
174}
175
176interface NodeListOf<TNode extends Node> {
177 [Symbol.iterator](): IterableIterator<TNode>;
178 /** Returns an array of key, value pairs for every entry in the list. */
179 entries(): IterableIterator<[number, TNode]>;
180 /** Returns an list of keys in the list. */
181 keys(): IterableIterator<number>;
182 /** Returns an list of values in the list. */
183 values(): IterableIterator<TNode>;
184}
185
186interface Plugin {
187 [Symbol.iterator](): IterableIterator<MimeType>;
188}
189
190interface PluginArray {
191 [Symbol.iterator](): IterableIterator<Plugin>;
192}
193
194interface RTCRtpTransceiver {
195 setCodecPreferences(codecs: Iterable<RTCRtpCodecCapability>): void;
196}
197
198interface RTCStatsReport extends ReadonlyMap<string, any> {
199}
200
201interface SVGLengthList {
202 [Symbol.iterator](): IterableIterator<SVGLength>;
203}
204
205interface SVGNumberList {
206 [Symbol.iterator](): IterableIterator<SVGNumber>;
207}
208
209interface SVGPointList {
210 [Symbol.iterator](): IterableIterator<DOMPoint>;
211}
212
213interface SVGStringList {
214 [Symbol.iterator](): IterableIterator<string>;
215}
216
217interface SVGTransformList {
218 [Symbol.iterator](): IterableIterator<SVGTransform>;
219}
220
221interface SourceBufferList {
222 [Symbol.iterator](): IterableIterator<SourceBuffer>;
223}
224
225interface SpeechRecognitionResult {
226 [Symbol.iterator](): IterableIterator<SpeechRecognitionAlternative>;
227}
228
229interface SpeechRecognitionResultList {
230 [Symbol.iterator](): IterableIterator<SpeechRecognitionResult>;
231}
232
233interface StyleSheetList {
234 [Symbol.iterator](): IterableIterator<CSSStyleSheet>;
235}
236
237interface SubtleCrypto {
238 deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
239 generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
240 generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
241 generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>;
242 importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
243 importKey(format: Exclude<KeyFormat, "jwk">, keyData: BufferSource, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
244 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>;
245}
246
247interface TextTrackCueList {
248 [Symbol.iterator](): IterableIterator<TextTrackCue>;
249}
250
251interface TextTrackList {
252 [Symbol.iterator](): IterableIterator<TextTrack>;
253}
254
255interface TouchList {
256 [Symbol.iterator](): IterableIterator<Touch>;
257}
258
259interface URLSearchParams {
260 [Symbol.iterator](): IterableIterator<[string, string]>;
261 /** Returns an array of key, value pairs for every entry in the search params. */
262 entries(): IterableIterator<[string, string]>;
263 /** Returns a list of keys in the search params. */
264 keys(): IterableIterator<string>;
265 /** Returns a list of values in the search params. */
266 values(): IterableIterator<string>;
267}
268
269interface WEBGL_draw_buffers {
270 drawBuffersWEBGL(buffers: Iterable<GLenum>): void;
271}
272
273interface WEBGL_multi_draw {
274 multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: GLuint, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: GLuint, drawcount: GLsizei): void;
275 multiDrawArraysWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: GLuint, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, drawcount: GLsizei): void;
276 multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLint>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: GLuint, drawcount: GLsizei): void;
277 multiDrawElementsWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLint>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, drawcount: GLsizei): void;
278}
279
280interface WebGL2RenderingContextBase {
281 clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLfloat>, srcOffset?: GLuint): void;
282 clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLint>, srcOffset?: GLuint): void;
283 clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLuint>, srcOffset?: GLuint): void;
284 drawBuffers(buffers: Iterable<GLenum>): void;
285 getActiveUniforms(program: WebGLProgram, uniformIndices: Iterable<GLuint>, pname: GLenum): any;
286 getUniformIndices(program: WebGLProgram, uniformNames: Iterable<string>): Iterable<GLuint> | null;
287 invalidateFramebuffer(target: GLenum, attachments: Iterable<GLenum>): void;
288 invalidateSubFramebuffer(target: GLenum, attachments: Iterable<GLenum>, x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
289 transformFeedbackVaryings(program: WebGLProgram, varyings: Iterable<string>, bufferMode: GLenum): void;
290 uniform1uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
291 uniform2uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
292 uniform3uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
293 uniform4uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
294 uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
295 uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
296 uniformMatrix3x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
297 uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
298 uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
299 uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
300 vertexAttribI4iv(index: GLuint, values: Iterable<GLint>): void;
301 vertexAttribI4uiv(index: GLuint, values: Iterable<GLuint>): void;
302}
303
304interface WebGL2RenderingContextOverloads {
305 uniform1fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
306 uniform1iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
307 uniform2fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
308 uniform2iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
309 uniform3fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
310 uniform3iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
311 uniform4fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
312 uniform4iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
313 uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
314 uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
315 uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
316}
317
318interface WebGLRenderingContextBase {
319 vertexAttrib1fv(index: GLuint, values: Iterable<GLfloat>): void;
320 vertexAttrib2fv(index: GLuint, values: Iterable<GLfloat>): void;
321 vertexAttrib3fv(index: GLuint, values: Iterable<GLfloat>): void;
322 vertexAttrib4fv(index: GLuint, values: Iterable<GLfloat>): void;
323}
324
325interface WebGLRenderingContextOverloads {
326 uniform1fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
327 uniform1iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
328 uniform2fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
329 uniform2iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
330 uniform3fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
331 uniform3iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
332 uniform4fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
333 uniform4iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
334 uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;
335 uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;
336 uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;
337}