babylon.mixins.ts 33 KB

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