@types/events

  • Version 3.0.3
  • Published
  • 4.77 kB
  • No dependencies
  • MIT license

Install

npm i @types/events
yarn add @types/events
pnpm add @types/events

Overview

TypeScript definitions for events

Index

Classes

class EventEmitter

class EventEmitter {}

    property defaultMaxListeners

    static defaultMaxListeners: number;

      method addListener

      addListener: (type: string | number, listener: Listener) => this;

        method emit

        emit: (type: string | number, ...args: any[]) => boolean;

          method eventNames

          eventNames: () => Array<string | number>;

            method getMaxListeners

            getMaxListeners: () => number;

              method listenerCount

              static listenerCount: (emitter: EventEmitter, type: string | number) => number;

                method listeners

                listeners: (type: string | number) => Listener[];

                  method off

                  off: (type: string | number, listener: Listener) => this;

                    method on

                    on: (type: string | number, listener: Listener) => this;

                      method once

                      once: (type: string | number, listener: Listener) => this;

                        method prependListener

                        prependListener: (type: string | number, listener: Listener) => this;

                          method prependOnceListener

                          prependOnceListener: (type: string | number, listener: Listener) => this;

                            method rawListeners

                            rawListeners: (type: string | number) => Listener[];

                              method removeAllListeners

                              removeAllListeners: (type?: string | number) => this;

                                method removeListener

                                removeListener: (type: string | number, listener: Listener) => this;

                                  method setMaxListeners

                                  setMaxListeners: (n: number) => this;

                                    Type Aliases

                                    type Listener

                                    type Listener = (...args: any[]) => void;

                                      Package Files (1)

                                      Dependencies (0)

                                      No dependencies.

                                      Dev Dependencies (0)

                                      No dev dependencies.

                                      Peer Dependencies (0)

                                      No peer dependencies.

                                      Badge

                                      To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                      You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/events.

                                      • Markdown
                                        [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/events)
                                      • HTML
                                        <a href="https://www.jsdocs.io/package/@types/events"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>