lib.dom.iterable.d.ts 16 KB

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