Options
All
  • Public
  • Public/Protected
  • All
Menu

Minimal EventEmitter interface that is molded against the Node.js EventEmitter interface.

Hierarchy

Index

Methods

Protected callListener

  • callListener(listener: Function, context: Object, params: any[]): any
  • Callback executor for overriding.

    Parameters

    • listener: Function
    • context: Object
    • params: any[]

    Returns any

emit

  • emit(event: string, ...args: any[]): boolean
  • Emit an event to all registered event listeners.

    Parameters

    • event: string
    • Rest ...args: any[]

    Returns boolean

listeners

  • listeners(event: string): Function[]
  • Return a list of assigned event listeners.

    Parameters

    • event: string

    Returns Function[]

on

  • on(event: string, fn: Function, context?: Object): this
  • Register a new EventListener for the given event.

    Parameters

    • event: string
    • fn: Function
    • Optional context: Object

    Returns this

once

  • once(event: string, fn: Function, context?: Object): this
  • Add an EventListener that's only called once.

    Parameters

    • event: string
    • fn: Function
    • Optional context: Object

    Returns this

removeAllListeners

  • removeAllListeners(event: string): this
  • Remove all listeners or only the listeners for the specified event.

    Parameters

    • event: string

    Returns this

removeListener

  • removeListener(event: string, fn: Function, once?: boolean): this
  • Remove event listeners.

    Parameters

    • event: string
    • fn: Function
    • Default value once: boolean = false

    Returns this

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc