recursal/MDN huggingface dataset:
BluetoothUUID
=============

 The **`BluetoothUUID`** interface of the `Web Bluetooth API` provides a way to look up Universally Unique Identifier (UUID) values by name in the
 registry maintained by the Bluetooth SIG.

Description
-----------

 A UUID string is a 128-bit UUID, for example `00001818-0000-1000-8000-00805f9b34fb`.
 The Bluetooth registry contains lists of descriptors, services, and characteristics identified by these UUIDs in addition to a 16- or 32- bit alias, and a name.

The `BluetoothUUID` interface provides methods to retrieve these 128-bit UUIDs.

Static methods
--------------

`BluetoothUUID.canonicalUUID()` 
Experimental

Returns the 128-bit UUID when passed the 16- or 32-bit UUID alias.

`BluetoothUUID.getCharacteristic()` 
Experimental

Returns the 128-bit UUID representing a registered characteristic when passed a name or the 16- or 32-bit UUID alias.

`BluetoothUUID.getDescriptor()` 
Experimental

Returns a UUID representing a registered descriptor when passed a name or the 16- or 32-bit UUID alias.

`BluetoothUUID.getService()` 
Experimental

Returns a UUID representing a registered service when passed a name or the 16- or 32-bit UUID alias.

Examples
--------

In the following example the UUID representing the service named `device_information` is returned and printed to the console.


```js
let result = BluetoothUUID.getService("device\_information");
console.log(result); // "0000180a-0000-1000-8000-00805f9b34fb"
```

Specifications
--------------

| Specification |
| --- |
| Web Bluetooth # bluetoothuuid |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
IdleDeadline
============

The `IdleDeadline` interface is used as the data type of the input parameter to idle callbacks established by calling `Window.requestIdleCallback()`. It offers a method, `timeRemaining()`, which lets you determine how much longer the user agent estimates it will remain idle and a property, `didTimeout`, which lets you determine if your callback is executing because its timeout duration expired.

To learn more about how request callbacks work, see Collaborative Scheduling of Background Tasks.

Instance properties
-------------------

`IdleDeadline.didTimeout` Read only 

A Boolean whose value is `true` if the callback is being executed because the timeout specified when the idle callback was installed has expired.

Instance methods
----------------

`IdleDeadline.timeRemaining()`

Returns a `DOMHighResTimeStamp`, which is a floating-point value providing an estimate of the number of milliseconds remaining in the current idle period. If the idle period is over, the value is 0. Your callback can call this repeatedly to see if there's enough time left to do more work before returning.

Example
-------

See our complete example in the article Cooperative Scheduling of Background Tasks API.

Specifications
--------------

| Specification |
| --- |
| requestIdleCallback() Cooperative Scheduling of Background Tasks # the-idledeadline-interface |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Cooperative Scheduling of Background Tasks API
* `Window.requestIdleCallback()`
* `Window.cancelIdleCallback()`
reportError() global function
=============================

**Note:** This feature is available in Web Workers

The **`reportError()`** global method may be used to report errors to the console or global event handlers, emulating an uncaught JavaScript exception.

 This feature is primarily intended for custom event-dispatching or callback-manipulating libraries.
 Libraries can use this feature to catch errors in callback code and re-throw them to the top level handler.
 This ensures that an exception in one callback will not prevent others from being handled, while at the same time ensuring that stack trace information is still readily available for debugging at the top level.

Syntax
------


```js
reportError(throwable)
```

### Parameters

`throwable`

An error object such as a `TypeError`.

### Return value

None (`undefined`).

### Exceptions

`TypeError`

The method is called without an error argument.

Examples
--------

Feature test for the method using:


```js
if (typeof self.reportError === "function") {
  // function is defined
}
```


 The following code shows how you might create and report an error, and how it may be caught using either the global `onerror` handler or by adding a listener for the `error` event.
 Note that the handler assigned to `onerror` must return `true` to stop the event propagating further.


