@types/ee-first
TypeScript definitions for ee-first
Last updated 8 months ago by types .
MIT · Repository · Original npm · Tarball · package.json
$ npm install @types/ee-first 
SYNC missed versions from official npm registry.

Installation

npm install --save @types/ee-first

Summary

This package contains type definitions for ee-first (https://github.com/jonathanong/ee-first).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ee-first.

index.d.ts

/// <reference types="node" />

import { EventEmitter } from "events";

export = first;

/**
 * Get the first event in a set of event emitters and event pairs, then clean up after itself.
 * Invoke `listener` on the first event from the list specified in `eventSpec`.
 *
 * @param eventSpec Array of arrays, with each array in the format `[ee, ...event]`.
 * @param listener Will be called only once, the first time any of the given events are emitted.
 * If `error` is one of the listened events, then if that fires first, the `listener` will be given the `err` argument.
 * `listener`'s arguments:
 * - `err`: the first argument emitted from an error event, if applicable
 * - `ee`: the event emitter that fired
 * - `event`: the string event name that fired
 * - `args`: an array of the arguments that were emitted on the event
 */
declare function first<TEmitter extends EventEmitter>(
    eventSpec: Array<[TEmitter, ...string[]]>,
    listener: first.Listener<TEmitter>,
): first.Thunk<TEmitter>;

declare namespace first {
    type Listener<TEmitter extends EventEmitter> = (
        err: any,
        ee: TEmitter,
        event: string,
        args: any[],
    ) => void;

    interface Thunk<TEmitter extends EventEmitter> {
        (listener: Listener<TEmitter>): void;

        /**
         * The group of listeners can be cancelled before being invoked and have all the event listeners removed
         * from the underlying event emitters.
         */
        cancel(): void;
    }
}

Additional Details

  • Last updated: Fri, 03 Apr 2026 00:13:39 GMT
  • Dependencies: @types/node

Credits

These definitions were written by BendingBender.

Current Tags

  • 1.1.4                                ...           latest (8 months ago)
  • 1.1.0                                ...           ts3.0 (8 years ago)
  • 1.1.0                                ...           ts3.1 (8 years ago)
  • 1.1.0                                ...           ts3.2 (8 years ago)
  • 1.1.0                                ...           ts3.3 (8 years ago)
  • 1.1.0                                ...           ts3.4 (8 years ago)
  • 1.1.0                                ...           ts3.5 (8 years ago)
  • 1.1.0                                ...           ts3.6 (8 years ago)
  • 1.1.0                                ...           ts3.7 (8 years ago)
  • 1.1.0                                ...           ts3.8 (8 years ago)
  • 1.1.0                                ...           ts3.9 (8 years ago)
  • 1.1.0                                ...           ts4.0 (8 years ago)
  • 1.1.0                                ...           ts4.1 (8 years ago)
  • 1.1.0                                ...           ts4.2 (8 years ago)
  • 1.1.0                                ...           ts4.3 (8 years ago)
  • 1.1.0                                ...           ts4.4 (8 years ago)
  • 1.1.3                                ...           ts4.5 (3 years ago)
  • 1.1.3                                ...           ts4.6 (3 years ago)
  • 1.1.3                                ...           ts4.7 (3 years ago)
  • 1.1.3                                ...           ts4.8 (3 years ago)
  • 1.1.3                                ...           ts4.9 (3 years ago)
  • 1.1.3                                ...           ts5.0 (3 years ago)
  • 1.1.3                                ...           ts5.1 (3 years ago)
  • 1.1.3                                ...           ts5.2 (3 years ago)
  • 1.1.4                                ...           ts5.3 (8 months ago)
  • 1.1.4                                ...           ts5.4 (8 months ago)
  • 1.1.4                                ...           ts5.5 (8 months ago)
  • 1.1.4                                ...           ts5.6 (8 months ago)
  • 1.1.4                                ...           ts5.7 (8 months ago)
  • 1.1.4                                ...           ts5.8 (8 months ago)
  • 1.1.4                                ...           ts5.9 (8 months ago)
  • 1.1.4                                ...           ts6.0 (8 months ago)
  • 1.1.4                                ...           ts7.0 (8 months ago)
  • 1.1.4                                ...           ts7.1 (8 months ago)

5 Versions

  • 1.1.4                                ...           8 months ago
  • 1.1.3                                ...           3 years ago
  • 1.1.2                                ...           3 years ago
  • 1.1.1                                ...           3 years ago
  • 1.1.0                                ...           8 years ago
Maintainers (1)
Downloads
Total 18
Today 0
This Week 0
This Month 14
Last Day 0
Last Week 6
Last Month 4
Dependencies (1)
Dev Dependencies (0)
None
Dependents (0)
None

© 2010 - cnpmjs.org x YWFE | Home | YWFE