MaddEventListener
Bun

method

AbstractWorker.addEventListener

addEventListener<K extends 'error'>(
type: K,
listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any,
options?: boolean | AddEventListenerOptions
): void;
type: string,
options?: boolean | AddEventListenerOptions
): void;

Referenced types

interface AddEventListenerOptions

  • capture?: boolean
  • once?: boolean

    When true, the listener is automatically removed when it is first invoked. Default: false.

  • passive?: boolean

    When true, serves as a hint that the listener will not call the Event object's preventDefault() method. Default: false.