UNPKG

13.8 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/// DOM 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 AudioTrackList {
33 [Symbol.iterator](): IterableIterator<AudioTrack>;
34}
35
36interface BaseAudioContext {
37 createIIRFilter(feedforward: Iterable<number>, feedback: Iterable<number>): IIRFilterNode;
38 createPeriodicWave(real: Iterable<number>, imag: Iterable<number>, constraints?: PeriodicWaveConstraints): PeriodicWave;
39}
40
41interface CSSRuleList {
42 [Symbol.iterator](): IterableIterator<CSSRule>;
43}
44
45interface CSSStyleDeclaration {
46 [Symbol.iterator](): IterableIterator<string>;
47}
48
49interface Cache {
50 addAll(requests: Iterable<RequestInfo>): Promise<void>;
51}
52
53interface CanvasPathDrawingStyles {
54 setLineDash(segments: Iterable<number>): void;
55}
56
57interface ClientRectList {
58 [Symbol.iterator](): IterableIterator<ClientRect>;
59}
60
61interface DOMRectList {
62 [Symbol.iterator](): IterableIterator<DOMRect>;
63}
64
65interface DOMStringList {
66 [Symbol.iterator](): IterableIterator<string>;
67}
68
69interface DOMTokenList {
70 [Symbol.iterator](): IterableIterator<string>;
71 entries(): IterableIterator<[number, string]>;
72 keys(): IterableIterator<number>;
73 values(): IterableIterator<string>;
74}
75
76interface DataTransferItemList {
77 [Symbol.iterator](): IterableIterator<DataTransferItem>;
78}
79
80interface FileList {
81 [Symbol.iterator](): IterableIterator<File>;
82}
83
84interface FormData {
85 [Symbol.iterator](): IterableIterator<[string, FormDataEntryValue]>;
86 /**
87 * Returns an array of key, value pairs for every entry in the list.
88 */
89 entries(): IterableIterator<[string, FormDataEntryValue]>;
90 /**
91 * Returns a list of keys in the list.
92 */
93 keys(): IterableIterator<string>;
94 /**
95 * Returns a list of values in the list.
96 */
97 values(): IterableIterator<FormDataEntryValue>;
98}
99
100interface HTMLAllCollection {
101 [Symbol.iterator](): IterableIterator<Element>;
102}
103
104interface HTMLCollectionBase {
105 [Symbol.iterator](): IterableIterator<Element>;
106}
107
108interface HTMLCollectionOf<T extends Element> {
109 [Symbol.iterator](): IterableIterator<T>;
110}
111
112interface HTMLFormElement {
113 [Symbol.iterator](): IterableIterator<Element>;
114}
115
116interface HTMLSelectElement {
117 [Symbol.iterator](): IterableIterator<Element>;
118}
119
120interface Headers {
121 [Symbol.iterator](): IterableIterator<[string, string]>;
122 /**
123 * Returns an iterator allowing to go through all key/value pairs contained in this object.
124 */
125 entries(): IterableIterator<[string, string]>;
126 /**
127 * Returns an iterator allowing to go through all keys of the key/value pairs contained in this object.
128 */
129 keys(): IterableIterator<string>;
130 /**
131 * Returns an iterator allowing to go through all values of the key/value pairs contained in this object.
132 */
133 values(): IterableIterator<string>;
134}
135
136interface IDBObjectStore {
137 /**
138 * 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.
139 *
140 * Throws an "InvalidStateError" DOMException if not called within an upgrade transaction.
141 */
142 createIndex(name: string, keyPath: string | Iterable<string>, options?: IDBIndexParameters): IDBIndex;
143}
144
145interface MediaKeyStatusMap {
146 [Symbol.iterator](): IterableIterator<[BufferSource, MediaKeyStatus]>;
147 entries(): IterableIterator<[BufferSource, MediaKeyStatus]>;
148 keys(): IterableIterator<BufferSource>;
149 values(): IterableIterator<MediaKeyStatus>;
150}
151
152interface MediaList {
153 [Symbol.iterator](): IterableIterator<string>;
154}
155
156interface MimeTypeArray {
157 [Symbol.iterator](): IterableIterator<MimeType>;
158}
159
160interface NamedNodeMap {
161 [Symbol.iterator](): IterableIterator<Attr>;
162}
163
164interface Navigator {
165 requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: Iterable<MediaKeySystemConfiguration>): Promise<MediaKeySystemAccess>;
166}
167
168interface NodeList {
169 [Symbol.iterator](): IterableIterator<Node>;
170 /**
171 * Returns an array of key, value pairs for every entry in the list.
172 */
173 entries(): IterableIterator<[number, Node]>;
174 /**
175 * Returns an list of keys in the list.
176 */
177 keys(): IterableIterator<number>;
178 /**
179 * Returns an list of values in the list.
180 */
181 values(): IterableIterator<Node>;
182}
183
184interface NodeListOf<TNode extends Node> {
185 [Symbol.iterator](): IterableIterator<TNode>;
186 /**
187 * Returns an array of key, value pairs for every entry in the list.
188 */
189 entries(): IterableIterator<[number, TNode]>;
190 /**
191 * Returns an list of keys in the list.
192 */
193 keys(): IterableIterator<number>;
194 /**
195 * Returns an list of values in the list.
196 */
197 values(): IterableIterator<TNode>;
198}
199
200interface Plugin {
201 [Symbol.iterator](): IterableIterator<MimeType>;
202}
203
204interface PluginArray {
205 [Symbol.iterator](): IterableIterator<Plugin>;
206}
207
208interface RTCRtpTransceiver {
209 setCodecPreferences(codecs: Iterable<RTCRtpCodecCapability>): void;
210}
211
212interface RTCStatsReport extends ReadonlyMap<string, any> {
213}
214
215interface SVGLengthList {
216 [Symbol.iterator](): IterableIterator<SVGLength>;
217}
218
219interface SVGNumberList {
220 [Symbol.iterator](): IterableIterator<SVGNumber>;
221}
222
223interface SVGPointList {
224 [Symbol.iterator](): IterableIterator<DOMPoint>;
225}
226
227interface SVGStringList {
228 [Symbol.iterator](): IterableIterator<string>;
229}
230
231interface SourceBufferList {
232 [Symbol.iterator](): IterableIterator<SourceBuffer>;
233}
234
235interface SpeechGrammarList {
236 [Symbol.iterator](): IterableIterator<SpeechGrammar>;
237}
238
239interface SpeechRecognitionResult {
240 [Symbol.iterator](): IterableIterator<SpeechRecognitionAlternative>;
241}
242
243interface SpeechRecognitionResultList {
244 [Symbol.iterator](): IterableIterator<SpeechRecognitionResult>;
245}
246
247interface StyleSheetList {
248 [Symbol.iterator](): IterableIterator<StyleSheet>;
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 /**
266 * Returns an array of key, value pairs for every entry in the search params.
267 */
268 entries(): IterableIterator<[string, string]>;
269 /**
270 * Returns a list of keys in the search params.
271 */
272 keys(): IterableIterator<string>;
273 /**
274 * Returns a list of values in the search params.
275 */
276 values(): IterableIterator<string>;
277}
278
279interface VRDisplay {
280 requestPresent(layers: Iterable<VRLayer>): Promise<void>;
281}
282
283interface VideoTrackList {
284 [Symbol.iterator](): IterableIterator<VideoTrack>;
285}
286
287interface WEBGL_draw_buffers {
288 drawBuffersWEBGL(buffers: Iterable<GLenum>): void;
289}
290
291interface WebAuthentication {
292 makeCredential(accountInformation: Account, cryptoParameters: Iterable<ScopedCredentialParameters>, attestationChallenge: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, options?: ScopedCredentialOptions): Promise<ScopedCredentialInfo>;
293}
294
295interface WebGL2RenderingContextBase {
296 clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLfloat>, srcOffset?: GLuint): void;
297 clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLint>, srcOffset?: GLuint): void;
298 clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLuint>, srcOffset?: GLuint): void;
299 drawBuffers(buffers: Iterable<GLenum>): void;
300 getActiveUniforms(program: WebGLProgram, uniformIndices: Iterable<GLuint>, pname: GLenum): any;
301 getUniformIndices(program: WebGLProgram, uniformNames: Iterable<string>): Iterable<GLuint> | null;
302 invalidateFramebuffer(target: GLenum, attachments: Iterable<GLenum>): void;
303 invalidateSubFramebuffer(target: GLenum, attachments: Iterable<GLenum>, x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
304 transformFeedbackVaryings(program: WebGLProgram, varyings: Iterable<string>, bufferMode: GLenum): void;
305 uniform1uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
306 uniform2uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
307 uniform3uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
308 uniform4uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
309 uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
310 uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
311 uniformMatrix3x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
312 uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
313 uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
314 uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
315 vertexAttribI4iv(index: GLuint, values: Iterable<GLint>): void;
316 vertexAttribI4uiv(index: GLuint, values: Iterable<GLuint>): void;
317}
318
319interface WebGL2RenderingContextOverloads {
320 uniform1fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
321 uniform1iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
322 uniform2fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
323 uniform2iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
324 uniform3fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
325 uniform3iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
326 uniform4fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
327 uniform4iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
328 uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
329 uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
330 uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
331}
332
333interface WebGLRenderingContextBase {
334 vertexAttrib1fv(index: GLuint, values: Iterable<GLfloat>): void;
335 vertexAttrib2fv(index: GLuint, values: Iterable<GLfloat>): void;
336 vertexAttrib3fv(index: GLuint, values: Iterable<GLfloat>): void;
337 vertexAttrib4fv(index: GLuint, values: Iterable<GLfloat>): void;
338}
339
340interface WebGLRenderingContextOverloads {
341 uniform1fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
342 uniform1iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
343 uniform2fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
344 uniform2iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
345 uniform3fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
346 uniform3iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
347 uniform4fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
348 uniform4iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
349 uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;
350 uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;
351 uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;
352}