recursal/MDN huggingface dataset:
FileSystemDirectoryReader
=========================

The `FileSystemDirectoryReader` interface of the File and Directory Entries API lets you access the `FileSystemFileEntry`-based objects (generally `FileSystemFileEntry` or `FileSystemDirectoryEntry`) representing each entry in a directory.

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

`readEntries()`

Returns an array containing some number of the directory's entries. Each item in the array is an object based on `FileSystemEntry`—typically either `FileSystemFileEntry` or `FileSystemDirectoryEntry`.

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

| Specification |
| --- |
| File and Directory Entries API # api-directoryreader |

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

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

See also
--------

* File and Directory Entries API
* Introduction to the File and Directory Entries API
* `FileSystemDirectoryEntry`
* `FileSystem`
SVGAElement
===========

The **`SVGAElement`** interface provides access to the properties of an `<a>` element, as well as methods to manipulate them.

EventTarget

Node

Element

SVGElement

SVGGraphicsElement

SVGAElementInstance properties
-------------------

*This interface also inherits properties from its parent, `SVGGraphicsElement`, and implements properties from `HTMLHyperlinkElementUtils`.*

`SVGAElement.download`

See `HTMLAnchorElement.download`.

`SVGAElement.href` Read only 

An `SVGAnimatedString` that reflects the `href` or `xlink:href` 
Deprecated
 attribute.

`SVGAElement.hreflang`

A string that reflects the `hreflang` attribute, indicating the language of the linked resource.

`SVGAElement.ping`

A string that reflects the ping attribute, containing a space-separated list of URLs to which, when the hyperlink is followed, `POST` requests with the body `PING` will be sent by the browser (in the background). Typically used for tracking.

`SVGAElement.referrerPolicy`

See `HTMLAnchorElement.referrerPolicy`.

`SVGAElement.rel`

See `HTMLAnchorElement.rel`.

`SVGAElement.relList`

See `HTMLAnchorElement.relList`.

`SVGAElement.target` Read only 

It corresponds to the `target` attribute of the given element.

`SVGAElement.text`

A string being a synonym for the `Node.textContent` property.

`SVGAElement.type`

A string that reflects the `type` attribute, indicating the MIME type of the linked resource.

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

*This interface has no methods but inherits methods from its parent, `SVGGraphicsElement`.*

Example
-------

In the example below, the `target` attribute of the `<a>` element is set to `_blank` and when the link is clicked, it logs to notify whether the condition is met or not.


```js
const linkRef = document.querySelector("a");
linkRef.target = "\_self";

linkRef.onclick = () => {
  if (linkRef.target === "\_blank") {
    console.log("BLANK!");
    linkRef.target = "\_self";
  } else {
    console.log("SORRY! not \_blank");
  }
};
```

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

| Specification |
| --- |
| Scalable Vector Graphics (SVG) 2 # InterfaceSVGAElement |

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

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

See also
--------

* SVG `<a>` element
StyleSheetList
==============

The `StyleSheetList` interface represents a list of `CSSStyleSheet` objects. An instance of this object can be returned by `Document.styleSheets`.

It is an array-like object but can't be iterated over using `Array` methods. However it can be iterated over in a standard `for` loop over its indices, or converted to an `Array`.

**Note:** This interface was an attempt to create an unmodifiable list and only continues to be supported to not break code that's already using it. Modern APIs use types that wrap around ECMAScript array types instead, so you can treat them like ECMAScript arrays, and at the same time impose additional semantics on their usage (such as making their items read-only).

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

`StyleSheetList.length` Read only 

Returns the number of `CSSStyleSheet` objects in the collection.

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

`StyleSheetList.item()`

Returns the `CSSStyleSheet` object at the index passed in, or `null` if no item exists for that index.

Examples
--------

### Get CSSStyleSheet objects with for loop


```js
const styleSheet = [];
const styleSheets = document.styleSheets;

for (let i = 0; i < styleSheets.length; i++) {
  styleSheet.push(styleSheets[i]);
}
```

### Get all CSS rules for the document using Array methods


```js
const allCSS = [...document.styleSheets]
  .map((styleSheet) => {
    try {
      return [...styleSheet.cssRules].map((rule) => rule.cssText).join("");
    } catch (e) {
      console.log(
        "Access to stylesheet %s is denied. Ignoring…",
        styleSheet.href,
      );
    }
  })
  .filter(Boolean)
  .join("\n");
```

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