```js
const newError = new Error("Some error message", "someFile.js", 11);
self.reportError(newError);

window.onerror = (message, source, lineno, colno, error) => {
  console.error(`message: ${error.message}, lineno: ${lineno}`);
  return true;
};

self.addEventListener("error", (error) => {
  console.error(error.filename);
});

// Output
// > "message:Some error message, lineno: 11"
// > "someFile.js"
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # runtime-script-errors |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `Window`
* `WorkerGlobalScope`
* error event
AudioWorklet
============

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The **`AudioWorklet`** interface of the Web Audio API is used to supply custom audio processing scripts that execute in a separate thread to provide very low latency audio processing.

The worklet's code is run in the `AudioWorkletGlobalScope` global execution context, using a separate Web Audio thread which is shared by the worklet and other audio nodes.

Access the audio context's instance of `AudioWorklet` through the `BaseAudioContext.audioWorklet` property.

Worklet

AudioWorkletInstance properties
-------------------

*The `AudioWorklet` interface does not define any properties of its own, but does inherit properties of `Worklet`.*

Instance methods
----------------

*This interface inherits methods from `Worklet`. The `AudioWorklet` interface does not define any methods of its own.*

Events
------

*`AudioWorklet` has no events to which it responds.*

Examples
--------

See `AudioWorkletNode` for complete examples of custom audio node creation.

Specifications
--------------

| Specification |
| --- |
| Web Audio API # AudioWorklet |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `AudioWorkletGlobalScope` — the global execution context of an `AudioWorklet`
* Web Audio API
* Using the Web Audio API
* Using AudioWorklet
VirtualKeyboard
===============

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The **`VirtualKeyboard`** interface of the VirtualKeyboard API is useful on devices that have on-screen virtual keyboards, such as tablets, mobile phones, or other devices where a hardware keyboard may not be available.

The `VirtualKeyboard` interface makes it possible to opt out of the automatic way browsers handle on-screen virtual keyboards by reducing the height of the viewport to make room for the virtual keyboard. You can prevent the browser from changing the size of the viewport, detect the position and size of the virtual keyboard — adapting the layout of your web page as a follow-up — and programmatically show or hide the virtual keyboard.

You access the `VirtualKeyboard` interface by using `navigator.virtualKeyboard`.

EventTarget

VirtualKeyboardInstance properties
-------------------

*The `VirtualKeyboard` interface inherits properties from its parent, `EventTarget`.*

`VirtualKeyboard.boundingRect` Read only  
Experimental

A `DOMRect` that describes the geometry of the virtual keyboard.

`VirtualKeyboard.overlaysContent` 
Experimental

A `Boolean` that defines whether the browser should stop handling the on-screen virtual keyboard.

Instance methods
----------------

*The `VirtualKeyboard` interface inherits methods from its parent, `EventTarget`.*

`VirtualKeyboard.show()` 
Experimental

Show the virtual keyboard.

`VirtualKeyboard.hide()` 
Experimental

Hide the virtual keyboard.

Events
------

`geometrychange` 
Experimental

Fires when the geometry of the on-screen virtual keyboard changes, which happens when the virtual keyboard appears or disappears.

Example
-------

The following example demonstrates how to opt out of the automatic virtual keyboard behavior, and detect the geometry of the virtual keyboard in the web page:


```js
if ("virtualKeyboard" in navigator) {
  navigator.virtualKeyboard.overlaysContent = true;

  navigator.virtualKeyboard.addEventListener("geometrychange", (event) => {
    const { x, y, width, height } = event.target.boundingRect;
  });
}
```

Specifications
--------------

| Specification |
| --- |
| VirtualKeyboard API # the-virtualkeyboard-interface |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* The VirtualKeyboard API
* Full control with the VirtualKeyboard API
CSSStyleValue
=============

The **`CSSStyleValue`** interface of the CSS Typed Object Model API is the base class of all CSS values accessible through the Typed OM API. An instance of this class may be used anywhere a string is expected.

Interfaces based on CSSStyleValue
---------------------------------

Below is a list of interfaces based on the `CSSStyleValue` interface.

* `CSSImageValue`
* `CSSKeywordValue`
* `CSSNumericValue`
* `CSSPositionValue`
* `CSSTransformValue`
* `CSSUnparsedValue`
Static methods
--------------

`CSSStyleValue.parse()`

Sets a specific CSS property to the specified values and returns the first value as a `CSSStyleValue` object.

`CSSStyleValue.parseAll()`

Sets all occurrences of a specific CSS property to the specified value and returns an array of `CSSStyleValue` objects, each containing one of the supplied values.

Specifications
--------------

| Specification |
| --- |
| CSS Typed OM Level 1 # stylevalue-objects |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
WakeLock
========

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The **`WakeLock`** interface of the Screen Wake Lock API can be used to request a lock that prevents device screens from dimming or locking when an application needs to keep running.

This interface, and hence the system wake lock, is exposed through the `Navigator.wakeLock` property.

Instance methods
----------------

`request()`

Returns a `Promise` that fulfills with a `WakeLockSentinel` object if the screen wake lock is granted.

Examples
--------

The following code `awaits` the request for a `WakeLockSentinel` object, and continues if the request is granted.

The `WakeLock.request()` method is wrapped in a `try...catch` statement to catch cases when the promise might be rejected rejected, such as due to low device power.


```js
try {
  const wakeLock = await navigator.wakeLock.request("screen");
} catch (err) {
  // the wake lock request fails - usually system related, such being low on battery
  console.log(`${err.name}, ${err.message}`);
}
```


 Note that the screen wake lock may be revoked by the device after it has been granted.
 The returned `WakeLockSentinel` can be used to check the status of the lock, and/or to manually cancel a held screen wake lock.

Specifications
--------------

| Specification |
| --- |
| Screen Wake Lock API # the-wakelock-interface |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Stay awake with the Screen Wake Lock API
RemotePlayback
==============

The **`RemotePlayback`** interface of the Remote Playback API allows the page to detect availability of remote playback devices, then connect to and control playing on these devices.

EventTarget

RemotePlaybackInstance properties
-------------------

`RemotePlayback.state` Read only 

Represents the `RemotePlayback` connection's state. One of:

`"connecting"`

The user agent is attempting to initiate remote playback with the selected device.

`"connected"`

The transition from local to remote playback has happened, all commands will now take place on the remote device.

`"disconnected"`

The remote playback has not been initiated, has failed to initiate, or has been stopped.


Instance methods
----------------

`RemotePlayback.watchAvailability()`

A `Promise` that resolves with a `callbackId` of an available remote playback device.

`RemotePlayback.cancelWatchAvailability()`

Cancels the request to monitor the availability of remote playback devices.

`RemotePlayback.prompt()`

Prompts the user to select and give permission to connect to a remote playback device.

Events
------

`connecting`

Fired when the user agent initiates remote playback.

`connect`

Fired when the user agent successfully connects to the remote device.

`disconnect`

Fired when the user agent disconnects from the remote device.

Examples
--------

The following example demonstrates a player with custom controls that support remote playback. Initially the button used to select a device is hidden:


```html
<video id="videoElement" src="https://example.org/media.ext">
  <button id="deviceBtn" style="display: none;">Pick device</button>
