| // GENERATED CONTENT - DO NOT EDIT |
| // Content was automatically extracted by Reffy into reffy-reports |
| // (https://github.com/tidoust/reffy-reports) |
| // Source: WebXR Device API (https://immersive-web.github.io/webxr/) |
| |
| [SecureContext, Exposed=Window] interface XR : EventTarget { |
| // Methods |
| Promise<void> supportsSessionMode(XRSessionMode mode); |
| Promise<XRSession> requestSession(optional XRSessionCreationOptions parameters); |
| |
| // Events |
| attribute EventHandler ondevicechange; |
| }; |
| |
| [SecureContext] |
| partial interface Navigator { |
| [SameObject] readonly attribute XR xr; |
| }; |
| |
| enum XREnvironmentBlendMode { |
| "opaque", |
| "additive", |
| "alpha-blend", |
| }; |
| |
| [SecureContext, Exposed=Window] interface XRSession : EventTarget { |
| // Attributes |
| readonly attribute XRSessionMode mode; |
| readonly attribute XRPresentationContext outputContext; |
| readonly attribute XREnvironmentBlendMode environmentBlendMode; |
| |
| attribute double depthNear; |
| attribute double depthFar; |
| attribute XRLayer baseLayer; |
| |
| // Methods |
| Promise<XRReferenceSpace> requestReferenceSpace(XRReferenceSpaceType type, optional XRReferenceSpaceOptions options); |
| |
| FrozenArray<XRInputSource> getInputSources(); |
| |
| long requestAnimationFrame(XRFrameRequestCallback callback); |
| void cancelAnimationFrame(long handle); |
| |
| Promise<void> end(); |
| |
| // Events |
| attribute EventHandler onblur; |
| attribute EventHandler onfocus; |
| attribute EventHandler onend; |
| attribute EventHandler onselect; |
| attribute EventHandler oninputsourceschange; |
| attribute EventHandler onselectstart; |
| attribute EventHandler onselectend; |
| }; |
| |
| enum XRSessionMode { |
| "inline", |
| "immersive-vr", |
| "immersive-ar" |
| }; |
| |
| dictionary XRSessionCreationOptions { |
| XRSessionMode mode = "inline"; |
| XRPresentationContext outputContext; |
| }; |
| |
| callback XRFrameRequestCallback = void (DOMHighResTimeStamp time, XRFrame frame); |
| |
| [SecureContext, Exposed=Window] interface XRFrame { |
| readonly attribute XRSession session; |
| |
| XRViewerPose? getViewerPose(optional XRReferenceSpace referenceSpace); |
| XRInputPose? getInputPose(XRInputSource inputSource, optional XRReferenceSpace referenceSpace); |
| }; |
| |
| [SecureContext, Exposed=Window] interface XRSpace : EventTarget { |
| XRRigidTransform? getTransformTo(XRSpace other); |
| }; |
| |
| enum XRReferenceSpaceType { |
| "stationary", |
| "bounded", |
| "unbounded" |
| }; |
| |
| dictionary XRReferenceSpaceOptions { |
| required XRReferenceSpaceType type; |
| }; |
| |
| [SecureContext, Exposed=Window] interface XRReferenceSpace : XRSpace { |
| attribute EventHandler onreset; |
| }; |
| |
| enum XRStationaryReferenceSpaceSubtype { |
| "eye-level", |
| "floor-level", |
| "position-disabled" |
| }; |
| |
| dictionary XRStationaryReferenceSpaceOptions : XRReferenceSpaceOptions { |
| required XRStationaryReferenceSpaceSubtype subtype; |
| }; |
| |
| [SecureContext, Exposed=Window] |
| interface XRStationaryReferenceSpace : XRReferenceSpace { |
| readonly attribute XRStationaryReferenceSpaceSubtype subtype; |
| }; |
| |
| [SecureContext, Exposed=Window] |
| interface XRBoundedReferenceSpace : XRReferenceSpace { |
| readonly attribute FrozenArray<DOMPointReadOnly> boundsGeometry; |
| }; |
| |
| [SecureContext, Exposed=Window] |
| |
| interface XRUnboundedReferenceSpace : XRReferenceSpace { |
| }; |
| |
| enum XREye { |
| "left", |
| "right" |
| }; |
| |
| [SecureContext, Exposed=Window] interface XRView { |
| readonly attribute XREye eye; |
| readonly attribute Float32Array projectionMatrix; |
| readonly attribute Float32Array viewMatrix; |
| readonly attribute XRRigidTransform transform; |
| }; |
| |
| [SecureContext, Exposed=Window] interface XRViewport { |
| readonly attribute long x; |
| readonly attribute long y; |
| readonly attribute long width; |
| readonly attribute long height; |
| }; |
| |
| [SecureContext, Exposed=Window, |
| Constructor(optional DOMPointInit position, optional DOMPointInit orientation)] |
| interface XRRigidTransform { |
| readonly attribute DOMPointReadOnly position; |
| readonly attribute DOMPointReadOnly orientation; |
| readonly attribute Float32Array matrix; |
| }; |
| |
| [SecureContext, Exposed=Window, |
| Constructor(optional DOMPointInit origin, optional DOMPointInit direction), |
| Constructor(XRRigidTransform transform)] |
| interface XRRay { |
| readonly attribute DOMPointReadOnly origin; |
| readonly attribute DOMPointReadOnly direction; |
| readonly attribute Float32Array matrix; |
| }; |
| |
| [SecureContext, Exposed=Window] interface XRViewerPose { |
| readonly attribute XRRigidTransform transform; |
| readonly attribute FrozenArray<XRView> views; |
| }; |
| |
| enum XRHandedness { |
| "", |
| "left", |
| "right" |
| }; |
| |
| enum XRTargetRayMode { |
| "gaze", |
| "tracked-pointer", |
| "screen" |
| }; |
| |
| [SecureContext, Exposed=Window] |
| interface XRInputSource { |
| readonly attribute XRHandedness handedness; |
| readonly attribute XRTargetRayMode targetRayMode; |
| }; |
| |
| [SecureContext, Exposed=Window] |
| interface XRInputPose { |
| readonly attribute boolean emulatedPosition; |
| readonly attribute XRRay targetRay; |
| readonly attribute XRRigidTransform? gripTransform; |
| }; |
| |
| [SecureContext, Exposed=Window] interface XRLayer {}; |
| |
| typedef (WebGLRenderingContext or |
| WebGL2RenderingContext) XRWebGLRenderingContext; |
| |
| dictionary XRWebGLLayerInit { |
| boolean antialias = true; |
| boolean depth = true; |
| boolean stencil = false; |
| boolean alpha = true; |
| double framebufferScaleFactor = 1.0; |
| }; |
| |
| [SecureContext, Exposed=Window, Constructor(XRSession session, |
| XRWebGLRenderingContext context, |
| optional XRWebGLLayerInit layerInit)] |
| interface XRWebGLLayer : XRLayer { |
| // Attributes |
| readonly attribute XRWebGLRenderingContext context; |
| |
| readonly attribute boolean antialias; |
| readonly attribute boolean depth; |
| readonly attribute boolean stencil; |
| readonly attribute boolean alpha; |
| |
| readonly attribute WebGLFramebuffer framebuffer; |
| readonly attribute unsigned long framebufferWidth; |
| readonly attribute unsigned long framebufferHeight; |
| |
| // Methods |
| XRViewport? getViewport(XRView view); |
| void requestViewportScaling(double viewportScaleFactor); |
| |
| // Static Methods |
| static double getNativeFramebufferScaleFactor(XRSession session); |
| }; |
| |
| partial dictionary WebGLContextAttributes { |
| boolean xrCompatible = null; |
| }; |
| |
| partial interface mixin WebGLRenderingContextBase { |
| Promise<void> makeXRCompatible(); |
| }; |
| |
| [SecureContext, Exposed=Window] interface XRPresentationContext { |
| readonly attribute HTMLCanvasElement canvas; |
| }; |
| |
| [SecureContext, Exposed=Window, Constructor(DOMString type, XRSessionEventInit eventInitDict)] |
| interface XRSessionEvent : Event { |
| readonly attribute XRSession session; |
| }; |
| |
| dictionary XRSessionEventInit : EventInit { |
| required XRSession session; |
| }; |
| |
| [SecureContext, Exposed=Window, Constructor(DOMString type, XRInputSourceEventInit eventInitDict)] |
| interface XRInputSourceEvent : Event { |
| readonly attribute XRFrame frame; |
| readonly attribute XRInputSource inputSource; |
| }; |
| |
| dictionary XRInputSourceEventInit : EventInit { |
| required XRFrame frame; |
| required XRInputSource inputSource; |
| }; |
| |
| [SecureContext, Exposed=Window, Constructor(DOMString type, XRReferenceSpaceEventInit eventInitDict)] |
| interface XRReferenceSpaceEvent : Event { |
| readonly attribute XRReferenceSpace referenceSpace; |
| readonly attribute XRRigidTransform? transform; |
| }; |
| |
| dictionary XRReferenceSpaceEventInit : EventInit { |
| required XRReferenceSpace referenceSpace; |
| XRRigidTransform transform; |
| }; |