| Specification |
| --- |
| CSS Object Model (CSSOM) # the-stylesheetlist-interface |

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

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

The **`WaveShaperNode`** interface represents a non-linear distorter.

It is an `AudioNode` that uses a curve to apply a wave shaping distortion to the signal. Beside obvious distortion effects, it is often used to add a warm feeling to the signal.

A `WaveShaperNode` always has exactly one input and one output.

EventTarget

AudioNode

WaveShaperNode

|  |  |
| --- | --- |
| Number of inputs | `1` |
| Number of outputs | `1` |
| Channel count mode | `"max"` |
| Channel count | `2` (not used in the default count mode) |
| Channel interpretation | `"speakers"` |

Constructor
-----------

`WaveShaperNode()`

Creates a new instance of an `WaveShaperNode` object.

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

*Inherits properties from its parent, `AudioNode`*.

`WaveShaperNode.curve`

A `Float32Array` of numbers describing the distortion to apply.

`WaveShaperNode.oversample`

An enumerated value indicating if oversampling must be used. Oversampling is a technique for creating more samples (up-sampling) before applying the distortion effect to the audio signal.

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

*No specific method; inherits methods from its parent, `AudioNode`*.

Example
-------

See `BaseAudioContext.createWaveShaper()` for example code.

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

| Specification |
| --- |
| Web Audio API # WaveShaperNode |

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

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

See also
--------

* Using the Web Audio API
OTPCredential
=============

**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 **`OTPCredential`** interface of the WebOTP API is returned when a WebOTP `navigator.credentials.get()` call (i.e. invoked with an `otp` option) fulfills. It includes a `code` property that contains the retrieved one-time password (OTP).

Credential

OTPCredentialInstance properties
-------------------

*This interface also inherits properties from `Credential`.*

`OTPCredential.code` 
Experimental

The OTP.

`OTPCredential.id`

Inherited from `Credential`. The ID of the credential type.

`OTPCredential.type`

Inherited from `Credential`. Always set to `otp` for `OTPCredential` instances.

### Event handlers

None.

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

None.

Examples
--------

The below code triggers the browser's permission flow when an SMS message arrives. If permission is granted, then the promise resolves with an `OTPCredential` object. The contained `code` value is then set as the value of an `<input>` form element, which is then submitted.


```js
navigator.credentials
  .get({
    otp: { transport: ["sms"] },
    signal: ac.signal,
  })
  .then((otp) => {
    input.value = otp.code;
    if (form) form.submit();
  })
  .catch((err) => {
    console.error(err);
  });
```


**Note:** For a full explanation of the code, see the WebOTP API landing page. You can also see this code as part of a full working demo.

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

| Specification |
| --- |
| WebOTP API # OTPCredential |

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

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

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**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 `USBIsochronousInTransferPacket` interface of the WebUSB API is part of the response from a call to the `isochronousTransferIn()` method of the `USBDevice` interface. It represents the status of an individual packet from a request to transfer data from the USB device to the USB host over an isochronous endpoint.

Constructor
-----------

`USBIsochronousInTransferPacket()` 
Experimental

Creates a new `USBIsochronousInTransferPacket` object with the provided `status` and `data` fields.

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

`USBIsochronousInTransferPacket.data` Read only  Read only  
Experimental

Returns a `DataView` object containing the data received from the USB device in this packet, if any.

`USBIsochronousInTransferPacket.status` Read only  Read only  
Experimental

Returns the status of the transfer request, one of:

* `"ok"` - The transfer was successful.
* `"stall"` - The device indicated an error by generating a stall condition on the endpoint. A stall on an isochronous endpoint does not need to be cleared.
* `"babble"` - The device responded with more data than was expected.

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

| Specification |
| --- |
| WebUSB API # usbisochronousintransferpacket |

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

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

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The **`BackgroundFetchRecord`** interface of the Background Fetch API represents an individual request and response.

A `BackgroundFetchRecord` is created by the `BackgroundFetchRegistration.matchAll()` method, therefore there is no constructor for this interface.

There will be one `BackgroundFetchRecord` for each resource requested by `fetch()`.

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

`request` Read only  
Experimental

Returns a `Request`.

`responseReady` Read only  
Experimental

Returns a promise that resolves with a `Response`.

Examples
--------

In this example an individual `BackgroundFetchRecord` is returned using `BackgroundFetchRegistration.matchAll()`. The `BackgroundFetchRecord.request` and `BackgroundFetchRecord.responseReady` are returned and logged to the console.