</video>
```


The `RemotePlayback.watchAvailability()` method is used to watch for available remote playback devices. If a device is available, use the callback to show the button.


```js
const deviceBtn = document.getElementById("deviceBtn");
const videoElem = document.getElementById("videoElement");

function availabilityCallback(available) {
  // Show or hide the device picker button depending on device availability.
  deviceBtn.style.display = available ? "inline" : "none";
}

videoElem.remote.watchAvailability(availabilityCallback).catch(() => {
  /\* If the device cannot continuously watch available,
 show the button to allow the user to try to prompt for a connection.\*/
  deviceBtn.style.display = "inline";
});
```

Specifications
--------------

| Specification |
| --- |
| Remote Playback API # remoteplayback-interface |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
Accelerometer
=============

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The **`Accelerometer`** interface of the Sensor APIs provides on each reading the acceleration applied to the device along all three axes.

To use this sensor, the user must grant permission to the `'accelerometer'`, device sensor through the Permissions API.

This feature may be blocked by a Permissions Policy set on your server.

EventTarget

Sensor

AccelerometerConstructor
-----------

`Accelerometer()` 
Experimental

Creates a new `Accelerometer` object.

Instance properties
-------------------

*In addition to the properties listed below, `Accelerometer` inherits properties from its parent interfaces, `Sensor` and `EventTarget`.*

`Accelerometer.x` Read only  
Experimental

Returns a double containing the acceleration of the device along the device's x axis.

`Accelerometer.y` Read only  
Experimental

Returns a double containing the acceleration of the device along the device's y axis.

`Accelerometer.z` Read only  
Experimental

Returns a double containing the acceleration of the device along the device's z axis.

Instance methods
----------------

*`Accelerometer` doesn't have own methods. However, it inherits methods from its parent interfaces, `Sensor` and `EventTarget`.*

Events
------

*`Accelerometer` doesn't have own events. However, it inherits events from its parent interface, `Sensor`.*

Example
-------

Acceleration is typically read in the `reading` event callback. In the example below this occurs sixty times a second.


```js
const acl = new Accelerometer({ frequency: 60 });
acl.addEventListener("reading", () => {
  console.log(`Acceleration along the X-axis ${acl.x}`);
  console.log(`Acceleration along the Y-axis ${acl.y}`);
  console.log(`Acceleration along the Z-axis ${acl.z}`);
});

