babylon.mixins.ts 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  1. // Mixins
  2. interface Window {
  3. mozIndexedDB(func: any): any;
  4. webkitIndexedDB(func: any): any;
  5. msIndexedDB: IDBFactory;
  6. IDBTransaction(func: any): any;
  7. webkitIDBTransaction(func: any): any;
  8. msIDBTransaction(func: any): any;
  9. IDBKeyRange(func: any): any;
  10. webkitIDBKeyRange(func: any): any;
  11. msIDBKeyRange(func: any): any;
  12. webkitURL: HTMLURL;
  13. webkitRequestAnimationFrame(func: any): any;
  14. mozRequestAnimationFrame(func: any): any;
  15. oRequestAnimationFrame(func: any): any;
  16. WebGLRenderingContext: WebGLRenderingContext;
  17. MSGesture: MSGesture;
  18. CANNON: any;
  19. SIMD: any;
  20. AudioContext: AudioContext;
  21. webkitAudioContext: AudioContext;
  22. PointerEvent: any;
  23. Math: Math;
  24. Uint8Array: Uint8ArrayConstructor;
  25. Float32Array: Float32ArrayConstructor;
  26. mozURL: any;
  27. msURL: any;
  28. VRFrameData: any; // WebVR, from specs 1.1
  29. }
  30. interface WebGLRenderingContext {
  31. drawArraysInstanced(mode: number, first: number, count: number, primcount: number): void;
  32. drawElementsInstanced(mode: number, count: number, type: number, offset: number, primcount: number): void;
  33. vertexAttribDivisor(index: number, divisor: number): void;
  34. createVertexArray(): any;
  35. bindVertexArray(vao?: WebGLVertexArrayObject | null): void;
  36. deleteVertexArray(vao: WebGLVertexArrayObject): void;
  37. blitFramebuffer(srcX0: number, srcY0: number, srcX1: number, srcY1: number, dstX0: number, dstY0: number, dstX1: number, dstY1: number, mask: number, filter: number): void;
  38. renderbufferStorageMultisample(target: number, samples: number, internalformat: number, width: number, height: number): void;
  39. bindBufferBase(target: number, index: number, buffer: WebGLBuffer | null): void;
  40. getUniformBlockIndex(program: WebGLProgram, uniformBlockName: string): number;
  41. uniformBlockBinding(program: WebGLProgram, uniformBlockIndex: number, uniformBlockBinding: number): void;
  42. // Queries
  43. createQuery(): WebGLQuery;
  44. deleteQuery(query: WebGLQuery): void;
  45. beginQuery(target: number, query: WebGLQuery): void;
  46. endQuery(target: number): void;
  47. getQueryParameter(query: WebGLQuery, pname: number): any;
  48. getQuery(target: number, pname: number): any;
  49. MAX_SAMPLES: number;
  50. RGBA8: number;
  51. READ_FRAMEBUFFER: number;
  52. DRAW_FRAMEBUFFER: number;
  53. UNIFORM_BUFFER: number;
  54. HALF_FLOAT_OES: number;
  55. RGBA16F: number;
  56. RGBA32F: number;
  57. DEPTH24_STENCIL8: number;
  58. /* Multiple Render Targets */
  59. drawBuffers(buffers: number[]): void;
  60. readBuffer(src: number): void;
  61. readonly COLOR_ATTACHMENT0: number; // 0x8CE1
  62. readonly COLOR_ATTACHMENT1: number; // 0x8CE2
  63. readonly COLOR_ATTACHMENT2: number; // 0x8CE3
  64. readonly COLOR_ATTACHMENT3: number; // 0x8CE4
  65. // Occlusion Query
  66. ANY_SAMPLES_PASSED_CONSERVATIVE: number;
  67. ANY_SAMPLES_PASSED: number;
  68. QUERY_RESULT_AVAILABLE: number;
  69. QUERY_RESULT: number;
  70. }
  71. interface HTMLURL {
  72. createObjectURL(param1: any, param2?: any): string;
  73. }
  74. interface Document {
  75. exitFullscreen(): void;
  76. webkitCancelFullScreen(): void;
  77. mozCancelFullScreen(): void;
  78. msCancelFullScreen(): void;
  79. mozFullScreen: boolean;
  80. msIsFullScreen: boolean;
  81. fullscreen: boolean;
  82. mozPointerLockElement: HTMLElement;
  83. msPointerLockElement: HTMLElement;
  84. webkitPointerLockElement: HTMLElement;
  85. }
  86. interface HTMLCanvasElement {
  87. requestPointerLock(): void;
  88. msRequestPointerLock?(): void;
  89. mozRequestPointerLock?(): void;
  90. webkitRequestPointerLock?(): void;
  91. }
  92. interface CanvasRenderingContext2D {
  93. imageSmoothingEnabled: boolean;
  94. mozImageSmoothingEnabled: boolean;
  95. oImageSmoothingEnabled: boolean;
  96. webkitImageSmoothingEnabled: boolean;
  97. msImageSmoothingEnabled: boolean;
  98. }
  99. interface WebGLBuffer {
  100. references: number;
  101. capacity: number;
  102. is32Bits: boolean;
  103. }
  104. interface WebGLProgram {
  105. transformFeedback?: WebGLTransformFeedback | null;
  106. __SPECTOR_rebuildProgram?: ((vertexSourceCode: string, fragmentSourceCode: string, onCompiled: (program: WebGLProgram) => void, onError: (message: string) => void) => void) | null;
  107. }
  108. interface MouseEvent {
  109. mozMovementX: number;
  110. mozMovementY: number;
  111. webkitMovementX: number;
  112. webkitMovementY: number;
  113. msMovementX: number;
  114. msMovementY: number;
  115. }
  116. interface MSStyleCSSProperties {
  117. webkitTransform: string;
  118. webkitTransition: string;
  119. }
  120. interface Navigator {
  121. getVRDisplays: () => any;
  122. mozGetVRDevices: (any: any) => any;
  123. getUserMedia: any;
  124. webkitGetUserMedia: any;
  125. mozGetUserMedia: any;
  126. msGetUserMedia: any;
  127. getGamepads(func?: any): any;
  128. webkitGetGamepads(func?: any): any
  129. msGetGamepads(func?: any): any;
  130. webkitGamepads(func?: any): any;
  131. }
  132. interface HTMLVideoElement {
  133. mozSrcObject: any;
  134. }
  135. interface Screen {
  136. orientation: string;
  137. mozOrientation: string;
  138. }
  139. interface HTMLMediaElement {
  140. crossOrigin: string | null;
  141. }
  142. interface Math {
  143. fround(x: number): number;
  144. imul(a: number, b: number): number;
  145. }
  146. interface SIMDglobal {
  147. SIMD: SIMD;
  148. Math: Math;
  149. Uint8Array: Uint8ArrayConstructor;
  150. Float32Array: Float32ArrayConstructor;
  151. }
  152. interface SIMD {
  153. Float32x4: SIMD.Float32x4Constructor;
  154. Int32x4: SIMD.Int32x4Constructor;
  155. Int16x8: SIMD.Int16x8Constructor;
  156. Int8x16: SIMD.Int8x16Constructor;
  157. Uint32x4: SIMD.Uint32x4Constructor;
  158. Uint16x8: SIMD.Uint16x8Constructor;
  159. Uint8x16: SIMD.Uint8x16Constructor;
  160. Bool32x4: SIMD.Bool32x4Constructor;
  161. Bool16x8: SIMD.Bool16x8Constructor;
  162. Bool8x16: SIMD.Bool8x16Constructor;
  163. }
  164. interface GamepadPose {
  165. hasOrientation: boolean;
  166. hasPosition: boolean;
  167. position?: Float32Array;
  168. linearVelocity?: Float32Array;
  169. linearAcceleration?: Float32Array;
  170. orientation?: Float32Array;
  171. angularVelocity?: Float32Array;
  172. angularAcceleration?: Float32Array;
  173. }
  174. declare namespace SIMD {
  175. interface Float32x4 {
  176. constructor: Float32x4Constructor;
  177. valueOf(): Float32x4;
  178. toLocaleString(): string;
  179. toString(): string;
  180. }
  181. interface Float32x4Constructor {
  182. (s0?: number, s1?: number, s2?: number, s3?: number): Float32x4;
  183. prototype: Float32x4;
  184. extractLane(simd: SIMD.Float32x4, lane: number): number;
  185. swizzle(a: SIMD.Float32x4, l1: number, l2: number, l3: number, l4: number): SIMD.Float32x4;
  186. shuffle(a: SIMD.Float32x4, b: SIMD.Float32x4, l1: number, l2: number, l3: number, l4: number): SIMD.Float32x4;
  187. check(a: SIMD.Float32x4): SIMD.Float32x4;
  188. splat(n: number): SIMD.Float32x4;
  189. replaceLane(simd: SIMD.Float32x4, lane: number, value: number): SIMD.Float32x4;
  190. select(selector: SIMD.Bool32x4, a: SIMD.Float32x4, b: SIMD.Float32x4): SIMD.Float32x4;
  191. equal(a: SIMD.Float32x4, b: SIMD.Float32x4): SIMD.Bool32x4;
  192. notEqual(a: SIMD.Float32x4, b: SIMD.Float32x4): SIMD.Bool32x4;
  193. lessThan(a: SIMD.Float32x4, b: SIMD.Float32x4): SIMD.Bool32x4;
  194. lessThanOrEqual(a: SIMD.Float32x4, b: SIMD.Float32x4): SIMD.Bool32x4;
  195. greaterThan(a: SIMD.Float32x4, b: SIMD.Float32x4): SIMD.Bool32x4;
  196. greaterThanOrEqual(a: SIMD.Float32x4, b: SIMD.Float32x4): SIMD.Bool32x4;
  197. add(a: SIMD.Float32x4, b: SIMD.Float32x4): SIMD.Float32x4;
  198. sub(a: SIMD.Float32x4, b: SIMD.Float32x4): SIMD.Float32x4;
  199. mul(a: SIMD.Float32x4, b: SIMD.Float32x4): SIMD.Float32x4;
  200. div(a: SIMD.Float32x4, b: SIMD.Float32x4): SIMD.Float32x4;
  201. neg(a: SIMD.Float32x4): SIMD.Float32x4;
  202. abs(a: SIMD.Float32x4): SIMD.Float32x4;
  203. min(a: SIMD.Float32x4, b: SIMD.Float32x4): SIMD.Float32x4;
  204. max(a: SIMD.Float32x4, b: SIMD.Float32x4): SIMD.Float32x4;
  205. minNum(a: SIMD.Float32x4, b: SIMD.Float32x4): SIMD.Float32x4;
  206. maxNum(a: SIMD.Float32x4, b: SIMD.Float32x4): SIMD.Float32x4;
  207. reciprocalApproximation(a: SIMD.Float32x4): SIMD.Float32x4;
  208. reciprocalSqrtApproximation(a: SIMD.Float32x4): SIMD.Float32x4;
  209. sqrt(a: SIMD.Float32x4): SIMD.Float32x4;
  210. load(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number): SIMD.Float32x4;
  211. load1(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number): SIMD.Float32x4;
  212. load2(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number): SIMD.Float32x4;
  213. load3(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number): SIMD.Float32x4;
  214. store(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number, value: SIMD.Float32x4): SIMD.Float32x4;
  215. store1(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number, value: SIMD.Float32x4): SIMD.Float32x4;
  216. store2(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number, value: SIMD.Float32x4): SIMD.Float32x4;
  217. store3(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number, value: SIMD.Float32x4): SIMD.Float32x4;
  218. fromInt32x4(value: SIMD.Int32x4): SIMD.Float32x4;
  219. fromUint32x4(value: SIMD.Uint32x4): SIMD.Float32x4;
  220. fromInt32x4Bits(value: SIMD.Int32x4): SIMD.Float32x4;
  221. fromInt16x8Bits(value: SIMD.Int16x8): SIMD.Float32x4;
  222. fromInt8x16Bits(value: SIMD.Int8x16): SIMD.Float32x4;
  223. fromUint32x4Bits(value: SIMD.Uint32x4): SIMD.Float32x4;
  224. fromUint16x8Bits(value: SIMD.Uint16x8): SIMD.Float32x4;
  225. fromUint8x16Bits(value: SIMD.Uint8x16): SIMD.Float32x4;
  226. }
  227. interface Int32x4 {
  228. constructor: Int32x4Constructor;
  229. valueOf(): Int32x4;
  230. toLocaleString(): string;
  231. toString(): string;
  232. }
  233. interface Int32x4Constructor {
  234. (s0?: number, s1?: number, s2?: number, s3?: number): Int32x4;
  235. prototype: Int32x4;
  236. extractLane(simd: SIMD.Int32x4, lane: number): number;
  237. swizzle(a: SIMD.Int32x4, l1: number, l2: number, l3: number, l4: number): SIMD.Int32x4;
  238. shuffle(a: SIMD.Int32x4, b: SIMD.Int32x4, l1: number, l2: number, l3: number, l4: number): SIMD.Int32x4;
  239. check(a: SIMD.Int32x4): SIMD.Int32x4;
  240. splat(n: number): SIMD.Int32x4;
  241. replaceLane(simd: SIMD.Int32x4, lane: number, value: number): SIMD.Int32x4;
  242. select(selector: SIMD.Bool32x4, a: SIMD.Int32x4, b: SIMD.Int32x4): SIMD.Int32x4;
  243. equal(a: SIMD.Int32x4, b: SIMD.Int32x4): SIMD.Bool32x4;
  244. notEqual(a: SIMD.Int32x4, b: SIMD.Int32x4): SIMD.Bool32x4;
  245. lessThan(a: SIMD.Int32x4, b: SIMD.Int32x4): SIMD.Bool32x4;
  246. lessThanOrEqual(a: SIMD.Int32x4, b: SIMD.Int32x4): SIMD.Bool32x4;
  247. greaterThan(a: SIMD.Int32x4, b: SIMD.Int32x4): SIMD.Bool32x4;
  248. greaterThanOrEqual(a: SIMD.Int32x4, b: SIMD.Int32x4): SIMD.Bool32x4;
  249. and(a: SIMD.Int32x4, b: SIMD.Int32x4): SIMD.Int32x4;
  250. or(a: SIMD.Int32x4, b: SIMD.Int32x4): SIMD.Int32x4;
  251. xor(a: SIMD.Int32x4, b: SIMD.Int32x4): SIMD.Int32x4;
  252. not(a: SIMD.Int32x4, b: SIMD.Int32x4): SIMD.Int32x4;
  253. add(a: SIMD.Int32x4, b: SIMD.Int32x4): SIMD.Int32x4;
  254. sub(a: SIMD.Int32x4, b: SIMD.Int32x4): SIMD.Int32x4;
  255. mul(a: SIMD.Int32x4, b: SIMD.Int32x4): SIMD.Int32x4;
  256. neg(a: SIMD.Int32x4): SIMD.Int32x4;
  257. shiftLeftByScalar(a: SIMD.Int32x4, bits: number): SIMD.Int32x4;
  258. shiftRightByScalar(a: SIMD.Int32x4, bits: number): SIMD.Int32x4;
  259. load(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number): SIMD.Int32x4;
  260. load1(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number): SIMD.Int32x4;
  261. load2(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number): SIMD.Int32x4;
  262. load3(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number): SIMD.Int32x4;
  263. store(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number, value: SIMD.Int32x4): SIMD.Int32x4;
  264. store1(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number, value: SIMD.Int32x4): SIMD.Int32x4;
  265. store2(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number, value: SIMD.Int32x4): SIMD.Int32x4;
  266. store3(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number, value: SIMD.Int32x4): SIMD.Int32x4;
  267. fromFloat32x4(value: SIMD.Float32x4): SIMD.Int32x4;
  268. fromUint32x4(value: SIMD.Uint32x4): SIMD.Int32x4;
  269. fromFloat32x4Bits(value: SIMD.Float32x4): SIMD.Int32x4;
  270. fromInt16x8Bits(value: SIMD.Int16x8): SIMD.Int32x4;
  271. fromInt8x16Bits(value: SIMD.Int8x16): SIMD.Int32x4;
  272. fromUint32x4Bits(value: SIMD.Uint32x4): SIMD.Int32x4;
  273. fromUint16x8Bits(value: SIMD.Uint16x8): SIMD.Int32x4;
  274. fromUint8x16Bits(value: SIMD.Uint8x16): SIMD.Int32x4;
  275. }
  276. interface Int16x8 {
  277. constructor: Int16x8Constructor;
  278. valueOf(): Int16x8;
  279. toLocaleString(): string;
  280. toString(): string;
  281. }
  282. interface Int16x8Constructor {
  283. (s0?: number, s1?: number, s2?: number, s3?: number, s4?: number, s5?: number, s6?: number, s7?: number): Int16x8;
  284. prototype: Int16x8;
  285. extractLane(simd: SIMD.Int16x8, lane: number): number;
  286. swizzle(a: SIMD.Int16x8, l1: number, l2: number, l3: number, l4: number, l5: number, l6: number, l7: number, l8: number): SIMD.Int16x8;
  287. shuffle(a: SIMD.Int16x8, b: SIMD.Int16x8, l1: number, l2: number, l3: number, l4: number, l5: number, l6: number, l7: number, l8: number): SIMD.Int16x8;
  288. check(a: SIMD.Int16x8): SIMD.Int16x8;
  289. splat(n: number): SIMD.Int16x8;
  290. replaceLane(simd: SIMD.Int16x8, lane: number, value: number): SIMD.Int16x8;
  291. select(selector: SIMD.Bool16x8, a: SIMD.Int16x8, b: SIMD.Int16x8): SIMD.Int16x8;
  292. equal(a: SIMD.Int16x8, b: SIMD.Int16x8): SIMD.Bool16x8;
  293. notEqual(a: SIMD.Int16x8, b: SIMD.Int16x8): SIMD.Bool16x8;
  294. lessThan(a: SIMD.Int16x8, b: SIMD.Int16x8): SIMD.Bool16x8;
  295. lessThanOrEqual(a: SIMD.Int16x8, b: SIMD.Int16x8): SIMD.Bool16x8;
  296. greaterThan(a: SIMD.Int16x8, b: SIMD.Int16x8): SIMD.Bool16x8;
  297. greaterThanOrEqual(a: SIMD.Int16x8, b: SIMD.Int16x8): SIMD.Bool16x8;
  298. and(a: SIMD.Int16x8, b: SIMD.Int16x8): SIMD.Int16x8;
  299. or(a: SIMD.Int16x8, b: SIMD.Int16x8): SIMD.Int16x8;
  300. xor(a: SIMD.Int16x8, b: SIMD.Int16x8): SIMD.Int16x8;
  301. not(a: SIMD.Int16x8, b: SIMD.Int16x8): SIMD.Int16x8;
  302. add(a: SIMD.Int16x8, b: SIMD.Int16x8): SIMD.Int16x8;
  303. sub(a: SIMD.Int16x8, b: SIMD.Int16x8): SIMD.Int16x8;
  304. mul(a: SIMD.Int16x8, b: SIMD.Int16x8): SIMD.Int16x8;
  305. neg(a: SIMD.Int16x8): SIMD.Int16x8;
  306. shiftLeftByScalar(a: SIMD.Int16x8, bits: number): SIMD.Int16x8;
  307. shiftRightByScalar(a: SIMD.Int16x8, bits: number): SIMD.Int16x8;
  308. addSaturate(a: SIMD.Int16x8, b: SIMD.Int16x8): SIMD.Int16x8;
  309. subSaturate(a: SIMD.Int16x8, b: SIMD.Int16x8): SIMD.Int16x8;
  310. load(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number): SIMD.Int16x8;
  311. store(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number, value: SIMD.Int16x8): SIMD.Int16x8;
  312. fromUint16x8(value: SIMD.Uint16x8): SIMD.Int16x8;
  313. fromFloat32x4Bits(value: SIMD.Float32x4): SIMD.Int16x8;
  314. fromInt32x4Bits(value: SIMD.Int32x4): SIMD.Int16x8;
  315. fromInt8x16Bits(value: SIMD.Int8x16): SIMD.Int16x8;
  316. fromUint32x4Bits(value: SIMD.Uint32x4): SIMD.Int16x8;
  317. fromUint16x8Bits(value: SIMD.Uint16x8): SIMD.Int16x8;
  318. fromUint8x16Bits(value: SIMD.Uint8x16): SIMD.Int16x8;
  319. }
  320. interface Int8x16 {
  321. constructor: Int8x16Constructor;
  322. valueOf(): Int8x16;
  323. toLocaleString(): string;
  324. toString(): string;
  325. }
  326. interface Int8x16Constructor {
  327. (s0?: number, s1?: number, s2?: number, s3?: number, s4?: number, s5?: number, s6?: number, s7?: number, s8?: number, s9?: number, s10?: number, s11?: number, s12?: number, s13?: number, s14?: number, s15?: number): Int8x16;
  328. prototype: Int8x16;
  329. extractLane(simd: SIMD.Int8x16, lane: number): number;
  330. swizzle(a: SIMD.Int8x16, l1: number, l2: number, l3: number, l4: number, l5: number, l6: number, l7: number, l8: number, l9: number, l10: number, l11: number, l12: number, l13: number, l14: number, l15: number, l16: number): SIMD.Int8x16;
  331. shuffle(a: SIMD.Int8x16, b: SIMD.Int8x16, l1: number, l2: number, l3: number, l4: number, l5: number, l6: number, l7: number, l8: number, l9: number, l10: number, l11: number, l12: number, l13: number, l14: number, l15: number, l16: number): SIMD.Int8x16;
  332. check(a: SIMD.Int8x16): SIMD.Int8x16;
  333. splat(n: number): SIMD.Int8x16;
  334. replaceLane(simd: SIMD.Int8x16, lane: number, value: number): SIMD.Int8x16;
  335. select(selector: SIMD.Bool8x16, a: SIMD.Int8x16, b: SIMD.Int8x16): SIMD.Int8x16;
  336. equal(a: SIMD.Int8x16, b: SIMD.Int8x16): SIMD.Bool8x16;
  337. notEqual(a: SIMD.Int8x16, b: SIMD.Int8x16): SIMD.Bool8x16;
  338. lessThan(a: SIMD.Int8x16, b: SIMD.Int8x16): SIMD.Bool8x16;
  339. lessThanOrEqual(a: SIMD.Int8x16, b: SIMD.Int8x16): SIMD.Bool8x16;
  340. greaterThan(a: SIMD.Int8x16, b: SIMD.Int8x16): SIMD.Bool8x16;
  341. greaterThanOrEqual(a: SIMD.Int8x16, b: SIMD.Int8x16): SIMD.Bool8x16;
  342. and(a: SIMD.Int8x16, b: SIMD.Int8x16): SIMD.Int8x16;
  343. or(a: SIMD.Int8x16, b: SIMD.Int8x16): SIMD.Int8x16;
  344. xor(a: SIMD.Int8x16, b: SIMD.Int8x16): SIMD.Int8x16;
  345. not(a: SIMD.Int8x16, b: SIMD.Int8x16): SIMD.Int8x16;
  346. add(a: SIMD.Int8x16, b: SIMD.Int8x16): SIMD.Int8x16;
  347. sub(a: SIMD.Int8x16, b: SIMD.Int8x16): SIMD.Int8x16;
  348. mul(a: SIMD.Int8x16, b: SIMD.Int8x16): SIMD.Int8x16;
  349. neg(a: SIMD.Int8x16): SIMD.Int8x16;
  350. shiftLeftByScalar(a: SIMD.Int8x16, bits: number): SIMD.Int8x16;
  351. shiftRightByScalar(a: SIMD.Int8x16, bits: number): SIMD.Int8x16;
  352. addSaturate(a: SIMD.Int8x16, b: SIMD.Int8x16): SIMD.Int8x16;
  353. subSaturate(a: SIMD.Int8x16, b: SIMD.Int8x16): SIMD.Int8x16;
  354. load(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number): SIMD.Int8x16;
  355. store(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number, value: SIMD.Int8x16): SIMD.Int8x16;
  356. fromUint8x16(value: SIMD.Uint8x16): SIMD.Int8x16;
  357. fromFloat32x4Bits(value: SIMD.Float32x4): SIMD.Int8x16;
  358. fromInt32x4Bits(value: SIMD.Int32x4): SIMD.Int8x16;
  359. fromInt16x8Bits(value: SIMD.Int16x8): SIMD.Int8x16;
  360. fromUint32x4Bits(value: SIMD.Uint32x4): SIMD.Int8x16;
  361. fromUint16x8Bits(value: SIMD.Uint16x8): SIMD.Int8x16;
  362. fromUint8x16Bits(value: SIMD.Uint8x16): SIMD.Int8x16;
  363. }
  364. interface Uint32x4 {
  365. constructor: Uint32x4Constructor;
  366. valueOf(): Uint32x4;
  367. toLocaleString(): string;
  368. toString(): string;
  369. }
  370. interface Uint32x4Constructor {
  371. (s0?: number, s1?: number, s2?: number, s3?: number): Uint32x4;
  372. prototype: Uint32x4;
  373. extractLane(simd: SIMD.Uint32x4, lane: number): number;
  374. swizzle(a: SIMD.Uint32x4, l1: number, l2: number, l3: number, l4: number): SIMD.Uint32x4;
  375. shuffle(a: SIMD.Uint32x4, b: SIMD.Uint32x4, l1: number, l2: number, l3: number, l4: number): SIMD.Uint32x4;
  376. check(a: SIMD.Uint32x4): SIMD.Uint32x4;
  377. splat(n: number): SIMD.Uint32x4;
  378. replaceLane(simd: SIMD.Uint32x4, lane: number, value: number): SIMD.Uint32x4;
  379. select(selector: SIMD.Bool32x4, a: SIMD.Uint32x4, b: SIMD.Uint32x4): SIMD.Uint32x4;
  380. equal(a: SIMD.Uint32x4, b: SIMD.Uint32x4): SIMD.Bool32x4;
  381. notEqual(a: SIMD.Uint32x4, b: SIMD.Uint32x4): SIMD.Bool32x4;
  382. lessThan(a: SIMD.Uint32x4, b: SIMD.Uint32x4): SIMD.Bool32x4;
  383. lessThanOrEqual(a: SIMD.Uint32x4, b: SIMD.Uint32x4): SIMD.Bool32x4;
  384. greaterThan(a: SIMD.Uint32x4, b: SIMD.Uint32x4): SIMD.Bool32x4;
  385. greaterThanOrEqual(a: SIMD.Uint32x4, b: SIMD.Uint32x4): SIMD.Bool32x4;
  386. and(a: SIMD.Uint32x4, b: SIMD.Uint32x4): SIMD.Uint32x4;
  387. or(a: SIMD.Uint32x4, b: SIMD.Uint32x4): SIMD.Uint32x4;
  388. xor(a: SIMD.Uint32x4, b: SIMD.Uint32x4): SIMD.Uint32x4;
  389. not(a: SIMD.Uint32x4, b: SIMD.Uint32x4): SIMD.Uint32x4;
  390. add(a: SIMD.Uint32x4, b: SIMD.Uint32x4): SIMD.Uint32x4;
  391. sub(a: SIMD.Uint32x4, b: SIMD.Uint32x4): SIMD.Uint32x4;
  392. mul(a: SIMD.Uint32x4, b: SIMD.Uint32x4): SIMD.Uint32x4;
  393. shiftLeftByScalar(a: SIMD.Uint32x4, bits: number): SIMD.Uint32x4;
  394. shiftRightByScalar(a: SIMD.Uint32x4, bits: number): SIMD.Uint32x4;
  395. load(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number): SIMD.Uint32x4;
  396. load1(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number): SIMD.Uint32x4;
  397. load2(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number): SIMD.Uint32x4;
  398. load3(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number): SIMD.Uint32x4;
  399. store(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number, value: SIMD.Uint32x4): SIMD.Uint32x4;
  400. store1(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number, value: SIMD.Uint32x4): SIMD.Uint32x4;
  401. store2(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number, value: SIMD.Uint32x4): SIMD.Uint32x4;
  402. store3(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number, value: SIMD.Uint32x4): SIMD.Uint32x4;
  403. fromFloat32x4(value: SIMD.Float32x4): SIMD.Uint32x4;
  404. fromInt32x4(value: SIMD.Int32x4): SIMD.Uint32x4;
  405. fromFloat32x4Bits(value: SIMD.Float32x4): SIMD.Uint32x4;
  406. fromInt32x4Bits(value: SIMD.Int32x4): SIMD.Uint32x4;
  407. fromInt16x8Bits(value: SIMD.Int16x8): SIMD.Uint32x4;
  408. fromInt8x16Bits(value: SIMD.Int8x16): SIMD.Uint32x4;
  409. fromUint16x8Bits(value: SIMD.Uint16x8): SIMD.Uint32x4;
  410. fromUint8x16Bits(value: SIMD.Uint8x16): SIMD.Uint32x4;
  411. }
  412. interface Uint16x8 {
  413. constructor: Uint16x8Constructor;
  414. valueOf(): Uint16x8;
  415. toLocaleString(): string;
  416. toString(): string;
  417. }
  418. interface Uint16x8Constructor {
  419. (s0?: number, s1?: number, s2?: number, s3?: number, s4?: number, s5?: number, s6?: number, s7?: number): Uint16x8;
  420. prototype: Uint16x8;
  421. extractLane(simd: SIMD.Uint16x8, lane: number): number;
  422. swizzle(a: SIMD.Uint16x8, l1: number, l2: number, l3: number, l4: number, l5: number, l6: number, l7: number, l8: number): SIMD.Uint16x8;
  423. shuffle(a: SIMD.Uint16x8, b: SIMD.Uint16x8, l1: number, l2: number, l3: number, l4: number, l5: number, l6: number, l7: number, l8: number): SIMD.Uint16x8;
  424. check(a: SIMD.Uint16x8): SIMD.Uint16x8;
  425. splat(n: number): SIMD.Uint16x8;
  426. replaceLane(simd: SIMD.Uint16x8, lane: number, value: number): SIMD.Uint16x8;
  427. select(selector: SIMD.Bool16x8, a: SIMD.Uint16x8, b: SIMD.Uint16x8): SIMD.Uint16x8;
  428. equal(a: SIMD.Uint16x8, b: SIMD.Uint16x8): SIMD.Bool16x8;
  429. notEqual(a: SIMD.Uint16x8, b: SIMD.Uint16x8): SIMD.Bool16x8;
  430. lessThan(a: SIMD.Uint16x8, b: SIMD.Uint16x8): SIMD.Bool16x8;
  431. lessThanOrEqual(a: SIMD.Uint16x8, b: SIMD.Uint16x8): SIMD.Bool16x8;
  432. greaterThan(a: SIMD.Uint16x8, b: SIMD.Uint16x8): SIMD.Bool16x8;
  433. greaterThanOrEqual(a: SIMD.Uint16x8, b: SIMD.Uint16x8): SIMD.Bool16x8;
  434. and(a: SIMD.Uint16x8, b: SIMD.Uint16x8): SIMD.Uint16x8;
  435. or(a: SIMD.Uint16x8, b: SIMD.Uint16x8): SIMD.Uint16x8;
  436. xor(a: SIMD.Uint16x8, b: SIMD.Uint16x8): SIMD.Uint16x8;
  437. not(a: SIMD.Uint16x8, b: SIMD.Uint16x8): SIMD.Uint16x8;
  438. add(a: SIMD.Uint16x8, b: SIMD.Uint16x8): SIMD.Uint16x8;
  439. sub(a: SIMD.Uint16x8, b: SIMD.Uint16x8): SIMD.Uint16x8;
  440. mul(a: SIMD.Uint16x8, b: SIMD.Uint16x8): SIMD.Uint16x8;
  441. shiftLeftByScalar(a: SIMD.Uint16x8, bits: number): SIMD.Uint16x8;
  442. shiftRightByScalar(a: SIMD.Uint16x8, bits: number): SIMD.Uint16x8;
  443. addSaturate(a: SIMD.Uint16x8, b: SIMD.Uint16x8): SIMD.Uint16x8;
  444. subSaturate(a: SIMD.Uint16x8, b: SIMD.Uint16x8): SIMD.Uint16x8;
  445. load(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number): SIMD.Uint16x8;
  446. store(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number, value: SIMD.Uint16x8): SIMD.Uint16x8;
  447. fromInt16x8(value: SIMD.Int16x8): SIMD.Uint16x8;
  448. fromFloat32x4Bits(value: SIMD.Float32x4): SIMD.Uint16x8;
  449. fromInt32x4Bits(value: SIMD.Int32x4): SIMD.Uint16x8;
  450. fromInt16x8Bits(value: SIMD.Int16x8): SIMD.Uint16x8;
  451. fromInt8x16Bits(value: SIMD.Int8x16): SIMD.Uint16x8;
  452. fromUint32x4Bits(value: SIMD.Uint32x4): SIMD.Uint16x8;
  453. fromUint8x16Bits(value: SIMD.Uint8x16): SIMD.Uint16x8;
  454. }
  455. interface Uint8x16 {
  456. constructor: Uint8x16Constructor;
  457. valueOf(): Uint8x16;
  458. toLocaleString(): string;
  459. toString(): string;
  460. }
  461. interface Uint8x16Constructor {
  462. (s0?: number, s1?: number, s2?: number, s3?: number, s4?: number, s5?: number, s6?: number, s7?: number, s8?: number, s9?: number, s10?: number, s11?: number, s12?: number, s13?: number, s14?: number, s15?: number): Uint8x16;
  463. prototype: Uint8x16;
  464. extractLane(simd: SIMD.Uint8x16, lane: number): number;
  465. swizzle(a: SIMD.Uint8x16, l1: number, l2: number, l3: number, l4: number, l5: number, l6: number, l7: number, l8: number, l9: number, l10: number, l11: number, l12: number, l13: number, l14: number, l15: number, l16: number): SIMD.Uint8x16;
  466. shuffle(a: SIMD.Uint8x16, b: SIMD.Uint8x16, l1: number, l2: number, l3: number, l4: number, l5: number, l6: number, l7: number, l8: number, l9: number, l10: number, l11: number, l12: number, l13: number, l14: number, l15: number, l16: number): SIMD.Uint8x16;
  467. check(a: SIMD.Uint8x16): SIMD.Uint8x16;
  468. splat(n: number): SIMD.Uint8x16;
  469. replaceLane(simd: SIMD.Uint8x16, lane: number, value: number): SIMD.Uint8x16;
  470. select(selector: SIMD.Bool8x16, a: SIMD.Uint8x16, b: SIMD.Uint8x16): SIMD.Uint8x16;
  471. equal(a: SIMD.Uint8x16, b: SIMD.Uint8x16): SIMD.Bool8x16;
  472. notEqual(a: SIMD.Uint8x16, b: SIMD.Uint8x16): SIMD.Bool8x16;
  473. lessThan(a: SIMD.Uint8x16, b: SIMD.Uint8x16): SIMD.Bool8x16;
  474. lessThanOrEqual(a: SIMD.Uint8x16, b: SIMD.Uint8x16): SIMD.Bool8x16;
  475. greaterThan(a: SIMD.Uint8x16, b: SIMD.Uint8x16): SIMD.Bool8x16;
  476. greaterThanOrEqual(a: SIMD.Uint8x16, b: SIMD.Uint8x16): SIMD.Bool8x16;
  477. and(a: SIMD.Uint8x16, b: SIMD.Uint8x16): SIMD.Uint8x16;
  478. or(a: SIMD.Uint8x16, b: SIMD.Uint8x16): SIMD.Uint8x16;
  479. xor(a: SIMD.Uint8x16, b: SIMD.Uint8x16): SIMD.Uint8x16;
  480. not(a: SIMD.Uint8x16, b: SIMD.Uint8x16): SIMD.Uint8x16;
  481. add(a: SIMD.Uint8x16, b: SIMD.Uint8x16): SIMD.Uint8x16;
  482. sub(a: SIMD.Uint8x16, b: SIMD.Uint8x16): SIMD.Uint8x16;
  483. mul(a: SIMD.Uint8x16, b: SIMD.Uint8x16): SIMD.Uint8x16;
  484. shiftLeftByScalar(a: SIMD.Uint8x16, bits: number): SIMD.Uint8x16;
  485. shiftRightByScalar(a: SIMD.Uint8x16, bits: number): SIMD.Uint8x16;
  486. addSaturate(a: SIMD.Uint8x16, b: SIMD.Uint8x16): SIMD.Uint8x16;
  487. subSaturate(a: SIMD.Uint8x16, b: SIMD.Uint8x16): SIMD.Uint8x16;
  488. load(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number): SIMD.Uint8x16;
  489. store(tarray: Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, index: number, value: SIMD.Uint8x16): SIMD.Uint8x16;
  490. fromInt8x16(value: SIMD.Int8x16): SIMD.Uint8x16;
  491. fromFloat32x4Bits(value: SIMD.Float32x4): SIMD.Uint8x16;
  492. fromInt32x4Bits(value: SIMD.Int32x4): SIMD.Uint8x16;
  493. fromInt16x8Bits(value: SIMD.Int16x8): SIMD.Uint8x16;
  494. fromInt8x16Bits(value: SIMD.Int8x16): SIMD.Uint8x16;
  495. fromUint32x4Bits(value: SIMD.Uint32x4): SIMD.Uint8x16;
  496. fromUint16x8Bits(value: SIMD.Uint16x8): SIMD.Uint8x16;
  497. }
  498. interface Bool32x4 {
  499. constructor: Bool32x4Constructor;
  500. valueOf(): Bool32x4;
  501. toLocaleString(): string;
  502. toString(): string;
  503. }
  504. interface Bool32x4Constructor {
  505. (s0?: boolean, s1?: boolean, s2?: boolean, s3?: boolean): Bool32x4;
  506. prototype: Bool32x4;
  507. extractLane(simd: SIMD.Bool32x4, lane: number): boolean;
  508. check(a: SIMD.Bool32x4): SIMD.Bool32x4;
  509. splat(n: boolean): SIMD.Bool32x4;
  510. replaceLane(simd: SIMD.Bool32x4, lane: number, value: boolean): SIMD.Bool32x4;
  511. allTrue(a: SIMD.Bool32x4): boolean;
  512. anyTrue(a: SIMD.Bool32x4): boolean;
  513. and(a: SIMD.Bool32x4, b: SIMD.Bool32x4): SIMD.Bool32x4;
  514. or(a: SIMD.Bool32x4, b: SIMD.Bool32x4): SIMD.Bool32x4;
  515. xor(a: SIMD.Bool32x4, b: SIMD.Bool32x4): SIMD.Bool32x4;
  516. not(a: SIMD.Bool32x4, b: SIMD.Bool32x4): SIMD.Bool32x4;
  517. }
  518. interface Bool16x8 {
  519. constructor: Bool16x8Constructor;
  520. valueOf(): Bool16x8;
  521. toLocaleString(): string;
  522. toString(): string;
  523. }
  524. interface Bool16x8Constructor {
  525. (s0?: boolean, s1?: boolean, s2?: boolean, s3?: boolean, s4?: boolean, s5?: boolean, s6?: boolean, s7?: boolean): Bool16x8;
  526. prototype: Bool16x8;
  527. extractLane(simd: SIMD.Bool16x8, lane: number): boolean;
  528. check(a: SIMD.Bool16x8): SIMD.Bool16x8;
  529. splat(n: boolean): SIMD.Bool16x8;
  530. replaceLane(simd: SIMD.Bool16x8, lane: number, value: boolean): SIMD.Bool16x8;
  531. allTrue(a: SIMD.Bool16x8): boolean;
  532. anyTrue(a: SIMD.Bool16x8): boolean;
  533. and(a: SIMD.Bool16x8, b: SIMD.Bool16x8): SIMD.Bool16x8;
  534. or(a: SIMD.Bool16x8, b: SIMD.Bool16x8): SIMD.Bool16x8;
  535. xor(a: SIMD.Bool16x8, b: SIMD.Bool16x8): SIMD.Bool16x8;
  536. not(a: SIMD.Bool16x8, b: SIMD.Bool16x8): SIMD.Bool16x8;
  537. }
  538. interface Bool8x16 {
  539. constructor: Bool8x16Constructor;
  540. valueOf(): Bool8x16;
  541. toLocaleString(): string;
  542. toString(): string;
  543. }
  544. interface Bool8x16Constructor {
  545. (s0?: boolean, s1?: boolean, s2?: boolean, s3?: boolean, s4?: boolean, s5?: boolean, s6?: boolean, s7?: boolean, s8?: boolean, s9?: boolean, s10?: boolean, s11?: boolean, s12?: boolean, s13?: boolean, s14?: boolean, s15?: boolean): Bool8x16;
  546. prototype: Bool8x16;
  547. extractLane(simd: SIMD.Bool8x16, lane: number): boolean;
  548. check(a: SIMD.Bool8x16): SIMD.Bool8x16;
  549. splat(n: boolean): SIMD.Bool8x16;
  550. replaceLane(simd: SIMD.Bool8x16, lane: number, value: boolean): SIMD.Bool8x16;
  551. allTrue(a: SIMD.Bool8x16): boolean;
  552. anyTrue(a: SIMD.Bool8x16): boolean;
  553. and(a: SIMD.Bool8x16, b: SIMD.Bool8x16): SIMD.Bool8x16;
  554. or(a: SIMD.Bool8x16, b: SIMD.Bool8x16): SIMD.Bool8x16;
  555. xor(a: SIMD.Bool8x16, b: SIMD.Bool8x16): SIMD.Bool8x16;
  556. not(a: SIMD.Bool8x16, b: SIMD.Bool8x16): SIMD.Bool8x16;
  557. }
  558. }
  559. interface EXT_disjoint_timer_query {
  560. QUERY_COUNTER_BITS_EXT: number;
  561. TIME_ELAPSED_EXT: number;
  562. TIMESTAMP_EXT: number;
  563. GPU_DISJOINT_EXT: number;
  564. QUERY_RESULT_EXT: number;
  565. QUERY_RESULT_AVAILABLE_EXT: number;
  566. queryCounterEXT(query: WebGLQuery, target: number): void;
  567. createQueryEXT(): WebGLQuery;
  568. beginQueryEXT(target: number, query: WebGLQuery): void;
  569. endQueryEXT(target: number): void;
  570. getQueryObjectEXT(query: WebGLQuery, target: number): any;
  571. deleteQueryEXT(query: WebGLQuery): void;
  572. }