```js
bgFetch.match("/ep-5.mp3").then(async (record) => {
  if (!record) {
    console.log("No record found");
    return;
  }

  console.log(`Here's the request`, record.request);
  const response = await record.responseReady;
  console.log(`And here's the response`, response);
});
```

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

| Specification |
| --- |
| Background Fetch # background-fetch-record-interface |

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

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

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

The Web Bluetooth API provides the ability to connect and interact with Bluetooth Low Energy peripherals.

**Note:** This API is *not available* in Web Workers (not exposed via `WorkerNavigator`).

Interfaces
----------

`Bluetooth`

Returns a `Promise` to a `BluetoothDevice` object with the specified options.

`BluetoothCharacteristicProperties`

Provides properties of a particular `BluetoothRemoteGATTCharacteristic`.

`BluetoothDevice`

Represents a Bluetooth device inside a particular script execution environment.

`BluetoothRemoteGATTCharacteristic`

Represents a GATT Characteristic, which is a basic data element that provides further information about a peripheral's service.

`BluetoothRemoteGATTDescriptor`

Represents a GATT Descriptor, which provides further information about a characteristic's value.

`BluetoothRemoteGATTServer`

Represents a GATT Server on a remote device.

`BluetoothRemoteGATTService`

Represents a service provided by a GATT server, including a device, a list of referenced services, and a list of the characteristics of this service.

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

| Specification |
| --- |
| Web Bluetooth # bluetooth |

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

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

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

The **`GPUDeviceLostInfo`** interface of the WebGPU API represents the object returned when the `GPUDevice.lost` `Promise` resolves. This provides information as to why a device has been lost.

See the `GPUDevice.lost` page for more information about "lost" state.

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

`message` 
Experimental
 Read only 

A string providing a human-readable message that explains why the device was lost.

`reason` 
Experimental
 Read only 

An enumerated value that defines the reason the device was lost in a machine-readable way.

Examples
--------


```js
async function init() {
  if (!navigator.gpu) {
    throw Error("WebGPU not supported.");
  }
  const adapter = await navigator.gpu.requestAdapter();
  if (!adapter) {
    throw Error("Couldn't request WebGPU adapter.");
  }

  // Create a GPUDevice
  let device = await adapter.requestDevice(descriptor);

  // Use lost to handle lost devices
  device.lost.then((info) => {
    console.error(`WebGPU device was lost: ${info.message}`);
    device = null;
    if (info.reason !== "destroyed") {
      init();
    }
  });
  // ...
}
```

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

| Specification |
| --- |
| WebGPU # gpudevicelostinfo |

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

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

See also
--------

* The WebGPU API
SVGFEBlendElement
=================

The **`SVGFEBlendElement`** interface corresponds to the `<feBlend>` element.

EventTarget

Node

Element

SVGElement

SVGFEBlendElementConstants
---------

| Name | Value | Description |
| --- | --- | --- |
| `SVG_FEBLEND_MODE_UNKNOWN` | 0 | 
 The type is not one of predefined types. It is invalid to attempt to
 define a new value of this type or to attempt to switch an existing
 value to this type.
  |
| `SVG_FEBLEND_MODE_NORMAL` | 1 | Corresponds to the value `normal`. |
| `SVG_FEBLEND_MODE_MULTIPLY` | 2 | Corresponds to the value `multiply`. |
| `SVG_FEBLEND_MODE_SCREEN` | 3 | Corresponds to the value `screen`. |
| `SVG_FEBLEND_MODE_DARKEN` | 4 | Corresponds to the value `darken`. |
| `SVG_FEBLEND_MODE_LIGHTEN` | 5 | Corresponds to the value `lighten`. |

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

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

`SVGFEBlendElement.height` Read only 

An `SVGAnimatedLength` corresponding to the `height` attribute of the given element.

`SVGFEBlendElement.in1` Read only 

An `SVGAnimatedString` corresponding to the `in` attribute of the given element.

`SVGFEBlendElement.in2` Read only 

An `SVGAnimatedString` corresponding to the `in2` attribute of the given element.

`SVGFEBlendElement.mode` Read only 

An `SVGAnimatedEnumeration` corresponding to the `mode` attribute of the given element. It takes one of the `SVG_FEBLEND_MODE_*` constants defined on this interface.

`SVGFEBlendElement.result` Read only 

An `SVGAnimatedString` corresponding to the `result` attribute of the given element.

`SVGFEBlendElement.width` Read only 

An `SVGAnimatedLength` corresponding to the `width` attribute of the given element.

`SVGFEBlendElement.x` Read only 

An `SVGAnimatedLength` corresponding to the `x` attribute of the given element.

`SVGFEBlendElement.y` Read only 

An `SVGAnimatedLength` corresponding to the `y` attribute of the given element.

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

*This interface does not provide any specific methods, but implements those of its parent, `SVGElement`.*

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

| Specification |
| --- |
| Filter Effects Module Level 1 # InterfaceSVGFEBlendElement |

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

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

See also
--------

* `<feBlend>`
FileSystemWritableFileStream
============================

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

The **`FileSystemWritableFileStream`** interface of the File System API is a `WritableStream` object with additional convenience methods, which operates on a single file on disk. The interface is accessed through the `FileSystemFileHandle.createWritable()` method.

WritableStream

FileSystemWritableFileStreamInstance properties
-------------------

*Inherits properties from its parent, `WritableStream`.*

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

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

`FileSystemWritableFileStream.write()`

Writes content into the file the method is called on, at the current file cursor offset.

`FileSystemWritableFileStream.seek()`

Updates the current file cursor offset to the position (in bytes) specified.

`FileSystemWritableFileStream.truncate()`

Resizes the file associated with the stream to be the specified size in bytes.

Examples
--------

The following asynchronous function opens the 'Save File' picker, which returns a `FileSystemFileHandle` once a file is selected. From this, a writable stream is created using the `FileSystemFileHandle.createWritable()` method.

A text string is then written to the stream, which is subsequently closed.


```js
async function saveFile() {
  // create a new handle
  const newHandle = await window.showSaveFilePicker();

  // create a FileSystemWritableFileStream to write to
  const writableStream = await newHandle.createWritable();

  // write our file
  await writableStream.write("This is my file content");

  // close the file and write the contents to disk.
  await writableStream.close();
}
```


The following examples show different options that can be passed into the `write()` method.


```js
// just pass in the data (no options)
writableStream.write(data);

