lib.webworker.iterable.d.ts 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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. /// Worker Iterable APIs
  16. /////////////////////////////
  17. interface Cache {
  18. addAll(requests: Iterable<RequestInfo>): Promise<void>;
  19. }
  20. interface DOMStringList {
  21. [Symbol.iterator](): IterableIterator<string>;
  22. }
  23. interface FileList {
  24. [Symbol.iterator](): IterableIterator<File>;
  25. }
  26. interface FontFaceSet extends Set<FontFace> {
  27. }
  28. interface FormData {
  29. [Symbol.iterator](): IterableIterator<[string, FormDataEntryValue]>;
  30. /** Returns an array of key, value pairs for every entry in the list. */
  31. entries(): IterableIterator<[string, FormDataEntryValue]>;
  32. /** Returns a list of keys in the list. */
  33. keys(): IterableIterator<string>;
  34. /** Returns a list of values in the list. */
  35. values(): IterableIterator<FormDataEntryValue>;
  36. }
  37. interface Headers {
  38. [Symbol.iterator](): IterableIterator<[string, string]>;
  39. /** Returns an iterator allowing to go through all key/value pairs contained in this object. */
  40. entries(): IterableIterator<[string, string]>;
  41. /** Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
  42. keys(): IterableIterator<string>;
  43. /** Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
  44. values(): IterableIterator<string>;
  45. }
  46. interface IDBDatabase {
  47. /** 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. */
  48. transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode): IDBTransaction;
  49. }
  50. interface IDBObjectStore {
  51. /**
  52. * 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.
  53. *
  54. * Throws an "InvalidStateError" DOMException if not called within an upgrade transaction.
  55. */
  56. createIndex(name: string, keyPath: string | Iterable<string>, options?: IDBIndexParameters): IDBIndex;
  57. }
  58. interface MessageEvent<T = any> {
  59. /** @deprecated */
  60. initMessageEvent(type: string, bubbles?: boolean, cancelable?: boolean, data?: any, origin?: string, lastEventId?: string, source?: MessageEventSource | null, ports?: Iterable<MessagePort>): void;
  61. }
  62. interface SubtleCrypto {
  63. deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
  64. generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
  65. generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
  66. generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>;
  67. importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
  68. importKey(format: Exclude<KeyFormat, "jwk">, keyData: BufferSource, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
  69. 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>;
  70. }
  71. interface URLSearchParams {
  72. [Symbol.iterator](): IterableIterator<[string, string]>;
  73. /** Returns an array of key, value pairs for every entry in the search params. */
  74. entries(): IterableIterator<[string, string]>;
  75. /** Returns a list of keys in the search params. */
  76. keys(): IterableIterator<string>;
  77. /** Returns a list of values in the search params. */
  78. values(): IterableIterator<string>;
  79. }
  80. interface WEBGL_draw_buffers {
  81. drawBuffersWEBGL(buffers: Iterable<GLenum>): void;
  82. }
  83. interface WEBGL_multi_draw {
  84. multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: GLuint, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: GLuint, drawcount: GLsizei): void;
  85. multiDrawArraysWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: GLuint, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, drawcount: GLsizei): void;
  86. 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;
  87. multiDrawElementsWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLint>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, drawcount: GLsizei): void;
  88. }
  89. interface WebGL2RenderingContextBase {
  90. clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLfloat>, srcOffset?: GLuint): void;
  91. clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLint>, srcOffset?: GLuint): void;
  92. clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLuint>, srcOffset?: GLuint): void;
  93. drawBuffers(buffers: Iterable<GLenum>): void;
  94. getActiveUniforms(program: WebGLProgram, uniformIndices: Iterable<GLuint>, pname: GLenum): any;
  95. getUniformIndices(program: WebGLProgram, uniformNames: Iterable<string>): Iterable<GLuint> | null;
  96. invalidateFramebuffer(target: GLenum, attachments: Iterable<GLenum>): void;
  97. invalidateSubFramebuffer(target: GLenum, attachments: Iterable<GLenum>, x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
  98. transformFeedbackVaryings(program: WebGLProgram, varyings: Iterable<string>, bufferMode: GLenum): void;
  99. uniform1uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
  100. uniform2uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
  101. uniform3uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
  102. uniform4uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
  103. uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
  104. uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
  105. uniformMatrix3x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
  106. uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
  107. uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
  108. uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
  109. vertexAttribI4iv(index: GLuint, values: Iterable<GLint>): void;
  110. vertexAttribI4uiv(index: GLuint, values: Iterable<GLuint>): void;
  111. }
  112. interface WebGL2RenderingContextOverloads {
  113. uniform1fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
  114. uniform1iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
  115. uniform2fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
  116. uniform2iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
  117. uniform3fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
  118. uniform3iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
  119. uniform4fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
  120. uniform4iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
  121. uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
  122. uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
  123. uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
  124. }
  125. interface WebGLRenderingContextBase {
  126. vertexAttrib1fv(index: GLuint, values: Iterable<GLfloat>): void;
  127. vertexAttrib2fv(index: GLuint, values: Iterable<GLfloat>): void;
  128. vertexAttrib3fv(index: GLuint, values: Iterable<GLfloat>): void;
  129. vertexAttrib4fv(index: GLuint, values: Iterable<GLfloat>): void;
  130. }
  131. interface WebGLRenderingContextOverloads {
  132. uniform1fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
  133. uniform1iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
  134. uniform2fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
  135. uniform2iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
  136. uniform3fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
  137. uniform3iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
  138. uniform4fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
  139. uniform4iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
  140. uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;
  141. uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;
  142. uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;
  143. }