acl.start();
```

Specifications
--------------

| Specification |
| --- |
| Accelerometer # accelerometer-interface |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
XRInputSourceEvent
==================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The WebXR Device API's **`XRInputSourceEvent`** interface describes an event which has occurred on a WebXR user input device such as a hand controller, gaze tracking system, or motion tracking system. More specifically, they represent a change in the state of an `XRInputSource`.

To learn more about handling inputs in a WebXR project, see the article Inputs and input sources.

Event

XRInputSourceEventConstructor
-----------

`XRInputSourceEvent()`

Creates and returns a new `XRInputSourceEvent` object whose properties match those provided in the `eventInitDict` dictionary provided.

Instance properties
-------------------

`frame` Read only 

An `XRFrame` object providing the needed information about the event frame during which the event occurred. This frame may have been rendered in the past rather than being a current frame. Because this is an *event* frame, not an *animation* frame, you cannot call the `XRFrame` method `getViewerPose()` on it; instead, use `getPose()`.

`inputSource` Read only 

An `XRInputSource` object indicating which input source generated the input event.

Instance methods
----------------

*The `XRInputSourceEvent` interface doesn't define any methods; however, several methods are inherited from the parent interface, `Event`.*

Event types
-----------

`select`

Sent to an `XRSession` when the sending input source has fully completed a primary action.

`selectend`

Sent to an `XRSession` when an ongoing primary action ends, or when an input source with an ongoing primary action has been disconnected from the system.

`selectstart`

Sent to an `XRSession` when an input source begins its primary action, indicating that the user has begun a command-like input, such as pressing a trigger or button, issuing a spoken command, tapping on a touchpad, or the like.

`squeeze`

Sent to an `XRSession` when the sending input source has fully completed a primary squeeze action.

`squeezeend`

Sent to an `XRSession` when an ongoing primary squeeze action ends or when an input source with an ongoing primary squeeze action is disconnected.

`squeezestart`

Sent to an `XRSession` when an input source begins its primary squeeze action, indicating that the user has begun to grab, squeeze, or grip the controller.

Examples
--------

The code below sets up handlers for primary action events in order to determine when the user clicks on (shoots at/pokes at/whatever) objects in the scene.


```js
xrSession.addEventListener("select", (event) => {
  let targetRayPose = event.frame.getPose(
    event.inputSource.targetRaySpace,
    myRefSpace,
  );

  if (targetRayPose) {
    let hit = myHitTest(targetRayPose.transform);
    if (hit) {
      /\* handle the hit \*/
    }
  }
});
```

Specifications
--------------

| Specification |
| --- |
| WebXR Device API # xrinputsourceevent-interface |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
PageTransitionEvent
===================

The **`PageTransitionEvent`** event object is available inside handler functions for the `pageshow` and `pagehide` events, fired when a document is being loaded or unloaded.

Event

PageTransitionEventConstructor
-----------

`PageTransitionEvent()`

Creates a new `PageTransitionEvent` object.

Instance properties
-------------------

*This interface also inherits properties from its parent, `Event`.*

`PageTransitionEvent.persisted` Read only 

Indicates if the document is loading from a cache.

Example
-------

### HTML


```html
<!doctype html>
<html lang="en-US">
  <body></body>
</html>
```

### JavaScript


```js
window.addEventListener("pageshow", (event) => {
  if (event.persisted) {
    alert("The page was cached by the browser");
  } else {
    alert("The page was NOT cached by the browser");
  }
});
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # the-pagetransitionevent-interface |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `pageshow` event
* `pagehide` event
XRLayer
=======

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The **`XRLayer`** interface of the WebXR Device API is the base class for WebXR layer types. It inherits methods from `EventTarget`.

EventTarget

XRLayerInterfaces based on `XRLayer`
-----------------------------

Below is a list of interfaces based on the `XRLayer` interface.

* `XRCompositionLayer`
* `XRWebGLLayer`
Instance methods
----------------

*Inherits methods from its parent, `EventTarget`*.

Specifications
--------------

| Specification |
| --- |
| WebXR Device API # xrlayer-interface |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `XRCompositionLayer`
* `XRWebGLLayer`
* `EventTarget`
AnimationEvent
==============

The **`AnimationEvent`** interface represents events providing information related to animations.

Event

AnimationEventConstructor
-----------

`AnimationEvent()`

Creates an `AnimationEvent` event with the given parameters.

Instance properties
-------------------

*Also inherits properties from its parent `Event`*.

`AnimationEvent.animationName` Read only 

A string containing the value of the `animation-name` that generated the animation.

`AnimationEvent.elapsedTime` Read only 

A `float` giving the amount of time the animation has been running, in seconds, when this event fired, excluding any time the animation was paused. For an `animationstart` event, `elapsedTime` is `0.0` unless there was a negative value for `animation-delay`, in which case the event will be fired with `elapsedTime` containing `(-1 * delay)`.

`AnimationEvent.pseudoElement` Read only 

A string, starting with `'::'`, containing the name of the pseudo-element the animation runs on. If the animation doesn't run on a pseudo-element but on the element, an empty string: `''`.

Instance methods
----------------

*Inherits methods from its parent, `Event`*.

Specifications
--------------

| Specification |
| --- |
| CSS Animations Level 1 # interface-animationevent |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Using CSS animations
* Animation-related CSS properties and at-rules: `animation`, `animation-composition`, `animation-delay`, `animation-direction`, `animation-duration`, `animation-fill-mode`, `animation-iteration-count`, `animation-name`, `animation-play-state`, `animation-timing-function`, `@keyframes`.