lib.dom.iterable.d.ts 15 KB

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