index.d.ts 407 B

1234567
  1. /// <reference types="node" />
  2. import { EventEmitter } from 'events';
  3. import { EventNames, EventListenerParameters, AbortSignal } from './types';
  4. export interface OnceOptions {
  5. signal?: AbortSignal;
  6. }
  7. export default function once<Emitter extends EventEmitter, Event extends EventNames<Emitter>>(emitter: Emitter, name: Event, { signal }?: OnceOptions): Promise<EventListenerParameters<Emitter, Event>>;