npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@t15i/webidl-decorators

v1.1.1

Published

A set of TypeScript decorators that let you declare [WebIDL](https://webidl.spec.whatwg.org/) interfaces, attributes, and special operations directly on classes. The runtime semantics — platform object behavior, indexed/named property access, setters, and

Readme

webidl-decorators - TypeScript decorators for WebIDL interfaces

A set of TypeScript decorators that let you declare WebIDL interfaces, attributes, and special operations directly on classes. The runtime semantics — platform object behavior, indexed/named property access, setters, and deleters — are provided by @t15i/webspecs.

Coverage is intentionally narrow — this is a knowledge base, not a polyfill. Only the decorators that have been ported so far are listed below; everything else is marked with ....

Install

npm install @t15i/webidl-decorators

Usage

All decorators are exposed from a single entry point:

import {
  Interface,
  Attribute,
  IndexedPropertyGetter,
  NamedPropertyGetter,
  // ...
} from "@t15i/webidl-decorators";

Decorate a class with @Interface and any of its members with the appropriate decorators. Once instantiated, the class behaves as a WebIDL platform object:

import { Interface, Attribute, IndexedPropertyGetter } from "@t15i/webidl-decorators";
import { Nullable, Type, UnsignedLong } from "@t15i/webspecs/webidl";

@Interface
class HTMLCollection {
  @Attribute(UnsignedLong)
  get length(): number {
    // ...
  }

  @IndexedPropertyGetter(Nullable(Type(Element)))
  item(index: number): Element | null {
    // ...
  }
}

The decorator proposal used is the TC39 stage-3 / 2023-11 variant. Make sure your toolchain supports it.

What's implemented

Expand a section to see what is currently ported. ... marks sections with un-ported content.

  • §2 Interface definition language
    • §2.2 Interfaces
      • [x] @Interface
    • §2.5 Members
      • §2.5.2 Attributes
        • [x] @Attribute
      • §2.5.6 Special operations
        • §2.5.6.1 Indexed properties
          • [x] @IndexedPropertyGetter
          • [x] @IndexedPropertySetter
          • [x] @IndexedPropertyDeterminator
          • [x] @NewIndexedPropertySetter
          • [x] @ExistingIndexedPropertySetter
          • [x] @SupportedPropertyIndices
        • §2.5.6.2 Named properties
          • [x] @NamedPropertyGetter
          • [x] @NamedPropertySetter
          • [x] @NamedPropertyDeleter
          • [x] @NamedPropertyDeterminator
          • [x] @NewNamedPropertySetter
          • [x] @ExistingNamedPropertySetter
          • [x] @ExistingNamedPropertyDeleter
          • [x] @SupportedPropertyNames
        • ...
      • ...
    • ...
  • §3 ECMAScript binding
    • §3.4 Legacy extended attributes
      • §3.4.9 [LegacyUnenumerableNamedProperties]
        • [x] @LegacyUnenumerableNamedProperties
      • ...
    • ...
  • ...

License

MIT