🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@hydroperx/event

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hydroperx/event

Statically typed event facilities.

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

Event

Getting started

The following program defines play and stop events.

import { EventRecord, EventTarget } from "@hydroperx/event";

// media player
class MediaPlayer extends EventTarget {
    // declare events
    declare [EventRecord]: {
        play: MediaPlayerEvent,
        stop: MediaPlayerEvent,
    };
}

Extending MediaPlayer with more events:

// media player
class MoreSpecializedPlayer extends MediaPlayer {
    // declare events
    declare [EventRecord]: MediaPlayer[typeof EventRecord] & {
        // more events...
    };
}

Note that event types must implement the Event interface.

Keywords

event

FAQs

Package last updated on 06 Dec 2025

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