Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@webref/idl

Package Overview
Dependencies
Maintainers
3
Versions
185
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webref/idl

Web IDL definitions of the web platform

  • 3.56.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

Web IDL definitions of the web platform

This package contains Web IDL scraped from the latest versions of web platform specifications in webref, with fixes applied to ensure all definitions can be parsed and are internally consistent.

API

The async listAll() method resolves with an object where the keys are spec shortnames, and the values are objects with async text() and parse() methods to get the raw text and the result of parsing that with WebIDL2.parse, respectively. Example:

const idl = require('@webref/idl');

const files = await idl.listAll();
for (const [shortname, file] of Object.entries(files)) {
  const text = await file.text();
  const ast = await file.parse();
  // do something with text or ast
}

As a shorthand, the async parseAll() method resolves with an object where the keys are spec shortnames and the values are the result of parsing the IDL with WebIDL2.parse. Example:

const idl = require('@webref/idl');

const parsedFiles = await idl.parseAll();
for (const [shortname, ast] of Object.entries(parsedFiles)) {
  // do something with the ast
}

Guarantees

The following guarantees are provided by this package:

  • All IDL files can be parsed by the version of webidl2.js used in peerDependencies in package.json.
  • WebIDL2.validate passes with the exception of the "no-nointerfaceobject" rule about [LegacyNoInterfaceObject], which is in wide use.
  • All types are defined by some specification.
  • All extended attributes are defined by some specification.
  • No duplicate top-level definitions or members.
  • No missing or mismatched types in inheritance chains.
  • No conflicts when applying mixins and partials.

The following guarantees are not provided:

  • Extended attribute values are not validated.
  • Generally no other guarantees except the ones enforced by tests.

FAQs

Package last updated on 14 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc