UNPKG

three-game-engine

Version:

Simple light-weight game engine using three.js, three-mesh-ui and rapier

18 lines (17 loc) 587 B
interface EventListenerMap { [eventName: string]: ((args: any) => void)[]; } /** * To reduce dependenciese on third party sources, here is a simplistic event emitter * class that can be used to emit, and listen for events. */ declare class EventEmitter { eventListeners: EventListenerMap; oneTimeListeners: EventListenerMap; constructor(); emit(eventName: string, args?: any): void; addEventListener(eventName: any, fn: any): void; once(eventName: any, fn: any): void; removeEventListener(eventName: any, fn: any): void; } export default EventEmitter;