webxr.externs.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. /**
  2. * @type {XR}
  3. */
  4. Navigator.prototype.xr;
  5. /**
  6. * @constructor
  7. */
  8. function XRSessionInit() {};
  9. /**
  10. * @type {Array<string>}
  11. */
  12. XRSessionInit.prototype.requiredFeatures;
  13. /**
  14. * @type {Array<string>}
  15. */
  16. XRSessionInit.prototype.optionalFeatures;
  17. /**
  18. * @constructor
  19. */
  20. function XR() {}
  21. /**
  22. * @type {?function (Event)}
  23. */
  24. XR.prototype.ondevicechanged;
  25. /**
  26. * @param {string} mode
  27. *
  28. * @return {!Promise<boolean>}
  29. */
  30. XR.prototype.isSessionSupported = function(mode) {}
  31. /**
  32. * @param {string} mode
  33. * @param {XRSessionInit} options
  34. *
  35. * @return {!Promise<XRSession>}
  36. */
  37. XR.prototype.requestSession = function(mode, options) {}
  38. /**
  39. * @constructor
  40. */
  41. function XRSession() {}
  42. /**
  43. * @type {XRRenderState}
  44. */
  45. XRSession.prototype.renderState;
  46. /**
  47. * @type {Array<XRInputSource>}
  48. */
  49. XRSession.prototype.inputSources;
  50. /**
  51. * @type {string}
  52. */
  53. XRSession.prototype.visibilityState;
  54. /**
  55. * @type {?function (Event)}
  56. */
  57. XRSession.prototype.onend;
  58. /**
  59. * @type {?function (XRInputSourcesChangeEvent)}
  60. */
  61. XRSession.prototype.oninputsourceschange;
  62. /**
  63. * @type {?function (XRInputSourceEvent)}
  64. */
  65. XRSession.prototype.onselectstart;
  66. /**
  67. * @type {?function (XRInputSourceEvent)}
  68. */
  69. XRSession.prototype.onselect;
  70. /**
  71. * @type {?function (XRInputSourceEvent)}
  72. */
  73. XRSession.prototype.onselectend;
  74. /**
  75. * @type {?function (XRInputSourceEvent)}
  76. */
  77. XRSession.prototype.onsqueezestart;
  78. /**
  79. * @type {?function (XRInputSourceEvent)}
  80. */
  81. XRSession.prototype.onsqueeze;
  82. /**
  83. * @type {?function (XRInputSourceEvent)}
  84. */
  85. XRSession.prototype.onsqueezeend;
  86. /**
  87. * @type {?function (Event)}
  88. */
  89. XRSession.prototype.onvisibilitychange;
  90. /**
  91. * @param {XRRenderStateInit} state
  92. * @return {void}
  93. */
  94. XRSession.prototype.updateRenderState = function (state) {};
  95. /**
  96. * @param {XRFrameRequestCallback} callback
  97. * @return {number}
  98. */
  99. XRSession.prototype.requestAnimationFrame = function (callback) {};
  100. /**
  101. * @param {number} handle
  102. * @return {void}
  103. */
  104. XRSession.prototype.cancelAnimationFrame = function (handle) {};
  105. /**
  106. * @return {Promise<void>}
  107. */
  108. XRSession.prototype.end = function () {};
  109. /**
  110. * @param {string} referenceSpaceType
  111. * @return {Promise<XRReferenceSpace>}
  112. */
  113. XRSession.prototype.requestReferenceSpace = function (referenceSpaceType) {};
  114. /**
  115. * @typedef {function(number, XRFrame): undefined}
  116. */
  117. var XRFrameRequestCallback;
  118. /**
  119. * @constructor
  120. */
  121. function XRRenderStateInit() {}
  122. /**
  123. * @type {number}
  124. */
  125. XRRenderStateInit.prototype.depthNear;
  126. /**
  127. * @type {number}
  128. */
  129. XRRenderStateInit.prototype.depthFar;
  130. /**
  131. * @type {number}
  132. */
  133. XRRenderStateInit.prototype.inlineVerticalFieldOfView;
  134. /**
  135. * @type {?XRWebGLLayer}
  136. */
  137. XRRenderStateInit.prototype.baseLayer;
  138. /**
  139. * @constructor
  140. */
  141. function XRRenderState() {};
  142. /**
  143. * @type {number}
  144. */
  145. XRRenderState.prototype.depthNear;
  146. /**
  147. * @type {number}
  148. */
  149. XRRenderState.prototype.depthFar;
  150. /**
  151. * @type {?number}
  152. */
  153. XRRenderState.prototype.inlineVerticalFieldOfView;
  154. /**
  155. * @type {?XRWebGLLayer}
  156. */
  157. XRRenderState.prototype.baseLayer;
  158. /**
  159. * @constructor
  160. */
  161. function XRFrame() {}
  162. /**
  163. * @type {XRSession}
  164. */
  165. XRFrame.prototype.session;
  166. /**
  167. * @param {XRReferenceSpace} referenceSpace
  168. * @return {?XRViewerPose}
  169. */
  170. XRFrame.prototype.getViewerPose = function (referenceSpace) {};
  171. /**
  172. *
  173. * @param {XRSpace} space
  174. * @param {XRSpace} baseSpace
  175. * @return {XRPose}
  176. */
  177. XRFrame.prototype.getPose = function (space, baseSpace) {};
  178. /**
  179. * @constructor
  180. */
  181. function XRReferenceSpace() {};
  182. /**
  183. * @type {Array<DOMPointReadOnly>}
  184. */
  185. XRReferenceSpace.prototype.boundsGeometry;
  186. /**
  187. * @param {XRRigidTransform} originOffset
  188. * @return {XRReferenceSpace}
  189. */
  190. XRReferenceSpace.prototype.getOffsetReferenceSpace = function(originOffset) {};
  191. /**
  192. * @type {?function (Event)}
  193. */
  194. XRReferenceSpace.prototype.onreset;
  195. /**
  196. * @constructor
  197. */
  198. function XRRigidTransform() {};
  199. /**
  200. * @type {DOMPointReadOnly}
  201. */
  202. XRRigidTransform.prototype.position;
  203. /**
  204. * @type {DOMPointReadOnly}
  205. */
  206. XRRigidTransform.prototype.orientation;
  207. /**
  208. * @type {Float32Array}
  209. */
  210. XRRigidTransform.prototype.matrix;
  211. /**
  212. * @type {XRRigidTransform}
  213. */
  214. XRRigidTransform.prototype.inverse;
  215. /**
  216. * @constructor
  217. */
  218. function XRView() {}
  219. /**
  220. * @type {string}
  221. */
  222. XRView.prototype.eye;
  223. /**
  224. * @type {Float32Array}
  225. */
  226. XRView.prototype.projectionMatrix;
  227. /**
  228. * @type {XRRigidTransform}
  229. */
  230. XRView.prototype.transform;
  231. /**
  232. * @constructor
  233. */
  234. function XRViewerPose() {}
  235. /**
  236. * @type {Array<XRView>}
  237. */
  238. XRViewerPose.prototype.views;
  239. /**
  240. * @constructor
  241. */
  242. function XRViewport() {}
  243. /**
  244. * @type {number}
  245. */
  246. XRViewport.prototype.x;
  247. /**
  248. * @type {number}
  249. */
  250. XRViewport.prototype.y;
  251. /**
  252. * @type {number}
  253. */
  254. XRViewport.prototype.width;
  255. /**
  256. * @type {number}
  257. */
  258. XRViewport.prototype.height;
  259. /**
  260. * @constructor
  261. */
  262. function XRWebGLLayerInit() {};
  263. /**
  264. * @type {boolean}
  265. */
  266. XRWebGLLayerInit.prototype.antialias;
  267. /**
  268. * @type {boolean}
  269. */
  270. XRWebGLLayerInit.prototype.depth;
  271. /**
  272. * @type {boolean}
  273. */
  274. XRWebGLLayerInit.prototype.stencil;
  275. /**
  276. * @type {boolean}
  277. */
  278. XRWebGLLayerInit.prototype.alpha;
  279. /**
  280. * @type {boolean}
  281. */
  282. XRWebGLLayerInit.prototype.ignoreDepthValues;
  283. /**
  284. * @type {boolean}
  285. */
  286. XRWebGLLayerInit.prototype.ignoreDepthValues;
  287. /**
  288. * @type {number}
  289. */
  290. XRWebGLLayerInit.prototype.framebufferScaleFactor;
  291. /**
  292. * @constructor
  293. *
  294. * @param {XRSession} session
  295. * @param {WebGLRenderContext|WebGL2RenderingContext} ctx
  296. * @param {?XRWebGLLayerInit} options
  297. */
  298. function XRWebGLLayer(session, ctx, options) {}
  299. /**
  300. * @type {boolean}
  301. */
  302. XRWebGLLayer.prototype.antialias;
  303. /**
  304. * @type {boolean}
  305. */
  306. XRWebGLLayer.prototype.ignoreDepthValues;
  307. /**
  308. * @type {number}
  309. */
  310. XRWebGLLayer.prototype.framebufferWidth;
  311. /**
  312. * @type {number}
  313. */
  314. XRWebGLLayer.prototype.framebufferHeight;
  315. /**
  316. * @type {WebGLFramebuffer}
  317. */
  318. XRWebGLLayer.prototype.framebuffer;
  319. /**
  320. * @param {XRView} view
  321. * @return {?XRViewport}
  322. */
  323. XRWebGLLayer.prototype.getViewport = function(view) {};
  324. /**
  325. * @param {XRSession} session
  326. * @return {number}
  327. */
  328. XRWebGLLayer.prototype.getNativeFramebufferScaleFactor = function (session) {};
  329. /**
  330. * @constructor
  331. */
  332. function WebGLRenderingContextBase() {};
  333. /**
  334. * @return {Promise<void>}
  335. */
  336. WebGLRenderingContextBase.prototype.makeXRCompatible = function () {};
  337. /**
  338. * @constructor
  339. */
  340. function XRInputSourcesChangeEvent() {};
  341. /**
  342. * @type {Array<XRInputSource>}
  343. */
  344. XRInputSourcesChangeEvent.prototype.added;
  345. /**
  346. * @type {Array<XRInputSource>}
  347. */
  348. XRInputSourcesChangeEvent.prototype.removed;
  349. /**
  350. * @constructor
  351. */
  352. function XRInputSourceEvent() {};
  353. /**
  354. * @type {XRFrame}
  355. */
  356. XRInputSourceEvent.prototype.frame;
  357. /**
  358. * @type {XRInputSource}
  359. */
  360. XRInputSourceEvent.prototype.inputSource;
  361. /**
  362. * @constructor
  363. */
  364. function XRInputSource() {};
  365. /**
  366. * @type {Gamepad}
  367. */
  368. XRInputSource.prototype.gamepad;
  369. /**
  370. * @type {XRSpace}
  371. */
  372. XRInputSource.prototype.gripSpace;
  373. /**
  374. * @type {string}
  375. */
  376. XRInputSource.prototype.handedness;
  377. /**
  378. * @type {string}
  379. */
  380. XRInputSource.prototype.profiles;
  381. /**
  382. * @type {string}
  383. */
  384. XRInputSource.prototype.targetRayMode;
  385. /**
  386. * @type {XRSpace}
  387. */
  388. XRInputSource.prototype.targetRaySpace;
  389. /**
  390. * @constructor
  391. */
  392. function XRSpace() {};
  393. /**
  394. * @constructor
  395. */
  396. function XRPose() {};
  397. /**
  398. * @type {XRRigidTransform}
  399. */
  400. XRPose.prototype.transform;
  401. /**
  402. * @type {boolean}
  403. */
  404. XRPose.prototype.emulatedPosition;