// writes the data to the stream from the determined position
writableStream.write({ type: "write", position, data });

// updates the current file cursor offset to the position specified
writableStream.write({ type: "seek", position });

// resizes the file to be size bytes long
writableStream.write({ type: "truncate", size });
```

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

| Specification |
| --- |
| File System Standard # api-filesystemwritablefilestream |

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

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

See also
--------

* File System API
* The File System Access API: simplifying access to local files
DOMImplementation
=================

The **`DOMImplementation`** interface represents an object providing methods which are not dependent on any particular document. Such an object is returned by the `Document.implementation` property.

Property
--------

*This interface has no specific property and doesn't inherit any.*

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

*No inherited method.*

`DOMImplementation.createDocument()`

Creates and returns an `XMLDocument`.

`DOMImplementation.createDocumentType()`

Creates and returns a `DocumentType`.

`DOMImplementation.createHTMLDocument()`

Creates and returns an HTML `Document`.

`DOMImplementation.hasFeature()` 
Deprecated

Returns a boolean value indicating if a given feature is supported or not. This function is unreliable and kept for compatibility purpose alone: except for SVG-related queries, it always returns `true`. Old browsers are very inconsistent in their behavior.

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

| Specification |
| --- |
| DOM Standard # interface-domimplementation |

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

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

See also
--------

* The DOM interfaces index.
TimeRanges
==========

When loading a media resource for use by an `<audio>` or `<video>` element, the **`TimeRanges`** interface is used for representing the time ranges of the media resource that have been buffered, the time ranges that have been played, and the time ranges that are seekable.

A `TimeRanges` object includes one or more ranges of time, each specified by a starting time offset and an ending time offset. You reference each time range by using the `start()` and `end()` methods, passing the index number of the time range you want to retrieve.

Normalized TimeRanges objects
-----------------------------

Several members of `HTMLMediaElement` objects return a **normalized TimeRanges object** — which the spec describes as having the following characteristics:

*The ranges in such an object are ordered, don't overlap, and don't touch (adjacent ranges are folded into one bigger range). A range can be empty (referencing just a single moment in time).*

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

`TimeRanges.length` Read only 

Returns an `unsigned long` representing the number of time ranges represented by the time range object.

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

`TimeRanges.start()`

Returns the time for the start of the range with the specified index.

`TimeRanges.end()`

Returns the time for the end of the specified range.

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

| Specification |
| --- |
| HTML Standard # time-ranges |

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

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