Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a new event

Hierarchy

Index

Constructors

constructor

  • new Event(name?: string): Event
  • Parameters

    • name: string = "event"

    Returns Event

Properties

map

map: Map<number, IListener>

For backward compatability and performance reasons Manager use Map to store data

name

name: string

The name of the event

Accessors

length

  • get length(): number
  • An alias for size

    Returns number

size

  • get size(): number
  • Returns the total number of items stored in the Manager

    Returns number

Methods

[iterator]

  • [iterator](): IterableIterator<[number, IListener]>

add

  • Adds a value to Manager, and uses the current size of the Manager as it's key, it works best when all the key in the Manager are numbers

    Parameters

    Returns Manager<number, IListener>

clear

  • Clear the Manager of all its contents

    Returns Manager<number, IListener>

delete

  • delete(key: number): boolean
  • Removes a value stored in the Manager via a key, returns true if an element in the Map object existed and has been removed, or false if the element does not exist

    Parameters

    • key: number

    Returns boolean

entries

  • entries(): IterableIterator<[number, IListener]>
  • Returns a new Iterator object that contains an array of [key, value] for each element in the Map object in insertion order.

    Returns IterableIterator<[number, IListener]>

forEach

  • forEach(callback: (value?: IListener, key?: number, map?: Map<number, IListener>) => void, context?: object): Manager<number, IListener>
  • Iterates through the Managers contents, calling a callback function every iteration

    Parameters

    • callback: (value?: IListener, key?: number, map?: Map<number, IListener>) => void
    • Optional context: object

    Returns Manager<number, IListener>

get

  • Get a value stored in the Manager

    Parameters

    • key: number

    Returns IListener

getMap

  • Returns the Manager classes base Map

    Returns Map<number, IListener>

has

  • has(key: number): boolean
  • Checks if the Manager contains a certain key

    Parameters

    • key: number

    Returns boolean

keys

  • keys(): number[]
  • Returns the keys of all items stored in the Manager as an Array

    Returns number[]

last

  • Returns the last item in the Manager who's index is a certain distance from the last item in the Manager

    Parameters

    • distance: number = 1

    Returns IListener

remove

  • remove(key: number): Manager<number, IListener>
  • Removes a value stored in the Manager via a key, returns the Manager class, allowing for chains

    Parameters

    • key: number

    Returns Manager<number, IListener>

set

  • Set a value to the Manager using a key

    Parameters

    Returns Manager<number, IListener>

values

  • Returns the values of all items stored in the Manager as an Array

    Returns IListener[]

Generated using TypeDoc