babylon.mixins.ts 33 KB

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