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

typed-emitter

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typed-emitter - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

2

index.d.ts

@@ -1,2 +0,2 @@

type Arguments<T> = [T] extends [(...args: infer U) => any]
export type Arguments<T> = [T] extends [(...args: infer U) => any]
? U

@@ -3,0 +3,0 @@ : [T] extends [void] ? [] : [T]

{
"name": "typed-emitter",
"version": "1.2.0",
"version": "1.3.0",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "Strictly typed event emitter interface for TypeScript 3.",

@@ -13,6 +13,6 @@ # Typed-Emitter

```sh
$ npm install typed-emitter
$ npm install --save-dev typed-emitter
# Using yarn:
$ yarn add typed-emitter
$ yarn add --dev typed-emitter
```

@@ -51,2 +51,20 @@

## Extending an emitter
You might find yourself in a situation where you need to extend an event emitter, but also want to strictly type its events. Here is how to.
```ts
class MyEventEmitter extends (EventEmitter as new () => TypedEmitter<MyEvents>) {
// ...
}
```
As a generic class:
```ts
class MyEventEmitter<T> extends (EventEmitter as { new<T>(): TypedEmitter<T> })<T> {
// ...
}
```
## Why another package?

@@ -60,5 +78,4 @@

## License
MIT
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